/* ============================================================
   "What did I pay for?" — styles
   Tokens from the brief; design language from the BOSF app:
   light glass cards, Plus Jakarta Sans / DM Sans, soft glow
   shadows, 44px tap targets, mobile-first app shell.
   ============================================================ */

:root {
  --bg: #eef0f3;
  --card: #ffffff;
  --ink: #14181f;
  --muted: #5b6472;
  --green: #0a7d3c;
  --gold: #f4b400;
  --red: #d8392b;
  --navy: #1d2b3a;

  --line: rgba(20, 24, 31, 0.08);
  --line-strong: rgba(20, 24, 31, 0.14);
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 1px 2px rgba(20, 24, 31, 0.05), 0 8px 24px rgba(20, 24, 31, 0.06);
  --font-display: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: linear-gradient(177deg, #f5f7f9 0%, var(--bg) 32%, #e6e9ed 100%);
  background-attachment: fixed;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.5;
  overflow-x: clip;
}

.tabular, .money-box, .bt-amt, .headline-total,
.vs-total, .vs-cell, .cgt-bar-val, .hl-amt, .bd-bal, .bd-tot-val, .bd-lever-val {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

button { font-family: inherit; cursor: pointer; touch-action: manipulation; }
input { font-family: inherit; }

.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;
}
.pt-safe { padding-top: env(safe-area-inset-top, 0px); }
.pb-safe { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px); }

/* ---------- App shell ---------- */
.app-shell {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 13px 48px;
  position: relative;
}

/* ---------- Header ---------- */
.site-header { text-align: center; padding: 24px 8px 16px; }
.site-header h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(31px, 8.5vw, 50px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 8px;
}
.site-header h1 .i { color: var(--red); }
.subtitle { margin: 0 auto; max-width: 420px; color: var(--muted); font-size: 15px; }

/* ---------- Tabs ---------- */
.tabs {
  position: sticky; top: 0; z-index: 30;
  display: flex; gap: 6px;
  padding: 10px 0; margin-bottom: 4px;
  background: var(--bg);
}
.tab {
  flex: 1; min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  font-size: 14px; font-weight: 700;
  color: var(--muted);
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.tab.is-active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  box-shadow: 0 6px 18px rgba(29, 43, 58, 0.28);
}
.tab-panel { display: flex; flex-direction: column; gap: 16px; }
.tab-panel[hidden] { display: none; }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(20, 24, 31, 0.04), 0 12px 30px rgba(20, 24, 31, 0.07);
  padding: 20px;
}
.card-eyebrow {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 6px;
}
.card-title {
  font-family: var(--font-display);
  font-weight: 800; font-size: 21px;
  letter-spacing: -0.018em;
  margin: 0 0 14px;
}

/* ---------- Hero ---------- */
.hero-card {
  background: linear-gradient(160deg, #243549, var(--navy) 70%);
  border: none; color: #eef2f6; text-align: center;
  padding: 26px 22px;
}
.portraits { display: flex; justify-content: center; margin-bottom: 14px; }
.portrait {
  width: 88px; height: 88px; border-radius: 50%;
  object-fit: cover;
  background: #2a3b4f;
  border: 3px solid #fff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}
.portrait--2 { margin-left: -26px; }
.hero-line { margin: 0 auto; max-width: 440px; font-size: 16.5px; line-height: 1.5; }
.hero-line strong { color: #ffd86b; font-weight: 800; white-space: nowrap; }

/* ---------- Fields ---------- */
.field { margin-bottom: 18px; }
.field:last-of-type { margin-bottom: 0; }
.field-label {
  display: block;
  font-family: var(--font-display);
  font-weight: 700; font-size: 15px;
  margin-bottom: 2px;
}
.field-hint { margin: 0 0 9px; font-size: 12px; color: var(--muted); }
.money-input {
  display: flex; align-items: center;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fafbfc; overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.money-input:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(10, 125, 60, 0.13);
  background: #fff;
}
.money-prefix {
  padding: 0 6px 0 14px;
  font-weight: 700; font-size: 19px; color: var(--muted);
}
.money-box {
  flex: 1; min-width: 0;
  border: none; background: transparent;
  padding: 12px 14px 12px 2px;
  font-size: 20px; font-weight: 700; color: var(--ink);
  outline: none;
}

/* Sliders */
.slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 28px; margin: 8px 0 0;
  background: transparent;
}
.slider::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: #e3e6ea; }
.slider::-moz-range-track { height: 6px; border-radius: 999px; background: #e3e6ea; }
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 24px; height: 24px; margin-top: -9px;
  border-radius: 50%; background: var(--green);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(10, 125, 60, 0.4);
  transition: transform .12s ease, box-shadow .12s ease;
}
.slider::-moz-range-thumb {
  width: 21px; height: 21px;
  border-radius: 50%; background: var(--green);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(10, 125, 60, 0.4);
  transition: transform .12s ease, box-shadow .12s ease;
}
.slider:active::-webkit-slider-thumb {
  transform: scale(1.2);
  box-shadow: 0 3px 14px rgba(10, 125, 60, 0.55);
}
.slider:active::-moz-range-thumb {
  transform: scale(1.2);
  box-shadow: 0 3px 14px rgba(10, 125, 60, 0.55);
}

.slider-hint {
  margin: 7px 0 0;
  padding: 7px 11px;
  font-size: 11.5px; font-weight: 600;
  color: var(--green);
  background: rgba(10, 125, 60, 0.08);
  border: 1px solid rgba(10, 125, 60, 0.22);
  border-radius: 8px;
}

.slider-head { display: flex; justify-content: space-between; align-items: baseline; }
.slider-val {
  font-family: var(--font-display);
  font-weight: 800; font-size: 17px; color: var(--green);
}

/* Segmented toggle */
.segmented {
  display: flex; gap: 6px; margin-top: 10px;
  padding: 4px; background: #f1f3f5;
  border-radius: var(--radius-sm);
}
.seg {
  flex: 1; min-height: 40px;
  padding: 8px 6px; border: none;
  background: transparent; border-radius: 8px;
  font-size: 12.5px; font-weight: 700; color: var(--muted);
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.seg.is-active {
  background: #fff; color: var(--ink);
  box-shadow: 0 1px 4px rgba(20, 24, 31, 0.14);
}

/* Caveat */
.caveat {
  margin-top: 18px; padding: 13px 14px;
  background: rgba(216, 57, 43, 0.06);
  border: 1px solid rgba(216, 57, 43, 0.2);
  border-radius: var(--radius-sm);
  font-size: 12.5px; color: #7a2a23; line-height: 1.5;
}
.caveat strong { color: var(--red); }

/* ---------- Optional yes/no input groups ---------- */
.opt-group {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.opt-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.opt-q {
  flex: 1;
  font-family: var(--font-display);
  font-weight: 700; font-size: 14.5px;
}
.opt-toggle {
  flex: none;
  min-width: 78px; min-height: 44px;
  padding: 9px 20px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #f1f3f5;
  font-family: var(--font-display);
  font-size: 14px; font-weight: 800; color: var(--muted);
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
}
.opt-toggle.is-on {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.opt-toggle:active { transform: scale(0.96); }
.opt-fields { margin-top: 14px; }
.opt-fields[hidden] { display: none; }
.opt-fields:not([hidden]) {
  animation: revealFields .4s cubic-bezier(.22, .61, .36, 1) both;
}
@keyframes revealFields {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* compact cost-base + years-held row */
.cgt-extra {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.mini-label {
  display: block;
  font-family: var(--font-display);
  font-weight: 700; font-size: 12.5px;
  margin-bottom: 5px;
}
.money-input--mini .money-prefix { padding: 0 3px 0 11px; font-size: 15px; }
.money-input--mini .money-box { padding: 9px 11px 9px 2px; font-size: 16px; }
.money-suffix {
  padding: 0 12px 0 4px;
  font-weight: 700; font-size: 13px; color: var(--muted);
}
.cgt-extra-hint { margin: 9px 0 0; }

/* ---------- Receipt card ---------- */

/* ---------- Receipt card ---------- */
.receipt-card { text-align: center; padding: 26px 20px; }
.receipt-title { margin-bottom: 4px; }
.headline-total {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(46px, 14vw, 76px);
  line-height: 1.02; letter-spacing: -0.03em;
  margin: 0;
  background: linear-gradient(135deg, #e8483a, var(--red) 55%, #a92a20);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- Highlight strip ---------- */
.hl-intro {
  margin: 2px 0 10px; text-align: center;
  font-size: 13.5px; font-weight: 600; color: var(--muted);
}
.hl-strip {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin-bottom: 18px;
}
.hl-card {
  background: linear-gradient(160deg, rgba(216,57,43,0.1), rgba(216,57,43,0.05));
  border: 1px solid rgba(216, 57, 43, 0.28);
  border-radius: var(--radius-sm);
  padding: 13px 8px; text-align: center;
}
.hl-amt {
  font-family: var(--font-display);
  font-weight: 800; font-size: clamp(16px, 5vw, 21px);
  color: var(--red); line-height: 1.1;
}
.hl-cat {
  font-size: 11px; font-weight: 700; color: var(--muted);
  margin-top: 4px;
}

/* ---------- Donut ---------- */
.donut-wrap { display: flex; justify-content: center; margin: 4px 0 18px; }
.donut {
  width: 240px; height: 240px;
  max-width: 76vw; max-height: 76vw;
  border-radius: 50%; position: relative;
  box-shadow: inset 0 0 0 1px rgba(20, 24, 31, 0.05);
}
.donut-hole {
  position: absolute; inset: 26%;
  background: #fff; border-radius: 50%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(20, 24, 31, 0.12);
}
.donut-hole-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--muted);
}
.donut-hole-total {
  font-family: var(--font-display);
  font-weight: 800; font-size: clamp(20px, 6.6vw, 27px);
  color: var(--ink); font-variant-numeric: tabular-nums;
}

.welfare-callout {
  background: linear-gradient(135deg, rgba(244, 180, 0, 0.16), rgba(244, 180, 0, 0.07));
  border: 1px solid rgba(244, 180, 0, 0.45);
  border-radius: var(--radius-sm);
  padding: 14px 15px; margin-bottom: 16px;
  font-size: 14px; line-height: 1.5;
}
.welfare-callout strong { color: #8a6400; }

/* ---------- Breakdown table (1 / 10 / 30 years) ---------- */
.bt { display: flex; flex-direction: column; }
.bt-head {
  display: grid;
  grid-template-columns: 1fr 62px 62px 62px;
  gap: 8px; padding: 0 6px 7px;
  border-bottom: 1.5px solid var(--line-strong);
}
.bt-head span {
  font-size: 10px; font-weight: 700; letter-spacing: 0.03em;
  text-transform: uppercase; color: var(--muted);
  text-align: right;
}
.bt-head span:first-child { text-align: left; }
.bt-row {
  display: grid;
  grid-template-columns: 1fr 62px 62px 62px;
  gap: 4px 8px;
  width: 100%; text-align: left;
  background: transparent; border: none;
  border-bottom: 1px solid var(--line);
  padding: 11px 6px;
}
.bt-row:hover { background: #f6f7f9; }
.bt-name {
  display: flex; align-items: center; gap: 7px;
  min-width: 0; overflow-wrap: anywhere;
  font-weight: 700; font-size: 12.5px;
}
.bt-dot { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.bt-chev { color: var(--muted); font-size: 10px; transition: transform .2s ease; }
.bt-row.is-open .bt-chev { transform: rotate(180deg); }
.bt-amt {
  align-self: center; text-align: right;
  font-weight: 700; font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.bt-amt:nth-of-type(3),
.bt-amt:nth-of-type(4) { color: var(--muted); }
.bt-blurb {
  grid-column: 1 / -1;
  font-size: 12.5px; color: var(--muted); line-height: 1.5;
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height .25s ease, opacity .2s ease, margin-top .2s ease;
}
.bt-row.is-open .bt-blurb { max-height: 160px; opacity: 1; margin-top: 4px; }
.bt-total {
  border-bottom: none; padding-top: 13px;
  pointer-events: none;
}
.bt-total .bt-name {
  font-family: var(--font-display);
  font-weight: 800; font-size: 15px;
}
.bt-total .bt-amt {
  font-family: var(--font-display);
  font-weight: 800; font-size: 13px; color: var(--ink);
}

/* ---------- USA card ---------- */
.usa-headline {
  text-align: center;
  border-radius: var(--radius-sm);
  padding: 16px 14px; margin-bottom: 14px;
  font-size: 16px; font-weight: 700; line-height: 1.35;
}
.usa-headline.good { background: rgba(10, 125, 60, 0.1); color: var(--green); }
.usa-headline.bad { background: rgba(216, 57, 43, 0.09); color: #a92a20; }
.usa-big {
  display: block;
  font-family: var(--font-display);
  font-weight: 800; font-size: clamp(28px, 9vw, 40px);
  letter-spacing: -0.02em;
}
.usa-per { font-size: 13px; font-weight: 600; opacity: 0.8; }

.versus {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: stretch; gap: 8px; margin-bottom: 14px;
}
.vs-side { border-radius: var(--radius-sm); padding: 15px 10px; text-align: center; }
.vs-side--au { background: rgba(10, 125, 60, 0.08); border: 1px solid rgba(10, 125, 60, 0.25); }
.vs-side--us { background: rgba(29, 43, 58, 0.06); border: 1px solid rgba(29, 43, 58, 0.18); }
.vs-flag { font-size: 22px; }
.vs-where {
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted); margin-top: 2px;
}
.vs-total {
  font-family: var(--font-display);
  font-weight: 800; font-size: clamp(22px, 6.5vw, 30px); margin-top: 4px;
}
.vs-side--au .vs-total { color: var(--green); }
.vs-side--us .vs-total { color: var(--navy); }
.vs-mid {
  align-self: center;
  font-family: var(--font-display);
  font-weight: 800; font-size: 13px; color: var(--muted);
}

.cmp-table { width: 100%; border-collapse: collapse; }
.cmp-table th, .cmp-table td { padding: 10px 6px; font-size: 13.5px; text-align: right; }
.cmp-table th:first-child, .cmp-table td:first-child {
  text-align: left; color: var(--muted); font-weight: 600;
}
.cmp-table thead th {
  font-size: 11px; font-weight: 700; letter-spacing: 0.03em;
  text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.cmp-table tbody td { border-bottom: 1px solid var(--line); }
.vs-cell { font-weight: 700; }
.cmp-table tr.total td {
  border-bottom: none; font-weight: 800; font-size: 14.5px; padding-top: 12px;
}
.cmp-table tr.total td:first-child { color: var(--ink); }
.note { margin: 12px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.lead { font-size: 14.5px; color: var(--muted); margin: 0 0 14px; line-height: 1.5; }
.lead strong { color: var(--ink); }

/* ---------- CGT world comparison ---------- */
.cgt-mine {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px;
  background: #f6f7f9; border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px; margin-bottom: 14px;
}
.cgt-mine-rate {
  font-family: var(--font-display);
  font-weight: 800; font-size: 22px; color: var(--red);
}
.cgt-mine-label { font-size: 13px; color: var(--muted); }
.cgt-bars { display: flex; flex-direction: column; gap: 9px; }
.cgt-bar-row { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; }
.cgt-bar-name { font-size: 13px; font-weight: 700; }
.cgt-bar-name .cgt-tag { font-size: 10px; font-weight: 700; color: var(--muted); }
.cgt-bar-val {
  font-family: var(--font-display);
  font-weight: 800; font-size: 13.5px; align-self: center;
}
.cgt-bar-track {
  grid-column: 1 / -1; height: 9px;
  background: #eceef0; border-radius: 999px; overflow: hidden;
}
.cgt-bar-fill { display: block; height: 100%; border-radius: 999px; }
.cgt-bar-row.is-mine .cgt-bar-name { color: var(--red); }

/* ---------- Share ---------- */
.share-card { padding: 16px 16px 14px; }
.share-title { font-size: 16.5px; margin: 0 0 11px; }
.share-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.share-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 44px; padding: 9px 12px;
  border: 1px solid var(--line-strong);
  background: #fff; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 700; color: var(--ink);
  transition: transform .12s ease, box-shadow .15s ease;
}
.share-btn:hover { box-shadow: 0 6px 16px rgba(20, 24, 31, 0.1); }
.share-btn:active { transform: scale(0.98); }
.share-btn--primary {
  grid-column: 1 / -1;
  background: var(--green); border-color: var(--green);
  color: #fff; font-size: 14.5px;
  box-shadow: 0 6px 16px rgba(10, 125, 60, 0.28);
}
.share-ico { font-size: 15px; }
.social-proof {
  margin: 10px 0 0; text-align: center;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
}

/* ---------- Footnote ---------- */
.footnote { padding: 4px 6px; font-size: 11.5px; color: var(--muted); line-height: 1.55; }
.footnote p { margin: 0 0 8px; }
.footnote strong { color: var(--ink); }

/* ---------- Budget balancer ---------- */
.balancer-tagline {
  margin: -8px 0 16px;
  font-size: 14px; font-weight: 600; color: var(--muted); font-style: italic;
}
.bd-summary {
  background: #f6f7f9;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
}
.bd-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bd-cap {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
}
.bd-bal {
  font-family: var(--font-display);
  font-weight: 800; font-size: clamp(30px, 9vw, 42px);
  letter-spacing: -0.02em; line-height: 1.05;
}
.bd-bal.is-good { color: var(--green); }
.bd-bal.is-bad { color: var(--red); }
.bd-bal-sub { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-top: 3px; }
.bd-grade {
  flex: none;
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-family: var(--font-display); font-weight: 800; font-size: 26px;
  color: #fff; background: var(--muted);
}
.grade-A { background: #128a47; }
.grade-B { background: #4e9f50; }
.grade-C { background: #d9a400; }
.grade-D { background: #e8763a; }
.grade-E { background: var(--red); }
.bd-meter {
  position: relative;
  height: 10px; margin: 14px 0 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e8483a, #f4b400 57%, #128a47);
}
.bd-meter-zero {
  position: absolute; top: -3px; bottom: -3px; left: 57.1%;
  width: 2px; background: var(--navy);
}
.bd-meter-mark {
  position: absolute; top: 50%; left: 0;
  width: 16px; height: 16px;
  transform: translate(-50%, -50%);
  border-radius: 50%; background: #fff;
  border: 3px solid var(--navy);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: left .15s ease;
}
.bd-meter-scale {
  display: flex; justify-content: space-between;
  font-size: 10px; font-weight: 600; color: var(--muted);
}
.bd-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.bd-tot {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.bd-tot-cap {
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted);
}
.bd-tot-val {
  font-family: var(--font-display);
  font-weight: 800; font-size: 19px; color: var(--navy); margin-top: 2px;
}
.bd-tot-sub { font-size: 11px; font-weight: 600; color: var(--muted); }
.bd-base-note { margin: 12px 0 0; font-size: 10.5px; color: var(--muted); line-height: 1.5; }

.bd-actions { display: flex; gap: 6px; margin: 14px 0 4px; }
.bd-act {
  flex: 1; min-height: 38px;
  border: 1px solid var(--line-strong);
  background: #fff; border-radius: var(--radius-sm);
  font-size: 12.5px; font-weight: 700; color: var(--ink);
}
.bd-act--reset { color: var(--red); }
.bd-act:active { transform: scale(0.98); }

.bd-sec-label {
  font-family: var(--font-display);
  font-weight: 800; font-size: 15px;
  margin: 18px 0 4px;
}
.bd-cat { border-top: 1px solid var(--line); }
.bd-cat-head {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 12px 2px;
  background: none; border: none; text-align: left;
}
.bd-cat-name { flex: 1; font-weight: 700; font-size: 13.5px; }
.bd-cat-size { color: var(--muted); font-weight: 600; font-size: 11.5px; }
.bd-cat-delta {
  flex: none;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 800;
}
.bd-cat-delta.is-flat { display: none; }
.bd-cat-delta.is-up { background: rgba(18, 138, 71, 0.13); color: var(--green); }
.bd-cat-delta.is-down { background: rgba(216, 57, 43, 0.12); color: var(--red); }
.bd-cat-chev {
  flex: none; color: var(--muted); font-size: 11px;
  transition: transform .2s ease;
}
.bd-cat-head.is-open .bd-cat-chev { transform: rotate(180deg); }
.bd-cat-body { padding: 2px 0 10px; }
.bd-lever {
  padding: 12px; margin-bottom: 8px;
  background: #f6f7f9; border-radius: var(--radius-sm);
}
.bd-lever-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
}
.bd-lever-label { font-weight: 700; font-size: 13.5px; }
.bd-lever-val {
  flex: none;
  font-family: var(--font-display);
  font-weight: 800; font-size: 14px; color: var(--navy);
}
.bd-lever-desc { margin: 4px 0 8px; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.bd-slider { margin: 0; }
.bd-lever-delta { margin: 7px 0 0; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.bd-lever-delta.is-flat { display: none; }
.bd-lever-delta.bd-fixed { color: var(--muted); font-style: italic; }
.bd-lever-delta.is-up { color: var(--green); }
.bd-lever-delta.is-down { color: var(--red); }

/* ---------- Review ---------- */
.stat-strip {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin-bottom: 18px;
}
.strip-stat { border-radius: var(--radius-sm); padding: 14px 8px; text-align: center; color: #fff; }
.strip-stat.deficit { background: linear-gradient(160deg, #e8483a, #b62b21); }
.strip-stat.debt { background: linear-gradient(160deg, #2b3d52, var(--navy)); }
.strip-stat.spend { background: linear-gradient(160deg, #128a47, #096031); }
.strip-value { font-family: var(--font-display); font-weight: 800; font-size: clamp(19px, 5.6vw, 25px); }
.strip-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; opacity: 0.85; margin-top: 2px;
}
.review-block-title {
  font-family: var(--font-display);
  font-weight: 800; font-size: 17px;
  margin: 18px 0 4px;
}
.review-block-sub { font-size: 12.5px; color: var(--muted); margin: 0 0 12px; }
.review-list { display: flex; flex-direction: column; gap: 8px; }
.review-item {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 12px 13px; border-radius: var(--radius-sm);
  font-size: 13.5px; line-height: 1.5;
}
.review-item.loser { background: rgba(216, 57, 43, 0.06); border: 1px solid rgba(216, 57, 43, 0.22); }
.review-item.winner { background: rgba(244, 180, 0, 0.1); border: 1px solid rgba(244, 180, 0, 0.4); }
.review-icon {
  flex: none; width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #fff;
}
.review-item.loser .review-icon { background: var(--red); }
.review-item.winner .review-icon { background: var(--gold); }
.review-note {
  margin: 18px 0 0; font-size: 11.5px; color: var(--muted);
  line-height: 1.55; font-style: italic;
}

/* ---------- Footer ---------- */
.site-footer { margin-top: 26px; text-align: center; }
.footer-name {
  font-family: var(--font-display);
  font-weight: 800; font-size: 14px; color: var(--ink);
  margin: 0 0 6px;
}
.footer-disc {
  margin: 0 auto; max-width: 540px;
  font-size: 11px; line-height: 1.55; color: var(--muted);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px;
  transform: translateX(-50%) translateY(14px);
  background: var(--navy); color: #fff;
  padding: 12px 20px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600;
  box-shadow: 0 12px 30px rgba(20, 24, 31, 0.35);
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 80; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Skeleton shimmer ---------- */
.skeleton-line { position: relative; color: transparent; }
.skeleton-line::after {
  content: ""; position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 220px; max-width: 70%; height: 13px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e9ebee 0%, #dfe2e6 25%, #e9ebee 50%, #dfe2e6 75%, #e9ebee 100%);
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
}
.skeleton-line.loaded { color: var(--muted); }
.skeleton-line.loaded::after { display: none; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- The Fix page ---------- */
.fix-hero { text-align: center; }
.fix-headline {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(34px, 10vw, 52px);
  line-height: 1.04; letter-spacing: -0.03em;
  margin: 8px 0 10px;
}
.fix-sub {
  margin: 0 auto; max-width: 430px;
  font-size: 16px; color: var(--muted); line-height: 1.5;
}
.fix-section-title {
  font-family: var(--font-display);
  font-weight: 800; font-size: 20px;
  margin: 2px 0 12px;
}
.fix-text { margin: 0; font-size: 15px; color: var(--ink); line-height: 1.6; }

.fix-step {
  display: flex; gap: 14px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.fix-step:first-of-type { border-top: none; padding-top: 4px; }
.fix-step-num {
  flex: none;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--green); color: #fff;
  font-family: var(--font-display); font-weight: 800; font-size: 16px;
}
.fix-step-body h4 {
  margin: 4px 0 5px;
  font-family: var(--font-display); font-weight: 800; font-size: 16px;
}
.fix-step-body p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.55; }

.fix-balance {
  text-align: center;
  background: linear-gradient(135deg, #eaf6ee, #d6efdf);
}
.fix-balance-tick {
  width: 50px; height: 50px; margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--green); color: #fff;
  font-family: var(--font-display); font-weight: 800; font-size: 28px;
}

.fix-win {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 14.5px; line-height: 1.55;
}
.fix-win:first-of-type { border-top: none; padding-top: 4px; }
.fix-win-mark {
  flex: none;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(10, 125, 60, 0.12); color: var(--green);
  font-size: 12px; font-weight: 800;
}
.fix-close { background: var(--navy); }
.fix-close-line {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800; font-size: 19px; line-height: 1.4;
  color: #fff; text-align: center;
}
.fix-disclaimer {
  margin: 2px 6px 0;
  font-size: 12px; line-height: 1.55;
  color: var(--muted); font-style: italic;
  text-align: center;
}

/* ---------- Fix → balancer link ---------- */
.fix-cta {
  width: 100%; min-height: 50px; margin-top: 14px;
  background: var(--green); color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 15px; font-weight: 800;
  box-shadow: 0 8px 22px rgba(10, 125, 60, 0.3);
}
.fix-cta:active { transform: scale(0.99); }
.bd-fixbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
  margin-bottom: 12px; padding: 11px 14px;
  background: var(--navy); color: #fff;
  border-radius: var(--radius-sm);
}
.bd-fixbar-label { font-size: 13px; font-weight: 600; }
.bd-fixbar-label strong { font-weight: 800; }
.bd-fixbar-btn {
  flex: none;
  padding: 7px 15px; min-height: 36px;
  background: #fff; color: var(--navy);
  border: none; border-radius: 999px;
  font-size: 12.5px; font-weight: 800;
}
.bd-fixbar-btn:active { transform: scale(0.97); }

/* ---------- Motion ---------- */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}
.tab-panel > * { animation: cardIn .5s cubic-bezier(.22, .61, .36, 1) both; }
.tab-panel > *:nth-child(1) { animation-delay: .03s; }
.tab-panel > *:nth-child(2) { animation-delay: .09s; }
.tab-panel > *:nth-child(3) { animation-delay: .15s; }
.tab-panel > *:nth-child(4) { animation-delay: .21s; }
.tab-panel > *:nth-child(5) { animation-delay: .27s; }
.tab-panel > *:nth-child(6) { animation-delay: .33s; }
.tab-panel > *:nth-child(7) { animation-delay: .39s; }
.tab-panel > *:nth-child(8) { animation-delay: .45s; }

/* ---------- Focus & motion ---------- */
:focus-visible { outline: 2.5px solid var(--green); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 380px) {
  .card { padding: 16px; }
  .hl-strip, .stat-strip { gap: 6px; }
  .bt-head, .bt-row { grid-template-columns: 1fr 52px 52px 52px; }
}
