:root {
  --ink: #17202b;
  --muted: #626a72;
  --paper: #f5f2ec;
  --white: #ffffff;
  --line: #c8ccc9;
  --soft-line: #dfe2df;
  --navy: #132f3f;
  --navy-light: #214c60;
  --green: #16816b;
  --green-soft: #dceee8;
  --gold: #e8b544;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Arial, Helvetica, sans-serif; }
button, input { font: inherit; }
.shell { width: min(1180px, calc(100% - 36px)); margin-inline: auto; }
.nav { display: flex; align-items: center; justify-content: center; }
.hero { padding: 44px 0 30px; text-align: center; }
.eyebrow { margin: 0; color: var(--green); font-size: 11px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
.hero h1 { margin: 10px auto 8px; font-size: clamp(42px, 5.6vw, 68px); line-height: .98; letter-spacing: -.058em; }
.subtitle { margin: 0; color: var(--muted); font-size: clamp(18px, 2vw, 22px); }

.calculator { display: grid; grid-template-columns: minmax(0, .94fr) minmax(430px, 1.06fr); overflow: hidden; border: 1px solid var(--ink); border-radius: 8px; background: var(--white); box-shadow: 0 13px 36px rgba(23, 32, 43, .1); }
.input-panel { min-width: 0; padding: 30px 32px 27px; }
.panel-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--soft-line); }
.panel-heading > span { font-size: 11px; font-weight: 900; letter-spacing: .14em; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 13px; }
#costForm { padding-top: 24px; }
.field { display: block; }
.field + .field, .term-fieldset + .field, .field + .term-fieldset { margin-top: 24px; }
.field-label, .term-fieldset legend { display: block; margin: 0 0 8px; padding: 0; color: var(--ink); font-size: 14px; font-weight: 800; }
.input-shell { display: flex; width: 100%; min-height: 56px; align-items: stretch; overflow: hidden; border: 1px solid #8f9698; border-radius: 6px; background: #fff; transition: border-color .12s ease, box-shadow .12s ease; }
.input-shell:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(22, 129, 107, .16); }
.input-shell b { display: grid; min-width: 48px; place-items: center; color: #4c555c; background: #f0f2f0; font-size: 18px; }
.input-shell input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 22px; font-weight: 750; font-variant-numeric: tabular-nums; }
.money-input input { padding: 12px 15px 12px 0; }
.rate-input input, .days-input input { padding: 12px 0 12px 15px; }
.field small { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.term-fieldset { min-width: 0; margin: 24px 0 0; padding: 0; border: 0; }
.term-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.term-options label { position: relative; min-width: 0; cursor: pointer; }
.term-options input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.term-options span { display: grid; min-height: 48px; place-items: center; border: 1px solid #8f9698; border-radius: 6px; background: #fff; font-size: 14px; font-weight: 800; transition: background .12s ease, border-color .12s ease, color .12s ease; }
.term-options input:checked + span { border-color: var(--navy); background: var(--navy); color: #fff; }
.term-options input:focus-visible + span { outline: 3px solid rgba(22, 129, 107, .25); outline-offset: 2px; }
.custom-days[hidden] { display: none; }
.form-status { min-height: 18px; margin: 18px 0 0; color: var(--green); font-size: 12px; font-weight: 750; }
.form-status.is-error { color: #aa3229; }
[aria-invalid="true"] { color: #aa3229 !important; }

.result-panel { display: flex; min-width: 0; flex-direction: column; padding: 34px 38px; background: var(--navy); color: #fff; }
.result-kicker { margin: 0 0 20px; color: #95d3c5; font-size: 11px; font-weight: 900; letter-spacing: .16em; }
.result-panel h2 { max-width: 490px; margin: 0; color: #d6e1e5; font-size: clamp(22px, 2.4vw, 31px); line-height: 1.15; letter-spacing: -.025em; }
.main-cost { display: block; margin: 12px 0 29px; color: #fff; font-size: clamp(60px, 7vw, 88px); font-weight: 900; line-height: .98; letter-spacing: -.065em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.result-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: auto; border-block: 1px solid rgba(255,255,255,.26); }
.result-details > div { min-width: 0; padding: 17px 14px 17px 0; }
.result-details > div + div { padding-left: 14px; border-left: 1px solid rgba(255,255,255,.26); }
.result-details span { display: block; min-height: 30px; color: #b7c8cf; font-size: 11px; line-height: 1.3; }
.result-details strong { display: block; margin-top: 5px; font-size: 15px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.formula { margin: 18px 0 0; color: #a8bdc6; font-family: "Courier New", monospace; font-size: 12px; }

.comparison { margin-top: 28px; padding: 30px 34px 31px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.section-heading { display: grid; grid-template-columns: 1fr minmax(240px, 360px); align-items: end; gap: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--soft-line); }
.section-heading h2, .charge h2 { margin: 6px 0 0; font-size: clamp(29px, 3.5vw, 42px); line-height: 1; letter-spacing: -.045em; }
.section-heading > p { margin: 0; color: var(--muted); line-height: 1.5; }
.comparison-list { margin-top: 7px; }
.comparison-row { display: grid; grid-template-columns: 78px minmax(80px, 1fr) 105px; align-items: center; gap: 18px; min-height: 52px; border-bottom: 1px solid var(--soft-line); color: #4e575e; font-variant-numeric: tabular-nums; }
.comparison-row > span { font-size: 13px; font-weight: 800; }
.comparison-row > strong { justify-self: end; color: var(--ink); font-size: 15px; }
.bar-track { height: 9px; overflow: hidden; background: #e8ebe8; }
.bar-fill { display: block; width: 0; height: 100%; background: var(--green); transition: width .2s ease; }
.comparison-row.is-active { color: var(--green); }
.comparison-row.is-active > span::after { content: "Current"; display: block; margin-top: 2px; font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.comparison-row.is-active .bar-fill { background: var(--gold); }

.charge { display: grid; grid-template-columns: minmax(0, .9fr) minmax(420px, 1.1fr); gap: 54px; margin-top: 28px; padding: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--green-soft); }
.charge-copy > p:last-child { max-width: 420px; margin: 14px 0 0; color: #4f605c; line-height: 1.5; }
.charge-results { margin: 0; border-top: 1px solid #9bbab1; }
.charge-results > div { display: flex; min-height: 52px; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid #9bbab1; }
.charge-results dt { color: #4f605c; font-size: 13px; }
.charge-results dd { margin: 0; font-size: 18px; font-weight: 850; font-variant-numeric: tabular-nums; }
.charge-results .equivalent dt, .charge-results .equivalent dd { color: var(--navy); font-weight: 900; }
.charge-results .equivalent dd { font-size: 23px; }

.tool-note { display: flex; align-items: center; gap: 11px; margin-top: 23px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.tool-note > span { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: var(--green); }
.tool-note p { margin: 0; color: var(--muted); font-size: 13px; }
.tool-note p strong { color: var(--ink); }
.tool-note b { margin-left: auto; color: var(--muted); font-size: 11px; white-space: nowrap; }
.disclaimer { margin-top: 18px; margin-bottom: 54px; color: var(--muted); font-size: 12px; line-height: 1.5; }

:focus-visible { outline: 3px solid rgba(22,129,107,.35); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }

@media (max-width: 820px) {
  .calculator { grid-template-columns: 1fr; }
  .result-panel { min-height: 420px; }
  .section-heading, .charge { grid-template-columns: 1fr; }
  .section-heading { gap: 12px; }
  .charge { gap: 25px; }
}

@media (max-width: 540px) {
  .shell { width: min(100% - 24px, 1180px); }
  .hero { padding: 31px 0 23px; text-align: left; }
  .hero h1 { margin-top: 8px; font-size: 41px; }
  .subtitle { font-size: 17px; }
  .calculator { border-radius: 6px; }
  .input-panel { padding: 23px 19px 20px; }
  .panel-heading { display: block; padding-bottom: 17px; }
  .panel-heading p { margin-top: 6px; }
  #costForm { padding-top: 20px; }
  .term-options { grid-template-columns: repeat(2, 1fr); }
  .term-options span { min-height: 50px; }
  .result-panel { min-height: 0; padding: 27px 20px 24px; }
  .result-kicker { margin-bottom: 15px; }
  .main-cost { margin: 10px 0 24px; font-size: 61px; }
  .result-details { grid-template-columns: 1fr; }
  .result-details > div { display: flex; min-height: 52px; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }
  .result-details > div + div { padding-left: 0; border-top: 1px solid rgba(255,255,255,.22); border-left: 0; }
  .result-details span { min-height: 0; }
  .result-details strong { margin: 0; text-align: right; }
  .formula { line-height: 1.5; }
  .comparison { margin-top: 16px; padding: 24px 18px; border-radius: 6px; }
  .comparison-row { grid-template-columns: 60px minmax(60px, 1fr) 82px; gap: 11px; }
  .comparison-row > strong { font-size: 13px; }
  .charge { gap: 21px; margin-top: 16px; padding: 25px 19px; border-radius: 6px; }
  .charge-results > div { min-height: 58px; }
  .charge-results dt { max-width: 47%; }
  .charge-results dd { font-size: 16px; }
  .charge-results .equivalent dd { font-size: 19px; }
  .tool-note { align-items: flex-start; flex-wrap: wrap; }
  .tool-note b { width: 100%; margin-left: 20px; }
  .disclaimer { margin-bottom: 42px; }
}
