/* Tested Markets website: the app's colours (src/theme/colors.ts), dark first, light by the system setting. No outside fonts. */
:root {
  --bg: #0B0F14; --surface: #141B24; --raised: #232D3A; --line: #3A4656;
  --ink: #EEF2F6; --soft: #C9D2DC; --muted: #8B97A5;
  --accent: #F5B83D; --accent-fill: #F5B83D; --on-accent: #0B0F14; --accent-wash: rgba(245, 184, 61, 0.18);
  --up: #2BD47D; --down: #FF5A5F;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #F4F6F9; --surface: #FFFFFF; --raised: #E8EDF3; --line: #C6CFD9;
    --ink: #0B0F14; --soft: #2B3643; --muted: #5D6875;
    --accent: #A86B00; --accent-wash: rgba(245, 184, 61, 0.28);
    --up: #0E8F52; --down: #D3343A;
    color-scheme: light;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); }
.wrap { width: 100%; max-width: 880px; margin: 0 auto; padding: 0 16px; }

.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; }
.brand { color: var(--ink); text-decoration: none; font-weight: 900; letter-spacing: 0.04em; font-size: 18px; white-space: nowrap; }
.brand span { color: var(--accent); }
.brand small { font-weight: 600; letter-spacing: 0; color: var(--muted); font-size: 14px; }
nav { display: flex; gap: 14px; overflow-x: auto; }
nav a { color: var(--soft); text-decoration: none; font-size: 14px; font-weight: 600; white-space: nowrap; }
nav a:hover { color: var(--accent); }
@media (max-width: 560px) { nav a[href="#started"] { display: none; } }

.hero { padding-top: 40px; padding-bottom: 8px; }
.kicker { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 13px; margin: 0 0 8px; }
h1 { font-size: clamp(30px, 7vw, 48px); line-height: 1.1; margin: 0 0 14px; letter-spacing: -0.02em; }
.hl { color: var(--accent); }
.lead { color: var(--soft); font-size: 18px; margin: 0 0 8px; max-width: 640px; }
.lead.small { font-size: 16px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px 16px; margin: 20px auto; }
@media (min-width: 900px) { .card { padding: 28px; } }
.card h2 { margin: 0 0 14px; font-size: 22px; }
.card h3 { margin: 26px 0 8px; font-size: 17px; }

.inputs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 14px; }
@media (max-width: 640px) { .inputs { grid-template-columns: 1fr 1fr; } }
.inputs label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.money { display: flex; align-items: center; gap: 6px; background: var(--raised); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; color: var(--soft); font-size: 18px; font-weight: 700; }
.money:focus-within { border-color: var(--accent); }
.money input { flex: 1; min-width: 0; width: 100%; background: transparent; border: 0; color: var(--ink); font: inherit; padding: 10px 0; outline: none; font-variant-numeric: tabular-nums; }
.years { grid-column: 1 / -1; }
.years output { color: var(--accent); font-size: 15px; }
input[type="range"] { width: 100%; accent-color: var(--accent-fill); height: 28px; }
.switch { grid-column: 1 / -1; flex-direction: row !important; align-items: center; gap: 10px !important; font-size: 15px !important; color: var(--soft) !important; cursor: pointer; }
.switch input { width: 20px; height: 20px; accent-color: var(--accent-fill); }

.headline { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 20px 0 6px; }
@media (max-width: 520px) { .headline { grid-template-columns: 1fr 1fr; } .headline .main { grid-column: 1 / -1; order: -1; } }
.stat { background: var(--raised); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat.main { background: var(--accent-wash); outline: 1px solid var(--accent); }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat-label small { font-weight: 500; }
.stat-num { font-size: clamp(20px, 5vw, 28px); font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat.main .stat-num { color: var(--accent); }
.note { color: var(--muted); font-size: 14px; margin: 8px 0 0; }

.chart { margin: 18px 0 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--soft); margin-bottom: 8px; }
.sw { display: inline-block; width: 14px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.sw-mid { background: var(--accent); height: 3px; }
.sw-band { background: var(--accent-wash); outline: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.sw-paid { height: 0; border-top: 2px dashed var(--muted); border-radius: 0; }
.plot { position: relative; width: 100%; height: 280px; touch-action: pan-y; }
.plot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.plot .axis text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.plot .grid line { stroke: var(--line); stroke-width: 1; opacity: 0.6; }
.tip { position: absolute; pointer-events: none; background: var(--raised); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 13px; line-height: 1.4; white-space: nowrap; box-shadow: 0 6px 20px rgba(0,0,0,0.25); font-variant-numeric: tabular-nums; }
.tip b { color: var(--accent); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 15px; }
th, td { text-align: right; padding: 9px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
td.typ { color: var(--accent); font-weight: 800; }
td.low { color: var(--soft); }
tr.na td { color: var(--muted); }

.started-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.started-row label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
select { background: var(--raised); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: 700 18px/1.2 inherit; font-family: inherit; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: transparent; color: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; font: 600 14px/1 inherit; font-family: inherit; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--accent-fill); color: var(--on-accent); border-color: var(--accent-fill); }

.steps { padding-left: 22px; margin: 8px 0 0; }
.steps li { margin: 0 0 12px; color: var(--soft); }
.steps b { color: var(--ink); }
.warn { background: var(--raised); border-left: 3px solid var(--accent); border-radius: 8px; padding: 10px 12px; margin: 16px 0 0; color: var(--soft); font-size: 15px; }

.app .btn { display: inline-block; margin-top: 6px; background: var(--accent-fill); color: var(--on-accent); font-weight: 800; text-decoration: none; padding: 12px 18px; border-radius: 12px; }
.foot { color: var(--muted); font-size: 13px; padding-top: 8px; padding-bottom: 40px; }
.foot .links a { color: var(--soft); }
.legal h1 { font-size: 30px; margin-top: 32px; }
.legal p, .legal li { color: var(--soft); }
.todo { background: var(--accent-wash); border: 1px dashed var(--accent); padding: 2px 6px; border-radius: 6px; }

/* cookie banner */
.consent { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 20; max-width: 560px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.35); font-size: 14px; color: var(--soft); }
.consent p { margin: 0 0 10px; }
.consent b { color: var(--ink); }
.consent-more[hidden] { display: none; }
.consent-more { display: flex; flex-direction: column; gap: 6px; margin: 0 0 10px; }
.consent-more label { display: flex; align-items: center; gap: 8px; }
.consent-more input { width: 18px; height: 18px; accent-color: var(--accent-fill); }
.consent-btns { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
@media (max-width: 420px) { .consent-btns { grid-template-columns: 1fr 1fr; } .consent-btns .primary { grid-column: 1 / -1; order: -1; } }
.consent button { background: var(--raised); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 10px 8px; font: 700 14px/1.2 inherit; font-family: inherit; cursor: pointer; }
.consent button.primary { background: var(--accent-fill); color: var(--on-accent); border-color: var(--accent-fill); }
