.chc-customizer-page,
.chc-custom-embed-page {
  --chc-blue: #2563EB;
  --chc-blue-dark: #1D4ED8;
  --chc-navy: #142235;
  --chc-muted: #64748B;
  --chc-border: #DCE4EE;
  --chc-soft-blue: #EFF6FF;
  --chc-soft-teal: #ECFDF9;
}

.chc-customizer-page {
  background: #F8FAFC;
}

.chc-customizer-main {
  overflow: hidden;
}

.chc-customizer-hero {
  padding: 2rem 0 2.25rem;
  border-bottom: 1px solid #DCEBFF;
  background:
    radial-gradient(circle at 88% 18%, rgba(18, 184, 166, 0.14), transparent 22rem),
    linear-gradient(135deg, #FFFFFF, #EAF3FF);
}

.chc-customizer-hero .spt-container {
  max-width: 1180px;
}

.chc-customizer-hero h1 {
  max-width: 820px;
  margin: 0.7rem 0 0.65rem;
  color: #0F172A;
  font-size: clamp(2.15rem, 5vw, 3.6rem);
  font-weight: 950;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.chc-customizer-hero p {
  max-width: 760px;
  margin: 0;
  color: #475569;
  font-size: 1.08rem;
  line-height: 1.65;
}

.chc-back-link {
  display: block;
  width: fit-content;
  margin-bottom: 0.85rem;
  color: #1764C8;
  font-weight: 800;
}

.chc-customizer-section {
  padding: 1.8rem 0 3rem;
}

.chc-customizer-section > .spt-container {
  max-width: 1280px;
}

.chc-customizer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(380px, 0.94fr);
  gap: 1.25rem;
  align-items: start;
}

.chc-panel {
  min-width: 0;
  padding: 1.4rem;
  border: 1px solid var(--chc-border);
  border-radius: 20px;
  background: #FFFFFF;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
}

.chc-panel-heading {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.chc-panel-heading h2 {
  margin: 0.15rem 0 0;
  color: #0F172A;
  font-size: clamp(1.35rem, 2.5vw, 1.8rem);
  line-height: 1.2;
}

.chc-eyebrow {
  color: #1764C8;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.chc-currency-badge,
.chc-live-pill {
  display: inline-flex;
  min-height: 31px;
  padding: 0.3rem 0.7rem;
  align-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  color: #0F5F57;
  background: var(--chc-soft-teal);
  font-size: 0.8rem;
  font-weight: 900;
}

.chc-starter-note {
  padding: 0.8rem 0.9rem;
  margin: 0 0 1rem;
  border: 1px solid #BFDBFE;
  border-radius: 12px;
  color: #334155;
  background: var(--chc-soft-blue);
  font-size: 0.9rem;
  line-height: 1.5;
}

.chc-config-section {
  min-width: 0;
  padding: 1.1rem 0;
  margin: 0;
  border: 0;
  border-top: 1px solid #E2E8F0;
}

.chc-config-section:first-of-type {
  padding-top: 0.25rem;
  border-top: 0;
}

.chc-config-section > legend {
  padding: 0;
  margin-bottom: 0.7rem;
  color: #0F172A;
  font-size: 1.04rem;
  font-weight: 900;
}

.chc-config-section > p {
  margin: -0.35rem 0 0.85rem;
  color: var(--chc-muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.chc-config-grid,
.chc-adjustment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.chc-adjustment-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.chc-field {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  align-content: start;
}

.chc-field-wide {
  grid-column: 1 / -1;
}

.chc-field label,
.chc-label,
.chc-generate-panel > label {
  color: #1E293B;
  font-size: 0.88rem;
  font-weight: 850;
}

.chc-field label span {
  color: var(--chc-muted);
  font-weight: 650;
}

.chc-field input[type="text"],
.chc-field input[type="number"],
.chc-readonly-value,
.chc-embed-code-output {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 0.7rem 0.8rem;
  border: 1px solid #CBD5E1;
  border-radius: 11px;
  color: #0F172A;
  background: #FFFFFF;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.035);
}

.chc-field input:focus-visible,
.chc-embed-code-output:focus-visible,
.chc-switch-row input:focus-visible + .chc-switch-control,
.chc-addon-toggle input:focus-visible {
  border-color: var(--chc-blue);
  outline: 3px solid rgba(37, 99, 235, 0.16);
  outline-offset: 1px;
}

.chc-field input[aria-invalid="true"] {
  border-color: #B42318;
}

.chc-field small {
  color: var(--chc-muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.chc-readonly-value {
  display: flex;
  align-items: center;
  color: #334155;
  background: #F8FAFC;
  font-weight: 800;
}

.chc-field-error {
  min-height: 1.1em;
  color: #B42318;
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.25;
}

.chc-field-error:empty {
  display: none;
}

.chc-number-control {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  min-width: 0;
  border: 1px solid #CBD5E1;
  border-radius: 11px;
  background: #FFFFFF;
  overflow: hidden;
}

.chc-number-control:focus-within {
  border-color: var(--chc-blue);
  outline: 3px solid rgba(37, 99, 235, 0.16);
  outline-offset: 1px;
}

.chc-number-control > span {
  display: flex;
  min-width: 42px;
  align-items: center;
  justify-content: center;
  color: #475569;
  background: #F1F5F9;
  font-weight: 850;
}

.chc-number-control input[type="number"] {
  min-height: 44px;
  padding: 0.65rem 0.75rem;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  outline: 0;
}

.chc-percent-control {
  grid-template-columns: minmax(0, 1fr) auto;
}

.chc-rate-list,
.chc-addon-config-list {
  display: grid;
  gap: 0.75rem;
}

.chc-rate-row,
.chc-addon-config {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.45fr);
  gap: 1rem;
  align-items: center;
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid #E2E8F0;
  border-radius: 13px;
  background: #FBFDFF;
}

.chc-switch-row {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  cursor: pointer;
}

.chc-switch-row > span:first-child {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.chc-switch-row strong {
  color: #0F172A;
  font-size: 0.9rem;
}

.chc-switch-row small {
  color: var(--chc-muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.chc-switch-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.chc-switch-control {
  position: relative;
  width: 46px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #94A3B8;
  transition: background 150ms ease;
}

.chc-switch-control::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
  transition: transform 150ms ease;
}

.chc-switch-row input:checked + .chc-switch-control {
  background: var(--chc-blue);
}

.chc-switch-row input:checked + .chc-switch-control::after {
  transform: translateX(20px);
}

.chc-config-rate.is-disabled {
  opacity: 0.55;
}

.chc-addon-toggle {
  display: flex;
  min-height: 44px;
  gap: 0.65rem;
  align-items: center;
  color: #0F172A;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
}

.chc-addon-toggle input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  accent-color: var(--chc-blue);
}

.chc-config-footer {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid #E2E8F0;
}

.chc-save-status,
.chc-action-status {
  margin: 0;
  color: #475569;
  font-size: 0.86rem;
  line-height: 1.5;
}

.chc-preview-panel {
  position: sticky;
  top: 94px;
}

.chc-preview-frame {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #D7E0EA;
  border-radius: 16px;
  background: #F8FAFC;
}

.chc-widget-heading {
  padding: 1rem 1rem 0;
}

.chc-widget-heading h3 {
  margin: 0;
  color: #0F172A;
  font-size: 1.18rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.chc-widget-heading p {
  margin: 0.35rem 0 0;
  color: var(--chc-muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.chc-preview-frame .chc-calculator-grid {
  grid-template-areas: "form" "results";
  grid-template-columns: minmax(0, 1fr);
  gap: 0.8rem;
  padding: 1rem;
  margin: 0;
}

.chc-preview-frame .hc-form-card,
.chc-preview-frame .hc-results-card {
  position: static;
  min-width: 0;
  padding: 1rem;
  border-radius: 14px;
  box-shadow: none;
}

.chc-preview-frame .hc-form-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
}

.chc-preview-frame .hc-check-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chc-widget .hc-input-group select {
  min-height: 44px;
}

.chc-widget .hc-range-group input[type="range"] {
  min-height: 34px;
}

.chc-widget .hc-check-option {
  min-height: 44px;
}

.chc-widget .hc-form-heading h2 {
  font-size: 0.86rem;
}

.chc-widget .chc-results .hc-featured-result {
  min-height: 104px;
}

.chc-widget .chc-results .hc-featured-result strong {
  font-size: clamp(2.2rem, 8vw, 3.35rem);
}

.chc-generate-panel {
  margin-top: 1.25rem;
}

.chc-generate-panel > p {
  margin: 0 0 1rem;
  color: #475569;
  line-height: 1.6;
}

.chc-embed-code-output {
  display: block;
  min-height: 176px;
  margin-top: 0.45rem;
  resize: vertical;
  color: #1E293B;
  background: #F8FAFC;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.5;
  overflow-wrap: normal;
  white-space: pre;
}

.chc-generate-actions,
.chc-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.chc-generate-actions button,
.chc-dialog-actions button {
  cursor: pointer;
}

.chc-action-status {
  min-height: 1.5rem;
  margin-top: 0.65rem;
  color: #1764C8;
  font-weight: 750;
}

.chc-update-warning {
  padding: 0.95rem 1rem;
  margin-top: 0.6rem;
  border: 1px solid #F6C453;
  border-radius: 12px;
  color: #5C4300;
  background: #FFF9E8;
  line-height: 1.55;
}

.chc-reset-dialog {
  width: min(92vw, 480px);
  padding: 1.4rem;
  border: 1px solid #CBD5E1;
  border-radius: 18px;
  color: #0F172A;
  background: #FFFFFF;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

.chc-reset-dialog::backdrop {
  background: rgba(15, 23, 42, 0.56);
}

.chc-reset-dialog h2 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
}

.chc-reset-dialog p {
  margin: 0;
  color: #475569;
}

.chc-custom-embed-page [hidden] {
  display: none !important;
}

.chc-custom-embed-page .chc-embed-widget-root .hc-calculator-grid {
  margin: 0;
}

.chc-custom-embed-page .chc-results .hc-featured-result {
  min-height: 112px;
}

.chc-custom-embed-page .chc-results .hc-featured-result strong {
  font-size: clamp(2.35rem, 6vw, 3.5rem);
}

.chc-invalid-config {
  display: grid;
  gap: 0.8rem;
  justify-items: start;
  padding: clamp(1.5rem, 5vw, 3rem);
}

.chc-invalid-config h2,
.chc-invalid-config h1 {
  margin: 0;
  color: #0F172A;
  font-size: clamp(1.5rem, 5vw, 2.2rem);
}

.chc-invalid-config p {
  max-width: 600px;
  margin: 0;
  color: #475569;
  line-height: 1.6;
}

@media (max-width: 1020px) {
  .chc-customizer-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .chc-preview-panel {
    position: static;
  }
}

@media (max-width: 680px) {
  .chc-customizer-hero {
    padding: 1.4rem 0 1.6rem;
  }

  .chc-customizer-section {
    padding: 1rem 0 2rem;
  }

  .chc-panel {
    padding: 1rem;
    border-radius: 16px;
  }

  .chc-config-grid,
  .chc-adjustment-grid,
  .chc-adjustment-grid-three,
  .chc-rate-row,
  .chc-addon-config {
    grid-template-columns: minmax(0, 1fr);
  }

  .chc-field-wide {
    grid-column: auto;
  }

  .chc-config-footer,
  .chc-panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .chc-config-footer .hc-button,
  .chc-generate-actions .spt-button {
    width: 100%;
  }

  .chc-preview-frame .hc-check-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .chc-embed-code-output {
    font-size: 0.76rem;
  }
}

@media (max-width: 380px) {
  .chc-panel,
  .chc-preview-frame .chc-calculator-grid {
    padding: 0.8rem;
  }

  .chc-rate-row,
  .chc-addon-config {
    padding: 0.7rem;
  }

  .chc-switch-row {
    gap: 0.55rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chc-customizer-page *,
  .chc-customizer-page *::before,
  .chc-customizer-page *::after,
  .chc-custom-embed-page *,
  .chc-custom-embed-page *::before,
  .chc-custom-embed-page *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
