/* ─── Fonts ──────────────────────────────────────────────────────────────────── */
/* Self-hosted (public/fonts/, SIL Open Font License — the OFL-*.txt files beside them),
   so no page asks another site for anything. Variable fonts: one file covers each range of
   weights. latin-ext only loads for names with accented letters beyond Western European. */
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 600 800; font-display: swap; src: url('/fonts/montserrat-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, U+FEFF, U+FFFD; }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 600 800; font-display: swap; src: url('/fonts/montserrat-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/fonts/inter-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, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/fonts/inter-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ─── Design tokens ──────────────────────────────────────────────────────────── */
:root {
  /* Warm ink — palette #1D1D1D / #4A4943 */
  --ink:         #1D1D1D;
  --ink-2:       #4A4943;
  --ink-mid:     #7A776D;
  --ink-dim:     #A8A399;
  --ink-faint:   #CFC9BC;

  /* Warm paper */
  --cream:       #F5F1E7;
  --cream-2:     #EEE9DC;
  --paper:       #FBF9F2;
  --paper-2:     #F8F5EC;
  --sand:        #E8DECC;

  /* Signature amber — palette #EFB63A, text-safe tone #B07A12.
     --amber is for fills/accents/highlights and for text or borders on DARK
     surfaces; on light (cream/paper) surfaces use --amber-hover instead —
     the bright tone fails contrast there. */
  --amber:        #EFB63A;
  --amber-hover:  #B07A12;
  --amber-soft:   rgba(239,182,58,0.12);
  --amber-glow:   rgba(239,182,58,0.18);
  --amber-line:   rgba(239,182,58,0.28);

  /* Status — palette teal #2E6B63 / terracotta #C2562F */
  --sage:         #2E6B63;
  --sage-soft:    rgba(46,107,99,0.10);
  --sage-line:    rgba(46,107,99,0.28);

  --clay:         #C2562F;
  --clay-soft:    rgba(194,86,47,0.10);
  --clay-line:    rgba(194,86,47,0.28);

  /* Answer-correctness feedback (scenario/quiz) — deliberately more saturated
     than --sage/--clay so a right/wrong answer reads unambiguously at a glance. */
  --correct:      #1E8E3E;
  --correct-soft: rgba(30,142,62,0.14);
  --correct-line: rgba(30,142,62,0.4);
  --wrong:        #D93025;
  --wrong-soft:   rgba(217,48,37,0.13);
  --wrong-line:   rgba(217,48,37,0.4);

  /* Structural */
  --line:         rgba(29,29,29,0.09);
  --line-2:       rgba(29,29,29,0.16);
  --warm-line:    #D6CDBC;  /* operator console card borders */
  /* Elevation: warm ink shadows, layered (a tight contact shadow under a soft ambient one) */
  --shadow-sm:    0 1px 1px rgba(29,29,29,0.03), 0 1px 3px rgba(29,29,29,0.05);
  --shadow:       0 1px 2px rgba(29,29,29,0.04), 0 4px 14px -2px rgba(29,29,29,0.08);
  --shadow-lg:    0 2px 4px rgba(29,29,29,0.04), 0 18px 40px -8px rgba(29,29,29,0.16);
  --shadow-lift:  0 2px 4px rgba(29,29,29,0.06), 0 10px 22px -6px rgba(29,29,29,0.22);
  --shadow-press: 0 1px 1px rgba(29,29,29,0.08);
  --shadow-thumb: 0 1px 2px rgba(29,29,29,0.18), 0 2px 6px rgba(29,29,29,0.14);
  --glow-amber:   0 8px 22px -8px rgba(239,182,58,0.55);

  /* Legacy aliases (kept for any residual references) */
  --bg:           var(--cream);
  --bg-alt:       var(--paper-2);
  --surface:      var(--paper);
  --surface-2:    var(--paper-2);
  --surface-3:    var(--cream-2);
  --text:         var(--ink);
  --text-mid:     var(--ink-mid);
  --text-dim:     var(--ink-dim);
  --border:       var(--line);
  --border-2:     var(--line-2);
  --amber-light:  var(--amber-hover);
  --amber-dark:   var(--amber-hover);
  --amber-subtle: var(--amber-soft);
  --pass:         var(--sage);
  --pass-bg:      var(--sage-soft);
  --pass-border:  var(--sage-line);
  --refuse:       var(--clay);
  --refuse-bg:    var(--clay-soft);
  --refuse-border:var(--clay-line);

  /* Typography */
  --font-heading: 'Montserrat', 'Avenir Next', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;

  /* Shape */
  --radius-lg:   20px;
  --radius:      14px;
  --radius-sm:   10px;
  --radius-xs:   6px;
  --radius-pill: 999px;
  --max-w:       720px;

  /* Spacing (4px steps) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;

  /* Motion: the only timings and curves on the site.
     --dur-1 colour and border changes; --dur-2 presses, lifts, menus, toggles;
     --dur-3 sections and dialogs arriving; --dur-4 large reveals and toasts leaving. */
  --dur-1: 150ms;
  --dur-2: 250ms;
  --dur-3: 400ms;
  --dur-4: 600ms;
  /* The pour on the code entry button: beer, bubbles and foam in the brand's amber and cream */
  --pour-light:  #F6CD6B;
  --pour-deep:   #D9981C;
  --pour-bubble: rgba(251,249,242,0.65);
  --pour-foam:   url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 12'%3E%3Cpath d='M0 5 Q7 0 14 5 T28 5 V12 H0Z' fill='%23FBF9F2'/%3E%3C/svg%3E");
  --ease-out:    cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1); /* older browsers; a real spring below */
  /* Everything a control animates, in one list */
  --t-control: transform var(--dur-2) var(--ease-spring), box-shadow var(--dur-2) var(--ease-out),
               background-color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out),
               color var(--dur-1) var(--ease-out), opacity var(--dur-1) var(--ease-out);
}
/* A damped spring (about 8% overshoot), where the browser can draw one */
@supports (transition-timing-function: linear(0, 1)) {
  :root { --ease-spring: linear(0, 0.054, 0.183, 0.348, 0.52, 0.679, 0.814, 0.919, 0.995, 1.045, 1.072, 1.083, 1.081, 1.072, 1.059, 1.045, 1.031, 1.019, 1.009, 1.002, 0.997, 0.995, 0.993, 0.993, 1); }
}

/* ─── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

/* Any author rule that sets `display` on an element beats the browser's own
   [hidden] { display: none } — origin wins before specificity does. Several
   components here set display on classes that also get toggled hidden (e.g.
   .precert-reveal is display:grid); without this override, hidden would
   silently stop working on any element carrying one of those classes. */
[hidden] { display: none !important; }

body {
  background: var(--cream);
  color: var(--ink);
  overflow-wrap: break-word; /* a very long name or email wraps rather than pushing the page sideways */
  font-family: var(--font-body);
  font-feature-settings: "ss01", "cv11";
  line-height: 1.6;
  min-height: 100dvh;
  /* A column the height of the screen at least: the page grows to fill it, so the footer
     (disclaimer and Privacy) always sits at the bottom, even on a short page */
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle grain — barely there, adds paper warmth */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.09 0 0 0 0 0.08 0 0 0 0 0.07 0 0 0 0.035 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Whisper-quiet honeycomb pattern on top of the grain — pigmented ink outlines
   at very low opacity so it reads as texture, not graphic. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='56' height='100' viewBox='0 0 56 100'><g fill='none' stroke='%231D1D1D' stroke-opacity='0.09' stroke-width='1'><path d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66L28 100'/><path d='M28 0L28 34L0 50L0 84L28 100L56 84L56 50L28 34'/></g></svg>");
  background-size: 56px 100px;
}

body > * { position: relative; z-index: 1; }

/* ─── Site header ────────────────────────────────────────────────────────────── */
.site-header {
  padding: 1.5rem clamp(1.5rem, 4vw, 3.5rem) 0.5rem;
  display: flex;
  align-items: center;
  background: transparent;
  border: none;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  transition: opacity var(--dur-1);
}
.logo-link:hover { opacity: 0.82; }
.site-logo {
  height: 84px;
  width: auto;
  display: block;
}

/* Hide banner entirely on entry-flow pages — logo lives inside the card instead.
   Also hide on the operator console and staff training shell; each has its own logo. */
body:has(.entry-page) .site-header,
body:has(.op-console) .site-header { display: none; }
/* Staff pages in rules of their own, never in a list with :has(): a browser without :has()
   throws out the whole list, and these must work there too (views/layout.js) */
body.page-staff .site-header,
body.page-staff .site-footer { display: none; }
.page-staff .main-content { max-width: 100%; padding: 0; }

/* ─── Main content ───────────────────────────────────────────────────────────── */
.main-content {
  flex: 1 0 auto;
  width: 100%; /* centred by its auto margins, which would otherwise shrink it in the column */
  box-sizing: border-box;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3.5rem 1.5rem 5rem;
}

.main-content:has(.entry-page),
.main-content:has(.op-console),
.main-content:has(.manager-page) {
  max-width: 100%;
  padding: 0;
}

/* ─── Site footer ────────────────────────────────────────────────────────────── */
.site-footer {
  max-width: none;
  margin: 0;
  padding: 1.25rem clamp(1.5rem, 4vw, 3.5rem);
}
.site-footer p {
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--ink-mid);
  text-align: center;
  max-width: none;
  margin: 0;
}

/* Operator console has its own footer treatment — skip the disclaimer here. The code entry
   and name screens (.staff-entry) and the privacy notice have no footer at all.
   Staff training shell renders its own copy inside the content column (see
   .staff-main__footer) so it doesn't stretch under the sidebar too. */
body:has(.op-console) .site-footer,
body:has(.staff-entry) .site-footer,
body:has(.op-login) .site-footer,
body:has(.privacy-page) .site-footer { display: none; } /* code entry, name, privacy and operator login screens: no footer */

/* ─── Typography ─────────────────────────────────────────────────────────────── */
h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin-bottom: 0.6rem;
  color: var(--ink);
}

h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin-bottom: 0.6rem;
  color: var(--ink);
}

h3 {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 0.4rem;
  color: var(--ink-mid);
}

p { margin-bottom: 0.75rem; color: var(--ink-2); }
p:last-child { margin-bottom: 0; }

.lede {
  color: var(--ink-mid);
  font-size: 1.02rem;
  line-height: 1.55;
  font-weight: 400;
}

a { color: var(--amber-hover); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: rgba(176,122,18,0.35); }
a:hover { color: var(--ink); text-decoration-color: var(--amber-hover); }

/* ─── Cards ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

/* ─── Forms ──────────────────────────────────────────────────────────────────── */
label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-mid);
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="search"],
textarea {
  display: block;
  width: 100%;
  padding: 0.9rem 1rem;
  font-size: 1rem;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  appearance: none;
  -webkit-appearance: none;
  transition: border-color var(--dur-1), box-shadow var(--dur-1), background var(--dur-1);
}

input::placeholder,
textarea::placeholder { color: var(--ink-dim); }

input:hover,
textarea:hover { border-color: rgba(29,29,29,0.24); }

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--amber-hover);
  box-shadow: 0 0 0 4px var(--amber-glow);
  background: var(--paper);
}

/* Red highlight after a failed submission — matches the amber focus ring shape
   but in clay. Cleared as soon as the user edits the field. */
input.input-invalid,
input.input-invalid:hover {
  border-color: var(--clay);
  box-shadow: 0 0 0 4px rgba(194,86,47,0.18);
  background: var(--paper);
}
input.input-invalid:focus {
  border-color: var(--clay);
  box-shadow: 0 0 0 4px rgba(194,86,47,0.28);
}

/* Radio buttons and tick boxes never get the glows above — round or small, they showed as
   a beige square around the box. The button or tick itself is the only sign of a choice.
   (After the invalid rules, so those can't bring the square back.) Keyboard users see a
   rounded outline round the label instead; browsers without :has() keep their own focus
   outline on the input. */
input:is([type="radio"], [type="checkbox"]):focus,
input:is([type="radio"], [type="checkbox"]).input-invalid,
input:is([type="radio"], [type="checkbox"]).input-invalid:focus { box-shadow: none; background: none; }
@supports selector(:has(*)) {
  input:is([type="radio"], [type="checkbox"]):focus { outline: none; }
  label:not(.quiz-option):has(> input:is([type="radio"], [type="checkbox"]):focus-visible) { outline: 2px solid var(--amber-hover); outline-offset: 3px; border-radius: var(--radius-xs); }
}

/* ─── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  min-height: 48px;
  padding: 0.85rem 1.75rem;
  margin-top: 1rem;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  text-decoration: none;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--dur-1) var(--ease-out), background var(--dur-1), border-color var(--dur-1), color var(--dur-1), box-shadow var(--dur-1);
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--ink);
  color: var(--paper);
}
.btn--primary:hover { background: var(--ink-2); box-shadow: 0 6px 16px rgba(29,29,29,0.18); }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-2);
}
.btn--ghost:hover { border-color: var(--ink); background: rgba(29,29,29,0.04); }

.btn--secondary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line-2);
  box-shadow: var(--shadow-sm);
}
.btn--secondary:hover { border-color: var(--ink); }

.btn--full { width: 100%; }

.btn--sm {
  padding: 0.5rem 1.1rem;
  font-size: 0.82rem;
  min-height: 36px;
  margin-top: 0;
}

.btn:focus-visible {
  outline: 2px solid var(--amber-hover);
  outline-offset: 3px;
}

/* ─── Messages ───────────────────────────────────────────────────────────────── */
.msg {
  padding: 0.85rem 1.05rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.9rem;
  margin-top: 1rem;
  line-height: 1.55;
  border: 1px solid transparent;
  transition: opacity 3000ms ease, transform 3000ms ease;
}

.msg--dismissing {
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
}

.msg--error {
  color: var(--clay);
  background: var(--clay-soft);
  border-color: var(--clay-line);
}

.msg--success {
  color: var(--sage);
  background: var(--sage-soft);
  border-color: var(--sage-line);
}

.msg--info,
.msg--warn {
  color: var(--amber-hover);
  background: var(--amber-soft);
  border-color: var(--amber-line);
}

/* ─── Entry page ─────────────────────────────────────────────────────────────── */
.entry-page {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.25rem 4rem;
  background: linear-gradient(180deg, var(--cream) 0%, var(--cream-2) 100%);
  overflow: hidden;
}

.entry-blobs {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  animation: entry-blobs-fade-in 1100ms cubic-bezier(0.22, 1, 0.36, 1) 120ms forwards;
}

/* Toast for entry-page alerts — floats at top of viewport so the card
   underneath never changes size when a message appears or dismisses. */
.entry-toast {
  position: fixed;
  top: calc(1.5rem + env(safe-area-inset-top)); /* clear of a notch (staff pages fill the screen) */
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: min(92vw, 440px);
  pointer-events: none;
}

.entry-toast .msg {
  margin: 0;
  pointer-events: auto;
  box-shadow: 0 12px 32px rgba(29,29,29,0.14), 0 4px 12px rgba(29,29,29,0.08);
  background: var(--paper);
}

.entry-toast .msg--error {
  background: var(--paper);
  color: var(--clay);
  border-color: var(--clay-line);
}

/* Hidden for the moment it takes to put a reloaded page back where it was (views/layout.js) */
html.keep-place body { visibility: hidden; }

/* Floating messages (public/js/flash.js): every notification, confirmation and error
   floats at the top centre of the screen, however far the page is scrolled, never in the
   page itself. Server-rendered ones float from the first paint (before the script moves
   them into the stack), so nothing on the page shifts when they appear or go. */
.toast-stack {
  position: fixed;
  top: calc(1.5rem + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: min(92vw, 520px);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
main .msg[role="alert"]:not(.toast):not(.entry-toast .msg),
main .quiz-fail:not(.toast) {
  position: fixed;
  top: calc(1.5rem + env(safe-area-inset-top)); /* clear of a notch (staff pages fill the screen) */
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: min(92vw, 520px);
  margin: 0;
}
.toast {
  position: relative;
  margin: 0;
  padding-right: 3rem;
  pointer-events: auto;
  background: var(--paper);
  box-shadow: 0 12px 32px rgba(29,29,29,0.14), 0 4px 12px rgba(29,29,29,0.08);
  animation: toast-in 260ms cubic-bezier(0.22, 1, 0.36, 1);
}
.toast.msg--success { border-color: var(--sage-line); }
.toast.msg--error, .toast.quiz-fail { border-color: var(--clay-line); }
.toast.msg--dismissing { transition: opacity var(--dur-4) var(--ease-out), transform var(--dur-4) var(--ease-out); }
.toast__close {
  position: absolute;
  top: 0;
  right: 0.15rem;
  width: 44px;   /* a full-size tap target (spec §6) */
  height: 44px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink-mid);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.toast__close:hover { background: rgba(29,29,29,0.06); color: var(--ink); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

@keyframes entry-blobs-fade-in {
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .entry-blobs { animation: none; opacity: 1; }
}

.entry-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.entry-card__header {
  background: transparent;
  border-bottom: none;
  padding: 2.5rem 1.9rem 1.25rem;
  text-align: center;
}

/* Error pages (views/error.js): the code entry card, with a smaller logo and a way back */
.error-card { max-width: 460px; }
.entry-card__header.error-card__header { padding: 2.25rem 1.9rem 0.6rem; }
.error-card__logo { height: 84px; width: auto; max-width: 100%; display: block; margin: 0 auto 1.5rem; }
.error-card__code {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mid);
  margin: 0 0 0.5rem;
}
.error-card__body { padding: 0.25rem 1.9rem 1.9rem; text-align: center; }
.error-card__body p { color: var(--ink-2); margin: 0 0 0.6rem; line-height: 1.55; }
.error-card__body .btn { margin-top: 1rem; }
.error-card__body .btn + .btn { margin-top: 0.5rem; }

.entry-card__logo {
  height: 160px;
  width: auto;
  max-width: 100%;
  display: block;
  margin: 0 auto 1.5rem;
}

.entry-card__header h1 {
  font-size: 1.75rem;
  margin: 0;
  letter-spacing: -0.02em;
}

.entry-card__header .lede {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  color: var(--ink-mid);
}

.entry-card > form,
.entry-card > .name-card,
.entry-card > p.msg,
.entry-card > .form-secondary {
  padding: 0 1.9rem;
}

.entry-card > form { padding-bottom: 1.9rem; }
.entry-card > form:first-of-type { padding-top: 1.75rem; }
.entry-card > form:first-child { padding-top: 1.75rem; }

.entry-card > form label:first-child { margin-top: 0; }

.entry-card input[type="text"],
.entry-card input[type="password"] {
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  padding: 0.95rem 1.05rem;
}

/* Small link under the code entry and Record ID forms */
.entry-alt { margin: 1.1rem 0 0; text-align: center; font-size: 0.9rem; }
.entry-alt a { color: var(--ink-2); }
.entry-alt a:hover { color: var(--ink); }

/* Verify a certificate (same card as code entry) */
.entry-card > p.verify-entry__msg { margin: 1.25rem 1.9rem 0; padding: 0.8rem 1rem; font-size: 0.92rem; }
.verify-again { margin: 1.25rem 0 0; text-align: center; font-size: 0.92rem; }
.verify-again--back { margin-top: 0.6rem; }
.verify-again--back a { color: var(--ink-2); }

/* ─── Utility ────────────────────────────────────────────────────────────────── */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ─── Overview ───────────────────────────────────────────────────────────────── */
.overview-header { margin-bottom: 2rem; text-align: center; }
.overview-header h1 { margin-bottom: 0.5rem; text-wrap: balance; } /* a two-line title splits evenly */

.progress-summary {
  font-size: 0.92rem;
  color: var(--ink-mid);
  margin: 0.3rem 0 0;
  font-weight: 500;
}

/* Resume / action card */
.resume-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem 1.5rem;
  margin-bottom: 2rem;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--paper);
  min-height: 84px;
  transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2);
  box-shadow: var(--shadow);
}

.resume-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.resume-card:focus-visible { outline: 2px solid var(--amber-hover); outline-offset: 3px; }

.resume-card--cert  { background: var(--sage); border-color: var(--sage); }
.resume-card--quiz  { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.resume-card--quiz .resume-card__label { color: rgba(29,29,29,0.55); }
.resume-card--quiz .resume-card__arrow { color: var(--ink); }

/* Feedback invitation under the certificate card — the loudest thing on the page
   once someone has passed: sidebar-black card, big heading, full-width amber button. */
.feedback-card {
  margin: 0 0 1.75rem;
  padding: clamp(1.75rem, 4vw, 2.5rem);
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: feedback-card-in 700ms cubic-bezier(0.22, 0.7, 0.2, 1) 250ms both;
}
@keyframes feedback-card-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.feedback-card__kicker {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 0.6rem;
}
.feedback-card__heading {
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  line-height: 1.1;
  color: var(--paper);
  margin: 0 0 0.6rem;
}
.feedback-card__text {
  font-size: 1rem;
  line-height: 1.55;
  color: rgba(251,249,242,0.75);
  margin: 0 0 1.5rem;
  max-width: 52ch;
}
.feedback-card__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 56px;
  padding: 0.9rem 1.5rem;
  background: var(--amber);
  color: var(--ink);
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  transition: background var(--dur-1), transform var(--dur-1);
}
.feedback-card__btn:hover { background: var(--paper); }
.feedback-card__btn:active { transform: scale(0.99); }
.feedback-card__btn:focus-visible { outline: 2px solid var(--paper); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .feedback-card { animation: none; } }


.resume-card__text  { display: flex; flex-direction: column; gap: 0.35rem; }

.resume-card__label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: rgba(251,249,242,0.55);
}

.resume-card__title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: inherit;
}

.resume-card__meta { font-size: 0.86rem; font-weight: 600; color: rgba(251,249,242,0.75); } /* "9 of 15 answered" */
.resume-card--quiz .resume-card__meta { color: rgba(29,29,29,0.72); } /* dark on the amber card */

.resume-card__arrow { font-size: 1.5rem; flex-shrink: 0; color: rgba(251,249,242,0.7); font-family: var(--font-heading); }

/* Module list (the overview): every module in order, then the assessment, set apart. A
   module that can be opened is one big link; a locked one is shown, dimmed, but not a link. */
.overview-list-heading { font-size: 1.05rem; margin: 2.25rem 0 0.85rem; }
.module-list {
  list-style: none;
  padding: 0; margin: 0 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.module-row {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-1), box-shadow var(--dur-1), border-color var(--dur-1);
}
.module-row__link {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 72px;
  padding: 1rem 1.2rem;
  color: inherit;
  text-decoration: none;
  border-radius: inherit;
}
a.module-row__link:focus-visible { outline: 2px solid var(--amber-hover); outline-offset: 2px; }
.module-row--link:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--line-2); }

.module-row--locked { opacity: 0.55; }
.module-row--locked .module-row__link { cursor: not-allowed; }

.module-row__num {
  flex-shrink: 0;
  width: 2.4rem; height: 2.4rem;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading);
  font-size: 1rem; font-weight: 700;
  border-radius: 50%;
  background: var(--cream-2);
  color: var(--ink-mid);
  border: 1px solid var(--line);
}
.module-row--complete .module-row__num { background: var(--sage); color: var(--paper); border-color: var(--sage); }
.module-row--available .module-row__num,
.module-row--in-progress .module-row__num { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.module-row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.module-row__title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.module-row__desc { font-size: 0.87rem; color: var(--ink-2); line-height: 1.45; } /* --ink-2: AA contrast on paper */
.module-row__time { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; color: var(--ink-2); }
.module-row__state {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mid);
}
.module-row--complete .module-row__state { color: var(--sage); }
.module-row--available .module-row__state,
.module-row--in-progress .module-row__state { color: var(--ink); } /* ink, not amber: one amber accent per screen */

/* The assessment: after the modules, on its own, with an amber edge once it's open */
.module-row--quiz { margin-top: 1.25rem; background: var(--paper-2); }
.module-row--quiz.module-row--available { background: var(--paper); border-color: var(--ink); } /* set apart in ink: amber is kept for one accent */

/* A phone: the state goes under the title, so the title keeps the width */
@media (max-width: 480px) {
  .module-row__link { flex-wrap: wrap; gap: 0.35rem 0.85rem; padding: 0.9rem 1rem; }
  .module-row__body { flex-basis: calc(100% - 3.3rem); }
  .module-row__state { margin-left: 3.25rem; }
  .module-row--quiz .module-row__state { margin-left: 0; }
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.75rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
}

.badge--pass   { background: var(--sage-soft);  color: var(--sage);  border-color: var(--sage-line); }
.badge--locked { background: var(--cream-2);    color: var(--ink-dim); border-color: var(--line-2); }
.badge--refuse { background: var(--clay-soft);  color: var(--clay);  border-color: var(--clay-line); }
.badge--mid    { background: var(--amber-soft); color: var(--amber-hover); border-color: var(--amber-line); }

/* Small link */
.link-small {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--amber-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(176,122,18,0.35);
}
.link-small:hover { color: var(--ink); text-decoration-color: var(--amber-hover); }
.link-small:focus-visible { outline: 2px solid var(--amber-hover); outline-offset: 2px; }

/* Access notice */
.access-notice {
  margin-top: 2rem;
  font-size: 0.88rem;
  color: var(--ink-mid);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  border: 1px solid var(--line);
  text-align: center;
}
.access-notice--warn   { color: var(--amber-hover); background: var(--amber-soft); border-color: var(--amber-line); }
.access-notice--urgent { color: var(--amber-hover); background: var(--amber-soft); border-color: var(--amber-line); font-weight: 600; } /* amber, as the final 14 days are: terracotta is for refusals */
.access-download-note  { font-size: 0.82rem; color: var(--ink-dim); margin-top: 0.5rem; text-align: center; }

/* ─── Name card ──────────────────────────────────────────────────────────────── */
.name-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1.15rem 1.25rem;
  margin: 1.35rem 0;
  text-align: center;
}

.name-card__name {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.015em;
}
.name-card__meta { font-size: 0.88rem; color: var(--ink-mid); }

.form-secondary { margin-top: 0.5rem; }
.form-secondary .btn { margin-top: 0; }

/* ─── Module page ────────────────────────────────────────────────────────────── */
.module-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  font-size: 0.85rem;
}

.module-nav__back {
  color: var(--ink-mid);
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  transition: color var(--dur-1);
}
.module-nav__back:hover { color: var(--ink); }
.module-nav__position {
  color: var(--ink-dim);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
}

.module-title { margin-bottom: 0.5rem; }
.module-desc  { color: var(--ink-mid); font-size: 1rem; margin-bottom: 2.25rem; line-height: 1.55; }

/* Compact heading for regular modules — no pre-video description block. */
.module-title--compact {
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  margin: 0 0 1.25rem;
  line-height: 1.15;
}

/* ─── Intro module (Getting started) ────────────────────────────────────────── */
.intro-hero {
  margin: 0 0 2rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--paper);
}
.intro-hero__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.intro-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 2.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.intro-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 1.15rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.intro-step__num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius-pill);
}
.intro-step__text {
  color: var(--ink-2);
  line-height: 1.55;
  padding-top: 0.15rem;
}

.intro-actions {
  margin: 0.5rem 0 0;
}
.intro-actions .btn {
  margin-top: 0;
}

/* Video */
.video-section { margin-bottom: 2.5rem; }

.video-container {
  position: relative;
  background: var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.video-container video {
  display: block;
  width: 100%;
  background: var(--ink);
}

/* Video modules get a wider column than reading pages: as wide as a 16:9 video can be
   while the title above and progress bar below still fit on screen, never narrower
   than the normal 820px column, never wider than 1280px. (--video marks a video page:
   views/staff-shell.js.) */
.staff-main__inner.staff-main__inner--video { max-width: 1280px; } /* beats .staff-main__inner's 820px, further down */
.staff-main__inner > .module-page:not(.module-page--intro) {
  max-width: max(820px, calc((100dvh - 210px) * 16 / 9));
  margin: 0 auto;
}

.video-error {
  padding: 1.5rem;
  background: var(--clay-soft);
  border: 1px solid var(--clay-line);
  border-radius: var(--radius);
  color: var(--clay);
  font-weight: 500;
  text-align: center;
}

.video-status { margin-top: 1rem; }

.progress-track {
  height: 5px;
  background: var(--sand);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 0.65rem;
}

.progress-fill {
  height: 100%;
  background: var(--ink);
  border-radius: 5px;
  width: 0;
  transition: width 0.4s linear;
}

@media (prefers-reduced-motion: reduce) { .progress-fill { transition: none; } }

.progress-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-mid);
  margin-bottom: 0.5rem;
}

.resume-note { font-size: 0.88rem; }
/* A text link with a full-size tap target: the padding reaches 44px, the negative margin keeps
   the line as it was */
.resume-note .link-btn { display: inline-block; padding: 12px 6px; margin: -12px -6px; }

.link-btn {
  background: none; border: none; padding: 0;
  font: inherit; font-size: inherit;
  font-weight: 600; color: var(--amber-hover);
  text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: rgba(176,122,18,0.35);
  cursor: pointer;
}
.link-btn:hover { color: var(--ink); text-decoration-color: var(--amber-hover); }
.link-btn:focus-visible { outline: 2px solid var(--amber-hover); outline-offset: 2px; }

/* Scenario */
/* Once the video is watched, a sidebar-black bar slides up from the bottom of the
   screen with a pulsing arrow. Pressing it scrolls down into the scenario, which is
   its own dark full-bleed scene — deliberately unlike the lesson above it. */
.scenario-bar {
  position: fixed;
  left: calc(320px + env(safe-area-inset-left)); /* sidebar width (and a notch beside it) — the bar sits under the main column */
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  width: auto;
  margin: 0;
  padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom));
  min-height: 76px;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-top: 1px solid rgba(251,249,242,0.08);
  border-radius: 0;
  box-shadow: 0 -8px 24px rgba(29,29,29,0.18);
  font: inherit;
  cursor: pointer;
  transform: translateY(100%);
  transition: transform var(--dur-4) cubic-bezier(0.22, 0.7, 0.2, 1), visibility 0s linear var(--dur-4);
  visibility: hidden;
}
.scenario-bar--shown { transform: none; visibility: visible; transition-delay: 0s; }
.scenario-bar--gone  { transform: translateY(100%); visibility: hidden; }
.scenario-bar:focus-visible { outline: 2px solid var(--amber); outline-offset: -4px; }

.scenario-bar__label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.scenario-bar__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--amber);
  color: var(--ink);
  animation: scenario-arrow-pulse 1.6s ease-in-out infinite;
}
.scenario-bar:hover .scenario-bar__arrow { animation-duration: 0.9s; }

@keyframes scenario-arrow-pulse {
  0%, 100% { transform: translateY(0) scale(1);       box-shadow: 0 0 0 0 rgba(239,182,58,0.55); }
  50%      { transform: translateY(4px) scale(1.06);  box-shadow: 0 0 0 10px rgba(239,182,58,0); }
}

/* Once the scenario is open the dark scene runs to the bottom of the page:
   the disclaimer footer joins it, full width, in light text. */
body.scenario-open .staff-main { padding-bottom: 0; }
body.scenario-open .staff-main__footer {
  margin: 0 calc(-1 * var(--main-pad));
  padding: 1.25rem var(--main-pad) 1.75rem;
  background: var(--ink);
  border-top: 1px solid rgba(251,249,242,0.08);
}
body.scenario-open .staff-main__footer p { color: var(--paper); }

/* On a module's page the footer waits for the scenario: under the video and "Take a closer look"
   it would only add bulk, and the scenario is the end of the page */
.staff-main__inner--video + .staff-main__footer { display: none; }
body.scenario-open .staff-main__inner--video + .staff-main__footer { display: block; }

/* Keep the page's last lines clear of the bar while it's up */
body.has-scenario-bar .staff-main { padding-bottom: 7rem; }

@media (max-width: 900px) {
  .scenario-bar { left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .scenario-bar { transition: none; }
  .scenario-bar__arrow { animation: none; }
}

/* The scene breaks out of the 820px reading column to the full width of the main
   area (see --main-pad on .staff-main) and fills the screen when scrolled to. The
   scenario itself is as large as it can be while the whole player still fits on screen. */
.scenario-scene {
  width: calc(100cqw + 2 * var(--main-pad));
  margin: 3rem calc((100% - 100cqw) / 2 - var(--main-pad)) 0;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  background: var(--ink);
  color: var(--paper);
  outline: none;
}
.scenario-scene[hidden] { display: none; }
.scenario-scene__inner {
  --scene-pad: clamp(1rem, 2vw, 1.5rem);
  width: 100%;
  /* a scenario video: 16:9 plus the heading, the progress bar and the padding */
  max-width: min(1280px, max(560px, calc((100dvh - 215px) * 16 / 9 + 2 * var(--scene-pad))));
  margin: 0 auto;
  padding: clamp(1rem, 3vh, 2rem) var(--scene-pad);
}

.scenario-card { background: none; border: none; padding: 0; box-shadow: none; }

.scenario-kicker {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(251,249,242,0.55);
  margin: 0 0 0.5rem;
}
.scenario-kicker + .scenario-heading { margin-top: 0; }
.scenario-heading { font-size: clamp(1.35rem, 2.4vw, 1.75rem); color: var(--paper); margin: 0 0 0.2rem; line-height: 1.15; }
.scenario-sub { font-size: 0.85rem; color: rgba(251,249,242,0.6); margin-bottom: 1rem; }

.scenario-scene .progress-track { background: rgba(251,249,242,0.14); }
.scenario-scene .progress-fill  { background: var(--amber); }
.scenario-scene .progress-text  { color: rgba(251,249,242,0.7); }
.scenario-scene .btn--primary { background: var(--amber); color: var(--ink); }
.scenario-scene .btn--primary:hover { background: var(--paper); color: var(--ink); }
.scenario-scene .btn:focus-visible { outline-color: var(--paper); }

.scenario-animation-wrap {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 0 1px rgba(251,249,242,0.1), 0 18px 40px rgba(0,0,0,0.35);
}

.scenario-animation-wrap video { display: block; width: 100%; background: #000; }

/* Interactive scenario page. Its player adds controls under the picture (about 86px with
   the frame's padding), so the column allows for those to keep it all on one screen. The
   pages' own 1080px cap is lifted as they're served (routes/module.js). The frame's height comes from the page itself
   (player.js); this starting height is only until it reports in. */
.scenario-scene__inner--page {
  max-width: min(calc(1280px + 2 * var(--scene-pad)), max(560px, calc((100dvh - 265px) * 16 / 9 + 2 * var(--scene-pad))));
}
.scenario-frame-wrap {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--cream);
  box-shadow: 0 0 0 1px rgba(251,249,242,0.1), 0 18px 40px rgba(0,0,0,0.35);
}
.scenario-frame-wrap iframe {
  display: block;
  width: 100%;
  /* Starts a touch shorter than any player (16:9 picture + controls): the page reports its
     height by measuring itself inside the frame, which can only grow the frame, never shrink it */
  aspect-ratio: 16 / 9.2;
  min-height: 220px;
  border: 0;
}
.scenario-loading {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  color: var(--ink-2);
  font-weight: 600;
}
.scenario-loading span { animation: scenario-loading-pulse 1.6s ease-in-out infinite; }
.scenario-loading[hidden] { display: none; }
@keyframes scenario-loading-pulse { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .scenario-loading span { animation: none; } }
.scenario-status { margin-top: 1rem; }
.scenario-reload { min-height: 44px; }

.video-error p, .anim-error p { margin: 0 0 0.85rem; }
.video-error .btn, .anim-error .btn { margin-top: 0; min-height: 44px; }
.anim-error {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  font-size: 0.87rem;
  color: var(--amber-hover);
  background: var(--amber-soft);
  border-radius: var(--radius-sm);
  border: 1px solid var(--amber-line);
}

.scenario-actions { margin-top: 1.25rem; }
/* "Module complete": a teal tick, drawn in when it's just happened (player.js celebrate) */
.module-done { display: flex; align-items: center; gap: 0.6rem; margin: 0 0 0.9rem; font: 700 1.05rem var(--font-heading); color: var(--sage); }
.scenario-scene .module-done { color: var(--paper); } /* the scenario's dark scene: light text, the tick stays teal */
.module-done__tick { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--sage); color: var(--paper); }
.module-done--new .module-done__tick { animation: done-pop 520ms cubic-bezier(0.2, 1.5, 0.4, 1); }
.module-done--new .module-done__tick path { stroke-dasharray: 22; stroke-dashoffset: 22; animation: done-draw 420ms 180ms ease-out forwards; }
.module-done--new { animation: done-rise 420ms ease-out; }
@keyframes done-pop { from { transform: scale(0.3); } to { transform: scale(1); } }
@keyframes done-draw { to { stroke-dashoffset: 0; } }
@keyframes done-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.staff-nav__item.is-just-done .staff-nav__icon { animation: done-pop 520ms cubic-bezier(0.2, 1.5, 0.4, 1); }
@media (prefers-reduced-motion: reduce) {
  .module-done--new, .module-done--new .module-done__tick, .staff-nav__item.is-just-done .staff-nav__icon { animation: none; }
  .module-done--new .module-done__tick path { animation: none; stroke-dashoffset: 0; }
}
.scenario-actions .btn { margin-top: 0; }

/* Correct/Wrong tags (quiz) — a solid, high-contrast fill so they read at a glance. */
.badge--correct { background: var(--correct); color: var(--paper); border-color: var(--correct); }
.badge--wrong   { background: var(--wrong);   color: var(--paper); border-color: var(--wrong); }

/* ─── Quiz page ──────────────────────────────────────────────────────────────── */
.quiz-page { max-width: 760px; margin: 0 auto; padding: 2rem 1.25rem 5rem; }
.quiz-header { margin-bottom: 2.5rem; }
.quiz-header h1 { margin: 0 0 0.5rem; }
.quiz-intro { margin: 0; color: var(--ink-mid); font-size: 0.95rem; }

.quiz-fail {
  background: var(--clay-soft);
  border: 1px solid var(--clay-line);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  margin-bottom: 1.75rem;
  font-size: 0.93rem;
  color: var(--ink-2);
}
.quiz-fail strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--clay);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
}
.quiz-fail__modules {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* The assessment, one question per screen (views/quiz.js). Helper text uses --ink-soft,
   dark enough for WCAG AA on cream and paper. */
.qz { --ink-soft: #5E5B52; }
.staff-main__inner > .quiz-page.qz { max-width: 680px; margin: 0 auto; }
.qz-card {
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 4vw, 2rem);
  box-shadow: var(--shadow-sm);
}
.qz-start h1 { margin: 0 0 0.85rem; }
.qz-start__rules { margin: 0; font-size: 1.02rem; line-height: 1.55; color: var(--ink-2); max-width: 56ch; }

/* The start screen: a briefing. The facts, a map of the parts, the rules. */
.qz-eyebrow {
  display: flex; align-items: center; gap: 0.6rem; margin: 0 0 0.6rem;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft);
}
.qz-eyebrow::before { content: ''; width: 22px; height: 3px; border-radius: 3px; background: var(--amber); } /* the screen's one amber */
.qz-start__lead { margin: 0 0 1.4rem; font-size: 1.08rem; line-height: 1.55; color: var(--ink-2); max-width: 54ch; }
.qz-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: column; gap: 0.5rem; margin: 0 0 1.75rem; }
.qz-fact { padding: 0.8rem 0.95rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper-2); }
.qz-fact dt { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.qz-fact dd { margin: 0.2rem 0 0; font: 700 1.2rem/1.2 var(--font-heading); color: var(--ink); letter-spacing: -0.01em; }
@media (max-width: 640px) {
  .qz-fact { padding: 0.7rem 0.75rem; }
  .qz-fact dt { font-size: 0.66rem; letter-spacing: 0.06em; }
  .qz-fact dd { font-size: 1.02rem; }
}
.qz-start__sub { margin: 0 0 0.6rem; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); font-family: var(--font-body); }
.qz-map, .qz-done { list-style: none; margin: 0 0 1.6rem; padding: 0; border-top: 1px solid var(--line); }
.qz-map__row, .qz-done__row { display: flex; align-items: center; gap: 0.8rem; min-height: 48px; padding: 0.45rem 0.15rem; border-bottom: 1px solid var(--line); }
.qz-map__num, .qz-done__num {
  flex: 0 0 28px; height: 28px; display: grid; place-items: center; border-radius: 50%;
  font-size: 0.8rem; font-weight: 700; color: var(--ink); background: var(--cream-2); border: 1px solid var(--line-2);
}
.qz-map__title, .qz-done__title { flex: 1 1 auto; min-width: 0; font-weight: 600; color: var(--ink); line-height: 1.35; }
.qz-map__count, .qz-done__count { flex-shrink: 0; font-size: 0.82rem; color: var(--ink-soft); }
.qz-start__keys { display: none; margin: 0.4rem 0 0; font-size: 0.88rem; color: var(--ink-soft); }
.qz-begin { margin-top: 1.5rem; min-height: 52px; padding-inline: 2rem; font-size: 1rem; }
@media (max-width: 640px) { .qz-begin { width: 100%; } }
/* Keyboard hints only where there's a keyboard and a mouse */
@media (hover: hover) and (pointer: fine) { .qz-start__keys { display: block; } }

/* Top: where they are, saved, the progress bar and the numbered dots */
.qz-top { margin-bottom: 1rem; scroll-margin-top: 1rem; }
.qz-top__row { display: flex; align-items: center; gap: 0.75rem; min-height: 44px; }
.qz-where { margin: 0; font-size: 0.9rem; font-weight: 600; color: var(--ink); }
.qz-saved { margin-left: auto; font-size: 0.82rem; color: var(--ink-soft); }
.qz-saved--fail { color: var(--amber-dark); font-weight: 600; }
/* A segment per part, each filling with that part's answers */
.qz-bar { display: flex; gap: 4px; height: 5px; margin: 0.35rem 0 0.85rem; }
.qz-bar__seg { flex: 1 1 0; min-width: 6px; border-radius: var(--radius-pill); background: var(--line); overflow: hidden; }
.qz-bar__fill { display: block; height: 100%; width: 0; background: var(--amber); border-radius: var(--radius-pill); transition: width var(--dur-3) var(--ease-out); }
.qz-dots { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.qz-dot {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; padding: 0 0.4rem; border-radius: var(--radius-pill);
  border: 1px solid var(--line-2); background: var(--paper);
  font-size: 0.78rem; font-weight: 600; color: var(--ink-soft); text-decoration: none;
  position: relative;
}
.qz-dot::after { content: ''; position: absolute; inset: -6px -2px; } /* a 44px tap area round a small dot */
.qz-dot:hover { border-color: var(--ink); color: var(--ink); }
.qz-dot.is-answered { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.qz-dot.is-wrong { background: var(--clay-soft); border-color: var(--clay-line); color: var(--clay); }
.qz-dot.is-right { background: var(--sage); border-color: var(--sage); color: var(--paper); }
.qz-dot[aria-current="step"] { box-shadow: 0 0 0 2px var(--cream), 0 0 0 4px var(--amber); }
.qz-dot--review { padding: 0 0.7rem; }
.qz-dots > .qz-dots__part { margin-left: 0.55rem; } /* a gap where each part starts */
.qz-dot:focus-visible { outline: 2px solid var(--amber-hover); outline-offset: 3px; }
/* On a phone the dots fold into a "4 / 15 ▾" menu */
.qz-jump { display: none; position: relative; }
.qz-jump__btn {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 0.3rem;
  min-height: 44px; padding: 0 0.85rem; border: 1px solid var(--line-2); border-radius: var(--radius-pill);
  background: var(--paper); font-size: 0.88rem; font-weight: 600; color: var(--ink);
}
.qz-jump__btn::-webkit-details-marker { display: none; }
.qz-jump__list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: min(260px, calc(100vw - 32px));
  max-height: 60vh; overflow-y: auto; list-style: none; margin: 0; padding: 0.35rem;
  background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  box-shadow: 0 10px 28px rgba(29,29,29, 0.14);
}
.qz-jump__row {
  display: flex; justify-content: space-between; gap: 0.75rem; align-items: center;
  min-height: 44px; padding: 0 0.75rem; border-radius: var(--radius-sm);
  color: var(--ink); text-decoration: none; font-size: 0.92rem;
}
.qz-jump__row:hover, .qz-jump__row[aria-current="step"] { background: var(--cream-2); }
.qz-jump__state { font-size: 0.78rem; color: var(--ink-soft); }
.qz-jump__row.is-missing .qz-jump__state { color: var(--amber-dark); font-weight: 600; }
.qz-jump__row.is-wrong .qz-jump__state { color: var(--clay); font-weight: 600; }

/* A question */
.quiz-question { border: 0; margin: 0; padding: 0; min-width: 0; }
.qz-legend { padding: 0; margin: 0 0 0.85rem; display: block; width: 100%; }
.qz-legend:focus { outline: none; }
/* The part a question belongs to, above its number; drawn in as a new part starts */
.qz-part { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem 0.6rem; margin: 0 0 0.9rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--line); position: relative; }
.qz-part::after { content: ''; position: absolute; left: 0; bottom: -1px; width: 48px; height: 2px; background: var(--ink); transform-origin: left; }
.qz-part__num { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
.qz-part__title { font-size: 0.9rem; font-weight: 700; color: var(--ink); }
.qz-label { display: block; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em; color: var(--ink-soft); margin-bottom: 0.35rem; }
.quiz-question__text {
  display: block; font-family: var(--font-heading); font-weight: 600;
  font-size: 1.25rem; line-height: 1.35; color: var(--ink); letter-spacing: -0.005em;
}
@media (min-width: 641px) { .quiz-question__text { font-size: 1.375rem; } }
.qz-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0 0 1.15rem; }
.qz-pill, .qz-verdict {
  display: inline-flex; align-items: center; min-height: 26px; padding: 0 0.7rem; border-radius: var(--radius-pill);
  font-size: 0.8rem; font-weight: 600; border: 1px solid var(--line-2); background: var(--cream-2); color: var(--ink-2);
}
.qz-count-hint { font-size: 0.82rem; color: var(--ink-soft); }
.qz-verdict { display: none; }
.quiz-question--wrong .qz-verdict--wrong { display: inline-flex; background: var(--clay-soft); border-color: var(--clay-line); color: var(--clay); }
.quiz-question--right .qz-verdict--right { display: inline-flex; background: rgba(46, 107, 99, 0.1); border-color: rgba(46, 107, 99, 0.45); color: var(--sage); }
.quiz-question--right .qz-answer { opacity: 0.7; }
.qz-status { margin: 0.75rem 0 0; font-size: 0.88rem; color: var(--ink-soft); }
/* A picture above the choices */
.qz-figure { margin: 0 0 1rem; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); background: var(--paper-2); }
.qz-figure img { display: block; width: 100%; height: auto; max-height: 340px; object-fit: contain; user-select: none; -webkit-user-select: none; }
/* "Press A–D to choose · Enter for next", only with a keyboard and a mouse */
.qz-keys { display: none; margin: 0.85rem 0 0; font-size: 0.8rem; color: var(--ink-soft); }
.qz-figure--tall { background: #1f1d1b; border-color: #1f1d1b; } /* the picture's own dark room, edge to edge */
.qz-figure--tall img { max-height: 560px; } /* a phone screen: tall enough to read */
@media (max-width: 640px) { .qz-figure img { max-height: none; } } /* full width on a phone, however tall */
/* A module's sample licence as Card A and Card B, side by side (stacked on a phone), held still */
.qz-figure--cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; padding: 1rem 1.25rem 1.5rem; }
.qz-sample__label { margin: 0 0 0.6rem; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); }
.ix-card.ix-card--still { max-width: none; cursor: default; transition: none; box-shadow: 0 12px 26px rgba(29, 29, 29, 0.16), 0 2px 6px rgba(29, 29, 29, 0.1); }
@media (max-width: 640px) { .qz-figure--cards { grid-template-columns: 1fr; padding: 0.9rem 1rem 1.2rem; } }
@media (hover: hover) and (pointer: fine) { .qz-keys { display: block; } }
.qz-keys kbd, .qz-start__keys kbd {
  display: inline-block; min-width: 1.6em; padding: 0.05rem 0.35rem; border: 1px solid var(--line-2); border-bottom-width: 2px;
  border-radius: var(--radius-xs); background: var(--paper); font: 600 0.75rem/1.4 var(--font-body); color: var(--ink); text-align: center;
}
.quiz-question--right .qz-keys { display: none; }
/* A hint on where to look: under a question still wrong after its second check, and only while
   it's marked wrong (once it's right, the "why" takes its place) */
.qz-hint {
  margin: 1rem 0 0; padding: 0.75rem 1rem; border-radius: var(--radius-sm); border-left: 3px solid var(--clay);
  background: var(--clay-soft); font-size: 0.93rem; line-height: 1.5; color: var(--ink);
  animation: rise-in var(--dur-3) var(--ease-out);
}
.quiz-question:not(.quiz-question--wrong) .qz-hint { display: none; }
.qz-hint__label { display: block; margin-bottom: 0.15rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--clay); }
@media (prefers-reduced-motion: reduce) { .qz-hint { animation: none; } }
/* Why the answer is right: under a question once it's marked right */
.qz-why {
  margin: 1rem 0 0; padding: 0.8rem 1rem; border-radius: var(--radius-sm); border-left: 3px solid var(--sage);
  background: rgba(46, 107, 99, 0.07); font-size: 0.93rem; line-height: 1.5; color: var(--ink);
  animation: rise-in var(--dur-3) var(--ease-out);
}
.qz-why__label { display: block; margin-bottom: 0.15rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sage); }
.qz-help { margin: 0.25rem 0 0; font-size: 0.82rem; color: var(--ink-soft); }

/* Choose one / Choose all: the radio or tick box, a plain letter, the text; the whole row taps */
.qz-options { display: flex; flex-direction: column; gap: 0.5rem; }
.quiz-option {
  display: flex; align-items: flex-start; gap: 0.7rem;
  min-height: 48px; margin: 0; padding: 0.75rem 0.95rem;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--paper);
  cursor: pointer; font-size: 1rem; font-weight: 400; line-height: 1.45;
  text-transform: none; letter-spacing: normal; color: var(--ink-2);
  transition: border-color var(--dur-1), background var(--dur-1);
}
.quiz-option:hover { border-color: var(--ink); }
.quiz-option input { flex-shrink: 0; width: 20px; height: 20px; margin: 0.1rem 0 0; accent-color: var(--ink); cursor: pointer; }
.quiz-option__letter { flex-shrink: 0; min-width: 1.1em; font-weight: 600; color: var(--ink-soft); }
.quiz-option__text { flex: 1 1 auto; min-width: 0; overflow-wrap: break-word; }
.quiz-option.is-checked { /* a class (views/quiz.js, public/js/quiz.js), not :has(): older phones too */
  border: 2px solid var(--ink); padding: calc(0.75rem - 1px) calc(0.95rem - 1px);
  background: var(--cream-2); color: var(--ink);
}
.quiz-option:has(input:focus-visible) { outline: 2px solid var(--amber-hover); outline-offset: 2px; }

/* Arrange in order: a number, a handle, the text and ↑ ↓ on every row */
.qo-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.qo-row {
  display: flex; align-items: center; gap: 0.6rem; min-height: 56px; padding: 0.4rem 0.4rem 0.4rem 0.75rem;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--paper);
  font-size: 1rem; line-height: 1.4; color: var(--ink-2); user-select: none; -webkit-user-select: none;
}
.qo-num { flex: 0 0 1.4rem; font-weight: 700; color: var(--ink-soft); text-align: center; }
.qo-grip {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 44px; margin: -0.4rem 0; font-size: 1.1rem; letter-spacing: -0.2em; color: var(--ink-soft);
  cursor: grab; touch-action: none;
}
.qo-text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.qo-moves { display: flex; gap: 0.3rem; flex-shrink: 0; }
.qo-move {
  width: 44px; height: 44px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--paper);
  font: inherit; font-size: 1.1rem; color: var(--ink); cursor: pointer;
}
.qo-move:hover:not(:disabled) { border-color: var(--ink); }
.qo-move:disabled { opacity: 0.3; cursor: default; }
.qo-move:focus-visible, .qg-card:focus-visible, .qg-col__head:focus-visible, .qh-area:focus-visible, .qn-btn:focus-visible { outline: 2px solid var(--amber-hover); outline-offset: 2px; }
.qo { position: relative; }
.qo-drop {
  position: absolute; height: 4px; border-radius: 4px; background: var(--amber); pointer-events: none; z-index: 6;
  box-shadow: 0 0 0 3px rgba(239, 182, 58, 0.25); animation: qo-drop-pulse 0.9s ease-in-out infinite;
  margin-left: -10px; padding-right: 20px; box-sizing: content-box; /* reaches past the row being dragged */
}
.qo-drop::before, .qo-drop::after { content: ''; position: absolute; top: -4px; width: 12px; height: 12px; border-radius: 50%; background: var(--amber); }
.qo-drop::before { left: -6px; }
.qo-drop::after { right: -6px; }
@keyframes qo-drop-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .qo-drop { animation: none; } }
.is-moved { animation: qz-moved 0.7s ease-out; }
@keyframes qz-moved { 0% { background: var(--amber-soft); border-color: var(--amber-dark); } 100% { } }
.is-dragging.qo-row, .is-dragging.qg-card { position: relative; z-index: 5; pointer-events: none; cursor: grabbing; box-shadow: 0 10px 24px rgba(29,29,29, 0.18); transition: none; }

/* Sort into groups: the cards left to sort, then a column per group */
.qg-pool { padding: 0.85rem; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--paper-2); }
.qg-pool__label { margin: 0 0 0.6rem; font-size: 0.85rem; font-weight: 600; color: var(--ink-2); }
.qg-pool__done { margin: 0; font-size: 0.85rem; color: var(--ink-soft); }
.qg-pool .qg-cards { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.qg-pool .qg-cards:empty { display: none; }
.qg-card {
  display: flex; align-items: center; min-height: 48px; margin: 0; padding: 0.6rem 0.85rem;
  font: inherit; font-size: 1rem; line-height: 1.35; text-align: left; color: var(--ink-2);
  background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation; overflow-wrap: anywhere;
  transition: transform var(--dur-1), box-shadow var(--dur-1);
}
.qg-card:hover { border-color: var(--ink); }
.qg-card[aria-pressed="true"] { border: 2px solid var(--ink); padding: calc(0.6rem - 1px) calc(0.85rem - 1px); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(29,29,29, 0.14); }
.qg-cols { display: grid; gap: 0.6rem; margin-top: 0.75rem; }
.qg-cols--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.qg-cols--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.qg-col {
  display: flex; flex-direction: column; min-width: 0;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--paper);
  transition: border-color var(--dur-1), background var(--dur-1);
}
.qg-col:not(.qg-col--filled) { border-style: dashed; } /* --filled: a class, not :has(), for older phones */
.qg-col__head {
  margin: 0; padding: 0.65rem 0.8rem; min-height: 44px; font: inherit; font-size: 0.9rem; font-weight: 700;
  text-align: left; color: var(--ink); background: none; border: 0; border-bottom: 1px solid var(--line);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0; cursor: default;
}
.qg-col .qg-cards { display: flex; flex-direction: column; gap: 0.4rem; padding: 0.6rem 0.6rem 0; }
.qg-col .qg-card { width: 100%; }
.qg-col__empty { margin: 0; padding: 0.4rem 0.8rem 0.9rem; font-size: 0.85rem; color: var(--ink-soft); }
.qg-col--filled .qg-col__empty { display: none; }
.qg-col--filled .qg-cards { padding-bottom: 0.6rem; }
.qg.is-picking [data-zone], .qg.is-picking .qg-col__head { cursor: pointer; }
.qg.is-picking .qg-col, .qg [data-zone].is-target { border-color: var(--amber-dark); background: var(--amber-soft); }
.qg.is-picking .qg-pool { border-color: var(--amber-dark); }
/* The "Move to" list, a phone's way of sorting */
.qg-sheet {
  margin: auto auto 0; width: 100%; max-width: 480px; border: 0; padding: 1.25rem 1rem calc(1rem + env(safe-area-inset-bottom));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0; background: var(--paper); color: var(--ink);
}
.qg-sheet:not([open]) { display: none; } /* a browser without <dialog> would show it in the page */
.qg-sheet::backdrop { background: rgba(29,29,29, 0.4); }
.qg-sheet__card { margin: 0 0 0.25rem; font-weight: 600; font-size: 1rem; }
.qg-sheet__label { margin: 0 0 0.6rem; font-size: 0.85rem; color: var(--ink-soft); }
.qg-sheet__opts { display: flex; flex-direction: column; gap: 0.5rem; }
.qg-sheet__opt { width: 100%; min-height: 48px; justify-content: flex-start; text-align: left; }
.qg-sheet__opt.is-current { border-color: var(--ink); background: var(--cream-2); }
.qg-sheet__cancel { display: block; margin: 0.85rem auto 0; min-height: 44px; }
@media (max-width: 640px) {
  .qg-cols--2, .qg-cols--3 { grid-template-columns: 1fr; }
}
/* Patrons' licences to sort: today's date above, each card with the patron's name, held tilted */
.qz-today { display: inline-flex; align-items: center; gap: 0.5rem; margin: 0 0 0.85rem; padding: 0.4rem 0.8rem; border: 1px solid var(--line-2); border-radius: var(--radius-pill); background: var(--paper); font-size: 0.9rem; font-weight: 600; color: var(--ink); }
.qz-today__label { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
.qg--licences .qg-pool .qg-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.qg-card.qg-card--licence { flex-direction: column; align-items: stretch; gap: 0.55rem; padding: 0.6rem 0.75rem 0.95rem; }
.qg-card.qg-card--licence[aria-pressed="true"] { padding: calc(0.6rem - 1px) calc(0.75rem - 1px) calc(0.95rem - 1px); }
.qg-card__who { font-size: 0.92rem; font-weight: 700; color: var(--ink); }
.qg-card--licence .ix-card { cursor: inherit; box-shadow: 0 8px 18px rgba(29, 29, 29, 0.14), 0 2px 5px rgba(29, 29, 29, 0.1); }
@media (max-width: 640px) { .qg--licences .qg-pool .qg-cards { grid-template-columns: 1fr; } }
/* Today's date and the tilt slider stay in view while the licences scroll by */
.qz-tilt {
  position: sticky; top: 0.5rem; z-index: 8; margin: 0 0 0.85rem; padding: 0.7rem 0.9rem;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--paper); box-shadow: var(--shadow-sm);
}
.qz-tilt .qz-today { margin: 0 0 0.35rem; padding: 0; border: 0; background: none; }
.qz-tilt .ix-tilt { max-width: none; }
.qz-tilt .ix-tilt label { font-size: 0.74rem; }
@media (max-width: 640px) {
  .qz-tilt { padding: 0.5rem 0.75rem 0.25rem; }
  .qz-tilt .qz-today { margin-bottom: 0.1rem; font-size: 0.84rem; }
  .qz-tilt .ix-tilt { flex-wrap: wrap; gap: 0; }
  .qz-tilt .ix-tilt label { flex-basis: 100%; font-size: 0.68rem; }
  .qz-tilt .ix-tilt__track { flex: 1 1 100%; }
  .qz-tilt .ix-tilt input { min-height: 36px; height: 36px; }
}
/* Turned by the slider: a quick follow, none for reduced motion */
.qg-card--licence .ix-card { transition: transform 120ms var(--ease-out); }
@media (prefers-reduced-motion: reduce) { .qg-card--licence .ix-card { transition: none; } }

/* Number stepper: − and + round a big number that can be typed too */
.qn-row { display: flex; align-items: center; gap: 0.6rem; }
.qn-btn {
  width: 56px; height: 56px; border-radius: var(--radius-pill); border: 1px solid var(--line-2); background: var(--paper);
  font: inherit; font-size: 1.6rem; line-height: 1; color: var(--ink); cursor: pointer;
}
.qn-btn:hover { border-color: var(--ink); }
.qn-input {
  width: 5.5rem; height: 64px; text-align: center; font-family: var(--font-heading); font-size: 2rem; font-weight: 700;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--paper); color: var(--ink);
}
.qn-input::placeholder { color: var(--ink-soft); }
.qn-input:focus-visible { outline: 2px solid var(--amber-hover); outline-offset: 2px; }

/* Tap the picture: full width, pinch to zoom; the marker is a ring with a crosshair */
.qh-area { position: relative; display: block; border-radius: var(--radius); cursor: crosshair; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.qh-area img { display: block; width: 100%; height: auto; border-radius: var(--radius); user-select: none; -webkit-user-select: none; }
.qh-marker {
  position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%;
  border: 3px solid var(--ink); box-shadow: 0 0 0 2px var(--paper), inset 0 0 0 2px var(--paper); pointer-events: none;
  background:
    linear-gradient(var(--ink), var(--ink)) center / 2px 12px no-repeat,
    linear-gradient(var(--ink), var(--ink)) center / 12px 2px no-repeat;
}

/* Review: every question with its state; unanswered and not-right ones in amber */
.qz-review__title { margin: 0 0 0.35rem; }
.qz-review__intro { margin: 0 0 1rem; color: var(--ink-2); }
.qz-review__list { list-style: none; margin: 0 0 0.5rem; padding: 0; border-top: 1px solid var(--line); }
.qz-review__row {
  display: flex; align-items: center; gap: 0.75rem; min-height: 52px; padding: 0.5rem 0.25rem;
  border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none;
}
.qz-review__row:hover { background: var(--paper-2); }
.qz-review__num { flex: 0 0 1.6rem; font-weight: 700; color: var(--ink-soft); }
.qz-review__text { flex: 1 1 auto; min-width: 0; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.qz-review__state {
  flex-shrink: 0; font-size: 0.76rem; font-weight: 600; padding: 0.2rem 0.6rem; border-radius: var(--radius-pill);
  border: 1px solid var(--line-2); background: var(--cream-2); color: var(--ink-2);
}
.qz-review__row.is-missing .qz-review__state { background: var(--amber-soft); border-color: var(--amber-dark); color: var(--ink); }
.qz-review__row.is-wrong .qz-review__state { background: var(--clay-soft); border-color: var(--clay-line); color: var(--clay); }
.qz-review__row.is-right .qz-review__state { background: rgba(46, 107, 99, 0.1); border-color: rgba(46, 107, 99, 0.45); color: var(--sage); }

/* Back and Next: under the card, and stuck to the bottom of a phone screen */
.qz-nav { display: flex; justify-content: space-between; gap: 0.75rem; margin-top: 1rem; }
.qz-nav .btn { min-height: 48px; min-width: 7.5rem; }
.qz-nav .qz-next { margin-left: auto; }
@media (max-width: 640px) {
  .qz-dots { display: none; }
  .qz-jump { display: block; }
  .qz-nav {
    position: sticky; bottom: 0; z-index: 10;
    margin: 1rem calc(-1 * var(--main-pad, 1rem)) 0; padding: 0.75rem var(--main-pad, 1rem) calc(0.75rem + env(safe-area-inset-bottom));
    background: var(--cream); border-top: 1px solid var(--line-2);
  }
  .qz-nav .btn { flex: 1 1 0; min-width: 0; }
  .qo-row { gap: 0.4rem; padding-left: 0.5rem; }
  .qo-num { flex-basis: 1rem; }
  .qo-grip { width: 22px; }
  .qo-moves { flex-direction: column; gap: 0.25rem; }
  .qo-move { height: 40px; }
}
/* The footer (disclaimer) shows on the start and review screens only */
body.qz-on-question .staff-main__footer { display: none; }

.quiz-error {
  background: var(--clay-soft);
  border: 1px solid var(--clay-line);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  color: var(--clay);
}

.quiz-actions { margin-top: 2rem; padding-bottom: 1.5rem; } /* room for the tick's pop and ring: the reveal panel clips its edges */

/* Submit assessment: the button closes up into a green circle and a tick draws in */
#quiz-submit.btn--sending {
  padding: 0;
  min-height: 0;
  box-sizing: border-box;
  overflow: hidden;
  white-space: nowrap;
  cursor: default;
  transition: width 0.42s cubic-bezier(0.65, 0, 0.35, 1),
              padding 0.42s cubic-bezier(0.65, 0, 0.35, 1), background-color var(--dur-3);
}
#quiz-submit.btn--sending .btn__label { opacity: 0; transition: opacity var(--dur-1); }
#quiz-submit.btn--done {
  background: var(--sage); /* the same green as the Download certificate card */
  box-shadow: none;
  animation: submit-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), submit-ring 0.9s ease-out 0.1s;
}
.btn-tick { width: 26px; height: 26px; }
.btn-tick path {
  fill: none;
  stroke: #fff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 22;
  stroke-dashoffset: 22;
  animation: submit-tick 0.38s cubic-bezier(0.65, 0, 0.35, 1) 0.08s forwards;
}
@keyframes submit-pop { 0% { transform: scale(0.86); } 100% { transform: scale(1); } }
@keyframes submit-ring {
  0%   { box-shadow: 0 0 0 0 var(--sage-line); }
  100% { box-shadow: 0 0 0 16px rgba(46, 107, 99, 0); }
}
@keyframes submit-tick { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  #quiz-submit.btn--sending { transition: none; }
  #quiz-submit.btn--done { animation: none; }
  .btn-tick path { animation: none; stroke-dashoffset: 0; }
}


/* All correct: a teal tick, every part ticked off in turn, then the declaration */
.qz-result { margin-top: 2.5rem; padding: 1.5rem; border: 1px solid rgba(46, 107, 99, 0.35); border-radius: var(--radius); background: rgba(46, 107, 99, 0.06); scroll-margin-top: 1rem; }
.qz-result__head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.1rem; }
.qz-result__badge { flex: 0 0 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: var(--sage); color: var(--paper); box-shadow: 0 0 0 6px rgba(46, 107, 99, 0.14); }
.qz-result__badge svg, .qz-done__num svg { width: 60%; height: 60%; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.qz-result__title { margin: 0; font: 700 1.5rem/1.2 var(--font-heading); color: var(--ink); letter-spacing: -0.015em; }
.qz-result__lead { margin: 0.2rem 0 0; color: var(--ink-2); }
.qz-done { margin-bottom: 1rem; border-top-color: rgba(46, 107, 99, 0.2); }
.qz-done__row { border-bottom-color: rgba(46, 107, 99, 0.2); }
.qz-done__num { background: var(--sage); border-color: var(--sage); color: var(--paper); }
.qz-done__num svg { width: 62%; height: 62%; }
.qz-result__next { margin: 0; font-weight: 600; color: var(--ink); }
.precert-reveal--open .qz-result__badge { animation: done-pop 520ms 200ms cubic-bezier(0.2, 1.5, 0.4, 1) backwards; }
.precert-reveal--open .qz-result__badge path { stroke-dasharray: 22; stroke-dashoffset: 22; animation: done-draw 420ms 450ms ease-out forwards; }
.precert-reveal--open .qz-done__row { animation: rise-in var(--dur-3) var(--ease-out) backwards; animation-delay: calc(500ms + var(--i, 0) * 90ms); }
.precert-reveal--open .qz-done__num { animation: done-pop 420ms cubic-bezier(0.2, 1.5, 0.4, 1) backwards; animation-delay: calc(560ms + var(--i, 0) * 90ms); }
@media (prefers-reduced-motion: reduce) {
  .precert-reveal--open .qz-result__badge, .precert-reveal--open .qz-done__row, .precert-reveal--open .qz-done__num { animation: none; }
  .precert-reveal--open .qz-result__badge path { animation: none; stroke-dashoffset: 0; }
}
.qz-result + .precert-section { margin-top: 1.25rem; }
@media (max-width: 640px) {
  .qz-result { padding: 1.1rem; }
  .qz-result__badge { flex-basis: 44px; height: 44px; }
  .qz-result__title { font-size: 1.3rem; }
}

.quiz-check-actions { margin-top: 1.75rem; }
.quiz-check-result {
  margin-top: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: var(--clay-soft);
  border: 1px solid var(--clay-line);
  color: var(--clay);
}

/* Everything after "Check answers" — acknowledgement, name, signature, final
   submit — stays collapsed until the check comes back all-correct. Same
   slide-open technique as the module scenario reveal. */
.precert-reveal {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  margin-top: 1.75rem;
  transition: grid-template-rows 900ms cubic-bezier(0.22, 0.7, 0.2, 1),
              opacity 700ms var(--ease-out) var(--dur-1);
}
.precert-reveal--open { grid-template-rows: 1fr; opacity: 1; }
.precert-reveal__inner { overflow: hidden; min-height: 0; padding: 0 20px; margin: 0 -20px; } /* clipping room either side for the submit tick's ring */
@media (prefers-reduced-motion: reduce) {
  .precert-reveal { transition: none; }
}

/* Small celebratory burst on an all-correct check — brand colors, brief, and
   skipped entirely for reduced-motion. */
.confetti-piece {
  position: fixed;
  top: -24px; left: 0;
  width: 12px;
  height: 20px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 80;
  opacity: 0.95;
  animation: confetti-fall 2.6s cubic-bezier(0.35, 0, 0.65, 1) forwards;
}
@keyframes confetti-fall {
  0%   { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translate(var(--confetti-x, 0), var(--confetti-y, 100vh)) rotate(var(--confetti-r, 480deg)); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .confetti-piece { display: none; }
}

/* ─── Pre-cert section ───────────────────────────────────────────────────────── */
.precert-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-top: 2.5rem;
  background: var(--paper-2);
}
.precert-title {
  margin: 0 0 1.25rem;
  font-size: 1.35rem;
  color: var(--ink);
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.015em;
}

.precert-acknowledgement {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.2rem;
  margin-bottom: 1.5rem;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--ink-2);
  transition: border-color var(--dur-2), box-shadow var(--dur-2);
}
.precert-acknowledgement p { margin: 0; color: var(--ink-2); }
.precert-acknowledgement p + p { margin-top: 0.5rem; }

/* Draws the eye when "Begin training" is pressed with the box unticked. */
.precert-acknowledgement--alert {
  border-color: var(--wrong);
  box-shadow: 0 0 0 4px var(--wrong-soft);
  animation: ack-alert-pulse 0.5s ease-in-out 2;
}
@keyframes ack-alert-pulse {
  0%, 100% { background: var(--paper); }
  50%      { background: var(--wrong-soft); }
}
@media (prefers-reduced-motion: reduce) {
  .precert-acknowledgement--alert { animation: none; }
}

.precert-ack-check {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.precert-ack-check input[type="checkbox"] {
  flex-shrink: 0;
  width: 20px; height: 20px;
  accent-color: var(--ink);
  cursor: pointer;
}
.precert-ack-check span { line-height: 1.4; }
.precert-field { margin-bottom: 1.35rem; }

.precert-name-display {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--cream-2);
  font-size: 0.98rem;
  color: var(--ink);
}
.precert-name-display span { flex: 1 1 auto; font-weight: 500; }
.precert-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--ink-mid);
  margin-bottom: 0.5rem;
}
.precert-input {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.98rem;
  color: var(--ink);
  background: var(--paper);
  box-sizing: border-box;
  transition: border-color var(--dur-1), box-shadow var(--dur-1);
}
.precert-input:focus {
  outline: none;
  border-color: var(--amber-hover);
  box-shadow: 0 0 0 4px var(--amber-glow);
}

.precert-name-edit {
  display: flex;
  align-items: stretch;
  gap: 0.6rem;
}
.precert-name-edit .precert-input { flex: 1 1 auto; min-width: 0; }
.btn--small {
  min-height: auto;
  margin-top: 0;
  padding: 0 1.25rem;
  flex-shrink: 0;
}

/* ─── Signature pad ──────────────────────────────────────────────────────────── */
.sig-pad-wrap { margin-top: 0.25rem; }
.sig-pad-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--ink-mid);
  margin-bottom: 0.5rem;
  display: block;
}
.sig-pad-canvas-wrap {
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: #fff;
  overflow: hidden;
  position: relative;
  touch-action: none;
}
#sig-canvas {
  display: block;
  width: 100%; max-width: 400px;
  height: auto; aspect-ratio: 400 / 150; /* shrinks evenly on narrow phones */
  touch-action: none;
  cursor: crosshair;
}
.sig-pad-hint {
  position: absolute; bottom: 0.6rem; left: 50%;
  transform: translateX(-50%);
  font-size: 0.78rem; color: var(--ink-faint);
  pointer-events: none; margin: 0; white-space: nowrap;
}
.sig-pad-canvas-wrap--locked #sig-canvas { opacity: 0.3; }
.sig-pad-lock {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.25rem;
  text-align: center;
  background: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-mid);
}
.sig-clear { margin-top: 0.5rem; font-size: 0.85rem; }
.link-btn:disabled, .link-small:disabled { color: var(--ink-faint); cursor: not-allowed; text-decoration: none; }

/* ─── Verify page ────────────────────────────────────────────────────────────── */
.verify-page { max-width: 640px; margin: 2rem auto; padding: 0 1.25rem; }


.verify-header { margin-bottom: 1.75rem; }

.verify-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--sage-soft);
  color: var(--sage);
  border: 1px solid var(--sage-line);
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.95rem;
  font-size: 0.72rem;
  font-weight: 600;
  margin-bottom: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

.verify-title { margin: 0; font-size: 1.85rem; }

.verify-details { margin: 0 0 1.75rem; padding: 0; }

.verify-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.verify-row dt { color: var(--ink-mid); flex-shrink: 0; font-weight: 400; }
.verify-row dd { margin: 0; text-align: right; font-weight: 500; word-break: break-all; color: var(--ink); }
.verify-record-id { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.85rem; color: var(--ink-mid); }

.verify-disclaimer {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1.15rem 1.25rem;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--ink-mid);
}
.verify-disclaimer-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--ink-mid);
  margin: 0 0 0.6rem;
  display: block;
}
.verify-disclaimer p { margin: 0; color: var(--ink-mid); }
.verify-disclaimer p + p { margin-top: 0.5rem; }

/* ─── Manager dashboard ──────────────────────────────────────────────────────── */
.manager-page { max-width: 1440px; margin: 0 auto; padding: 2.5rem clamp(1.5rem, 4vw, 3.5rem) 5rem; }

.manager-back {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.9rem; font-weight: 500;
  color: var(--ink-mid); text-decoration: none; margin-bottom: 1.25rem;
  transition: color var(--dur-1);
}
.manager-back:hover { color: var(--ink); }

.manager-header { margin-bottom: 2.5rem; }
.manager-header__venue { margin: 0 0 0.3rem; font-size: 2.4rem; letter-spacing: -0.025em; }
.manager-header__course { margin: 0; color: var(--ink-mid); font-size: 1rem; }

/* Staff table */
.staff-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 2.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}
.staff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  white-space: nowrap;
}
.staff-table th {
  text-align: left;
  padding: 0.85rem 1.1rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--ink-mid);
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}
.staff-table td {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  vertical-align: middle;
}
.staff-table tbody tr:last-child td { border-bottom: none; }
.staff-table tbody tr:hover { background: var(--paper-2); }
.staff-table__name { font-weight: 500; white-space: normal; min-width: 140px; color: var(--ink); }
.num-cell  { text-align: center; color: var(--ink-mid); font-variant-numeric: tabular-nums; }
.date-cell { color: var(--ink-mid); font-variant-numeric: tabular-nums; }
.record-id-cell { color: var(--ink-mid); font-size: 0.82rem; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; user-select: all; }
.record-id--long { display: inline-block; max-width: 9.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; cursor: help; }
.muted     { color: var(--ink-dim); }

/* Header cells inherit table-scoped text-align: left by default, which visually
   misaligns numeric columns from their centered data cells. Match them up. */
.staff-table th.num-cell,
.op-table    th.num-cell { text-align: center; }

/* Empty state */


.code-display {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  color: var(--amber-hover);
  font-weight: 600;
}
/* ─── Copy button ────────────────────────────────────────────────────────────── */
/* "Copied" floats at the top of the screen (public/js/copy.js); the button itself stays put */
.code-with-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  min-height: 0;
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink-mid);
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color var(--dur-1), border-color var(--dur-1), background var(--dur-1), transform var(--dur-1);
}

.copy-btn svg { display: block; }
.copy-btn__label { line-height: 1; display: inline-block; }

.copy-btn:hover {
  color: var(--ink);
  border-color: var(--ink);
  background: var(--paper-2);
}

.copy-btn:active { transform: scale(0.96); }

.copy-btn:focus-visible {
  outline: 2px solid var(--amber-hover);
  outline-offset: 2px;
}

.venue-row--expired .copy-btn { opacity: 0.6; }

.manager-downloads__actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* ─── Staff training shell (sidebar + main) ──────────────────────────────────── */
.staff-shell { display: flex; min-height: 100dvh; align-items: stretch; }

.staff-sidebar {
  width: 320px;
  flex-shrink: 0;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid rgba(251,249,242,0.08);
}

.staff-sidebar__header {
  display: block;
  padding: 1.75rem 1.5rem 1.5rem;
  color: var(--paper);
  text-decoration: none;
  text-align: center;
  border-bottom: 1px solid rgba(251,249,242,0.08);
  transition: background var(--dur-1);
}
.staff-sidebar__header:hover { background: rgba(251,249,242,0.04); color: var(--paper); }
.staff-sidebar__header--active { background: rgba(251,249,242,0.04); }

.staff-sidebar__logo {
  height: 110px;
  width: auto;
  display: block;
  margin: 0 auto 1.25rem;
}

.staff-sidebar__title {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  color: var(--paper);
}

.staff-sidebar__progress {
  width: 100%;
  height: 4px;
  background: rgba(251,249,242,0.12);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 0.55rem;
}
.staff-sidebar__progress-fill {
  height: 100%;
  background: var(--amber);
  border-radius: var(--radius-pill);
  transition: width var(--dur-4) var(--ease-out);
}
.staff-sidebar__progress-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(251,249,242,0.65);
}

.staff-nav {
  flex: 1;
  padding: 1.25rem 0 1.5rem;
}
.staff-nav__section-title {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  font-variant-caps: all-small-caps;
  color: rgba(251,249,242,0.42);
  padding: 0.75rem 1.5rem 0.5rem;
}
.staff-nav__section-title--divider {
  margin-top: 0.5rem;
  border-top: 1px solid rgba(251,249,242,0.08);
  padding-top: 1.1rem;
}
.staff-nav__list { list-style: none; padding: 0; margin: 0; }

.staff-nav__item { margin: 0; }

.staff-nav__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
  padding: 0.7rem 1.5rem;
  text-decoration: none;
  color: rgba(251,249,242,0.78);
  font-size: 0.875rem;
  line-height: 1.35;
  border-left: 3px solid transparent;
  transition: background var(--dur-1), color var(--dur-1), border-color var(--dur-1);
}
.staff-nav__link:hover { background: rgba(251,249,242,0.05); color: var(--paper); }

.staff-nav__icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: rgba(251,249,242,0.5);
}
.staff-nav__label { flex: 1; }

.staff-nav__item--complete .staff-nav__icon { color: var(--sage); }
.staff-nav__item--complete .staff-nav__link { color: rgba(251,249,242,0.72); }

.staff-nav__item--in-progress .staff-nav__icon { color: var(--amber); }
.staff-nav__item--in-progress .staff-nav__link { color: var(--paper); }

.staff-nav__item--available .staff-nav__icon { color: rgba(251,249,242,0.7); }

.staff-nav__item--locked .staff-nav__link {
  color: rgba(251,249,242,0.32);
  cursor: not-allowed;
  text-decoration: none;
}
.staff-nav__item--locked .staff-nav__link:hover { background: transparent; color: rgba(251,249,242,0.32); }
/* Passed: the assessment is a status, not a link, so it doesn't light up like one */
.staff-nav__item--locked .staff-nav__icon { color: rgba(251,249,242,0.28); }

.staff-nav__item--active > .staff-nav__link {
  background: rgba(239,182,58,0.14);
  color: var(--paper);
  border-left-color: var(--amber);
}
.staff-nav__item--active > .staff-nav__link:hover { background: rgba(239,182,58,0.2); }

.staff-sidebar__footer {
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid rgba(251,249,242,0.08);
}
.staff-sidebar__days {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  color: rgba(251,249,242,0.6);
}
.staff-sidebar__days--warn   { color: var(--amber); }
.staff-sidebar__days--urgent { color: var(--amber); font-weight: 600; } /* amber in the final 14 days (spec 2.3), bolder on the last */

.staff-sidebar__exit {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(251,249,242,0.72);
  text-decoration: none;
  min-height: 44px;
  padding: 0.5rem 0.85rem;
  border: 1px solid rgba(251,249,242,0.18);
  border-radius: var(--radius-pill);
  transition: color var(--dur-1), background var(--dur-1), border-color var(--dur-1);
}
.staff-sidebar__exit:hover {
  color: var(--paper);
  background: rgba(251,249,242,0.08);
  border-color: rgba(251,249,242,0.32);
}

.staff-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  --main-pad: clamp(1.5rem, 4vw, 3rem);
  container-type: inline-size;   /* lets the scenario scene span the full main width */
  padding: 2.25rem var(--main-pad) 1.5rem;
}
.staff-main__inner {
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

.staff-main__footer {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.staff-main__footer p {
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--ink-mid);
  text-align: center;
  margin: 0;
}

/* Reset any inner constraints from legacy per-page CSS so the shell owns width. */
.staff-main__inner > .overview,
.staff-main__inner > .module-page,
.staff-main__inner > .quiz-page {
  max-width: none;
  margin: 0;
  padding: 0;
}

/* Short fade+lift on each navigation between staff pages. Modern browsers also
   get a native cross-document crossfade via @view-transition below. */
.staff-main__inner > .overview,
.staff-main__inner > .module-page,
.staff-main__inner > .quiz-page {
  animation: staff-page-enter 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes staff-page-enter {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .staff-main__inner > * { animation: none; }
}

/* Cross-document crossfade for browsers that support the View Transitions API. */
@view-transition { navigation: auto; }

.module-who {
  font-size: 0.8rem;
  color: var(--ink-mid);
  margin: 0 0 0.4rem;
  overflow-wrap: anywhere;
}
.module-who strong { font-weight: 600; color: var(--ink); }

.module-position {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mid);
  margin: 0 0 0.6rem;
}

/* Phones and narrow tablets: a slim top bar (course, progress, Menu) and the sidebar as a
   drawer from the left (public/js/staff-nav.js) */
.staff-topbar { display: none; }
.staff-sidebar__close { display: none; }
@media (max-width: 900px) {
  .staff-shell { flex-direction: column; }
  .staff-topbar {
    display: flex; align-items: center; gap: 0.75rem; min-height: 56px;
    padding: calc(0.5rem + env(safe-area-inset-top)) 16px 0.5rem;
    background: var(--ink); color: var(--paper);
  }
  .staff-topbar__home { display: flex; align-items: center; gap: 0.6rem; min-width: 0; flex: 1 1 auto; color: var(--paper); text-decoration: none; min-height: 44px; }
  .staff-topbar__logo { height: 30px; width: auto; flex-shrink: 0; }
  .staff-topbar__title { font-family: var(--font-heading); font-size: 1rem; font-weight: 700; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .staff-topbar__pct { flex-shrink: 0; font-size: 0.8rem; font-weight: 600; color: var(--amber); }
  .staff-topbar__menu {
    flex-shrink: 0; display: inline-flex; align-items: center; gap: 0.45rem; min-height: 44px; padding: 0 0.85rem;
    border: 1px solid rgba(251,249,242,0.25); border-radius: var(--radius-pill); background: none; color: var(--paper);
    font: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer;
  }
  .staff-topbar__menu:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
  .staff-topbar__bars, .staff-topbar__bars::before, .staff-topbar__bars::after { display: block; width: 14px; height: 2px; border-radius: 1px; background: currentColor; }
  .staff-topbar__bars { position: relative; }
  .staff-topbar__bars::before, .staff-topbar__bars::after { content: ''; position: absolute; left: 0; }
  .staff-topbar__bars::before { top: -5px; }
  .staff-topbar__bars::after { top: 5px; }
  .staff-sidebar {
    position: fixed; z-index: 60; top: 0; bottom: 0; left: 0;
    width: min(320px, 86vw); height: auto; max-height: none;
    transform: translateX(-100%); visibility: hidden;
    transition: transform var(--dur-2) var(--ease-out), visibility 0s linear var(--dur-2);
  }
  .staff-shell.is-nav-open .staff-sidebar { transform: none; visibility: visible; transition: transform var(--dur-2) var(--ease-out); }
  .staff-drawer-backdrop { position: fixed; inset: 0; z-index: 59; background: rgba(29,29,29, 0.45); }
  .staff-sidebar__close {
    display: flex; align-items: center; justify-content: center; position: absolute; top: 8px; right: 8px; z-index: 1;
    width: 44px; height: 44px; border: 0; border-radius: var(--radius-pill); background: rgba(251,249,242,0.08);
    color: var(--paper); font-size: 1.6rem; line-height: 1; cursor: pointer;
  }
  .staff-sidebar__close:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
  body.staff-nav-open { overflow: hidden; }
  .staff-main { --main-pad: 1rem; padding: 1.25rem var(--main-pad) 3rem; }
}
@media (max-width: 900px) and (prefers-reduced-motion: reduce) {
  .staff-sidebar, .staff-shell.is-nav-open .staff-sidebar { transition: none; }
}

/* The open drawer is on top of everything: the Practice scenario bar (which lives on <body>,
   outside the drawer's layer) steps out of the way until it closes */
body.staff-nav-open .scenario-bar { visibility: hidden; transition: none; }

/* Phones with a notch or a home bar (staff pages fill the whole screen, viewport-fit=cover:
   views/layout.js). The content keeps clear of the notch on either side in landscape; the
   drawer, the Practice scenario bar and the quiz's bottom bar keep clear of the home bar. */
.page-staff .staff-shell { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
.staff-sidebar { padding-bottom: env(safe-area-inset-bottom); } /* the desktop sidebar too: a large phone on its side */
@media (max-width: 900px) {
  .staff-sidebar { padding-left: env(safe-area-inset-left); padding-top: env(safe-area-inset-top); }
  .staff-sidebar__close { top: calc(8px + env(safe-area-inset-top)); }
  .scenario-bar { padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right)); }
}

/* Short landscape screens (a phone on its side): the video, and the scenario with its
   controls, are sized to the screen's height so the whole player fits on it when scrolled
   to, instead of the usual 820px floor, which would run its controls off the bottom. The
   Practice scenario bar slims down to one line so it covers less. */
@media (orientation: landscape) and (max-height: 540px) {
  .staff-main__inner > .module-page:not(.module-page--intro) {
    max-width: calc((100dvh - 1.5rem - 52px) * 16 / 9); /* 52px: the slim scenario bar, clear of the controls */
  }
  .scenario-scene__inner {
    max-width: calc((100dvh - 1.5rem) * 16 / 9 + 2 * var(--scene-pad));
    padding-top: 0.75rem; padding-bottom: 0.75rem;
  }
  .scenario-scene__inner--page {
    /* the picture, plus the page's controls under it (about 86px with the frame's padding), the
       status line under the frame (about 37px) and the scene's own padding: all on one screen */
    max-width: calc((100dvh - 150px) * 16 / 9 + 2 * var(--scene-pad));
  }
  .scenario-bar { flex-direction: row; justify-content: center; gap: 0.75rem; min-height: 52px; padding-top: 0.45rem; padding-bottom: calc(0.45rem + env(safe-area-inset-bottom)); }
  .scenario-bar__arrow { width: 32px; height: 32px; }
  body.has-scenario-bar .staff-main { padding-bottom: 5rem; }
}

/* ─── Operator console ───────────────────────────────────────────────────────── */
.op-console { display: flex; flex-direction: column; min-height: 100vh; }

/* Transparent header strip on cream — the logo, brand label, search, and logout
   float as elements on the cream page rather than a chrome bar. */
.op-topbar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem clamp(1.5rem, 4vw, 3.5rem) 0.5rem;
  background: transparent;
  border: none;
  flex-wrap: wrap;
}

.op-logo-link {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  margin-right: auto;
  transition: opacity var(--dur-1);
}
.op-logo-link:hover { opacity: 0.85; }
.op-logo {
  height: 84px;
  width: auto;
  display: block;
}
.op-search-form { display: flex; gap: 0.5rem; flex: 1 1 220px; max-width: 360px; }

.op-search-input {
  flex: 1;
  /* Same look as the form fields (.precert-input) */
  padding: 0.6rem 1rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  min-width: 0;
  transition: border-color var(--dur-1), box-shadow var(--dur-1);
}
.op-search-input::placeholder { color: var(--ink-mid); }
.op-search-input:focus {
  outline: none;
  border-color: var(--amber-hover);
  box-shadow: 0 0 0 4px var(--amber-glow);
}

.op-logout {
  font-size: 0.9rem;
  color: var(--ink-mid);
  text-decoration: none;
  white-space: nowrap;
  font-weight: 500;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-pill);
  transition: color var(--dur-1), background var(--dur-1);
}
.op-logout:hover {
  color: var(--ink);
  background: rgba(29,29,29,0.06);
}

.op-content { flex: 1; }

/* Destructive per-row cancel — subtle by default, clay on hover. */
.op-cancel-form { margin: 0; padding: 0; }
.op-cell-action { width: 1%; white-space: nowrap; text-align: right; }
.btn-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-mid);
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color var(--dur-1), background var(--dur-1), border-color var(--dur-1);
}
.btn-cancel:hover {
  color: var(--clay);
  border-color: var(--clay-line);
  background: var(--clay-soft);
}
.btn-cancel:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 2px;
}

/* Page */
.op-page { max-width: none; margin: 0; padding: 2.5rem clamp(1.5rem, 4vw, 3.5rem) 5rem; }
.op-page-title {
  margin: 0 0 1.5rem;
  overflow-wrap: anywhere;
  font-size: 2.2rem;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.op-back {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.9rem; font-weight: 500;
  color: var(--ink-mid); text-decoration: none; margin-bottom: 1rem;
  transition: color var(--dur-1);
}
.op-back:hover { color: var(--ink); }

/* Venue header */
.op-venue-meta { color: var(--ink-mid); font-size: 0.9rem; margin: 0.25rem 0 0; }

/* Stat strip (All venues): plain figures, nothing to press */
.op-stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 1.5rem; padding: 1.1rem 0;
  border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2);
}
.op-stat { display: flex; flex-direction: column; gap: 0.2rem; padding: 0 1.25rem; border-left: 1px solid var(--line); }
.op-stat:first-child { padding-left: 0; border-left: none; }
.op-stat__num {
  font-family: var(--font-heading); font-size: 2.1rem; font-weight: 700; line-height: 1;
  letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums;
}
.op-stat__label { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.11em; text-transform: uppercase; color: var(--ink-mid); }
@media (max-width: 640px) {
  .op-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 1rem; }
  .op-stat__num { font-size: 1.45rem; white-space: nowrap; }
  .op-stat:nth-child(3) { padding-left: 0; border-left: none; }
}
/* Weekly backup reminder + download button (beside Needs attention on All venues) */
.op-backup {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem 1.25rem; flex-wrap: wrap;
  padding: 0.7rem 0.9rem 0.7rem 1.1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.88rem;
  color: var(--ink-2);
}
.op-backup p { margin: 0; flex: 1 1 18rem; }
.op-backup--due { background: var(--clay-soft); border-color: var(--clay-line); }
.op-backup--due strong { color: var(--clay); }
.op-backup__btn { flex-shrink: 0; }
/* Site status, the last figure on the Dashboard (views/operator.js siteStatusFigure) */
.op-stats--home { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.op-stat--site .op-stat__num { color: var(--sage); }
.op-site__mark { margin-right: 0.3em; }
.op-stat--site.is-down .op-stat__num, .op-stat--site.is-down .op-when { color: var(--clay); }
/* A small link with a 44px tap area that doesn't make the figure any taller */
.op-site__link { display: inline-block; padding: 0.75rem 0; margin: -0.75rem 0 -0.75rem 0.4rem; color: var(--ink-2); text-transform: none; letter-spacing: 0; font-weight: 500; }
@media (max-width: 640px) {
  .op-stats--home { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .op-stats--home .op-stat--site { grid-column: 1 / -1; padding-left: 0; border-left: none; }
}

/* Tables */
.op-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 0.25rem;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}
.op-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  white-space: nowrap;
}
.op-table th {
  text-align: left;
  padding: 0.75rem 1.1rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--ink-mid);
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}
.op-table td {
  padding: 0.75rem 1.1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  color: var(--ink-2);
}
.op-table tbody tr:last-child td { border-bottom: none; }
.op-table tbody tr:hover { background: var(--paper-2); }

.op-cell-sm { color: var(--ink-mid); font-variant-numeric: tabular-nums; }
.op-venue-link {
  font-weight: 500;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(29,29,29,0.15);
}
.op-venue-link:hover { color: var(--amber-hover); text-decoration-color: var(--amber); }

.venue-row--expired td { opacity: 0.5; }
.op-expired { background: var(--cream-2); color: var(--ink-dim); border-color: var(--line-2); }

/* Two-col layout */
.op-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.15rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 760px) { .op-two-col { grid-template-columns: 1fr; } }

/* Sections */
.op-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  background: var(--paper);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.op-section-title {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.op-section-note { color: var(--ink-mid); font-size: 0.85rem; margin: -0.6rem 0 0.85rem; }

/* Activity log (views/activity.js): the Activity page and each venue's Activity card.
   Fixed columns, so every description starts at the same place: time, venue (the page only),
   category, description. Risky events get an amber dot by the time — never red. */
.op-activity__list { list-style: none; margin: 0; padding: 0; }
.op-activity__more { margin-top: 0.85rem; }
.op-activity__empty { margin: 0; }
.act-list { list-style: none; margin: 0; padding: 0; }
.act-row {
  display: grid; grid-template-columns: 4.75rem 180px 6.75rem minmax(0, 1fr); align-items: baseline; gap: 0.25rem 1rem;
  padding: 0.6rem 0; border-top: 1px solid var(--line); font-size: 0.92rem;
}
.act-list--card .act-row { grid-template-columns: 9.5rem 6.75rem minmax(0, 1fr); }
.act-list > .act-row:first-child { border-top: none; }
.act-time { position: relative; color: var(--ink-mid); font-size: 0.82rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.act-dot { position: absolute; left: -0.85rem; top: 0.45em; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.act-venue { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--ink); text-decoration: none; }
a.act-venue:hover { text-decoration: underline; text-decoration-color: var(--amber); text-underline-offset: 3px; }
.act-venue--site { color: var(--ink-mid); font-weight: 400; }
.act-cat {
  justify-self: start; white-space: nowrap; padding: 0.1rem 0.5rem; border-radius: var(--radius-pill); background: var(--cream-2);
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em; color: var(--ink-2);
}
.act-desc { min-width: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.act-code { font-size: 0.86rem; text-decoration: none; }
a.act-code:hover { text-decoration: underline; text-underline-offset: 3px; }
.act-date { font-weight: 600; color: var(--ink); }
.act-old { color: var(--ink-mid); }
.act-group { display: inline; margin-left: 0.4rem; }
.act-group summary { display: inline; cursor: pointer; font-size: 0.8rem; color: var(--ink-mid); }
.act-group summary::marker { content: '▸ '; }
.act-group[open] summary::marker { content: '▾ '; }
.act-group__list { list-style: none; margin: 0.4rem 0 0.1rem; padding: 0 0 0 0.75rem; border-left: 2px solid var(--cream-2); }
.act-group__list li { display: flex; gap: 0.75rem; padding: 0.15rem 0; font-size: 0.85rem; }
.act-group__list time { flex: 0 0 auto; color: var(--ink-mid); font-variant-numeric: tabular-nums; }

/* The Activity page */
.act-intro { margin: -1rem 0 1.25rem; }
.act-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem 1rem; margin-bottom: 0.75rem; }
.act-filters__head, .act-filters-open { display: none; }
.act-field { display: flex; flex-direction: column; gap: 0.3rem; margin: 0; }
.act-field > span, .act-chips legend {
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-mid);
}
.act-field select, .act-field input {
  font: inherit; font-size: 0.88rem; padding: 0 0.65rem; height: 2.5rem; box-sizing: border-box;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--paper); color: var(--ink);
}
.act-field select { max-width: 15rem; cursor: pointer; }
.act-search input { width: 16rem; }
.act-custom { display: flex; gap: 0.75rem; }
.act-custom[hidden] { display: none; }
/* Category: a row of chips. Each one adds its category; All clears them. */
.act-chips { flex-basis: 100%; order: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: 0.15rem 0 0; padding: 0; border: none; min-width: 0; }
.act-chips legend { float: left; margin-right: 0.5rem; padding: 0; }
.act-chip {
  display: inline-flex; align-items: center; height: 2rem; padding: 0 0.85rem; margin: 0; border-radius: var(--radius-pill); cursor: pointer;
  border: 1px solid var(--line-2); background: var(--paper); color: var(--ink-2);
  font: inherit; font-size: 0.82rem; font-weight: 500; letter-spacing: 0; text-transform: none;
  transition: background var(--dur-1), color var(--dur-1), border-color var(--dur-1);
}
.act-chip:hover { border-color: var(--ink); color: var(--ink); }
.act-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.act-chip:has(input:checked) { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.act-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--cream); } /* its own rule: a list with :has() is dropped whole where :has() is unknown */
.act-chip:has(input:focus-visible) { outline: 2px solid var(--amber-hover); outline-offset: 2px; }
.act-chip:focus-visible { outline: 2px solid var(--amber-hover); outline-offset: 2px; } /* its own rule: a list with :has() is dropped whole where :has() is unknown */
.act-export { margin-left: auto; margin-top: 0; }
.act-summary { display: flex; align-items: center; gap: 0.5rem 1.25rem; flex-wrap: wrap; margin-bottom: 0.75rem; font-size: 0.88rem; }
.act-count { font-weight: 600; color: var(--ink); }
.act-sort { margin-left: auto; font-weight: 500; }
.act-log { padding-top: 0.5rem; }
/* Each day is its own block, its heading staying in view while its rows scroll */
.act-day + .act-day { margin-top: 1.1rem; }
.act-day__head {
  position: sticky; top: 0; z-index: 2; margin: 0; padding: 0.55rem 0 0.4rem; background: var(--paper);
  font-family: var(--font-body); font-size: 0.72rem; font-weight: 600; font-variant: small-caps; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-mid);
}
.act-empty { padding: 1.5rem 0; text-align: center; color: var(--ink-mid); }
.act-empty p { margin: 0 0 0.75rem; }
.act-more { display: block; margin: 1rem auto 0.25rem; }
.act-more[hidden] { display: none; }

/* Phones: two lines a row; the filters open as a sheet from the bottom */
@media (max-width: 640px) {
  .act-row, .act-list--card .act-row { grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.2rem 0.6rem; }
  .act-desc { grid-column: 1 / -1; }
  .act-list--card .act-cat { justify-self: end; }
  .act-filters-open { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 44px; margin: 0 0 0.75rem; }
  .act-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 1.3rem; height: 1.3rem; padding: 0 0.3rem; border-radius: var(--radius-pill); background: var(--ink); color: var(--cream); font-size: 0.72rem; }
  .act-badge[hidden] { display: none; }
  .act-filters { display: none; }
  .act-filters.is-open {
    display: flex; flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 0.85rem;
    position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; max-height: 85dvh; overflow-y: auto; margin: 0;
    padding: 1rem 1rem calc(1.25rem + env(safe-area-inset-bottom)); background: var(--paper);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: 0 0 0 100vmax rgba(29,29,29,0.35); /* dims the page behind; part of the sheet, so never on top of it */
  }
  .act-filters.is-open .act-filters__head { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
  .act-field select, .act-field input { height: 44px; max-width: none; width: 100%; }
  .act-search input { width: 100%; }
  .act-custom { flex-direction: column; }
  .act-chips legend { float: none; width: 100%; margin: 0 0 0.3rem; }
  .act-export { margin-left: 0; min-height: 44px; }
  .act-chip { height: 44px; padding: 0 1rem; }
}

/* Course check */

/* Needs attention (console home): one row per kind of alert, naming every venue it applies
   to, with its action on the right. Only there when something needs doing. */
.op-attention__note { color: var(--ink-mid); font-size: 0.88em; }
.op-attention__list { list-style: none; margin: 0; padding: 0; }
.op-attention__item {
  display: flex; align-items: baseline; gap: 0.4rem 1rem; flex-wrap: wrap;
  padding: 0.7rem 0; border-top: 1px solid var(--line);
}
.op-attention__item:first-child { border-top: none; padding-top: 0; }
.op-attention__kind {
  flex: 0 0 8.5rem;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.11em; text-transform: uppercase; color: var(--ink-mid);
}
.op-attention__item--email-broken .op-attention__kind,
.op-attention__item--course-broken .op-attention__kind,
.op-attention__item--email-failed .op-attention__kind,
.op-attention__item--email-bounced .op-attention__kind,
.op-attention__item--backup-due .op-attention__kind { color: var(--refuse); }
.op-attention__item--ending .op-attention__kind,
.op-attention__item--low-completion .op-attention__kind { color: var(--amber-dark); }
.op-attention__what { flex: 1 1 18rem; min-width: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.op-attention__go { flex-shrink: 0; margin-left: auto; font-size: 0.85rem; color: var(--ink); font-weight: 500; white-space: nowrap; }
.op-attention__dismiss { flex-shrink: 0; margin: 0 0 0 auto; align-self: center; }
.op-attention__go + .op-attention__dismiss { margin-left: 0.25rem; }
.op-attention__dismiss .btn { margin-top: 0; color: var(--ink-mid); }
.op-attention__dismiss .btn:hover { color: var(--ink); }
@media (max-width: 640px) { .op-attention__kind { flex-basis: 100%; } }

/* New venue (a dialog opened from + New venue) */
.op-new-venue-field { display: flex; flex-direction: column; margin-top: 1rem; }
.op-required { color: var(--clay); }
@media (max-width: 480px) {
  .precert-name-edit { flex-direction: column; }
  .btn--small { width: 100%; }
}

/* Code issuance form */
.op-issue-form__row { display: flex; gap: 0.85rem; align-items: flex-end; flex-wrap: wrap; }
.op-days-input { width: 90px; }
.op-issue-form__submit { display: flex; flex-direction: column; }

/* A venue's page. Wide: staff progress and staff codes in the main column (two thirds),
   venue details and emails beside them, activity across the bottom. Narrow: one column, in
   the order details, progress, codes, emails, activity (the columns step aside). */
.op-venue-layout { display: flex; flex-direction: column; gap: 1.25rem; margin-bottom: 1.5rem; }
.op-venue-layout__main, .op-venue-layout__side { display: contents; }
.op-venue-layout .op-section { margin: 0; min-width: 0; }
.op-venue-layout .op-agreements { order: 1; }
.op-venue-layout .op-progress-section { order: 2; }
.op-venue-layout .op-codes-section { order: 3; }
.op-venue-layout #venue-details { order: 4; }
.op-venue-layout .op-emails { order: 5; }
.op-venue-layout__activity { order: 6; }
@media (min-width: 1380px) { /* below this the tables would need to scroll in two thirds */
  .op-venue-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
  .op-venue-layout__main, .op-venue-layout__side { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
  /* Short side column: it stays in view while the staff and activity scroll */
  .op-venue-layout__side { position: sticky; top: var(--space-3); }
}

/* Headers: title on the left, the figures (or + New venue) on the right */
.op-home-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; flex-wrap: wrap; margin: 0.5rem 0 1rem; }
.op-venue-header { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.op-stat .op-when { margin-top: 0.15rem; }
.op-home-head .op-page-title { margin: 0; }
.op-venue-header__stats { margin: 0; }
.op-venue-header__main { min-width: 0; }

/* Card headings with their actions on the right (poster, Copy all active codes) */
.op-section-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.op-section-head .op-section-title { margin: 0; }
.op-section-head__actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* "No staff have started yet", with the poster to hand */
.op-empty-state {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem 1.25rem; flex-wrap: wrap;
  padding: 0.9rem 1.1rem; background: var(--paper-2); border: 1px dashed var(--warm-line); border-radius: var(--radius-sm);
}
.op-empty-state p { margin: 0; flex: 1 1 16rem; color: var(--ink-2); font-size: 0.92rem; }

/* Staff codes: one-line expiry, the rest folded away */
.op-codes-section .copy-btn__label { display: none; }
.op-codes-section .copy-btn { padding-left: 0.45rem; padding-right: 0.45rem; }
.op-codes-section .op-issue-form--inline { margin-bottom: 1.1rem; }
.op-cell-expiry { white-space: nowrap; }
.op-code-left { font-size: 0.82rem; color: var(--ink-mid); }
.op-codes__more { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-top: 0.6rem; }

/* Venue details (side column): the manager, their email, their code */
.op-details__list { display: grid; gap: 0.7rem; margin: 0 0 1rem; }
.op-details__list dt { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-mid); }
.op-details__list dd { margin: 0.1rem 0 0; overflow-wrap: anywhere; }
.op-details__warn {
  margin: 0 0 1rem; padding: 0.6rem 0.8rem; font-size: 0.88rem; color: var(--clay);
  background: var(--clay-soft); border: 1px solid var(--clay-line); border-radius: var(--radius-sm);
}
.op-details .op-manager-code { margin: 0; flex-direction: column; align-items: flex-start; gap: 0.55rem; }
.op-details .op-manager-code .op-code-actions { margin-left: 0; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.op-details .op-manager-code .code-with-copy { white-space: nowrap; }
.op-details .op-manager-code .copy-btn__label { display: none; }
.op-details .op-manager-code .copy-btn { padding-left: 0.45rem; padding-right: 0.45rem; }

/* Small text buttons (Add email, Show all) and the disabled-with-a-reason wrapper */
.op-link-btn {
  background: none; border: none; padding: 0; font: inherit; font-size: 0.88rem; font-weight: 600; color: var(--ink);
  text-decoration: underline; text-decoration-color: var(--amber); text-underline-offset: 3px; cursor: pointer;
}
.op-link-btn:hover { text-decoration-thickness: 2px; }
.op-danger-text { color: var(--clay); }
.op-warn-text { color: var(--clay); font-weight: 600; }
.op-disabled-tip { display: inline-block; cursor: not-allowed; }
.op-disabled-tip .btn { pointer-events: none; opacity: 0.45; }

/* All venues: the venue table */
.op-home .op-backup { margin: 1.25rem 0 1.5rem; }
.op-console .op-table .num-cell { text-align: right; }
.op-row-link { cursor: pointer; }
.op-cell-ends { white-space: nowrap; }
.op-when { display: block; font-size: 0.78rem; color: var(--ink-mid); margin-top: 0.1rem; }
.op-when--soon { color: var(--amber-dark); font-weight: 600; }
.op-when--past { color: var(--refuse); font-weight: 600; }
.op-progress { display: inline-flex; align-items: center; gap: 0.6rem; white-space: nowrap; }
.op-progress__bar { width: 4.5rem; height: 6px; border-radius: var(--radius-pill); background: var(--cream-2); overflow: hidden; }
.op-progress__bar > span { display: block; height: 100%; background: var(--pass); border-radius: inherit; }
.op-progress__num { min-width: 3.2rem; text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }

/* A row's ⋯ menu (Archive) */
.op-menu { position: relative; display: inline-block; }
.op-menu__btn {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: var(--radius-pill); font-size: 1.1rem; line-height: 1; color: var(--ink-mid);
  border: 1px solid transparent;
}
.op-menu__btn::-webkit-details-marker { display: none; }
.op-menu__btn:hover, .op-menu[open] .op-menu__btn { color: var(--ink); background: var(--cream-2); border-color: var(--line-2); }
.op-menu__btn:focus-visible { outline: 2px solid var(--amber-hover); outline-offset: 2px; }
/* Opens beside the button, inside its own row, so the table's scroll box never cuts it off */
.op-menu__list {
  position: absolute; right: calc(100% + 6px); top: 50%; transform: translateY(-50%); z-index: 20; min-width: 8rem;
  padding: 0.3rem; background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.op-menu__item {
  display: block; width: 100%; text-align: left; padding: 0.5rem 0.75rem; border: none; background: none;
  font: inherit; font-size: 0.88rem; color: var(--ink); border-radius: var(--radius-xs); cursor: pointer;
}
.op-menu__item:hover, .op-menu__item:focus-visible { background: var(--cream-2); outline: none; }
.op-menu__item--danger:hover, .op-menu__item--danger:focus-visible { color: var(--clay); background: var(--clay-soft); }

.op-venue-layout__side .op-emails__form { max-width: none; }


/* Compact inline issue form — in the header row of the Staff codes section. */
.op-codes-section__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.op-codes-section__header .op-section-title { margin: 0 0 0.4rem; }

.op-issue-form--inline {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0;
}
.op-issue-form__field { display: flex; flex-direction: column; }
.op-issue-form__field label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mid);
  margin: 0 0 0.35rem;
}
.op-issue-form--inline input, .op-issue-form--inline select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.88rem;
  background: var(--paper);
  color: var(--ink);
  min-width: 0;
}
.op-issue-form--inline input[type="text"]   { width: 150px; }
.op-issue-form--inline input[type="number"] { width: 90px; }
.op-issue-form--inline select { min-width: 150px; cursor: pointer; }
.op-issue-form--inline .btn { margin-top: 0; }

/* Email summary textarea */
.email-summary {
  width: 100%;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.85rem;
  line-height: 1.7;
  padding: 1rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  color: var(--ink-2);
  resize: vertical;
  box-sizing: border-box;
}
.email-summary:focus { outline: none; border-color: var(--amber-hover); box-shadow: 0 0 0 3px var(--amber-glow); }

/* Search results */
.op-search-section { margin-bottom: 1.75rem; }
.op-search-section__title {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.015em;
}
.op-search-list {
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}
.op-search-item {
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
  background: transparent;
}
.op-search-item:last-child { border-bottom: none; }
.op-search-item:hover { background: var(--paper-2); }
.op-search-meta { display: block; font-size: 0.83rem; color: var(--ink-mid); margin-top: 0.2rem; }
.text-pass  { color: var(--sage); }
.text-muted { color: var(--ink-mid); }
.op-empty   { color: var(--ink-mid); font-size: 0.92rem; padding: 1.15rem 0; text-align: center; }

/* ─── Motion ─────────────────────────────────────────────────────────────────── */
/* Radio toggles (the console's forms) take the same sliding pill as the button ones */
[data-pill] > label { position: relative; transition: color var(--dur-1) var(--ease-out); }
[data-pill].has-pill > label:has(> input:checked) { background: transparent; }
[data-pill] > label:active { transform: scale(0.96); transition: transform var(--dur-1) var(--ease-out); }
@media (hover: hover) { [data-pill] > label:not(:has(> input:checked)):hover { color: var(--ink); } }

/* Choice cards (a course to add, a staff band, a pill choice): the hover border and a small
   press; the chosen one settles with a spring */
:is(.nv-course, .nv-band, .nv-choice:not(.nv-seg) > label) {
  transition: var(--t-control), border-color var(--dur-1) var(--ease-out), background var(--dur-1) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  :is(.nv-course, .nv-band, .nv-choice:not(.nv-seg) > label):not(:has(input:checked)):not(:has(input:disabled)):hover {
    border-color: var(--ink-dim); box-shadow: var(--shadow-sm);
  }
}
:is(.nv-course, .nv-band, .nv-choice:not(.nv-seg) > label):not(:has(input:disabled)):active { transform: scale(0.985); transition-duration: var(--dur-1); }
:is(.nv-course, .nv-band):has(input:focus-visible) { outline: 2px solid var(--amber-hover); outline-offset: 2px; }
.nv-band:has(input:checked) .nv-band__name { animation: choose-pop var(--dur-2) var(--ease-spring); }
@keyframes choose-pop { 50% { transform: scale(1.04); } }
.nv-band__name { display: inline-block; justify-self: start; transform-origin: left center; }
/* The tick boxes on a line of their own respond too */
.nv-check { transition: color var(--dur-1) var(--ease-out); }
@media (hover: hover) { .nv-check:has(input:not(:disabled)):hover { color: var(--ink); } .nv-check:hover input:not(:disabled) { filter: brightness(1.15); } }

/* A part a choice brings in (a custom price's boxes, the discount, the payer's email) rises
   into place: it plays each time it goes from hidden to shown */
.nv-reveal:not([hidden]) { animation: rise-in var(--dur-3) var(--ease-out); }
.nv-step:not([hidden]) { animation: rise-in var(--dur-3) var(--ease-out) backwards; }
/* A figure in the summary that has just changed ticks over (public/js/op-billing.js) */
.nv-summary strong.is-ticking, .nv-summary s.is-ticking, .nv-band__fig.is-ticking { animation: tick-in var(--dur-2) var(--ease-out); }
@keyframes tick-in { from { opacity: 0.25; transform: translateY(3px); } }
/* …and the venue Emails card's count and Next lines after a switch is saved (public/js/op-emails.js) */
[data-sched] { display: block; }
.op-emails__summary.is-ticking, [data-sched].is-ticking { animation: tick-in var(--dur-2) var(--ease-out); }
.nv-summary strong, .nv-summary s { display: inline-block; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Operator: per-code actions + "Edit expiry" dialog (native <dialog>, centred by the browser) */
.op-code-actions { display: inline-flex; gap: 0.4rem; align-items: center; justify-content: flex-end; }
.btn-expiry:hover { color: var(--ink); border-color: var(--ink); background: rgba(29,29,29,0.04); }
.btn-expiry:focus-visible { outline-color: var(--amber-hover); }

.op-dialog {
  /* The global reset zeroes margins, which un-centres <dialog>; restore it */
  position: fixed;
  inset: 0;
  margin: auto;
  height: fit-content;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  text-align: left;
  white-space: normal;
}
.op-dialog::backdrop { background: rgba(29,29,29,0.45); }
.op-dialog form { padding: 1.5rem 1.5rem 1.25rem; margin: 0; }
.op-dialog__title { margin: 0; font-size: 1.3rem; }
.op-dialog__code { margin: 0.35rem 0 0; font-size: 0.88rem; color: var(--ink-mid); }
/* New venue and Add courses as pop-ups on a computer: wide, the form scrolling under a fixed head,
   Create / Add kept in reach at the bottom (a sticky bar, not fixed: safe inside the dialog) */
.op-dialog--form { width: min(760px, calc(100vw - 48px)); max-height: calc(100vh - 48px); background: var(--cream); }
.op-dialog--form .op-dialog__head {
  position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-4) var(--space-5); background: var(--paper); border-bottom: 1px solid var(--line);
}
.op-dialog__x {
  width: 40px; height: 40px; border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--ink-2);
  font-size: 1.6rem; line-height: 1; cursor: pointer; transition: background var(--dur-1);
}
@media (hover: hover) { .op-dialog__x:hover { background: var(--cream-2); } }
.op-dialog--form form.nv-form { padding: var(--space-4) var(--space-5) 0; }
.op-dialog--form .nv-submit { background: linear-gradient(to top, var(--cream) 75%, transparent); }
/* Who pays on Add courses: shown, with Edit */
.nv-payer__now { margin: 0 0 var(--space-1); }
.nv-edit summary { cursor: pointer; display: inline-block; margin-bottom: var(--space-2); }
.nv-edit[open] summary { margin-bottom: var(--space-3); }

.op-dialog__facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 1.25rem 0 0;
  padding: 0.9rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.op-dialog__facts dt {
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.11em;
  text-transform: uppercase; color: var(--ink-mid);
}
.op-dialog__facts dd { margin: 0.25rem 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }

.op-dialog__adjust { border: 0; margin: 1.1rem 0 0; padding: 0; }
.op-dialog__adjust legend {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.11em;
  text-transform: uppercase; color: var(--ink-mid); padding: 0; margin-bottom: 0.6rem;
}
.op-dialog__direction { display: inline-flex; gap: 1rem; margin-right: 1rem; }
.op-dialog__direction label,
.op-dialog__days {
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin: 0; font-size: 0.92rem; font-weight: 500;
  letter-spacing: 0; text-transform: none; color: var(--ink);
  min-height: 44px;
}
.op-dialog__direction input { accent-color: var(--ink); width: 18px; height: 18px; margin: 0; }
.op-dialog__days input[type="number"] { width: 90px; padding: 0.55rem 0.7rem; display: inline-block; }

.op-dialog__preview { margin: 0.75rem 0 0; font-size: 0.88rem; color: var(--ink-2); min-height: 1.3em; }
.op-dialog__preview--warn { color: var(--clay); }

.op-dialog__actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.25rem; }

/* Operator: "Edit staff name" — button beside the name, two-step dialog */
.op-dialog { font-weight: 400; font-size: 1rem; line-height: 1.5; }
/* Name on the left, Edit name pinned to the column's right edge: the buttons form one neat
   column whatever the name's length. A long name wraps rather than pushing its button along. */
.op-rename label { margin-top: 1.1rem; }
.op-rename__change {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem;
  margin: 1rem 0 0; padding: 0.9rem 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font-size: 1.05rem; overflow-wrap: anywhere;
}
.op-rename__from { color: var(--ink-mid); text-decoration: line-through; }
.op-rename__to { color: var(--ink); }
.op-rename__note { margin: 0.75rem 0 0; font-size: 0.88rem; color: var(--ink-2); }

/* Operator: "Remove" (archive) venue — confirmation dialog + archived list */
.op-remove__venue { margin: 0.5rem 0 0; font-weight: 600; font-size: 1.05rem; overflow-wrap: anywhere; }
.op-remove__list {
  margin: 1rem 0 0; padding: 0.9rem 0 0 1.1rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem; color: var(--ink-2);
}
.op-remove__list li + li { margin-top: 0.4rem; }
.btn--remove { background: var(--clay); color: var(--paper); }
.btn--remove:hover { background: #A84826; }

.op-archived { margin-top: 2.5rem; }
.op-archived summary { cursor: pointer; list-style-position: inside; color: var(--ink-mid); }
.op-archived__note { margin: 0.5rem 0 1rem; font-size: 0.88rem; color: var(--ink-mid); }

.op-archived-banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem;
  background: #E6E3DC; border: 2px solid #8C887F; color: var(--ink); margin-bottom: 1.25rem;
}
.op-archived-banner > span { flex: 1 1 24rem; }
.op-archived-banner strong { display: block; margin-bottom: 0.15rem; }

/* An archived venue's page: everything under the banner greyed out so it can't be mistaken
   for a live venue. Still readable and usable, to find records. Its badge is the muted pill. */
.op-page--archived .op-page-title,
.op-page--archived .op-venue-meta { color: var(--ink-mid); }
.op-page--archived .op-venue-layout {
  filter: grayscale(1); opacity: 0.4; transition: opacity var(--dur-2) var(--ease-out);
}
.op-page--archived .op-venue-layout:hover,
.op-page--archived .op-venue-layout:focus-within { opacity: 0.7; }
.op-page--archived .op-section { background: #EEECE7; }
.op-details-btn:disabled { opacity: 0.45; }
.op-archived-note { font-style: italic; margin: 0; }

/* ─── Email: operator outbox and welcome ─────────────────────────────────────── */
.op-topnav-list { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }
.op-topnav { position: relative; font-size: 0.9rem; color: var(--ink-mid); text-decoration: none; font-weight: 500; padding: 0.5rem 0.9rem; border-radius: var(--radius-pill); }
.op-topnav:hover { color: var(--ink); background: rgba(29,29,29,0.06); }
.op-topnav[aria-current="page"] { color: var(--ink); font-weight: 600; }
/* The amber line under the current page. view-transition-name lets the browser slide it from
   one link to the next as the page changes (views/operator.js opWrap) */
.op-topnav__line {
  position: absolute; left: 0.9rem; right: 0.9rem; bottom: 0.05rem; height: 2px;
  border-radius: 2px; background: var(--amber); view-transition-name: op-nav-line;
}
::view-transition-old(root), ::view-transition-new(root) { animation: none; } /* only the line moves */
::view-transition-group(op-nav-line) { animation-duration: 0.35s; animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1); }
@media (prefers-reduced-motion: reduce) { ::view-transition-group(*) { animation: none; } }
.badge--sent { background: var(--sage-soft); color: var(--sage); border-color: var(--sage-line); }
.badge--pending, .badge--skipped { background: var(--amber-soft); color: var(--amber-hover); border-color: var(--amber-line); }
.op-email-meta { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; margin: 0 0 1.25rem; font-size: 0.92rem; }
.op-email-meta dt { color: var(--ink-mid); font-weight: 600; }
.op-email-meta dd { margin: 0; overflow-wrap: anywhere; }
.op-email-frame { width: 100%; height: 760px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; }
.op-email-text { white-space: pre-wrap; font: 0.85rem/1.55 ui-monospace, Menlo, Consolas, monospace; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem; overflow-x: auto; }
.op-welcome__history { margin: 0.75rem 0 0; padding: 0; list-style: none; font-size: 0.85rem; color: var(--ink-mid); }
.op-welcome__history li { padding: 0.2rem 0; }
.op-dialog input[type="email"] { width: 100%; }
/* State or territory (New venue, Edit details): a select dressed as the text fields beside it */
.op-state-select {
  display: block; width: 100%; min-height: 44px; padding: 0.85rem 2.5rem 0.85rem 1rem;
  font: inherit; font-size: 0.98rem; color: var(--ink); cursor: pointer;
  background: var(--paper) no-repeat right 1rem center / 0.7rem
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%234A4943' stroke-width='1.6'/%3E%3C/svg%3E");
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  appearance: none; -webkit-appearance: none;
  transition: border-color var(--dur-1), box-shadow var(--dur-1);
}
.op-state-select:invalid { color: var(--ink-dim); }
.op-state-select option { color: var(--ink); }
@media (hover: hover) { .op-state-select:hover { border-color: rgba(29,29,29,0.24); } }
.op-state-select:focus { outline: none; border-color: var(--amber-hover); box-shadow: 0 0 0 4px var(--amber-glow); }
/* The venue's state, a quiet tag after its name in the venue table */
.op-venue-state { margin-left: 0.5rem; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; color: var(--ink-mid); }
.op-course-id { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.82rem; white-space: nowrap; }
.op-codes-table .op-cell-course { font-size: 0.88rem; color: var(--ink-2); min-width: 9rem; }
/* Phones: each staff code a card — the code with its status and ⋯ menu, then its course, issue
   and end dates, labelled — so nothing is off to the side */
@media (max-width: 640px) {
  .op-codes-section .op-table-wrap { overflow-x: visible; }
  .op-codes-table, .op-codes-table tbody { display: block; }
  .op-codes-table thead { display: none; }
  .op-codes-table tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.75rem; padding: 0.85rem 1rem; border-bottom: 1px solid var(--line); }
  .op-codes-table tbody tr[hidden] { display: none; }
  .op-codes-table tbody tr:last-child { border-bottom: none; }
  .op-codes-table td { display: block; padding: 0; border: none; }
  .op-codes-table .op-cell-code { flex: 1 1 auto; }
  .op-codes-table .op-cell-status, .op-codes-table .op-cell-action { flex: 0 0 auto; width: auto; }
  /* Status and ⋯ at the card's right, so the menu (it opens to the button's left) stays on screen */
  .op-codes-table .op-cell-status { margin-left: auto; }
  .op-codes-table .op-cell-course { flex: 1 1 100%; min-width: 0; font-size: 0.9rem; color: var(--ink); white-space: normal; overflow-wrap: anywhere; }
  .op-codes-table .op-cell-issued, .op-codes-table .op-cell-expiry { flex: 1 1 auto; font-size: 0.85rem; white-space: normal; }
  .op-codes-table [data-label]::before {
    content: attr(data-label) ' '; font-size: 0.65rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-mid);
  }
  .op-codes-table .op-cell-course::before { display: block; margin-bottom: 0.1rem; }
}
.op-emails { scroll-margin-top: 1rem; }
.op-emails .msg { margin: 0 0 0.75rem; }
/* One Emails panel: heading, where they go and the welcome button; then the welcome email's
   latest send (earlier ones folded); then the scheduled switches */
.op-emails__to { margin: -0.5rem 0 1rem; }
.op-emails__to strong { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.op-emails__subhead { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; flex-wrap: wrap;
  margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.op-emails__subhead .op-emails__sub { margin: 0; padding: 0; border: none; }
.op-emails__subhead + * { margin-top: 0.4rem; }
.op-emails__sched { display: block; font-size: 0.78rem; color: var(--ink-2); margin-top: 0.15rem; }
.op-emails__about { color: var(--ink-2); }
.op-emails__save { display: flex; align-items: center; gap: 0.75rem; margin-top: 1rem; }
.op-emails__dirty { font-size: 0.82rem; font-weight: 600; color: var(--amber-dark); }
.op-emails__form .op-emails__save .btn { margin-top: 0; }
.op-emails__form .btn:disabled { opacity: 0.45; cursor: default; }
.op-emails__sub {
  margin: 1.4rem 0 0.4rem; padding-top: 1.1rem; border-top: 1px solid var(--line);
  font-family: var(--font-body); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.11em; text-transform: uppercase; color: var(--ink-mid);
}
.op-emails__line { margin: 0 0 0.5rem; font-size: 0.88rem; color: var(--ink-2); }
.op-emails__earlier { font-size: 0.85rem; color: var(--ink-mid); }
.op-emails__earlier summary { cursor: pointer; width: max-content; }
.op-emails__earlier .op-welcome__history { margin-top: 0.35rem; }
.op-emails__form { display: flex; flex-direction: column; align-items: stretch; gap: 0; max-width: 30rem; }
.op-emails__option { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--cream-2); font-size: 0.9rem; font-weight: 400; text-transform: none; letter-spacing: normal; color: var(--ink); cursor: pointer; margin: 0; }
.op-emails__option:first-child { border-top: 1px solid var(--cream-2); }
.op-emails__when { display: block; font-size: 0.8rem; color: var(--ink-mid); }

/* On/off switch: a checkbox drawn as a sliding toggle (still a real checkbox for the form) */
.op-switch {
  appearance: none; -webkit-appearance: none; flex: 0 0 auto; position: relative;
  width: 2.75rem; height: 1.5rem; margin: 0; border-radius: var(--radius-pill); cursor: pointer;
  background: var(--cream-2); border: 1.5px solid var(--ink-faint);
  transition: background-color var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out);
}
.op-switch::before {
  content: ''; position: absolute; top: 50%; left: 0.15rem; width: 1.05rem; height: 1.05rem; border-radius: 50%;
  background: var(--paper); box-shadow: var(--shadow-thumb);
  transform: translate(0, -50%);
  transition: transform var(--dur-2) var(--ease-spring);
}
.op-switch:checked { background: var(--ink); border-color: var(--ink); }
.op-switch:checked::before { transform: translate(1.2rem, -50%); }
.op-switch:active::before { width: 1.25rem; }
.op-switch:checked:active::before { transform: translate(1rem, -50%); }
/* the site-wide checkbox focus rule clears backgrounds; keep the track colour */
input.op-switch:focus { background: var(--cream-2); }
input.op-switch:checked:focus { background: var(--ink); }
@media (prefers-reduced-motion: reduce) { .op-switch, .op-switch::before { transition: none; } }
.op-emails__form .btn { margin-top: 1rem; align-self: flex-start; }

/* ─── Manager dashboard: one section per course ──────────────────────────────── */
.manager-course {
  margin-bottom: 2.5rem;
  padding: 1.75rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.manager-course__title { margin: 0 0 0.35rem; font-size: 1.3rem; font-family: var(--font-heading); font-weight: 700; letter-spacing: -0.015em; }
.manager-course__downloads { margin-top: 1.25rem; }
.op-manager-code { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.15rem; margin-bottom: 1.5rem; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.op-manager-code__label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-mid); }
.op-manager-code__note { font-size: 0.85rem; color: var(--ink-mid); }
.op-manager-code .op-code-actions { margin-left: auto; }
.op-course-group { margin-top: 1.5rem; }
.op-course-group:first-of-type { margin-top: 0; }
.op-course-group__title { margin: 0 0 0.75rem; font-size: 1rem; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--ink); }
:is(.op-course-group__title, .op-course-check .op-section-title) .op-course-id { margin-left: 0.6rem; color: var(--ink-mid); font-weight: 400; }
.op-venue-header__title { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }
.op-venue-header__title .op-page-title { margin-bottom: 0; }

/* Manager dashboard: the same light 1px warm grey as the operator console */
.manager-page :is(.manager-course, .staff-table-wrap, .op-dialog) { border: 1px solid var(--warm-line); }
/* Operator console: a lighter 1px warm grey on every card and table */
.op-console :is(
  .op-section, .op-table-wrap, .staff-table-wrap, .op-manager-code, .op-search-list,
  .op-backup, .op-email-frame, .op-email-text, .op-dialog
) { border: 1px solid var(--warm-line); }
.op-console .op-backup--due { border-color: var(--clay-line); }

/* Archived venues list (bottom of All venues): everything greyed out except the Restore
   buttons, so nothing there reads as a live venue. After the border rule above, to override it. */
.op-console .op-archived.op-section { background: #EEECE7; border-color: #B3AFA6; }
.op-console .op-archived .op-table-wrap { border-color: #B3AFA6; background: #F4F2EE; }
.op-archived .op-table, .op-archived .op-table th { background: transparent; }
.op-archived summary,
.op-archived .op-archived__note { color: #9A968D; }
.op-archived .op-table th,
.op-archived .venue-row--expired td:not(.op-cell-action) { filter: grayscale(1); opacity: 0.45; }
.op-archived .venue-row--expired td.op-cell-action { opacity: 1; }

/* Issuing a staff code reloads the page at the Staff codes area — leave a little room above it */
#staff-codes { scroll-margin-top: 1.5rem; }

/* Manager dashboard: in-progress staff with no activity for a week or more */
.last-active--stale { color: var(--clay); font-weight: 600; }

/* Privacy page and links to it */
.privacy-page { max-width: 720px; margin: 2rem auto; padding: 0 1.25rem; }
.privacy-card h1 { margin: 0 0 0.35rem; }
.privacy-card h2 { margin: 1.75rem 0 0.5rem; font-size: 1.1rem; }
.privacy-card p, .privacy-card li { line-height: 1.6; color: var(--ink-2); }
.privacy-card ul { margin: 0; padding-left: 1.2rem; }
.privacy-card li { margin-bottom: 0.5rem; }
.privacy-card a { color: var(--amber-hover); }
.privacy-back { margin-bottom: 1rem; }
.privacy-card .privacy-back-bottom { margin: 2rem 0 0; }
.privacy-card .privacy-back-bottom a { color: var(--paper); }
.privacy-updated { margin: 0; font-size: 0.88rem; color: var(--ink-mid); }
.privacy-note { margin: 0.9rem 0 0; font-size: 0.8rem; line-height: 1.45; color: var(--ink-mid); text-align: center; }
.privacy-note a, .site-footer__links a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.site-footer p.site-footer__links,
.staff-main__footer p.site-footer__links { margin-top: 0.4rem; }

/* Operator venue page: the staff table sits in the main column, so it is kept compact */
.op-staff-table th, .op-staff-table td { padding: 0.7rem 0.75rem; }
.op-staff-table th { white-space: nowrap; }
.op-staff-table .staff-table__name { min-width: 9rem; }
.op-staff-table a.record-id-cell { cursor: pointer; color: var(--amber-dark); text-decoration: underline; text-underline-offset: 3px; user-select: auto; }

/* ─── Manager dashboard ──────────────────────────────────────────────────────── */
/* Sign out, at the right of the logo row (views/layout.js headerRight) */
.site-header__right { margin-left: auto; }
.mgr-signout-form { margin: 0; }
.mgr-signout {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.9rem;
  font: inherit; font-size: 0.9rem; font-weight: 500; color: var(--ink-mid); text-decoration: none; border-radius: var(--radius-pill);
  background: none; border: none; cursor: pointer;
}
.mgr-signout:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.mgr-signout:hover { color: var(--ink); background: rgba(29,29,29,0.06); }

.manager-page .manager-header { margin-bottom: 1.75rem; }
.mgr-jump { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; margin-top: 0.85rem; font-size: 0.9rem; }
.mgr-jump a { color: var(--ink); font-weight: 500; text-decoration: underline; text-decoration-color: var(--amber); text-underline-offset: 3px; }

/* One card per course: sections inside are separated by space and thin rules, not boxes */
.manager-page .manager-course { box-shadow: none; padding: 1.5rem 1.6rem; scroll-margin-top: 1rem; }
.mgr-stats { margin: 0 0 1.25rem; padding: 0.9rem 0; }

/* Get your staff started: full while nobody has started, one row under the table after */
.mgr-start { padding-top: 0.25rem; }
.mgr-start__title { margin: 0 0 0.3rem; font-family: var(--font-heading); font-size: 1.15rem; font-weight: 700; text-transform: none; letter-spacing: -0.01em; color: var(--ink); }
.mgr-start__copy { margin: 0 0 1rem; color: var(--ink-2); font-size: 0.95rem; }
.mgr-start__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.mgr-start__actions .btn { margin-top: 0; }
.mgr-start--compact { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; margin-top: 1.25rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.mgr-start--compact .mgr-preview,
.mgr-start--compact .mgr-device { flex-basis: 100%; margin-top: 0; }
.mgr-start__label { margin: 0; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.11em; text-transform: uppercase; color: var(--ink-mid); }
.mgr-preview { margin-top: 1rem; }
.mgr-preview summary { cursor: pointer; width: max-content; font-size: 0.88rem; font-weight: 600; color: var(--ink-2); }
.mgr-preview textarea {
  display: block; width: 100%; max-width: 46rem; margin-top: 0.6rem; padding: 0.75rem; box-sizing: border-box;
  font: inherit; font-size: 0.9rem; line-height: 1.45; color: var(--ink);
  background: var(--paper-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); resize: vertical;
}
.mgr-preview textarea:focus { outline: none; border-color: var(--amber-hover); box-shadow: 0 0 0 4px var(--amber-glow); }
.mgr-preview__note { margin: 0.4rem 0 0; font-size: 0.8rem; color: var(--ink-mid); }

/* ── A course card's head: title and status, then the staff code tile ─────────── */
.mgr-course-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.mgr-course-head .manager-course__title { margin: 0; }
.mgr-live {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.3rem 0.75rem; border-radius: var(--radius-pill);
  font-size: 0.78rem; font-weight: 600; white-space: nowrap;
  background: var(--sage-soft); color: var(--sage); border: 1px solid var(--sage-line);
}
.mgr-live--soon { background: var(--clay-soft); color: var(--clay); border-color: var(--clay-line); }
.mgr-live--ended { background: var(--cream-2); color: var(--ink-mid); border-color: var(--line-2); }
.mgr-live__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: mgr-live 2.4s var(--ease-in-out) infinite; }
@keyframes mgr-live { 50% { opacity: 0.35; } }

.mgr-code {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem;
  padding: 1.15rem 1.35rem; margin-bottom: 1.6rem;
  background: var(--paper-2); border: 1px solid var(--warm-line); border-radius: var(--radius);
}
.mgr-code__main, .mgr-code__meta { display: flex; flex-direction: column; gap: 0.3rem; }
.mgr-code__meta { text-align: right; }
.mgr-code__label { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-mid); }
.mgr-code .code-with-copy { gap: 0.8rem; }
.mgr-code__value { font-size: 1.65rem; letter-spacing: 0.06em; line-height: 1.2; }
.mgr-code__when { font-weight: 600; color: var(--ink); font-size: 1.05rem; }
.mgr-code__time { font-size: 0.82rem; color: var(--ink-mid); }
.mgr-ended { margin: 0 0 1.25rem; color: var(--ink-mid); }

/* ── Get your staff started: three steps, side by side on a wide screen ───────── */
.mgr-start .mgr-start__title { margin-bottom: 0.9rem; }
.mgr-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.85rem; }
.mgr-step {
  display: flex; flex-direction: column;
  padding: 1.15rem 1.2rem 1.2rem;
  background: var(--paper); border: 1px solid var(--warm-line); border-radius: var(--radius);
}
.mgr-step__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.85rem; }
.mgr-step__icon {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  border-radius: var(--radius-sm); background: var(--cream-2); color: var(--ink);
}
.mgr-step__num { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-mid); }
.mgr-step__num--optional { padding: 0.2rem 0.55rem; border: 1px solid var(--line-2); border-radius: var(--radius-pill); letter-spacing: 0.1em; }
.mgr-step__title { margin: 0 0 0.3rem; font-family: var(--font-heading); font-size: 1.02rem; font-weight: 700; letter-spacing: -0.01em; text-transform: none; color: var(--ink); }
.mgr-step__text { margin: 0 0 1rem; font-size: 0.88rem; line-height: 1.5; color: var(--ink-2); }
.mgr-step__actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.mgr-step__actions .btn { margin-top: 0; }
.mgr-waiting { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; font-weight: 600; color: var(--ink-mid); }
.mgr-waiting__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sage); box-shadow: 0 0 0 0 var(--sage-line); animation: mgr-waiting 2s var(--ease-out) infinite; }
@keyframes mgr-waiting { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ── What your staff are assessed on: the facts and parts, beside a fan of sample licences ── */
/* What staff are assessed on: one line on the course card; the full box in a pop-up */
.mgr-assess-open { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--line); }
.mgr-assess-open__note { font-size: 0.85rem; color: var(--ink-mid); }
.mgr-assess-dialog { width: min(960px, calc(100vw - 32px)); }
.mgr-assess-dialog .mgr-assess { margin: 0; border: 0; border-radius: 0; }
.mgr-assess {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1.5rem 2rem; align-items: center;
  margin-top: 1.5rem; padding: 1.4rem 1.5rem; background: var(--paper); border: 1px solid var(--warm-line); border-radius: var(--radius);
}
.mgr-assess__kicker { margin: 0; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-mid); }
.mgr-assess__title { margin: 0.25rem 0 0.5rem; font-family: var(--font-heading); font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; text-transform: none; color: var(--ink); }
.mgr-assess__lead { margin: 0 0 1rem; font-size: 0.9rem; line-height: 1.55; color: var(--ink-2); }
.mgr-assess__facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 0.5rem; margin: 0 0 1rem; }
.mgr-assess__facts > div { padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper-2); }
.mgr-assess__facts dt { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-mid); }
.mgr-assess__facts dd { margin: 0.15rem 0 0; font: 700 1.05rem/1.2 var(--font-heading); color: var(--ink); }
.mgr-assess__parts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.mgr-assess__parts li { display: flex; align-items: center; gap: 0.7rem; min-height: 40px; padding: 0.35rem 0.1rem; border-bottom: 1px solid var(--line); }
.mgr-assess__num { flex: 0 0 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; font-size: 0.74rem; font-weight: 700; color: var(--ink); background: var(--cream-2); border: 1px solid var(--line-2); }
.mgr-assess__part { flex: 1 1 auto; min-width: 0; font-size: 0.9rem; font-weight: 600; color: var(--ink); }
.mgr-assess__count { flex-shrink: 0; font-size: 0.78rem; color: var(--ink-mid); }
.mgr-assess__preview { margin: 0; }
/* Three licences fanned out, as they're held up at the bar */
.mgr-assess__cards { position: relative; aspect-ratio: 100 / 78; }
.mgr-assess__card { position: absolute; width: 66%; }
.mgr-assess__card .ix-card { cursor: default; box-shadow: 0 10px 22px rgba(29, 29, 29, 0.16), 0 2px 5px rgba(29, 29, 29, 0.1); }
.mgr-assess__card--1 { left: 0; top: 2%; transform: rotate(-6deg); }
.mgr-assess__card--2 { left: 17%; top: 18%; transform: rotate(-1deg); }
.mgr-assess__card--3 { left: 34%; top: 34%; transform: rotate(5deg); }
/* The deck: opened, the front licence settles first, then the others slide out from behind it and fan apart */
.mgr-assess-dialog[open] .mgr-assess__card--3 { animation: assess-deal-front var(--dur-3) var(--ease-out) backwards; }
.mgr-assess-dialog[open] .mgr-assess__card--2 { animation: assess-deal-2 calc(var(--dur-4) * 1.3) var(--ease-spring) 0.35s backwards; }
.mgr-assess-dialog[open] .mgr-assess__card--1 { animation: assess-deal-1 calc(var(--dur-4) * 1.3) var(--ease-spring) 0.6s backwards; }
@keyframes assess-deal-front { from { opacity: 0; transform: translateY(14px) rotate(5deg); } to { opacity: 1; transform: rotate(5deg); } }
@keyframes assess-deal-2 { from { left: 34%; top: 34%; transform: rotate(5deg); } to { left: 17%; top: 18%; transform: rotate(-1deg); } }
@keyframes assess-deal-1 { from { left: 34%; top: 34%; transform: rotate(5deg); } to { left: 0; top: 2%; transform: rotate(-6deg); } }
@media (prefers-reduced-motion: reduce) { .mgr-assess-dialog[open] .mgr-assess__card { animation: none; } }
/* A magnifying glass drifts over the licences once they're fanned out, looks at each, and leaves */
.mgr-assess__glass { position: absolute; z-index: 5; left: 108%; top: 70%; width: 36%; height: auto; opacity: 0; pointer-events: none; filter: drop-shadow(0 8px 10px rgba(29, 29, 29, 0.25)); }
.mgr-assess-dialog[open] .mgr-assess__glass { animation: assess-inspect 5.2s ease-in-out 1.7s both; }
@keyframes assess-inspect {
  0%   { left: 108%; top: 72%; opacity: 0; transform: rotate(14deg) scale(0.9); }
  8%   { opacity: 1; }
  24%  { left: 58%;  top: 46%; transform: rotate(-6deg) scale(1.08); }
  42%  { left: 34%;  top: 28%; transform: rotate(6deg) scale(1.08); }
  60%  { left: 10%;  top: 8%;  transform: rotate(-8deg) scale(1.1); }
  78%  { left: 52%;  top: 40%; transform: rotate(4deg) scale(1.08); }
  92%  { opacity: 1; }
  100% { left: 112%; top: 20%; opacity: 0; transform: rotate(16deg) scale(0.95); }
}
@media (prefers-reduced-motion: reduce) { .mgr-assess__glass { display: none; } }
.mgr-assess__preview figcaption { margin-top: 0.75rem; font-size: 0.82rem; line-height: 1.45; color: var(--ink-mid); text-align: center; }
@media (max-width: 760px) {
  .mgr-assess { grid-template-columns: 1fr; padding: 1.15rem; }
  .mgr-assess__preview { max-width: 420px; margin: 0 auto; width: 100%; }
}

.mgr-device { display: flex; align-items: center; gap: 0.55rem; margin: 1rem 0 0; font-size: 0.86rem; color: var(--ink-2); }
.mgr-device svg { flex: none; color: var(--ink-mid); }
.mgr-device strong { color: var(--ink); font-weight: 600; }
.mgr-start .mgr-preview { margin-top: 0.9rem; }
.mgr-start .mgr-preview summary { color: var(--ink-mid); }
.mgr-start .mgr-preview summary:hover { color: var(--ink); }

@media (max-width: 640px) {
  .mgr-code { flex-direction: column; align-items: flex-start; padding: 1rem; }
  .mgr-code__meta { text-align: left; }
  .mgr-code__value { font-size: 1.35rem; }
  .mgr-step__actions .btn { flex: 1 1 auto; justify-content: center; min-height: 44px; }
  .mgr-device { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .mgr-live__dot, .mgr-waiting__dot { animation: none; }
}

.mgr-empty { margin: 1.25rem 0 0; padding-top: 1.1rem; border-top: 1px solid var(--line); color: var(--ink-mid); }
.mgr-records-note { margin: 0.75rem 0 0; font-size: 0.8rem; color: var(--ink-mid); }
.mgr-dash { color: var(--ink-mid); }

/* Above the table: show All / Not completed / Completed, sort (phones), downloads */
.mgr-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; margin-bottom: 0.85rem; }
.mgr-filter { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius-pill); padding: 2px; background: var(--paper); }
.mgr-filter__opt {
  border: none; background: none; font: inherit; font-size: 0.82rem; font-weight: 500; color: var(--ink-2);
  padding: 0.35rem 0.8rem; border-radius: var(--radius-pill); cursor: pointer; white-space: nowrap;
}
.mgr-filter__opt span { color: var(--ink-mid); margin-left: 0.2rem; }
.mgr-filter__opt[aria-pressed="true"] { background: var(--ink); color: var(--cream); }
.mgr-filter__opt[aria-pressed="true"] span { color: var(--cream-2); }
.mgr-sort-select { display: none; align-items: center; gap: 0.5rem; font-size: 0.82rem; color: var(--ink-mid); }
.mgr-sort-select select { font: inherit; font-size: 0.85rem; padding: 0.35rem 0.5rem; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--paper); color: var(--ink); }
.mgr-exports { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-left: auto; }
.mgr-exports .btn { margin-top: 0; }

/* The staff table */
.mgr-table th[data-sort-key] { padding: 0; }
.mgr-sort {
  display: inline-flex; align-items: center; gap: 0.3rem; width: 100%; padding: 0.85rem 1.1rem;
  border: none; background: none; font: inherit; font-size: inherit; letter-spacing: inherit; text-transform: inherit;
  color: inherit; font-weight: inherit; cursor: pointer; text-align: left;
}
.mgr-sort:hover { color: var(--ink); }
.mgr-sort__arrow::after { content: ''; }
th[aria-sort="ascending"] .mgr-sort__arrow::after { content: '↑'; }
th[aria-sort="descending"] .mgr-sort__arrow::after { content: '↓'; }
.mgr-name { font-weight: 500; color: var(--ink); min-width: 10rem; }
.mgr-name__text { overflow-wrap: anywhere; }
.mgr-name__pencil {
  display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; margin-left: 0.3rem;
  vertical-align: middle; border: none; border-radius: var(--radius-xs); background: none; color: var(--ink-mid); cursor: pointer; opacity: 0;
}
.mgr-row:hover .mgr-name__pencil, .op-staff-table tr:hover .mgr-name__pencil, .mgr-name__pencil:focus-visible { opacity: 1; }
.mgr-name__pencil:hover { background: var(--cream-2); color: var(--ink); }
.mgr-name__form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; white-space: normal; } /* the table keeps cells on one line; the warning must wrap */
.mgr-name__form input {
  flex: 1 1 10rem; min-width: 0; padding: 0.4rem 0.6rem; font: inherit; font-size: 0.92rem;
  border: 1px solid var(--amber-hover); border-radius: var(--radius-sm); background: var(--paper);
  box-shadow: 0 0 0 3px var(--amber-glow); outline: none;
}
.mgr-name__buttons { display: inline-flex; gap: 0.3rem; }
.mgr-name__buttons .btn { margin-top: 0; }
.mgr-table td[hidden] { display: none; }
.mgr-name__step { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; flex-basis: 100%; }
.mgr-name__step[hidden] { display: none; }
.mgr-name__step input { flex: 1 1 10rem; min-width: 0; }
/* The warning before a name changes: amber, so it reads as "check this", not an error */
.mgr-name__confirm { padding: 0.65rem 0.75rem; border: 1px solid var(--amber-hover); border-radius: var(--radius-sm); background: var(--amber-glow); }
.mgr-name__warn { margin: 0; flex-basis: 100%; font-weight: 400; overflow-wrap: anywhere; }
.mgr-name__warn s { color: var(--ink-mid); }
.mgr-name__note { margin: 0 0 0.2rem; flex-basis: 100%; font-size: 0.8rem; font-weight: 400; line-height: 1.45; color: var(--ink-2); }
.mgr-completed { white-space: nowrap; }
.mgr-cert { margin-left: 0.5rem; }
/* How long ago (views/manager.js certAge): under the date, quiet; a year or more held in ink */
.mgr-age { display: block; font-size: 0.8rem; color: var(--ink-mid); margin-top: 0.15rem; }
.mgr-age--old { color: var(--ink); font-weight: 600; }
/* Touch screens have no hover: the name is edited from the ⋯ menu instead of the pencil */
.mgr-actions { width: 1%; }
@media (hover: hover) { .mgr-menu { display: none; } .mgr-actions { padding: 0 !important; } }
@media (hover: none) {
  .mgr-name__pencil { display: none; }
  /* The operator's staff table has no ⋯ menu: on a touch screen the pencil just shows */
  .op-staff-table .mgr-name__pencil { display: inline-flex; opacity: 1; }
}
.mgr-filter-empty { margin: 0; padding: 1rem 1.1rem; color: var(--ink-mid); font-size: 0.9rem; }

/* Phones: each person a card, controls stacked, buttons full width, nothing off to the side */
@media (max-width: 640px) {
  .manager-page .manager-course { padding: 1.1rem 1rem; }
  .mgr-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mgr-stats .op-stat:nth-child(3) { padding-left: 0.75rem; border-left: 1px solid var(--line); }
  .mgr-stats .op-stat { padding: 0 0.75rem; }
  .mgr-stats .op-stat:first-child { padding-left: 0; }
  .mgr-stats .op-stat__label { font-size: 0.62rem; letter-spacing: 0.08em; }
  .mgr-tools { flex-direction: column; align-items: stretch; }
  .mgr-filter { justify-content: space-between; }
  .mgr-filter__opt { flex: 1; min-height: 40px; padding: 0 0.4rem; }
  .mgr-sort-select { display: flex; }
  .mgr-sort-select select { flex: 1; min-height: 44px; }
  .mgr-exports { margin-left: 0; flex-direction: column; }
  .mgr-exports .btn, .mgr-start__actions .btn { width: 100%; min-height: 44px; justify-content: center; }
  .mgr-start__actions { flex-direction: column; align-items: stretch; }
  .mgr-start--compact { flex-direction: column; align-items: stretch; }

  .mgr-table-wrap { overflow-x: visible; }
  .mgr-table, .mgr-table tbody { display: block; }
  .mgr-table thead { display: none; }
  /* Each card wraps rather than overlaps: name, pill and ⋯; then progress; then last active
     and completed, the second moving under the first when there isn't room */
  .mgr-table tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem 0.75rem; padding: 0.9rem 1rem; border-bottom: 1px solid var(--line); }
  .mgr-table tbody tr[hidden] { display: none; }
  .mgr-table tbody tr:last-child { border-bottom: none; }
  .mgr-table tbody tr:hover { background: none; }
  .mgr-table td { display: block; padding: 0; border: none; min-width: 0; }
  .mgr-name { flex: 1 1 8rem; min-width: 0; }
  .mgr-status, .mgr-actions { flex: 0 0 auto; width: auto; }
  .mgr-modules { flex: 1 1 100%; }
  .mgr-last { flex: 1 1 auto; font-size: 0.85rem; }
  .mgr-completed { flex: 0 1 auto; margin-left: auto; font-size: 0.85rem; white-space: normal; text-align: right; }
  .mgr-last::before, .mgr-completed::before {
    content: attr(data-label) ' '; font-size: 0.65rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-mid);
  }
  .mgr-row:has(.mgr-name__form) .mgr-name { flex-basis: 100%; }
  .op-menu__btn { width: 44px; height: 44px; }
  .copy-btn { min-width: 44px; min-height: 44px; }
}
.op-row-target > td { background: var(--amber-glow); }
.op-row-target > td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.op-filter-note { margin: -0.4rem 0 0.85rem; font-size: 0.88rem; color: var(--ink-2); }

/* ─── Courses: is each course ready to sell? ─────────────────────────────────── */
/* One colour system: a muted green tick for done, amber for anything to do */
.cc-intro { margin: -1rem 0 0.75rem; }
.cc-help { margin: 0 0 1.25rem; font-size: 0.88rem; color: var(--ink-2); }
.cc-help summary { cursor: pointer; width: max-content; font-weight: 600; color: var(--ink); }
.cc-help ul { margin: 0.5rem 0 0; padding-left: 1.2rem; }
.cc-help li { margin: 0.15rem 0; }
.cc-summary { list-style: none; margin: 0 0 1.25rem; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.9rem; }
.cc-summary li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.75rem; }
.cc-summary a:first-child { font-weight: 600; color: var(--ink); }
.cc-course { margin-bottom: 1.5rem; }
.cc-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 0.75rem 1.5rem; margin-bottom: 0.9rem; }
.cc-head__main { min-width: 0; }
.cc-title { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; margin: 0 0 0.35rem; }
.cc-title .op-course-id { margin-left: 0; }
.cc-meta { margin: 0; font-size: 0.88rem; color: var(--ink-2); }
.cc-head__actions { display: flex; align-items: center; gap: 0.75rem; }
.cc-checked { font-size: 0.8rem; color: var(--ink-mid); white-space: nowrap; }
.cc-live { color: var(--ink-2); }
a.cc-live { color: var(--ink); font-weight: 500; text-decoration: underline; text-decoration-color: var(--amber); text-underline-offset: 3px; }
.cc-live--warn, a.cc-live--warn { color: var(--amber-dark); font-weight: 600; }
.cc-tag { display: inline-flex; align-items: center; padding: 0.05rem 0.45rem; border-radius: var(--radius-pill); background: var(--cream-2); font-family: var(--font-body); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.02em; color: var(--ink-2); white-space: nowrap; cursor: default; }
.cc-tag--warn { background: var(--amber-glow); color: var(--amber-dark); }
/* A national course (offered to every venue, whatever its state): teal, apart from the grey state tags.
   In the Issue staff code list it has its own group; option colours show only where the browser
   draws the list itself (not macOS's own menus), so the group and " · National" carry it anyway. */
.op-national-tag { display: inline-flex; align-items: center; padding: 0.05rem 0.5rem; border-radius: var(--radius-pill);
  background: var(--sage-soft); border: 1px solid var(--sage); color: var(--sage); font-family: var(--font-body);
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; vertical-align: middle; }
.op-option-national { color: var(--sage); font-weight: 600; }
.cc-badge--warn { background: var(--amber-glow); color: var(--amber-dark); border-color: rgba(176,122,18,0.35); }
.cc-ok { color: var(--pass); font-weight: 700; opacity: 0.85; }
.cc-missing { color: var(--amber-dark); font-weight: 600; }
.cc-file { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.76rem; color: var(--ink-mid); white-space: nowrap; }
/* The checklist: a compact row of items, not a coloured box */
.cc-checks { list-style: none; margin: 0 0 0.9rem; padding: 0.75rem 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 0.86rem; }
.cc-check { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--ink-2); }
.cc-check strong { white-space: nowrap; }
.cc-check strong { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.cc-check--todo, .cc-check--todo strong { color: var(--amber-dark); }
.cc-check--optional { color: var(--ink-mid); }
.cc-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.cc-check--optional .cc-dot { background: var(--ink-faint); }
.cc-texts { margin: 0 0 1rem; font-size: 0.86rem; }
.cc-texts > summary { cursor: pointer; width: max-content; font-weight: 600; color: var(--amber-dark); }
.cc-texts__group { margin: 0.4rem 0 0 1rem; }
.cc-texts__group summary { cursor: pointer; width: max-content; color: var(--ink); }
.cc-count { display: inline-block; min-width: 1.4rem; padding: 0 0.35rem; margin-left: 0.3rem; border-radius: var(--radius-pill); background: var(--amber-glow); color: var(--amber-dark); font-size: 0.75rem; font-weight: 600; text-align: center; }
.cc-texts__group ul { margin: 0.35rem 0 0.5rem; padding-left: 1rem; color: var(--ink-2); }
.cc-texts__group li { margin: 0.2rem 0; overflow-wrap: anywhere; }
.cc-texts__group code { font-size: 0.74rem; color: var(--ink-mid); margin-right: 0.35rem; }
.cc-table th, .cc-table td { padding: 0.65rem 0.6rem; vertical-align: middle; white-space: normal; }
.cc-table th:first-child, .cc-table td:first-child { padding-left: 1rem; }
.cc-module { font-weight: 500; color: var(--ink); min-width: 11rem; }
.cc-num { display: inline-block; min-width: 1.1rem; color: var(--ink-mid); font-variant-numeric: tabular-nums; }
.cc-row--intro .cc-module { color: var(--ink-mid); }
.cc-intro-note { color: var(--ink-mid); font-style: italic; font-size: 0.86rem; }
.cc-num-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cc-preview-cell { text-align: right; white-space: nowrap; }
/* Preview */
.cc-preview__video { display: block; width: 100%; max-width: 960px; border-radius: var(--radius-sm); background: #000; }
.cc-preview__frame { display: block; width: 100%; max-width: 1280px; aspect-ratio: 16 / 9.2; border: 1px solid var(--warm-line); border-radius: var(--radius-sm); background: #fff; }

/* Narrower screens: one card per module (the table needs about 1200px), the checklist in two columns */
@media (max-width: 1279px) {
  .cc-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cc-head__actions { width: 100%; justify-content: space-between; }
  .cc-head__actions .btn { min-height: 44px; }
  .cc-table-wrap, .cc-course .op-table-wrap { overflow-x: visible; border: none; }
  .cc-table, .cc-table tbody { display: block; }
  .cc-table thead { display: none; }
  .cc-table tr { display: flex; flex-direction: column; gap: 0.3rem; padding: 0.85rem 0.9rem; margin-bottom: 0.6rem; border: 1px solid var(--warm-line); border-radius: var(--radius-sm); background: var(--paper); }
  .cc-table td { display: flex; align-items: baseline; gap: 0.5rem; padding: 0; border: none; min-width: 0; white-space: normal; }
  .cc-cell { flex: 1; min-width: 0; }
  .cc-cell .cc-fileline { white-space: normal; }
  .cc-check { display: block; line-height: 1.4; }
  .cc-check .cc-ok, .cc-check .cc-dot { display: inline-block; margin-right: 0.3rem; vertical-align: 0.1em; }
  .cc-check strong { margin-left: 0.25rem; }
  .cc-table td[data-label]:not(.cc-module)::before {
    content: attr(data-label); flex: 0 0 6.5rem; font-size: 0.66rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-mid);
  }
  .cc-module { font-size: 1rem; margin-bottom: 0.15rem; }
  .cc-file { white-space: normal; overflow-wrap: anywhere; }
  .cc-preview-cell { justify-content: flex-start; }
  .cc-preview-cell a { display: inline-flex; align-items: center; min-height: 44px; }
}
.cc-fileline { white-space: nowrap; }

/* ─── Dev mode: on every console page, so a "Sent" is never mistaken for a real send ─── */
.op-devmode {
  margin: 0.75rem clamp(1.5rem, 4vw, 3.5rem) 0; padding: 0.6rem 0.9rem;
  border-left: 4px solid var(--amber); background: var(--amber-glow); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.86rem; color: var(--ink-2);
}
.op-devmode code { font-size: 0.82rem; }

/* ─── Outbox ──────────────────────────────────────────────────────────────────── */
.ob-sub { margin-left: 0.4rem; font-family: var(--font-body); font-size: 0.75rem; font-weight: 500; color: var(--ink-mid); letter-spacing: 0; }
.ob-coming .op-section-title { margin-bottom: 0.75rem; }
.ob-quiet { margin: 0; color: var(--ink-mid); font-size: 0.9rem; }
.ob-sent-title { margin: 0.25rem 0 0.75rem; }
.ob-upcoming { list-style: none; margin: 0; padding: 0; }
.ob-up, .ob-row {
  display: grid; align-items: center; gap: 0.25rem 1rem; padding: 0.55rem 0; border-top: 1px solid var(--line); font-size: 0.9rem;
}
/* Columns give way as the page narrows: a long name or address ends in … rather than running into the next */
.ob-up { grid-template-columns: 9.5rem minmax(0, 0.8fr) minmax(0, 0.9fr) minmax(0, 1.7fr); }
.ob-up .ob-to { white-space: normal; } /* "(if anyone starts or completes…)" wraps rather than being cut */
/* Every row's own grid, so no column is sized by its content (it would differ row to row) */
.ob-row { grid-template-columns: 4.75rem minmax(0, 0.7fr) minmax(0, 1.3fr) minmax(0, 1.3fr) 5.5rem 2rem; cursor: pointer; }
.ob-row > .ob-status { justify-self: end; }
.ob-upcoming > li:first-child, .act-list > .ob-row:first-child { border-top: none; }
.ob-row:hover { background: var(--paper-2); }
.ob-up__when { color: var(--ink-2); font-size: 0.84rem; white-space: nowrap; }
.ob-kind { display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; min-width: 0; }
/* An email's name never runs into the recipient: the column fits the longest; anything longer ends in … */
.ob-kind .act-cat { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ob-to { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.ob-wont { color: var(--amber-dark); font-weight: 600; white-space: normal; }
.ob-wont .op-link-btn { margin-left: 0.4rem; font-size: 0.84rem; white-space: nowrap; }
.ob-actions { justify-self: end; }
.ob-badge--warn { background: var(--amber-glow); color: var(--amber-dark); border-color: rgba(176,122,18,0.35); }
.ob-dup { margin: 0.75rem 0 0; padding: 0.55rem 0.75rem; border-left: 3px solid var(--amber); background: var(--amber-glow); font-size: 0.88rem; color: var(--ink); }
.ob-dup[hidden] { display: none; }
.ob-resend__opt { display: flex; align-items: center; gap: 0.5rem; margin: 0.4rem 0 0; font-size: 0.92rem; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ink); }
.ob-up-all { margin-top: 0.6rem; }

/* The preview drawer, from the right; full screen on a phone */
.ob-drawer { position: fixed; inset: 0; z-index: 70; background: rgba(29,29,29,0.35); display: flex; justify-content: flex-end; }
.ob-drawer[hidden] { display: none; }
body.ob-drawer-open { overflow: hidden; }
.ob-drawer__panel { width: min(640px, 100%); height: 100%; overflow-y: auto; background: var(--paper); box-shadow: -12px 0 40px rgba(29,29,29,0.2); }
.ob-panel { padding: 1.25rem 1.4rem 1.5rem; }
.ob-panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 0.9rem; }
.ob-panel__subject { margin: 0.5rem 0 0; font-size: 1.15rem; font-family: var(--font-heading); font-weight: 700; overflow-wrap: anywhere; }
.ob-panel__close { flex-shrink: 0; width: 44px; height: 44px; border: none; border-radius: var(--radius-pill); background: none; font-size: 1.6rem; line-height: 1; color: var(--ink-mid); cursor: pointer; }
.ob-panel__close:hover { background: var(--cream-2); color: var(--ink); }
.ob-panel .op-email-meta { margin-bottom: 1rem; }
.ob-panel__frame { width: 100%; height: 60vh; }
.ob-panel__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; margin-top: 1rem; }
.ob-panel__foot .btn { margin-top: 0; }
.ob-error { color: var(--amber-dark); font-weight: 600; }
.op-emails__all { margin: 0.9rem 0 0; }

@media (max-width: 640px) {
  .op-devmode { margin: 0.5rem 1rem 0; }
  /* Three lines a row: time, venue, ⋯; the email's name with its status; the recipient. So neither
     the venue nor a long name like "Accepted Terms of Service (our copy)" is squeezed out */
  .ob-row { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "time venue actions" "kind kind status" "to to to"; gap: var(--space-1) var(--space-2); }
  .ob-row .act-time { grid-area: time; }
  .ob-row .act-venue { grid-area: venue; }
  .ob-row .ob-kind { grid-area: kind; }
  .ob-row .ob-actions { grid-area: actions; }
  .ob-row .ob-to { grid-area: to; }
  .ob-row .ob-status { grid-area: status; justify-self: end; }
  .ob-up { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "when kind" "venue venue" "to to"; gap: 0.2rem 0.6rem; }
  .ob-up .ob-up__when { grid-area: when; }
  .ob-up .act-venue { grid-area: venue; }
  .ob-up .ob-kind { grid-area: kind; }
  .ob-up .ob-to { grid-area: to; }
  .ob-drawer__panel { width: 100%; box-shadow: none; }
  .ob-panel__frame { height: 70vh; }
}

/* ─── Take a closer look (views/inspect.js, public/js/inspect.js) ────────────────
   A made-up sample licence: tilted under a light, magnified, compared with the genuine card.
   Its sizes are in container units (cqw) so the whole card scales as one; the px sizes before
   them are for a browser without container queries. Ink and teal only: the page's amber is
   kept for its one accent. */
.inspect {
  scroll-margin-top: 1rem;
  margin: 2.5rem 0 0;
  padding: 1.5rem 1.25rem 1.25rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.inspect__kicker { margin: 0; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-mid); }
.inspect__heading { margin: 0.3rem 0 0.4rem; font-size: 1.35rem; }
.inspect__intro { margin: 0; color: var(--ink-2); }

.ix-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 1.1rem; }
.ix-seg { display: inline-flex; padding: 3px; border: 1px solid var(--line-2); border-radius: var(--radius-pill); background: var(--paper-2); }
.ix-seg__btn {
  min-height: 40px; padding: 0 1rem; border: 0; border-radius: var(--radius-pill); background: transparent;
  font: 600 0.88rem var(--font-body); color: var(--ink-2); cursor: pointer;
}
.ix-seg__btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.ix-seg__btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.ix-stage {
  position: relative; display: flex; justify-content: center;
  padding: 1.75rem 0 1.25rem; touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.ix-card {
  position: relative; width: 100%; max-width: 520px; aspect-ratio: 85.6 / 54;
  container-type: inline-size; border-radius: 4.5% / 7%;
  box-shadow: 0 18px 40px rgba(29, 29, 29, 0.18), 0 3px 8px rgba(29, 29, 29, 0.12);
  transform-style: preserve-3d; transition: transform 140ms var(--ease-out); cursor: pointer;
}
.ix-face {
  position: absolute; inset: 0; overflow: hidden; border-radius: inherit;
  /* For a browser without container units (iOS 15, older Chrome): the same, in px */
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='12'%3E%3Cpath d='M0 6 Q10 0 20 6 T40 6' fill='none' stroke='%23ffffff' stroke-opacity='.4' stroke-width='.5'/%3E%3C/svg%3E") 0 0 / 20px 6px,
    radial-gradient(ellipse 70% 60% at 30% 25%, rgba(255, 248, 200, 0.55), transparent 70%),
    linear-gradient(120deg, #f6de4f 0%, #edc92c 38%, #f4d944 62%, #e6bf22 100%);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='12'%3E%3Cpath d='M0 6 Q10 0 20 6 T40 6' fill='none' stroke='%23ffffff' stroke-opacity='.4' stroke-width='.5'/%3E%3C/svg%3E") 0 0 / 4.2cqw 1.3cqw,
    radial-gradient(ellipse 70% 60% at 30% 25%, rgba(255, 248, 200, 0.55), transparent 70%),
    linear-gradient(120deg, #f6de4f 0%, #edc92c 38%, #f4d944 62%, #e6bf22 100%);
  color: #111; font-family: var(--font-body);
}
.ix-contour { position: absolute; left: 20%; top: -6%; width: 56%; height: 70%; pointer-events: none; }
.ix-contour svg, .ix-watermark svg, .ix-ghost svg, .ix-sig svg { width: 100%; height: 100%; display: block; }
.ix-watermark { position: absolute; left: 27%; top: 34%; width: 36%; aspect-ratio: 1; color: rgba(120, 96, 10, 0.18); pointer-events: none; }
.ix-kind { position: absolute; left: 3.5%; top: 3.5%; font: 800 16px var(--font-heading); font-size: 5cqw; letter-spacing: -0.01em; color: rgb(255 255 255 / calc(0.95 - var(--glare, 0) * 0.35)); text-shadow: 0 0 1px rgba(150, 120, 0, 0.35); }
.ix-no { position: absolute; right: 3.5%; top: 3%; display: flex; flex-direction: column; align-items: flex-end; }
.ix-value.ix-no__value { font-size: 15px; font-size: 4.6cqw; font-weight: 700; letter-spacing: 0.04em; }
.ix-who { position: absolute; left: 7%; top: 14.5%; display: flex; flex-direction: column; line-height: 1.05; }
.ix-value.ix-name { font-size: 12px; font-size: 3.6cqw; font-weight: 700; letter-spacing: 0.01em; text-transform: uppercase; }
.ix-value.ix-given { font-size: 11px; font-size: 3.3cqw; font-weight: 500; text-transform: uppercase; }
.ix-dob { position: absolute; left: 24%; top: 32%; display: flex; align-items: baseline; gap: 5px; gap: 1.2cqw; }
.ix-value.ix-dob__value { position: relative; font-size: 15px; font-size: 4.6cqw; font-weight: 700; letter-spacing: 0; }
.ix-label--dob { font-size: 9px; font-size: 2.6cqw; }
.ix-table { position: absolute; left: 24%; top: 42.5%; display: grid; grid-template-columns: repeat(4, auto); column-gap: 6px; column-gap: 1.7cqw; row-gap: 0; align-items: baseline; }
.ix-table .ix-value { font-size: 10px; font-size: 3.05cqw; font-weight: 700; letter-spacing: 0.02em; }
.ix-ghost { position: absolute; left: 8%; top: 58%; width: 13%; height: 30%; opacity: 0.2; filter: grayscale(1) contrast(0.8); mix-blend-mode: multiply; }
.ix-sig { position: absolute; left: 4%; top: 62%; width: 20%; height: 20%; opacity: calc(0.85 - var(--glare, 0) * 0.3); }
.ix-cond { position: absolute; left: 24%; top: 72%; font-size: 7px; font-size: 2.2cqw; font-weight: 700; color: rgb(17 17 17 / calc(1 - var(--glare, 0) * 0.42)); }
.ix-photo { position: absolute; right: 4%; top: 23%; width: 27%; height: 56%; overflow: hidden; border-radius: 1%; }
.ix-photo svg { width: 100%; height: 100%; display: block; }
.ix-brand { position: absolute; right: 4%; bottom: 4.5%; display: flex; flex-direction: column; align-items: flex-end; color: rgb(17 17 17 / calc(0.85 - var(--glare, 0) * 0.35)); }
.ix-brand__big { font: 800 12px var(--font-heading); font-size: 3.6cqw; letter-spacing: 0.02em; line-height: 1; }
.ix-brand__small { font-size: 6px; font-size: 1.6cqw; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.ix-label { font-size: 7px; font-size: 2cqw; font-weight: 700; letter-spacing: 0.02em; color: rgb(17 17 17 / calc(1 - var(--glare, 0) * 0.42)); }
.ix-no .ix-label { text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.ix-value { font-size: 12px; font-size: 3.3cqw; font-weight: 600; letter-spacing: 0.02em; line-height: 1.2; color: rgb(17 17 17 / calc(1 - var(--glare, 0) * 0.42)); }

/* The changed year: a touch heavier, bluer-black, wider set and out of line. Behind it, the
   scraped patch where the background lines stop; round it, the bubbling that shows in the light. */
.ix-year { position: relative; display: inline-block; }
.ix-year__alt, .ix-year__orig, .ix-text { position: relative; z-index: 1; }
/* Ink laid on top of the surface: in the light it stays dark and a touch glossy while the card's
   own print (under the laminate) washes out — as on a real one tilted to the light */
.ix-year__alt {
  display: inline-block; transform: rotate(calc(var(--glare, 0) * -1.6deg)); transform-origin: 0 100%;
  font-weight: 700; font-weight: calc(700 + var(--glare, 0) * 100);
  letter-spacing: calc(0em + var(--glare, 0) * 0.03em); top: calc(var(--glare, 0) * 0.1em);
  color: rgb(17 17 17); color: color-mix(in srgb, rgb(17 17 17), #000 calc(var(--glare, 0) * 100%)); /* face on: the same as the print round it */
  text-shadow: 0 0 calc(var(--glare, 0) * 0.7px) rgba(0, 0, 0, 0.7), 0 calc(var(--glare, 0) * -0.6px) 0 rgba(255, 255, 255, calc(var(--glare, 0) * 0.35));
}
.ix-patch {
  position: absolute; z-index: 0; left: -8%; right: -150%; top: -30%; bottom: -30%;
  background: radial-gradient(ellipse 60% 55% at 38% 50%, #f1d43e 55%, rgba(241, 212, 62, 0.6) 72%, transparent 88%);
  filter: blur(0.3px);
  opacity: var(--glare, 0); /* face on the lines look whole; in the light the scraped patch shows */
}
/* Guide lines along the top and foot of the card's own digits ("14", "20"), shown by the
   walkthrough's digits step: the changed ones sit off them (a touch low, a touch tilted) */
.ix-guides { display: none; position: absolute; z-index: 2; left: -0.15em; right: -0.3em; top: 0.235em; height: 0.73em; pointer-events: none;
  border-top: 1px dashed var(--sage); border-bottom: 1px dashed var(--sage); }
.show-guides [data-view="altered"] .ix-guides { display: block; }
.ix-patch-hit { position: absolute; left: 80%; right: -80%; top: -30%; bottom: -30%; } /* where the scrape shows most, just past the digits */
/* Bubbling (views/inspect.js): barely there flat, plain in the light */
.ix-bubbles {
  position: absolute; z-index: 0; left: -1.25em; top: -0.85em; width: 4.2em; height: 3em; pointer-events: none; /* under the digits, which stay crisp */
  opacity: calc(var(--glare, 0) * 0.48); /* none at all face on; never more than a hint */
}
.ix-bubbles svg { display: block; width: 100%; height: 100%; overflow: visible; }

[data-view="altered"] .ix-year__orig,
[data-view="genuine"] .ix-year__alt,
[data-view="genuine"] .ix-patch,
[data-view="genuine"] .ix-bubbles,
[data-view="genuine"] .ix-focus { display: none; }

/* The hologram is real on a scratch ID: it shifts colour as the card turns */
.ix-holo {
  position: absolute; left: 39%; top: 54.5%; width: 12%; aspect-ratio: 1; border-radius: 50%;
  color: rgba(100, 78, 0, 0.5);
  background: conic-gradient(from calc(var(--tilt, 0) * 9deg), #f1d48a, #a9dccb, #ecb3c0, #d9e6a6, #f1d48a);
  opacity: calc(0.3 + var(--glare, 0) * 0.6); mix-blend-mode: multiply;
}
.ix-holo svg { width: 100%; height: 100%; display: block; }
.ix-glare {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(105deg, transparent calc(var(--gx, 50%) - 22%), rgba(255, 255, 255, 0.6) var(--gx, 50%), transparent calc(var(--gx, 50%) + 22%));
  opacity: calc(0.12 + var(--glare, 0) * 0.65); mix-blend-mode: screen;
}


/* The lens is clipped to the card's outline: it never shows anything beyond the card */
.ix-lens-clip { position: absolute; z-index: 5; overflow: hidden; border-radius: 4.5% / 7%; pointer-events: none; }
.ix-lens {
  position: absolute; z-index: 5; width: 150px; height: 150px; border-radius: 50%; overflow: hidden;
  border: 3px solid var(--ink); background: #f1d43e; pointer-events: none;
  box-shadow: 0 10px 28px rgba(29, 29, 29, 0.3);
}
.ix-lens.ix-lens--wide { width: 200px; height: 200px; }
.ix-lens:not([hidden]) { animation: ix-lens-in var(--dur-2) var(--ease-out); }
@keyframes ix-lens-in { from { opacity: 0; transform: scale(0.92); } }
.ix-lens__inner { position: absolute; left: 0; top: 0; transform-origin: 0 0; container-type: inline-size; }
.ix-lens__inner .ix-face { border-radius: 0; }

.ix-tilt { display: flex; align-items: center; gap: 0.85rem; max-width: 520px; margin: 0 auto; }
.ix-tilt label { flex: none; font-size: 0.85rem; font-weight: 600; color: var(--ink-2); }
.ix-tilt__track { position: relative; flex: 1; display: flex; align-items: center; }
.ix-tilt input { flex: 1; width: 100%; min-height: 44px; margin: 0; accent-color: var(--ink); }
/* The face-on point: a notch at the middle (the slider snaps to it) */
.ix-tilt__mid { position: absolute; left: 50%; top: calc(50% + 9px); width: 2px; height: 8px; margin-left: -1px; border-radius: 1px; background: var(--ink-mid); pointer-events: none; }

/* What gives it away: numbered steps, the one shown, Back / Next */
.ix-guide { margin-top: 1.1rem; }
.ix-guide__start { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.9rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper-2); }
.ix-guide__start p { margin: 0; color: var(--ink-2); }
.ix-chips { list-style: none; margin: 0 0 0.75rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ix-chip {
  display: inline-flex; align-items: center; gap: 0.45rem; min-height: 44px; padding: 0 0.85rem 0 0.4rem;
  border: 1px solid var(--line-2); border-radius: var(--radius-pill); background: var(--paper);
  font: 600 0.82rem var(--font-body); color: var(--ink-2); cursor: pointer;
}
.ix-chip__num { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--ink-faint); font-size: 0.78rem; color: var(--ink-mid); }
.ix-chip.is-seen .ix-chip__num { background: var(--sage); border-color: var(--sage); color: var(--paper); }
.ix-chip[aria-current] { border-color: var(--ink); color: var(--ink); background: var(--paper-2); }
.ix-chip[aria-current] .ix-chip__num { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.ix-chip.is-seen .ix-chip__num, .ix-chip[aria-current].is-seen .ix-chip__num { background: var(--sage); border-color: var(--sage); color: var(--paper); } /* done: green, and stays green */
.ix-chip:disabled { opacity: 0.42; cursor: not-allowed; background: var(--paper-2); } /* not reached yet */
.ix-chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.ix-guide__body { min-height: 8rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper-2); }
.ix-panel__how { margin: 0; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sage); }
.ix-panel__title { margin: 0.2rem 0 0.35rem; font: 700 1.1rem var(--font-heading); letter-spacing: -0.01em; text-transform: none; color: var(--ink); }
.ix-panel__text { margin: 0; color: var(--ink-2); line-height: 1.55; }
.ix-panel--after .ix-panel__text { color: var(--ink); }
.ix-guide__nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 44px; margin-top: 0.75rem; }
.ix-panel--after { margin-top: 0.85rem; padding-top: 0.85rem; border-top: 1px solid var(--line); }
.ix-guide__count { font-size: 0.85rem; color: var(--ink-mid); }

/* Where to look: a teal outline on the card (it turns with it), gently pulsing */
.ix-focus { position: absolute; z-index: 4; border: 3px solid var(--sage); border-radius: var(--radius-xs); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95), 0 0 12px 2px rgba(46, 107, 99, 0.55); pointer-events: none; }
.ix-focus--pulse { animation: ix-focus 1.4s ease-in-out infinite; }
@keyframes ix-focus { 50% { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95), 0 0 0 9px rgba(46, 107, 99, 0.5), 0 0 16px 9px rgba(46, 107, 99, 0.3); } }

@media (max-width: 640px) {
  .inspect { padding: 1.25rem 1rem 1rem; }
  .ix-stage { padding: 1.25rem 0 1rem; }
  .ix-lens { width: 120px; height: 120px; }
  .ix-lens.ix-lens--wide { width: 150px; height: 150px; }
  .ix-chip__label { display: none; } /* numbers only on a phone; the step's title is just below */
  .ix-chip { padding: 0 0.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  .ix-card { transition: none; }
}


/* ═══ Terms and payment (docs/build-spec.md §10) ════════════════════════════════
   The manager's terms screen (one phone screen), the console's New venue page, its Terms &
   payment card and the Acceptances page. Tokens only. */
.terms-page { display: flex; justify-content: center; padding: var(--space-4) var(--space-4) var(--space-6); }
.terms-card {
  width: 100%; max-width: 560px; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: var(--space-5) var(--space-5) var(--space-5);
}
.terms-placeholder {
  margin: 0 0 var(--space-3); padding: var(--space-2) var(--space-3); font-size: 0.85rem; color: var(--clay);
  background: var(--clay-soft); border: 1px solid var(--clay-line); border-radius: var(--radius-sm);
}
.terms-title { margin: 0 0 var(--space-1); font-family: var(--font-heading); font-weight: 800; font-size: 1.5rem; line-height: 1.2; }
.terms-lede { margin: 0 0 var(--space-4); color: var(--ink-2); font-size: 0.95rem; }
.terms-facts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2) var(--space-4); margin: 0 0 var(--space-4); }
.terms-facts div { min-width: 0; }
.terms-facts dt { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-mid); }
.terms-facts dd { margin: 0.1rem 0 0; font-weight: 600; font-size: 0.92rem; overflow-wrap: anywhere; }
.terms-courses { width: 100%; margin: 0 0 var(--space-3); border-collapse: collapse; font-size: 0.9rem; }
.terms-courses td { padding: var(--space-1) 0; border-bottom: 1px solid var(--line); }
.terms-courses td, .terms-courses th { padding: var(--space-1) 0; border-bottom: 1px solid var(--line); text-align: left; }
.terms-courses thead th { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-mid); }
.terms-courses td + td, .terms-courses th + th, .terms-courses tfoot td { text-align: right; white-space: nowrap; font-weight: 600; padding-left: var(--space-3); }
.terms-courses tfoot th { font-weight: 700; }
.op-inline-form { display: inline; margin: 0; }
.nv-after { border: 0; margin: 0; padding: 0; display: grid; gap: var(--space-1); }
.nv-after[hidden] { display: none; }
.terms-payby { border: 0; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.terms-payby legend { padding: 0; margin-bottom: var(--space-2); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-mid); }
.terms-check input[type="radio"] { accent-color: var(--ink); }
.terms-points { margin: 0 0 var(--space-3); padding-left: 1.1rem; font-size: 0.88rem; color: var(--ink-2); }
.terms-points li { margin-bottom: var(--space-1); }
.terms-disclaimer {
  margin: 0 0 var(--space-3); padding: var(--space-3); font-size: 0.8rem; line-height: 1.5; color: var(--ink-2);
  background: var(--cream); border-left: 3px solid var(--amber); border-radius: var(--radius-xs);
}
.terms-full { margin: 0 0 var(--space-4); font-size: 0.92rem; font-weight: 600; }
.terms-full a { color: var(--amber-hover); }
.terms-form { display: grid; gap: var(--space-3); }
.terms-check { display: flex; gap: var(--space-3); align-items: flex-start; font-size: 0.95rem; cursor: pointer; min-height: 44px; }
.terms-check input { flex: none; width: 22px; height: 22px; margin: 0.1rem 0 0; accent-color: var(--ink); }
.terms-name-label { margin: 0; }
.terms-submit:disabled { opacity: 0.45; }
@media (max-width: 480px) {
  .terms-page { padding: var(--space-2) var(--space-2) var(--space-5); }
  .terms-card { padding: var(--space-4); border-radius: var(--radius); }
  .terms-title { font-size: 1.3rem; }
}
/* The Plan Order (views/terms.js): five labelled steps in one card, tiles for what leaves the account,
   cards for how to pay, consents in plain body text. Tokens only. */
.po-card { max-width: 680px; box-shadow: none; }
.po-top { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-3); }
.po-ref { margin: 0; font-size: 0.85rem; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.po-section { padding: var(--space-4) 0; border-top: 1px solid var(--line); }
.po-section:first-of-type { margin-top: var(--space-2); }
.po-label { margin: 0 0 var(--space-3); font-family: var(--font-body); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.po-card .terms-facts dt { color: var(--ink-2); }
.po-card .terms-facts { margin-bottom: var(--space-2); }
.po-help { margin: var(--space-2) 0 0; font-size: 1rem; color: var(--ink-2); }
.po-help a, .po-check a, .po-group a, .po-actions a:not(.btn) { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.po-course { margin: 0 0 var(--space-3); font-weight: 700; font-size: 1.05rem; }
.po-free { margin: 0; font-size: 1.05rem; font-weight: 600; }
.po-cap { text-align: left; font-size: 0.85rem; color: var(--ink-2); padding-bottom: var(--space-1); }
.po-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.po-tile { padding: var(--space-3); background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius); }
.po-tile p { margin: 0; }
.po-tile__label { font-size: 0.85rem; font-weight: 700; color: var(--ink-2); }
.po-tile__figure { margin-top: var(--space-1) !important; font-family: var(--font-heading); font-weight: 800; font-size: 1.5rem; line-height: 1.2; }
.po-tile__figure span { font-family: var(--font-body); font-weight: 600; font-size: 0.85rem; color: var(--ink-2); }
.po-tile__note { margin-top: var(--space-1) !important; font-size: 1rem; line-height: 1.5; color: var(--ink-2); }
.po-group { margin-bottom: var(--space-3); }
.po-group h3 { margin: 0 0 var(--space-1); font-family: var(--font-body); font-size: 1rem; font-weight: 700; }
.po-group ul { margin: 0; padding-left: 1.1rem; font-size: 1rem; line-height: 1.6; color: var(--ink); }
.po-group li { margin-bottom: var(--space-1); }
.po-form { display: block; }
.po-form .po-section:first-child { border-top: 1px solid var(--line); }
.po-pay { border: 0; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.po-choice, .po-check { display: flex; gap: var(--space-3); align-items: flex-start; cursor: pointer; min-height: 44px; font-size: 1rem; line-height: 1.5; color: var(--ink); }
.po-choice { padding: var(--space-3); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); transition: var(--t-control); }
.po-choice > span { display: grid; gap: 2px; }
.po-choice strong { font-weight: 600; }
.po-choice > span > span { color: var(--ink-2); }
.po-choice:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: var(--cream); }
.po-choice:has(input:focus-visible), .po-check:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.po-choice input, .po-check input { flex: none; width: 24px; height: 24px; margin: 0.1rem 0 0; accent-color: var(--ink); }
@media (hover: hover) { .po-choice:hover { border-color: var(--ink-2); } }
.po-next { margin: var(--space-3) 0 0; font-size: 1rem; line-height: 1.5; color: var(--ink); }
.po-next[hidden], .po-missing:empty { display: none; }
.po-check { margin-bottom: var(--space-3); }
.po-name { display: grid; gap: var(--space-1); margin-bottom: var(--space-3); }
.po-name label { font-weight: 600; }
.po-name .po-help { margin: 0; font-size: 0.9rem; }
.po-missing { margin: 0 0 var(--space-2); font-size: 1rem; color: var(--ink-2); }
.po-error { margin: 0 0 var(--space-3); padding: var(--space-2) var(--space-3); font-size: 1rem; color: var(--ink); background: var(--amber-soft, var(--cream)); border: 1px solid var(--amber); border-left-width: 4px; border-radius: var(--radius-sm); }
.po-card .terms-submit { min-height: 48px; }
.terms-submit.is-sending::before { content: ""; display: inline-block; width: 1em; height: 1em; margin-right: 0.5em; vertical-align: -0.15em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: po-spin 0.7s linear infinite; }
@keyframes po-spin { to { transform: rotate(360deg); } }
.po-done .po-section { border-top: 1px solid var(--line); margin-top: var(--space-3); padding-bottom: 0; }
.po-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); margin-top: var(--space-4); }
@media (max-width: 640px) {
  .po-top { flex-direction: column; gap: var(--space-2); }
  .po-tiles, .po-card .terms-facts { grid-template-columns: 1fr; }
  .po-card .terms-submit, .po-actions .btn { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .terms-submit.is-sending::before { animation-duration: 2s; } }
/* The dashboard's billing card (views/billing.js): an invoice to pay, the monthly plan, Manage billing */
.bill-card {
  margin: 0 0 var(--space-5); padding: var(--space-4) var(--space-5); background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.bill-row + .bill-row { margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--line); }
.bill-row p { margin: 0 0 var(--space-2); }
/* An unpaid invoice: the red Unpaid pill on the far right, the details beside it */
.bill-row--invoice { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-3); align-items: start; }
.bill-row--invoice > :not(.bill-unpaid) { grid-column: 1; }
.bill-unpaid { grid-column: 2; grid-row: 1; justify-self: end; white-space: nowrap; }
.bill-row .btn { margin-right: var(--space-2); }
.bill-offer strong { font-family: var(--font-heading); }
.bill-note { font-size: 0.85rem; color: var(--ink-mid); }
/* "Keep … going?": the case for carrying on monthly, then the box, the name and the buttons */
/* A dark band in the brand's ink (logo, the question, their results and the end date in amber), then
   on paper the price, what they get, and the agreement. Flat colour, no gradient. */
.bill-keep { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-2); background: var(--paper); box-shadow: var(--shadow); }
.bill-row + .bill-keep { margin-top: var(--space-4); padding-top: 0; }
.bill-keep p { margin: 0; }
.bill-keep__hero { background: var(--ink); color: var(--cream); padding: var(--space-5) var(--space-5) var(--space-5); }
.bill-keep__brand { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); }
.bill-keep__logo { width: 88px; height: auto; flex: none; }
.bill-keep__eyebrow { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--amber); }
.bill-keep__title { margin: 0 0 var(--space-3); font-family: var(--font-heading); font-weight: 800; font-size: clamp(1.45rem, 1.1rem + 1.5vw, 2rem); line-height: 1.15; letter-spacing: -0.01em; color: var(--paper); }
.bill-keep__lead { max-width: 60ch; color: rgba(245,241,231,0.78); line-height: 1.55; }
.bill-keep__facts { display: grid; grid-template-columns: 1fr 1fr; margin-top: var(--space-5); border-top: 1px solid rgba(245,241,231,0.16); }
.bill-keep__facts--one { grid-template-columns: 1fr; }
.bill-keep__fact { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-4) var(--space-4) 0 0; }
.bill-keep__fact + .bill-keep__fact { padding-left: var(--space-4); border-left: 1px solid rgba(245,241,231,0.16); }
.bill-keep__num { font-family: var(--font-heading); font-weight: 800; font-size: 2.4rem; line-height: 1; color: var(--amber); font-variant-numeric: tabular-nums; }
.bill-keep__num--date { font-size: 1.6rem; padding-top: 0.4rem; }
.bill-keep__fact-text { font-size: 0.9rem; color: rgba(245,241,231,0.78); }
.bill-keep__body { padding: var(--space-5); }
/* Several courses: each on the band with its results and end date, then each its own price and agreement */
.bill-keep__courses { list-style: none; margin: var(--space-5) 0 0; padding: 0; border-top: 1px solid rgba(245,241,231,0.16); }
.bill-keep__courses li { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-3) 0; border-bottom: 1px solid rgba(245,241,231,0.16); }
.bill-keep__course-name { font-family: var(--font-heading); font-weight: 700; color: var(--paper); }
.bill-keep__course-meta { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); font-size: 0.9rem; color: rgba(245,241,231,0.78); }
.bill-keep__course-meta strong { color: var(--amber); font-weight: 700; }
.bill-keep__offer + .bill-keep__offer { margin-top: var(--space-5); padding-top: var(--space-5); border-top: 1px solid var(--line); }
.bill-keep__offer-title { margin: 0 0 var(--space-3); font-family: var(--font-heading); font-weight: 800; font-size: 1.2rem; line-height: 1.25; letter-spacing: 0; text-transform: none; color: var(--ink); }
.bill-keep--many .bill-keep__price { border-bottom: 0; padding-bottom: 0; }
.bill-keep__price { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5); padding-bottom: var(--space-4); margin-bottom: var(--space-4); border-bottom: 1px solid var(--line); }
.bill-keep__amount { display: flex; align-items: baseline; gap: var(--space-2); white-space: nowrap; }
.bill-keep__dollars { font-family: var(--font-heading); font-weight: 800; font-size: 2.6rem; line-height: 1; color: var(--ink); letter-spacing: -0.02em; }
.bill-keep__per { font-weight: 600; color: var(--ink-2); }
.bill-keep__price-text { flex: 1 1 260px; color: var(--ink-2); line-height: 1.5; }
.bill-keep__price-text strong { color: var(--ink); }
.bill-keep__label { margin: 0 0 var(--space-3) !important; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-mid); }
.bill-keep__benefits { list-style: none; margin: 0 0 var(--space-5); padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-3) var(--space-5); }
.bill-keep__benefits li { display: flex; gap: var(--space-3); align-items: flex-start; line-height: 1.5; color: var(--ink-2); }
.bill-keep__benefits strong { display: block; color: var(--ink); }
.bill-keep__tick { flex: none; width: 20px; height: 20px; margin-top: 2px; }
.bill-keep__tick circle { fill: var(--sage); }
.bill-keep__tick path { fill: none; stroke: var(--paper); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
/* Scrolled into view, each tick pops in and its mark is drawn, as if ticked, then stays. Armed only by
   public/js/manager.js (so without it, or with reduced motion, the ticks simply show) */
.bill-keep__benefits.is-armed .bill-keep__tick circle { transform: scale(0); transform-box: fill-box; transform-origin: center; transition: transform var(--dur-3) var(--ease-spring) var(--tick-delay, 0ms); }
.bill-keep__benefits.is-armed .bill-keep__tick path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset var(--dur-3) var(--ease-out) calc(var(--tick-delay, 0ms) + var(--dur-2)); }
.bill-keep__benefits.is-armed li.is-ticked .bill-keep__tick circle { transform: scale(1); }
.bill-keep__benefits.is-armed li.is-ticked .bill-keep__tick path { stroke-dashoffset: 0; }
@media (prefers-reduced-motion: reduce) { .bill-keep__benefits.is-armed .bill-keep__tick circle, .bill-keep__benefits.is-armed .bill-keep__tick path { transform: none; stroke-dashoffset: 0; transition: none; } }
.bill-keep__form { gap: var(--space-2); padding: var(--space-4); background: var(--cream-2); border-radius: var(--radius-sm); }
.bill-keep__form .bill-keep__label { margin: 0 !important; }
.bill-keep__form .terms-name-label { margin-top: var(--space-1); }
.bill-keep__form .bill-name { margin: 0 0 var(--space-2); }
/* Alone, or first, on the billing card: the box fills the card to its edges instead of a card in a card */
.bill-card:has(> .bill-keep) { overflow: hidden; }
.bill-card > .bill-keep:first-child { margin: calc(var(--space-4) * -1) calc(var(--space-5) * -1) 0; border: 0; border-radius: 0; box-shadow: none; }
.bill-card > .bill-keep:last-child { margin-bottom: calc(var(--space-4) * -1); }
.bill-card > .bill-keep:not(:first-child) { margin-left: calc(var(--space-5) * -1); margin-right: calc(var(--space-5) * -1); border-left: 0; border-right: 0; border-radius: 0; box-shadow: none; }
.bill-keep__form .terms-check { line-height: 1.5; }
.bill-keep__form .bill-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0; }
.bill-keep__form .bill-name { background: var(--paper); }
@media (max-width: 480px) {
  .bill-card > .bill-keep:first-child, .bill-card > .bill-keep:not(:first-child) { margin-left: calc(var(--space-4) * -1); margin-right: calc(var(--space-4) * -1); }
}
/* A phone */
@media (max-width: 640px) {
  .bill-keep__hero, .bill-keep__body { padding: var(--space-4); }
  .bill-keep__facts { grid-template-columns: 1fr; }
  .bill-keep__fact + .bill-keep__fact { padding-left: 0; border-left: 0; border-top: 1px solid rgba(245,241,231,0.16); margin-top: var(--space-4); }
  .bill-keep__form .bill-actions .btn--primary { flex: 1 1 100%; justify-content: center; }
}
.bill-approve .terms-name-label { display: block; margin-top: var(--space-2); font-weight: 600; font-size: 0.9rem; }
.bill-name { width: 100%; max-width: 360px; margin: var(--space-1) 0 var(--space-3); }
/* Pressed with the box not ticked (or no name typed): it pulses amber, then stays highlighted until done */
.bill-approve .terms-check { border-radius: var(--radius-sm); transition: background var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out); }
.bill-approve .is-nudge { background: var(--amber-soft); box-shadow: 0 0 0 2px var(--amber); animation: bill-nudge var(--dur-4) var(--ease-in-out) 2; }
.bill-approve .terms-check.is-nudge { padding: var(--space-1) var(--space-2); }
@keyframes bill-nudge { 50% { box-shadow: 0 0 0 7px var(--amber-soft), 0 0 0 2px var(--amber); transform: scale(1.015); } }
@media (prefers-reduced-motion: reduce) { .bill-approve .is-nudge { animation: none; } }
.bill-overdue { display: block; margin-top: var(--space-1); color: var(--clay); font-weight: 600; }
.bill-manage { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: var(--space-3) 0 0; padding-top: var(--space-3); border-top: 1px solid var(--line); }
@media (max-width: 480px) { .bill-card { padding: var(--space-3) var(--space-4); } }
.mgr-notice {
  margin: 0 0 var(--space-4); padding: var(--space-3) var(--space-4); font-size: 0.92rem; color: var(--ink);
  background: var(--amber-soft); border: 1px solid var(--amber-line); border-radius: var(--radius-sm);
}

/* New venue: a page of short fieldsets, one column on a phone, Create venue kept in reach */
/* Centred on a computer; full width (with the console's padding) on a phone */
.nv-page { max-width: 760px; margin: 0 auto; box-sizing: content-box; }
.nv-form { display: grid; gap: var(--space-4); }
.nv-group { margin: 0; padding: var(--space-4) var(--space-5) var(--space-2); background: var(--paper); border: 1px solid var(--warm-line); border-radius: var(--radius); }
.nv-group legend { padding: 0 var(--space-2); margin-left: calc(-1 * var(--space-2)); font-family: var(--font-heading); font-weight: 800; font-size: 1.05rem; }
.nv-legend-note { font-family: var(--font-body); font-weight: 400; font-size: 0.82rem; color: var(--ink-mid); }
.nv-field { margin-bottom: var(--space-3); min-width: 0; }
.nv-field label, .nv-label { display: block; margin: 0 0 var(--space-1); }
.nv-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--space-4); }
.nv-note { margin: var(--space-1) 0 0; font-size: 0.8rem; color: var(--ink-mid); }
.nv-auto { margin: 0; }
.nv-choice { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.nv-choice label {
  display: flex; align-items: center; gap: var(--space-2); min-height: 44px; padding: 0 var(--space-4); margin: 0;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--paper); cursor: pointer;
  text-transform: none; letter-spacing: normal; font-size: 0.95rem; color: var(--ink); font-weight: 500;
  transition: border-color var(--dur-1), background var(--dur-1);
}
.nv-choice label:has(input:checked) { border-color: var(--ink); background: var(--cream-2); }
.nv-choice input, .nv-check input { accent-color: var(--ink); width: 18px; height: 18px; }
.nv-check { display: flex; align-items: center; gap: var(--space-2); min-height: 44px; margin: 0 0 var(--space-3);
  text-transform: none; letter-spacing: normal; font-size: 0.95rem; color: var(--ink); font-weight: 500; cursor: pointer; }
.nv-form input[readonly] { background: var(--cream-2); color: var(--ink-2); }
.nv-submit {
  position: sticky; bottom: 0; z-index: 2; display: flex; justify-content: flex-end; gap: var(--space-2);
  padding: var(--space-3) 0; background: linear-gradient(to top, var(--cream) 70%, transparent);
}
@media (max-width: 640px) {
  .nv-row { grid-template-columns: 1fr; }
  .nv-group { padding: var(--space-3) var(--space-4) var(--space-1); }
  .nv-submit .btn { flex: 1; justify-content: center; }
}

/* The venue page's Terms & payment card, and the Acceptances page */
.op-terms-line { margin: 0 0 var(--space-3); font-size: 0.9rem; line-height: 1.6; }
.op-muted { color: var(--ink-mid); font-size: 0.85em; }
.op-block { display: block; }
.op-invoice { margin: 0 0 var(--space-3); padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); }
.op-invoice p { margin: 0 0 var(--space-1); }
.op-invoice__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.op-invoice__lines { margin: 0 0 var(--space-1); padding-left: 1.1rem; font-size: 0.88rem; }
/* The Courses part of New venue and Add courses */
.nv-courses { display: grid; gap: var(--space-2); margin-bottom: var(--space-3); }
.nv-course { display: flex; align-items: flex-start; gap: var(--space-3); min-height: 44px; padding: var(--space-2) var(--space-3); margin: 0;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--paper); cursor: pointer;
  text-transform: none; letter-spacing: normal; font-size: 0.95rem; color: var(--ink); font-weight: 400; }
.nv-course:has(input:checked) { border-color: var(--ink); background: var(--cream-2); }
.nv-course input { accent-color: var(--ink); width: 18px; height: 18px; margin-top: 0.15rem; flex: none; }
.nv-course[hidden] { display: none; }
.nv-total { margin: 0 0 var(--space-3); font-weight: 600; }
.op-pay-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.op-publish { margin-top: var(--space-4); }
.op-publish summary { cursor: pointer; display: inline-block; }
.op-publish__form { display: grid; gap: var(--space-2); max-width: 520px; margin-top: var(--space-3); }
.op-publish__mode { margin: var(--space-2) 0; padding: 0; border: 0; display: grid; gap: var(--space-2); }
.op-publish__mode legend { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-mid); margin-bottom: var(--space-1); }
.nv-bands.op-publish__modes { margin-bottom: 0; }
.op-publish__modes .nv-band { align-content: start; }
.op-publish__modes .nv-band:last-child { grid-column: auto; }
.op-publish__status { margin: 0; font-size: 0.88rem; color: var(--clay); }
.op-acc-filter select { min-height: 40px; padding-top: 0.5rem; padding-bottom: 0.5rem; }
.op-acc-table td { vertical-align: top; }

/* ═══ Motion and finish ═════════════════════════════════════════════════════════
   Last in the file on purpose: it settles every control the same way. Timings, curves,
   radii and shadows all come from the tokens at the top, never from numbers here.
   Transforms only on things with nothing fixed inside them (a transform would move a
   fixed bar with its parent). Everything still works with all of it switched off. */

/* ── Buttons: lift on hover, press down on click, the arrow nudges on ───────────── */
.btn { transition: var(--t-control); -webkit-tap-highlight-color: transparent; }
.btn:not(:disabled):not(.btn--sending):active {
  transform: translateY(0) scale(0.97);
  box-shadow: var(--shadow-press);
  transition-duration: var(--dur-1);
}
@media (hover: hover) {
  .btn:not(:disabled):not(.btn--sending):hover { transform: translateY(-1px); }
  .btn--primary:not(:disabled):not(.btn--sending):hover { box-shadow: var(--shadow-lift), var(--glow-amber); }
  .btn--secondary:not(:disabled):hover,
  .btn--ghost:not(:disabled):hover { box-shadow: var(--shadow); }
  .btn--remove:not(:disabled):hover { box-shadow: var(--shadow-lift); }
  .btn:not(:disabled):not(.btn--sending):active { transform: translateY(0) scale(0.97); box-shadow: var(--shadow-press); } /* the press beats the hover */
}
.btn:disabled { cursor: not-allowed; }

.arrow, .resume-card__arrow { display: inline-block; transition: transform var(--dur-2) var(--ease-spring); }
@media (hover: hover) {
  :is(a, button):not(:disabled):hover > .arrow,
  .resume-card:hover .resume-card__arrow { transform: translateX(3px); }
}
:is(a, button):focus-visible > .arrow { transform: translateX(3px); }

/* Small round and pill controls: the same press, a shade quicker */
:is(.copy-btn, .qn-btn, .btn-cancel, .btn-expiry, .op-menu__btn, .act-chip, .ix-chip, .qz-dot,
    .sig-clear, .scenario-reload, .qo-move, .toast__close, .staff-topbar__menu, .staff-sidebar__close) {
  transition: var(--t-control);
  -webkit-tap-highlight-color: transparent;
}
:is(.copy-btn, .qn-btn, .btn-cancel, .btn-expiry, .op-menu__btn, .act-chip, .ix-chip, .qz-dot,
    .sig-clear, .scenario-reload, .qo-move, .toast__close, .staff-topbar__menu, .staff-sidebar__close):not(:disabled):active {
  transform: scale(0.94);
  transition-duration: var(--dur-1);
}
@media (hover: hover) {
  :is(.qn-btn, .ix-chip, .act-chip):not(:disabled):hover { box-shadow: var(--shadow-sm); }
}

/* ── Cards: hairline border, layered shadow, a spring lift where they're links ───── */
.resume-card, .module-row { transition: var(--t-control); }
@media (hover: hover) {
  .resume-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
  .module-row--link:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--line-2); }
}
.resume-card:active, .module-row--link:active { transform: scale(0.99); transition-duration: var(--dur-1); }
.quiz-option { transition: var(--t-control); }
@media (hover: hover) { .quiz-option:not(.is-checked):hover { background: var(--paper-2); } }
.quiz-option:active { transform: scale(0.995); transition-duration: var(--dur-1); }

/* ── Toggle groups: the dark pill slides to the chosen option ─────────────────────
   public/js/pill.js adds the pill and .has-pill once it has measured; until then (or
   without it) the chosen button is simply dark, as before. */
[data-pill] { position: relative; isolation: isolate; }
[data-pill] > button { position: relative; transition: color var(--dur-1) var(--ease-out); }
.seg-pill {
  position: absolute; left: 0; top: 0; z-index: -1; width: 0; height: 0;
  border-radius: var(--radius-pill); background: var(--ink); box-shadow: var(--shadow-sm);
  pointer-events: none; opacity: 0;
}
[data-pill].has-pill > .seg-pill { opacity: 1; }
[data-pill].pill-ready > .seg-pill {
  transition: transform var(--dur-3) var(--ease-spring), width var(--dur-3) var(--ease-spring), height var(--dur-3) var(--ease-spring);
}
[data-pill].has-pill > button[aria-pressed="true"] { background: transparent; }
[data-pill] > button:active { transform: scale(0.96); transition: transform var(--dur-1) var(--ease-out); }
@media (hover: hover) { [data-pill] > button[aria-pressed="false"]:hover { color: var(--ink); } }

/* ── The tilt slider: a filled track from the face-on middle to the handle ──────── */
.ix-tilt input[type="range"] {
  --p: 50%; /* public/js/inspect.js moves it with the handle */
  --lo: min(50%, var(--p)); --hi: max(50%, var(--p));
  -webkit-appearance: none; appearance: none;
  height: 44px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; cursor: grab;
}
.ix-tilt input[type="range"]:hover,
.ix-tilt input[type="range"]:focus { border: 0; background: transparent; box-shadow: none; outline: none; }
.ix-tilt input[type="range"]:active { cursor: grabbing; }
.ix-tilt input[type="range"]::-webkit-slider-runnable-track {
  height: 6px; border-radius: var(--radius-pill);
  background: linear-gradient(to right, var(--sand) var(--lo), var(--ink) var(--lo) var(--hi), var(--sand) var(--hi));
  box-shadow: inset 0 1px 1px rgba(29,29,29,0.08);
}
.ix-tilt input[type="range"]::-moz-range-track {
  height: 6px; border-radius: var(--radius-pill);
  background: linear-gradient(to right, var(--sand) var(--lo), var(--ink) var(--lo) var(--hi), var(--sand) var(--hi));
}
.ix-tilt input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--ink); box-shadow: var(--shadow-thumb);
  transition: transform var(--dur-2) var(--ease-spring), box-shadow var(--dur-2) var(--ease-out);
}
.ix-tilt input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--ink); box-shadow: var(--shadow-thumb);
  transition: transform var(--dur-2) var(--ease-spring), box-shadow var(--dur-2) var(--ease-out);
}
@media (hover: hover) {
  .ix-tilt input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.08); }
  .ix-tilt input[type="range"]:hover::-moz-range-thumb { transform: scale(1.08); }
}
.ix-tilt input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.22); box-shadow: var(--shadow-thumb), 0 0 0 7px rgba(29,29,29,0.08); }
.ix-tilt input[type="range"]:active::-moz-range-thumb { transform: scale(1.22); box-shadow: var(--shadow-thumb), 0 0 0 7px rgba(29,29,29,0.08); }
.ix-tilt input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: var(--shadow-thumb), 0 0 0 3px var(--paper), 0 0 0 5px var(--amber-hover); }
.ix-tilt input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: var(--shadow-thumb), 0 0 0 3px var(--paper), 0 0 0 5px var(--amber-hover); }
.ix-tilt__mid { top: calc(50% + 13px); height: 6px; } /* clear of the handle, which is face on over it */

/* ── The on/off switch: hover and keyboard states to match ────────────────────── */
@media (hover: hover) { .op-switch:not(:checked):hover { border-color: var(--ink-dim); } }
.op-switch:focus-visible { outline: 2px solid var(--amber-hover); outline-offset: 2px; }

/* ── Pages and sections arriving ──────────────────────────────────────────────── */
@keyframes fade-in { from { opacity: 0; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(8px); } }
/* An assessment question slides in from the side it's travelling to; the first of a new part
   draws its part rule in (public/js/quiz.js). Back and Next sit outside the question, so nothing
   fixed moves with it. */
.quiz-question.is-arriving { animation: qz-in var(--dur-3) var(--ease-out); }
.quiz-question.is-arriving-back { animation: qz-in-back var(--dur-3) var(--ease-out); }
.quiz-question.is-new-part .qz-part { animation: fade-in var(--dur-4) var(--ease-out); }
.quiz-question.is-new-part .qz-part::after { animation: qz-rule var(--dur-4) 120ms var(--ease-out) backwards; }
@keyframes qz-in { from { opacity: 0; transform: translateX(18px); } }
@keyframes qz-in-back { from { opacity: 0; transform: translateX(-18px); } }
@keyframes qz-rule { from { transform: scaleX(0); } }
.qz-start { animation: rise-in var(--dur-3) var(--ease-out); }
.qz-map__row { animation: rise-in var(--dur-3) var(--ease-out) backwards; animation-delay: calc(80ms + var(--i, 0) * 40ms); }
@media (prefers-reduced-motion: reduce) {
  .quiz-question.is-arriving, .quiz-question.is-arriving-back, .quiz-question.is-new-part .qz-part,
  .quiz-question.is-new-part .qz-part::after, .qz-start, .qz-map__row, .qz-why { animation: none; }
}
main.main-content > * { animation: fade-in var(--dur-3) var(--ease-out); }
.staff-main__inner > .overview,
.staff-main__inner > .module-page,
.staff-main__inner > .quiz-page { animation: fade-in var(--dur-3) var(--ease-out); } /* no transform: the module page holds fixed bars */
/* The course list settles in a row at a time ("backwards": the hover lift stays free after) */
.module-list > .module-row { animation: rise-in var(--dur-3) var(--ease-out) backwards; }
.module-list > .module-row:nth-child(2) { animation-delay: 30ms; }
.module-list > .module-row:nth-child(3) { animation-delay: 60ms; }
.module-list > .module-row:nth-child(4) { animation-delay: 90ms; }
.module-list > .module-row:nth-child(5) { animation-delay: 120ms; }
.module-list > .module-row:nth-child(6) { animation-delay: 150ms; }
.module-list > .module-row:nth-child(7) { animation-delay: 180ms; }
.module-list > .module-row:nth-child(n+8) { animation-delay: 210ms; }

/* Dialogs and the move sheet rise in; their backdrops fade */
.op-dialog[open] { animation: dialog-in var(--dur-3) var(--ease-spring); }
.qg-sheet[open] { animation: sheet-in var(--dur-3) var(--ease-spring); }
.op-dialog[open]::backdrop, .qg-sheet[open]::backdrop { animation: fade-in var(--dur-2) var(--ease-out); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px) scale(0.97); } }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
.op-dialog { border-color: var(--line); box-shadow: var(--shadow-lg); }

/* Menus pop from their button; opened details fade their contents in */
.op-menu[open] > .op-menu__list { transform-origin: right center; animation: menu-in var(--dur-2) var(--ease-spring); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-50%) scale(0.94); } }
details:not(.op-menu)[open] > :not(summary) { animation: fade-in var(--dur-2) var(--ease-out); }

.toast { animation: toast-in var(--dur-3) var(--ease-spring); box-shadow: var(--shadow-lg); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; } /* once: a repeat at 1ms would flicker */
  .btn:active, :is(.copy-btn, .qn-btn, .ix-chip, .act-chip):active, .resume-card:hover, .module-row--link:hover,
  :is(.nv-course, .nv-band, .nv-choice > label, [data-pill] > label):active { transform: none !important; }
}

/* ── The video player's controls (public/js/video-player.js) ──────────────────────
   Light on the dark picture. Amber only for how far along it is. */
.vp-wrap { position: relative; }
.vp-wrap:not(.vp-sized) video { aspect-ratio: 16 / 9; } /* no jump when the video's size arrives */
.vp-wrap:fullscreen { display: flex; align-items: center; border-radius: 0; background: #000; }
.vp-wrap:fullscreen video { width: 100%; height: 100%; object-fit: contain; }
video[hidden] ~ .vp { display: none; }
.vp {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
  color: var(--paper); cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
}
.vp--idle { cursor: none; }
.vp__bar {
  position: relative; z-index: 2; padding: 2.5rem var(--space-3) var(--space-1); cursor: default;
  background: linear-gradient(to top, rgba(29,29,29,0.82), rgba(29,29,29,0));
  transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out);
}
.vp--idle .vp__bar { opacity: 0; transform: translateY(6px); pointer-events: none; }
.vp__row { display: flex; align-items: center; gap: var(--space-1); min-height: 44px; }
.vp__gap { flex: 1; }
.vp__btn {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--radius-pill);
  background: transparent; color: var(--paper); cursor: pointer; transition: var(--t-control);
}
.vp__btn:active { transform: scale(0.92); transition-duration: var(--dur-1); }
.vp__btn:focus-visible, .vp__seek:focus-visible, .vp__volume:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }
.vp__btn.is-on { background: var(--paper); color: var(--ink); } /* captions on: plainly on */
.vp__btn.is-unavailable { opacity: 0.45; }
@media (hover: hover) { .vp__btn.is-on:hover { background: var(--paper); } }
/* Captions sit above the bar while it shows, and lower once it has stepped back */
.vp__cue {
  position: absolute; z-index: 1; left: 50%; bottom: 5.75rem; transform: translateX(-50%); max-width: 86%; padding: 0.25em 0.6em; pointer-events: none;
  border-radius: var(--radius-xs); background: rgba(29,29,29,0.82); color: var(--paper); text-align: center; white-space: pre-line;
  font-size: clamp(0.85rem, 2.3vw, 1.25rem); font-weight: 500; line-height: 1.35; transition: bottom var(--dur-2) var(--ease-out);
}
.vp--idle .vp__cue { bottom: var(--space-4); }
.vp__time { flex: none; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.vp__chapter { min-width: 0; margin-left: var(--space-3); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 0.82rem; opacity: 0.8; }
@media (hover: hover) { .vp__btn:hover { background: rgba(251,249,242,0.16); } }

/* The middle play button */
.vp__big {
  position: absolute; z-index: 2; left: 50%; top: 50%; width: 72px; height: 72px; margin: -36px 0 0 -36px;
  background: var(--paper); color: var(--ink); box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden;
}
.vp__big svg { width: 34px; height: 34px; }
.vp--paused .vp__big { opacity: 1; visibility: visible; }
@media (hover: hover) { .vp__big:hover { background: var(--paper); transform: scale(1.07); } }

/* The bar: the rail, how far has been watched, how far along it is now, chapter marks */
.vp__track { position: relative; display: flex; align-items: center; height: 24px; }
.vp__rail { position: absolute; left: 0; right: 0; height: 5px; border-radius: var(--radius-pill); background: rgba(251,249,242,0.26); transition: height var(--dur-1) var(--ease-out); }
.vp__track:hover .vp__rail { height: 7px; }
.vp__watched, .vp__played { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; }
.vp__watched { background: rgba(251,249,242,0.5); }
.vp__played { background: var(--amber); }
.vp__mark { position: absolute; top: -1px; bottom: -1px; width: 3px; margin-left: -1px; background: var(--ink); }
.vp__seek, .vp__volume { -webkit-appearance: none; appearance: none; margin: 0; padding: 0; border: 0; background: transparent; cursor: pointer; }
.vp__seek { position: relative; width: 100%; height: 24px; touch-action: pan-y; }
.vp__seek::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--paper); box-shadow: var(--shadow-thumb);
  transition: transform var(--dur-2) var(--ease-spring);
}
.vp__seek::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: var(--paper); box-shadow: var(--shadow-thumb); transition: transform var(--dur-2) var(--ease-spring); }
.vp__seek:active::-webkit-slider-thumb { transform: scale(1.3); }
.vp__seek:active::-moz-range-thumb { transform: scale(1.3); }
.vp__tip {
  position: absolute; bottom: 100%; margin-bottom: var(--space-1); transform: translateX(-50%); padding: 0.2rem 0.5rem; max-width: 70%;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border-radius: var(--radius-xs); background: var(--ink); color: var(--paper); font-size: 0.75rem; pointer-events: none;
}
.vp__volume { --fill: 100%; width: 88px; height: 44px; touch-action: none; }
.vp__seek, .vp__volume { -webkit-user-select: auto; user-select: auto; }
/* The site's rules for inputs would paint a focused slider as a solid box */
.vp__seek:hover, .vp__seek:focus, .vp__volume:hover, .vp__volume:focus { border: 0; background: transparent; box-shadow: none; }
.vp__seek:focus:not(:focus-visible), .vp__volume:focus:not(:focus-visible) { outline: none; }
.vp__volume::-webkit-slider-runnable-track { height: 5px; border-radius: var(--radius-pill); background: linear-gradient(to right, var(--paper) var(--fill), rgba(251,249,242,0.3) var(--fill)); }
.vp__volume::-moz-range-track { height: 5px; border-radius: var(--radius-pill); background: linear-gradient(to right, var(--paper) var(--fill), rgba(251,249,242,0.3) var(--fill)); }
.vp__volume::-webkit-slider-thumb { -webkit-appearance: none; width: 15px; height: 15px; margin-top: -5px; border-radius: 50%; background: var(--paper); }
.vp__volume::-moz-range-thumb { width: 15px; height: 15px; border: 0; border-radius: 50%; background: var(--paper); }
@media (hover: none) { .vp__volume { display: none; } } /* a phone's own buttons set the volume */
@media (max-width: 480px) { .vp__chapter { display: none; } .vp__bar { padding-left: var(--space-2); padding-right: var(--space-2); } }

/* Waiting: a shimmer until the video has loaded, a spinner when it stalls */
.vp__skeleton { position: absolute; inset: 0; background: var(--ink); pointer-events: none; }
.vp__skeleton::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(251,249,242,0.07) 50%, transparent 70%);
  background-size: 220% 100%; animation: shimmer 1.6s linear infinite;
}
.vp--loaded .vp__skeleton { opacity: 0; transition: opacity var(--dur-2) var(--ease-out); }
.vp--loaded .vp__skeleton::after { animation: none; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.vp__spinner {
  display: none; position: absolute; z-index: 1; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
  border: 3px solid rgba(251,249,242,0.3); border-top-color: var(--paper); animation: spin 0.8s linear infinite; pointer-events: none;
}
.vp--busy .vp__spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Dialogs close as they open: a quick fade. Where the browser can't, they just close. ── */
@supports (transition-behavior: allow-discrete) {
  .op-dialog, .qg-sheet {
    transition: opacity var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out),
                overlay var(--dur-1) allow-discrete, display var(--dur-1) allow-discrete;
  }
  .op-dialog:not([open]) { opacity: 0; transform: translateY(4px) scale(0.98); }
  .qg-sheet:not([open]) { opacity: 0; transform: translateY(16px); }
  .op-dialog::backdrop, .qg-sheet::backdrop {
    transition: opacity var(--dur-1) var(--ease-out), overlay var(--dur-1) allow-discrete, display var(--dur-1) allow-discrete;
  }
  .op-dialog:not([open])::backdrop, .qg-sheet:not([open])::backdrop { opacity: 0; }
}

/* ── Waiting ──────────────────────────────────────────────────────────────────────
   A button that has been pressed shows a spinner in place of its words (window.pdtBusy,
   public/js/flash.js); the scenario shimmers until its page has loaded. */
.btn { --spin: var(--ink); }
.btn--primary, .btn--remove { --spin: var(--paper); }
.btn.is-busy { position: relative; color: transparent; pointer-events: none; }
.btn.is-busy > * { visibility: hidden; }
.btn.is-busy::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 1.15em; height: 1.15em; margin: -0.575em 0 0 -0.575em; border-radius: 50%;
  border: 2px solid var(--spin); border-top-color: transparent; animation: spin 0.7s linear infinite;
}
.scenario-loading { overflow: hidden; }
.scenario-loading::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(251,249,242,0.75) 50%, transparent 70%);
  background-size: 220% 100%; animation: shimmer 1.6s linear infinite;
}
.scenario-loading span { position: relative; }

/* ── The interstate sample (views/inspect.js): its own layout and made-up colours ── */
/* Silver, with the light caught across it (sample colours, not a real state's) */
.ix-face--interstate { background: linear-gradient(112deg, #aeb9bb 0%, #d9dedb 27%, #9dacaf 52%, #c9d0cd 76%, #a3afb0 100%); color: #15202a; }
.ix-lines { position: absolute; inset: 0; pointer-events: none; }
.ix-lines svg, .ix-wear svg { display: block; width: 100%; height: 100%; }
.ix-band { position: absolute; left: 0; right: 0; top: 4.5%; height: 12%; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; padding-right: 14%; line-height: 1; background: rgba(190, 62, 82, 0.86); }
.ix-face--interstate .ix-kind { position: static; font: 800 13px var(--font-heading); font-size: 3.7cqw; letter-spacing: 0.04em; text-transform: uppercase; color: rgba(255, 255, 255, 0.92); text-shadow: none; }
.ix-state { margin-top: 2px; margin-top: 0.4cqw; font-size: 7px; font-size: 1.9cqw; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255, 255, 255, 0.85); }
.ix-crest { position: absolute; left: 43%; top: 6%; width: 13%; aspect-ratio: 1; color: rgba(38, 44, 46, 0.72); }
.ix-crest svg { display: block; width: 100%; height: 100%; }
.ix-face--interstate .ix-no { right: 4%; top: 18%; }
.ix-face--interstate .ix-value.ix-no__value { font-size: 12px; font-size: 3.5cqw; }
.ix-face--interstate .ix-who { left: 4%; top: 20%; }
.ix-face--interstate .ix-value.ix-given, .ix-face--interstate .ix-value.ix-name { font-size: 11px; font-size: 3.1cqw; font-weight: 700; }
.ix-value.ix-addr { font-size: 9px; font-size: 2.6cqw; font-weight: 600; }
.ix-addr:first-of-type { margin-top: 3px; margin-top: 1cqw; }
.ix-strip { position: absolute; left: 3%; top: 49%; width: 53%; display: flex; gap: 12px; gap: 3.4cqw; padding: 3px 7px; padding: 0.9cqw 1.6cqw; background: rgba(226, 208, 182, 0.86); }
.ix-strip > div { display: flex; flex-direction: column; }
.ix-face--interstate .ix-dob { position: static; display: flex; gap: 0; }
.ix-face--interstate .ix-label { font-size: 7px; font-size: 1.95cqw; text-transform: uppercase; letter-spacing: 0.03em; }
.ix-face--interstate .ix-value.ix-strip__value { font-size: 12px; font-size: 3.5cqw; font-weight: 800; letter-spacing: 0; }
.ix-more { position: absolute; display: flex; flex-direction: column; }
.ix-more--type { left: 4%; top: 64.5%; }
.ix-more--cond { left: 26%; top: 64.5%; }
.ix-more--end { left: 4%; bottom: 5%; }
.ix-more--end .ix-value { font-size: 9px; font-size: 2.6cqw; }
.ix-face--interstate .ix-holo { left: 42%; right: auto; top: 68%; width: 13%; color: rgba(40, 60, 70, 0.6); opacity: calc(0.5 + var(--glare, 0) * 0.5); }
.ix-face--interstate .ix-holo--small { left: 14%; top: 72%; width: 7%; }
.ix-face--interstate .ix-sig { left: 22%; top: auto; bottom: 4%; width: 18%; height: 18%; }
.ix-face--interstate .ix-photo { left: auto; right: 9%; top: 32%; width: 26%; height: 51%; border-radius: 0; } /* the picture's own shape, so an outline fits it */
.ix-face--interstate .ix-brand { right: 4%; bottom: 3.5%; width: 36%; height: 10%; justify-content: center; align-items: center; border: 1.5px solid rgba(30, 40, 46, 0.55); background: rgba(240, 240, 234, 0.55); color: #15202a; }
.ix-face--interstate .ix-brand__big { font-size: 10px; font-size: 2.9cqw; }
.ix-face--interstate .ix-brand__small { font-size: 5px; font-size: 1.25cqw; }
.ix-wear { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
[data-view="genuine"] .ix-wear { display: none; }
/* The suspect card's print: soft, doubled and washed out, as a poor copy under cloudy laminate is */
[data-view="altered"] .ix-face--interstate .ix-value,
[data-view="altered"] .ix-face--interstate .ix-label { color: rgb(38 54 72 / calc(0.72 - var(--glare, 0) * 0.14)); text-shadow: 0.25cqw 0.3cqw 0.3cqw rgba(38, 54, 72, 0.4); }
[data-view="altered"] .ix-face--interstate .ix-strip .ix-value { color: rgb(20 26 32 / 0.92); text-shadow: 0.2cqw 0.2cqw 0.25cqw rgba(20, 26, 32, 0.5); }
[data-view="altered"] .ix-face--interstate .ix-band { background: rgba(198, 92, 108, 0.72); }
.ix-peel-hit { position: absolute; right: 0; top: 0; width: 8.5%; height: 13.5%; }
/* Laminate lifting at the corner: the film folds back over itself, with the dull card bare beneath */
.ix-peel { position: absolute; right: 0; top: 0; width: 8.5%; aspect-ratio: 1; z-index: 3; filter: drop-shadow(-1px 1px 1px rgba(29,29,29,0.2)); }
.ix-peel::before, .ix-peel::after { content: ''; position: absolute; inset: 0; }
.ix-peel::before { /* the bare card, with scraps of film left stuck to it, torn along an uneven line */
  background:
    radial-gradient(ellipse 13% 8% at 64% 22%, rgba(255, 255, 255, 0.4) 60%, transparent 100%),
    radial-gradient(ellipse 7% 12% at 86% 44%, rgba(255, 255, 255, 0.3) 55%, transparent 100%),
    radial-gradient(ellipse 5% 4% at 42% 9%, rgba(120, 124, 120, 0.3) 60%, transparent 100%),
    linear-gradient(200deg, #bcc3c1, #cdd1cc 55%, #b6bdbb);
  clip-path: polygon(16% 0, 100% 0, 100% 91%, 95% 85%, 92% 88%, 85% 71%, 79% 69%, 73% 54%, 66% 57%, 60% 43%, 53% 39%, 49% 29%, 41% 30%, 36% 15%, 27% 13%, 23% 4%);
}
.ix-peel::after { /* the film, lifted and crumpled rather than folded flat */
  background:
    linear-gradient(118deg, transparent 36%, rgba(255, 255, 255, 0.5) 39%, transparent 43%),
    linear-gradient(64deg, transparent 58%, rgba(96, 108, 104, 0.25) 61%, transparent 65%),
    linear-gradient(32deg, rgba(150, 164, 160, 0.72) 0%, rgba(206, 214, 210, 0.72) 34%, rgba(170, 182, 178, 0.7) 52%, rgba(226, 232, 228, 0.75) 70%, rgba(188, 198, 194, 0.72) 100%);
  clip-path: polygon(16% 0, 23% 4%, 27% 13%, 36% 15%, 41% 30%, 49% 29%, 53% 39%, 60% 43%, 66% 57%, 73% 54%, 79% 69%, 85% 71%, 92% 88%, 95% 85%, 100% 91%, 91% 97%, 79% 89%, 72% 100%, 59% 86%, 47% 87%, 40% 69%, 27% 71%, 22% 49%, 9% 44%, 13% 25%, 6% 13%);
}
[data-view="genuine"] .ix-peel { display: none; }
.ix-photo > span { display: block; width: 100%; height: 100%; }
[data-view="altered"] .ix-face--interstate .ix-photo svg { filter: blur(0.5px) contrast(0.92); }
.ix-second { max-width: 520px; margin: 0 auto var(--space-5); animation: rise-in var(--dur-3) var(--ease-out); }
.ix-second__card {
  display: grid; grid-template-columns: 4.5rem 1fr; gap: var(--space-1) var(--space-4); align-items: center; padding: var(--space-4);
  border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--paper-2); box-shadow: var(--shadow);
}
.ix-second__photo { grid-row: span 2; border-radius: var(--radius-xs); overflow: hidden; }
.ix-second__photo svg { display: block; width: 100%; }
.ix-second__facts { display: grid; gap: var(--space-2); margin: 0; }
.ix-second__facts dt { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-mid); }
.ix-second__facts dd { margin: 0; font-weight: 700; color: var(--ink); }
.ix-second__dob { justify-self: start; padding: var(--space-1) var(--space-2); margin-left: calc(var(--space-2) * -1); border: 3px solid var(--sage); border-radius: var(--radius-xs); box-shadow: 0 0 10px 1px rgba(46, 107, 99, 0.45); }
.ix-second__kind { margin: 0; font-size: 0.8rem; font-weight: 600; color: var(--ink-2); }
.ix-second__kind span { font-weight: 400; color: var(--ink-mid); }
:root { --pp-turn: 900ms; --pp-flip: 1100ms; --pp-flip-at: 500ms; } /* the passport opening: a choreographed sequence */
/* The book: closed it stands upright like a real passport, spine on the left, the same size as it
   will be open. Tapped, it turns on its side, and part way through the turn its cover swings up and
   over the spine to lie flat above it, showing the page on its inside. A turn takes no room of its
   own, so the margins hold the space for it, both ways (their sizes follow the page's shape). */
.ix-passport-book {
  container-type: inline-size; position: relative; z-index: 6; padding: 0 7px 11px; padding: 0 1.5cqw 2.3cqw; border-radius: 10px; border-radius: 2.2cqw;
  background: #1c2b57; box-shadow: var(--shadow-lg);
  margin: var(--pp-open-top) 0 0;
  transition: transform var(--pp-turn) var(--ease-in-out), margin var(--pp-flip) var(--ease-in-out) var(--pp-flip-at);
}
.ix-second--passport { --pp-open-top: 68%; }
.ix-second--passport:not(.is-open) .ix-passport-book { transform: rotate(-90deg); margin: 15% 0 19%; }
.ix-passport-book__lower { position: relative; perspective: 1500px; perspective-origin: 50% 0; }
.ix-passport-cover {
  position: absolute; z-index: 5; top: 0; left: -1.5cqw; right: -1.5cqw; bottom: -2.3cqw; display: block;
  padding: 0; border: 0; border-radius: 2.2cqw; background: none; cursor: pointer;
  transform-origin: 50% 0; transform-style: preserve-3d;
  transition: transform var(--pp-flip) var(--ease-in-out) var(--pp-flip-at);
}
.is-open .ix-passport-cover { transform: rotateX(180deg); cursor: default; pointer-events: none; }
.ix-passport-cover:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.ix-passport-cover__front, .ix-passport-cover__inside { position: absolute; inset: 0; display: block; border-radius: inherit; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
/* The cover: navy with a fine grain, the print in gold foil */
.ix-passport-cover__front {
  color: #dcc384;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.3), transparent 6%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0.9 0 0 0 -0.32'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23g)' opacity='0.28'/%3E%3C/svg%3E"),
    #1c2b57;
}
.ix-passport-cover__face {
  position: absolute; left: 50%; top: 50%; width: 62cqw; height: 100cqw; transform: translate(-50%, -50%) rotate(90deg);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 7cqw;
}
.ix-passport-cover__country { font-size: 18px; font-size: 5.4cqw; font-weight: 800; letter-spacing: 0.04em; text-align: center; text-transform: uppercase; }
.ix-passport-cover__emblem { display: block; width: 34cqw; height: 34cqw; margin-top: 4cqw; }
.ix-passport-cover__emblem svg, .ix-passport-cover__chip svg { display: block; width: 100%; height: 100%; }
.ix-passport-cover__title { margin-top: 3.5cqw; font-size: 16px; font-size: 4.8cqw; font-weight: 600; }
.ix-passport-cover__chip { display: block; width: 8cqw; height: 4.8cqw; margin-top: 3cqw; }
.ix-passport-cover__hint {
  margin-top: 4cqw; padding: 0.45rem 1.2rem; border-radius: var(--radius-pill); background: var(--paper); color: var(--ink);
  font: 600 1rem var(--font-body); animation: ix-tap 1.6s ease-in-out infinite;
}
@keyframes ix-tap { 50% { box-shadow: 0 0 0 7px rgba(251, 249, 242, 0.25); } }
.ix-passport-cover__sample { margin-top: 2.6cqw; max-width: 50cqw; font: 600 8px var(--font-body); font-size: 1.9cqw; line-height: 1.3; letter-spacing: 0.04em; text-align: center; text-transform: uppercase; opacity: 0.85; }
/* The cover's inside: the page above the spine (it's upright once the cover has swung over) */
.ix-passport-cover__inside { transform: rotateX(180deg); background: #1c2b57; }
.ix-passport-cover__leaf { position: absolute; inset: 2.3cqw 1.5cqw 0; display: block; overflow: hidden; border-radius: 1.2cqw 1.2cqw 0 0; background: #f6f0e6; }
.ix-passport-cover__leaf::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3.5cqw; background: linear-gradient(to top, rgba(29, 42, 44, 0.22), transparent); }
.ix-passport-leaf__note { position: absolute; left: 11cqw; top: 3cqw; width: 34cqw; text-align: left; font-size: 1.35cqw; line-height: 1.3; color: #a5a092; }
.ix-passport-leaf__note strong { display: block; margin-bottom: 0.4cqw; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
/* The document number punched through the pages: read up the edge, made of dots */
.ix-passport-leaf__number {
  position: absolute; left: 3cqw; top: 3cqw; bottom: 7cqw; writing-mode: vertical-rl; transform: rotate(180deg); text-align: left;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 5.6cqw; font-weight: 800; letter-spacing: 0.14em; color: transparent;
  background: radial-gradient(circle, #8f8a7c 44%, transparent 48%) 0 0 / 0.55cqw 0.55cqw; -webkit-background-clip: text; background-clip: text;
}
.ix-passport-leaf__landmark { position: absolute; left: 10cqw; right: 20cqw; bottom: 8cqw; }
.ix-passport-leaf__landmark svg { display: block; width: 100%; height: auto; }
.ix-passport-leaf__portrait { position: absolute; right: 5cqw; top: 3.5cqw; width: 21cqw; aspect-ratio: 4 / 5; overflow: hidden; }
.ix-passport-leaf__portrait svg { display: block; width: 100%; height: 100%; filter: grayscale(0.45) contrast(0.8) brightness(1.08); }
.ix-passport-leaf__micro { position: absolute; left: 10cqw; bottom: 3.6cqw; width: 44cqw; padding: 0.4cqw 0.6cqw; border: 1px solid #a5a092; overflow: hidden; white-space: nowrap; font-size: 1cqw; letter-spacing: 0.02em; color: #8f8a7c; }
/* The stitching along the spine */
.ix-passport-cover__leaf::before { content: ''; position: absolute; z-index: 1; left: 2cqw; right: 2cqw; bottom: 1.1cqw; border-bottom: 1.5px dashed rgba(112, 105, 90, 0.55); }
/* The photo page */
.ix-passport { position: relative; z-index: 1; overflow: hidden; border-radius: 0 0 1.2cqw 1.2cqw; background: #f6f0e6; color: #20262c; box-shadow: 0 1.5px 0 #ddd3c2, 0 3px 0 #c9bfae, 0 4.5px 0 #ddd3c2, 0 6px 0 #bdb3a2; }
.ix-passport::before { content: ''; position: absolute; left: 0; right: 0; top: 0; z-index: 2; height: 2.5cqw; background: linear-gradient(to bottom, rgba(29, 42, 44, 0.2), transparent); pointer-events: none; }
.ix-passport::after { content: ''; position: absolute; z-index: 2; left: 2cqw; right: 2cqw; top: 1cqw; border-top: 1.5px dashed rgba(112, 105, 90, 0.55); pointer-events: none; }
.ix-passport:focus { outline: none; }
.ix-passport__wash, .ix-passport__lines { position: absolute; inset: 0; display: block; pointer-events: none; }
.ix-passport__wash svg, .ix-passport__lines svg { display: block; width: 100%; height: 100%; }
.ix-passport__lines { opacity: 0.28; }
.ix-passport__watermark { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) rotate(-14deg); font: 800 16cqw var(--font-heading); letter-spacing: 0.1em; color: rgba(90, 80, 130, 0.07); pointer-events: none; }
.ix-passport__body { position: relative; display: grid; grid-template-columns: 27% 1fr 23%; gap: 2.6cqw; padding: 3.2cqw 3.5cqw 0; }
.ix-passport__title { display: block; margin-top: 2cqw; font-size: 12px; font-size: 3cqw; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; color: #3a3f47; }
.ix-passport__photo { aspect-ratio: 4 / 5; margin-top: 3cqw; overflow: hidden; }
.ix-passport__photo svg { display: block; width: 100%; height: 100%; filter: saturate(0.75) contrast(0.96); }
.ix-passport__head { display: flex; align-items: center; gap: 2cqw; margin-bottom: 1.2cqw; }
.ix-passport__mark { display: block; width: 5.4cqw; height: 3.3cqw; color: #4e6a9c; }
.ix-passport__mark svg { display: block; width: 100%; height: 100%; }
.ix-passport__country { font-size: 11px; font-size: 2.7cqw; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: #4e6a9c; }
.ix-passport__facts { display: grid; gap: 0.55cqw; margin: 0; align-content: start; }
.ix-passport__pair { display: flex; gap: 5cqw; align-items: flex-start; }
.ix-passport__facts dt { font-size: 6px; font-size: 1.55cqw; font-weight: 500; line-height: 1.2; color: #5b6168; }
.ix-passport__facts dd { margin: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; font-size: 2.65cqw; font-weight: 600; line-height: 1.2; text-transform: uppercase; overflow-wrap: anywhere; }
.ix-passport .ix-second__dob { padding: 0.5cqw 1.4cqw; margin: -0.5cqw 0 0 -1.7cqw; }
.ix-passport__number dd { font-size: 3cqw; font-weight: 700; }
.ix-passport__right { display: flex; flex-direction: column; }
.ix-passport__ghost { position: relative; align-self: center; width: 15cqw; height: 15cqw; margin-top: 2.2cqw; }
.ix-passport__rosette { position: absolute; inset: 0; }
.ix-passport__rosette svg { display: block; width: 100%; height: 100%; }
.ix-passport__ghost-face { position: absolute; left: 50%; top: 50%; width: 8cqw; height: 10cqw; transform: translate(-50%, -50%); overflow: hidden; border-radius: 48%; }
.ix-passport__ghost-face svg { display: block; width: 100%; height: 100%; filter: grayscale(0.5) contrast(0.85) brightness(1.05); }
.ix-passport__sign { margin-top: auto; font-size: 6px; font-size: 1.5cqw; color: #5b6168; }
.ix-passport__scribble { height: 7cqw; }
.ix-passport__scribble svg { display: block; width: 100%; height: 100%; }
.ix-passport__sample { position: relative; margin: 0.8cqw 0 0; padding: 0 3.5cqw; font-size: 7px; font-size: 1.55cqw; font-weight: 600; letter-spacing: 0.06em; text-align: right; text-transform: uppercase; color: #5b6168; }
.ix-passport__mrz { position: relative; margin: 0; padding: 1cqw 3.5cqw 2.2cqw; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 10px; font-size: 3.1cqw; font-weight: 600; line-height: 1.4; letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; color: #20262c; }
.ix-passport__mrz > span { display: block; }
/* Nothing about the page shows until it's open, including whether the dates match */
.ix-second--passport:not(.is-open) .ix-second__verdict { display: none; }
.ix-second--passport.is-open .ix-second__verdict { animation: fade-in var(--dur-3) var(--ease-out) 1500ms backwards; }
.ix-second__verdict { margin: var(--space-2) 0 0; font-size: 0.92rem; font-weight: 600; text-align: center; }
.ix-second__no { color: var(--clay); }
.ix-second__yes { color: var(--sage); }
[data-view="altered"] .ix-when-genuine, [data-view="genuine"] .ix-when-altered { display: none !important; }

/* ── The finish screen (views/complete.js) ─────────────────────────────────────── */
.finish { display: flex; flex-direction: column; align-items: center; text-align: center; }
.finish__tick {
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--sage); color: var(--paper);
  box-shadow: var(--shadow-lift); animation: done-pop var(--dur-3) var(--ease-spring);
}
.finish__tick path { stroke-dasharray: 22; stroke-dashoffset: 22; animation: done-draw var(--dur-3) var(--ease-out) var(--dur-1) forwards; }
.finish__title { margin: var(--space-4) 0 var(--space-1); font-size: clamp(1.8rem, 5vw, 2.4rem); }
.finish__sub { margin: 0; color: var(--ink-2); }
.finish__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3); margin-top: var(--space-5); }
.finish__actions .btn { margin-top: 0; }
.arrow--down { transition: transform var(--dur-2) var(--ease-spring); }
@media (hover: hover) { :is(a, button):not(:disabled):hover > .arrow--down { transform: translateY(2px); } }
:is(a, button):focus-visible > .arrow--down { transform: translateY(2px); }
.finish__cert {
  width: 100%; max-width: 520px; margin-top: var(--space-6); padding: clamp(1.5rem, 5vw, 2.75rem) clamp(1.25rem, 5vw, 2.5rem);
  border: 1px solid var(--line-2); border-top: 4px solid var(--ink); border-radius: var(--radius-xs); background: var(--paper); box-shadow: var(--shadow-lg);
  animation: rise-in var(--dur-4) var(--ease-out) var(--dur-1) backwards;
}
.finish__logo { display: block; height: 64px; width: auto; margin: 0 auto var(--space-4); }
.finish__heading { margin: 0; font: 800 clamp(1.05rem, 3.6vw, 1.3rem) var(--font-heading); letter-spacing: 0.02em; }
.finish__label { display: block; margin-top: var(--space-4); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-mid); }
.finish__name { margin: var(--space-1) 0 0; font: 700 clamp(1.4rem, 5vw, 1.9rem)/1.2 var(--font-heading); }
.finish__line { margin: var(--space-1) 0 0; font-size: 0.92rem; color: var(--ink-2); }
.finish__course { margin: var(--space-1) 0 0; font-weight: 700; }
.finish__sig { display: block; max-width: 180px; max-height: 64px; margin: var(--space-4) auto 0; mix-blend-mode: multiply; }
.finish__sigline { max-width: 220px; margin: var(--space-1) auto 0; padding-top: var(--space-1); border-top: 1px solid var(--line-2); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-mid); }
.finish__facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: var(--space-2) var(--space-4); margin: var(--space-4) 0 0; }
.finish__facts dt { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-mid); }
.finish__facts dd { margin: 0; font-size: 0.9rem; font-weight: 600; overflow-wrap: anywhere; }
.finish__issued { margin: var(--space-4) 0 0; font-size: 0.85rem; color: var(--ink-2); }
.finish__disclaimer { margin: var(--space-4) 0 0; padding-top: var(--space-3); border-top: 1px solid var(--line); font-size: 0.8rem; line-height: 1.5; color: var(--ink-2); text-align: left; }
.finish__note { max-width: 520px; margin: var(--space-3) 0 0; font-size: 0.85rem; color: var(--ink-mid); }
.finish__record {
  width: 100%; max-width: 520px; margin-top: var(--space-5); padding: var(--space-4); text-align: left;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper-2);
}
.finish__record p { margin: 0; font-size: 0.9rem; color: var(--ink-2); }
.finish__link { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }
.finish__link a { min-width: 0; overflow-wrap: anywhere; font-size: 0.88rem; font-weight: 600; }
.finish__more { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2) var(--space-5); margin-top: var(--space-5); font-size: 0.92rem; }
.finish__feedback { width: 100%; max-width: 520px; margin: var(--space-5) 0 0; text-align: left; }
/* The passport's cover looks wider as it swings towards the viewer: never a sideways scroll on a phone */
.inspect { overflow-x: clip; }

/* ── The pour: the code entry button while the code is checked (public/js/entry-form.js) ──
   The button fills with amber from the bottom, a foam line rolling on top and bubbles rising.
   Right code: it tops off and the card lifts away. Wrong: it drains and the card shakes once.
   Reduced motion gets the ordinary spinner instead (the script never adds these classes). */
.btn.has-pour { position: relative; overflow: hidden; isolation: isolate; }
.pour { position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit; overflow: hidden; }
/* Only while it's pouring, full or draining: at rest the button is just itself, no foam line */
.btn:not(.is-pouring, .is-poured, .is-draining) > .pour { display: none; }
.pour__beer {
  position: absolute; inset: 0;
  transform: translateY(100%); /* empty; moved, never resized, so the pour runs on the GPU */
  will-change: transform;
  background: linear-gradient(180deg, var(--pour-light) 0%, var(--amber) 45%, var(--pour-deep) 100%);
}
/* Bubbles: one 40px tile of dots, drifting up one tile at a time, seamlessly — in their own
   layer, clipped to the beer, so none drift up into the empty part of the glass */
.pour__bubbles { position: absolute; inset: 0; overflow: hidden; }
.pour__bubbles::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; bottom: -40px;
  background-image:
    radial-gradient(circle at 6px 34px, var(--pour-bubble) 1.1px, transparent 1.7px),
    radial-gradient(circle at 21px 12px, var(--pour-bubble) 1.6px, transparent 2.2px),
    radial-gradient(circle at 33px 27px, var(--pour-bubble) 0.9px, transparent 1.4px),
    radial-gradient(circle at 14px 3px, var(--pour-bubble) 0.8px, transparent 1.3px);
  background-size: 40px 40px;
  will-change: transform;
  animation: pour-bubbles 1.8s linear infinite;
}
/* The foam: a soft wave of cream riding the top of the beer */
.pour__foam {
  position: absolute; left: -50%; width: 200%; top: -7px; height: 12px;
  background: var(--pour-foam) repeat-x 0 0 / 28px 12px;
  transform-origin: 50% 100%;
  will-change: transform;
  animation: pour-wave 1.1s linear infinite;
}
.btn.has-pour:is(.is-pouring, .is-poured, .is-draining) { color: transparent; pointer-events: none; }
.btn.has-pour:is(.is-pouring, .is-poured, .is-draining) > :not(.pour) { visibility: hidden; }
/* Its words come back once it's empty */
.btn.has-pour:not(.is-pouring, .is-poured, .is-draining) > :not(.pour) { animation: pour-words-back var(--dur-2) var(--ease-out); }
/* A steady pour that slows as it fills (about half full by the time most codes are checked) */
.btn.has-pour.is-pouring .pour__beer { animation: pour-fill 2.4s cubic-bezier(0.3, 0.6, 0.35, 1) forwards; }
/* Topping off and draining both start from wherever the beer is (--pour-from, set by the
   script from its place on screen), so neither ever jumps */
.btn.has-pour.is-poured .pour__beer { animation: pour-top var(--dur-3) var(--ease-out) forwards; }
.btn.has-pour.is-poured .pour__foam { animation: pour-wave 1.1s linear infinite, pour-head var(--dur-3) var(--ease-out) forwards; }
.btn.has-pour.is-draining .pour__beer { animation: pour-drain var(--dur-3) var(--ease-in-out) forwards; }
.btn.has-pour.is-pouring, .btn.has-pour.is-poured { box-shadow: var(--shadow-lift), var(--glow-amber); }

.entry-card.is-leaving { animation: card-leave var(--dur-3) var(--ease-in-out) forwards; }
.entry-card.is-shaking { animation: card-shake var(--dur-3) var(--ease-out); }

@keyframes pour-fill { from { transform: translateY(100%); } to { transform: translateY(14%); } }
@keyframes pour-top { from { transform: var(--pour-from, translateY(14%)); } to { transform: translateY(4%); } }
@keyframes pour-drain { from { transform: var(--pour-from, translateY(40%)); } to { transform: translateY(100%); } }
@keyframes pour-head { to { transform: translateX(28px) scaleY(1.6); } }
@keyframes pour-words-back { from { opacity: 0; } }
@keyframes pour-wave { to { transform: translateX(28px); } }
@keyframes pour-bubbles { to { transform: translateY(-40px); } }
@keyframes card-leave { to { opacity: 0; transform: translateY(-14px) scale(0.985); } }
@keyframes card-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(2px); }
}
@media (prefers-reduced-motion: reduce) {
  .entry-card.is-leaving, .entry-card.is-shaking { animation: none; }
  .pour { display: none; }
}


/* The venue's Terms & billing page */
.op-bill-page { display: grid; gap: var(--space-4); max-width: 880px; }
.op-bill-section { margin: 0; }
.op-bill-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-4); }
.op-bill-list, .op-bill-history { margin: 0 0 var(--space-3); padding-left: 1.1rem; font-size: 0.92rem; line-height: 1.6; }
.op-bill-payer { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--line); }
.op-venue-head { margin-bottom: var(--space-3); }
.op-venue-head .op-page-title { margin: 0; }
.op-venue-header__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
/* The Billing button beside Add a plan and Edit details: the amber accent, so it stands out */
.btn--accent { background: var(--amber); color: var(--ink); }
.btn--accent:hover { background: #F4C35A; box-shadow: 0 6px 16px rgba(239,182,58,0.35); }
.op-plan-sub { display: block; margin-top: 0.15rem; font-size: 0.82rem; color: var(--ink-mid); }
.op-plans-table td { vertical-align: top; }

/* ── Add a plan: numbered steps, each its own card ─────────────────────────────── */
.nv-plan { display: grid; gap: var(--space-3); }
.nv-plan > .op-details__warn, .nv-plan > .nv-auto { margin: 0; }
.nv-step[hidden] { display: none; }
.nv-step > legend { display: flex; align-items: center; gap: var(--space-2); }
.nv-step__n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink); color: var(--paper); font-size: 0.75rem; font-weight: 800; }
.nv-step .nv-field:last-child { margin-bottom: var(--space-2); }
.nv-plan [hidden] { display: none !important; }

/* Two or three equal choices in one rounded track, as the site's other toggle groups; the dark
   pill slides to the one chosen (data-pill, public/js/pill.js; without it the chosen one is dark) */
.nv-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; flex-wrap: nowrap; margin-bottom: var(--space-2);
  padding: 3px; border: 1px solid var(--line-2); border-radius: var(--radius-pill); background: var(--paper-2); }
.nv-choice.nv-seg label { justify-content: center; min-height: 40px; padding: 0 var(--space-3); border: 0; border-radius: var(--radius-pill);
  background: transparent; font-weight: 600; text-align: center; color: var(--ink-2); }
.nv-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.nv-choice.nv-seg label:has(input:checked) { background: var(--ink); color: var(--paper); }
.nv-seg label:has(input:focus-visible) { outline: 2px solid var(--amber-hover); outline-offset: 2px; }

/* Staff band cards: the band, and its price for the courses ticked */
.nv-bands { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--space-2); margin-bottom: var(--space-3); }
.nv-plan .nv-label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.11em; text-transform: uppercase; color: var(--ink-mid); }
.nv-band { text-transform: none; letter-spacing: normal; font-size: 0.95rem; color: var(--ink); }
.nv-band:last-child { grid-column: 1 / -1; }
.nv-band { position: relative; display: grid; gap: 2px; padding: var(--space-3) var(--space-3) var(--space-3) 40px; margin: 0;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--paper); cursor: pointer; transition: border-color var(--dur-1), background var(--dur-1); }
.nv-band input { position: absolute; left: 14px; top: 15px; accent-color: var(--ink); width: 16px; height: 16px; margin: 0; }
.nv-band:has(input:checked) { border-color: var(--ink); background: var(--cream-2); box-shadow: inset 0 0 0 1px var(--ink); }
.nv-band__name { font-weight: 700; }
.nv-band__name, .nv-band__fig { letter-spacing: normal; text-transform: none; }
.nv-band__fig { font-size: 0.82rem; color: var(--ink-mid); font-variant-numeric: tabular-nums; }
.nv-custom { padding: var(--space-3) var(--space-4) 0; background: var(--cream-2); border-radius: var(--radius-sm); margin-bottom: var(--space-3); }

/* $ and units sit with their boxes */
.nv-money { position: relative; display: block; }
.nv-money > span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-mid); pointer-events: none; }
.nv-form .nv-money input { padding-left: 28px; }
.nv-unit { display: flex; align-items: center; gap: var(--space-2); }
.nv-form .nv-unit input { width: 6.5rem; flex: none; }
.nv-unit > span { color: var(--ink-mid); font-size: 0.9rem; }
.nv-step .nv-check { margin-bottom: var(--space-1); }

/* What the manager will be asked to pay */
.nv-summary { padding: var(--space-3) var(--space-4); background: var(--ink); color: var(--paper); border-radius: var(--radius); }
.nv-summary__row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); padding: 2px 0; }
.nv-summary__row > span:first-child { color: var(--ink-faint); font-size: 0.88rem; }
.nv-summary__row > span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.nv-summary__row strong { font-family: var(--font-heading); font-size: 1.05rem; }
.nv-summary__row s { color: var(--ink-dim); font-size: 0.85rem; margin-right: var(--space-1); }
.nv-summary__row s:empty { display: none; }
.nv-summary__note { margin: var(--space-2) 0 0; padding-top: var(--space-2); border-top: 1px solid rgba(255,255,255,.14); font-size: 0.8rem; color: var(--ink-faint); }
.nv-plan-terms { margin: 0 0 var(--space-3); color: var(--ink-2); }
@media (max-width: 480px) {
  .nv-seg { grid-auto-flow: row; border-radius: var(--radius); }
}

/* Terms and Plan Order: agreement text is read in full, so plain sentence case, never the small-caps label style */
.terms-check, .po-check, .po-choice, .po-name label, .terms-name-label {
  text-transform: none; letter-spacing: normal; font-size: 1rem; font-weight: 400; color: var(--ink); line-height: 1.5;
}
.po-choice strong, .po-name label { font-weight: 600; }

/* Terms of Service page: the same card as the Plan Order, the terms read on the page */
.po-env { width: 100%; max-width: 680px; margin: 0 auto var(--space-3); padding: var(--space-2) var(--space-3); font-size: 0.95rem; color: var(--ink); background: var(--amber-soft); border: 1px solid var(--amber); border-radius: var(--radius-sm); }
.terms-page:has(.po-env) { flex-direction: column; align-items: center; }
.po-step { margin: 0 0 var(--space-1); font-size: 0.85rem; font-weight: 600; color: var(--ink-2); }
.po-facts3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.po-sub { margin: 0 0 var(--space-1); font-family: var(--font-body); font-size: 1rem; font-weight: 700; }
.po-points { margin: 0 0 var(--space-1); padding-left: 1.1rem; font-size: 1rem; line-height: 1.6; color: var(--ink); }
.po-terms-actions { margin: var(--space-3) 0 0; font-size: 1rem; font-weight: 600; }
.po-version { margin-top: 0; }
.terms-card .terms-disclaimer { margin-top: var(--space-3); padding: var(--space-3); border-radius: var(--radius-sm); }
@media (max-width: 640px) {
  .po-facts3 { grid-template-columns: 1fr; }
}

/* Venue page v2: Agreements, grouped Venue details, collapsed Emails, quieter tables */
.op-sub { margin: var(--space-3) 0 var(--space-1); font-family: var(--font-body); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.op-agree-line { margin: 0 0 var(--space-1); font-size: 0.95rem; }
.op-plan-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.op-plan-item { padding-top: var(--space-2); border-top: 1px solid var(--line); }
.op-plan-item:first-child { border-top: 0; padding-top: 0; }
.op-plan-item__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-2); flex-wrap: wrap; }
.op-plan-item__sub { margin: 2px 0 0; font-size: 0.88rem; color: var(--ink-2); }
.op-terms-history { margin: var(--space-2) 0; }
.op-terms-history summary { display: block; }
.op-bill-history { clear: both; margin: var(--space-1) 0 0; padding-left: 1.1rem; font-size: 0.88rem; color: var(--ink-2); }
.op-agreements a, .op-details a:not(.btn) { color: var(--ink); text-underline-offset: 2px; }
.op-detail-line { margin: 0 0 var(--space-1); font-size: 0.95rem; overflow-wrap: anywhere; }
.op-abn { color: var(--ink-2); font-size: 0.9rem; }
.op-info { display: inline-block; margin-left: 4px; cursor: help; color: var(--ink-2); font-size: 0.8rem; }
.op-attempts--stuck { color: var(--amber-dark); font-weight: 700; }
.op-codes-table[data-single-course] .op-cell-course { display: none; }
.op-emails__group { border: 0; margin: var(--space-3) 0 0; padding: 0; }
.op-emails__group legend { padding: 0; margin-bottom: var(--space-1); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.op-emails__manage > summary { cursor: pointer; margin-top: var(--space-2); min-height: 44px; display: flex; align-items: center; }
.op-emails__saved { margin: var(--space-2) 0 0; font-size: 0.9rem; color: var(--pass); }
.op-venue-layout .op-section { padding: var(--space-4); }
@media (max-width: 640px) { .op-stats { display: grid; grid-template-columns: 1fr 1fr; } }
.op-agree-line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); margin: 0 0 var(--space-2); line-height: 1.5; }
.op-agree-line .badge { margin: 0; }
.op-agreements .op-section-note { margin: 0 0 var(--space-2); line-height: 1.5; }
.op-terms-history { margin: var(--space-1) 0 var(--space-2); }
.op-terms-history > summary { display: block; margin-bottom: var(--space-1); line-height: 1.5; }
.op-agreements .op-sub { margin-top: var(--space-4); }
/* Edit venue details: wide, two columns on a computer */
.op-dialog--wide { width: min(760px, calc(100vw - 32px)); }
.op-details-form { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3) var(--space-4); }
.op-details-form > .op-dialog__title, .op-details-form > .op-field--full, .op-details-form > .op-rename__note, .op-details-form > .op-dialog__actions { grid-column: 1 / -1; }
.op-details-form .op-field { min-width: 0; }
@media (max-width: 640px) { .op-details-form { grid-template-columns: 1fr; } }

/* ── Billing page (v2): header, warnings, two columns, plan grid, collection ─────── */
.op-bill-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3) var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-4); }
.op-bill-head__title .op-page-title { margin: 0 0 var(--space-2); line-height: 1.2; }
.op-bill-head__title .op-section-note { margin: 0; }
.op-bill-head__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.op-bill-head__menu { display: none; position: relative; }
.op-bill-actions-btn { width: auto; min-height: 44px; padding: 0 var(--space-3); }
.is-disabled { opacity: 0.5; cursor: not-allowed; pointer-events: auto; }
.op-bill-warns { display: grid; gap: var(--space-2); margin-bottom: var(--space-4); }
.op-bill-warns .op-details__warn { margin: 0; }
.op-bill-warns form { display: inline; }
.op-bill-layout { display: flex; flex-direction: column; gap: var(--space-4); }
.op-bill-main, .op-bill-side { display: contents; }
.op-bill-layout .op-bill-section { margin: 0; min-width: 0; padding: var(--space-4); }
#plan { order: 1; } #collection { order: 2; } #plan-courses { order: 3; } #plan-history { order: 4; }
@media (min-width: 1100px) {
  .op-bill-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
  .op-bill-main, .op-bill-side { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
}
@media (max-width: 639px) {
  .op-bill-head__wide { display: none; }
  .op-bill-head__menu { display: block; }
  .op-bill-head .op-menu__item, .op-inv__menu .op-menu__item { min-height: 44px; }
}
.op-bill-card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-3); }
.op-bill-card__head .op-section-title { margin: 0; }
.op-plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3) var(--space-4); margin: 0; }
.op-plan-grid--one { grid-template-columns: 1fr; margin-top: var(--space-3); }
.op-plan-grid > div { min-width: 0; }
.op-plan-grid__full { grid-column: 1 / -1; padding-top: var(--space-3); border-top: 1px solid var(--line); }
.op-plan-grid dt { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 2px; }
.op-plan-grid dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 639px) { .op-plan-grid { grid-template-columns: 1fr; } }
.op-tip { border-bottom: 1px dotted var(--ink-2); cursor: help; }
.op-payer-form { margin-top: var(--space-2); display: grid; gap: var(--space-3); max-width: 420px; }
.op-payer-form[hidden], [data-payer-view][hidden] { display: none; }
.op-payer-form__actions { display: flex; gap: var(--space-2); margin: 0; }
.op-plan-table td.num-cell, .op-plan-table th.num-cell { text-align: right; font-variant-numeric: tabular-nums; }
.op-plan-table tfoot th, .op-plan-table tfoot td { background: var(--cream-2); font-weight: 600; }
.op-plan-table tfoot tr + tr th, .op-plan-table tfoot tr + tr td { border-top: 0; }
.op-collect { margin: 0 0 var(--space-3); font-weight: 600; }
.op-collect--warn { color: var(--amber-dark); }
.op-collect--ok { color: var(--pass); }
.op-inv-list { list-style: none; margin: 0; padding: 0; }
.op-inv { display: grid; grid-template-columns: 1fr auto auto; gap: 2px var(--space-3); align-items: center; padding: var(--space-2) 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.op-inv__due { font-size: 0.88rem; color: var(--ink-2); }
.op-inv__menu { grid-row: 1; grid-column: 3; }
.op-inv__no { grid-column: 1; } .op-inv__amt { grid-column: 2; grid-row: 1; text-align: right; }
.op-inv__due { grid-column: 1; grid-row: 2; } .op-inv__st { grid-column: 2; grid-row: 2; justify-self: end; }
.op-bill-history--plain { list-style: none; padding: 0; }
.op-bill-history--plain li { padding: var(--space-2) 0; border-top: 1px solid var(--line); }
.op-bill-history--plain li:first-child { border-top: 0; }
.op-bill-history--plain .op-muted { display: block; font-size: 0.8rem; }
@media (max-width: 639px) {
  .op-plan-table--stack thead { display: none; }
  .op-plan-table--stack, .op-plan-table--stack tbody, .op-plan-table--stack tfoot, .op-plan-table--stack tr { display: block; }
  .op-plan-table--stack tbody tr, .op-plan-table--stack tfoot { border: 1px solid var(--line); margin-bottom: var(--space-2); padding: var(--space-2) var(--space-3); background: var(--paper); }
  .op-plan-table--stack td { display: flex; justify-content: space-between; gap: var(--space-3); border: 0; padding: 2px 0; text-align: right; }
  .op-plan-table--stack td[data-label]::before { content: attr(data-label); color: var(--ink-2); text-align: left; }
  .op-plan-table--stack td:first-child { font-weight: 600; }
  .op-plan-table--stack tfoot tr { display: grid; grid-template-columns: 1fr auto auto; gap: var(--space-2); }
  .op-plan-table--stack tfoot td:empty { display: none; }
}
