/* ── Presenter tooling styles ───────────────────────────────────────────────
   Companion to presenter.js. Reads the semantic tokens every theme defines —
   no new palette here.

   NOTE: cues now live in cues.js, not in slide markup, so there is nothing left
   for a missing presenter.css to leak. The `.notes { display: none }` rule still
   lives in engine.css rather than here — vestigial insurance in case an <aside> is
   ever reintroduced.
   ─────────────────────────────────────────────────────────────────────────── */

/* ═══ Mode A · in-deck notes strip ══════════════════════════════════════════
   z-index 200 is chosen to sit above the deck chrome (100) but below the scrim
   (390) and the TOC/overview overlays (400), so pressing O or T still covers the
   strip instead of fighting it. Fixed positioning means toggling the strip can
   never reflow slide content. ═══════════════════════════════════════════════ */

.pnotes {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 200;
  display: flex;
  align-items: flex-start;
  gap: clamp(12px, 2vw, 28px);
  padding: clamp(10px, 1.6vh, 18px) clamp(14px, 2.4vw, 30px);
  background: color-mix(in srgb, var(--surface-2) 94%, transparent);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transform: translateY(110%);
  opacity: 0;
  pointer-events: none;
}
.pnotes.is-on { transform: translateY(0); opacity: 1; pointer-events: auto; }

@media (prefers-reduced-motion: no-preference) {
  .pnotes { transition: transform .28s ease, opacity .28s ease; }
}

.pnotes__cues {
  flex: 1;
  min-width: 0;
  max-height: 26vh;
  overflow-y: auto;
  font-family: var(--font-body);
  font-size: clamp(13px, 1.7vh, 16px);
  line-height: 1.5;
  color: var(--text-strong);
}
.pnotes__cues ul, .pnotes__cues ol { padding-left: 1.2em; }
.pnotes__cues li + li { margin-top: 3px; }
.pnotes__cues b, .pnotes__cues strong { color: var(--accent); font-weight: 600; }
.pnotes__empty { color: var(--muted); font-style: italic; opacity: .75; }

.pnotes__meta {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.pnotes__meta b { color: var(--text-strong); font-weight: 500; }
.pnotes__pos { opacity: .85; }
.pnotes__pos b { color: var(--accent); font-weight: 700; }
.pnotes__clock { font-size: 13px; }
.pnotes__clock b.is-over { color: var(--bad); }
/* Drift against the cumulative plan — a verdict on the whole run, so it sits on its
   own line rather than inside the clock, which would read as a third countdown. */
.pnotes__drift b { font-weight: 600; }
.pnotes__drift b.is-behind { color: var(--bad); }
.pnotes__drift b.is-ahead { color: var(--good); }

/* "- ~ " cues are OPTIONAL — the drop list. Dimmed and re-markered so a glance
   separates "must say" from "say only if drift allows", without having to re-read
   the line. Shared by both modes because both render the same parsed HTML. */
.pnotes__cues li.is-opt,
.pv__cues li.is-opt { opacity: .5; font-style: italic; }
.pnotes__cues li.is-opt::marker,
.pv__cues li.is-opt::marker { content: '~ '; color: var(--accent-2); }
/* "- !" lines are the speaker's own notes, which the autopilot never says, and the
   chips are what the autopilot does at that point (framework/pilot-cues.js). */
.pnotes__cues li.is-speaker,
.pv__cues li.is-speaker { color: var(--muted); }
.pnotes__cues li.is-speaker::marker,
.pv__cues li.is-speaker::marker { content: '! '; color: var(--accent); }
.cue-op {
  display: inline-block; margin: 0 2px; padding: 0 6px; border-radius: 6px;
  border: 1px solid var(--line); color: var(--muted);
  font-family: var(--font-mono); font-size: .72em; font-style: normal; vertical-align: .1em;
}

/* Transient notice line: pop-up-blocked warning and the ? key help.
   z-index 210 puts it above the strip, and it is a sibling of the strip rather than
   a child so it stays readable while the strip is closed — which is exactly when
   both of those messages matter. Still below the scrim/overlays. */
.pmsg {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: clamp(10px, 1.8vh, 22px);
  z-index: 210;
  display: none;
  max-width: min(92vw, 900px);
  padding: 9px 13px;
  border: 1px solid var(--accent-soft, var(--line));
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}
.pmsg.is-on { display: block; }
/* When the strip is up, sit above it instead of behind it. */
.pnotes.is-on ~ .pmsg { bottom: calc(28vh + 18px); }

/* ═══ Mode B · presenter window (index.html?present=1) ══════════════════════
   The slides stay in the DOM — that is how this window still has access to each
   slide's data-nav, which keys the lookup into cues.js — but nothing of the deck
   is shown. The theme toggle is hidden too, so this window can never write the
   shared theme key. Everything here optimises for a glance read from arm's
   length, not density.
   ═══════════════════════════════════════════════════════════════════════════ */

html.is-presenter body { overflow: auto; background: var(--bg); }
html.is-presenter .deck,
html.is-presenter .theme-toggle { display: none !important; }

.pv {
  display: none;
  min-height: 100dvh;
  grid-template-rows: auto 1fr auto auto auto;
  gap: clamp(14px, 2.4vh, 26px);
  padding: clamp(16px, 3vh, 34px) clamp(18px, 3.4vw, 40px);
}
html.is-presenter .pv { display: grid; }

.pv__head {
  display: flex;
  align-items: baseline;
  gap: clamp(10px, 1.8vw, 22px);
  padding-bottom: clamp(10px, 1.6vh, 18px);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  flex-wrap: wrap;
}
.pv__num {
  font-size: clamp(20px, 3.4vh, 32px);
  color: var(--accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.pv__title {
  flex: 1;
  min-width: 0;
  font-family: var(--font-display);
  font-size: clamp(17px, 2.8vh, 26px);
  color: var(--text);
}
.pv__via { font-size: 10px; color: var(--muted); opacity: .8; }
/* shown once the deck reports an autopilot (autopilot.js) */
.pv__pilot {
  display: none; align-self: center;
  font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
.pv__pilot.is-on { display: inline-block; }
.pv__pilot.is-playing { border-color: var(--accent); color: var(--accent); }
.pv__pilot:hover, .pv__pilot.is-hot { border-color: var(--accent); }

/* The cue area. Deliberately large — the whole point of this window is that a
   half-second look down is enough, so legibility beats fitting more in. */
.pv__cues {
  font-family: var(--font-body);
  font-size: clamp(17px, 3vh, 28px);
  line-height: 1.55;
  color: var(--text-strong);
  overflow-y: auto;
}
.pv__cues ul, .pv__cues ol { padding-left: 1.15em; }
.pv__cues li + li { margin-top: .45em; }
.pv__cues b, .pv__cues strong { color: var(--accent); font-weight: 600; }
.pv__empty { color: var(--muted); font-style: italic; opacity: .75; }

.pv__foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: clamp(10px, 2vw, 24px);
  padding-top: clamp(10px, 1.6vh, 18px);
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: clamp(12px, 1.9vh, 15px);
  color: var(--muted);
  flex-wrap: wrap;
}
.pv__next b { color: var(--accent-2); font-weight: 600; }
.pv__clock { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pv__clock b { font-size: clamp(18px, 3.2vh, 30px); color: var(--text-strong); font-weight: 700; }
/* Elapsed half of each pair: same size as the remaining half so "12:10 / 17:50" reads
   as one unit, but recessive enough that a glance lands on the number that matters. */
.pv__clock b.is-past { opacity: .45; font-weight: 500; }
.pv__clock b.is-over { color: var(--bad); }
.pv__clock span { font-size: .8em; opacity: .75; }

/* Drift cell, centre of the footer. Smaller than the clocks — it changes only on a
   slide change, so it never needs to win a glance against a live countdown. */
.pv__drift { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pv__drift b { font-size: clamp(14px, 2.2vh, 20px); color: var(--text-strong); font-weight: 700; }
.pv__drift b.is-behind { color: var(--bad); }
.pv__drift b.is-ahead  { color: var(--good); }
.pv__drift span { font-size: .8em; opacity: .75; }

.pv__hint { font-family: var(--font-mono); font-size: 10px; color: var(--muted); opacity: .6; }

/* Remote-control row — sits below the cues (which stay the dominant element) and
   above the footer. Worst case is 8 chips (slide 12), so this stays compact. */
.pv__ctl      { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.pv__acts     { display: flex; flex-wrap: wrap; gap: 8px; }
.pv__acts:empty { display: none; }
.pv__acts button,
.pv__tgrid button {
  font: 500 clamp(12px,1.15vw,15px)/1 var(--font-mono);
  padding: 7px 11px; border-radius: 3px; cursor: pointer;
  color: var(--text-strong); background: transparent;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
.pv__acts button:hover,
.pv__tgrid button:hover  { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.pv__acts button:focus-visible,
.pv__tgrid button:focus-visible,
.pv__tcaret:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pv__tgrid button.is-on  { color: var(--bg); background: var(--accent); border-color: var(--accent); }
.pv__targets  { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.pv__targets--empty { display: none; }
.pv__tcount   { font: 500 clamp(11px,1vw,13px)/1 var(--font-mono); color: var(--muted); letter-spacing: .08em; white-space: nowrap; }
.pv__tcaret   { font: 500 13px/1 var(--font-mono); color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 3px; padding: 4px 8px; cursor: pointer; }
.pv__tgrid    { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.pv__tgrid.is-off { display: none; }

@media (max-width: 620px) {
  .pv__foot { flex-direction: column; align-items: flex-start; }
}
