:root {
  --navy: #06254a;
  --navy-2: #0b3769;
  --green: #2faa16;
  --green-dark: #247d15;
  --green-soft: #eff9ec;
  --ink: #10233d;
  --muted: #58697f;
  --line: #d8e0e9;
  --surface: #ffffff;
  --canvas: #f4f7fa;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; background: var(--canvas); color: var(--ink); font-size: 16px; line-height: 1.5; }
input, button, summary { font: inherit; }
.page-width { width: min(1080px, calc(100% - 40px)); margin-inline: auto; }
.brand-bar { background: white; border-bottom: 1px solid #e5eaf0; }
.brand-bar .page-width { height: 78px; display: flex; align-items: center; }
.brand-logo { width: 255px; max-height: 60px; object-fit: contain; object-position: left center; }

.hero { padding: 26px 0; color: white; background: linear-gradient(120deg, #061f3e, #07315f); }
.title-row { display: flex; justify-content: space-between; align-items: center; gap: 28px; }
.hero h1 { margin: 0; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.12; letter-spacing: -.025em; }
.hero p { max-width: 760px; margin: 10px 0 0; color: #eef5fb; font-size: 1.08rem; }
.assumption-badge { flex: 0 0 auto; padding: 8px 12px; border-radius: 7px; background: #165795; font-weight: 700; font-size: .9rem; }

.calculator-shell { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 22px; align-items: start; padding-block: 24px; }
.input-card, .results-card, .supporting-content details { border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: 0 3px 12px rgba(9,31,61,.06); }
.input-card { padding: 22px; }
h2 { margin: 0; color: var(--navy); font-size: 1.35rem; }
form { margin-top: 20px; }
form label { display: block; margin-top: 19px; color: var(--ink); font-weight: 700; }
form label:first-child { margin-top: 0; }
form label span { color: var(--muted); font-weight: 400; }
.input-shell { display: flex; min-height: 52px; margin-top: 7px; overflow: hidden; border: 1px solid #aebdcd; border-radius: 8px; background: white; }
.input-shell.currency::before { content: "$"; flex: 0 0 44px; display: grid; place-items: center; border-right: 1px solid var(--line); color: #33465e; background: #f6f8fa; font-weight: 700; }
.input-shell input { width: 100%; min-width: 0; border: 0; outline: 0; padding: 10px 13px; color: var(--ink); background: transparent; text-align: right; font-size: 1.1rem; }
.input-shell:focus-within { border-color: var(--green-dark); box-shadow: 0 0 0 3px rgba(47,170,22,.14); }
input:focus-visible, summary:focus-visible { outline: 3px solid #79ca67; outline-offset: 2px; }
.help-text { margin: 7px 0 0; color: var(--muted); font-size: .9rem; }
.assumptions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.assumptions div { padding: 11px 12px; border-radius: 8px; background: #f1f5f8; }
.assumptions span { display: block; color: var(--muted); font-size: .82rem; }
.assumptions strong { display: block; margin-top: 2px; color: var(--navy); font-size: 1.08rem; }
.income-note { margin: 16px 0 0; padding: 12px 14px; border-left: 4px solid var(--navy-2); color: #35475d; background: #f4f7fa; font-size: .9rem; }

.results-card { overflow: hidden; }
.results-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 20px 22px 17px; border-bottom: 2px solid var(--green); }
.eyebrow { display: block; margin-bottom: 2px; color: var(--green-dark); font-size: .78rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.status { padding: 6px 9px; border-radius: 999px; color: var(--green-dark); background: var(--green-soft); font-size: .8rem; font-weight: 700; }
.status.over { color: #8a2f1e; background: #fff0ec; }
.threshold-result { padding: 22px; color: white; background: var(--navy); }
.threshold-result span { display: block; color: #dbe7f3; font-size: .92rem; }
.threshold-result strong { display: block; margin-top: 3px; font-size: clamp(2rem, 5vw, 2.65rem); line-height: 1.15; }
.result-list > div { display: flex; justify-content: space-between; align-items: center; gap: 18px; min-height: 68px; padding: 14px 22px; border-top: 1px solid var(--line); }
.result-list span { max-width: 68%; }
.result-list strong { color: var(--green-dark); font-size: 1.18rem; text-align: right; }
.result-list .key-result { background: var(--green-soft); }
.result-list .key-result strong { font-size: 1.35rem; }
.cap-note { margin: 0; padding: 12px 22px 16px; color: #7b351f; background: #fff8f3; font-size: .88rem; }

.supporting-content { padding-bottom: 24px; }
.supporting-content details { overflow: hidden; }
.supporting-content summary { display: flex; align-items: center; padding: 15px 18px; color: var(--navy); font-weight: 700; cursor: pointer; list-style: none; }
.supporting-content summary::-webkit-details-marker { display: none; }
.supporting-content summary::after { content: "⌄"; margin-left: auto; }
.supporting-content details[open] summary::after { content: "⌃"; }
.supporting-content details > div { padding: 0 18px 15px; color: #35475d; }
.supporting-content p { margin: 8px 0; }

footer { border-top: 1px solid var(--line); background: white; }
footer .page-width { min-height: 70px; display: flex; justify-content: space-between; align-items: center; gap: 20px; color: #35475d; font-size: .9rem; }

@media (max-width: 760px) {
  .page-width { width: min(100% - 24px, 560px); }
  .brand-bar .page-width { height: 66px; }
  .brand-logo { width: 215px; max-height: 52px; }
  .hero { padding: 20px 0; }
  .title-row { display: block; }
  .hero h1 { font-size: 2rem; }
  .hero p { font-size: 1rem; }
  .assumption-badge { display: inline-block; margin-top: 13px; }
  .calculator-shell { grid-template-columns: 1fr; gap: 14px; padding-block: 14px; }
  .input-card { padding: 18px 16px; }
  .results-heading { padding-inline: 16px; }
  .threshold-result { padding: 18px 16px; }
  .result-list > div { padding-inline: 16px; }
  .assumptions { grid-template-columns: 1fr 1fr; }
  footer .page-width { flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; padding-block: 15px; }
}

@media (max-width: 390px) {
  .assumptions { grid-template-columns: 1fr; }
  .results-heading { align-items: flex-start; flex-direction: column; }
  .result-list > div { align-items: flex-start; flex-direction: column; gap: 5px; }
  .result-list span { max-width: none; }
  .result-list strong { text-align: left; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

