:root {
  --bg: #f5f6f2;
  --surface: #ffffff;
  --surface-2: #f0f2ec;
  --ink: #15211c;
  --ink-2: #4b5a53;
  --ink-3: #7b8a83;
  --line: #e2e6df;
  --brand: #0e6b4e;
  --brand-ink: #ffffff;
  --brand-soft: #e2f1ea;
  --save: #0d7a54;
  --warn: #b45309;
  --new-bg: #fff0d1;
  --new-ink: #8a4a00;
  --chg-bg: #e5eefc;
  --chg-ink: #1f4f99;
  --bar-base: #cfd6d0;
  --shadow: 0 1px 2px rgba(20, 33, 28, 0.05), 0 4px 16px rgba(20, 33, 28, 0.05);
  --radius: 14px;
  --indent: 34px; /* aligns content under a title that has a 22px marker + 12px gap */
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1311;
    --surface: #151c19;
    --surface-2: #1c2521;
    --ink: #e7eee9;
    --ink-2: #a8b6af;
    --ink-3: #7d8c85;
    --line: #26312c;
    --brand: #3cc08e;
    --brand-ink: #04170f;
    --brand-soft: #14322a;
    --save: #4fd19f;
    --warn: #f0a24b;
    --new-bg: #3b2a0b;
    --new-ink: #f6c46a;
    --chg-bg: #172a47;
    --chg-ink: #9cc0fb;
    --bar-base: #33403a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
p { margin: 0; }
a { color: var(--brand); }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.warn { color: var(--warn); }
.ok { color: var(--save); font-weight: 600; }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand-mark {
  display: grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--brand); color: var(--brand-ink);
  font-weight: 800; font-size: 13px; letter-spacing: 0.02em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { font-size: 15px; }
.brand-text small { color: var(--ink-3); font-size: 12px; white-space: nowrap; }

.year-switch { display: flex; padding: 3px; gap: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; flex: none; }
.year-switch button {
  display: flex; flex-direction: column; align-items: flex-start;
  border: 0; background: transparent; padding: 5px 12px; border-radius: 9px; cursor: pointer;
  line-height: 1.15; color: var(--ink-2);
}
.year-switch button strong { font-size: 14px; }
.year-switch button small { font-size: 11px; color: var(--ink-3); }
.year-switch button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.year-switch button[aria-pressed="true"] small { color: var(--brand); }

/* ---------- Layout ---------- */

.layout { display: grid; gap: 24px; padding-top: 24px; padding-bottom: 120px; }
.main-col { display: flex; flex-direction: column; gap: 22px; min-width: 0; }

@media (min-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; padding-bottom: 48px; }
  .summary-col { position: relative; }
  .summary-stack { position: sticky; top: 88px; max-height: calc(100vh - 104px); overflow-y: auto; scrollbar-width: thin; }
  .mobile-bar { display: none !important; }
}

/* ---------- Hero ---------- */

.hero { display: flex; flex-direction: column; gap: 8px; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--brand); }
.hero h1 { font-size: clamp(24px, 3.4vw, 32px); letter-spacing: -0.02em; text-wrap: balance; }
.lede { color: var(--ink-2); font-size: 15px; max-width: 60ch; }

.countdown {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px;
  background: var(--new-bg); color: var(--new-ink); font-size: 13px;
}
.countdown::before { content: "⏳"; }
.countdown strong { font-variant-numeric: tabular-nums; }

.year-info { font-size: 13.5px; color: var(--ink-2); }
.year-info summary {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
  cursor: pointer; list-style: none;
}
.year-info summary::-webkit-details-marker { display: none; }
.info-dot {
  display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 800; font-style: italic;
}
.year-info-more { color: var(--brand); font-weight: 600; }
.year-info-more::after { content: " ▾"; font-size: 11px; }
.year-info[open] .year-info-more::after { content: " ▴"; }
.year-info p { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--brand-soft); color: var(--ink); max-width: 70ch; }

/* ---------- Cards, blocks ---------- */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

.block-title { display: flex; align-items: center; gap: 12px; font-size: 17px; }
.block-aside { margin-left: auto; font-size: 12.5px; font-weight: 500; color: var(--ink-3); }
.block-sub { color: var(--ink-2); font-size: 13.5px; margin: 2px 0 12px var(--indent); }
.step-num {
  flex: none; display: grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink); color: var(--bg); font-weight: 700; font-size: 12px;
}

.setup-block { padding: 18px 20px; }
.setup-block + .setup-block { border-top: 1px solid var(--line); }
.setup-block > .income-row, .setup-block > .hint, .setup-block > .chips, .setup-block > .potential-line { margin-left: var(--indent); }

.income-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hint { margin-top: 8px; color: var(--ink-3); font-size: 13px; }

/* ---------- Inputs ---------- */

.money {
  display: flex; align-items: center;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px;
  padding: 0 12px; min-width: 0; flex: 1 1 160px; max-width: 240px;
  transition: border-color 0.15s;
}
.money:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.money span { color: var(--ink-3); font-weight: 600; font-size: 14px; margin-right: 6px; }
.money input { border: 0; outline: 0; background: transparent; width: 100%; min-width: 0; padding: 9px 0; font-variant-numeric: tabular-nums; font-size: 16px; }
.money-lg { max-width: 300px; flex-basis: 220px; }
.money-lg input { font-size: 22px; font-weight: 700; padding: 9px 0; }
.money-lg span { font-size: 18px; }
.money-sm { max-width: 150px; flex: none; width: 150px; }
.money-sm input { padding: 7px 0; }

.money-group { display: flex; align-items: stretch; }
.money-group .money { border-radius: 10px 0 0 10px; width: 150px; flex: none; }
.btn-max {
  border: 1.5px solid var(--line); border-left: 0; border-radius: 0 10px 10px 0;
  background: var(--surface-2); color: var(--ink-2); padding: 0 12px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.btn-max:hover { color: var(--brand); }
.btn-max:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

select {
  border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface);
  padding: 9px 12px; max-width: 100%; min-width: 0; flex: 1 1 auto;
}
select:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.btn { border: 0; cursor: pointer; border-radius: 10px; padding: 9px 14px; font-weight: 600; font-size: 14px; }
.btn-ghost { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink-3); }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-block { width: 100%; display: flex; justify-content: center; gap: 6px; }

.link-btn {
  border: 0; background: transparent; padding: 2px 0; cursor: pointer;
  color: var(--brand); font-weight: 600; font-size: 13.5px; text-align: left;
}
.link-btn:hover { text-decoration: underline; }

.btn:focus-visible, .seg button:focus-visible, .group-head:focus-visible, .pointer:focus-visible, .opp:focus-visible,
.year-switch button:focus-visible, .chip:focus-visible, .link-btn:focus-visible, .year-info summary:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px;
}

.seg { display: inline-flex; padding: 3px; gap: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 8px; cursor: pointer; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- About-you chips ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px 7px 10px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--surface);
  font-size: 14px; font-weight: 600; color: var(--ink-2);
  transition: border-color 0.15s, background 0.15s;
}
.chip:hover { border-color: var(--ink-3); }
.chip-icon { font-size: 17px; line-height: 1; }
.chip-tick { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--line); position: relative; flex: none; }
.chip[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--ink); }
.chip[aria-pressed="true"] .chip-tick { background: var(--brand); border-color: var(--brand); }
.chip[aria-pressed="true"] .chip-tick::after {
  content: ""; position: absolute; left: 4.5px; top: 1.5px; width: 4px; height: 8px;
  border: solid var(--brand-ink); border-width: 0 2px 2px 0; transform: rotate(45deg);
}

.potential-line {
  display: flex; gap: 10px; align-items: flex-start;
  margin-top: 14px; padding: 10px 12px; border-radius: 10px;
  background: var(--surface-2); font-size: 14px; color: var(--ink-2);
}
.potential-line:empty { display: none; }
.potential-line strong { color: var(--save); font-variant-numeric: tabular-nums; }
.potential-icon { color: var(--save); font-weight: 800; flex: none; }

/* ---------- Relief groups ---------- */

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#groups { display: flex; flex-direction: column; gap: 10px; }

.group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.group-head {
  display: flex; align-items: center; gap: 12px; width: 100%;
  border: 0; background: transparent; padding: 14px 16px; cursor: pointer; text-align: left;
}
.group-head:hover { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.g-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); font-size: 18px; flex: none; }
.g-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.g-title { font-weight: 700; font-size: 15.5px; }
.g-blurb { color: var(--ink-2); font-size: 13px; }
.g-meta { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.g-amount { font-weight: 700; color: var(--save); font-variant-numeric: tabular-nums; }
.g-count { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.chev { width: 9px; height: 9px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg); margin: 0 4px 4px; transition: transform 0.2s; flex: none; }
.group.open .chev { transform: rotate(225deg); margin-bottom: -4px; }

.group-body { display: none; flex-direction: column; padding: 0 16px 8px; border-top: 1px solid var(--line); }
.group.open .group-body { display: flex; }

/* ---------- Relief rows ---------- */

.item { padding: 14px 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }

.item-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; column-gap: 12px; align-items: start; }
.item-text { min-width: 0; }
.item-row h4 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 15px; font-weight: 650; }
.limit { font-size: 12.5px; font-weight: 500; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.item-desc { color: var(--ink-2); font-size: 13.5px; margin-top: 2px; }
.item-side { padding-top: 2px; }
.item-body, .item-foot, .item-info { margin-left: var(--indent); }
.item-body { margin-top: 10px; }
.item-foot { margin-top: 8px; }

.check { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); margin-top: 1px; position: relative; transition: all 0.2s; }
.item.is-claimed .check, .item.is-auto .check { background: var(--save); border-color: var(--save); }
.item.is-claimed .check::after, .item.is-auto .check::after {
  content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px;
  border: solid var(--surface); border-width: 0 2px 2px 0; transform: rotate(45deg);
}

.auto-tag { display: inline-flex; gap: 4px; padding: 5px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--save); font-size: 13px; font-weight: 600; white-space: nowrap; }

.badge { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 1px 7px; white-space: nowrap; letter-spacing: 0.01em; }
.badge-new { background: var(--new-bg); color: var(--new-ink); }
.badge-changed { background: var(--chg-bg); color: var(--chg-ink); }

.meter { height: 4px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: var(--save); border-radius: 99px; transition: width 0.3s ease; }
.item-foot .meter { margin-bottom: 6px; }
.foot-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.meter-text { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.info-btn { flex: none; font-size: 12.5px; margin-left: auto; }
.info-btn::after { content: " ▾"; font-size: 10px; }
.info-btn[aria-expanded="true"]::after { content: " ▴"; }

.item-info { margin-top: 8px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; color: var(--ink-2); }
.info-list { list-style: none; margin: 0; padding: 0; }
.info-list li { position: relative; padding-left: 20px; margin: 4px 0; }
.info-yes li::before { content: "✓"; position: absolute; left: 0; color: var(--save); font-weight: 700; }
.info-no li::before { content: "✕"; position: absolute; left: 1px; color: var(--warn); font-size: 11px; top: 2px; }
.info-title { margin-top: 10px; font-weight: 600; color: var(--ink); }
.item-info > :first-child { margin-top: 0; }
.tip, .note { margin-top: 8px; }
.note { color: var(--ink-3); font-style: italic; }

/* Sub-items (medical, education, child categories, EPF parts) */
.subs { display: flex; flex-direction: column; }
.sub { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px dashed var(--line); }
.sub:first-child { border-top: 0; padding-top: 0; }
.sub-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sub-label { font-size: 14px; font-weight: 550; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.sub-hint { font-size: 12.5px; color: var(--ink-3); }
.sub-input { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.sub-cap { font-size: 11.5px; color: var(--ink-3); min-height: 1em; }
.sub-cap.over { color: var(--warn); font-weight: 600; }

.bucket { padding: 2px 0 2px 12px; border-left: 3px solid var(--line); }
.bucket + .bucket { margin-top: 14px; }
.bucket-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.bucket-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-2); }
.pill { flex: none; font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--surface-2); border-radius: 999px; padding: 2px 9px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.meter-thin { height: 4px; margin-top: 8px; }
.bucket .meter-text { margin-top: 4px; }

.control-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.control-row + .control-row { margin-top: 8px; }

.stepper { display: flex; align-items: center; gap: 4px; flex: none; }
.btn-step { width: 34px; height: 34px; padding: 0; background: var(--surface-2); border: 1px solid var(--line); font-size: 18px; line-height: 1; }
.stepper output { min-width: 28px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; font-weight: 500; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { width: 42px; height: 24px; border-radius: 99px; background: var(--bar-base); position: relative; transition: background 0.2s; flex: none; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .switch-ui { background: var(--save); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--brand); outline-offset: 2px; }

/* "Also claimable in other groups" */
.pointers { padding: 12px 0 6px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 2px; }
.pointers-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin-bottom: 4px; }
.pointer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; text-align: left; cursor: pointer;
  background: transparent; border: 0; border-radius: 8px; padding: 6px 8px; margin: 0 -8px; font-size: 13.5px; color: var(--ink-2);
}
.pointer:hover { background: var(--surface-2); color: var(--ink); }
.pointer-arrow { color: var(--brand); font-weight: 700; flex: none; }

@keyframes flash { from { box-shadow: 0 0 0 4px var(--brand); } to { box-shadow: 0 0 0 0 transparent; } }
.flash { animation: flash 1.4s ease-out; border-radius: 10px; }

/* ---------- Summary ---------- */

.summary { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.sum-head { display: flex; justify-content: space-between; align-items: center; }
.sum-head h2 { font-size: 16px; }

.empty { display: flex; flex-direction: column; gap: 10px; font-size: 14px; padding: 14px; border-radius: 12px; background: var(--surface-2); }



/* Before → saved → now */
.tax-flow { margin: 0; padding: 4px 14px; border-radius: 12px; background: var(--surface-2); }
.tf-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; }
.tf-row + .tf-row { border-top: 1px solid var(--line); }
.tf-row dt { display: flex; flex-direction: column; font-size: 14px; color: var(--ink-2); min-width: 0; }
.tf-row dt small { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tf-row dd { margin: 0; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tf-save dt, .tf-save dd { color: var(--save); }
.tf-save dt { font-weight: 600; }
.tf-save dd { font-size: 20px; font-weight: 800; }
.tf-row.tf-now { border-top: 2px solid var(--ink); }
.tf-now dt { color: var(--ink); font-weight: 700; font-size: 15px; }
.tf-now dd { font-size: 26px; font-weight: 800; letter-spacing: -0.01em; }

.still { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.still-text { font-size: 13.5px; color: var(--ink-2); }
.still-text strong { color: var(--save); font-variant-numeric: tabular-nums; }
.still-sub { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.opps { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.opps h3 { font-size: 13.5px; }
.opp-list { display: flex; flex-direction: column; gap: 6px; }
.opp {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 12px; cursor: pointer; text-align: left;
}
.opp:hover { border-color: var(--brand); }
.opp-text { display: flex; flex-direction: column; min-width: 0; }
.opp-text strong { font-size: 14px; }
.opp-text small { color: var(--ink-3); font-size: 12px; }
.opp-save { flex: none; font-size: 13px; font-weight: 700; color: var(--save); white-space: nowrap; }
.all-good { font-size: 14px; padding: 12px; border-radius: 10px; background: var(--brand-soft); }

.sum-actions { display: flex; gap: 8px; align-items: center; justify-content: center; color: var(--ink-3); padding-top: 2px; }
.sum-actions .link-btn { color: var(--ink-2); font-weight: 500; font-size: 13px; }

.summary-stack { display: flex; flex-direction: column; gap: 16px; }

/* ---------- Reminder sign-up ---------- */

.remind { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; border-top: 3px solid var(--brand); }
.remind-head, .remind-done { display: flex; gap: 10px; align-items: flex-start; }
.remind-icon { font-size: 20px; line-height: 1.2; flex: none; }
.remind h3 { font-size: 15.5px; }
.remind-lead { font-size: 13.5px; color: var(--ink-2); margin-top: 2px; }
.remind-done p { font-size: 13.5px; color: var(--ink-2); margin: 2px 0 6px; overflow-wrap: anywhere; }
.remind-list { list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--ink-2); }
.remind-list li { position: relative; padding-left: 20px; margin: 3px 0; }
.remind-list li::before { content: "✓"; position: absolute; left: 0; color: var(--save); font-weight: 700; }
.remind-form { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.remind-row { display: flex; gap: 8px; }
.remind-row input {
  flex: 1; min-width: 0; padding: 9px 12px; border-radius: 10px;
  border: 1.5px solid var(--line); background: var(--surface); font-size: 15px;
}
.remind-row input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.remind-row .btn { flex: none; white-space: nowrap; }
.remind-row .btn:disabled { opacity: 0.6; cursor: progress; }
.remind-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.remind-consent input { margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.remind-fine { font-size: 12px; color: var(--ink-3); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.disclaimer { font-size: 13px; color: var(--ink-3); display: flex; flex-direction: column; gap: 6px; padding: 4px 2px; }

/* ---------- Calculation drawer ---------- */

.drawer-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(10, 15, 13, 0.45);
  opacity: 0; visibility: hidden; transition: opacity 0.2s, visibility 0.2s;
}
.drawer-backdrop.open { opacity: 1; visibility: visible; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 41;
  width: min(480px, 100vw);
  display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--line);
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.15);
  transform: translateX(100%); visibility: hidden;
  transition: transform 0.25s ease, visibility 0.25s;
}
.drawer.open { transform: none; visibility: visible; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 16px; }
.btn-close { width: 36px; height: 36px; padding: 0; display: grid; place-items: center; font-size: 14px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px 28px; display: flex; flex-direction: column; gap: 12px; }
body.drawer-lock { overflow: hidden; }

.band-explain { font-size: 13.5px; color: var(--ink-2); padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.drawer-h { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-top: 8px; }
.drawer-h .step-num { width: 20px; height: 20px; font-size: 11px; }

.breakdown { margin: 0; display: flex; flex-direction: column; }
.breakdown .row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 14px; border-bottom: 1px solid var(--line); }
.breakdown dt { color: var(--ink-2); }
.breakdown dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; }
.row-strong dt, .row-strong dd { color: var(--ink); font-weight: 700; }
.row-total { border-bottom: 0 !important; padding-top: 10px !important; font-size: 16px !important; }
.row-total dt { color: var(--ink); font-weight: 700; }
.row-total dd { font-weight: 800; }

.band-table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.band-table th { text-align: right; font-size: 11.5px; font-weight: 600; color: var(--ink-3); padding: 6px; vertical-align: bottom; }
.band-table th:first-child, .band-table td:first-child { text-align: left; }
.band-table td { text-align: right; padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
.band-table td:first-child { white-space: normal; }
.band-table tr.off td { color: var(--ink-3); }
.band-table tr.top td { background: var(--brand-soft); font-weight: 700; }
.band-bar { height: 4px; margin-top: 5px; border-radius: 99px; background: var(--surface-2); overflow: hidden; max-width: 160px; }
.band-bar span { display: block; height: 100%; background: var(--save); border-radius: 99px; }
.band-table tr.top .band-bar { background: var(--surface); }

.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr auto; gap: 10px; align-items: center; font-size: 13px; color: var(--ink-2); }
.bar-row b { font-variant-numeric: tabular-nums; color: var(--ink); }
.bar { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 99px; transition: width 0.3s ease; }
.bar-base { background: var(--bar-base); }
.bar-now { background: var(--save); }
.bars-save { text-align: right; font-size: 13.5px; color: var(--ink-2); }
.bars-save strong { color: var(--save); font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .drawer, .drawer-backdrop { transition: none; }
}

/* ---------- Mobile ---------- */

.mobile-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}
.mobile-bar > div { display: flex; flex-direction: column; line-height: 1.2; }
.mobile-bar > div:first-child { flex: 1; }
.mb-label { font-size: 11.5px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.mb-big { font-size: 22px; color: var(--save); font-variant-numeric: tabular-nums; }
.mb-tax {
  display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2;
  border: 0; background: transparent; padding: 4px 6px; margin: -4px -6px; border-radius: 8px; cursor: pointer; text-align: left;
}
.mb-tax:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.mb-tax .mb-label { color: var(--brand); }
.mb-tax strong { font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
  :root { --indent: 0px; }
  .brand-text small { display: none; }
  .year-switch button { padding: 5px 9px; }
  .setup-block { padding: 16px; }
  .group-head { padding: 12px; gap: 10px; }
  .g-icon { width: 32px; height: 32px; font-size: 16px; }
  .g-blurb { display: none; }
  .group-body { padding: 0 12px 6px; }
  .item-row { grid-template-columns: 22px minmax(0, 1fr); }
  .item-side { grid-column: 2; padding-top: 10px; }
  .money-group .money { width: auto; flex: 1; }
  .money-group { max-width: 260px; }
  .sub { flex-direction: column; align-items: stretch; gap: 6px; }
  .sub-input { flex-direction: row; align-items: center; justify-content: space-between; }
  .sub .stepper { align-self: flex-start; }
  .money { max-width: none; }
  .money-sm { width: auto; flex: 1 1 auto; max-width: 200px; }
  .sub-cap { flex: none; }
  .bar-row { grid-template-columns: 110px 1fr auto; }
}

@media (max-width: 420px) {
  .brand-text { display: none; }
}

/* ---------- Print ---------- */

@media print {
  body { background: #fff; color: #000; font-size: 12px; }
  .topbar, .mobile-bar, .drawer, .drawer-backdrop, .sum-actions, .btn, .btn-max, .link-btn, .seg, .chips,
  .pointers, .opps, .hero .lede, .year-info, .chev, .item-info, .meter, .remind { display: none !important; }
  .layout { display: block; padding: 0; }
  .card, .group, .item { box-shadow: none; break-inside: avoid; }
  .summary-stack { position: static; max-height: none; }
  .summary { margin-top: 16px; }
  .group-body { display: flex !important; }
}
