/* Layout: statement-style tools. Inputs card left (sticky on desktop), live results right,
   full-width year-by-year ledger below, guide content in a reading column. */
:root {
  --bg: #F6F8FC;
  --surface: #FFFFFF;
  --surface-2: #EEF2FA;
  --ink: #0E1A33;
  --muted: #56637C;
  --line: #DCE2EE;
  --brand: #1E3A8A;
  --brand-ink: #FFFFFF;
  --brand-soft: #E7EDFB;
  --gain: #15803D;
  --gain-soft: #E5F5EA;
  --loss: #C62828;
  --loss-soft: #FCE9E9;
  --warn: #A15C07;
  --cta: #F59E0B;
  --cta-ink: #1F1500;
  --c-invest: #3B5BDB;
  --c-gain: #16A34A;
  --c-loss: #DC2626;
  --focus: #2F6BFF;
  --shadow: 0 1px 2px rgba(14, 26, 51, .06), 0 8px 24px rgba(14, 26, 51, .06);
  --f-display: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --f-body: "IBM Plex Sans", "Segoe UI", Roboto, Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --r: 10px;
  --wrap: 1180px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1220; --surface: #121B2E; --surface-2: #18233A; --ink: #E8EDF7; --muted: #9DA9BF;
    --line: #26324C; --brand: #8FB0FF; --brand-ink: #0B1220; --brand-soft: #1A2850;
    --gain: #4ADE80; --gain-soft: #12301F; --loss: #F87171; --loss-soft: #3A1717; --warn: #F5B451;
    --cta: #FBBF24; --cta-ink: #1F1500; --c-invest: #6B8AF5; --c-gain: #1FA866; --c-loss: #EF5350;
    --focus: #8FB0FF; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B1220; --surface: #121B2E; --surface-2: #18233A; --ink: #E8EDF7; --muted: #9DA9BF;
  --line: #26324C; --brand: #8FB0FF; --brand-ink: #0B1220; --brand-soft: #1A2850;
  --gain: #4ADE80; --gain-soft: #12301F; --loss: #F87171; --loss-soft: #3A1717; --warn: #F5B451;
  --cta: #FBBF24; --cta-ink: #1F1500; --c-invest: #6B8AF5; --c-gain: #1FA866; --c-loss: #EF5350;
  --focus: #8FB0FF; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}
/* Regions where markets show rises in red (China, Taiwan, South Korea): swap gain and loss colours */
:root.flip { --gain: #C62828; --gain-soft: #FCE9E9; --c-gain: #DC2626; --loss: #15803D; --loss-soft: #E5F5EA; --c-loss: #16A34A; }
@media (prefers-color-scheme: dark) {
  :root.flip:not([data-theme="light"]) { --gain: #F87171; --gain-soft: #3A1717; --c-gain: #EF5350; --loss: #4ADE80; --loss-soft: #12301F; --c-loss: #1FA866; }
}
:root.flip[data-theme="dark"] { --gain: #F87171; --gain-soft: #3A1717; --c-gain: #EF5350; --loss: #4ADE80; --loss-soft: #12301F; --c-loss: #1FA866; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.55 var(--f-body);
  font-feature-settings: "tnum" 0;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 30; background: var(--surface);
}
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.num, table, .tile-value, .hero-value, .words, input { font-variant-numeric: tabular-nums; }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.15; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: clamp(1.3rem, 1.1rem + .8vw, 1.6rem); font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0; }
.wrap {
  max-width: var(--wrap); margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 12px; }

/* Header */
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 12px; min-height: 60px; }
.logo { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font: 800 1.2rem/1 var(--f-display); letter-spacing: -.02em; }
.logo svg { width: 28px; height: 28px; flex: none; }
.logo b { color: var(--brand); font-weight: 800; }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 500; padding: 8px 10px; border-radius: 8px; font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
.top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink);
  font: 600 .9rem/1 var(--f-body); cursor: pointer;
}
.chip-btn:hover { border-color: var(--brand); }
.chip-btn .sym { font-family: var(--f-display); font-weight: 800; color: var(--brand); }
.icon-btn { width: 40px; padding: 0; justify-content: center; }
.icon-btn svg { width: 20px; height: 20px; }
@media (max-width: 760px) { .nav { display: none; } }

/* Breadcrumb + page head */
.crumbs { font-size: .85rem; color: var(--muted); padding-top: 18px; }
.crumbs a { color: var(--muted); }
.page-head { padding-block: 10px 22px; display: grid; gap: 10px; }
.answer { max-width: 70ch; color: var(--muted); font-size: 1.05rem; }
.usp-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); }
.pill svg { width: 14px; height: 14px; }

/* Tool layout */
.tool { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .tool { grid-template-columns: minmax(0, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.inputs { padding: 20px; display: grid; gap: 18px; position: sticky; top: calc(76px + env(safe-area-inset-top, 0px)); max-height: calc(100vh - 92px - env(safe-area-inset-top, 0px)); overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 900px) { .inputs { position: static; max-height: none; overflow: visible; } }
.group-title { font: 700 .78rem/1 var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-top: 4px; }

.field { display: grid; gap: 8px; min-width: 0; }
.field-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field label, .field legend { font-weight: 600; font-size: .95rem; }
.field legend { padding: 0; margin-bottom: 8px; }
.input-wrap {
  display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: var(--r);
  background: var(--surface-2); min-height: 44px; padding: 0 10px; flex: 0 1 190px; min-width: 0;
}
.input-wrap:focus-within { border-color: var(--focus); background: var(--surface); }
.input-wrap input {
  border: 0; background: transparent; color: var(--ink); width: 100%; min-width: 0;
  font: 700 1.05rem/1 var(--f-display); text-align: right; padding: 10px 0; outline: none;
}
.input-wrap .pre, .input-wrap .suf { color: var(--muted); font-weight: 600; white-space: nowrap; }
.input-wrap .pre { padding-right: 6px; font-family: var(--f-display); }
.input-wrap .suf { padding-left: 6px; font-size: .85rem; }
.field.bad .input-wrap { border-color: var(--loss); }
.words { font-size: .82rem; color: var(--muted); min-height: 1.2em; text-align: right; margin-top: -4px; }
.hint { font-size: .82rem; color: var(--muted); }
input[type="range"] { width: 100%; accent-color: var(--brand); height: 24px; margin: 0; }

fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { position: relative; flex: 1 1 auto; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 6px 12px; text-align: center;
  border: 1.5px solid var(--line); border-radius: var(--r); font-size: .88rem; font-weight: 600; color: var(--muted); background: var(--surface);
}
.seg input:checked + span { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.toggle { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1.5px dashed var(--line); border-radius: var(--r); }
.toggle:has(input:checked) { border-style: solid; border-color: var(--brand); background: var(--brand-soft); }
.toggle input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.toggle label { font-weight: 600; cursor: pointer; display: grid; gap: 2px; }
.toggle label small { font-weight: 400; color: var(--muted); font-size: .82rem; }
.reveal { display: grid; gap: 14px; padding: 4px 0 0 4px; border-left: 3px solid var(--brand-soft); padding-left: 14px; }
details.more { border-top: 1px solid var(--line); padding-top: 14px; }
details.more summary { cursor: pointer; font-weight: 600; color: var(--brand); list-style: none; display: flex; align-items: center; gap: 6px; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "+"; font: 700 1.1rem/1 var(--f-display); width: 1em; }
details.more[open] summary::before { content: "−"; }
details.more > div { display: grid; gap: 16px; margin-top: 14px; }

/* Lots (stock average) */
.lots { display: grid; gap: 8px; }
.lot { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) minmax(0, .8fr) 40px; gap: 8px; align-items: center; }
.lot .idx { color: var(--muted); font-size: .85rem; text-align: center; }
.lot .input-wrap { flex: 1 1 auto; }
.lot-head { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) minmax(0, .8fr) 40px; gap: 8px; font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.lot button { width: 40px; height: 40px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: var(--r); cursor: pointer; font-size: 1.1rem; }
.btn-add { justify-self: start; }

/* Results */
.results { padding: 22px; display: grid; gap: 18px; min-width: 0; }
.hero-label { font-size: .9rem; color: var(--muted); font-weight: 600; }
.hero-value { font: 800 clamp(2.1rem, 1.5rem + 2.6vw, 3.2rem)/1.05 var(--f-display); letter-spacing: -.03em; color: var(--ink); overflow-wrap: anywhere; }
.hero-sub { font-size: 1rem; color: var(--brand); font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tile { padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); display: grid; gap: 4px; min-width: 0; }
.tile-label { font-size: .8rem; color: var(--muted); font-weight: 600; }
.tile-value { font: 700 1.15rem/1.2 var(--f-display); overflow-wrap: anywhere; }
.tile-note { font-size: .78rem; color: var(--muted); }
.tile.gain .tile-value { color: var(--gain); }
.tile.loss .tile-value { color: var(--loss); }
.split { height: 12px; border-radius: 999px; overflow: hidden; display: flex; gap: 2px; background: var(--surface); }
.split i { display: block; height: 100%; }
.split .a { background: var(--c-invest); border-radius: 999px 0 0 999px; }
.split .b { background: var(--c-gain); border-radius: 0 999px 999px 0; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .82rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend i.dash { height: 0; border-top: 2px dashed var(--muted); border-radius: 0; width: 16px; }
.sentence { font-size: 1.02rem; max-width: 62ch; }
.sentence strong { font-family: var(--f-display); }
.insights { display: grid; gap: 8px; }
.insight { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--brand-soft); font-size: .93rem; }
.insight svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--brand); }
.insight.warn { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); }
.insight.warn svg { color: var(--warn); }

/* Chart */
.chart { position: relative; margin: 0; min-width: 0; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis text { fill: var(--muted); font: 500 11px var(--f-body); }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .plan-line { stroke: var(--muted); stroke-dasharray: 4 4; stroke-width: 1.25; }
.chart .plan-label { fill: var(--muted); font: 600 11px var(--f-body); }
.chart .phase-label { fill: var(--muted); font: 600 11px var(--f-body); }
.chart .hit { fill: transparent; cursor: crosshair; }
.tip {
  position: absolute; pointer-events: none; z-index: 5; min-width: 150px; max-width: 220px;
  background: var(--ink); color: var(--bg); border-radius: 8px; padding: 8px 10px; font-size: .8rem; line-height: 1.4;
  box-shadow: var(--shadow); transform: translate(-50%, calc(-100% - 10px));
}
.tip b { font-family: var(--f-display); }
.tip .row { display: flex; justify-content: space-between; gap: 12px; }
.tip i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-right: 5px; }

/* Actions */
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 16px;
  border-radius: var(--r); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  font: 600 .93rem/1 var(--f-body); cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--brand); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--cta); border-color: var(--cta); color: var(--cta-ink); }
.btn.primary:hover { filter: brightness(.96); }

/* Ledger */
.ledger { margin-top: 26px; padding: 20px; display: grid; gap: 14px; }
.ledger-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; }
.ledger-head p { color: var(--muted); font-size: .92rem; max-width: 60ch; }
.ledger .seg { flex: 0 1 360px; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { padding: 10px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; position: sticky; left: 0; background: inherit; }
thead th, thead th:first-child { background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; position: sticky; top: 0; }
tbody tr { background: var(--surface); }
tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }
tbody tr.ext { color: var(--muted); }
tbody tr.end-row { background: var(--brand-soft); font-weight: 700; color: var(--ink); }
tbody tr.divider td { background: var(--surface-2); color: var(--ink); text-align: left; font-weight: 700; font-size: .85rem; white-space: normal; position: static; }
td small { display: block; color: var(--muted); font-size: .75rem; font-weight: 400; }
.ms { display: inline-block; margin-left: 6px; padding: 2px 7px; border-radius: 999px; background: var(--gain-soft); color: var(--gain); font-size: .72rem; font-weight: 700; }
td.neg { color: var(--loss); }

/* Guide content */
.guide { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; margin-top: 40px; align-items: start; }
@media (max-width: 960px) { .guide { grid-template-columns: minmax(0, 1fr); } }
.prose { display: grid; gap: 16px; max-width: 72ch; min-width: 0; }
.prose h2 { margin-top: 18px; }
.prose ul, .prose ol { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; }
.prose .formula { font: 500 .95rem/1.6 var(--f-mono); background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--r); padding: 14px 16px; overflow-x: auto; white-space: pre-wrap; }
.prose table { font-size: .9rem; }
.prose .table-scroll { background: var(--surface); }
.faq { display: grid; gap: 8px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin-top: 10px; color: var(--muted); }
.side { display: grid; gap: 14px; position: sticky; top: calc(80px + env(safe-area-inset-top, 0px)); }
@media (max-width: 960px) { .side { position: static; } }
.side .card { padding: 18px; display: grid; gap: 10px; }
.side h3 { font-size: 1rem; }
.side ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.side li a { display: flex; justify-content: space-between; padding: 8px 0; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); font-weight: 500; }
.side li a:hover { color: var(--brand); }
.meta { font-size: .82rem; color: var(--muted); }

/* Mobile live result bar */
.livebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: none;
  padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: var(--brand); color: var(--brand-ink); box-shadow: 0 -6px 20px rgba(0, 0, 0, .15);
}
.livebar a { color: inherit; text-decoration: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 600; }
.livebar b { font: 800 1.2rem/1 var(--f-display); }
@media (max-width: 900px) { .livebar.on { display: block; } }

/* Home */
.home-hero { padding-block: 36px 26px; display: grid; gap: 16px; }
.home-hero .pill { justify-self: start; }
.home-hero h1 { font-size: clamp(2rem, 1.3rem + 3.2vw, 3.4rem); max-width: 18ch; }
.home-hero p { max-width: 60ch; color: var(--muted); font-size: 1.08rem; }
.search { display: flex; align-items: center; gap: 10px; max-width: 560px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 0 14px; min-height: 52px; box-shadow: var(--shadow); }
.search:focus-within { border-color: var(--focus); }
.search svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.search input { border: 0; outline: none; background: transparent; color: var(--ink); font: 500 1rem var(--f-body); width: 100%; min-width: 0; padding: 12px 0; }
.groups { display: grid; gap: 30px; padding-bottom: 20px; }
.group h2 { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.group h2 small { font: 500 .9rem var(--f-body); color: var(--muted); letter-spacing: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.calc-card { display: grid; gap: 6px; padding: 18px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; transition: border-color .15s, transform .15s; }
.calc-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.calc-card h3 { display: flex; justify-content: space-between; gap: 8px; }
.calc-card h3 span { color: var(--brand); }
.calc-card p { color: var(--muted); font-size: .92rem; }
.calc-card .new { font: 700 .7rem/1 var(--f-body); letter-spacing: .06em; text-transform: uppercase; color: var(--cta-ink); background: var(--cta); padding: 4px 7px; border-radius: 6px; align-self: center; }
.calc-card.feature { background: linear-gradient(160deg, var(--brand-soft), var(--surface) 70%); }
.why { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; padding-block: 10px 30px; }
.why div { padding: 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 6px; }
.why b { font-family: var(--f-display); font-size: 1.02rem; }
.why p { color: var(--muted); font-size: .9rem; }
.empty-search { color: var(--muted); }

/* Footer */
.foot { margin-top: 56px; background: var(--surface); border-top: 1px solid var(--line); }
.foot .wrap { padding-block: 32px calc(32px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 22px; }
.foot-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; }
.foot h4 { margin: 0 0 8px; font: 700 .8rem/1 var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.foot a { color: var(--ink); text-decoration: none; font-size: .92rem; }
.foot a:hover { color: var(--brand); text-decoration: underline; }
.foot .fine { font-size: .82rem; color: var(--muted); max-width: 90ch; }

/* Settings dialog */
dialog.sheet {
  border: 0; padding: 0; border-radius: 16px; width: min(520px, calc(100vw - 24px)); max-height: min(86vh, 760px);
  background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
dialog.sheet::backdrop { background: rgba(8, 14, 28, .55); }
.sheet-inner { display: grid; gap: 18px; padding: 20px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.ccy-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r); }
.ccy-list button { display: flex; width: 100%; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; font: 500 .92rem var(--f-body); }
.ccy-list button[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.ccy-list button span:last-child { color: var(--muted); font-family: var(--f-display); font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: .9rem; z-index: 60; }

/* Static pages */
.doc { max-width: 72ch; display: grid; gap: 14px; padding-block: 10px 20px; }
.doc h2 { margin-top: 14px; }
.doc ul { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;}
.when{display:grid;gap:14px}
