.h6scf-wrap {
  max-width: 1120px;
}

.h6scf-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin: 18px 0 20px;
}

.h6scf-header h1 {
  margin: 0 0 8px;
}

.h6scf-intro {
  max-width: 760px;
  margin: 0;
  color: #50575e;
  font-size: 14px;
  line-height: 1.6;
}

.h6scf-form {
  margin-top: 0;
}

.h6scf-card,
.h6scf-status-card {
  box-sizing: border-box;
  margin: 0 0 20px;
  padding: 24px;
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.h6scf-card-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f0f1;
}

.h6scf-card-header-action {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.h6scf-card-header-action > div {
  min-width: 0;
}

.h6scf-card-header h2 {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.35;
}

.h6scf-card-header p,
.h6scf-status-copy p,
.h6scf-section-heading p,
.h6scf-modal-header p {
  margin: 0;
  color: #646970;
  line-height: 1.55;
}

.h6scf-status-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.h6scf-status-card.is-enabled {
  border-color: #b8e6bf;
  background: #f6fff7;
}

.h6scf-status-card.is-disabled {
  background: #fcfcfc;
}

.h6scf-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f0f0f1;
  font-size: 12px;
  font-weight: 600;
}

.is-enabled .h6scf-status-badge {
  background: #dff6e3;
  color: #0a5c22;
}

.h6scf-status-copy strong {
  display: block;
  margin: 0 0 4px;
  font-size: 15px;
}

.h6scf-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  cursor: pointer;
}

.h6scf-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.h6scf-switch-ui {
  position: relative;
  display: inline-block;
  flex: 0 0 44px;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #8c8f94;
  transition: background 0.18s ease;
}

.h6scf-switch-ui::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.18s ease;
}

.h6scf-switch input:checked + .h6scf-switch-ui {
  background: #2271b1;
}

.h6scf-switch input:checked + .h6scf-switch-ui::before {
  transform: translateX(20px);
}

.h6scf-switch-text {
  font-weight: 600;
  color: #1d2327;
}

/* Tabs */

.h6scf-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
  padding: 0;
  border-bottom: 1px solid #f0f0f1;
}

.h6scf-tab {
  appearance: none;
  min-height: 40px;
  margin: 0 0 -1px;
  padding: 10px 16px;
  border: 1px solid #dcdcde;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: #f6f7f7;
  color: #2c3338;
  font-weight: 600;
  cursor: pointer;
}

.h6scf-tab:hover {
  background: #fff;
  border-color: #c3c4c7;
  color: #1d2327;
}

.h6scf-tab.is-active {
  background: #fff;
  border-color: #dcdcde;
  color: #1d2327;
  box-shadow: 0 -1px 0 #fff inset;
}

.h6scf-tab-panel {
  display: none;
}

.h6scf-tab-panel.is-active {
  display: block;
}

/* Section headings */

.h6scf-field-group {
  padding: 0;
  border-top: 0;
}

.h6scf-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin: 0 0 16px;
  padding: 0 0 16px;
  border-bottom: 1px solid #f0f0f1;
}

.h6scf-section-heading h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  text-transform: none;
}

.h6scf-section-heading p {
  max-width: 520px;
}

/* Add field button */

.h6scf-add-toggle {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  margin-top: 2px !important;
  white-space: nowrap;
}

.h6scf-add-toggle span {
  font-size: 18px;
  line-height: 1;
}

/* Field builder */

.h6scf-table-scroll {
  overflow-x: auto;
  max-width: 100%;
}

.h6scf-table {
  margin: 0;
  border: 0 !important;
  background: transparent;
  box-shadow: none;
}

.h6scf-table thead {
  display: none;
}

.h6scf-table tbody {
  display: block;
}

.h6scf-table tr.h6scf-builder-row {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) 90px minmax(180px, 1.25fr) minmax(180px, 1.25fr) 90px 90px;
  gap: 12px;
  align-items: center;
  margin: 0 0 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.h6scf-table tr.h6scf-builder-row:hover {
  border-color: #b8c4ce;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.h6scf-table tr.h6scf-builder-row td {
  display: block;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  vertical-align: middle;
}

.h6scf-field-cell {
  display: flex !important;
  align-items: flex-start;
  gap: 12px;
}

.h6scf-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  margin-right: 0 !important;
  border: 1px solid #dcdcde;
  border-radius: 8px;
  background: #f6f7f7;
  color: #646970;
  font-size: 15px;
  line-height: 1;
  cursor: grab;
}

.h6scf-field-summary {
  min-width: 0;
}

.h6scf-field-title {
  display: block;
  margin: 0 0 3px;
  color: #1d2327;
  font-size: 14px;
}

.h6scf-field-key {
  display: block;
  margin-bottom: 8px;
  color: #646970;
}

.h6scf-field-key code {
  padding: 0;
  border: 0;
  background: transparent;
  color: #646970;
}

.h6scf-custom-row {
  background: #fff !important;
}

.h6scf-priority-display {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 5px 8px;
  border: 1px solid #dcdcde;
  border-radius: 6px;
  background: #fff;
  color: #2c3338;
}

/* Badges */

.h6scf-badge-row {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center;
  gap: 6px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: 0 !important;
}

.h6scf-badge-row::before,
.h6scf-badge-row::after {
  display: none !important;
}

.h6scf-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid #dcdcde;
  border-radius: 999px;
  background: #f0f0f1;
  color: #3c434a;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.h6scf-badge.is-muted {
  background: #f6f7f7;
  color: #646970;
}

.h6scf-badge.is-type {
  background: #eef6fc;
  border-color: #c5d9ed;
  color: #135e96;
}

.h6scf-badge.is-custom {
  background: #f7f1ff;
  border-color: #d8c9f1;
  color: #573b86;
}

.h6scf-badge.is-required {
  background: #fff8e5;
  border-color: #f0d98d;
  color: #6f4e00;
}

.h6scf-badge.is-disabled {
  background: #f6f7f7;
  border-color: #dcdcde;
  color: #8c8f94;
  text-decoration: line-through;
}

/* Form controls */

.h6scf-table input[type="text"],
.h6scf-table input[type="number"],
.h6scf-table select,
.h6scf-table textarea,
.h6scf-editor-grid input[type="text"],
.h6scf-editor-grid select,
.h6scf-editor-grid textarea {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  border-color: #c3c4c7;
  border-radius: 6px;
}

.h6scf-table .regular-text {
  width: 100%;
  max-width: 320px;
}

.h6scf-table textarea.h6scf-options,
.h6scf-editor-grid textarea.h6scf-options {
  display: none;
  min-height: 96px;
}

.h6scf-table input.h6scf-placeholder {
  display: block;
  width: 100%;
  max-width: 420px;
}

.h6scf-field-control,
.h6scf-checkbox-control {
  display: block;
  margin: 0;
}

.h6scf-field-control > span {
  display: block;
  margin: 0 0 5px;
  color: #646970;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  text-transform: uppercase;
}

.h6scf-checkbox-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  color: #1d2327;
  font-weight: 600;
}

.h6scf-checkbox-control input[type="checkbox"] {
  margin: 0;
}

/* Row actions and editor */

.h6scf-row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.h6scf-delete-custom.button {
  background: #fff;
  border-color: #b32d2e;
  color: #b32d2e;
  box-shadow: none;
}

.h6scf-delete-custom.button:hover,
.h6scf-delete-custom.button:focus {
  background: #b32d2e;
  border-color: #b32d2e;
  color: #fff;
}

.h6scf-custom-summary-row.is-editing {
  grid-template-columns: 1fr !important;
}

.h6scf-custom-summary-row.is-editing > td:not(:first-child) {
  display: none !important;
}

.h6scf-custom-editor {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #dcdcde;
  border-radius: 10px;
  background: #f6f7f7;
}

.h6scf-custom-editor[hidden] {
  display: none !important;
}

.h6scf-editor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.h6scf-editor-grid label,
.h6scf-editor-checks label {
  display: block;
  margin: 0;
}

.h6scf-editor-grid label span {
  display: block;
  margin: 0 0 6px;
  color: #1d2327;
  font-weight: 600;
}

.h6scf-editor-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #dcdcde;
}

.h6scf-editor-display {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin: 14px 0 0;
  padding: 14px 0 0;
  border: 0;
  border-top: 1px solid #dcdcde;
}

.h6scf-editor-display legend {
  width: 100%;
  margin: 0 0 2px;
  padding: 0;
  color: #1d2327;
  font-weight: 600;
}

.h6scf-editor-display label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
}

.h6scf-editor-display input[type="checkbox"] {
  margin: 0;
}

.h6scf-editor-actions {
  margin: 16px 0 0;
}

.h6scf-help-text {
  margin: 14px 0 0;
  color: #646970;
  font-style: italic;
}

/* Modal */

body.h6scf-modal-open {
  overflow: hidden;
}

.h6scf-modal[hidden] {
  display: none !important;
}

.h6scf-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 24px;
}

.h6scf-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
}

.h6scf-modal-dialog {
  position: relative;
  width: min(860px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
}

.h6scf-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid #f0f0f1;
}

.h6scf-modal-header h3 {
  margin: 0 0 6px;
  color: #1d2327;
  font-size: 18px;
  line-height: 1.35;
}

.h6scf-modal-header p {
  max-width: 650px;
}

.h6scf-modal-close {
  min-width: 28px;
  margin: 0;
  padding: 0;
  color: #646970;
  font-size: 28px;
  line-height: 1;
  text-align: center;
  text-decoration: none !important;
  box-shadow: none !important;
  outline: none !important;
}

.h6scf-modal-close:hover,
.h6scf-modal-close:focus,
.h6scf-modal-close:active {
  color: #1d2327;
  text-decoration: none !important;
  box-shadow: none !important;
  outline: none !important;
}

.h6scf-modal-body {
  padding: 24px;
}

.h6scf-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid #f0f0f1;
  border-radius: 0 0 14px 14px;
  background: #f6f7f7;
}

.h6scf-modal .h6scf-custom-editor {
  margin: 0;
  padding: 0;
  border: 0;
  background: #fff;
}

.h6scf-modal .h6scf-editor-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.h6scf-modal .h6scf-help-text {
  margin: 16px 0 0;
}

/* Save actions */

.h6scf-button-row {
  margin: 16px 0 0;
}

.h6scf-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  flex-wrap: wrap;
  margin: 24px 0 12px;
}

.h6scf-actions .button-primary {
  min-height: 34px;
  padding-right: 16px;
  padding-left: 16px;
}

.h6scf-reset-fields.button {
  min-height: 34px;
  border-color: #b32d2e;
  color: #b32d2e;
}

.h6scf-reset-fields.button:hover,
.h6scf-reset-fields.button:focus {
  border-color: #8a2424;
  color: #8a2424;
}

/* Responsive */

@media (max-width: 1180px) {
  .h6scf-card-header-action {
    display: block;
  }

  .h6scf-add-toggle {
    margin-top: 14px !important;
  }

  .h6scf-table tr.h6scf-builder-row {
    grid-template-columns: 1fr 90px 1fr;
  }
}

@media (max-width: 900px) {
  .h6scf-header,
  .h6scf-status-card {
    flex-direction: column;
  }

  .h6scf-editor-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 782px) {
  .h6scf-tabs {
    border-bottom: 0;
  }

  .h6scf-tab {
    flex: 1 1 auto;
    margin: 0;
    border: 1px solid #dcdcde;
    border-radius: 8px;
  }

  .h6scf-section-heading {
    display: block;
  }

  .h6scf-section-heading p {
    margin-top: 6px;
  }

  .h6scf-table tr.h6scf-builder-row {
    display: block;
  }

  .h6scf-table tr.h6scf-builder-row td {
    margin-bottom: 12px;
  }

  .h6scf-table tr.h6scf-builder-row td:last-child {
    margin-bottom: 0;
  }

  .h6scf-modal {
    padding: 12px;
  }

  .h6scf-modal-dialog {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }

  .h6scf-modal-header,
  .h6scf-modal-body,
  .h6scf-modal-footer {
    padding-right: 16px;
    padding-left: 16px;
  }

  .h6scf-modal .h6scf-editor-grid {
    grid-template-columns: 1fr;
  }
}

/* -----------------------------------------------------------------------
 * v2 field editor: validation + conditional logic
 * --------------------------------------------------------------------- */
.h6scf-editor-validation,
.h6scf-editor-conditional {
	margin: 12px 0;
	padding: 12px;
	border: 1px solid #f0f0f1;
	border-radius: 8px;
	background: #fbfbfc;
}
.h6scf-editor-validation > strong,
.h6scf-editor-conditional > strong {
	display: block;
	margin-bottom: 8px;
}
.h6scf-validation-grid,
.h6scf-conditional-grid {
	display: flex;
	gap: 14px;
	flex-wrap: wrap;
}
.h6scf-validation-grid label,
.h6scf-conditional-grid label {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-weight: 600;
}
.h6scf-conditional-grid label { flex: 1 1 160px; }
.h6scf-conditional-grid input,
.h6scf-conditional-grid select { width: 100%; }
.h6scf-heading-field .h6scf-field-heading { margin: 0 0 4px; }

/* -----------------------------------------------------------------------
 * v2 file upload field settings
 * --------------------------------------------------------------------- */
.h6scf-editor-file {
	margin: 12px 0;
	padding: 12px;
	border: 1px solid #f0f0f1;
	border-radius: 8px;
	background: #fbfbfc;
}
.h6scf-editor-file > strong { display: block; margin-bottom: 8px; }
.h6scf-file-grid { display: flex; gap: 14px; flex-wrap: wrap; }
.h6scf-file-grid label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
