/* Hành Trình Tài Chính Hưu Trí — VDK
   Phong cách: Nhật Bản tối giản — giấy washi, mực tàu, hoa anh đào, xanh chàm. */

:root {
  --paper: #faf6f1;
  --paper-2: #f3ece4;
  --surface: #fffdfa;
  --surface-2: #f7f1ea;
  --ink: #26212b;
  --ink-2: #4f4652;
  --muted: #6d6370;
  --line: #e6dcd2;
  --line-strong: #d4c6b9;

  --sakura: #c8476f;
  --sakura-ink: #a8345a;
  --sakura-soft: #fbe6ec;
  --ai: #2c4f86;
  --ai-soft: #e4ebf6;
  --matcha: #3f6a35;
  --matcha-soft: #e6f0df;
  --kin: #80580f;
  --kin-soft: #f8eedb;
  --danger: #b23b2a;
  --danger-soft: #fbe5e0;
  --ref: #8f8592;

  --shadow-sm: 0 1px 2px rgba(60, 40, 50, .06);
  --shadow: 0 1px 2px rgba(60, 40, 50, .05), 0 10px 30px -12px rgba(90, 50, 70, .18);
  --radius: 18px;
  --radius-sm: 12px;
  --font-ui: "Be Vietnam Pro", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Noto Serif", "Times New Roman", Georgia, serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #16141a;
    --paper-2: #1c1a21;
    --surface: #201d25;
    --surface-2: #29252f;
    --ink: #f1ebef;
    --ink-2: #d2c8d0;
    --muted: #a99fac;
    --line: #37313d;
    --line-strong: #4a4351;
    --sakura: #ef8fae;
    --sakura-ink: #f6a9c1;
    --sakura-soft: #3a2430;
    --ai: #93b4ec;
    --ai-soft: #222c40;
    --matcha: #9cc78c;
    --matcha-soft: #22301f;
    --kin: #e2b765;
    --kin-soft: #3a3020;
    --danger: #f08e7d;
    --danger-soft: #3c2320;
    --ref: #8d8491;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 30px -14px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #16141a;
  --paper-2: #1c1a21;
  --surface: #201d25;
  --surface-2: #29252f;
  --ink: #f1ebef;
  --ink-2: #d2c8d0;
  --muted: #a99fac;
  --line: #37313d;
  --line-strong: #4a4351;
  --sakura: #ef8fae;
  --sakura-ink: #f6a9c1;
  --sakura-soft: #3a2430;
  --ai: #93b4ec;
  --ai-soft: #222c40;
  --matcha: #9cc78c;
  --matcha-soft: #22301f;
  --kin: #e2b765;
  --kin-soft: #3a3020;
  --danger: #f08e7d;
  --danger-soft: #3c2320;
  --ref: #8d8491;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 30px -14px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ───────── Nền tảng ───────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(1200px 500px at 85% -10%, color-mix(in srgb, var(--sakura) 9%, transparent), transparent 70%),
    radial-gradient(900px 500px at -10% 40%, color-mix(in srgb, var(--ai) 6%, transparent), transparent 70%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
h2 { font-size: 21px; line-height: 1.25; margin: 0; }
p { margin: 0; }
b, strong { font-weight: 600; }
button, input, select { font: inherit; color: inherit; }
kbd {
  font-family: var(--font-ui); font-size: 12px; padding: 1px 6px; border-radius: 6px;
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink-2);
}
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--ai); outline-offset: 2px; }

.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 50;
  background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 10px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.page {
  position: relative; z-index: 1;
  width: min(1320px, 100% - 32px);
  margin: 20px auto 32px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ───────── Cánh hoa rơi ───────── */
.petals { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.petal {
  position: absolute; top: -40px;
  width: 12px; height: 9px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--sakura) 55%, #fff), color-mix(in srgb, var(--sakura) 85%, #fff));
  border-radius: 100% 0 100% 0;
  opacity: .5;
  animation: petal-fall linear infinite, petal-sway ease-in-out infinite alternate;
}
@keyframes petal-fall {
  0% { transform: translate3d(0, -5vh, 0) rotate(0deg); }
  100% { transform: translate3d(14vw, 110vh, 0) rotate(540deg); }
}
@keyframes petal-sway { from { margin-left: -18px; } to { margin-left: 18px; } }

/* ───────── Đầu trang ───────── */
.hero { padding: 22px 24px 14px; overflow: hidden; }
.hero-top {
  display: grid; align-items: center; column-gap: 14px;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  grid-template-areas: "mark eyebrow tools" "mark title tools";
}
.brand-mark {
  grid-area: mark;
  width: 52px; height: 52px; border-radius: 15px;
  display: grid; place-items: center; color: var(--ink);
  background: linear-gradient(145deg, var(--surface-2), var(--sakura-soft));
  border: 1px solid var(--line);
}
.eyebrow { grid-area: eyebrow; align-self: end; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--sakura-ink); font-weight: 600; }
h1 { grid-area: title; align-self: start; margin: 2px 0 0; font-size: clamp(25px, 3.4vw, 36px); line-height: 1.15; }
.lead { margin-top: 12px; max-width: 760px; font-size: 16px; color: var(--ink-2); }
.hero-tools { grid-area: tools; display: flex; gap: 8px; align-self: start; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
}

.journey { margin: 14px -8px 0; }
#lifeCanvas { display: block; width: 100%; height: clamp(210px, 25vw, 290px); }
.journey-legend {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px;
  font-size: 12.5px; color: var(--muted); padding: 2px 0 2px;
}
.journey-legend span { display: inline-flex; align-items: center; gap: 7px; }
.sw { display: inline-block; width: 18px; height: 4px; border-radius: 4px; }
.sw-past { background: var(--line-strong); }
.sw-work { background: var(--ai); }
.sw-retire { background: var(--sakura); }

/* ───────── Bố cục ───────── */
.layout {
  display: grid;
  grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin-top: 20px;
}

/* ───────── Ô nhập liệu ───────── */
.inputs {
  padding: 20px 20px 18px;
  position: sticky; top: 16px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.inputs-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.chip-btn {
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink-2);
  border-radius: 999px; padding: 6px 13px; font-size: 13px; font-weight: 500; cursor: pointer;
}
.chip-btn:hover { border-color: var(--sakura); color: var(--sakura-ink); }

.group { border: 0; padding: 0; margin: 18px 0 0; min-width: 0; }
.group + .group { padding-top: 18px; border-top: 1px dashed var(--line); }
legend {
  display: flex; align-items: center; gap: 10px; padding: 0; margin-bottom: 12px;
  font-family: var(--font-display); font-weight: 600; font-size: 16.5px; color: var(--ink);
}
.step {
  width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center;
  font-family: var(--font-ui); font-size: 12px; font-weight: 600;
  background: var(--ink); color: var(--paper);
}
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { min-width: 0; display: flex; flex-direction: column; }
.field label { font-size: 13.5px; font-weight: 500; color: var(--ink-2); margin-bottom: 5px; }
.req { color: var(--sakura); }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.peek { font-size: 12px; color: var(--ai); margin-top: 4px; min-height: 0; font-weight: 500; }
.peek:empty { display: none; }

input[type="date"], input[type="number"], input[type="text"], input:not([type]), select {
  width: 100%; min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  transition: border-color .15s, box-shadow .15s;
  appearance: none; -webkit-appearance: none;
}
input[type="number"] { -moz-appearance: textfield; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
select {
  padding-right: 34px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px;
  background-size: 5px 5px; background-repeat: no-repeat;
}
input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
input:hover, select:hover { border-color: color-mix(in srgb, var(--ink) 30%, var(--line-strong)); }
input:focus, select:focus { outline: none; border-color: var(--ai); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ai) 18%, transparent); }
.field.invalid input, .field.invalid select { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 14%, transparent); }
.field-error { font-size: 12px; color: var(--danger); margin-top: 4px; }

.suffix { position: relative; }
.suffix input { padding-right: 74px; }
.suffix::after {
  content: attr(data-suffix);
  position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
  font-size: 12px; color: var(--muted); pointer-events: none; white-space: nowrap;
}

.info-line {
  margin-top: 10px; padding: 9px 12px; border-radius: 10px; font-size: 13px;
  background: var(--ai-soft); color: var(--ink-2); line-height: 1.45;
}
.total-line {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 12px; padding: 10px 12px; border-radius: 10px;
  background: var(--surface-2); font-size: 13.5px; color: var(--ink-2);
}
.total-line b { font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums; }

.preset-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.preset {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2);
  border-radius: 999px; padding: 6px 14px; font-size: 13.5px; font-weight: 500; cursor: pointer;
  transition: all .15s;
}
.preset:hover { border-color: var(--sakura); }
.preset.is-on { background: var(--sakura-ink); border-color: var(--sakura-ink); color: #fff; }
:root[data-theme="dark"] .preset.is-on { color: #1d1218; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .preset.is-on { color: #1d1218; } }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); cursor: pointer; margin-bottom: 12px; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--sakura); flex: 0 0 18px; }
#bhxhBox[hidden], #overrideBox[hidden] { display: none; }

.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border-radius: 999px; cursor: pointer;
  font-weight: 600; font-size: 14px; text-decoration: none; border: 1px solid transparent;
  transition: transform .12s, background .15s, border-color .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: color-mix(in srgb, var(--ink) 85%, var(--sakura)); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); }
.only-mobile { display: none; }

/* ───────── Kết quả ───────── */
.results { display: grid; gap: 16px; min-width: 0; scroll-margin-top: 16px; }
#resultsContent { display: grid; gap: 16px; min-width: 0; }
.results [hidden] { display: none !important; }
.results .card { padding: 20px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head p { margin-top: 4px; max-width: 720px; }

.empty { text-align: center; padding: 44px 28px !important; color: var(--ink-2); }
.empty svg { color: var(--ink); margin-bottom: 10px; }
.empty h2 { margin-bottom: 8px; font-size: 24px; }
.empty p { max-width: 460px; margin: 0 auto; }
.error-list {
  list-style: none; padding: 12px 16px; margin: 16px auto 0; max-width: 460px; text-align: left;
  background: var(--danger-soft); color: var(--danger); border-radius: 12px; font-size: 14px;
}
.error-list li + li { margin-top: 4px; }

/* Kết luận */
.verdict { position: relative; overflow: hidden; padding: 22px 22px 20px !important; }
.verdict::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 5px;
  background: linear-gradient(180deg, var(--ai), var(--sakura));
}
.verdict-kicker { font-size: 13px; color: var(--muted); }
.verdict h2 { font-size: clamp(21px, 2.4vw, 27px); margin: 4px 0 8px; }
.verdict-text { color: var(--ink-2); font-size: 15px; max-width: 820px; }
.verdict-text b { color: var(--ink); }
.versus { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; margin-top: 18px; }
.vs-card {
  border-radius: 14px; padding: 15px 16px; border: 1px solid var(--line);
  background: var(--surface-2); min-width: 0;
}
.vs-card.work { background: var(--ai-soft); border-color: color-mix(in srgb, var(--ai) 25%, var(--line)); }
.vs-card.capital { background: var(--sakura-soft); border-color: color-mix(in srgb, var(--sakura) 25%, var(--line)); }
.vs-card.win { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--matcha) 70%, transparent); }
.vs-title { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.vs-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; }
.vs-amount { font-family: var(--font-display); font-size: clamp(24px, 2.6vw, 32px); font-weight: 700; margin: 6px 0 2px; font-variant-numeric: tabular-nums; line-height: 1.15; overflow-wrap: anywhere; }
.vs-real { font-size: 13px; color: var(--muted); }
.vs-status { margin-top: 10px; font-size: 13.5px; display: flex; gap: 6px; align-items: flex-start; }
.vs-mid { display: grid; place-items: center; font-family: var(--font-display); font-style: italic; color: var(--muted); font-size: 15px; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge.ok { background: var(--matcha-soft); color: var(--matcha); }
.badge.bad { background: var(--danger-soft); color: var(--danger); }
.badge.warn { background: var(--kin-soft); color: var(--kin); }
.badge.info { background: var(--ai-soft); color: var(--ai); }
.notice {
  margin-top: 14px; padding: 10px 13px; border-radius: 11px; font-size: 13.5px;
  background: var(--kin-soft); color: var(--ink-2); border: 1px solid color-mix(in srgb, var(--kin) 25%, transparent);
}

/* Chỉ số */
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.kpi { padding: 15px 16px !important; display: flex; flex-direction: column; gap: 3px; }
.kpi-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi-value { font-family: var(--font-display); font-size: 23px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; overflow-wrap: anywhere; }
.kpi-note { font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.kpi .meter { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin: 6px 0 2px; }
.kpi .meter i { display: block; height: 100%; border-radius: 6px; background: var(--matcha); }

/* Biểu đồ */
.chart-ctrls { display: flex; flex-wrap: wrap; gap: 8px; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.seg-btn { border: 0; background: transparent; padding: 6px 13px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; }
.seg-btn.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.legend-item {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); font-size: 13px; color: var(--ink-2); cursor: pointer;
}
.legend-item svg { flex: 0 0 22px; }
.legend-item.off { opacity: .45; }
.legend-item.off span { text-decoration: line-through; }
.chart-wrap { position: relative; }
#wealthChart { display: block; width: 100%; height: 340px; touch-action: pan-y; }
.chart-tip {
  position: absolute; top: 0; left: 0; pointer-events: none; z-index: 3;
  min-width: 190px; padding: 10px 12px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow);
  font-size: 12.5px; line-height: 1.5;
}
.chart-tip .t-head { font-weight: 600; margin-bottom: 4px; color: var(--ink); }
.chart-tip .t-row { display: flex; align-items: center; gap: 7px; justify-content: space-between; }
.chart-tip .t-row span:first-child { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.chart-tip .t-row b { font-variant-numeric: tabular-nums; }
.chart-tip i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* Bảng */
.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
.data th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
  padding: 8px 10px; border-bottom: 1px solid var(--line-strong); white-space: nowrap;
}
.data td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data tr:last-child td { border-bottom: 0; }
.data td.num { white-space: nowrap; }
.data .sub { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.data tr.sel td { background: color-mix(in srgb, var(--sakura-soft) 60%, transparent); }
.data tr.ref td { color: var(--muted); }
.data .row-name { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.pos { color: var(--matcha); }
.neg { color: var(--danger); }

/* Tự do tài chính */
.freedom { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.free-card { border: 1px solid var(--line); border-radius: 14px; padding: 15px 16px; background: var(--surface-2); min-width: 0; }
.free-card h3 { font-size: 15.5px; margin: 0; }
.free-card .lvl { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.free-card .big { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin-top: 10px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.free-card .cap { font-size: 12.5px; color: var(--ink-2); }
.free-card .alt { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-strong); font-size: 12.5px; color: var(--muted); }
.free-card .alt b { color: var(--ink-2); }
.free-card.reach { border-color: color-mix(in srgb, var(--matcha) 55%, var(--line)); background: var(--matcha-soft); }

/* Cách tính */
.method summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.method summary::-webkit-details-marker { display: none; }
.method summary::after { content: "+"; font-size: 22px; color: var(--muted); line-height: 1; }
.method[open] summary::after { content: "–"; }
.method-body { margin-top: 12px; font-size: 14px; color: var(--ink-2); }
.method-body ul { margin: 0; padding-left: 20px; }
.method-body li { margin: 6px 0; }
.method-body h3 { font-size: 15px; margin: 16px 0 4px; }

/* Lời nhắc & chân trang */
.notes { margin-top: 20px; padding: 20px 24px; background: linear-gradient(135deg, var(--surface), var(--sakura-soft)); }
.notes h2 { font-size: 19px; margin-bottom: 8px; }
.notes ul { margin: 0; padding-left: 20px; color: var(--ink-2); font-family: var(--font-display); font-size: 15.5px; line-height: 1.7; }
.footer { text-align: center; padding: 26px 12px 8px; color: var(--ink-2); font-size: 14px; }
.footer p + p { margin-top: 4px; }

/* ───────── Đáp ứng màn hình ───────── */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .inputs { position: static; max-height: none; overflow: visible; }
  .only-mobile { display: inline-flex; }
}
@media (max-width: 860px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .freedom { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .page { width: calc(100% - 24px); margin-top: 12px; }
  .hero { padding: 16px 16px 10px; }
  .hero-top { grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-areas: "mark eyebrow tools" "title title title"; column-gap: 10px; }
  .brand-mark { width: 40px; height: 40px; border-radius: 12px; }
  .brand-mark svg { width: 24px; height: 24px; }
  .eyebrow { align-self: center; letter-spacing: .06em; font-size: 11px; }
  h1 { margin-top: 10px; font-size: 26px; }
  .legend-item { padding: 4px 10px; font-size: 12.5px; }
  .lead { font-size: 15px; }
  .inputs { padding: 16px; }
  .results .card { padding: 16px; }
  .grid-2 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .versus { grid-template-columns: 1fr; }
  .vs-mid { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-value { font-size: 19px; }
  #wealthChart { height: 280px; }
  .journey { margin: 10px -6px 0; }
}
@media (max-width: 420px) {
  .grid-2 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr; }
  .hero-tools .icon-btn { width: 36px; height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .petals { display: none; }
  * { transition: none !important; }
}

/* ───────── In ───────── */
@media print {
  body { background: #fff; color: #000; font-size: 12px; }
  .petals, .hero-tools, .journey, .inputs, .notes, .seg, .skip-link, .form-actions { display: none !important; }
  .page { width: 100%; margin: 0; }
  .layout { display: block; margin: 0; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  .method { display: block; }
  .method-body { display: block; }
  table.data { min-width: 0; }
}
