@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --bg: #f1f5f6;
  --surface: #ffffff;
  --sunk: #e6edf0;
  --ink: #0e1a21;
  --muted: #56646e;
  --line: #d6dee3;
  --accent: #00757f;
  --accent-ink: #ffffff;
  --accent-soft: #d6eef0;
  --boost: #a85f00;
  --danger: #b3261e;
  --radius: 10px;
  --gutter: max(clamp(1rem, 4vw, 2.5rem), calc((100vw - 66rem) / 2));
  --header-gutter: max(clamp(1rem, 4vw, 2.5rem), calc((100vw - 66rem) / 2));
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0d1418;
  --surface: #141d23;
  --sunk: #1b2830;
  --ink: #e6eef2;
  --muted: #93a3ae;
  --line: #263640;
  --accent: #46c7d2;
  --accent-ink: #03282c;
  --accent-soft: #12363c;
  --boost: #f2b545;
  --danger: #ff8f86;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.5 "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
[hidden] { display: none !important; }
/* Tabular figures only on the ticker, where digits must not shift as they roll; elsewhere they widen the punctuation. */
h1, h2 { margin: 0; line-height: 1.2; }
h2 { font-size: 1.125rem; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- top bar ---------- */
.bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem 1.5rem;
  padding: 0.75rem var(--header-gutter, var(--gutter));
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; font-size: 1.25rem; letter-spacing: -0.03em; color: var(--ink); text-decoration: none; }
.bar-actions { margin-left: auto; display: flex; gap: 0.5rem; }
.nav { display: flex; flex-wrap: wrap; gap: 0 1.25rem; order: 3; flex-basis: 100%; padding-bottom: 0.1rem; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.95rem; padding: 0.35rem 0; border-bottom: 2px solid transparent; white-space: nowrap; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
@media (min-width: 760px) { .nav { order: 0; flex-basis: auto; margin-left: 0.5rem; } }

.btn {
  font: inherit; font-weight: 600; font-size: 0.95rem;
  min-height: 2.5rem; padding: 0 1rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink);
  cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: transparent; background: transparent; padding: 0 0.6rem; }
.btn.ghost:hover { background: var(--sunk); }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: default; }
.link { font: inherit; background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; }
.ico-sun { display: none; }
[data-theme="dark"] .ico-sun { display: block; }
[data-theme="dark"] .ico-moon { display: none; }

/* ---------- calculator: one linear column ---------- */
body.narrow { --gutter: max(1rem, calc((100vw - 44rem) / 2)); }

.summary {
  position: sticky; top: 0; z-index: 5;
  display: flex; flex-direction: column; gap: 0.35rem;
  padding: 0.55rem var(--gutter);
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.sum-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.sum-label { color: var(--muted); font-size: 0.85rem; }
.sum-figs { margin: 0; display: flex; gap: 1.5rem; }
.sum-figs dt { color: var(--muted); font-size: 0.75rem; line-height: 1.2; }
.sum-figs dd { margin: 0; font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; line-height: 1.25; }
.sum-row:first-child .sum-figs dd { font-size: 0.95rem; font-weight: 700; color: var(--muted); }

.flow { padding: 1rem var(--gutter) 2.5rem; }
.profilebar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 0.6rem 0.9rem; margin-bottom: 1.5rem;
  background: var(--accent-soft); border-radius: var(--radius); font-size: 0.925rem;
}
.profilebar .btn { min-height: 2.1rem; }

.live { padding: 1rem 0 1.25rem; border-bottom: 1px solid var(--line); margin-bottom: 0.25rem; }
.tk-label { color: var(--muted); font-size: 0.9rem; }
.tk-num {
  font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; font-variant-numeric: tabular-nums;
  font-size: clamp(1.9rem, 8vw, 2.9rem); white-space: nowrap; overflow: hidden;
}
.tk-dec { color: var(--accent); }
.tk-dot { font-variant-numeric: normal; margin-right: -0.02em; }

/* ---------- inputs ---------- */
fieldset { border: 0; margin: 0 0 1.75rem; padding: 0 0 1.75rem; border-bottom: 1px solid var(--line); min-width: 0; }
fieldset:last-child { border-bottom: 0; margin-bottom: 0; }
legend { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; padding: 0; margin-bottom: 0.9rem; }
.field { display: block; margin-bottom: 0.9rem; }
.field > span, .field > label { display: block; font-size: 0.9rem; color: var(--muted); margin-bottom: 0.3rem; }
.field small { color: var(--muted); }
input[type="number"], input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="month"], select, textarea {
  font: inherit; color: var(--ink);
  width: 100%; min-height: 2.75rem; padding: 0.4rem 0.75rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.check { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.9rem; cursor: pointer; }
.check input { width: 1.15rem; height: 1.15rem; accent-color: var(--accent); }
.hint { color: var(--muted); font-size: 0.875rem; margin-top: -0.25rem; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.rarities { display: grid; gap: 0.5rem; }
.rar {
  display: grid; grid-template-columns: 0.3rem 1fr 6rem 3.75rem; align-items: center; gap: 0.75rem;
  padding: 0.3rem 0;
}
.rar-head { padding: 0 0 0.2rem; color: var(--muted); font-size: 0.8rem; }
.rar-head span:nth-child(3) { text-align: right; padding-right: 0.75rem; }
.rar-share { text-align: right; color: var(--muted); font-size: 0.9rem; }
.rar-bar { align-self: stretch; border-radius: 2px; }
.rar-name { font-weight: 600; }
.rar-name small { display: block; font-weight: 400; color: var(--muted); font-size: 0.8rem; }
.rar input { text-align: right; }
.sumline { display: flex; justify-content: space-between; margin-top: 0.85rem; padding-top: 0.75rem; border-top: 1px dashed var(--line); }
.sumline b { font-size: 1.1rem; }

.range { display: flex; align-items: center; gap: 0.9rem; }
.range input { flex: 1; accent-color: var(--accent); height: 2rem; }
.range output { min-width: 4.5rem; text-align: right; font-weight: 700; }

/* ---------- results ---------- */
.results { margin-top: 2.5rem; padding-top: 1.75rem; border-top: 2px solid var(--ink); }
.results h2 { margin-bottom: 0.4rem; }
.results h2:not(:first-child) { margin-top: 2.25rem; }
.earn { width: 100%; border-collapse: collapse; }
.earn th, .earn td { padding: 0.6rem 0; text-align: right; border-bottom: 1px solid var(--line); }
.earn th { font-weight: 500; font-size: 0.875rem; color: var(--muted); }
.earn th:first-child, .earn td:first-child { text-align: left; }
.earn td:first-child { color: var(--muted); }
.earn td.ads { font-weight: 700; color: var(--ink); }
.earn tr.key td { font-size: 1.05rem; }
@media (max-width: 480px) {
  .earn th, .earn td { font-size: 0.875rem; }
  .earn tr.key td { font-size: 0.95rem; }
  .earn td:first-child { padding-right: 0.5rem; }
}
#earnNote { margin-top: 0.6rem; }

.stairs { width: 100%; margin-bottom: 0.75rem; }
.stairs svg { display: block; width: 100%; height: auto; overflow: visible; }
.st-bar { fill: var(--sunk); }
.st-bar.on { fill: var(--accent); }
.st-x { fill: var(--ink); font: 600 11px "Schibsted Grotesk", sans-serif; }
.st-mult { fill: var(--muted); font: 700 11px "Schibsted Grotesk", sans-serif; }
.st-mult.on { fill: var(--accent-ink); }
.st-you { stroke: var(--boost); stroke-width: 2; }
.st-youlab { fill: var(--boost); font: 700 12px "Schibsted Grotesk", sans-serif; }

.facts { margin: 0; }
.facts > div { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.facts b { font-weight: 700; }

.foot p + p { margin-top: 0.6rem; color: var(--ink); }
.foot { padding: 1.5rem var(--gutter) calc(3rem + env(safe-area-inset-bottom, 0px)); color: var(--muted); font-size: 0.85rem; }

/* ---------- content pages ---------- */
.page { padding: clamp(1.75rem, 4vw, 3rem) var(--gutter); }
.page h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 0.75rem; }
.lede { max-width: 42rem; color: var(--muted); font-size: 1.05rem; margin-bottom: 1.75rem; }
.page section { margin-top: 3rem; max-width: 46rem; }
.page section > h2 { font-size: 1.4rem; letter-spacing: -0.02em; margin-bottom: 0.9rem; }
.sub { font-weight: 700; margin: 1.5rem 0 0.4rem; }
.page .hint { margin-top: 0.6rem; max-width: 42rem; }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.chip { font: inherit; font-size: 0.925rem; font-weight: 600; text-align: left; padding: 0.4rem 0.9rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); cursor: pointer; }
.chip:hover { border-color: var(--muted); }
.chip[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.applies { color: var(--muted); margin-bottom: 1.5rem; max-width: 46rem; }
.tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem 2.5rem; margin-bottom: 1.25rem; }
.tools .field, .tools .check { margin-bottom: 0; }
.tools .range { min-width: min(20rem, 80vw); }

.scroll { overflow-x: auto; }
.boost, .plain { width: 100%; border-collapse: collapse; }
.boost th, .boost td, .plain th, .plain td { padding: 0.7rem 0.9rem 0.7rem 0; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.boost thead th, .plain thead th { font-size: 0.85rem; font-weight: 500; color: var(--muted); vertical-align: bottom; white-space: normal; }
.boost tbody th, .plain tbody th { font-weight: 600; }
.r { text-align: right !important; }
.boost td.strong { font-weight: 700; }
.boost tr.step th, .boost tr.step td { border-top: 1px solid var(--muted); }
.mult { display: inline-block; min-width: 3rem; text-align: center; padding: 0.1rem 0.55rem; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.boost .pp { min-width: 11rem; }
.bar-track { display: inline-block; width: 5.5rem; height: 0.5rem; margin-right: 0.6rem; background: var(--sunk); border-radius: 999px; vertical-align: middle; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.pp-num { color: var(--muted); font-size: 0.9rem; }
.boost tbody th:first-child, .boost thead th:first-child { position: sticky; left: 0; background: var(--bg); padding-left: 0; padding-right: 1rem; }

.plain { max-width: 40rem; }
.dot { display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 50%; margin-right: 0.55rem; }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps > li { counter-increment: s; position: relative; padding: 0 0 1.75rem 2.75rem; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--ink); color: var(--bg); font-weight: 700; font-size: 0.9rem; display: grid; place-items: center; }
.steps > li::after { content: ""; position: absolute; left: 0.95rem; top: 2.2rem; bottom: 0.3rem; width: 1px; background: var(--line); }
.steps > li:last-child::after { display: none; }
.steps h3 { font-size: 1.1rem; margin: 0 0 0.3rem; letter-spacing: -0.01em; line-height: 1.9rem; }
.steps p { color: var(--muted); }
.steps p.formula { margin-top: 0.4rem; padding: 0.5rem 0.8rem; background: var(--sunk); border-radius: 8px; color: var(--ink); overflow-x: auto; white-space: nowrap; }
.steps p.result { margin-top: 0.5rem; color: var(--ink); font-weight: 700; }
.notes { margin: 0; padding-left: 1.2rem; }
.notes li { margin-bottom: 0.8rem; }

/* ---------- dialog ---------- */
dialog { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); padding: 1.5rem; width: min(24rem, calc(100vw - 2rem)); }
dialog::backdrop { background: rgba(8, 14, 18, 0.55); }
dialog h2 { margin-bottom: 1rem; }
.dlg-close { position: absolute; top: 0.6rem; right: 0.6rem; margin: 0; }
.dlg-close .btn { min-height: 2rem; font-size: 0.85rem; }
.error { color: var(--danger); margin-bottom: 0.75rem; font-size: 0.925rem; }
.switch { margin-top: 1rem; text-align: center; color: var(--muted); font-size: 0.925rem; }
.row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }
#uWho { margin-bottom: 0.5rem; font-weight: 600; }

/* ---------- admin ---------- */
.admin { padding: clamp(1.25rem, 4vw, 2.5rem) var(--gutter); }
.admin h1 { font-size: 1.6rem; letter-spacing: -0.02em; margin-bottom: 0.4rem; }
.tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 1.25rem 0; }
.tabs .btn[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.grid { width: 100%; border-collapse: collapse; }
.grid th { text-align: left; font-weight: 500; font-size: 0.85rem; color: var(--muted); padding: 0.4rem 0.4rem; }
.grid td { padding: 0.25rem 0.4rem; vertical-align: middle; }
.grid input, .grid select { min-height: 2.25rem; padding: 0.2rem 0.5rem; }
.grid input[type="color"] { padding: 0.1rem; width: 3rem; }
.grid .actions { white-space: nowrap; }
.grid tr.dirty td { background: var(--accent-soft); }
.grid .btn { min-height: 2.1rem; padding: 0 0.8rem; font-size: 0.875rem; }
.scroll { overflow-x: auto; }
.msg { min-height: 1.5rem; margin-top: 0.75rem; color: var(--muted); }
.msg.bad { color: var(--danger); }

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

/* ---------- next steps ---------- */
.plan h1 { font-size: clamp(1.75rem, 5vw, 2.25rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 0.75rem; }
.plan .lede { color: var(--muted); font-size: 1.05rem; margin-bottom: 1rem; }
.using { padding: 0.6rem 0.9rem; background: var(--sunk); border-radius: var(--radius); font-size: 0.925rem; margin-bottom: 1.75rem; }
.plan section { margin-top: 2.75rem; }
.plan section > h2 { font-size: 1.35rem; letter-spacing: -0.02em; margin-bottom: 0.7rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.plan .assume h2 { font-size: 1.05rem; margin-bottom: 0.8rem; }
.assume { margin-bottom: 0.5rem; }
.assume-grid { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.sec-lede { color: var(--muted); margin-bottom: 1rem; }
.plain.wide { max-width: none; }
.plain.wide th, .plain.wide td { white-space: normal; }
.plain.wide td.r { white-space: nowrap; }
.plain.wide th:first-child { min-width: 8rem; }
.plain td { text-align: right; }
.plain td:first-child, .plain th:first-child { text-align: left; }
.plain td.l { text-align: left; white-space: normal; }
.plain th.r, .plain td.r { text-align: right; }
.plain td small, .plain th small { display: block; color: var(--muted); font-weight: 400; font-size: 0.85rem; }
.callout { padding: 1rem 1.1rem; background: var(--accent-soft); border-radius: var(--radius); margin-bottom: 1.25rem; }
.callout strong { font-weight: 800; }
.callout p + p { margin-top: 0.4rem; }
.plain tr.best td, .plain tr.best th { background: var(--accent-soft); }
.plan .steps > li { padding-bottom: 1.5rem; }
.plan .steps ul { list-style: none; margin: 0.35rem 0 0; padding: 0; }
.plan .steps li li { padding: 0.2rem 0; color: var(--ink); }
.plan .steps li li b { font-weight: 700; }
.plan .steps .muted, .muted { color: var(--muted); }
.plan .facts > div { grid-template-columns: 10.5rem 1fr; }
.ladder-on td, .ladder-on th { background: var(--accent-soft); }
@media (max-width: 520px) { .plan .facts > div { grid-template-columns: 1fr; gap: 0.1rem; } }
@media (max-width: 480px) { .nav { gap: 0 1rem; } .nav a { font-size: 0.9rem; } .plain.wide th, .plain.wide td { padding-right: 0.5rem; } .data-table { font-size: 0.875rem; } }

/* ---------- accounts, comparison, stats ---------- */
.foot-links { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-top: 0.6rem; }
.foot-links a { color: var(--muted); }
.notice { padding: 0.65rem 0.8rem; margin-bottom: 1rem; border-radius: var(--radius); background: var(--sunk); font-size: 0.9rem; }
.okmsg { color: var(--accent); margin-bottom: 0.75rem; font-size: 0.925rem; }
.banner { padding: 0.7rem 0.85rem; margin: 0.75rem 0; border-radius: var(--radius); background: var(--accent-soft); font-size: 0.9rem; }
.banner p + .link { margin-top: 0.3rem; }
#dlgUser .row .btn { flex: 1 1 auto; }
.page-narrow { max-width: 44rem; }
.prose h2 { font-size: 1.2rem; margin: 2rem 0 0.5rem; letter-spacing: -0.01em; }
.prose p, .prose li { margin-bottom: 0.6rem; }
.prose ul { padding-left: 1.2rem; margin: 0 0 0.6rem; }
.msg-ok { color: var(--accent); }
.msg-bad { color: var(--danger); }
.form-row { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); align-items: end; }
.form-row .field { margin-bottom: 0.6rem; }
.actions { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin: 0.25rem 0 0.5rem; }
.danger-zone { border-top: 1px solid var(--line); margin-top: 2rem; padding-top: 1rem; }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.standing { display: grid; gap: 0.9rem; margin: 1rem 0 1.5rem; }
.stand-row { display: grid; grid-template-columns: 6rem 1fr; gap: 0.2rem 1rem; align-items: center; }
.stand-row .label { font-weight: 600; }
.stand-row small { grid-column: 2; color: var(--muted); }
.meter { height: 0.6rem; background: var(--sunk); border-radius: 999px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.you-row td, .you-row th { background: var(--accent-soft); }
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; margin-bottom: 1rem; align-items: end; }
.filters .field { margin: 0; flex: 1 1 9rem; }
.stat-wrap { max-width: 68rem; }
.chart { margin: 0.75rem 0 1.5rem; }
.chart h3 { font-size: 1.05rem; margin-bottom: 0.15rem; }
.chart p.hint { margin: 0 0 0.4rem; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-axis { fill: var(--muted); font: 500 11px "Schibsted Grotesk", sans-serif; }
.ch-ref { stroke: var(--danger); stroke-width: 1.5; stroke-dasharray: 5 4; }
.ch-reflab { fill: var(--danger); font: 600 11px "Schibsted Grotesk", sans-serif; }
.ch-l0 { stroke: var(--accent); fill: none; stroke-width: 2.5; }
.ch-l1 { stroke: var(--boost); fill: none; stroke-width: 2; }
.ch-l2 { stroke: var(--muted); fill: none; stroke-width: 2; }
.ch-dash { stroke-dasharray: 6 5; }
.ch-d0 { fill: var(--accent); } .ch-d1 { fill: var(--boost); } .ch-d2 { fill: var(--muted); }
.ch-b0 { fill: var(--accent); } .ch-b1 { fill: var(--boost); } .ch-b2 { fill: var(--muted); }
.ch-vlabel { font: 600 10px "Schibsted Grotesk", sans-serif; }
.ch-t0 { fill: var(--accent); } .ch-t1 { fill: var(--boost); } .ch-t2 { fill: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-size: 0.85rem; color: var(--muted); margin-top: 0.25rem; }
.legend i { display: inline-block; width: 0.8rem; height: 0.3rem; border-radius: 2px; margin-right: 0.35rem; vertical-align: middle; }
.lg0 { background: var(--accent); } .lg1 { background: var(--boost); } .lg2 { background: var(--muted); }
.entry-form { display: grid; gap: 0 0.75rem; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); align-items: end; margin-bottom: 0.4rem; }
.entry-form .field { margin-bottom: 0.5rem; }
.data-table td.note { max-width: 12rem; overflow: hidden; text-overflow: ellipsis; }
.stat-section { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.stat-section h2 { font-size: 1.25rem; margin-bottom: 0.4rem; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.analytics-bars td.bar-cell { width: 50%; }
.analytics-bars .bar-track { width: 100%; margin: 0; }
.page-h1 { font-size: clamp(1.75rem, 5vw, 2.25rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 0.75rem; }
.flow .lede { color: var(--muted); font-size: 1.05rem; margin-bottom: 1.5rem; }
body:not(.narrow) .flow { max-width: 68rem; margin: 0 auto; }

.data-table th.l, .data-table td.l { text-align: left; }
.data-table td small { display: block; color: var(--muted); font-size: 0.8rem; }
.btn.small { min-height: 0; padding: 0.3rem 0.65rem; font-size: 0.8rem; }
#table th:first-child, #table td:first-child { width: 1.6rem; padding-right: 0.25rem; }
.data-table td, .data-table th { vertical-align: middle; }
#table.plain.wide th:first-child { min-width: 0; }
.trend { font-weight: 700; }
.trend.up { color: var(--accent); }
.trend.down { color: var(--danger); }
.trend.flat { color: var(--muted); }

/* header brand mark */
.brand { display: inline-flex; align-items: center; gap: 0.5rem; }
.brand-mark { flex-shrink: 0; border-radius: 6px; }

/* bottom donation notice */
.donate-bar {
  order: 2;
  display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap;
  padding: 0.7rem 1.25rem; background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.12);
}
.donate-bar p { margin: 0; font-size: 0.88rem; color: var(--ink); max-width: 34rem; text-align: center; }
.donate-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
@media (max-width: 480px) { .donate-bar { padding: 0.6rem 0.9rem; } .donate-bar p { font-size: 0.83rem; } }

/* admin: toggle switch, textarea, user rows */
textarea { width: 100%; box-sizing: border-box; resize: vertical; font-family: inherit; }
.toggle { display: flex; align-items: center; gap: 0.65rem; cursor: pointer; margin-bottom: 1rem; width: fit-content; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-track { width: 2.5rem; height: 1.4rem; border-radius: 999px; background: var(--sunk); border: 1px solid var(--line); flex-shrink: 0; position: relative; transition: background 0.15s; }
.toggle-thumb { position: absolute; top: 1px; left: 1px; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,0.3); transition: transform 0.15s; }
.toggle input:checked + .toggle-track { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + .toggle-track .toggle-thumb { transform: translateX(1.1rem); }
.toggle input:focus-visible + .toggle-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.toggle-label { font-weight: 600; }
.row-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.btn.small.danger { border-color: var(--danger); color: var(--danger); }
#emailSettings, #newsletterPanel, #usersPanel { max-width: 40rem; }
#usersPanel { max-width: none; }
#emailSettings h2, #newsletterPanel h2 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }
#emailSettings h2:first-child, #newsletterPanel h2:first-child { margin-top: 0; }

/* one-time email-features prompt */
.email-prompt {
  display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap;
  padding: 0.6rem 1.25rem; background: var(--accent-soft); border-bottom: 1px solid var(--line);
}
.email-prompt p { margin: 0; font-size: 0.88rem; color: var(--ink); text-align: center; }

/* admin: donations tab */
.muted-row td { color: var(--muted); }
code.payload { display: block; max-width: 32rem; white-space: pre-wrap; word-break: break-word; font-size: 0.78rem; background: var(--sunk); padding: 0.4rem 0.5rem; border-radius: 6px; }

/* donors page */
.big-total { font-size: 2.75rem; font-weight: 800; letter-spacing: -0.03em; margin: 0.1rem 0 0.4rem; color: var(--accent); }

/* support page */
.support-link { padding: 0.9rem 0; border-top: 1px solid var(--line); }
.support-link:first-child { border-top: none; }
.support-link .btn { margin-bottom: 0.35rem; }
#page section + section, #page section#costBox { margin-top: 1.75rem; }

/* admin: unmistakable labeling */
.admin-eyebrow { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--boost); margin: 0 0 0.3rem; }

/* boost table: your own row */
.you-badge { display: inline-block; margin-left: 0.4rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent); border-radius: 999px; padding: 0.1rem 0.5rem; vertical-align: middle; }

/* shared header sign-in indicator */
#authLink { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* cookie notice: same shape as the donate bar, but neutral (not accent-colored) and takes priority */
#bottomStack { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom, 0px); }
.cookie-notice {
  order: 1;
  display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap;
  padding: 0.7rem 1.25rem; background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.12);
}
.save-bar {
  order: 3;
  display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap;
  padding: 0.7rem 1.25rem; background: var(--accent-soft); border-top: 1px solid var(--accent);
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.16);
}
.save-bar p { margin: 0; font-size: 0.88rem; color: var(--ink); text-align: center; }
.cookie-notice p { margin: 0; font-size: 0.85rem; color: var(--ink); max-width: 40rem; text-align: center; }
@media (max-width: 480px) { .cookie-notice { padding: 0.6rem 0.9rem; } .cookie-notice p { font-size: 0.8rem; } }

/* permanent header support button — deliberately warmer than the other header buttons so it stays noticeable */
.support-hdr { background: var(--boost); border-color: var(--boost); color: var(--accent-ink); font-weight: 700; }
.support-hdr:hover { filter: brightness(1.08); }

/* admin: update posts list */
.update-row { border-top: 1px solid var(--line); padding: 1rem 0; margin-top: 0.5rem; }
.update-row:first-of-type { margin-top: 0; }

/* public updates page */
.update-post { padding: 1.25rem 0; border-top: 1px solid var(--line); }
.update-post:first-child { border-top: none; padding-top: 0; }
.update-date { color: var(--muted); font-size: 0.85rem; margin: 0 0 0.15rem; }
.update-post h2 { margin: 0 0 0.5rem; font-size: 1.2rem; }
.update-body p { margin: 0 0 0.6rem; }
.update-body p:last-child { margin-bottom: 0; }

/* admin: backup instructions */
.code-block { background: var(--sunk); border-radius: 8px; padding: 0.7rem 0.9rem; font-size: 0.85rem; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }

/* compact AB/diamond inputs under Parcels on the calculator */
.mini-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 0.75rem; margin-top: 0.75rem; }
.field.mini { margin-bottom: 0.4rem; }
.field.mini span { font-size: 0.82rem; }

/* money in/out section on the calculator */
.money-section { border-top: 1px solid var(--line); margin-top: 1.5rem; padding-top: 1.25rem; }

/* top recommendation banner on Next Steps */
.recommend { background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 12px; padding: 1.1rem 1.25rem; margin: 1rem 0 1.5rem; }
.rec-eyebrow { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--accent); margin: 0 0 0.3rem; }
.recommend h2 { margin: 0 0 0.5rem; font-size: 1.3rem; line-height: 1.3; }
.recommend .hint { margin: 0; }

/* floating next-page button, bottom right — sits above the bottom bar stack so it never overlaps them */
.next-page-nav { position: fixed; right: 1.1rem; bottom: calc(1.1rem + env(safe-area-inset-bottom, 0px)); z-index: 41; display: flex; flex-direction: column; align-items: flex-end; gap: 0.35rem; }
.next-page-btn { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22); }
.next-page-hint { margin: 0; max-width: 14rem; font-size: 0.72rem; text-align: right; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 0.35rem 0.55rem; }
@media (max-width: 640px) { .next-page-nav { right: 0.6rem; bottom: 0.6rem; } .next-page-hint { max-width: 9rem; font-size: 0.68rem; } }

/* collapsed assumptions block on Next Steps */
.assume-details { margin: 1rem 0; border: 1px solid var(--line); border-radius: 10px; padding: 0.1rem 1rem; }
.assume-details summary { cursor: pointer; padding: 0.75rem 0; font-weight: 600; color: var(--muted); }
.assume-details[open] summary { color: var(--ink); }
.assume-details form { padding-bottom: 0.75rem; }
