/* Layout: light, consumer-finance look. White ground, navy ink, one trustworthy blue for
   actions; red is reserved for losses and the year-end deadline. Light theme only. */
:root {
  --bg: #ffffff;
  --band: #f3f6f9;          /* alternating section ground */
  --hero: #eaf3fc;          /* hero wash */
  --surface: #ffffff;
  --ink: #142538;           /* navy text */
  --muted: #56677a;
  --rule: #dfe5ec;
  --rule-strong: #c3ccd6;
  --blue: #0a62c9;          /* primary actions */
  --blue-dark: #084fa3;
  --blue-wash: #e7f0fb;
  --on-blue: #ffffff;
  --red: #c8281d;           /* losses, deadline */
  --red-wash: #fdeceb;
  --gain: #13804f;
  --amber: #a85d00;
  --amber-wash: #fff4e2;
  --focus: #0a62c9;
  --shadow: 0 1px 2px rgba(20, 37, 56, .06), 0 6px 20px rgba(20, 37, 56, .07);

  --display: "Figtree", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Public Sans", "Helvetica Neue", Arial, system-ui, sans-serif;

  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.625rem;
  --step-3: 2.25rem;
  --step-4: clamp(2.375rem, 5.5vw, 3.75rem);
  --radius: 8px;
  --radius-lg: 14px;
  --wrap: 72rem;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }   /* components set display:grid/flex; hidden must still win */
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.12; text-wrap: balance; margin: 0; letter-spacing: -0.015em; color: var(--ink); }
p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.wrap.wide { max-width: 86rem; }

/* ---------- header / footer ---------- */
.site-header { background: var(--bg); border-bottom: 1px solid var(--rule); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-icon { width: 30px; height: 30px; flex: none; }
.brand-mark { font-family: var(--display); font-weight: 800; font-size: 1.1875rem; letter-spacing: -0.02em; }
.nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.nav a { text-decoration: none; padding: 8px 12px; border-radius: 6px; color: var(--ink); font-weight: 600; font-size: 0.9375rem; }
.nav a:hover { background: var(--band); }
.nav a[aria-current="page"] { color: var(--blue); }
.nav .soon { font-size: 0.6875rem; color: var(--amber); background: var(--amber-wash); font-weight: 700; margin-left: 6px; padding: 2px 6px; border-radius: 4px; vertical-align: 1px; }
.nav .nav-cta { background: var(--blue); color: var(--on-blue); margin-left: 6px; }
.nav .nav-cta:hover { background: var(--blue-dark); }

.site-footer { background: var(--band); border-top: 1px solid var(--rule); margin-top: 0; }
.site-footer .wrap { padding-block: 36px 48px; display: grid; gap: 12px; color: var(--muted); font-size: 0.875rem; }
.site-footer p { max-width: 72ch; }
.site-footer strong { color: var(--ink); }

/* ---------- buttons / forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 1rem/1 var(--body); padding: 14px 22px; border-radius: 6px;
  border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--blue); color: var(--on-blue); }
.btn-primary:hover { background: var(--blue-dark); }
.btn-ghost { background: var(--surface); color: var(--blue); border-color: var(--blue); }
.btn-ghost:hover { background: var(--blue-wash); }
.btn-text { background: transparent; color: var(--muted); padding-inline: 8px; }
.btn-text:hover { color: var(--ink); }
.btn-small { padding: 10px 14px; font-size: 0.875rem; }

.signup { display: flex; gap: 8px; flex-wrap: wrap; max-width: 30rem; }
.signup input {
  flex: 1 1 14rem; min-width: 0; font: 400 1rem var(--body); color: var(--ink);
  background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 6px; padding: 13px 14px;
}
.signup input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-wash); }
.signup-note { font-size: 0.875rem; color: var(--muted); margin-top: 8px; }

/* ---------- landing ---------- */
.hero { background: linear-gradient(180deg, var(--hero), var(--bg)); padding-block: 64px 64px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.hero h1 { font-size: var(--step-4); font-weight: 800; letter-spacing: -0.03em; max-width: 15ch; }
.hero .lede { font-size: var(--step-1); color: var(--muted); max-width: 34rem; margin-top: 18px; line-height: 1.5; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

.clock { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: 28px; display: grid; gap: 18px; box-shadow: var(--shadow); }
.clock-label { font-weight: 700; color: var(--ink); font-size: 1rem; }
.clock-days { font-family: var(--display); font-weight: 800; font-size: clamp(4.5rem, 11vw, 6.75rem); line-height: 0.9; letter-spacing: -0.04em; color: var(--red); }
.clock-days small { font-size: 0.28em; letter-spacing: 0; color: var(--ink); margin-left: 6px; font-weight: 700; }
.year-bar { height: 10px; border-radius: 999px; background: var(--band); overflow: hidden; position: relative; box-shadow: inset 0 0 0 1px var(--rule); }
.year-bar i { position: absolute; inset: 0 auto 0 0; background: var(--blue); border-radius: 999px; }
.year-ticks { display: flex; justify-content: space-between; font-size: var(--step--1); color: var(--muted); }
.clock-foot { font-size: 0.9375rem; color: var(--muted); border-top: 1px solid var(--rule); padding-top: 16px; }
.clock-foot strong { color: var(--ink); }

.latest { padding-block: 8px 56px; }
.latest-h { font-size: var(--step-1); font-weight: 800; margin-bottom: 14px; }
.post-card { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; text-decoration: none; color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease; }
.post-card:hover { border-color: var(--rule-strong); box-shadow: 0 2px 4px rgba(20,37,56,.08), 0 12px 32px rgba(20,37,56,.1); }
.post-card:not(:has(.post-img)) { grid-template-columns: minmax(0, 1fr); }
.post-img { width: 100%; height: 100%; max-height: 300px; object-fit: cover; display: block; background: var(--band); }
.post-body { padding: 26px 28px; display: grid; gap: 10px; align-content: center; }
.post-date { color: var(--muted); font-size: 0.875rem; font-weight: 600; }
.post-title { font-size: var(--step-2); font-weight: 800; line-height: 1.15; }
.post-sub { color: var(--muted); font-size: 1.0625rem; max-width: 60ch; }
.post-cta { color: var(--blue); font-weight: 700; margin-top: 4px; }
.post-card:hover .post-cta { text-decoration: underline; }
@media (max-width: 700px) { .post-card { grid-template-columns: minmax(0, 1fr); } .post-img { max-height: 200px; } .post-body { padding: 20px; } }

.section { padding-block: 64px; }
.section.alt { background: var(--band); }
.section-head { display: grid; gap: 10px; max-width: 42rem; margin-bottom: 32px; }
.section-head h2 { font-size: var(--step-3); font-weight: 800; }
.section-head p { color: var(--muted); font-size: 1.0625rem; }

.timeline { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding: 0; margin: 0; }
.timeline li { list-style: none; padding: 24px; display: grid; gap: 10px; align-content: start; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); }
.timeline .when { font-family: var(--display); font-weight: 800; font-size: var(--step-1); }
.timeline .step { font-size: 0.8125rem; font-weight: 700; color: var(--blue); }
.timeline li:nth-child(2) .when { color: var(--red); }
.timeline li:nth-child(3) .when { color: var(--gain); }
.timeline p { color: var(--muted); }

.preview { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.preview-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 18px 22px; border-bottom: 1px solid var(--rule); }
.preview-top h3 { font-size: var(--step-1); }
.preview-top span { color: var(--muted); font-size: 0.875rem; }
.table-scroll { overflow-x: auto; }
table.screen { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; min-width: 34rem; }
.screen th { text-align: right; font-weight: 700; font-size: 0.8125rem; color: var(--muted); padding: 10px 22px; border-bottom: 1px solid var(--rule); background: var(--band); }
.screen td { text-align: right; padding: 13px 22px; border-bottom: 1px solid var(--rule); }
.screen th:first-child, .screen td:first-child { text-align: left; }
.screen tr:last-child td { border-bottom: 0; }
.screen .tk { font-weight: 700; }
.screen .co { color: var(--muted); font-size: 0.875rem; display: block; }
.screen .disc { color: var(--red); font-weight: 700; }
.preview-foot { padding: 14px 22px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.875rem; background: var(--band); }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.math { display: grid; gap: 0; margin: 0; border: 1px solid var(--rule); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.math div { display: flex; justify-content: space-between; gap: 16px; padding: 15px 22px; border-bottom: 1px solid var(--rule); }
.math div:last-child { border-bottom: 0; font-weight: 700; background: var(--blue-wash); }
.math div:last-child dd { color: var(--gain); font-size: 1.125rem; }
.math dt { color: var(--muted); }
.math div:last-child dt { color: var(--ink); }
.math dd { margin: 0; font-variant-numeric: tabular-nums; }
.loss { color: var(--red); }
.gain { color: var(--gain); }

.cta-band { background: var(--ink); border-radius: var(--radius-lg); padding: 40px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 40px; align-items: center; }
.cta-band h2 { font-size: var(--step-3); color: var(--on-blue); max-width: 18ch; }
.cta-band .section-head p { color: #c5d0dc; }
.cta-band .signup-note { color: #c5d0dc; }

/* ---------- calculator ---------- */
.calc-top { background: linear-gradient(180deg, var(--hero), var(--bg)); }
.calc-head { padding-block: 40px 24px; display: grid; gap: 10px; }
.calc-head h1 { font-size: var(--step-3); font-weight: 800; letter-spacing: -0.02em; }
.calc-head p { color: var(--muted); max-width: 44rem; font-size: 1.0625rem; }

.settings { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: end; padding: 18px 20px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.field { display: grid; gap: 6px; }
.field label { font-size: 0.8125rem; font-weight: 700; color: var(--ink); }
.field .hint { font-weight: 400; color: var(--muted); }
.input-unit { display: flex; align-items: center; border: 1px solid var(--rule-strong); border-radius: 6px; background: var(--surface); overflow: hidden; }
.input-unit:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-wash); }
.input-unit input { border: 0; background: transparent; }
.input-unit input:focus { outline: none; }
.input-unit span { padding: 0 10px; color: var(--muted); font-size: 0.875rem; }
.settings input, .settings select, .ledger input {
  font: 400 1rem var(--body); color: var(--ink); font-variant-numeric: tabular-nums;
  padding: 10px 12px; width: 100%; min-width: 0;
}
.settings input { width: 6.5rem; border: 1px solid var(--rule-strong); border-radius: 6px; background: var(--surface); }
.settings input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-wash); }
.settings .input-unit input { width: 4.5rem; border: 0; box-shadow: none; }
.settings input[type="date"] { width: auto; }
.settings .spacer { flex: 1 1 auto; }
.settings .tip { max-width: 22rem; font-size: 0.8125rem; color: var(--muted); }

.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-top: 20px; border: 1px solid var(--rule); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.summary > div { padding: 18px 20px; display: grid; gap: 4px; align-content: start; }
.summary > div + div { border-left: 1px solid var(--rule); }
.summary .k { font-size: 0.8125rem; font-weight: 700; color: var(--muted); }
.summary .v { font-family: var(--display); font-weight: 800; font-size: var(--step-2); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.summary .s { font-size: 0.8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.summary .hero-v { background: var(--blue-wash); }
.summary .hero-v .k { color: var(--blue); }
.summary .hero-v .v { color: var(--gain); }

.alerts { display: grid; gap: 8px; margin-top: 16px; }
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 0.9375rem; background: var(--amber-wash); border: 1px solid #f3d9ad; }
.alert strong { font-weight: 700; }

.ledger-wrap { margin-top: 20px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
table.ledger { width: 100%; border-collapse: collapse; table-layout: fixed; font-variant-numeric: tabular-nums; }
.ledger thead th { text-align: left; vertical-align: bottom; font-size: 0.75rem; font-weight: 700; color: var(--muted); padding: 12px 8px; border-bottom: 1px solid var(--rule-strong); background: var(--band); line-height: 1.3; }
.ledger th.r, .ledger td.r { text-align: right; }
.ledger td { padding: 10px 6px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.ledger td.out, .ledger td.c-term { padding-top: 20px; }
.ledger td.c-x { padding-top: 12px; }
.ledger td:first-child, .ledger th:first-child { padding-left: 16px; }
.ledger td:last-child, .ledger th:last-child { padding-right: 12px; }
.ledger input { border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); }
.ledger input:hover { border-color: var(--rule-strong); }
.ledger input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px var(--blue-wash); }
.ledger input.tkr { text-transform: uppercase; font-weight: 700; }
.ledger input.n { text-align: right; }
.ledger .out { white-space: nowrap; font-size: 0.9375rem; }
.ledger .pl { font-weight: 700; }
.ledger tr.is-loss .pl { color: var(--red); }
.ledger tr.is-gain .pl { color: var(--gain); }
.term { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 700; padding: 3px 8px; border-radius: 4px; white-space: nowrap; }
.term.st { background: var(--amber-wash); color: var(--amber); }
.term.lt { background: var(--band); color: var(--muted); box-shadow: inset 0 0 0 1px var(--rule); }
.term-sub { display: block; font-size: 0.75rem; color: var(--muted); margin-top: 4px; }
.del { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 1.25rem; line-height: 1; padding: 6px 8px; border-radius: 6px; }
.del:hover { color: var(--red); background: var(--red-wash); }
.ledger tfoot td { border-bottom: 0; padding: 14px 6px; font-weight: 700; background: var(--band); }
.px-src { display: block; font-size: 0.75rem; color: var(--muted); margin-top: 4px; padding-left: 2px; min-height: 1.1em; }
.px-src.miss { color: var(--amber); }
/* column widths (desktop table) */
.ledger col.c-tkr { width: 8%; } .ledger col.c-sh { width: 8.5%; } .ledger col.c-cost { width: 9%; }
.ledger col.c-date { width: 14%; } .ledger col.c-px { width: 9.5%; } .ledger col.c-basis { width: 9.5%; }
.ledger col.c-proc { width: 9.5%; } .ledger col.c-pl { width: 10%; } .ledger col.c-term { width: 10%; }
.ledger col.c-tax { width: 9%; } .ledger col.c-x { width: 3%; }
.ledger .c-tax-cell { white-space: normal; }

/* below desktop width: each position becomes a card instead of a side-scrolling table */
@media (max-width: 1179px) {
  .ledger colgroup, .ledger thead { display: none; }
  .ledger, .ledger tbody, .ledger tfoot { display: block; }
  .ledger tbody tr, .ledger tfoot tr {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: 12px 14px;
    padding: 18px 48px 18px 18px; border-bottom: 1px solid var(--rule); position: relative;
  }
  .ledger td, .ledger td.out, .ledger td.c-term, .ledger td:first-child, .ledger td:last-child { display: block; padding: 0; border: 0; text-align: left; }
  .ledger td.c-date { grid-column: span 2; }
  .ledger td.c-date input { max-width: 16rem; }
  .ledger td[data-label]::before { content: attr(data-label); display: block; font-size: 0.75rem; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
  .ledger td.r { text-align: left; }
  .ledger input.n { text-align: left; }
  .ledger td.c-x { position: absolute; top: 10px; right: 8px; padding: 0; }
  .ledger tfoot td:empty, .ledger tfoot td.tot-label { display: none; }
  .ledger tfoot tr::before { content: "Total"; grid-column: 1 / -1; font-family: var(--display); font-weight: 800; }
  .ledger td.out { white-space: normal; }
}
.ledger-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.ledger-actions .note { color: var(--muted); font-size: 0.875rem; margin-left: auto; }

.fine { margin-top: 32px; margin-bottom: 64px; display: grid; gap: 10px; color: var(--muted); font-size: 0.875rem; max-width: 72ch; }
.fine strong { color: var(--ink); }

/* ---------- screener ---------- */
.settings select { border: 1px solid var(--rule-strong); border-radius: 6px; background: var(--surface); width: auto; min-width: 11rem; padding-right: 32px; }
.settings select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-wash); }
.scr-filters .grow { flex: 1 1 18rem; }
.scr-filters .grow input { width: 100%; }
.scr-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; flex-wrap: wrap; margin-top: 24px; }
.scr-count { font-size: 1rem; }
.scr-count strong { font-family: var(--display); font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.scr-asof { color: var(--muted); font-size: 0.875rem; margin-left: 10px; }
.scr-wrap { margin-top: 14px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow-x: auto; }
table.scr { width: 100%; border-collapse: collapse; table-layout: fixed; font-variant-numeric: tabular-nums; }
.scr th.w-stock { width: 34%; } .scr th.w-num { width: 14%; } .scr th.w-disc { width: 26%; } .scr th.w-cap { width: 12%; }
.scr.has-sector th.w-stock { width: 28%; } .scr.has-sector th.w-sec { width: 15%; } .scr.has-sector th.w-num { width: 12%; }
.scr.has-sector th.w-disc { width: 22%; } .scr.has-sector th.w-cap { width: 11%; }
.scr td.sec { color: var(--muted); font-size: 0.9375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scr thead th { background: var(--band); border-bottom: 1px solid var(--rule-strong); padding: 0; text-align: left; position: sticky; top: 0; }
.scr thead th.r { text-align: right; }
.scr thead button { all: unset; box-sizing: border-box; display: block; width: 100%; padding: 12px 16px; font: 700 0.8125rem var(--body); color: var(--muted); cursor: pointer; }
.scr thead th.r button { text-align: right; }
.scr thead button:hover { color: var(--ink); }
.scr thead button:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.scr thead th[aria-sort="ascending"] button, .scr thead th[aria-sort="descending"] button { color: var(--blue); }
.scr thead th[aria-sort="ascending"] button::after { content: " \25B2"; font-size: 0.65rem; }
.scr thead th[aria-sort="descending"] button::after { content: " \25BC"; font-size: 0.65rem; }
.scr td { padding: 12px 16px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.scr td.r { text-align: right; }
.scr tbody tr:hover { background: var(--band); }
.scr .tk { font-weight: 800; }
.scr .co { display: block; color: var(--muted); font-size: 0.875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adj { display: inline-block; font-size: 0.6875rem; font-weight: 700; color: var(--muted); background: var(--band); box-shadow: inset 0 0 0 1px var(--rule); border-radius: 4px; padding: 1px 5px; vertical-align: 1px; }
.dbar { display: grid; grid-template-columns: 4rem minmax(0, 1fr); align-items: center; gap: 10px; }
.dval { color: var(--red); font-weight: 700; text-align: right; }
.dtrack { height: 8px; background: var(--red-wash); border-radius: 999px; overflow: hidden; }
.dtrack i { display: block; height: 100%; background: var(--red); border-radius: 999px; opacity: .85; }
.scr-empty { padding: 32px 20px; color: var(--muted); text-align: center; }
.scr-more { display: flex; justify-content: center; margin-top: 16px; }
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .scr th.w-stock, .scr.has-sector th.w-stock { width: 36%; } .scr th.w-num, .scr.has-sector th.w-num { width: 20%; }
  .scr th.w-disc, .scr.has-sector th.w-disc { width: 21%; } .scr th.w-cap, .scr.has-sector th.w-cap { width: 23%; }
  .scr td, .scr thead button { padding-inline: 8px; }
  .scr td:first-child, .scr thead th:first-child button { padding-left: 12px; }
  .scr td:last-child, .scr thead th:last-child button { padding-right: 12px; }
  .dbar { display: block; } .dtrack { display: none; }
  .settings select { width: 100%; }
  .scr-filters .field { flex: 1 1 100%; }
}

/* ---------- subscribe popup ---------- */
.sub-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(20, 37, 56, .45); display: grid; place-items: center; padding: 20px; }
.sub-dialog { position: relative; width: min(28rem, 100%); background: var(--surface); border-radius: var(--radius-lg); box-shadow: 0 24px 60px rgba(20, 37, 56, .28); padding: 32px 28px 24px; display: grid; gap: 14px; }
.sub-dialog h2 { font-size: var(--step-2); font-weight: 800; padding-right: 24px; }
.sub-dialog p { color: var(--muted); }
.sub-dialog ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.sub-dialog li { display: flex; gap: 10px; align-items: flex-start; }
.sub-dialog li svg { width: 18px; height: 18px; color: var(--gain); flex: none; margin-top: 3px; }
.sub-actions { display: grid; gap: 6px; margin-top: 6px; }
.sub-actions .btn { width: 100%; }
.sub-close { position: absolute; top: 12px; right: 12px; border: 0; background: transparent; font-size: 1.5rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 6px 10px; border-radius: 6px; }
.sub-close:hover { background: var(--band); color: var(--ink); }
.sub-fine { font-size: 0.8125rem; color: var(--muted); text-align: center; }

@media (max-width: 860px) {
  .hero .wrap, .split, .cta-band { grid-template-columns: minmax(0, 1fr); }
  .timeline { grid-template-columns: minmax(0, 1fr); }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary > div:nth-child(3) { border-left: 0; }
  .summary > div:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .cta-band { padding: 28px 22px; }
}
@media (max-width: 420px) {
  .summary { grid-template-columns: minmax(0, 1fr); }
  .summary > div + div { border-left: 0; border-top: 1px solid var(--rule); }
  .nav .nav-cta { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .year-bar i { animation: fill 900ms cubic-bezier(.2,.7,.2,1) both; transform-origin: left; }
  @keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  .sub-overlay { animation: fadein .2s ease both; }
  .sub-dialog { animation: rise .25s cubic-bezier(.2,.7,.2,1) both; }
  @keyframes fadein { from { opacity: 0; } }
  @keyframes rise { from { transform: translateY(12px); opacity: 0; } }
}
