/* TDS Calculator — hero & tool widget */
.tds-page {
  --tds-navy: #061a31;
  --tds-navy-2: #0b2947;
  --tds-coral: #f45f58;
  --tds-coral-dark: #d94a44;
  --tds-ink: #10243a;
  --tds-muted: #5c6f82;
  --tds-line: #d9e2ea;
  --tds-green: #16825c;
  --tds-green-soft: #eaf7f1;
  --tds-amber: #9e650f;
  --tds-amber-soft: #fff7e8;
  --tds-shadow: 0 24px 70px rgba(4, 24, 46, 0.18);
}

.tds-page .hero-tool {
  position: relative;
  min-height: calc(100svh - 58px);
  display: flex;
  align-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 92% 8%, rgba(54, 107, 155, 0.36), transparent 32%),
    linear-gradient(135deg, var(--tds-navy) 0%, #081f39 58%, #0b2d50 100%);
  color: #fff;
}

.tds-page .grid-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.22;
  pointer-events: none;
  color: #fff;
}

.tds-page .page-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1850px;
  margin-inline: auto;
  padding-block: 24px 26px;
  padding-inline: clamp(24px, 5vw, 96px);
  display: grid;
  grid-template-columns: minmax(0, 0.62fr) minmax(0, 1.38fr);
  gap: clamp(32px, 4vw, 62px);
  align-items: center;
}

.tds-page .kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #ffaaa6;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.tds-page .kicker:before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--tds-coral);
}

.tds-page .intro h1 {
  max-width: 540px;
  margin: 0;
  font-size: clamp(2.45rem, 4.25vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: -0.058em;
  font-weight: 800;
  text-align: left;
}

.tds-page .intro h1 span {
  color: #ff817a;
}

.tds-page .intro-copy {
  max-width: 555px;
  margin: 18px 0 0;
  color: #c8d6e4;
  font-size: 0.94rem;
  line-height: 1.68;
}

.tds-page .proof {
  display: flex;
  flex-wrap: wrap;
  gap: 11px 18px;
  margin-top: 20px;
  color: #c6d5e3;
  font-size: 0.73rem;
  font-weight: 650;
}

.tds-page .proof span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.tds-page .proof svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: #57dda1;
  stroke-width: 2.4;
}

.tds-page .scope-note {
  margin-top: 22px;
  padding: 13px 15px;
  max-width: 560px;
  border-left: 3px solid var(--tds-coral);
  background: rgba(255, 255, 255, 0.07);
  color: #bdccda;
  font-size: 0.69rem;
  line-height: 1.55;
}

.tds-page .tool {
  min-width: 0;
  max-width: 100%;
  min-height: 640px;
  background: #fff;
  color: var(--tds-ink);
  box-shadow: var(--tds-shadow);
  border-top: 4px solid var(--tds-coral);
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.tds-page .tool-head {
  padding: 16px 19px 14px;
  border-bottom: 1px solid var(--tds-line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.tds-page .tool-head small {
  display: block;
  color: var(--tds-coral-dark);
  font-size: 0.63rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.tds-page .tool-head h2 {
  margin: 0;
  font-size: 1.12rem;
  letter-spacing: -0.025em;
  color: var(--tds-ink);
  text-align: left;
}

.tds-page .editable-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--tds-amber);
  font-size: 0.61rem;
  font-weight: 800;
  white-space: nowrap;
  background: var(--tds-amber-soft);
  padding: 7px 9px;
}

.tds-page .workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(0, 0.72fr);
  min-height: 0;
}

.tds-page .input-pane {
  padding: 17px 19px;
  border-right: 1px solid var(--tds-line);
  min-width: 0;
  overflow: auto;
}

.tds-page .section-label {
  display: block;
  margin-bottom: 8px;
  color: var(--tds-coral-dark);
  font-size: 0.57rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tds-page .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.tds-page .field.full {
  grid-column: 1 / -1;
}

.tds-page .field label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  color: var(--tds-muted);
  font-size: 0.51rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tds-page .field label span {
  color: #8996a3;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}

.tds-page .field input,
.tds-page .field select {
  width: 100%;
  height: 39px;
  border: 1px solid #cfd8e1;
  background: #fff;
  color: var(--tds-ink);
  padding: 0 10px;
  outline: none;
  font-size: 0.62rem;
  border-radius: 0;
}

.tds-page .field input:focus,
.tds-page .field select:focus {
  border-color: var(--tds-coral);
  box-shadow: 0 0 0 3px rgba(244, 95, 88, 0.1);
}

.tds-page .rate-row {
  display: grid;
  grid-template-columns: 1fr 0.68fr;
  gap: 9px;
  margin-top: 9px;
}

.tds-page .switches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 10px;
}

.tds-page .switch-card {
  padding: 10px;
  border: 1px solid var(--tds-line);
  background: #f9fafb;
}

.tds-page .switch-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.tds-page .switch-card strong {
  font-size: 0.61rem;
  color: var(--tds-ink);
}

.tds-page .switch-card p {
  margin: 4px 0 0;
  color: var(--tds-muted);
  font-size: 0.51rem;
  line-height: 1.4;
}

.tds-page .switch {
  position: relative;
  width: 34px;
  height: 18px;
  flex: 0 0 auto;
}

.tds-page .switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.tds-page .slider {
  position: absolute;
  inset: 0;
  background: #cbd4dc;
  transition: 0.18s;
  cursor: pointer;
}

.tds-page .slider:before {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  left: 3px;
  top: 3px;
  background: #fff;
  transition: 0.18s;
}

.tds-page .switch input:checked + .slider {
  background: var(--tds-coral);
}

.tds-page .switch input:checked + .slider:before {
  transform: translateX(16px);
}

.tds-page .interest-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--tds-line);
}

.tds-page .result-pane {
  padding: 17px;
  background: #f7f9fb;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tds-page .result-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.tds-page .result-head h3 {
  margin: 0;
  font-size: 0.78rem;
  color: var(--tds-ink);
  text-align: left;
}

.tds-page .status-chip {
  padding: 5px 7px;
  background: var(--tds-green-soft);
  color: var(--tds-green);
  font-size: 0.49rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.tds-page .status-chip.below-threshold {
  background: var(--tds-amber-soft);
  color: var(--tds-amber);
}

.tds-page .total-card {
  margin-top: 10px;
  padding: 16px;
  background: var(--tds-navy-2);
  color: #fff;
}

.tds-page .total-card small {
  display: block;
  color: #b9c9d7;
  font-size: 0.54rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.tds-page .total-card strong {
  display: block;
  margin-top: 4px;
  font-size: 1.75rem;
  line-height: 1;
  letter-spacing: -0.045em;
}

.tds-page .total-card p {
  margin: 7px 0 0;
  color: #c7d4df;
  font-size: 0.54rem;
  line-height: 1.4;
}

.tds-page .result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 9px;
}

.tds-page .result-box {
  padding: 10px;
  border: 1px solid var(--tds-line);
  background: #fff;
}

.tds-page .result-box small {
  display: block;
  color: var(--tds-muted);
  font-size: 0.47rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 800;
}

.tds-page .result-box strong {
  display: block;
  margin-top: 3px;
  font-size: 0.75rem;
  color: var(--tds-ink);
}

.tds-page .breakdown {
  margin-top: 9px;
  padding: 10px;
  border: 1px solid var(--tds-line);
  background: #fff;
}

.tds-page .breakdown-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.tds-page .breakdown-head strong {
  font-size: 0.61rem;
  color: var(--tds-ink);
}

.tds-page .breakdown-head span {
  font-size: 0.49rem;
  color: var(--tds-muted);
}

.tds-page .breakdown-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-block: 6px 6px;
  padding-inline: clamp(24px, 5vw, 96px);
  border-top: 1px solid #edf0f3;
  font-size: 0.56rem;
}

.tds-page .breakdown-row:first-of-type {
  border-top: 0;
}

.tds-page .breakdown-row span {
  color: var(--tds-muted);
}

.tds-page .breakdown-row strong {
  color: var(--tds-ink);
}

.tds-page .threshold-note {
  margin-top: 9px;
  padding: 9px;
  border: 1px solid #eed5a8;
  background: var(--tds-amber-soft);
  color: #76500f;
  font-size: 0.52rem;
  line-height: 1.42;
}

.tds-page .threshold-note.good {
  border-color: #c6e6d7;
  background: var(--tds-green-soft);
  color: #126347;
}

.tds-page .result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: auto;
  padding-top: 10px;
}

.tds-page .result-actions button,
.tds-page .result-actions a {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--tds-line);
  background: #fff;
  color: var(--tds-ink);
  text-decoration: none;
  font-size: 0.57rem;
  font-weight: 800;
  cursor: pointer;
}

.tds-page .result-actions a {
  grid-column: 1 / -1;
  color: #fff;
  background: var(--tds-coral);
  border-color: var(--tds-coral);
}

.tds-page .result-actions a:hover {
  background: var(--tds-coral-dark);
  color: #fff;
}

.tds-page .tool-foot {
  padding: 10px 19px;
  border-top: 1px solid var(--tds-line);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--tds-muted);
  font-size: 0.52rem;
}

.tds-page .tool-foot strong {
  color: var(--tds-ink);
}

@media (max-width: 1120px) {
  .tds-page .hero-tool {
    min-height: auto;
  }

  .tds-page .page-shell {
    grid-template-columns: 1fr;
    padding-block: 42px;
    padding-inline: clamp(24px, 5vw, 96px);
  }

  .tds-page .intro h1,
  .tds-page .intro-copy {
    max-width: 760px;
  }
}

@media (max-width: 760px) {
  .tds-page .page-shell {
    padding-inline: clamp(16px, 4vw, 24px);
    padding-block: 25px;
    gap: 26px;
  }

  .tds-page .intro h1 {
    font-size: 2.35rem;
  }

  .tds-page .intro-copy {
    font-size: 0.86rem;
  }

  .tds-page .scope-note {
    display: none;
  }

  .tds-page .tool {
    min-height: 850px;
  }

  .tds-page .workspace {
    grid-template-columns: 1fr;
  }

  .tds-page .input-pane {
    border-right: 0;
    border-bottom: 1px solid var(--tds-line);
  }

  .tds-page .result-pane {
    min-height: 360px;
  }
}

@media (max-width: 460px) {
  .tds-page .intro h1 {
    font-size: 2.05rem;
  }

  .tds-page .tool-head,
  .tds-page .input-pane {
    padding-left: 14px;
    padding-right: 14px;
  }

  .tds-page .editable-badge {
    display: none;
  }

  .tds-page .form-grid,
  .tds-page .rate-row,
  .tds-page .switches,
  .tds-page .interest-grid {
    grid-template-columns: 1fr;
  }

  .tds-page .field.full {
    grid-column: auto;
  }

  .tds-page .result-actions {
    grid-template-columns: 1fr;
  }

  .tds-page .result-actions a {
    grid-column: auto;
  }

  .tds-page .tool-foot {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tds-page * {
    animation: none !important;
    transition: none !important;
  }
}
