/* ─────────────────────────────────────────────────────────────
   Agency AI Live — NSB brand system
   Anton (display, uppercase) + Inter Tight (everything else).
   Palette from nsbagency.com: ink #0b0b0b, verde #80bc00.
   Fonts are self-hosted: the CSP allows font-src 'self' only.
   ───────────────────────────────────────────────────────────── */

@font-face {
  font-family: 'Anton';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/anton-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
                 U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(/fonts/inter-tight-latin-var.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
                 U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}

:root {
  --ink: #0b0b0b;           /* brand black */
  --snow: #ffffff;
  --mist: #ececec;          /* light-gray panels */
  --paper: #e8e8e6;         /* editorial light-gray */
  --verde: #80bc00;         /* brand green, exact from nsbagency.com */
  --verde-bright: #93d400;  /* green on dark */
  --verde-ink: #4d7000;     /* green that passes contrast on white */
  --muted: #4f4f4f;         /* body-muted on light (7.5:1) */
  --smoke: #8a8a8a;         /* decorative gray only */
  --line: #d5d5d3;
  --line-dark: #2e2e2e;
  --red: #a3312c;
  --red-bright: #ff9d8f;    /* negative on dark */
  --radius: 3px;

  --font-display: 'Anton', 'Arial Narrow', Impact, sans-serif;
  --font-sans: 'Inter Tight', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;

  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--snow);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; font-size: 16px; line-height: 1.5; background: var(--snow); color: var(--ink); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input, select { font: inherit; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
button, a, summary { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
a { color: var(--verde-ink); text-underline-offset: 3px; }
[hidden] { display: none !important; }
::selection { background: var(--verde); color: var(--ink); }

/* Display type: Anton is always uppercase and tight, per the brand template. */
h1, h2, h3, .display, .session-code, .stage-join strong, .empty-state strong {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: -.01em;
  line-height: .95;
}
/* Headlines break at natural points — never leave an orphan word. */
h1, h2, h3, h4, .balance { text-wrap: balance; }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}
.profit-card :focus-visible, .active-session :focus-visible, .stage :focus-visible,
body.stage-mode :focus-visible, footer :focus-visible { outline-color: var(--verde-bright); }

.skip { position: absolute; top: -80px; left: 20px; z-index: 10; background: var(--verde); color: var(--ink); padding: 12px 16px; font-weight: 700; text-decoration: none; }
.skip:focus { top: 10px; }

/* ── Brand lockup: product wordmark + NSB pill + descriptor (live text) ── */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--ink);
  padding: 16px max(24px, calc((100vw - 1280px) / 2));
  gap: 20px;
}
.brand { display: inline-flex; gap: 12px; align-items: center; text-decoration: none; color: var(--ink); white-space: nowrap; }
.brand-word { font-family: var(--font-display); font-size: 25px; line-height: 1; text-transform: uppercase; letter-spacing: -.005em; }
.brand-word b { font-weight: 400; color: var(--verde-ink); }
.brand-pill {
  background: var(--verde); color: #fff; font-weight: 800;
  font-size: 12.5px; letter-spacing: .01em; line-height: 1;
  padding: 4px 7px 5px; border-radius: 5px;
}
.brand-pill sup { font-size: .52em; font-weight: 700; margin-left: 1px; }
.brand-tag { font-size: 14px; font-weight: 500; color: var(--muted); }
.topbar nav { display: flex; gap: 6px; }
.topbar nav button { border: 0; background: none; font-weight: 600; color: var(--muted); font-size: 14px; padding: 9px 14px; border-radius: var(--radius); }
.topbar nav button:hover { color: var(--ink); }
.topbar nav .nav-active { background: var(--ink); color: var(--snow); }

main { max-width: 1280px; margin: auto; padding: 0 24px; }

.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--verde-ink); margin: 0 0 12px; }

/* ── Join strip ── */
.join-strip { padding: 20px 0; border-bottom: 1px solid var(--line); }
.join-strip form { display: flex; gap: 22px; align-items: center; justify-content: space-between; }
.join-strip label { font-size: 14px; font-weight: 600; }
.join-strip form > div { display: flex; gap: 10px; }
.join-strip input {
  width: 180px; padding: 11px 12px; border: 1px solid var(--ink); border-radius: var(--radius);
  font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; background: var(--snow);
}

/* ── Buttons ── */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 14px;
  text-decoration: none; padding: 12px 18px; font-size: 14px; line-height: 1.3; font-weight: 600;
  border: 1px solid transparent; border-radius: var(--radius); min-height: 44px;
}
.ink { background: var(--ink); color: var(--snow); }
.ink:hover:not(:disabled) { background: #262626; }
.lime { background: var(--verde); color: var(--ink); font-weight: 700; }
.lime:hover:not(:disabled) { background: var(--verde-bright); }
.outline { border-color: var(--ink); background: var(--snow); color: var(--ink); }
.outline:hover { background: var(--mist); }
.text-button { background: transparent; border: 0; padding: 7px 0; color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.text-button:hover { color: var(--ink); }

/* ── Page intro ── */
.page-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; padding: 40px 0 32px; }
.page-intro h1 { font-size: clamp(38px, 4.6vw, 62px); margin: 0; }
.page-intro h1 em { color: var(--verde); font-style: normal; }
.page-intro > p { font-size: 15px; color: var(--muted); line-height: 1.6; margin: 0 0 4px; }

/* ── Calculator ── */
.calculator-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 38px; align-items: start; }
.controls { min-width: 0; }
.control-section { background: var(--mist); border: 1px solid var(--line); padding: 22px 26px; margin-bottom: 20px; }
.control-section h2 { font-size: 22px; margin: 0 0 22px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.control-section h2 > span { color: var(--verde-ink); font-size: 16px; }
.control-note { font-size: 13.5px; color: var(--muted); margin: -12px 0 22px; line-height: 1.5; max-width: 60ch; }
.control-section h2 small { font-family: var(--font-sans); font-size: 14px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); }

.slider-row { display: block; padding: 0 0 21px; margin: 0 0 20px; border-bottom: 1px solid var(--line); }
.slider-row:last-child { padding-bottom: 0; margin-bottom: 0; border: 0; }
.slider-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; font-size: 15px; font-weight: 600; }
.slider-row output { font-size: 22px; font-weight: 700; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.slider-row small { display: block; font-size: 13px; color: var(--muted); line-height: 1.5; margin-top: 7px; }
.slider-row small .moves { color: var(--ink); font-weight: 700; }
.tally { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 13px 15px; margin: 0 0 20px; background: var(--snow); border: 1px solid var(--ink); }
.tally-label { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.tally-num { display: flex; align-items: baseline; gap: 10px; margin-left: auto; }
.tally-figures { font-size: 20px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tally-delta { font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.slider-row input[type=range] { -webkit-appearance: none; appearance: none; display: block; width: 100%; margin: 14px 0 0; background: transparent; cursor: pointer; }
.slider-row input[type=range]::-webkit-slider-runnable-track { height: 6px; background: var(--snow); border: 1px solid var(--ink); }
.slider-row input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -7px; background: var(--verde); border: 0; border-radius: 50%; }
.slider-row input[type=range]::-moz-range-track { height: 6px; background: var(--snow); border: 1px solid var(--ink); }
/* A tick at "no change". Zero is not the middle of every track: sales volume
   and deliverables run -100..+300, so their zero sits at 25%. */
.slider-row input[type=range].has-zero::-webkit-slider-runnable-track {
  background: linear-gradient(var(--smoke), var(--smoke)) var(--zero) center / 2px 100% no-repeat, var(--snow);
}
.slider-row input[type=range].has-zero::-moz-range-track {
  background: linear-gradient(var(--smoke), var(--smoke)) var(--zero) center / 2px 100% no-repeat, var(--snow);
}
.slider-row input[type=range]::-moz-range-thumb { width: 22px; height: 22px; background: var(--verde); border: 0; border-radius: 50%; }

/* ── Personal result ── */
.personal-result { position: sticky; top: 18px; border: 1px solid var(--ink); background: var(--snow); }
.personal-result > .eyebrow { padding: 17px 24px; margin: 0; color: var(--muted); }
.personal-result article { padding: 22px 24px; }
.personal-result h2 { font-family: var(--font-sans); font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; margin: 0; }
.personal-result article > strong { display: block; font-family: var(--font-display); font-weight: 400; font-size: clamp(40px, 5vw, 64px); letter-spacing: -.02em; line-height: 1; margin: 14px 0 12px; }
.profit-card > strong, .margin-card > strong { font-size: clamp(30px, 3.6vw, 46px); white-space: nowrap; }
.personal-result strong > span { font-size: .42em; letter-spacing: 0; }
.personal-result article p { font-size: 14px; margin: 0; }
.personal-result article small { font-size: 12px; display: block; margin-top: 6px; }

.profit-card { background: var(--ink); color: var(--snow); }
.profit-card strong { color: var(--verde-bright); }
.profit-card.down strong { color: var(--red-bright); }
.margin-card { background: var(--verde); color: var(--ink); }
.margin-card strong { color: var(--ink); }
.margin-card.down strong { color: #2b0a06; }

.mini-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.mini-metrics span { display: block; font-size: 13px; color: var(--muted); }
.mini-metrics b { display: block; font-size: 24px; margin-top: 5px; font-variant-numeric: tabular-nums; }
.mix-panel { padding: 16px 24px; border-bottom: 1px solid var(--line); font-size: 13px; }
.mix-panel p { font-weight: 600; margin: 0 0 8px; }
.mix-panel > div { display: flex; justify-content: space-between; gap: 12px; margin-top: 5px; }
.mix-panel span { color: var(--muted); }
.mix-panel b { font-variant-numeric: tabular-nums; }

.submit-panel { padding: 22px 24px; }
.assumptions-set { margin: 0 0 12px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--verde-ink); }
.assumptions-set.is-empty { color: var(--muted); }
.submit-panel .button { width: 100%; font-size: 15px; min-height: 52px; }
.submit-panel .button:disabled { background: var(--mist); color: var(--muted); border-color: var(--line); opacity: 1; }
.submit-panel p { font-size: 13px; margin: 12px 0 7px; }
.submit-panel small { font-size: 12px; color: var(--muted); display: block; line-height: 1.5; }
.submit-panel > a { display: block; font-size: 14px; margin-top: 14px; font-weight: 600; }

/* ── Method ── */
.method { border-top: 1px solid var(--ink); padding: 22px 0; margin-top: 34px; }
.method summary { font-size: 14px; font-weight: 600; cursor: pointer; }
.method p { font-size: 14px; color: var(--muted); }
.method strong { color: var(--ink); font-weight: 600; }
.method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 30px; margin-top: 10px; }

/* ── Active session banner ── */
.active-session { background: var(--ink); color: var(--snow); padding: 22px 26px; display: flex; justify-content: space-between; gap: 24px; margin-top: 24px; }
.active-session .eyebrow { color: var(--verde-bright); margin: 0 0 6px; }
.active-session h2 { font-size: 26px; margin: 0 0 6px; }
.active-session p { font-size: 13px; margin: 0; color: #c9c9c9; }
.active-session > div:last-child { text-align: right; }
.active-session .text-button { display: block; margin-left: auto; color: #e0e0e0; }
.session-code { font-size: 30px; letter-spacing: .1em; white-space: nowrap; }

.notice { background: #fff6e0; border-left: 4px solid var(--ink); color: var(--ink); padding: 15px 20px; margin-top: 20px; font-size: 14px; }

/* ── Presenter: create ── */
.create-panel { max-width: 650px; margin: 70px auto; }
.create-panel h1 { font-size: clamp(42px, 5vw, 58px); margin: 0 0 20px; }
.create-panel > p:not(.eyebrow) { color: var(--muted); font-size: 17px; }
.create-panel form { display: grid; grid-template-columns: 1fr auto auto; gap: 22px; align-items: end; margin: 32px 0; }
.fixed-horizon { margin: 0; font-size: 14px; font-weight: 600; }
.fixed-horizon b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 34px; line-height: 1; margin-top: 10px; letter-spacing: .01em; }
.create-panel label { font-size: 14px; font-weight: 600; }
.create-panel input, .create-panel select { display: block; width: 100%; padding: 12px; border: 1px solid var(--ink); border-radius: var(--radius); background: var(--snow); color: var(--ink); margin-top: 8px; }
.create-panel button { grid-column: 1 / -1; }
.fine { font-size: 13px !important; color: var(--muted); line-height: 1.5; }
#savedSessions { margin-top: 35px; border-top: 1px solid var(--line); padding-top: 16px; }
#savedSessions h2 { font-size: 22px; }
#savedSessionList > a { display: block; padding: 14px 0; font-size: 15px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 500; }
#savedSessionList > a:hover { color: var(--verde-ink); }

/* ── Presenter: host ── */
.host-header { display: flex; justify-content: space-between; gap: 30px; align-items: center; padding: 44px 0 26px; }
.host-header h1 { font-size: clamp(32px, 3.6vw, 46px); margin: 0; }
.host-header p:last-child { margin: 10px 0 0; color: var(--muted); font-size: 14px; font-family: var(--font-sans); }
.host-tools { display: flex; gap: 10px; flex-wrap: wrap; }
.host-share { background: var(--mist); border: 1px solid var(--line); margin: 24px 0 35px; display: grid; grid-template-columns: 180px 1fr; gap: 28px; align-items: center; padding: 22px; }
.qr-wrap img { width: 100%; height: auto; display: block; background: #fff; }
.host-share h2 { font-size: 24px; margin: 0 0 10px; }
.share-url { overflow-wrap: anywhere; font-size: 15px; color: var(--verde-ink); font-weight: 500; }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; }
.host-share .fine { margin-bottom: 0; }

/* ── Aggregate results ── */
.aggregate-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 30px 0 18px; }
.aggregate-heading h2 { font-size: 30px; margin: 0; }
.count-pill { background: var(--verde); color: var(--ink); padding: 7px 13px; font-size: 14px; font-weight: 700; border-radius: 5px; white-space: nowrap; }
.aggregate-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.aggregate-card { padding: 28px; background: var(--ink); color: var(--snow); }
.aggregate-card:nth-child(2) { background: var(--verde); color: var(--ink); }
.aggregate-card h3 { font-family: var(--font-sans); font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; margin: 0; }
.aggregate-card strong { display: block; font-family: var(--font-display); font-weight: 400; font-size: clamp(44px, 5.6vw, 76px); line-height: 1; letter-spacing: -.02em; color: var(--verde-bright); margin: 18px 0 14px; }
.aggregate-card:nth-child(2) strong { color: var(--ink); }
.aggregate-card strong span { font-size: .38em; letter-spacing: 0; }
.aggregate-card p { font-size: 14px; margin: 0; }
.aggregate-card small { display: block; font-size: 12px; margin-top: 8px; color: #c9c9c9; }
.aggregate-card:nth-child(2) small { color: #2c3f00; }

.average-assumptions { border: 1px solid var(--line); margin: 24px 0; padding: 24px; }
.average-assumptions h3 { font-size: 22px; margin: 0 0 18px; }
.averages-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.average-row { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; border-top: 1px solid var(--line); padding: 13px 0; font-size: 14px; }
.average-row b { font-size: 21px; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); }
.average-row small { font-size: 12px; color: var(--muted); display: block; }
.aggregate-note { font-size: 13px; color: var(--muted); line-height: 1.6; }
.aggregate-note strong { color: var(--ink); font-weight: 600; }
.mean-scenario { border-top: 1px solid var(--line); padding: 18px 0; margin-top: 18px; font-size: 14px; }
.mean-scenario summary { font-weight: 600; cursor: pointer; }
.mean-scenario p { color: var(--muted); }
.empty-state { border: 1px dashed var(--smoke); background: var(--mist); padding: 58px 25px; text-align: center; margin: 25px 0; }
.empty-state strong { font-size: 34px; display: block; margin-bottom: 12px; }
.empty-state p { color: var(--muted); margin: 0; font-size: 15px; font-family: var(--font-sans); }

/* ── Distribution: where the room lands ── */
.distribution { border: 1px solid var(--line); margin: 24px 0; padding: 24px; }
.distribution h3 { font-size: 22px; margin: 0 0 6px; }
.dist-sub { font-size: 13px; color: var(--muted); margin: 0 0 24px; }
.dist-plot { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; align-items: end; }
.dist-col { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.dist-share { font-family: var(--font-display); font-weight: 400; font-size: 30px; line-height: 1; color: var(--ink); margin-bottom: 10px; }
.dist-col.is-empty .dist-share { color: var(--smoke); }
.dist-track { width: 100%; height: 150px; display: flex; align-items: flex-end; border-bottom: 2px solid var(--ink); }
.dist-bar { width: 100%; height: var(--fill, 0); background: var(--verde); }
.dist-col.is-peak .dist-bar { background: var(--ink); }
.dist-label { font-size: 13px; font-weight: 600; margin-top: 12px; line-height: 1.25; }
.dist-range { font-size: 12px; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.dist-median { font-size: 13px; color: var(--muted); margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }

.stage .distribution { padding: 30px; }
.stage .dist-track { height: 210px; }
.stage .dist-share { font-size: 46px; }
.stage .dist-label { font-size: 16px; }
.stage .dist-range { font-size: 13px; }

body.stage-mode .distribution { border-color: var(--line-dark); }
body.stage-mode .dist-share { color: var(--snow); }
body.stage-mode .dist-col.is-empty .dist-share { color: #6a6a6a; }
body.stage-mode .dist-track { border-bottom-color: #5a5a5a; }
body.stage-mode .dist-bar { background: #3f5c00; }
body.stage-mode .dist-col.is-peak .dist-bar { background: var(--verde-bright); }
body.stage-mode .dist-sub, body.stage-mode .dist-range, body.stage-mode .dist-median { color: #bdbdbd; }
body.stage-mode .dist-median { border-top-color: var(--line-dark); }

/* ── Stage / projection view ── */
.stage { padding: 38px 0 10px; }
.stage-top { display: flex; justify-content: space-between; gap: 35px; align-items: center; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.stage h1 { font-size: clamp(34px, 4vw, 58px); margin: 0 0 10px; }
.stage-top > div > p:last-child { color: var(--muted); font-size: 15px; margin: 0; }
.stage-join { display: flex; align-items: center; gap: 16px; }
.stage-join img { border: 1px solid var(--line); width: 132px; height: 132px; background: #fff; }
.stage-join span { font-size: 12px; font-weight: 700; display: block; color: var(--verde-ink); letter-spacing: .12em; }
.stage-join strong { font-size: 36px; letter-spacing: .1em; display: block; }
.stage-join small { font-size: 12px; display: block; max-width: 210px; overflow-wrap: anywhere; color: var(--muted); }
.stage-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 24px; }
.stage-footer p { font-size: 13px; color: var(--muted); }
.stage .aggregate-heading { margin-top: 26px; }
.stage .aggregate-card strong { font-size: clamp(52px, 6.6vw, 92px); }
.stage .average-row { font-size: 16px; }
.stage .average-row b { font-size: 25px; }

/* Projected full-screen mode goes dark: it reads far better on a projector
   and matches the NSB black/green section style. */
body.stage-mode { background: var(--ink); color: var(--snow); }
body.stage-mode .topbar, body.stage-mode #appFooter { display: none; }
body.stage-mode main { max-width: 1480px; }
body.stage-mode .stage-top { border-bottom-color: var(--line-dark); }
body.stage-mode .eyebrow { color: var(--verde-bright); }
body.stage-mode .stage-top > div > p:last-child,
body.stage-mode .stage-footer p,
body.stage-mode .stage-join small { color: #bdbdbd; }
body.stage-mode .stage-join span { color: var(--verde-bright); }
body.stage-mode .stage-join strong { font-size: 42px; }
body.stage-mode .stage-join img { border-color: var(--line-dark); }
body.stage-mode .aggregate-card { background: #161616; border: 1px solid var(--line-dark); }
body.stage-mode .aggregate-card:nth-child(2) { background: var(--verde); border-color: var(--verde); }
body.stage-mode .average-assumptions { border-color: var(--line-dark); }
body.stage-mode .average-row { border-top-color: var(--line-dark); }
body.stage-mode .average-row b { color: var(--verde-bright); }
body.stage-mode .average-row small, body.stage-mode .aggregate-note { color: #bdbdbd; }
body.stage-mode .aggregate-note strong { color: var(--snow); }
body.stage-mode .empty-state { background: #161616; border-color: var(--line-dark); }
body.stage-mode .empty-state p { color: #bdbdbd; }
body.stage-mode .outline { background: transparent; color: var(--snow); border-color: var(--snow); }
body.stage-mode .outline:hover { background: #1f1f1f; }
body.stage-mode .mean-scenario { border-top-color: var(--line-dark); }
body.stage-mode .mean-scenario p { color: #bdbdbd; }

/* ── Footer: the NSB signature ── */
footer { max-width: 1280px; margin: 40px auto 0; padding: 26px 24px; display: flex; justify-content: space-between; align-items: center; gap: 25px; border-top: 1px solid var(--ink); font-size: 12px; color: var(--muted); }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand svg { display: block; width: 68px; height: auto; color: var(--ink); }
.footer-brand span { font-size: 13px; font-weight: 500; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: 25px; transform: translateX(-50%); background: var(--ink); color: var(--snow); padding: 14px 22px; border-left: 4px solid var(--verde); border-radius: var(--radius); max-width: calc(100vw - 35px); font-size: 14px; z-index: 30; }

/* ── Responsive ── */
@media (min-width: 1600px) {
  .stage { padding-top: 48px; }
  .stage .aggregate-card { padding: 38px; }
  .stage .aggregate-card strong { font-size: 100px; }
  .stage .average-row { padding: 16px 0; }
}
@media (max-width: 950px) {
  .brand-tag { display: none; }
}
@media (max-width: 850px) {
  .page-intro > p { display: none; }
  .calculator-layout { gap: 22px; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); }
  .control-section { padding: 20px; }
  .personal-result article > strong { font-size: 46px; }
  .stage-top { align-items: flex-start; }
  .stage-join { flex-direction: column; gap: 8px; align-items: flex-start; }
  .stage-join img { width: 100px; height: 100px; }
  .stage-join strong { font-size: 28px; }
}
@media (max-width: 650px) {
  main { padding: 0 18px; }
  .topbar { padding: 14px 18px; gap: 12px; }
  .brand { gap: 8px; }
  .brand-word { font-size: 19px; }
  .brand-pill { font-size: 10.5px; padding: 3px 6px 4px; }
  .topbar nav { gap: 0; }
  .topbar nav button { font-size: 12px; padding: 8px 10px; }
  .join-strip form { display: block; }
  .join-strip label { display: block; margin-bottom: 10px; }
  .join-strip form > div { display: grid; grid-template-columns: 1fr auto; }
  .join-strip input { width: 100%; min-width: 0; }
  .button { font-size: 13px; padding: 11px 14px; }
  .page-intro { padding: 28px 0 24px; }
  .page-intro h1 { font-size: 38px; }
  /* The hand-placed break is tuned for a wide column. On a phone it strands
     the last word on its own line, so drop it and let text-wrap:balance run. */
  .page-intro h1 br { display: none; }
  .calculator-layout { grid-template-columns: 1fr; gap: 20px; }
  .personal-result { position: static; }
  .personal-result article > strong { font-size: 56px; }
  .control-section { padding: 19px; }
  .control-section h2 { font-size: 19px; }
  .slider-heading { font-size: 14px; gap: 14px; }
  .slider-row output { font-size: 22px; }
  .method-grid { grid-template-columns: 1fr; }
  .active-session { padding: 18px; gap: 15px; display: block; }
  .active-session > div:last-child { text-align: left; margin-top: 14px; }
  .active-session .text-button { margin-left: 0; }
  .active-session h2 { font-size: 21px; }
  .session-code { font-size: 24px; }
  .create-panel { margin: 40px 0; }
  .create-panel h1 { font-size: 38px; }
  .create-panel form { grid-template-columns: 1fr auto; gap: 16px; }
  .create-panel label[for=sessionLang] { grid-column: 1 / -1; }
  .fixed-horizon b { font-size: 28px; }
  .host-header { padding-top: 30px; align-items: flex-start; }
  .host-header h1 { font-size: 28px; }
  .host-share { grid-template-columns: 1fr; padding: 18px; gap: 15px; }
  .qr-wrap { width: 150px; }
  .aggregate-cards { grid-template-columns: 1fr; gap: 15px; }
  .aggregate-card { padding: 24px; }
  .aggregate-card strong { font-size: 58px; }
  .averages-grid { grid-template-columns: 1fr; }
  .distribution { padding: 18px; }
  .dist-plot { grid-template-columns: 1fr; gap: 18px; }
  .dist-col {
    display: grid; text-align: left; align-items: center; gap: 2px 12px;
    grid-template-columns: 1fr auto;
    grid-template-areas: "label share" "track track" "range range";
  }
  .dist-share, .stage .dist-share { grid-area: share; font-size: 24px; margin: 0; }
  .dist-label, .stage .dist-label { grid-area: label; margin: 0; font-size: 14px; }
  .dist-range, .stage .dist-range { grid-area: range; font-size: 12px; }
  .dist-track, .stage .dist-track {
    grid-area: track; height: 24px; width: 100%; align-items: stretch;
    border-bottom: 0; border-left: 2px solid var(--ink); margin: 7px 0 3px;
  }
  .dist-bar { width: var(--fill, 0); height: 100%; }
  body.stage-mode .dist-track { border-left-color: #5a5a5a; }
  .average-assumptions { padding: 18px; }
  .aggregate-heading h2 { font-size: 24px; }
  .stage-top { display: block; }
  .stage-join { flex-direction: row; align-items: center; margin-top: 20px; }
  .stage h1 { font-size: 32px; }
  .stage .aggregate-card strong { font-size: 66px; }
  .stage .average-row { font-size: 14px; }
  .stage-footer { align-items: flex-start; }
  footer { padding: 22px 18px; display: block; }
  .footer-brand { margin-bottom: 10px; }
  .count-pill { font-size: 12px; padding: 6px 10px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
@media print {
  .topbar, .join-strip, .controls, .submit-panel, .host-tools, .button, .host-share, #appFooter { display: none !important; }
  .calculator-layout { display: block; }
  .personal-result { position: static; }
  .aggregate-cards { grid-template-columns: 1fr 1fr; }
  .aggregate-card { break-inside: avoid; }
  .aggregate-card strong { font-size: 40pt; }
  .stage-join img { width: 100px; height: 100px; }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
