/* Rocket Calculator — design system after DESIGN-vodafone.md:
   single scarlet accent (#e60000), ink #25282b, white / #f2f2f2 canvases, pill buttons, flat 6 px cards,
   heavy uppercase display headlines (Inter 800 as the open substitute), two-band page rhythm.
   Light tokens first, then dark (OS preference and explicit toggle), then base, layout, components. */

@font-face { font-family: "Inter"; src: url("../vendor/fonts/inter-latin-300-normal.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../vendor/fonts/inter-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../vendor/fonts/inter-latin-600-normal.woff2") format("woff2"); font-weight: 500 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../vendor/fonts/inter-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../vendor/fonts/inter-latin-800-normal.woff2") format("woff2"); font-weight: 800 900; font-display: swap; }

:root {
  color-scheme: light;
  --red: #e60000;
  --danger: #e60000;                 /* semantic: unsafe / error — does not follow the accent colour */
  --red-text: #d40000;
  --ink-brand: #25282b;
  --bg: #ffffff;
  --surface: #f2f2f2;
  --surface-2: #ffffff;
  --surface-3: #e6e6e6;
  --border: #e1e1e1;
  --border-strong: #bebebe;
  --hairline: #25282b;
  --text: #25282b;
  --text-2: #4b4f53;
  --text-3: #6b6e71;
  --on-dark: #ffffff;
  --on-dark-2: rgba(255, 255, 255, 0.74);
  --accent: var(--red);
  --accent-ink: #ffffff;
  --accent-soft: rgba(230, 0, 0, 0.08);
  --accent-2: #25282b;
  --accent-2-soft: rgba(37, 40, 43, 0.07);
  --key-bg: #25282b;
  --key-text: #ffffff;
  --key-mark: var(--red);
  --ok: #1d7a3e;
  --ok-soft: rgba(29, 122, 62, 0.1);
  --warn: #a35a00;
  --warn-soft: rgba(196, 116, 0, 0.12);
  --err: #d40000;
  --err-soft: rgba(230, 0, 0, 0.08);
  --focus: #25282b;
  --series-1: #e60000;
  --series-2: #25282b;
  --series-3: #8a8d90;
  --series-4: #9b0000;
  --series-5: #5b6b7a;
  --series-6: #ff7f7f;
  --schem-stroke: #25282b;
  --schem-fill: #ffffff;
  --schem-fill-2: #dcdcdc;
  --schem-dim: #6b6e71;
  --overlay: rgba(20, 22, 24, 0.55);
  --input-mark: #25282b;
  --const-mark: #9b0000;
  --star: rgba(255, 255, 255, 0.5);
  --font-sans: "Inter", "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 6px;
  --radius-sm: 6px;
  --pill: 60px;
  --header-h: 64px;
  --maxw: 1400px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #141618; --surface: #25282b; --surface-2: #1c1e21; --surface-3: #33373b;
    --border: #383c41; --border-strong: #4d5258; --hairline: #bebebe;
    --text: #ffffff; --text-2: #d0d2d4; --text-3: #a9acaf;
    --danger: #ff3b3b; --red-text: #ff4d4d; --accent-soft: rgba(230, 0, 0, 0.18); --accent-2: #ffffff; --accent-2-soft: rgba(255, 255, 255, 0.08);
    --key-bg: #f2f2f2; --key-text: #25282b;
    --ok: #4cc77a; --ok-soft: rgba(76, 199, 122, 0.14); --warn: #f0ad4e; --warn-soft: rgba(240, 173, 78, 0.14); --err: #ff4d4d; --err-soft: rgba(230, 0, 0, 0.16);
    --focus: #ffffff;
    --series-1: #ff3b3b; --series-2: #f2f2f2; --series-3: #9a9da0; --series-4: #ff9a9a; --series-5: #8fa3b5; --series-6: #c40000;
    --schem-stroke: #e8e8e8; --schem-fill: #1c1e21; --schem-fill-2: #3a3e43; --schem-dim: #a9acaf;
    --overlay: rgba(0, 0, 0, 0.65); --input-mark: #ffffff; --const-mark: #ff9a9a;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141618; --surface: #25282b; --surface-2: #1c1e21; --surface-3: #33373b;
  --border: #383c41; --border-strong: #4d5258; --hairline: #bebebe;
  --text: #ffffff; --text-2: #d0d2d4; --text-3: #a9acaf;
  --danger: #ff3b3b; --red-text: #ff4d4d; --accent-soft: rgba(230, 0, 0, 0.18); --accent-2: #ffffff; --accent-2-soft: rgba(255, 255, 255, 0.08);
  --key-bg: #f2f2f2; --key-text: #25282b;
  --ok: #4cc77a; --ok-soft: rgba(76, 199, 122, 0.14); --warn: #f0ad4e; --warn-soft: rgba(240, 173, 78, 0.14); --err: #ff4d4d; --err-soft: rgba(230, 0, 0, 0.16);
  --focus: #ffffff;
  --series-1: #ff3b3b; --series-2: #f2f2f2; --series-3: #9a9da0; --series-4: #ff9a9a; --series-5: #8fa3b5; --series-6: #c40000;
  --schem-stroke: #e8e8e8; --schem-fill: #1c1e21; --schem-fill-2: #3a3e43; --schem-dim: #a9acaf;
  --overlay: rgba(0, 0, 0, 0.65); --input-mark: #ffffff; --const-mark: #ff9a9a;
}

/* ---------- base ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 220ms; }
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--ink-brand); scrollbar-gutter: stable; scrollbar-color: var(--border-strong) var(--bg); -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; font: 400 16px/1.55 var(--font-sans); color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; overflow-x: hidden; transition: background-color 0.25s var(--ease), color 0.25s var(--ease); }
main { flex: 1; width: 100%; animation: page-in 0.38s var(--ease) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.1; }
h1 { font-size: clamp(2.2rem, 1.2rem + 3.6vw, 4.4rem); font-weight: 800; text-transform: uppercase; letter-spacing: -0.02em; line-height: 0.95; }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2.2rem); font-weight: 300; letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 0.9em; }
a { color: var(--red-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--text); }
code, kbd { font-family: var(--font-mono); font-size: 0.88em; }
.num, .mono { font-variant-numeric: tabular-nums lining-nums; }
kbd { display: inline-block; padding: 0 0.45em; border: 1px solid currentColor; border-radius: 4px; font-size: 0.75em; line-height: 1.6; opacity: 0.8; }
::selection { background: rgba(230, 0, 0, 0.2); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
img, svg { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--bg); padding: 8px 12px; border-radius: 6px; }
.skip-link:focus { left: 12px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }

/* ---------- header: dark nav band ---------- */
.site-header { position: sticky; top: 0; z-index: 40; height: var(--header-h); background: var(--ink-brand); color: var(--on-dark); }
.site-header .wrap { height: 100%; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--on-dark); text-decoration: none; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; font-size: 1.05rem; }
.brand:hover { color: var(--on-dark); }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand small { display: block; font-weight: 600; font-size: 0.66rem; color: var(--on-dark-2); letter-spacing: 0.08em; text-transform: uppercase; margin-top: 1px; }
.nav { display: flex; gap: 2px; margin-left: 12px; }
.nav a { color: var(--on-dark); text-decoration: none; padding: 8px 12px; border-radius: var(--pill); font-size: 0.95rem; white-space: nowrap; }
.nav a:hover { background: rgba(255, 255, 255, 0.1); color: var(--on-dark); }
.nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--red); border-radius: 0; }
.header-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search-btn { display: flex; align-items: center; gap: 8px; min-width: 160px; padding: 8px 14px; border-radius: var(--pill); border: 1px solid rgba(255, 255, 255, 0.45); background: transparent; color: var(--on-dark-2); font: inherit; font-size: 0.9rem; cursor: pointer; }
.search-btn:hover { border-color: var(--on-dark); color: var(--on-dark); }
.search-btn kbd { margin-left: auto; }
.seg { display: inline-flex; border: 1px solid rgba(255, 255, 255, 0.45); border-radius: var(--pill); overflow: hidden; }
.seg button { font: 700 0.78rem/1 var(--font-sans); letter-spacing: 0.04em; padding: 9px 12px; border: 0; background: none; color: var(--on-dark-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--on-dark); color: var(--ink-brand); }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.45); background: transparent; color: var(--on-dark); cursor: pointer; padding: 0; }
.icon-btn:hover { background: rgba(255, 255, 255, 0.12); }
.icon-btn svg { width: 18px; height: 18px; }
.gh-btn svg { width: 19px; height: 19px; }
@media (max-width: 520px) { .gh-btn { display: none; } } /* the footer carries the GitHub link on phones */
.menu-btn { display: none; }
@media (max-width: 1240px) { .search-btn { min-width: 0; } .search-btn .label, .search-btn kbd { display: none; } .brand small { display: none; } }
@media (max-width: 1000px) {
  .nav { display: none; position: absolute; top: var(--header-h); left: 0; right: 0; flex-direction: column; padding: 10px 16px 18px; background: var(--ink-brand); }
  .nav.open { display: flex; }
  .menu-btn { display: inline-grid; }
  .brand small { display: none; }
  .site-header .wrap { gap: 10px; }
  .header-tools { gap: 6px; }
  .seg button { padding: 9px 9px; }
}
@media (max-width: 400px) { .brand span.name { display: none; } }

/* ---------- footer: slim dark band ---------- */
.site-footer { margin-top: 56px; background: var(--ink-brand); color: var(--on-dark-2); font-size: 0.85rem; }
.site-footer .wrap { padding-top: 18px; padding-bottom: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; }
.site-footer .credit { margin: 0; flex: 1 1 420px; }
.site-footer a { color: var(--on-dark); text-decoration: none; }
.site-footer a.coffee { font-weight: 600; }
.site-footer a:hover { text-decoration: underline; color: var(--on-dark); }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }

/* ---------- generic components ---------- */
.card { background: var(--surface); border-radius: var(--radius); }
.card-pad { padding: 22px 24px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { margin: 0; font-size: 1.05rem; font-weight: 700; text-transform: none; letter-spacing: 0; }
.card-head .spacer { flex: 1; }
.eyebrow { font: 800 0.82rem/1.2 var(--font-sans); text-transform: uppercase; letter-spacing: 0.06em; color: var(--red-text); margin-bottom: 10px; }
.muted { color: var(--text-3); }
.lead { font-size: 1.25rem; line-height: 1.45; color: var(--text-2); max-width: 64ch; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 24px; border-radius: var(--pill); font: 400 1.05rem/1.4 var(--font-sans);
  border: 1px solid var(--hairline); background: transparent; color: var(--text); cursor: pointer; text-decoration: none; transition: background 0.15s, color 0.15s, transform 0.15s; }
.btn:hover { background: var(--text); color: var(--bg); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: #c20000; border-color: #c20000; color: #fff; }
.btn.outline-red { color: var(--red-text); border-color: var(--red); }
.btn.outline-red:hover { background: var(--red); color: #fff; }
.btn.ghost { border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--accent-2-soft); color: var(--text); }
.btn.small { padding: 6px 14px; font-size: 0.85rem; }
.btn svg { width: 16px; height: 16px; }
.btn.on-dark { color: var(--on-dark); border-color: var(--on-dark); }
.btn.on-dark:hover { background: var(--on-dark); color: var(--ink-brand); }
select.btn { appearance: none; -webkit-appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 32px; font: 700 0.78rem/1.4 var(--font-sans); background: var(--surface); color: var(--text); white-space: nowrap; }
.card .chip { background: var(--surface-2); }
.chip.ok { color: var(--ok); }
.chip.soon { color: var(--text-3); }
.chip.warn { color: var(--warn); }
.chip.final, .card .chip.final, a.topic-card:hover .chip.final { background: #6d28d9; color: #fff; }
.calc-links .chip.final { margin-left: 8px; padding: 1px 9px; font-size: 0.7rem; vertical-align: middle; }
.chip.accent { background: var(--red) !important; color: #fff; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.info-btn { width: 22px; height: 22px; flex: none; display: inline-grid; place-items: center; padding: 0; border-radius: 50%; border: 1.5px solid currentColor; background: transparent; color: var(--text-2);
  font: italic 700 12px/1 Georgia, "Times New Roman", serif; cursor: pointer; vertical-align: middle; transition: background 0.15s, color 0.15s, transform 0.15s; }
.info-btn:hover { background: var(--red); border-color: var(--red); color: #fff; transform: scale(1.08); }
.info-btn.lg { width: 30px; height: 30px; font-size: 16px; }
.notice { padding: 12px 16px; border-radius: var(--radius); font-size: 0.95rem; border-left: 4px solid transparent; }
.notice.warn { background: var(--warn-soft); border-left-color: var(--warn); }
.notice.err { background: var(--err-soft); border-left-color: var(--danger); }
.notice.info { background: var(--surface); border-left-color: var(--text); }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 0.85rem; color: var(--text-3); margin: 28px 0 14px; }
.breadcrumb a { color: var(--text-3); text-decoration: none; }
.breadcrumb a:hover { color: var(--red-text); }

/* ---------- home ---------- */
.hero { position: relative; overflow: hidden; background: var(--ink-brand); color: var(--on-dark); }
.hero .wrap { position: relative; display: grid; grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr); grid-template-rows: auto auto; gap: 0 40px; align-items: end; padding-top: 56px; padding-bottom: 56px; }
/* the title sizes to its own column so it never runs into the flight */
.hero .wrap > div:first-child { container-type: inline-size; }
.hero h1 { font-size: clamp(3rem, 0.8rem + 5.6vw, 7.5rem); font-size: clamp(3rem, 17cqi, 6rem); line-height: 0.8; letter-spacing: -0.035em; margin-bottom: 28px; }
.hero h1 em { font-style: normal; color: var(--red); }
.hero .eyebrow { color: var(--on-dark); }
.hero .lead { color: var(--on-dark-2); margin-bottom: 1.6em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-top: 36px; align-self: start; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, 0.2); }
.hero-stats div { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; color: var(--on-dark-2); }
.hero-stats b { display: block; font-size: clamp(1.6rem, 1rem + 1vw, 2.2rem); white-space: nowrap; font-weight: 800; letter-spacing: -0.02em; color: var(--on-dark); text-transform: none; }
.hero-art { position: relative; aspect-ratio: 640 / 380; grid-column: 2; grid-row: 1 / 3; align-self: center; }
.hero-art svg { width: 100%; height: 100%; display: block; overflow: visible; }
.hero-band-red { background: var(--red); color: #fff; }
.hero-band-red .wrap { padding-top: 34px; padding-bottom: 34px; display: flex; flex-wrap: wrap; align-items: center; gap: 18px 32px; }
.hero-band-red h2 { margin: 0; font-weight: 800; text-transform: uppercase; letter-spacing: -0.02em; font-size: clamp(1.6rem, 1rem + 2.4vw, 3rem); line-height: 0.95; }
.hero-band-red p { margin: 0; max-width: 60ch; }
.hero-band-red .btn { color: #fff; border-color: #fff; }
.hero-band-red .btn:hover { background: #fff; color: var(--red); }
@media (max-width: 1100px) { .hero .wrap { grid-template-columns: 1fr; padding-top: 40px; padding-bottom: 36px; } .hero-art { width: 100%; grid-column: 1; grid-row: auto; margin-top: 28px; } .hero-stats { order: 1; } }
@media (max-width: 520px) { .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.traj-path { stroke-dasharray: 6 7; animation: dash 18s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -260; } }
.traj-draw { stroke-dasharray: 1200; stroke-dashoffset: 1200; animation: draw 3.2s 0.3s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.twinkle { animation: twinkle 3.5s ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: 0.25; } }
.hero-knob { cursor: grab; transition: fill 0.15s; touch-action: none; }
.hero-knob:hover, .hero-knob:focus-visible, .hero-knob.dragging { fill: rgba(255, 255, 255, 0.35); outline: none; }
.hero-knob.dragging { cursor: grabbing; }
.pulse-ring { transform-origin: center; transform-box: fill-box; animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { from { opacity: 0.8; transform: scale(0.6); } to { opacity: 0; transform: scale(2.2); } }
.section { padding: 64px 0 8px; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 32px; margin-bottom: 26px; }
.section-head h2 { margin: 0; font-size: clamp(1.9rem, 1.2rem + 2vw, 3rem); }
.section-head p { margin: 0; color: var(--text-3); max-width: 62ch; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: step; }
.step { position: relative; padding: 20px 20px 22px; }
.step::before { counter-increment: step; content: "0" counter(step); display: block; font-weight: 800; font-size: 2rem; letter-spacing: -0.03em; color: var(--red); line-height: 1; margin-bottom: 14px; }
.step h3 { margin-bottom: 6px; }
.step p { margin: 0; color: var(--text-2); font-size: 0.95rem; }
.step .step-ill { height: 74px; margin-bottom: 14px; border-radius: var(--radius); background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.step .step-ill svg { width: 100%; height: 100%; }
@media (max-width: 1000px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 20px; }
.filters input[type="search"] { flex: 1 1 260px; max-width: 380px; padding: 11px 18px; border-radius: var(--pill); border: 1px solid var(--hairline); background: var(--bg); color: var(--text); font: inherit; }
.filter-chip { font: 600 0.88rem/1 var(--font-sans); padding: 10px 16px; border-radius: var(--pill); border: 1px solid var(--hairline); background: var(--bg); color: var(--text); cursor: pointer; }
.filter-chip[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.area-block { margin-bottom: 34px; }
.area-block > h3 { display: flex; align-items: center; gap: 12px; font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text); margin: 0 0 12px; }
.area-block > h3::after { content: ""; flex: 1; height: 1px; background: var(--border-strong); }
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.topic-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 20px; text-decoration: none; color: var(--text); transition: background 0.2s, color 0.2s, transform 0.2s var(--ease); }
a.topic-card:hover { background: var(--key-bg); color: var(--key-text); transform: translateY(-2px); }
a.topic-card:hover p { color: inherit; opacity: 0.85; }
a.topic-card:hover .chip { background: rgba(127, 127, 127, 0.25); color: inherit; }
.topic-card.available { box-shadow: inset 4px 0 0 var(--red); }
.topic-card h4 { margin: 0; font-size: 1.15rem; font-weight: 700; overflow-wrap: anywhere; }
.topic-card p { margin: 0; font-size: 0.92rem; color: var(--text-2); }
.topic-card .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.topic-card .calc-links { display: flex; flex-direction: column; gap: 4px; font-size: 0.95rem; }
.topic-card .calc-links span { color: var(--red-text); font-weight: 700; }
.empty { padding: 26px; text-align: center; color: var(--text-3); }
.nav-guide { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.nav-guide .card { padding: 20px 22px; }
.nav-guide p { margin: 0; font-size: 0.95rem; color: var(--text-2); }
@media (max-width: 900px) { .nav-guide { grid-template-columns: 1fr; } }
.legend-swatches { display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: 0.92rem; color: var(--text-2); }
.legend-swatches span { display: inline-flex; align-items: center; gap: 8px; }
.legend-swatches i { width: 16px; height: 16px; border-radius: 4px; display: inline-block; }

/* ---------- calculator page ---------- */
.calc-title { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 10px; }
.calc-title h1 { margin: 0; }
.calc-sub { color: var(--text-2); font-size: 1.15rem; max-width: 78ch; margin-bottom: 18px; }
.calc-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.calc-badges .chip { white-space: normal; max-width: 100%; }
.intro-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.intro-grid .card { padding: 18px 20px; }
.intro-grid h3 { font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--red-text); margin-bottom: 8px; }
.intro-grid p { margin: 0; font-size: 0.95rem; color: var(--text-2); }
@media (max-width: 1000px) { .intro-grid { grid-template-columns: repeat(2, 1fr); } }
.calc-layout { display: grid; grid-template-columns: minmax(310px, 420px) minmax(0, 1fr); gap: 20px; align-items: start; }
.calc-layout > *, .doc-layout > *, .ref-layout > *, .calc-outputs > * { min-width: 0; }
.calc-inputs { position: sticky; top: calc(var(--header-h) + 14px); max-height: calc(100vh - var(--header-h) - 28px); display: flex; flex-direction: column; }
.calc-inputs .form-scroll { scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; overflow: auto; padding: 6px 20px 20px; overscroll-behavior: contain; }
.def-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0 4px; }
.calc-outputs { display: grid; gap: 20px; min-width: 0; }
@media (max-width: 980px) { .calc-layout, .calc-layout.topic { grid-template-columns: minmax(0, 1fr); } .calc-inputs { position: static; max-height: none; } .calc-inputs .form-scroll { overflow: visible; overscroll-behavior: auto; } } /* stacked: the inputs are part of the page, not a scroll box that would swallow swipes */
@media (min-width: 981px) { .calc-layout.topic { grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); } }
.form-actions { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.form-actions select { max-width: 200px; text-overflow: ellipsis; }
.fgroup { border: 0; padding: 0; margin: 18px 0 0; min-width: 0; }
.fgroup legend { width: 100%; display: flex; align-items: center; gap: 8px; padding: 0 0 8px; margin-bottom: 6px; font: 800 0.75rem/1.2 var(--font-sans); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text); border-bottom: 1px solid var(--border-strong); }
.field { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 4px 12px; align-items: center; padding: 7px 8px; margin: 0 -8px; border-radius: var(--radius); transition: background 0.15s; }
.field.hl, .field:focus-within { background: var(--accent-soft); }
.field label { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 7px; font-size: 0.92rem; color: var(--text); line-height: 1.3; }
.field label .sym { color: var(--text-2); }
.field .ctl { display: flex; align-items: stretch; border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--surface-2); overflow: hidden; }
.field .ctl:focus-within { border-color: var(--red); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input[type="number"], .field input[type="text"], .field input[type="datetime-local"], .field select { width: 100%; min-width: 0; border: 0; background: transparent; color: var(--text); padding: 8px 10px; font: 600 0.95rem/1.3 var(--font-sans); font-variant-numeric: tabular-nums; outline: none; }
.field select { font-weight: 400; cursor: pointer; }
.field.date { grid-template-columns: 1fr; }
.dt { position: relative; }
.dt-btn { width: 100%; display: flex; align-items: center; gap: 8px; text-align: left; border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--surface-2); color: var(--text); padding: 8px 10px; font: 600 0.95rem/1.3 var(--font-sans); cursor: pointer; }
.dt-btn:hover, .dt-btn[aria-expanded="true"] { border-color: var(--red); }
.dt-btn:focus-visible { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--accent-soft); }
.dt-ico { filter: grayscale(1); font-size: 0.95rem; }
.dt-pop { margin-top: 6px; max-width: 340px; padding: 12px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18); }
.dt-head { display: grid; grid-template-columns: auto 1fr auto auto; gap: 6px; align-items: center; margin-bottom: 8px; }
.dt-head select, .dt-time select { border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--surface-2); color: var(--text); padding: 5px 6px; font: 600 0.9rem var(--font-sans); cursor: pointer; }
.dt-nav { width: 30px; height: 30px; border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--surface-2); color: var(--text); font-size: 1.1rem; cursor: pointer; }
.dt-nav:hover, .dt-day:hover { border-color: var(--red); }
.dt-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.dt-dow { text-align: center; font-size: 0.72rem; color: var(--text-3); padding: 2px 0 4px; }
.dt-day { aspect-ratio: 1; border: 1px solid transparent; border-radius: var(--radius); background: transparent; color: var(--text); font: 500 0.88rem var(--font-sans); cursor: pointer; }
.dt-day.today { border-color: var(--hairline); font-weight: 700; }
.dt-day.on { background: var(--red); color: #fff; font-weight: 700; }
.dt-time { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--hairline); font-size: 0.88rem; }
.dt-time .muted { margin-left: auto; color: var(--text-3); font-size: 0.78rem; }
.dt-foot { display: flex; gap: 6px; margin-top: 10px; }
.dt-foot .spacer { flex: 1; }
.field .unit { flex: none; align-self: center; min-width: 5ch; text-align: right; padding: 0 10px 0 2px; font-size: 0.85rem; color: var(--text-3); white-space: nowrap; }
/* the message floats under the control instead of inserting a row, so a validation error never moves the fields below */
.field { position: relative; }
.field .err-msg { position: absolute; z-index: 5; right: 8px; top: calc(100% - 6px); max-width: min(320px, calc(100% - 16px)); padding: 4px 8px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--err); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16); font-size: 0.8rem; line-height: 1.3; color: var(--err); }
.field .err-msg:empty { display: none; }
.field.invalid .ctl { border-color: var(--err); }
.field.bool { grid-template-columns: minmax(0, 1fr) auto; }
/* RocketBackView (js/ui/backview.js) under fin-count inputs */
.field .backview { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin-top: 4px; }
.backview .bv-svg svg { display: block; width: 100%; max-width: 240px; height: auto; margin: 0 auto; }
.backview .bv-text { margin: 0; font-size: 0.78rem; line-height: 1.35; color: var(--text-2); min-height: 6.8em; }
.backview .bv-text.warn { color: var(--warn); font-weight: 600; }
.rbv-body { fill: var(--schem-fill); stroke: var(--schem-stroke); stroke-width: 1.4; }
.rbv-inner { fill: none; stroke: var(--schem-dim); stroke-width: 1; stroke-dasharray: 3 2; }
.rbv-fin { fill: var(--schem-fill-2); stroke: var(--schem-stroke); stroke-width: 1; }
.rbv-fin1 { fill: var(--red); stroke: var(--red); }
.rbv-dim { fill: none; stroke: var(--schem-dim); stroke-width: 1; }
.rbv-label, .rbv-one { fill: var(--text); font: 500 11px var(--font-sans); font-variant-numeric: tabular-nums; }
.rbv-one { fill: var(--red-text, var(--red)); font-weight: 700; }
.rbv-caption { fill: var(--text-2); font: 700 10.5px var(--font-sans); text-transform: uppercase; letter-spacing: 0.04em; }
.rbv-note { fill: var(--text-3); font: 10px var(--font-sans); }
.field input[type="range"] { grid-column: 1 / -1; width: 100%; accent-color: var(--red); margin: 0; height: 18px; }
.range-touch { grid-column: 1 / -1; display: block; padding: 4px 0; touch-action: pan-y; } /* touch: a vertical swipe scrolls, a sideways drag moves the slider (form.js) */
.range-touch input[type="range"] { display: block; pointer-events: none; }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--border-strong); transition: background 0.2s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.2s var(--ease); }
.switch input:checked + span { background: var(--red); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.ptable-wrap { overflow: auto; border: 1px solid var(--hairline); border-radius: var(--radius); margin-top: 6px; max-height: 300px; background: var(--surface-2); }
table.ptable { border-collapse: collapse; width: 100%; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
table.ptable th { position: sticky; top: 0; background: var(--surface-3); color: var(--text); font: 600 0.72rem var(--font-sans); text-transform: uppercase; letter-spacing: 0.04em; text-align: left; padding: 8px; white-space: nowrap; }
table.ptable td { padding: 2px 4px; border-top: 1px solid var(--border); }
table.ptable td input { width: 100%; min-width: 64px; border: 1px solid transparent; background: transparent; color: var(--text); font: inherit; padding: 5px 7px; border-radius: 4px; }
table.ptable td input:focus { outline: none; border-color: var(--red); }
table.ptable td.idx { color: var(--text-3); width: 28px; text-align: right; }
table.ptable tr.hl td { background: var(--accent-soft); }
table.ptable button { border: 0; background: none; color: var(--text-3); cursor: pointer; padding: 2px 6px; font-size: 1rem; }
table.ptable button:hover { color: var(--red); }
.ptable-actions { display: flex; gap: 6px; margin-top: 8px; }
.compat { margin-top: 18px; padding: 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px dashed var(--border-strong); }
.compat .field { margin: 0; padding: 0; }
.compat p { margin: 6px 0 0; font-size: 0.82rem; color: var(--text-3); }
/* Verdict banner (def.verdict): icon + word + colour, a one-line summary and up to three fixes, in a box of fixed
   height so a changing verdict never moves the content below */
.verdict { display: grid; grid-template-rows: auto auto 1fr; gap: 4px; min-height: 9.6rem; max-height: 9.6rem; overflow: hidden; padding: 14px 18px; border-radius: var(--radius); border: 1px solid var(--border-strong); border-left-width: 6px; background: var(--surface-2); }
.verdict-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.verdict-icon { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font: 800 0.95rem/1 var(--font-sans); color: #fff; background: var(--text-3); }
.verdict-word { flex: none; font: 800 1.15rem/1 var(--font-sans); letter-spacing: 0.02em; }
.verdict-title { min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.verdict-text { font-size: 0.9rem; color: var(--text-2); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.verdict-fixes { margin: 0; padding-left: 1.1em; font-size: 0.86rem; overflow: hidden; }
.verdict-fixes li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.verdict-safe { border-left-color: var(--ok); } .verdict-safe .verdict-icon { background: var(--ok); } .verdict-safe .verdict-word { color: var(--ok); }
.verdict-marginal { border-left-color: var(--warn); } .verdict-marginal .verdict-icon { background: var(--warn); } .verdict-marginal .verdict-word { color: var(--warn); }
.verdict-unsafe { border-left-color: var(--danger); background: var(--err-soft); } .verdict-unsafe .verdict-icon { background: var(--danger); } .verdict-unsafe .verdict-word { color: var(--danger); }
/* phones: the title gets its own line and the box room for three two-line fixes (still a fixed height) */
@media (max-width: 600px) {
  .verdict { min-height: 19rem; max-height: 19rem; padding: 12px 14px; }
  .verdict-head { flex-wrap: wrap; row-gap: 4px; }
  .verdict-title { flex-basis: 100%; white-space: normal; font-size: 0.95rem; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  .verdict-fixes li { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
}
.notice .notice-fix { margin-top: 4px; }
/* Explore (def.tiers): the second tier, closed by default */
.explore { border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface); }
.explore > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 10px; padding: 14px 18px; }
.explore > summary::-webkit-details-marker { display: none; }
.explore > summary::before { content: "▸"; transition: transform 0.15s; }
.explore[open] > summary::before { transform: rotate(90deg); }
.explore-title { font: 800 1rem var(--font-sans); text-transform: uppercase; letter-spacing: 0.03em; }
.explore-sub { font-size: 0.86rem; color: var(--text-3); }
.explore-body { display: grid; gap: 20px; padding: 0 14px 14px; }
.limits ul { margin: 6px 0 0; padding-left: 1.2em; } .limits li { margin: 4px 0; font-size: 0.9rem; }
.key-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.kr { position: relative; padding: 16px 18px 14px; border-radius: var(--radius); background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong); border-left: 4px solid var(--border-strong); }
.kr .kr-label { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.82rem; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
/* warnings dock: fixed in the bottom corner so notices never shift the layout */
.notice-dock { position: fixed; right: 16px; bottom: 16px; z-index: 45; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100vw - 32px)); max-height: 45vh; overflow-y: auto; pointer-events: none; }
.notice-dock:empty { display: none; }
.notice-dock .notice { position: relative; isolation: isolate; margin: 0; padding-right: 34px; pointer-events: auto; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); font-size: 0.88rem; }
/* solid layer under the (possibly translucent) tint so the page does not show through */
.notice-dock .notice::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--bg); }
.notice-dock .notice-x { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 1.1rem; line-height: 1; cursor: pointer; opacity: 0.7; }
.notice-dock .notice-x:hover, .notice-dock .notice-x:focus-visible { opacity: 1; background: rgba(0, 0, 0, 0.08); }
@media print { .notice-dock { display: none; } }
/* phones: the dock must not cover a third of the screen; notices clamp to 2 lines and hide the fix visually (screen readers still read both)
   and open on tap */
@media (max-width: 600px) {
  .notice-dock { max-height: 30vh; }
  .notice-dock .notice:not(.open) { cursor: pointer; }
  .notice-dock .notice:not(.open) > div:first-child { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .notice-dock .notice:not(.open) .notice-fix { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}

/* value and unit always share one line; the number shrinks with the card instead of pushing the unit down */
.kr { container-type: inline-size; }
.kr .kr-row { display: flex; align-items: baseline; flex-wrap: nowrap; white-space: nowrap; min-width: 0; }
.kr .kr-value { font-weight: 800; font-size: clamp(1.1rem, 11cqi, 2rem); line-height: 1.05; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kr .kr-unit { font-size: 1rem; font-weight: 400; margin-left: 6px; color: var(--text-2); flex: none; }
/* the note area keeps two lines whether or not the text needs them, so a note that grows never moves the cards below */
.kr .kr-note { font-size: 0.8rem; line-height: 1.35; color: var(--text-3); margin-top: 4px; min-height: 2.7em; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.kr.status-ok { border-left-color: var(--ok); }
.kr.status-warn { border-left-color: var(--warn); }
.kr.status-err { border-color: var(--danger); background: var(--err-soft); }
.kr.flash .kr-value { animation: flash 0.6s var(--ease); }
@keyframes flash { from { color: var(--red); } }
.kr.hl { outline: 2px solid var(--red); }
/* DiagramViewport (js/ui/viewport.js): fixed box (aspect ratio set from the first canvas), drawing fitted inside;
   the controls sit in a fixed-height bar below so they never cover the drawing */
.dv-wrap { margin: 6px 14px 10px; }
.dv { position: relative; border-radius: var(--radius); overflow: hidden; outline: none; }
.dv > .schem-host { position: absolute; inset: 0; padding: 4px; }
.dv:focus-visible, .dv.dv-active { box-shadow: 0 0 0 2px var(--accent-soft), inset 0 0 0 1px var(--border-strong); }
.dv.dv-zoomed { cursor: grab; } .dv.dv-panning { cursor: grabbing; }
.schem-host svg { display: block; width: 100%; height: 100%; touch-action: pan-y; }   /* one finger scrolls the page */
.sc-handle { touch-action: none; }                                                    /* handles still drag */
.dv-bar { display: flex; align-items: center; gap: 4px; height: 34px; margin-top: 4px; }
.dv-btn { min-width: 30px; height: 28px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: var(--pill); background: var(--surface); color: var(--text); font: 600 0.95rem/1 var(--font-sans); cursor: pointer; }
.dv-btn.dv-reset { font-size: 0.78rem; }
.dv-btn:disabled { opacity: 0.4; cursor: default; }
.dv-btn:not(:disabled):hover { border-color: var(--red); }
.dv-hint { font-size: 0.75rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sc-body { fill: var(--schem-fill); stroke: var(--schem-stroke); stroke-width: 1.5; vector-effect: non-scaling-stroke; transition: fill 0.2s; }
.sc-body-2 { fill: var(--schem-fill-2); stroke: var(--schem-stroke); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.sc-line { fill: none; stroke: var(--schem-stroke); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.sc-thin { fill: none; stroke: var(--schem-dim); stroke-width: 1; vector-effect: non-scaling-stroke; }
.sc-axis { fill: none; stroke: var(--schem-dim); stroke-width: 1; stroke-dasharray: 10 4 2 4; vector-effect: non-scaling-stroke; }
.sc-dim { fill: none; stroke: var(--schem-dim); stroke-width: 1; vector-effect: non-scaling-stroke; }
.sc-dim-text { fill: var(--text); font: 500 11.5px var(--font-sans); font-variant-numeric: tabular-nums; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.sc-label { fill: var(--text-2); font: 12px var(--font-sans); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.sc-on-accent { fill: #fff; font: 600 12px var(--font-sans); }
.sc-accent { fill: none; stroke: var(--red); stroke-width: 2; vector-effect: non-scaling-stroke; }
.sc-accent-fill { fill: var(--red); }
.sc-accent2 { fill: none; stroke: var(--text); stroke-width: 2; vector-effect: non-scaling-stroke; }
.sc-accent2-fill { fill: var(--text); }
.sc-key { fill: var(--red); }
.sc-hit { cursor: pointer; }
.sc-dim.hl, .sc-thin.hl, .sc-line.hl { stroke: var(--red); stroke-width: 2.4; }
.sc-body.hl, .sc-body-2.hl { fill: var(--accent-soft); stroke: var(--red); }
.sc-dim-text.hl { fill: var(--red-text); font-weight: 700; }
.sc-handle { fill: var(--bg); stroke: var(--red); stroke-width: 2.4; cursor: grab; vector-effect: non-scaling-stroke; }
.sc-handle:hover, .sc-handle.dragging { fill: var(--red); cursor: grabbing; }
/* fixed columns: a value that gains a digit never moves the other columns (DISCOVERY.md §7); fmt() output is ≤ 13 characters */
.results-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; table-layout: fixed; }
.results-table th, .results-table td { text-align: left; padding: 9px 20px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.results-table th { font-weight: 400; color: var(--text); }
.results-table td.v { width: calc(13ch + 32px); font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.results-table td.u { width: calc(8ch + 24px); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 8px; }
.results-table thead th.v { width: calc(13ch + 32px); }
/* phones: the label gets its own line; value and unit sit below it in fixed cells */
@media (max-width: 600px) {
  .results-table, .results-table tbody { display: block; }
  .results-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) calc(13ch + 12px) calc(7ch + 12px); border-bottom: 1px solid var(--border); }
  .results-table tbody tr:last-child { border-bottom: 0; }
  .results-table tbody th { grid-column: 1 / -1; padding: 9px 12px 0; border: 0; }
  .results-table tbody td { border: 0; padding: 2px 12px 9px; width: auto; }
  .results-table tbody td.v { grid-column: 2; width: auto; padding-right: 6px; }
  .results-table tbody td.u { grid-column: 3; width: auto; padding-left: 2px; }
  .results-table tbody td.v.base, .results-table tbody td.delta { grid-column: auto; }
  .results-table thead { display: none; }
}
.results-table tr.key th { font-weight: 700; }
.results-table tr.key.status-ok td.v { color: var(--ok); }
.results-table tr.key.status-warn td.v { color: var(--warn); }
.results-table tr.key.status-err td.v { color: var(--danger); }
.results-table tr:last-child th, .results-table tr:last-child td { border-bottom: 0; }
.results-table .lbl { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.warnings { display: grid; gap: 8px; }
.plot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 20px; }
@media (max-width: 460px) { .plot-grid { grid-template-columns: minmax(0, 1fr); } }
.refs-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.refs-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 16px; border-radius: var(--radius); background: var(--surface-2); }
.refs-list li > div:first-child { flex: 1 1 220px; min-width: 0; }
.refs-list .t { font-weight: 600; overflow-wrap: anywhere; }
.refs-list .a { font-size: 0.85rem; color: var(--text-3); overflow-wrap: anywhere; }
.refs-list .go { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px; }
.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 28px; }
.prevnext a { display: block; padding: 18px 20px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 1.1rem; transition: background 0.2s, color 0.2s; }
.prevnext a:hover { background: var(--key-bg); color: var(--key-text); }
.prevnext small { display: block; color: var(--red-text); font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 2px; }
.prevnext a:hover small { color: inherit; }
.prevnext .next { text-align: right; }

/* ---------- menus (export) ---------- */
.menu { position: relative; display: inline-block; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 250px; padding: 6px; background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18); display: none; }
.menu.open .menu-pop { display: grid; }
.menu-pop button { text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 4px; font: 400 0.92rem var(--font-sans); color: var(--text); cursor: pointer; display: flex; justify-content: space-between; gap: 12px; }
.menu-pop button { white-space: nowrap; }
.menu-pop button small { color: var(--text-3); }
.menu-pop .menu-sep { height: 1px; margin: 5px 6px; background: var(--border-strong); }
.menu-pop button:hover, .menu-pop button:focus-visible { background: var(--surface); }

/* ---------- report box ---------- */
.report-tabs { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--hairline); border-radius: var(--pill); overflow: hidden; }
.report-tabs button { border: 0; background: none; padding: 8px 16px; font: 600 0.85rem var(--font-sans); color: var(--text); cursor: pointer; }
.report-tabs button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.report-body { padding: 18px 20px 22px; display: grid; gap: 14px; }
.report-body textarea { width: 100%; min-height: 360px; resize: vertical; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--hairline); background: var(--surface-2); color: var(--text); font: 0.82rem/1.5 var(--font-mono); white-space: pre; }
.report-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.report-preview { max-height: 560px; overflow: auto; padding: 22px 26px; border-radius: var(--radius); background: var(--surface-2); }
.report-preview h1 { font-size: 1.6rem; text-transform: none; letter-spacing: -0.01em; line-height: 1.2; }
.report-preview h2 { font-size: 1.25rem; font-weight: 700; margin-top: 1.2em; }
.report-preview h3 { font-size: 1rem; margin-top: 1em; }
.report-preview table { border-collapse: collapse; width: 100%; font-size: 0.9rem; margin: 8px 0 14px; }
.report-preview th, .report-preview td { border: 1px solid var(--border-strong); padding: 5px 9px; text-align: left; }
.report-preview .katex-display { margin: 0.5em 0; overflow-x: auto; overflow-y: hidden; padding: 2px 0; }

/* ---------- chart ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font-sans); touch-action: pan-y; } /* a sideways finger reads along the curve, a vertical one scrolls */
.chart .grid line { stroke: var(--border); stroke-width: 1; }
.chart .axis path { stroke: var(--border-strong); }
.chart .tick text { fill: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .axis-label { fill: var(--text); font: 600 12px var(--font-sans); }
.chart .series { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart .series.dashed { stroke-dasharray: 6 4; }
.chart .series.anim { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: chart-draw 0.7s var(--ease) forwards; }
@keyframes chart-draw { to { stroke-dashoffset: 0; } }
.chart .marker circle { stroke: var(--surface); stroke-width: 2; }
.chart .marker text { font-size: 11px; font-weight: 600; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.chart .crosshair { stroke: var(--text-3); stroke-dasharray: 3 3; stroke-width: 1; }
.chart .hover-dot { stroke: var(--surface); stroke-width: 2; }
.chart .hline { stroke-dasharray: 4 4; stroke-width: 1.2; }
.chart-empty-msg { display: none; }
.chart.is-empty .chart-body, .chart.is-empty .chart-legend { opacity: 0.18; pointer-events: none; }
.chart.is-empty .chart-empty-msg { display: flex; position: absolute; inset: 0; align-items: center; justify-content: center; padding: 16px; text-align: center; font-size: 0.9rem; color: var(--text-2); }
.chart-tip { position: absolute; pointer-events: none; z-index: 5; padding: 8px 11px; border-radius: var(--radius); background: var(--ink-brand); color: #fff; font: 0.8rem/1.5 var(--font-sans); font-variant-numeric: tabular-nums; white-space: nowrap; transform: translate(12px, -50%); opacity: 0; transition: opacity 0.12s; }
.chart-tip.show { opacity: 1; }
.chart-tip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
/* one row that scrolls sideways when it does not fit: a legend that wraps when its labels change moved the cards below */
.chart-legend { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 6px; padding: 0 14px 12px; mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.chart-legend::-webkit-scrollbar { display: none; }   /* a scrollbar appearing would change the height */
.chart-legend button { flex: none; white-space: nowrap; height: 28px; line-height: 1; overflow: hidden; }   /* maths in a label must not change its height */
.chart-legend button { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border-strong); border-radius: var(--pill); background: var(--surface-2); color: var(--text); font: 0.8rem var(--font-sans); padding: 4px 12px; cursor: pointer; }
.chart-legend button[aria-pressed="false"] { opacity: 0.45; text-decoration: line-through; }
.chart-legend button[disabled] { opacity: 0.35; cursor: default; }
.chart-legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.chart-body { padding: 10px 12px 4px; }

/* ---------- drawer ---------- */
.drawer-overlay { position: fixed; inset: 0; z-index: 80; background: var(--overlay); opacity: 0; transition: opacity 0.25s var(--ease); }
.drawer-overlay.open { opacity: 1; }
.drawer { position: fixed; z-index: 81; top: 0; right: 0; bottom: 0; width: min(540px, 100vw); display: flex; flex-direction: column; background: var(--bg); transform: translateX(104%); transition: transform 0.32s var(--ease); visibility: hidden; }
.drawer.open { transform: none; visibility: visible; }
.drawer header { display: flex; align-items: flex-start; gap: 10px; padding: 22px 24px 18px; background: var(--ink-brand); color: var(--on-dark); }
.drawer header h2 { margin: 2px 0 0; font-size: 1.5rem; font-weight: 800; text-transform: uppercase; letter-spacing: -0.01em; line-height: 1.05; }
.drawer header .eyebrow { margin: 0; color: #ff5a5a; }
.drawer header .close { margin-left: auto; flex: none; }
.drawer .drawer-body { flex: 1; overflow: auto; padding: 20px 24px; }
.drawer .drawer-body h3 { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--red-text); margin: 22px 0 8px; }
.drawer .drawer-body h3:first-child { margin-top: 0; }
.drawer .formula { padding: 16px 14px; border-radius: var(--radius); background: var(--surface); overflow-x: auto; }
.drawer .diagram { border-radius: var(--radius); background: var(--surface); padding: 10px; }
.drawer .diagram svg { width: 100%; height: auto; display: block; }
.drawer .diagram .dimmed { opacity: 0.3; }
.drawer .diagram-cap { font-size: 0.82rem; color: var(--text-3); margin: 6px 2px 0; }
.drawer ol.walk { margin: 0; padding: 0; list-style: none; counter-reset: walk; display: grid; gap: 12px; }
.drawer ol.walk li { position: relative; padding-left: 36px; font-size: 0.95rem; color: var(--text-2); }
.drawer ol.walk li::before { counter-increment: walk; content: counter(walk); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--red); color: #fff; font-weight: 700; font-size: 0.78rem; }
.drawer .range { font-size: 0.95rem; color: var(--text); padding: 10px 12px; border-radius: var(--radius); background: var(--surface); border-left: 4px solid var(--red); }
.drawer footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- command palette ---------- */
.palette-overlay { position: fixed; inset: 0; z-index: 90; background: var(--overlay); display: none; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; }
.palette-overlay.open { display: flex; animation: fade 0.15s ease-out; }
@keyframes fade { from { opacity: 0; } }
.palette { width: min(660px, 100%); max-height: 70vh; display: flex; flex-direction: column; background: var(--bg); border-radius: var(--radius); overflow: hidden; animation: pop 0.18s var(--ease); }
@keyframes pop { from { transform: translateY(-6px) scale(0.99); opacity: 0; } }
.palette input { border: 0; border-bottom: 1px solid var(--border-strong); padding: 18px 20px; font: 1.05rem var(--font-sans); background: transparent; color: var(--text); outline: none; }
.palette ul { list-style: none; margin: 0; padding: 6px; overflow: auto; }
.palette li a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 4px; color: var(--text); text-decoration: none; }
.palette li a .k { font-weight: 800; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--red-text); width: 78px; flex: none; }
.palette li a .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette li a .s { color: var(--text-3); font-size: 0.8rem; flex: none; }
.palette li a[aria-selected="true"] { background: var(--surface); }
.palette .hint { padding: 9px 16px; border-top: 1px solid var(--border); font-size: 0.78rem; color: var(--text-3); display: flex; gap: 14px; }

/* ---------- references ---------- */
.ref-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 20px; align-items: start; }
@media (max-width: 1060px) { .ref-layout { grid-template-columns: minmax(0, 1fr); } }
.ref-items { display: grid; gap: 8px; }
.ref-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 14px; align-items: center; padding: 14px 16px; cursor: pointer; text-align: left; font: inherit; color: var(--text); width: 100%; border: 0; transition: background 0.15s, color 0.15s; scroll-margin-top: calc(var(--header-h) + 20px); }
.ref-item:hover { background: var(--surface-3); }
.ref-item[aria-current="true"] { background: var(--key-bg); color: var(--key-text); }
.ref-item[aria-current="true"] .a, .ref-item[aria-current="true"] .sz { color: inherit; opacity: 0.75; }
.ref-item.target { animation: target 1.6s var(--ease); }
@keyframes target { 0%, 40% { box-shadow: 0 0 0 3px var(--red); } }
.ref-item .pdf-ico { width: 30px; height: 36px; flex: none; }
.ref-item .t { font-weight: 600; font-size: 0.95rem; line-height: 1.3; overflow-wrap: anywhere; }
.ref-item .a { font-size: 0.8rem; color: var(--text-3); margin-top: 2px; }
.ref-item .tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.ref-item .sz { font-size: 0.75rem; color: var(--text-3); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.viewer { position: sticky; top: calc(var(--header-h) + 14px); height: calc(100vh - var(--header-h) - 28px); display: flex; flex-direction: column; overflow: hidden; }
.viewer iframe { flex: 1; width: 100%; border: 0; background: var(--surface-3); }
.viewer .viewer-empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--text-3); padding: 30px; }
.viewer .card-head .t { font-weight: 700; font-size: 0.95rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1060px) { .viewer { position: relative; top: 0; height: 80vh; } }

/* ---------- docs ---------- */
.doc-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 40px; align-items: start; }
.doc-toc { position: sticky; top: calc(var(--header-h) + 20px); font-size: 0.9rem; max-height: calc(100vh - var(--header-h) - 40px); overflow: auto; }
.doc-toc h4 { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 10px; }
.doc-toc ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; border-left: 1px solid var(--border-strong); }
.doc-toc a { display: block; padding: 5px 14px; margin-left: -1px; border-left: 3px solid transparent; color: var(--text-2); text-decoration: none; }
.doc-toc a:hover { color: var(--text); }
.doc-toc a.active { border-left-color: var(--red); color: var(--text); font-weight: 700; }
.doc { max-width: 880px; }
.doc section { padding: 28px 0 8px; border-top: 1px solid var(--border-strong); scroll-margin-top: calc(var(--header-h) + 16px); }
.doc section:first-of-type { border-top: 0; }
.doc section:target h2 { color: var(--red-text); }
.doc h2 { display: flex; align-items: baseline; gap: 12px; }
.doc h2 .num { font-size: 0.85rem; font-weight: 800; color: var(--red-text); }
.doc p, .doc li { color: var(--text-2); font-size: 1.02rem; }
.doc strong { color: var(--text); }
.eq { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; margin: 16px 0; padding: 14px 18px; border-radius: var(--radius); background: var(--surface); overflow-x: auto; }
.eq .no { font-size: 0.85rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.sym-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; margin: 12px 0 18px; }
.sym-table th, .sym-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.sym-table th { background: var(--surface); font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.sym-table td:first-child { white-space: nowrap; }
.sym-table td.mono { font-family: var(--font-mono); font-size: 0.82rem; word-break: break-word; }
.callout { padding: 14px 18px; border-left: 4px solid var(--text); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; margin: 16px 0; }
.callout.warn { border-left-color: var(--red); }
.callout p:last-child { margin-bottom: 0; }
.diff-list { display: grid; gap: 10px; padding: 0; list-style: none; }
.diff-list li { padding: 14px 16px; border-left: 4px solid var(--red); border-radius: 0 var(--radius) var(--radius) 0; background: var(--surface); }
.doc .refs { padding-left: 1.3em; }
.doc .refs li { margin-bottom: 6px; }
@media (max-width: 900px) { .doc-layout { grid-template-columns: minmax(0, 1fr); } .doc-toc { position: static; max-height: none; } }

/* ---------- misc ---------- */
.katex { font-size: 1.05em; }
.field .katex, .results-table .katex, .kr .katex, .unit .katex, .chart-legend .katex, .chart-tip .katex { font-size: 1em; }
.eq .katex-display, .formula .katex-display { margin: 0; }
.doc .katex { max-width: 100%; }
.doc p .katex, .doc li .katex { display: inline-block; overflow-x: auto; overflow-y: hidden; vertical-align: middle; padding: 2px 0; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); z-index: 95; padding: 12px 20px; border-radius: var(--pill); background: var(--ink-brand); color: #fff; font-size: 0.9rem; opacity: 0; transition: opacity 0.2s, transform 0.2s var(--ease); pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.reveal { opacity: 1; }
.reveal.in { opacity: 1; transform: none; }
@media (max-width: 760px) {
  .sym-table { display: block; overflow-x: auto; }
  .intro-grid, .key-results { grid-template-columns: minmax(0, 1fr); }
  .field { grid-template-columns: minmax(0, 1fr) 140px; }
  .prevnext { grid-template-columns: minmax(0, 1fr); }
  .refs-list li .go { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .traj-draw { stroke-dashoffset: 0; }
}
@media print {
  .site-header, .site-footer, .drawer, .calc-inputs .form-actions, .chart-legend { display: none !important; }
  body { background: #fff; }
}
.katex, .katex * { text-transform: none; letter-spacing: normal; }
@media (max-width: 460px) {
  .site-header .wrap { gap: 8px; }
  .header-tools { gap: 4px; }
  .icon-btn { width: 34px; height: 34px; }
  .seg button { padding: 8px 7px; }
  .search-btn { padding: 8px 10px; }
  .brand { gap: 8px; }
}
.card p, .card li, .doc p, .doc li { overflow-wrap: anywhere; }
.drawer dl.where { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 12px 0 0; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border); font-size: 0.92rem; }
.drawer dl.where::before { content: "where"; grid-column: 1 / -1; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }
.drawer dl.where dt { text-align: right; }
.drawer dl.where dd { margin: 0; color: var(--text-2); }
/* KaTeX's hidden MathML copy is position:absolute; without a positioned ancestor inside a scrolling box it escapes the
   box and stretches the page (seen as a tall grey band below the footer once the report rendered). */
.katex { position: relative; }
.report-preview, .drawer .drawer-body, .eq, .drawer .formula, .ptable-wrap, .calc-inputs .form-scroll, .results-table, .chart { position: relative; }

/* ---------- design bar: shared rocket, design files, baseline ---------- */
.design-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 18px; padding: 10px 16px; background: var(--surface); border-radius: var(--radius); }
.design-bar .spacer { flex: 1 1 0; }
.db-rocket { display: flex; align-items: center; gap: 10px; min-width: 0; }
.db-eyebrow { font: 800 0.72rem/1 var(--font-sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.rocket-name { font: 700 1rem var(--font-sans); color: var(--text); background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 5px 8px; width: 15ch; min-width: 8ch; }
.rocket-name:hover { border-color: var(--border-strong); }
.rocket-name:focus { border-color: var(--text); background: var(--surface-2); outline: none; }
.db-share { display: inline-flex; align-items: center; gap: 10px; font-size: 0.9rem; color: var(--text-2); cursor: pointer; }
.compare-box { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.base-chip { background: var(--surface-2); border: 1px solid var(--border); font-weight: 600; }
.base-swatch { display: inline-block; width: 16px; height: 0; border-top: 2px dashed var(--text-3); }
.shared-mark { display: none; color: var(--text-3); margin-left: 2px; vertical-align: middle; }
.shared-mark svg { width: 13px; height: 13px; display: block; }
body.rocket-linked .shared-mark { display: inline-flex; }
.kr .kr-base { font-size: 0.8rem; color: var(--text-3); margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border); font-variant-numeric: tabular-nums; }
.kr .kr-base .up, .kr .kr-base .down { color: var(--text-2); font-weight: 600; }
.results-table thead th { font: 800 0.72rem/1.2 var(--font-sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); padding-top: 12px; padding-bottom: 8px; }
.results-table td.base { color: var(--text-3); }
.results-table td.delta { width: calc(16ch + 24px); color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; }
.results-table td.delta.same { color: var(--text-3); }
@media (max-width: 600px) { .design-bar { padding: 10px 12px; } .design-bar .spacer { display: none; } .rocket-name { width: 100%; } .db-rocket { flex: 1 1 100%; } }
.db-share-wrap { display: inline-flex; align-items: center; gap: 8px; }
.compare-box { flex-wrap: nowrap; }
@media (max-width: 600px) { .db-share-wrap { flex: 1 1 100%; } .compare-box { flex: 1 1 100%; } }
/* About page: author photo beside the text, stacked on phones */
.about-author { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; align-items: start; }
.about-author img { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.about-links { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 640px) { .about-author { grid-template-columns: minmax(0, 1fr); } .about-author img { max-width: 280px; } }

/* Accent colour (header picker, rc-accent): the brand red is replaced; --danger stays red */
:root[data-accent="blue"] { --red: #1f6feb; --red-text: #175cd3; --accent-soft: rgba(31, 111, 235, 0.08); --series-1: #1f6feb; --series-4: #0b3d91; --series-6: #7fb0ff; --const-mark: #0b3d91; }
:root[data-accent="blue"][data-theme="dark"] { --red: #3b82f6; --red-text: #6ea8ff; --accent-soft: rgba(59, 130, 246, 0.18); --series-1: #4d94ff; --series-4: #9cc3ff; --series-6: #1f5fc4; --const-mark: #9cc3ff; }
@media (prefers-color-scheme: dark) { :root[data-accent="blue"]:not([data-theme="light"]) { --red: #3b82f6; --red-text: #6ea8ff; --accent-soft: rgba(59, 130, 246, 0.18); --series-1: #4d94ff; --series-4: #9cc3ff; --series-6: #1f5fc4; --const-mark: #9cc3ff; } }
:root[data-accent="purple"] { --red: #7c3aed; --red-text: #6d28d9; --accent-soft: rgba(124, 58, 237, 0.08); --series-1: #7c3aed; --series-4: #4c1d95; --series-6: #b794f6; --const-mark: #4c1d95; }
:root[data-accent="purple"][data-theme="dark"] { --red: #8b5cf6; --red-text: #a78bfa; --accent-soft: rgba(139, 92, 246, 0.18); --series-1: #9d74ff; --series-4: #c4b0ff; --series-6: #6d28d9; --const-mark: #c4b0ff; }
@media (prefers-color-scheme: dark) { :root[data-accent="purple"]:not([data-theme="light"]) { --red: #8b5cf6; --red-text: #a78bfa; --accent-soft: rgba(139, 92, 246, 0.18); --series-1: #9d74ff; --series-4: #c4b0ff; --series-6: #6d28d9; --const-mark: #c4b0ff; } }
:root[data-accent="pink"] { --red: #db2777; --red-text: #be185d; --accent-soft: rgba(219, 39, 119, 0.08); --series-1: #db2777; --series-4: #831843; --series-6: #f49ac2; --const-mark: #831843; }
:root[data-accent="pink"][data-theme="dark"] { --red: #ec4899; --red-text: #f472b6; --accent-soft: rgba(236, 72, 153, 0.18); --series-1: #f45fa6; --series-4: #f9b4d4; --series-6: #be185d; --const-mark: #f9b4d4; }
@media (prefers-color-scheme: dark) { :root[data-accent="pink"]:not([data-theme="light"]) { --red: #ec4899; --red-text: #f472b6; --accent-soft: rgba(236, 72, 153, 0.18); --series-1: #f45fa6; --series-4: #f9b4d4; --series-6: #be185d; --const-mark: #f9b4d4; } }
:root[data-accent="orange"] { --red: #ea580c; --red-text: #c2410c; --accent-soft: rgba(234, 88, 12, 0.08); --series-1: #ea580c; --series-4: #7c2d12; --series-6: #fdba74; --const-mark: #7c2d12; }
:root[data-accent="orange"][data-theme="dark"] { --red: #f97316; --red-text: #fb923c; --accent-soft: rgba(249, 115, 22, 0.18); --series-1: #ff8a3d; --series-4: #fdc58f; --series-6: #c2410c; --const-mark: #fdc58f; }
@media (prefers-color-scheme: dark) { :root[data-accent="orange"]:not([data-theme="light"]) { --red: #f97316; --red-text: #fb923c; --accent-soft: rgba(249, 115, 22, 0.18); --series-1: #ff8a3d; --series-4: #fdc58f; --series-6: #c2410c; --const-mark: #fdc58f; } }
:root[data-accent="green"] { --red: #15803d; --red-text: #15803d; --accent-soft: rgba(21, 128, 61, 0.08); --series-1: #15803d; --series-4: #14532d; --series-6: #86efac; --const-mark: #14532d; }
:root[data-accent="green"][data-theme="dark"] { --red: #22c55e; --red-text: #4ade80; --accent-soft: rgba(34, 197, 94, 0.18); --series-1: #34d27a; --series-4: #9be8b8; --series-6: #15803d; --const-mark: #9be8b8; }
@media (prefers-color-scheme: dark) { :root[data-accent="green"]:not([data-theme="light"]) { --red: #22c55e; --red-text: #4ade80; --accent-soft: rgba(34, 197, 94, 0.18); --series-1: #34d27a; --series-4: #9be8b8; --series-6: #15803d; --const-mark: #9be8b8; } }
.accent-pick { position: relative; }
.accent-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; display: grid; grid-template-columns: repeat(3, 34px); gap: 8px; padding: 10px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: 0 10px 28px rgba(0,0,0,.18); }
.accent-menu[hidden] { display: none; }
.accent-menu button { width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.accent-menu button[aria-pressed="true"] { border-color: var(--text); box-shadow: inset 0 0 0 2px var(--surface); }
.accent-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--red); display: block; }

/* ---------- guided tour ---------- */
.tour-btn span, .nav-tour span { display: inline-grid; }
.tour-btn svg { width: 19px; height: 19px; }
.nav-tour { display: none; align-items: center; gap: 8px; padding: 8px 12px; border: 0; border-radius: var(--pill); background: transparent; color: var(--on-dark); font: inherit; font-size: 0.95rem; cursor: pointer; }
.nav-tour svg { width: 17px; height: 17px; }
@media (max-width: 520px) { .tour-btn { display: none; } .nav-tour { display: inline-flex; } } /* phones: the tour sits in the menu */
.link-btn { padding: 0; border: 0; background: none; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.tour-spot { position: fixed; z-index: 85; pointer-events: none; border-radius: 10px; box-shadow: 0 0 0 2px var(--red), 0 0 0 9999px rgba(10, 12, 14, 0.58); transition: left 0.3s var(--ease), top 0.3s var(--ease), width 0.3s var(--ease), height 0.3s var(--ease), opacity 0.2s; }
.tour-pop { position: fixed; z-index: 86; width: min(380px, calc(100vw - 24px)); padding: 16px 18px 14px; border-radius: var(--radius); background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28); }
.tour-pop.sheet { left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); width: auto; max-width: 520px; margin: 0 auto; }
.tour-pop.center { top: 50%; bottom: auto; transform: translateY(-50%); box-shadow: 0 0 0 9999px rgba(10, 12, 14, 0.58), 0 16px 40px rgba(0, 0, 0, 0.28); }
.tour-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.tour-count { font: 600 0.75rem var(--font-sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2); }
.tour-close { width: 32px; height: 32px; margin: -6px -8px 0 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-2); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.tour-close:hover { background: var(--surface-2); color: var(--text); }
.tour-title { margin: 0 0 6px; font-size: 1.15rem; font-weight: 800; letter-spacing: -0.01em; text-transform: none; }
.tour-text { margin: 0 0 14px; font-size: 0.95rem; line-height: 1.45; color: var(--text-2); }
.tour-actions { display: flex; justify-content: flex-end; gap: 8px; }
.tour-actions .btn[disabled] { opacity: 0.4; cursor: default; }
@media (prefers-reduced-motion: reduce) { .tour-spot { transition: none; } }
@media print { .tour-spot, .tour-pop { display: none !important; } }
.touring .notice-dock { display: none; } /* the tour card replaces the notices while it runs */

/* ---------- touch screens: fingers need room, iOS must not zoom into fields ---------- */
@media (pointer: coarse) {
  input, select, textarea, .field input[type="number"], .field input[type="text"], .field select, .filter-chip, select.btn, select.btn.small { font-size: 16px; } /* under 16 px iOS zooms the page on focus */
  .field input[type="range"] { height: 30px; }
  .info-btn, .notice-dock .notice-x { position: relative; }
  .info-btn::after, .notice-dock .notice-x::after { content: ""; position: absolute; inset: -11px; } /* a 44 px target around the small button */
  .dv-btn { min-width: 40px; height: 36px; }
  .report-preview.clamped { max-height: 340px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
  .report-more { display: inline-flex; }
}
.report-more { display: none; margin: 10px 0 0; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } } /* in-page links glide instead of jumping */
