/* pybmc click-through presentation (web_plain) -- engine styles.
   Design tokens live in :root.  js/engine.js reads the colour tokens (--<name>) into PB.C and the
   size tokens (--fs-<name>) into PB.SZ at boot, so change them HERE (one source of truth).
   Everything inside .pb-stage is in 1920x1080 design px.  Design system: STYLE.md (overrides plan.md / ENGINE.md §5).
   Light paper, flat; no gradients, glows or shadows on the stage. */
/* Greek alpha fallback (merged from web_intro_teasers/css/teasers.css, 2026-10-05): in Avenir Next the Greek α (U+03B1)
   is a single-storey "a", so "α decay" and "Qα" read as "a decay" and "Qa". These faces take U+03B1 ONLY from Lucida
   Grande (macOS); every other character still comes from Avenir Next. Without Lucida Grande they are skipped. */
@font-face { font-family: 'PB Alpha'; font-weight: 100 549; src: local('LucidaGrande'), local('Lucida Grande');
             unicode-range: U+03B1; }
@font-face { font-family: 'PB Alpha'; font-weight: 550 900; src: local('LucidaGrande-Bold'), local('Lucida Grande Bold');
             unicode-range: U+03B1; }


:root {
  /* palette (STYLE.md §3.1).  NB --ink is the BACKGROUND (the name is kept for the engine API). */
  --ink: #FAFAF8;          /* paper */
  --bg-in: #FAFAF8;
  --bg-out: #FAFAF8;
  --letterbox: #FAFAF8;
  --fg: #1C1E23;           /* text, data marks, AME2020 points, zero lines */
  --text2: #4B505B;        /* secondary text, legends, brackets */
  --muted: #6B717C;        /* ticks, footnotes, axis titles */
  --dim: #8A9099;          /* axis lines, de-emphasised lines */
  --faint: #C9CDD4;        /* hairlines, plane edge, inset frame */
  --grid: #E4E4E0;         /* gridlines (sparingly) */
  --gold: #A66F00;         /* ONLY the pybmc result (posterior mean, band edge, draws, least-squares foot) */
  --mag: #B8336A;          /* Skyrme EDF family (identity only) */
  --teal: #0E7C8B;         /* UNEDF family (identity only) */
  --table: #3A7D44;        /* mass tables FRDM-12, HFB-24 (identity only) */
  --lavender: #6E7699;     /* other EDFs D1M, BCPM (identity only) */
  --pale: #A3A8B0;         /* unnamed models, "without" bars */
  --under: #2166AC;        /* maps: model underbinds */
  --over: #B2182B;         /* maps: model overbinds */
  --neutral-map: #DCDCD7;  /* maps: zero */
  --cover-in: #A3A8B0;     /* inside the band (= --pale, so it stands off the not-in-play cells) */
  --cover-out: #1C1E23;    /* outside the band */
  --cell: #D3D6DB;         /* chart cell not yet coloured */
  --cell-off: #EEEEEB;     /* chart cell not in play */
  --good: #2E7D4F;         /* UI only (selftest / presenter status) */
  --bad: #C0392B;          /* UI only */

  /* typography: px at 1080p (em size).  Four sizes on stage: title 44, must-read 32, fine 28, footnote 24
     (STYLE.md §3.2).  Must-read >= 32 px; 28 / 24 need {fine: true} (floor 24). */
  --font: 'PB Alpha', 'Avenir Next', 'Helvetica Neue', Arial, sans-serif;   /* PB Alpha: Greek α only (top of file) */
  --mono: Menlo, 'SF Mono', Monaco, monospace;
  --fs-title: 44px;
  --fs-caption: 32px;
  --fs-body: 32px;
  --fs-label: 32px;
  --fs-secondary: 28px;
  --fs-tick: 28px;
  --fs-number: 32px;
  --fs-panel: 32px;
  --fs-big: 32px;
  --fs-huge: 32px;
  --fs-footnote: 24px;
  --fs-fine: 24px;
  --min-px: 32px;
  --fine-px: 24px;
}
/* ?contrast=high (washed-out projector in a lit room): darker greys for secondary text, footnotes, axes and grids.
   The engine adds the class before it reads the tokens, so scenes pick the values up. */
:root.pb-contrast-high {
  --text2: #3A3F48;
  --muted: #4B505B;
  --dim: #6B717C;
  --faint: #A3A8B0;
  --grid: #D6D6D1;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden;
  background: var(--letterbox); color: var(--fg); font-family: var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: geometricPrecision;
}
body.pb-hide-cursor, body.pb-hide-cursor * { cursor: none !important; }

/* ---------------------------------------------------------------- stage (letterboxed) */
#pb-viewport { position: fixed; inset: 0; overflow: hidden; background: var(--letterbox); }
.pb-stage {
  position: absolute; left: 0; top: 0; width: 1920px; height: 1080px;
  transform-origin: 0 0; overflow: hidden; contain: layout paint;
  font-family: var(--font); color: var(--fg); user-select: none; -webkit-user-select: none;
  font-variant-numeric: tabular-nums;
}
.pb-bg { position: absolute; inset: 0; background: var(--bg-in); }   /* flat paper: no gradient, no vignette */
.pb-scenes { position: absolute; inset: 0; }
.pb-scene { position: absolute; inset: 0; isolation: isolate; }
.pb-scene.pb-outgoing { pointer-events: none; }
.pb-layer { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; overflow: visible; pointer-events: none; }
svg.pb-layer { overflow: hidden; }
.pb-layer text { font-family: var(--font); font-variant-numeric: tabular-nums; }
.pb-scene .ix, .pb-scene .ix * { pointer-events: auto; cursor: pointer; }
.pb-mono { font-family: var(--mono); }

/* ---------------------------------------------------------------- per-scene chrome (title, footnote) */
.pb-chrome { position: absolute; inset: 0; z-index: 100; pointer-events: none; }
/* title only: top-left, 44 px, line box 56 px (baseline ~ y 94-96); content may start at y = 140 */
.pb-header { position: absolute; left: 56px; top: 52px; right: 56px; }
.pb-kicker-box { display: none; }      /* no kicker (the engine no longer builds it) */
.pb-title-box { position: relative; height: 56px; }
.pb-slot { position: absolute; left: 0; top: 0; white-space: nowrap; }
.pb-kicker { display: none; }
.pb-title { font-size: var(--fs-title); line-height: 56px; font-weight: 600; letter-spacing: 0; color: var(--fg); }
/* footnote line (step field caption): bottom-left, x 56, baseline ~ 1030, 24 px muted, left-aligned; grows upward */
.pb-caption-box { position: absolute; left: 56px; right: 56px; bottom: 42px; height: 30px; }
.pb-caption {
  left: 0; right: 0; top: auto; bottom: 0; text-align: left; white-space: normal;
  font-size: var(--fs-footnote); line-height: 30px; font-weight: 500; color: var(--muted);
}
.pb-caption sub, .pb-caption sup, .pb-rich sub, .pb-rich sup { font-size: 0.68em; line-height: 0; }
.pb-err-card {
  position: absolute; left: 160px; right: 160px; top: 380px; padding: 36px 44px; border-radius: 4px;
  background: #FFFFFF; border: 2px solid var(--bad); color: var(--fg);
  font-size: 32px; line-height: 1.35; z-index: 200; white-space: pre-wrap;
}
.pb-err-card b { color: var(--bad); }

/* hover card (S.tooltip()): white, hairline frame, square-ish corners, no shadow */
.pb-tip {
  position: absolute; left: 0; top: 0; max-width: 380px; padding: 12px 16px 14px; border-radius: 4px;
  background: #FFFFFF; border: 1px solid var(--faint); box-shadow: none; color: var(--fg);
  font-size: 26px; line-height: 1.3; font-weight: 500; z-index: 80; pointer-events: none; white-space: normal;
}
.pb-tip .h { font-size: 28px; font-weight: 600; margin-bottom: 4px; }
.pb-tip .m { color: var(--text2); }
.pb-tip b { font-weight: 600; }

/* ---------------------------------------------------------------- stage-level persistent chrome */
/* no brand on stage: the logo appears only on the title card and the end card, drawn by those scenes */
.pb-brand { display: none; }
/* progress ticks: only with ?ui=1 (rehearsal); current tick in fg */
.pb-progress {
  position: absolute; left: 0; right: 0; top: 1044px; height: 10px; display: flex; justify-content: center;
  align-items: center; gap: 24px; z-index: 300; pointer-events: none; opacity: 0.8;
}
.pb-progress .acts { display: flex; gap: 18px; align-items: center; }
.pb-progress .act { display: flex; gap: 6px; align-items: center; }
.pb-progress .tick { width: 24px; height: 3px; background: var(--faint); }
.pb-progress .tick.past { background: var(--dim); }
.pb-progress .tick.cur { background: var(--fg); }
.pb-progress .pips { display: flex; gap: 8px; align-items: center; justify-content: flex-start; min-width: 10px; }
.pb-progress .pip { width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--dim); }
.pb-progress .pip.done { background: var(--dim); border-color: var(--dim); }
.pb-progress .pip.cur { background: var(--fg); border-color: var(--fg); }
.pb-progress .pip.opt { border-style: dashed; }
/* no INTERACTIVE badge (the presenter view tags interactive steps) */
.pb-ixbadge, .pb-ixbadge.on, body.pb-cursor-awake .pb-ixbadge.on { display: none; }
/* presenter-only scene controls (s09, s10): plain text, shown only while the mouse is awake (&awake=1 forces them) */
body:not(.pb-cursor-awake) .pb-awake-only { display: none; }
.pb-noprogress .pb-progress { display: none; }
.pb-nochrome .pb-brand, .pb-nochrome .pb-progress, .pb-nochrome .pb-header, .pb-nochrome .pb-ixbadge { display: none; }

/* ---------------------------------------------------------------- window-level overlays (main view; presenter-facing) */
.pb-black { position: fixed; inset: 0; background: #000; z-index: 900; display: none; }
.pb-black.on { display: block; }
.pb-hud {
  position: fixed; right: 24px; top: 20px; z-index: 950; padding: 8px 16px; border-radius: 4px;
  background: #FFFFFF; border: 1px solid var(--faint);
  font: 600 22px var(--font); color: var(--fg); display: none;
}
.pb-hud.on { display: block; }
.pb-hint {
  position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 940;
  padding: 8px 18px; border-radius: 4px; background: #FFFFFF;
  border: 1px solid var(--faint); font: 500 17px var(--font); color: var(--text2);
  opacity: 0; transition: opacity 0.4s ease; pointer-events: none; white-space: nowrap;
}
.pb-hint.on { opacity: 1; }
.pb-hint b { color: var(--fg); font-weight: 600; }
.pb-toast {
  position: fixed; left: 24px; top: 20px; z-index: 960; max-width: 46vw; padding: 12px 18px; border-radius: 4px;
  background: #FFF4F2; border: 1px solid var(--bad); color: var(--fg);
  font: 500 16px/1.4 var(--font); white-space: pre-wrap; display: none;
}
.pb-toast.on { display: block; }
.pb-drawer {
  position: fixed; left: 50%; bottom: 0; transform: translate(-50%, 100%); width: min(1100px, 92vw); max-height: 34vh;
  overflow: auto; z-index: 930; padding: 16px 24px 20px; border-radius: 4px 4px 0 0;
  background: #FFFFFF; border: 1px solid var(--faint); border-bottom: none;
  font: 500 21px/1.45 var(--font); color: var(--fg); transition: transform 0.25s ease;
}
.pb-drawer.on { transform: translate(-50%, 0); }
.pb-drawer .head { font-size: 15px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }

.pb-help {
  position: fixed; inset: 0; z-index: 980; display: none; align-items: center; justify-content: center;
  background: rgba(250, 250, 248, 0.92);
}
.pb-help.on { display: flex; }
.pb-help .box {
  min-width: 640px; max-width: 900px; padding: 30px 40px; border-radius: 4px; background: #FFFFFF;
  border: 1px solid var(--faint); font: 500 19px/1.55 var(--font); color: var(--fg);
}
.pb-help h2 { margin: 0 0 14px; font-size: 24px; font-weight: 600; color: var(--fg); }
.pb-help table { border-collapse: collapse; }
.pb-help td { padding: 3px 18px 3px 0; vertical-align: top; }
.pb-help td:first-child { color: var(--fg); font-weight: 600; white-space: nowrap; }
.pb-help td:last-child { color: var(--text2); }
.pb-help .foot { margin-top: 14px; color: var(--muted); font-size: 16px; }

/* ---------------------------------------------------------------- overview grid */
.pb-overview {
  position: fixed; inset: 0; z-index: 970; display: none; overflow: auto; padding: 30px 40px 60px;
  background: #EFEFEB;
}
.pb-overview.on { display: block; }
.pb-overview h2 { margin: 0 0 20px; font: 500 20px var(--font); color: var(--text2); }
.pb-overview h2 b { color: var(--fg); font-weight: 600; }
.pb-ov-grid { display: grid; gap: 22px; }
.pb-ov-card { cursor: pointer; border-radius: 4px; padding: 8px; border: 2px solid transparent; background: #FFFFFF; }
.pb-ov-card:hover { border-color: var(--faint); }
.pb-ov-card.cur { border-color: var(--dim); }
.pb-ov-card.sel { border-color: var(--fg); }
.pb-ov-thumb { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: var(--letterbox); outline: 1px solid var(--faint); }
.pb-ov-label { display: flex; flex-wrap: wrap; column-gap: 10px; row-gap: 2px; align-items: baseline; padding: 8px 4px 2px; font: 600 18px var(--font); color: var(--fg); }
.pb-ov-label .num { color: var(--muted); min-width: 1.6em; }
.pb-ov-label .act { color: var(--muted); font-size: 15px; font-weight: 500; }
.pb-ov-label .steps { flex-basis: 100%; padding-left: calc(1.6em + 10px); color: var(--text2); font-weight: 500; font-size: 15px; white-space: nowrap; }

/* ---------------------------------------------------------------- presenter (speaker) view */
body.pb-presenter { background: #EFEFEB; overflow: hidden; }
.pv { position: fixed; inset: 0; display: grid; grid-template-rows: auto 1fr minmax(180px, 34vh); gap: 12px; padding: 14px 18px 16px; }
.pv-top { display: flex; align-items: center; gap: 26px; font: 600 20px var(--font); color: var(--fg); }
.pv-pos { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-pos .muted { color: var(--text2); font-weight: 500; }
.pv-pos .gold { color: var(--fg); }
.pv-timer { font: 600 30px var(--mono); color: var(--fg); cursor: pointer; }
.pv-timer.paused { color: var(--muted); }
.pv-timer.armed { color: var(--dim); }
.pv-steptime { font: 600 20px var(--mono); color: var(--text2); }
.pv-clock { font: 600 30px var(--mono); color: var(--fg); }
.pv-status { font: 600 15px var(--font); padding: 5px 12px; border-radius: 4px; background: #FFFFFF; border: 1px solid var(--faint); color: var(--text2); }
.pv-status.linked { color: var(--good); border-color: var(--good); }
.pv-status.black { background: #000; color: #fff; border: 1px solid #000; }
.pv-status.warn { background: #FFF4F2; color: var(--bad); border-color: var(--bad); }
.pv-status.digits { color: var(--fg); border-color: var(--fg); }
.pv-now.dim .pv-stagehost { opacity: 0.35; }
.pv-main { display: grid; grid-template-columns: 62fr 38fr; gap: 16px; min-height: 0; }
.pv-panel { position: relative; display: flex; flex-direction: column; min-height: 0; }
.pv-label { font: 600 14px var(--font); color: var(--muted); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-label b { color: var(--fg); font-size: 16px; }
.pv-label .tag { color: var(--teal); font-size: 14px; }
.pv-stagehost { position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--letterbox); outline: 1px solid var(--faint); }
.pv-side { display: grid; grid-template-rows: 1fr auto; gap: 12px; min-height: 0; }
.pv-nextinfo { margin-top: 8px; font: 500 17px/1.4 var(--font); color: var(--text2); max-height: 5.6em; overflow: hidden; }
.pv-low { display: flex; flex-direction: column; gap: 10px; }
.pv-controls { display: flex; gap: 10px; flex-wrap: wrap; }
.pv-strip { display: flex; gap: 6px; flex-wrap: wrap; }
.pv-strip button {
  font: 600 16px var(--font); color: var(--text2); background: #FFFFFF; border: 1px solid var(--faint);
  border-radius: 4px; padding: 6px 0; min-width: 36px; cursor: pointer;
}
.pv-strip button:hover { border-color: var(--dim); color: var(--fg); }
.pv-strip button.cur { border-color: var(--fg); color: var(--fg); }
.pv-strip button.ret { padding: 6px 12px; margin-left: 6px; }
.pv-strip button:disabled { opacity: 0.35; cursor: default; }
.pv-controls button {
  font: 600 17px var(--font); color: var(--fg); background: #FFFFFF; border: 1px solid var(--faint);
  border-radius: 4px; padding: 10px 18px; cursor: pointer;
}
.pv-controls button:hover { border-color: var(--dim); }
.pv-controls button.primary { border-color: var(--fg); }
.pv-notes {
  overflow: auto; border-radius: 4px; background: #FFFFFF; border: 1px solid var(--faint);
  padding: 16px 22px; font: 500 26px/1.45 var(--font); color: var(--fg);
}
.pv-notes .step-head { color: var(--muted); font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.pv-notes .step-notes { margin-bottom: 14px; }
.pv-notes .scene-head { color: var(--muted); font-size: 15px; font-weight: 600;
  border-top: 1px solid var(--faint); padding-top: 8px; margin-bottom: 2px; }
.pv-notes .scene-notes { color: var(--muted); font-size: 18px; line-height: 1.4; }
.pv-notes .err { color: var(--bad); font-size: 17px; margin-top: 10px; white-space: pre-wrap; }

/* ---------------------------------------------------------------- selftest report */
body.pb-selftest { overflow: auto; background: #FFFFFF; }
.st { padding: 28px 36px 60px; font: 500 17px/1.45 var(--font); color: var(--fg); }
.st h1 { margin: 0 0 4px; font-size: 34px; }
.st h1.pass { color: var(--good); }
.st h1.fail { color: var(--bad); }
.st .sum { color: var(--text2); margin-bottom: 18px; font-size: 19px; }
.st .sum b { color: var(--fg); }
.st table { border-collapse: collapse; margin: 6px 0 22px; }
.st th, .st td { border-bottom: 1px solid var(--grid); padding: 4px 14px 4px 0; text-align: left; vertical-align: top; }
.st th { color: var(--text2); font-weight: 600; font-size: 14px; }
.st td.msg { font-size: 14px; color: var(--text2); max-width: 1100px; }
.st .ok { color: var(--good); font-weight: 600; }
.st .warn { color: var(--gold); font-weight: 600; }
.st .err { color: var(--bad); font-weight: 600; }
.st .msgs { margin: 0; padding-left: 18px; font-size: 15px; }
.st .msgs li.err { font-weight: 500; color: var(--bad); }
.st .msgs li.warn { font-weight: 500; color: var(--gold); }
.st code { font-family: var(--mono); font-size: 0.92em; color: var(--lavender); }
.st h2 { font-size: 22px; margin: 22px 0 6px; color: var(--fg); }

/* hidden off-screen host for measuring / tests */
.pb-offscreen { position: fixed; left: -30000px; top: 0; width: 1920px; height: 1080px; overflow: hidden; }
