/* Brand tokens: adjust these to match the Leaton Wealth site. */
:root {
  --ink: #14213d;
  --ink-soft: #4a5568;
  --muted: #718096;
  --line: #e2e8f0;
  --bg: #ffffff;
  --panel: #f7f8fa;
  --accent: #1f4e79;
  --accent-ink: #ffffff;
  --gold: #b08d57;
  --pos: #2f7d4f;
  --neg: #b4443a;
  --warn-bg: #fff8e6;
  --warn-line: #e8c96a;
  --s-cautious: #8fa3bf;
  --s-middle: #1f4e79;
  --s-strong: #b08d57;
  --s-paid: #718096;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

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

.explorer { max-width: 1120px; margin: 0 auto; padding: 24px 16px 40px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Header */
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.eyebrow { margin: 0; color: var(--gold); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-size: 13px; }
.hero h1 { font-size: clamp(26px, 4vw, 38px); line-height: 1.15; margin: 10px 0 12px; max-width: 22ch; }
.intro { color: var(--ink-soft); max-width: 70ch; margin: 0 0 12px; }
.badge { display: inline-block; margin: 0; padding: 4px 10px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; color: var(--ink-soft); }

.lang { display: flex; gap: 4px; }
.lang button {
  font: inherit; font-size: 14px; font-weight: 600; padding: 6px 10px; min-width: 44px; min-height: 36px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink-soft); border-radius: 6px; cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.star { color: var(--muted); text-decoration: none; margin-left: 2px; }
.fineprint { color: var(--muted); font-size: 12.5px; line-height: 1.45; }

/* Wizard */
.wizard { max-width: 640px; margin: 28px 0 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.wizard h2 { font-size: 22px; margin: 0 0 14px; outline: none; }
.progress { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 20px; counter-reset: step; }
.progress li { flex: 1; font-size: 13px; color: var(--muted); counter-increment: step; }
.progress li::before { content: ""; display: block; height: 4px; border-radius: 2px; background: var(--line); margin-bottom: 6px; }
.progress li.done::before, .progress li.current::before { background: var(--accent); }
.progress li.current { color: var(--ink); font-weight: 600; }
.progress li span::before { content: counter(step) ". "; }
.step-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; }
.step-nav #next { margin-left: auto; }

.button {
  display: inline-block; font: inherit; font-weight: 700; padding: 11px 20px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); text-decoration: none;
}
.button.secondary { background: var(--bg); color: var(--accent); }
.button.light { background: var(--accent-ink); color: var(--accent); border-color: var(--accent-ink); }
[hidden] { display: none !important; }

.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 480px) { .choices { grid-template-columns: 1fr; } }
.choice { position: relative; display: block; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 12px 40px; cursor: pointer; }
.choice input { position: absolute; left: 14px; top: 15px; width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.choice:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); box-shadow: inset 0 0 0 1px var(--accent); }
.choice-body { display: block; }
.choice-body strong { display: block; }
.choice-mix { display: block; font-size: 13px; color: var(--muted); }
.choice-return { display: block; margin-top: 4px; font-weight: 600; color: var(--accent); font-size: 14px; }

/* Assumptions (inside results) */
.assumptions { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 24px 0 0; background: var(--bg); }
.assumptions h4 { font-size: 15px; margin: 18px 0 8px; }
.help { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.field { display: block; margin: 0 0 14px; }
.field > span:first-child, .field > label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.field small, .check small { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }

input:not([type]), input[inputmode], select {
  width: 100%; font: inherit; padding: 9px 11px; border: 1px solid #cbd5e0; border-radius: 6px; background: #fff; color: var(--ink);
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: 2px;
}
input:disabled { background: var(--panel); color: var(--muted); }

.input-wrap { position: relative; display: block; }
.input-wrap.euro input { padding-left: 28px; }
.input-wrap.euro::before { content: "€"; position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-wrap.pct input { padding-right: 28px; }
.input-wrap.pct::after { content: "%"; position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }

.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input { flex: 1; accent-color: var(--accent); }
.range-row output { min-width: 64px; font-weight: 700; text-align: right; }

.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.grid4 .field > span:first-child { font-weight: 500; }
@media (max-width: 560px) { .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.check { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; font-size: 14px; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--accent); }

.assumptions summary { font-weight: 700; cursor: pointer; }
.assumptions[open] summary { margin-bottom: 8px; }
.link-button { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; }

/* Results */
.results { margin-top: 28px; }
.results-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 4px; }
.results h2 { margin: 0; font-size: 24px; outline: none; }
.results h3 { margin: 28px 0 10px; font-size: 18px; }
.results h4 { margin: 16px 0 6px; font-size: 15px; }
.summary { color: var(--ink-soft); margin: 0 0 16px; }

.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 1100px) { .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 420px) { .cards { grid-template-columns: 1fr; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.card-label { display: block; font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.card.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.card.accent .card-label, .card.accent small { color: var(--accent-ink); opacity: .85; }
.card-value { display: block; font-size: 22px; margin: 4px 0; font-variant-numeric: tabular-nums; }
.card small { color: var(--muted); font-size: 13px; line-height: 1.4; display: block; }

.chart { margin: 24px 0 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.chart figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--ink-soft); }
.key::before { content: ""; display: inline-block; width: 16px; height: 3px; margin-right: 6px; vertical-align: middle; border-radius: 2px; }
.key-selected::before { background: var(--s-middle); height: 4px; }
.key-other::before { background: var(--s-cautious); }
.key-paid::before { background: repeating-linear-gradient(90deg, var(--s-paid) 0 4px, transparent 4px 7px); }
#chart svg { width: 100%; height: auto; display: block; }
#chart .grid { stroke: var(--line); }
#chart .axis { fill: var(--muted); font-size: 12px; font-family: var(--font); }
#chart .line { fill: none; stroke-width: 2.5; stroke-linejoin: round; }
#chart .line-other { stroke: var(--s-cautious); stroke-width: 1.5; opacity: .7; }
#chart .line-selected { stroke: var(--s-middle); stroke-width: 3.5; }
#chart .line-paid { stroke: var(--s-paid); stroke-dasharray: 5 4; stroke-width: 1.5; }
#chart .dot-selected { fill: var(--s-middle); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; white-space: normal; }
thead th { font-size: 13px; color: var(--ink-soft); font-weight: 600; }
tbody th { font-weight: 500; }
tr.total th, tr.total td { font-weight: 700; border-top: 2px solid var(--ink); }
tr.selected th, tr.selected td { background: color-mix(in srgb, var(--accent) 7%, transparent); font-weight: 700; }
td.pos { color: var(--pos); font-weight: 600; }
td.neg { color: var(--neg); font-weight: 600; }

.compare ul, .points ul, .not-modelled ul { padding-left: 20px; margin: 8px 0; }
.compare li, .points li, .not-modelled li { margin: 6px 0; }
/* Inheritance */
.estate { margin-top: 28px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); }
.estate.highlight { border-color: var(--gold); box-shadow: inset 4px 0 0 var(--gold); }
.estate h3 { margin-top: 0; }
.estate-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
@media (max-width: 480px) { .estate-grid { grid-template-columns: 1fr; } }
.estate-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.estate-box.planned { border-color: var(--pos); background: color-mix(in srgb, var(--pos) 7%, var(--bg)); }
.estate-box.planned .card-value { color: var(--pos); }
.estate-box small { display: block; color: var(--ink-soft); font-size: 13px; line-height: 1.4; }
.estate-points { padding-left: 20px; margin: 8px 0; }
.estate-points li { margin: 6px 0; }

.callout { background: var(--panel); border-left: 3px solid var(--gold); padding: 10px 14px; border-radius: 4px; }
.point-shortHorizon { color: var(--neg); }

.cta { margin-top: 28px; padding: 20px; border-radius: var(--radius); background: var(--accent); color: var(--accent-ink); }
.cta h3 { margin-top: 0; }
.cta .privacy { font-size: 13px; opacity: .85; margin-bottom: 0; }

.not-modelled { margin-top: 20px; }
.not-modelled summary { cursor: pointer; font-weight: 600; }

.footer { margin-top: 36px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.45; }
.footer p { margin: 0 0 6px; }
.error { padding: 16px; color: var(--neg); }

/* Keep wide tables inside their scroll box on narrow screens. */
.results > * { min-width: 0; }
@media (max-width: 480px) {
  th, td { padding: 8px 6px; }
  .wizard { padding: 16px; }
}
