/* Numbers vs Narrative — visual identity taken from the book cover of
 * "Smart Investing for Teens": cover red + yellow band, heavy condensed black
 * titles with a white outline, sticker-style cards with a hard offset shadow.
 * Fonts are self-hosted (SIL OFL): no third-party requests (minors' privacy).
 * Numbers (facts) = money green. Hype = cover red. */
@font-face { font-family: "Anton"; src: url(fonts/anton-latin.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Nunito"; src: url(fonts/nunito-latin-var.woff2) format("woff2"); font-weight: 400 800; font-display: swap; }

:root {
  color-scheme: light;
  --red: #ff1a2d; --red-ink: #c8101f; --yellow: #ffcc00; --yellow-soft: #fff3b8;
  --bg: #fff8dc; --panel: #ffffff; --ink: #141414; --muted: #55524a; --faint: #8a8577; --line: #141414; --hair: #e9e2c8;
  --fact: #12844a; --fact-soft: rgba(18, 132, 74, .12);
  --hype: #e0142a; --hype-soft: rgba(224, 20, 42, .10);
  --pink: #f28cc0;
  --good: #12844a; --ok: #55524a; --warn: #a86a00; --crit: #c8101f;
  --shadow: 4px 4px 0 var(--line);
  --display: "Anton", Impact, "Arial Narrow Bold", sans-serif;
  --sans: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #15130d; --panel: #211e16; --ink: #f6f1e1; --muted: #c9c2ad; --faint: #9a937f; --line: #f6f1e1; --hair: #3a3527;
    --yellow-soft: #3b3210;
    --fact: #49d18a; --fact-soft: rgba(73, 209, 138, .16);
    --hype: #ff5a68; --hype-soft: rgba(255, 90, 104, .16);
    --good: #49d18a; --ok: #c9c2ad; --warn: #ffc53d; --crit: #ff6b76;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
.mono, code { font-family: var(--mono); font-size: .9em; }
.num { color: var(--fact); } .nar { color: var(--hype); }
h1, h2, h3 { text-wrap: balance; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.appbar { position: sticky; top: 0; z-index: 10; background: var(--red); border-bottom: 3px solid #141414; padding-top: env(safe-area-inset-top, 0px); }
.appbar-in { max-width: 820px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 8px max(14px, env(safe-area-inset-right, 0px)) 8px max(14px, env(safe-area-inset-left, 0px)); }
.logo { text-decoration: none; display: inline-flex; align-items: baseline; gap: 2px; background: var(--yellow); border: 2.5px solid #141414; border-radius: 10px; padding: 2px 8px; box-shadow: 2px 2px 0 #141414; flex: none; }
.logo-n { font-family: var(--display); font-size: 20px; letter-spacing: .5px; line-height: 1.2; color: #141414; }
.logo-vs { font-family: var(--sans); font-weight: 800; font-size: 12px; color: #141414; }
.tabs { display: flex; gap: 6px; flex: 1; justify-content: flex-end; min-width: 0; }
.tab { text-decoration: none; color: #fff; font-weight: 800; font-size: 14px; line-height: 1.15; padding: 5px 10px; border-radius: 10px; border: 2.5px solid transparent; display: grid; text-align: center; white-space: nowrap; }
.tab .ti { font-size: 16px; line-height: 1.1; }
.tab[aria-current="page"] { background: #fff; color: #141414; border-color: #141414; box-shadow: 2px 2px 0 #141414; }
@media (max-width: 520px) { .tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; } .tab { font-size: 12.5px; padding: 3px 2px; min-width: 0; } .logo-n { font-size: 19px; } }

.wrap { max-width: 820px; margin: 0 auto; padding: 18px max(16px, env(safe-area-inset-right, 0px)) calc(70px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.view { display: grid; gap: 18px; }
.view > *, #results > * { min-width: 0; }

/* ---------- home ---------- */
.hero { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; background: var(--yellow); border: 3px solid #141414; border-radius: 20px; box-shadow: 6px 6px 0 #141414; padding: 20px; color: #141414; }
.cover { width: 150px; height: auto; border-radius: 6px; border: 2.5px solid #141414; box-shadow: 4px 4px 0 #141414; transform: rotate(-3deg); background: var(--red); }
.kicker { margin: 0; font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.hero h1 { font-family: var(--display); font-weight: 400; font-size: clamp(34px, 8vw, 54px); line-height: 1.02; margin: 4px 0 8px; color: #141414; text-shadow: 2px 2px 0 #fff, -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff; letter-spacing: .5px; }
.hero h1 .vs { font-family: var(--sans); font-weight: 800; font-size: .45em; text-shadow: none; vertical-align: middle; }
.hero p { margin: 0; font-weight: 700; font-size: 18px; }
.hero .sub-title { font-family: var(--display); font-size: 22px; letter-spacing: .5px; margin: -4px 0 8px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px !important; font-size: 13px !important; }
.tags span { background: #fff; border: 2px solid #141414; border-radius: 999px; padding: 1px 10px; }
@media (max-width: 520px) { .tags { justify-content: center; } }
@media (max-width: 520px) { .hero { grid-template-columns: 1fr; text-align: center; justify-items: center; } .cover { width: 120px; } }

.parts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 700px) { .parts-grid { grid-template-columns: 1fr; } }
.part-card { text-decoration: none; background: var(--panel); border: 3px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 16px; display: grid; gap: 6px; align-content: start; position: relative; overflow: hidden; }
.part-card::after { content: ""; position: absolute; right: -24px; top: -24px; width: 80px; height: 80px; border-radius: 50%; background: var(--accent); opacity: .9; border: 3px solid var(--line); }
.pc-money { --accent: var(--pink); } .pc-check { --accent: var(--red); } .pc-paper { --accent: var(--yellow); }
.part-card h2 { font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1.05; margin: 4px 0 0; letter-spacing: .3px; }
.part-card p { margin: 0; color: var(--muted); font-size: 15px; }
.part-card .go { font-weight: 800; margin-top: 4px; }
.pc-icon { font-size: 30px; line-height: 1; }
.part-card:hover, .part-card:focus-visible { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 var(--line); }
.chip { justify-self: start; display: inline-block; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; background: var(--yellow); color: #141414; border: 2px solid #141414; border-radius: 999px; padding: 1px 10px; }

.page-head { display: grid; gap: 4px; }
.page-head h1 { font-family: var(--display); font-weight: 400; font-size: clamp(34px, 7vw, 46px); line-height: 1.05; margin: 2px 0 0; letter-spacing: .4px; }
.page-head p { margin: 0; color: var(--muted); font-weight: 600; }

/* ---------- blocks ---------- */
.step, .card { background: var(--panel); border: 2.5px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 18px 18px; }
.step h2 { font-size: 19px; font-weight: 800; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.stepn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--yellow); color: #141414; border: 2.5px solid #141414; font-family: var(--display); font-size: 17px; flex: none; }
.card h3 { font-size: 17px; font-weight: 800; margin: 0 0 10px; }
.lede { margin: 0 0 12px; color: var(--muted); }
.cite { font-family: var(--sans); font-size: 11px; font-weight: 800; color: #141414; background: var(--yellow-soft); border: 1.5px solid var(--hair); border-radius: 6px; padding: 0 6px; margin-left: 6px; vertical-align: 2px; white-space: nowrap; }
@media (prefers-color-scheme: dark) { .cite { color: var(--ink); } }
.note { color: var(--muted); font-size: 14px; }
.help { margin: 2px 0 0; font-size: 14px; color: var(--faint); }

.field { display: grid; gap: 6px; }
.field + .field, .grid3 + .field { margin-top: 12px; }
.field label { font-size: 14px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
input, textarea { font: inherit; font-size: 17px; padding: 12px 14px; border: 2.5px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); width: 100%; font-variant-numeric: tabular-nums; }
textarea { resize: vertical; font-size: 16px; }
input:focus, textarea:focus { outline: none; box-shadow: 0 0 0 4px var(--yellow); }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--red); }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 600px) { .grid3 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: center; margin-top: 12px; font-size: 15px; font-weight: 600; }

/* buttons */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; align-items: center; }
.actions.center { justify-content: center; }
.btn, button.primary, button.secondary { font: inherit; font-weight: 800; font-size: 16px; border-radius: 12px; padding: 11px 18px; min-height: 46px; cursor: pointer; border: 2.5px solid #141414; box-shadow: 3px 3px 0 #141414; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; text-align: center; color: #141414; max-width: 100%; }
.btn.primary, button.primary { background: var(--yellow); }
.btn.ghost, button.secondary { background: #fff; }
.btn:active, button.primary:active, button.secondary:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #141414; }
button.small { padding: 5px 12px; font-size: 14px; min-height: 36px; }
button.link, label.link { background: none; border: none; padding: 0; color: inherit; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; font: inherit; font-weight: 800; cursor: pointer; box-shadow: none; }
.danger-btn { font: inherit; font-weight: 800; background: var(--red); color: #fff; border: 2.5px solid #141414; border-radius: 10px; padding: 6px 12px; cursor: pointer; }
.card.danger { border-style: dashed; box-shadow: none; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

.msg { border-radius: 12px; padding: 10px 12px; margin: 12px 0 0; font-size: 15px; font-weight: 600; border: 2px solid currentColor; }
.msg.err { color: var(--crit); background: var(--hype-soft); }
.msg.warn { color: var(--warn); background: var(--yellow-soft); }
.msg.ok { color: var(--good); background: var(--fact-soft); }

/* ---------- price lookup guide ---------- */
.lookup { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.lookup .btn { font-size: 14.5px; padding: 9px 14px; flex: 1 1 0; min-width: 0; }
.guide { border: 2px dashed var(--hair); border-radius: 14px; padding: 10px 12px; margin-bottom: 14px; background: var(--yellow-soft); }
.guide summary { font-weight: 800; cursor: pointer; }
.guide-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-top: 10px; align-items: start; }
@media (max-width: 600px) { .guide-body { grid-template-columns: minmax(0, 1fr); } }
.mock { margin: 0; min-width: 0; overflow-wrap: anywhere; background: #fff; color: #141414; border: 2px solid #141414; border-radius: 12px; padding: 12px; font-size: 13.5px; font-family: system-ui, sans-serif; }
.mock-head { color: #555; } .mock-head b { color: #141414; }
.mock-price { font-size: 26px; font-weight: 800; margin: 4px 0 8px; display: flex; align-items: center; gap: 8px; }
.mock-price small { font-size: 13px; color: #12844a; font-weight: 700; }
.mock-rows > div { display: flex; justify-content: space-between; gap: 8px; min-width: 0; flex-wrap: wrap; padding: 5px 0; border-top: 1px solid #e6e6e6; }
.mock-rows > .hl { background: #fff3b8; margin: 0 -6px; padding: 5px 6px; border-radius: 6px; border-top-color: transparent; font-weight: 700; }
.mock-rows > .hl > span:first-child { display: flex; gap: 6px; align-items: center; }
.mock figcaption { margin-top: 8px; font-size: 12px; color: #777; }
.how { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 10px; font-size: 15px; }
.how li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px; align-items: start; }
.pin.tip { background: var(--yellow); color: #141414; }
.pin { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 800; font-size: 12px; border: 2px solid #141414; flex: none; font-family: var(--sans); }
.lo { color: #0f6fb8; } .hi { color: #c8101f; }
@media (prefers-color-scheme: dark) { .how .lo { color: #7cc0ff; } .how .hi { color: #ff7a85; } }

/* ---------- results ---------- */
#results { display: grid; gap: 16px; margin-top: 4px; }
.verdict { border: 3px solid #141414; border-radius: 20px; box-shadow: 6px 6px 0 #141414; padding: 22px 20px; text-align: center; color: #141414; background: #fff; }
.verdict.good { background: #c9f2d9; }
.verdict.meh { background: #ece7d6; }
.verdict.mid { background: var(--yellow); }
.verdict.crit { background: #ffb3ba; }
.v-icon { font-size: 44px; line-height: 1; margin: 4px 0; }
.verdict .tkr { font-weight: 800; font-size: 13px; letter-spacing: .05em; text-transform: uppercase; margin: 0 0 4px; }
.verdict h2 { font-family: var(--display); font-weight: 400; font-size: clamp(26px, 6vw, 36px); line-height: 1.1; margin: 2px 0 8px; letter-spacing: .3px; }
.verdict p { margin: 0 auto; max-width: 50ch; font-weight: 600; }
.scores { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.scores { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 340px; margin-left: auto; margin-right: auto; }
.score { background: #fff; border: 2px solid #141414; border-radius: 14px; padding: 6px 4px; font-weight: 800; display: grid; }
.score small { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.score b { font-variant-numeric: tabular-nums; font-size: 24px; line-height: 1.1; }
.score.f b { color: #12844a; } .score.h b { color: #c8101f; }
.echo { margin: -4px 0 0; text-align: center; color: var(--muted); font-size: 14.5px; font-weight: 600; }

.radar-wrap { max-width: 420px; margin: 0 auto; }
#radar text { fill: var(--ink); font-size: 13px; font-family: var(--sans); font-weight: 800; }
#radar .grid { fill: none; stroke: var(--hair); stroke-width: 1.5; }
#radar .fact { fill: var(--fact-soft); stroke: var(--fact); stroke-width: 3; }
#radar .hype { fill: var(--hype-soft); stroke: var(--hype); stroke-width: 3; stroke-dasharray: 6 5; }
.legend { display: flex; justify-content: center; gap: 8px; align-items: center; font-size: 14px; font-weight: 700; flex-wrap: wrap; }
.sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 2px solid var(--line); }
.sw.f { background: var(--fact); } .sw.h { background: var(--hype); margin-left: 10px; }

details.more { margin-top: 10px; }
details.more > summary, details.fold > summary { cursor: pointer; font-weight: 800; list-style: none; }
details.more > summary::before, details.fold > summary::before { content: "▸ "; display: inline-block; }
details[open].more > summary::before, details[open].fold > summary::before { transform: rotate(90deg); }
details.more > summary::-webkit-details-marker, details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary { display: flex; align-items: center; gap: 4px; }
details.fold > summary h3 { display: inline; margin: 0; }
details[open].fold > summary { margin-bottom: 12px; }

table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
td, th { padding: 8px 6px; border-top: 1.5px solid var(--hair); text-align: left; vertical-align: top; }
th { font-weight: 800; font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
td.n { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 14px; }
.gapbar { height: 6px; border-radius: 3px; background: var(--hype); margin-top: 3px; }
.pill { display: inline-block; font-size: 12px; font-weight: 800; border-radius: 999px; padding: 0 9px; border: 2px solid currentColor; white-space: nowrap; }
.s-good { color: var(--good); } .s-ok { color: var(--ok); } .s-watch { color: var(--warn); } .s-bad { color: var(--crit); } .s-info, .s-na { color: var(--faint); }

.meter { height: 18px; border-radius: 9px; background: linear-gradient(90deg, var(--fact-soft), var(--yellow-soft), var(--hype-soft)); border: 2.5px solid var(--line); overflow: hidden; }
.meter-fill { height: 100%; background: var(--hype); width: 0; }
@media (prefers-reduced-motion: no-preference) { .meter-fill { transition: width .6s ease; } }
.parts { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: 14.5px; display: grid; gap: 4px; }

.filter { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.filter li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; border-top: 1.5px solid var(--hair); padding-top: 8px; font-weight: 700; }
.filter li:first-child { border-top: 0; padding-top: 0; }
.filter .why { grid-column: 1 / -1; color: var(--muted); font-size: 14px; font-weight: 500; }
.choice { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.choice button { font: inherit; font-weight: 800; font-size: 13.5px; padding: 4px 12px; border: 2px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 999px; cursor: pointer; }
.choice button[aria-pressed="true"] { background: var(--yellow); color: #141414; border-color: #141414; box-shadow: 2px 2px 0 #141414; }

.statements { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 640px) { .statements { grid-template-columns: 1fr; } }
.stmt { border: 2px solid var(--line); border-radius: 14px; padding: 12px; background: var(--panel); }
.stmt h4 { margin: 0; font-size: 15px; font-weight: 800; }
.stmt .vibe { margin: 0 0 8px; font-size: 13px; color: var(--faint); font-weight: 700; }
.stmt dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; font-size: 14.5px; }
.stmt dt { color: var(--muted); } .stmt dd { margin: 0; font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; font-size: 14px; }

.bars { display: grid; gap: 8px; align-items: end; height: 150px; margin-top: 6px; }
.bar { display: grid; grid-template-rows: auto 1fr auto; height: 100%; text-align: center; font-size: 12.5px; gap: 2px; }
.bar .v { font-family: var(--mono); font-weight: 700; }
.bar .col { align-self: end; background: var(--fact); border: 2px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0; min-height: 4px; }
.bar .col.neg { background: var(--hype); }
.bar .y { color: var(--muted); font-weight: 800; }
.source p, .src { margin: 0 0 8px; font-size: 14.5px; color: var(--muted); }
.src { list-style: none; padding: 0; display: grid; gap: 4px; }

/* ---------- paper fund + money ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 4px 0 12px; }
.kpis > div { border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; display: grid; background: var(--yellow-soft); }
.kpis .k { font-size: 12.5px; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.kpis b { font-size: 21px; font-variant-numeric: tabular-nums; font-weight: 800; }
.up { color: var(--good); } .down { color: var(--crit); }
.alloc { display: flex; height: 18px; border-radius: 9px; overflow: hidden; border: 2.5px solid var(--line); }
.seg { height: 100%; background: hsl(calc(140 + var(--i) * 67) 62% 48%); border-right: 2px solid var(--line); }
.seg.cash, .dot.cash { background: var(--hair); }
.alloc-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13.5px; font-weight: 700; color: var(--muted); margin: 8px 0 0; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; border: 1.5px solid var(--line); background: hsl(calc(140 + var(--i) * 67) 62% 48%); }
.scroll { overflow-x: auto; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.list li { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; border-top: 1.5px solid var(--hair); padding-top: 8px; }
.list li:first-child { border-top: 0; padding-top: 0; }
.journal li { display: block; }
.journal p { margin: 4px 0 0; }
.risk { margin-top: 14px; }
.risk p { margin: 0 0 8px; }
.sub { font-size: 16px; font-weight: 800; margin: 12px 0 8px; }
.budget { display: grid; gap: 10px; }
.brow { display: grid; grid-template-columns: minmax(110px, 1.2fr) 2fr auto; gap: 10px; align-items: center; font-size: 15px; font-weight: 700; }
@media (max-width: 520px) { .brow { grid-template-columns: 1fr; gap: 4px; } }
.btrack { position: relative; height: 16px; border-radius: 8px; background: var(--bg); border: 2px solid var(--line); }
.bfill { height: 100%; border-radius: 6px; background: var(--pink); }
.btarget { position: absolute; top: -5px; bottom: -5px; width: 3px; background: var(--ink); }
.meter.shield { background: var(--bg); }
.meter.shield .meter-fill { background: var(--fact); }
.kinds { flex-wrap: wrap; margin-bottom: 14px; }
.days { display: flex; flex-wrap: wrap; gap: 6px; }
.day { font-size: 13px; font-weight: 800; padding: 4px 10px; border-radius: 999px; border: 2px solid var(--hair); color: var(--muted); }
.day.on { border-color: var(--line); background: var(--yellow); color: #141414; }
.day.today { outline: 3px solid var(--red); outline-offset: 1px; }
.big { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; margin: 10px 0 4px; }
.big.small { font-size: 16px; margin: 8px 0 0; }
.big .note { font-size: 14px; font-weight: 600; display: block; }
.checkin { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }

#toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(20px); background: #141414; color: #fff; border: 2.5px solid #fff; padding: 10px 16px; border-radius: 14px; font-size: 15px; font-weight: 700; opacity: 0; pointer-events: none; max-width: min(92vw, 480px); text-align: center; z-index: 20; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (prefers-reduced-motion: no-preference) { #toast { transition: opacity .2s, transform .2s; } }

.foot { margin-top: 34px; text-align: center; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.foot p { margin: 4px 0; }
.backup { margin-top: 10px; }

/* ---------- phone layout: buttons fit the screen width ---------- */
@media (max-width: 600px) {
  .actions > .btn, .actions > button.primary, .actions > button.secondary { flex: 1 1 100%; width: 100%; }
  .actions > .field { flex: 1 1 100%; }
  .lookup .btn { flex: 1 1 100%; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis b { font-size: 18px; }
  .choice.kinds, .risk .choice { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .choice.kinds button, .risk .choice button { padding: 8px 4px; min-height: 40px; }
  .list li > div:last-child { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  #reset-confirm { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
  #reset-confirm[hidden] { display: none; }
}
