/* =====================================================================
   Welltold · base.css
   The Sitting: hairline-flat · the picture carries the page ·
   subtitle yellow is Ellen's voice (and what she remembers), nothing else.
   Owner: Foundation. Areas compose from these classes; see components.html.
   ===================================================================== */

/* ---------- tokens ---------- */
:root{
  --page:#F4EFE6; --card:#FBF8F2; --inset:#E9E3D8; --paper:#FBF8F2;
  --ink:#16130F; --muted:#3F3A33; --rule:#D5CEC1; --rule-strong:#16130F;
  --raised:#16130F; --raised-ink:#FFFFFF;
  --btn:#16130F; --btn-ink:#FFFFFF; --btn-hi:#332E27; --hover:#EAE4D9; --sel:#E9E3D8;
  --focus:#16130F; --ring-gap:var(--page);
  /* broadcast surfaces: identical in both themes, because they sit on the picture */
  --band:#16130F; --band-ink:#FFFFFF; --band-muted:#E6E1D8; --band-key:#24201B; --band-key-hi:#332E27; --band-rule:#38332C;
  /* the one accent: subtitle yellow, only Ellen, only on black */
  --sub-50:#FFF7BF; --sub-200:#FFEB66; --sub:#FFDD00; --sub-700:#B39B00; --sub-900:#6E5F00;
  /* semantics, kept apart from the accent */
  --rec:#C8261C; --ok:#1E5B2E; --err:#9B1C14;
  /* type */
  --f-serif:"Young Serif",Georgia,serif;
  --f-sans:Lexend,system-ui,-apple-system,"Segoe UI",sans-serif;
  --f-book:"Libre Caslon Text",Georgia,serif;
  /* shape + motion */
  --r:2px;
  --ease-out:cubic-bezier(.2,.8,.2,1);
  --t-press:120ms; --t-word:160ms; --t-dialog:160ms; --t-draw:320ms; --t-lift:480ms;
  /* layout */
  --col:720px; --wide:1080px; --rail:280px; --gutter:24px; --top-h:76px;
  color-scheme:light;
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --page:#0F0D0B; --card:#191612; --inset:#221E19; --paper:#EFEAE0;
    --ink:#F4EFE6; --muted:#C9C2B6; --rule:#38332C; --rule-strong:#F4EFE6;
    --raised:#F4EFE6; --raised-ink:#16130F;
    --btn:#F4EFE6; --btn-ink:#16130F; --btn-hi:#D9D2C6; --hover:#1E1A16; --sel:#26211B;
    --focus:#F4EFE6;
    --ok:#93D3A2; --err:#FF9B91;
    color-scheme:dark;
  }
}
:root[data-theme="dark"]{
  --page:#0F0D0B; --card:#191612; --inset:#221E19; --paper:#EFEAE0;
  --ink:#F4EFE6; --muted:#C9C2B6; --rule:#38332C; --rule-strong:#F4EFE6;
  --raised:#F4EFE6; --raised-ink:#16130F;
  --btn:#F4EFE6; --btn-ink:#16130F; --btn-hi:#D9D2C6; --hover:#1E1A16; --sel:#26211B;
  --focus:#F4EFE6;
  --ok:#93D3A2; --err:#FF9B91;
  color-scheme:dark;
}

/* ---------- reset ---------- */
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
html,body{margin:0}
body{background:var(--page);color:var(--ink);font-family:var(--f-sans);font-weight:400;font-size:18px;line-height:28px;-webkit-font-smoothing:antialiased;overflow-x:hidden;min-height:100vh;display:flex;flex-direction:column}
img,svg{display:block;max-width:100%}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
h1,h2,h3,h4,p,figure,blockquote,ul,ol,dl,dd{margin:0}
ul[class],ol[class]{list-style:none;padding:0}
a{color:inherit;text-decoration-thickness:1.5px;text-underline-offset:4px}
::selection{background:var(--ink);color:var(--page)}
[hidden]{display:none !important}
#view{flex:1 0 auto;outline:none}

/* ---------- utilities ---------- */
.serif{font-family:var(--f-serif);font-weight:400}
.book-face{font-family:var(--f-book)}
.tnum{font-variant-numeric:tabular-nums}
.nw{white-space:nowrap}
.vh{position:absolute !important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.skip{position:absolute;left:16px;top:-80px;z-index:50;background:var(--band);color:#fff;padding:12px 18px;border-radius:var(--r);font-weight:500;text-decoration:none}
.skip:focus{top:12px}

/* ---------- type ---------- */
.t-title{font-family:var(--f-serif);font-weight:400;font-size:48px;line-height:52px;letter-spacing:-.01em;text-wrap:balance}
.t-chapter{font-family:var(--f-serif);font-weight:400;font-size:30px;line-height:36px;letter-spacing:-.005em}
.t-h3{font-family:var(--f-sans);font-weight:600;font-size:20px;line-height:28px}
.t-dek{font-size:20px;line-height:30px;color:var(--muted);text-wrap:pretty}
.t-body{font-size:18px;line-height:28px}
.t-meta{font-size:15px;line-height:22px;font-weight:500;letter-spacing:.01em;color:var(--muted)}
.t-label{font-size:13px;line-height:18px;font-weight:500;letter-spacing:.02em;color:var(--muted)}
.prose>*+*{margin-top:18px}
.prose p{text-wrap:pretty}

/* ---------- layout ---------- */
.page{padding:72px var(--gutter) 96px}
.col{max-width:var(--col);margin-left:auto;margin-right:auto}
.wide{max-width:var(--wide);margin-left:auto;margin-right:auto}
.stack>*+*{margin-top:var(--gap,24px)}
.with-rail{max-width:calc(var(--col) + 56px + var(--rail));margin:0 auto;display:grid;grid-template-columns:minmax(0,var(--col)) var(--rail);gap:0 56px;align-items:start}
.with-rail .rail{position:sticky;top:calc(var(--top-h) + 24px);display:flex;flex-direction:column;gap:20px}

/* the motif: a short black lower-third bar marks a section */
.marker{display:block;width:56px;height:8px;background:var(--rule-strong);margin:0 0 28px}
.page-head{margin:0 0 48px}
.page-head .t-dek{margin-top:20px;max-width:640px}
.section{margin-top:72px}
.section-h{display:block;font-size:15px;line-height:22px;font-weight:600;letter-spacing:.01em;color:var(--ink);margin:0 0 16px}
.section-h::before{content:"";display:inline-block;vertical-align:middle;width:22px;height:4px;margin:-3px 12px 0 0;background:var(--rule-strong)}
.on-band .section-h::before,.band .section-h::before{background:#fff}
.rule{border:0;border-top:1px solid var(--rule);margin:32px 0}

/* sitting progress, in words, never pips */
.progress-words{font-size:18px;line-height:28px;color:var(--muted)}
.progress-words b{font-weight:600;color:var(--ink)}

/* ---------- the mark: "Welltold", the W standing on a lower-third bar ---------- */
.mark{font-family:var(--f-serif);font-weight:400;letter-spacing:-.005em;white-space:nowrap;text-decoration:none;color:inherit;display:inline-block}
.mark .w{position:relative;display:inline-block}
.mark .w::after{content:"";position:absolute;left:-3px;right:-1px;bottom:-4px;height:4px;background:currentColor}

/* ---------- icons: one stroke family, 1.75px, sized to the text ---------- */
.ic{width:1.1em;height:1.1em;flex:none;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round;display:inline-block;vertical-align:-.16em}
.ic.fill{fill:currentColor;stroke:none}

/* =====================================================================
   FOCUS: box-shadow rings. Components with their own inset shadow set
   --ring-base so the ring adds to it instead of replacing it.
   ===================================================================== */
.on-band,.studio-scope,.band,.ellen,.clip,.dlg.on-band,.toast{--focus:#FFFFFF;--ring-gap:var(--band)}
:is(a,button,input,select,textarea,summary,[tabindex]):focus-visible{outline:none;box-shadow:var(--ring-base,0 0 #0000),0 0 0 3px var(--ring-gap),0 0 0 6px var(--focus)}
#view:focus-visible{box-shadow:none}

/* =====================================================================
   STORYTELLER CONTROLS (always on the black band; same in both themes)
   ===================================================================== */
.band{background:var(--band);color:var(--band-ink)}

/* primary key: ≥96px, worded, white on band */
.key{--ring-base:0 0 #0000;position:relative;min-width:420px;min-height:104px;padding:16px 36px;display:inline-flex;align-items:center;justify-content:center;gap:16px;background:#fff;color:#16130F;border:0;border-radius:var(--r);transition:transform var(--t-press) var(--ease-out),background-color var(--t-press);overflow:hidden;text-align:left}
.key .lab{display:flex;flex-direction:column;align-items:flex-start}
.key .lab b{font-size:24px;line-height:30px;font-weight:600;letter-spacing:-.003em}
.key .lab small{font-size:18px;line-height:24px;font-weight:400;color:#3F3A33}
.key .gl{width:36px;height:36px;flex:none;display:grid;place-items:center}
@media (hover:hover){.key:not([disabled]):not([aria-busy="true"]):hover{background:#ECE7DE}}
.key:active{transform:scale(.97)}
.key[disabled]{background:#3A352E;color:#C9C2B6;cursor:not-allowed}
.key[disabled] .lab small{color:#C9C2B6}
.key[disabled] .gl{opacity:.6}
.key[aria-busy="true"]{background:#ECE7DE;cursor:progress}
.key[aria-busy="true"]::after{content:"";position:absolute;left:0;bottom:0;height:5px;width:38%;background:#16130F;animation:wt-carry 1.4s var(--ease-out) infinite}
@keyframes wt-carry{from{transform:translateX(-100%)}to{transform:translateX(270%)}}

/* key glyphs: drawn, not icon-font */
.gl-go::before{content:"";width:0;height:0;border-left:16px solid currentColor;border-top:11px solid transparent;border-bottom:11px solid transparent;margin-left:5px}
.gl-rec{border-radius:50%;box-shadow:inset 0 0 0 3px currentColor}
.gl-rec::before{content:"";width:14px;height:14px;border-radius:50%;background:var(--rec)}
.gl-pause::before{content:"";width:22px;height:24px;background:linear-gradient(90deg,currentColor 0 8px,transparent 8px 14px,currentColor 14px)}
.gl-ask::before{content:"";width:24px;height:5px;background:currentColor}
.gl-check::before{content:"";width:22px;height:12px;border-left:3px solid currentColor;border-bottom:3px solid currentColor;transform:rotate(-45deg) translate(2px,-3px)}

/* secondary key: 64px, 19px label */
.k2{--ring-base:0 0 #0000;width:240px;min-height:64px;padding:8px 18px;display:flex;align-items:center;justify-content:space-between;gap:10px;background:var(--band);color:#fff;border:0;border-radius:var(--r);font-size:19px;line-height:24px;font-weight:500;text-align:left;transition:transform var(--t-press) var(--ease-out),background-color var(--t-press)}
.k2.raised{background:var(--band-key)}
.k2 small{display:block;font-size:18px;line-height:22px;font-weight:400;color:var(--band-muted);white-space:nowrap}
.k2 .two{display:flex;flex-direction:column}
@media (hover:hover){.k2:not([disabled]):hover{background:var(--band-key-hi)}}
.k2:active{transform:scale(.97)}
.k2[aria-pressed="true"]{background:#fff;color:#16130F}
.k2[aria-pressed="true"] small{color:#3F3A33}
.k2[disabled]{color:#8F887C;cursor:not-allowed}
.k2[disabled] small{color:#8F887C}
.k2[aria-busy="true"]{cursor:progress;color:var(--band-muted)}
.k2.sm{width:auto;min-height:48px;padding:0 18px;font-size:17px}

/* the end control: fixed corner, red ring, never a fourth equal button */
.end{--ring-base:inset 0 0 0 2px var(--rec);display:inline-flex;align-items:center;gap:12px;min-height:64px;padding:0 20px 0 16px;background:var(--band);color:#fff;border:0;border-radius:var(--r);box-shadow:var(--ring-base);font-size:19px;font-weight:500;transition:transform var(--t-press) var(--ease-out)}
.end .stop{width:26px;height:26px;border-radius:50%;flex:none;box-shadow:inset 0 0 0 2px var(--rec);display:grid;place-items:center}
.end .stop::after{content:"";width:9px;height:9px;background:#fff}
@media (hover:hover){.end:hover{background:#2A0B08}}
.end:active{transform:scale(.97)}

/* chips on the picture: solid black bands */
.chip{display:inline-flex;align-items:center;gap:10px;background:var(--band);color:var(--band-ink);font-size:18px;line-height:24px;font-weight:500;padding:10px 14px;border-radius:var(--r)}
.chip.markchip{background:#fff;color:#16130F;font-size:22px;padding:8px 14px 10px}
.chip.rec .dot{width:14px;height:14px;border-radius:50%;flex:none;box-shadow:inset 0 0 0 2px #fff}
.chip.rec[data-s="recording"] .dot{background:var(--rec);box-shadow:0 0 0 2px #000,0 0 0 4px var(--rec)}
.chip.rec[data-s="paused"] .dot{box-shadow:inset 0 0 0 2px var(--rec)}
.chip.rec .t{font-weight:400;color:var(--band-muted);font-variant-numeric:tabular-nums}

/* ---------- caption band: Ellen only ever speaks in subtitles ---------- */
.subs{text-align:center}
.speaker{display:inline-flex;align-items:center;gap:10px;background:var(--band);color:#fff;font-size:18px;line-height:24px;font-weight:500;padding:7px 14px 7px 12px;margin:0 0 10px}
.speaker::before{content:"";width:18px;height:4px;background:var(--sub)}
.caption{margin:0;font-size:36px;line-height:54px;font-weight:500;letter-spacing:.003em}
.caption .box{background:var(--band);color:var(--sub);padding:4px 16px 5px;-webkit-box-decoration-break:clone;box-decoration-break:clone}
.caption .w{display:inline-block;transition:opacity var(--t-word) var(--ease-out),transform var(--t-word) var(--ease-out)}
.caption .w.hid{opacity:0;transform:translateY(4px)}
.caption .w.gone{display:none}
/* remembered words: one yellow underline, drawn as she says them */
.m{background-image:linear-gradient(var(--sub),var(--sub));background-repeat:no-repeat;background-position:0 calc(100% - 2px);background-size:0 3px;transition:background-size var(--t-draw) var(--ease-out);padding-bottom:2px}
.m.drawn{background-size:100% 3px}
.caption.sm{font-size:28px;line-height:40px}

/* ---------- lower-third name plate (people only, never chapters) ---------- */
.lt{display:inline-flex;flex-direction:column;align-items:flex-start;text-decoration:none;color:inherit}
.lt .n{background:var(--card);color:var(--ink);box-shadow:inset 0 0 0 1px var(--rule);font-family:var(--f-serif);font-weight:400;font-size:34px;line-height:34px;letter-spacing:-.005em;padding:14px 22px 12px 20px}
.lt .s{background:var(--raised);color:var(--raised-ink);font-size:15px;line-height:22px;font-weight:500;letter-spacing:.01em;padding:7px 20px 8px}
.lt.md .n{font-size:24px;line-height:26px;padding:10px 16px 9px 14px}
.lt.md .s{font-size:14px;line-height:20px;padding:5px 16px 6px 14px}
.lt.sm .n{font-size:17px;line-height:20px;padding:6px 12px 5px 10px}
.lt.sm .s{font-size:13px;line-height:18px;padding:3px 12px 4px 10px}
/* on the picture, broadcast colours in both themes */
.lt.broadcast .n{background:#fff;color:#16130F;box-shadow:none;padding:16px 26px 14px 40px}
.lt.broadcast .s{background:var(--band);color:#fff;font-size:18px;line-height:24px;font-weight:400;padding:8px 26px 9px 40px}
.lt.pending .s{background:var(--inset);color:var(--muted)}

/* ---------- memory line: what Ellen remembers, yellow on black ---------- */
.memline{margin:0;max-width:440px}
.memline .lbl{display:block;font-size:18px;line-height:24px;font-weight:500;color:var(--band-muted);margin-bottom:4px}
.memline .val{font-size:20px;line-height:28px;font-weight:500;color:var(--sub)}
.memline .val .sep{color:var(--band-muted);font-weight:400}

/* Ellen on a light page: a small black band with yellow words */
.ellen{background:var(--band);color:var(--sub);border-radius:var(--r);padding:16px 20px 18px;box-shadow:inset 0 0 0 1px var(--band-rule)}
.ellen .who{display:flex;align-items:center;gap:10px;font-size:14px;line-height:20px;font-weight:500;letter-spacing:.01em;color:var(--band-muted);margin:0 0 6px}
.ellen .who::before{content:"";width:18px;height:4px;background:var(--sub);flex:none}
.ellen .say{font-size:20px;line-height:30px;font-weight:500;color:var(--sub);text-wrap:pretty}
.ellen .say.sm{font-size:18px;line-height:28px}
.ellen .acts{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}
.ellen .acts .b2{--ring-base:inset 0 0 0 1.5px #fff;color:#fff;box-shadow:var(--ring-base);min-height:48px;font-size:17px}
@media (hover:hover){.ellen .acts .b2:hover{background:var(--band-key-hi)}}
/* inline memory reference: one remembered thing, with its source */
.memref{display:inline-flex;align-items:baseline;gap:8px;background:var(--band);color:var(--sub);border-radius:var(--r);padding:2px 9px 3px;font-size:15px;line-height:22px;font-weight:500;text-decoration:none;white-space:nowrap}
.memref .src{color:var(--band-muted);font-weight:400;font-variant-numeric:tabular-nums}
a.memref{--ring-base:0 0 #0000}
@media (hover:hover){a.memref:hover{background:#2A251F}}

/* ---------- status lines: states said in words ---------- */
.status{display:inline-flex;align-items:center;gap:10px;font-size:18px;line-height:24px;font-weight:500;color:var(--ink)}
.status::before{content:"";flex:none;width:12px;height:7px;border-left:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(-45deg) translate(1px,-2px)}
.status[data-s="holding"]::before{width:12px;height:12px;border:2px solid currentColor;border-radius:50%;transform:none;background:linear-gradient(currentColor,currentColor) 50% 100%/2px 50% no-repeat}
.status[data-s="saving"]::before{width:14px;height:4px;border:0;background:currentColor;transform:none}
.status[data-s="err"]{color:var(--err)}
.status[data-s="err"]::before{width:12px;height:12px;border:2px solid currentColor;border-radius:50%;transform:none;background:linear-gradient(currentColor,currentColor) 50% 2px/2px 4px no-repeat}
.status .sub{font-weight:400;color:var(--muted)}
.on-band .status,.band .status{color:#fff}
.on-band .status .sub,.band .status .sub{color:var(--band-muted)}

/* =====================================================================
   FAMILY CONTROLS (paper page, flips with the theme)
   ===================================================================== */
.b1,.b2,.b3{display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:56px;padding:0 24px;border-radius:var(--r);border:0;font-size:18px;line-height:24px;font-weight:500;text-decoration:none;transition:transform var(--t-press) var(--ease-out),background-color var(--t-press);white-space:nowrap}
.b1{--ring-base:0 0 #0000;background:var(--btn);color:var(--btn-ink)}
.b2{--ring-base:inset 0 0 0 1.5px var(--ink);background:transparent;color:var(--ink);box-shadow:var(--ring-base)}
.b3{--ring-base:0 0 #0000;background:transparent;color:var(--ink);padding:0 4px;min-height:44px;text-decoration:underline;text-decoration-thickness:1.5px;text-underline-offset:5px}
.b1.lg,.b2.lg{min-height:64px;font-size:19px;padding:0 28px}
.b1.sm,.b2.sm{min-height:44px;font-size:16px;padding:0 16px}
.b1.danger{background:var(--err);color:#fff}
@media (hover:hover){
  .b1:not([disabled]):not([aria-busy="true"]):hover{background:var(--btn-hi)}
  .b1.danger:not([disabled]):hover{background:#7A140E}
  .b2:not([disabled]):not([aria-busy="true"]):hover{background:var(--hover)}
  .b3:not([disabled]):hover{text-decoration-thickness:3px}
}
.b1:active,.b2:active{transform:scale(.97)}
.b1[disabled],.b2[disabled],.b3[disabled]{cursor:not-allowed;opacity:1}
.b1[disabled]{background:var(--inset);color:var(--muted)}
.b2[disabled]{--ring-base:inset 0 0 0 1.5px var(--rule);color:var(--muted)}
.b3[disabled]{color:var(--muted);text-decoration:none}
.b1[aria-busy="true"],.b2[aria-busy="true"]{cursor:progress;position:relative;overflow:hidden}
.b1[aria-busy="true"]::after,.b2[aria-busy="true"]::after{content:"";position:absolute;left:0;bottom:0;height:3px;width:38%;background:currentColor;animation:wt-carry 1.4s var(--ease-out) infinite}
.b1[aria-pressed="true"],.b1.done{--ring-base:inset 0 0 0 1.5px var(--ok);background:transparent;color:var(--ok);box-shadow:var(--ring-base)}
.b1 .gl-go{width:16px;height:16px;display:grid;place-items:center}
.b1 .gl-go::before{border-left-width:11px;border-top-width:7px;border-bottom-width:7px;margin-left:2px}
.acts{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.back{display:inline-flex;align-items:center;gap:8px;font-size:16px;line-height:22px;font-weight:500;color:var(--ink);text-decoration:underline;text-underline-offset:4px;margin:0 0 32px;min-height:44px}
.back::before{content:"";width:8px;height:8px;border-left:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg)}

/* ---------- forms: one thing per page, GOV.UK plain ---------- */
.field{display:flex;flex-direction:column;gap:6px;margin:0 0 28px;max-width:560px}
.f-label{font-size:18px;line-height:26px;font-weight:600;color:var(--ink)}
.f-help{font-size:16px;line-height:24px;color:var(--muted)}
.f-error{display:flex;gap:8px;align-items:center;font-size:16px;line-height:24px;font-weight:600;color:var(--err)}
.f-error::before{content:"";width:14px;height:4px;background:currentColor;flex:none}
.input,.select,.textarea{--ring-base:inset 0 0 0 2px var(--ink);width:100%;min-height:56px;padding:12px 14px;background:var(--card);color:var(--ink);border:0;border-radius:var(--r);box-shadow:var(--ring-base);font-size:18px;line-height:28px;appearance:none;-webkit-appearance:none}
.textarea{min-height:140px;resize:vertical}
.input::placeholder,.textarea::placeholder{color:var(--muted);opacity:.8}
.field.has-error .input,.field.has-error .select,.field.has-error .textarea{--ring-base:inset 0 0 0 3px var(--err)}
.input[disabled],.select[disabled]{background:var(--inset);color:var(--muted);--ring-base:inset 0 0 0 2px var(--rule)}
.select{padding-right:52px;background-image:linear-gradient(45deg,transparent 50%,var(--ink) 50%),linear-gradient(-45deg,transparent 50%,var(--ink) 50%);background-position:calc(100% - 26px) 50%,calc(100% - 19px) 50%;background-size:7px 7px;background-repeat:no-repeat;cursor:pointer}
.input.short{max-width:220px}

/* big question (yes / no) */
.q{max-width:640px}
.q legend,.q .q-title{font-family:var(--f-serif);font-weight:400;font-size:36px;line-height:42px;letter-spacing:-.008em;margin:0 0 12px;padding:0}
.q fieldset{border:0;margin:0;padding:0;min-width:0}
.q .f-help{margin:0 0 24px}
.choices{display:flex;flex-direction:column;gap:12px;margin:0 0 32px}
.choices.inline{flex-direction:row;gap:24px;flex-wrap:wrap}
.choice{position:relative;display:flex;align-items:flex-start;gap:16px;min-height:52px;cursor:pointer}
.choice input{position:absolute;opacity:0;width:52px;height:52px;margin:0;cursor:pointer}
.choice .dot{--ring-base:inset 0 0 0 2.5px var(--ink);flex:none;width:52px;height:52px;border-radius:50%;box-shadow:var(--ring-base);background:var(--card);display:grid;place-items:center}
.choice .dot::after{content:"";width:24px;height:24px;border-radius:50%;background:var(--ink);transform:scale(0);transition:transform var(--t-press) var(--ease-out)}
.choice input:checked+.dot::after{transform:scale(1)}
.choice input:focus-visible+.dot{box-shadow:var(--ring-base),0 0 0 3px var(--ring-gap),0 0 0 6px var(--focus)}
.choice .c-lab{padding-top:12px;font-size:20px;line-height:28px;font-weight:500}
.choice .c-lab small{display:block;font-size:16px;line-height:24px;font-weight:400;color:var(--muted);margin-top:2px}
.choice.check .dot{border-radius:var(--r)}
.choice.check .dot::after{width:22px;height:12px;border-radius:0;background:none;border-left:3px solid var(--ink);border-bottom:3px solid var(--ink);transform:rotate(-45deg) translate(2px,-3px) scale(0)}
.choice.check input:checked+.dot::after{transform:rotate(-45deg) translate(2px,-3px) scale(1)}
@media (hover:hover){.choice:hover .dot{--ring-base:inset 0 0 0 4px var(--ink)}}

/* switch */
.switch{--ring-base:0 0 #0000;display:flex;align-items:center;justify-content:space-between;gap:24px;width:100%;max-width:640px;padding:18px 0;border:0;border-top:1px solid var(--rule);border-bottom:1px solid var(--rule);background:none;text-align:left;border-radius:0}
.switch .sw-lab{display:flex;flex-direction:column;gap:2px}
.switch .sw-lab b{font-size:18px;line-height:26px;font-weight:600}
.switch .sw-lab small{font-size:16px;line-height:24px;color:var(--muted)}
.switch .track{flex:none;position:relative;width:64px;height:36px;border-radius:18px;background:var(--inset);box-shadow:inset 0 0 0 2px var(--ink);transition:background-color var(--t-press)}
.switch .track::after{content:"";position:absolute;left:5px;top:5px;width:26px;height:26px;border-radius:50%;background:var(--ink);transition:transform var(--t-press) var(--ease-out)}
.switch[aria-checked="true"] .track{background:var(--ink)}
.switch[aria-checked="true"] .track::after{background:var(--page);transform:translateX(28px)}
.switch .state-word{font-size:15px;font-weight:500;color:var(--muted);min-width:24px;text-align:right}
.switch[disabled]{cursor:not-allowed}
.switch[disabled] .track{opacity:.45}
.switch[disabled] .sw-lab b{color:var(--muted)}
.switch .sw-end{display:flex;align-items:center;gap:12px}

/* segmented: the region switch (UK £ / AU A$) */
.seg{display:inline-flex;border-radius:var(--r);box-shadow:inset 0 0 0 1.5px var(--ink);padding:3px;gap:2px}
.seg button{--ring-base:0 0 #0000;min-height:38px;padding:0 14px;border:0;border-radius:1px;background:transparent;color:var(--ink);font-size:15px;font-weight:500;font-variant-numeric:tabular-nums}
.seg button[aria-pressed="true"]{background:var(--ink);color:var(--page)}
@media (hover:hover){.seg button[aria-pressed="false"]:hover{background:var(--hover)}}

/* ---------- list rows (sittings, people, access log) ---------- */
.rows{border-top:1px solid var(--rule-strong)}
.row{--ring-base:0 0 #0000;position:relative;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 24px;align-items:baseline;padding:18px 12px 18px 12px;margin:0 -12px;border-bottom:1px solid var(--rule);color:inherit;text-decoration:none;border-radius:0}
a.row,button.row{cursor:pointer;width:calc(100% + 24px);background:none;border-left:0;border-right:0;border-top:0;text-align:left}
.row .r-title{font-size:19px;line-height:28px;font-weight:500}
.row .r-title b{font-weight:600}
.row .r-meta{grid-column:1;font-size:15px;line-height:22px;color:var(--muted);font-variant-numeric:tabular-nums}
.row .r-end{grid-column:2;grid-row:1 / span 2;align-self:center;text-align:right;font-size:15px;line-height:22px;font-weight:500;font-variant-numeric:tabular-nums;color:var(--ink);white-space:nowrap}
@media (hover:hover){a.row:hover,button.row:hover{background:var(--hover)}}
.row[aria-current="true"],.row[aria-selected="true"]{background:var(--sel)}
.row[aria-current="true"]::before,.row[aria-selected="true"]::before{content:"";position:absolute;left:0;top:-1px;width:40px;height:5px;background:var(--rule-strong)}
.row .live{display:inline-flex;align-items:center;gap:8px;color:var(--ink)}
.row .live::before{content:"";width:10px;height:10px;border-radius:50%;background:var(--rec)}

/* ---------- clip-linked sentences ---------- */
.said-by{display:block;margin:32px 0 8px;font-size:15px;line-height:22px;font-weight:600;letter-spacing:.01em;color:var(--muted)}
.said-by::before{content:"";display:inline-block;vertical-align:middle;width:18px;height:4px;margin:-3px 10px 0 0;background:var(--rule-strong)}
.said-by .tnum{font-weight:500}
.story{font-size:20px;line-height:34px}
.cs{--ring-base:0 0 #0000;color:inherit;text-decoration:none;border-radius:var(--r);padding:2px 0;cursor:pointer;-webkit-box-decoration-break:clone;box-decoration-break:clone}
@media (hover:hover){.cs:hover{background:var(--hover)}}
.cs[aria-current="true"]{text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:6px}
.tc{display:inline-block;margin-left:6px;background:var(--raised);color:var(--raised-ink);font-size:14px;line-height:20px;font-weight:500;padding:1px 7px 2px;border-radius:var(--r);font-variant-numeric:tabular-nums;vertical-align:2px;text-decoration:none;font-family:var(--f-sans)}
/* his own words, quoted */
.quote{font-size:22px;line-height:34px;font-weight:400;text-wrap:pretty}

/* the clip the sentence came from */
.clip{background:var(--band);color:#fff}
.clip .pic{position:relative;aspect-ratio:16/9;overflow:hidden}
.clip .pic img{width:100%;height:100%;object-fit:cover;object-position:50% 30%}
.clip .said{position:absolute;left:24px;right:24px;bottom:20px;text-align:center;font-size:22px;line-height:34px;font-weight:500}
.clip .said span{background:var(--band);color:#fff;padding:3px 12px 4px;-webkit-box-decoration-break:clone;box-decoration-break:clone}
.clip .tcbig{position:absolute;left:0;top:20px;background:var(--band);font-size:15px;line-height:20px;font-weight:500;padding:7px 14px 7px 20px;font-variant-numeric:tabular-nums}
.clip .bar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 16px 14px}
.clip .when{font-size:15px;line-height:22px;color:var(--band-muted);font-variant-numeric:tabular-nums;white-space:nowrap}
.play{--ring-base:0 0 #0000;min-height:56px;min-width:168px;padding:0 18px;display:inline-flex;gap:12px;align-items:center;background:#fff;color:#16130F;border:0;border-radius:var(--r);font-size:18px;font-weight:500;transition:transform var(--t-press) var(--ease-out)}
.play:active{transform:scale(.97)}
@media (hover:hover){.play:hover{background:#ECE7DE}}
.play .gl-go,.play .gl-pause{width:20px;height:20px;display:grid;place-items:center}
.play .gl-go::before{border-left-width:12px;border-top-width:8px;border-bottom-width:8px;margin-left:2px}
.play .gl-pause::before{width:14px;height:16px;background:linear-gradient(90deg,currentColor 0 5px,transparent 5px 9px,currentColor 9px)}

/* photographs: no radius, no motion */
.photo img{width:100%;height:auto;aspect-ratio:4/3;object-fit:cover}
.photo figcaption{margin:14px 0 0;font-size:15px;line-height:22px;color:var(--muted)}
.photo figcaption b{font-weight:500;color:var(--ink)}

/* ---------- margin-rail note (review notes beside the chapter) ---------- */
.note{background:var(--card);box-shadow:inset 0 0 0 1px var(--rule);border-radius:var(--r);padding:16px 18px 18px}
.note .n-who{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin:0 0 8px}
.note .n-who b{font-size:15px;line-height:22px;font-weight:600}
.note .n-who span{font-size:13px;line-height:18px;font-weight:500;letter-spacing:.02em;color:var(--muted);font-variant-numeric:tabular-nums}
.note .n-body{font-size:16px;line-height:25px}
.note .n-on{display:block;margin:10px 0 0;font-size:13px;line-height:18px;font-weight:500;letter-spacing:.02em;color:var(--muted)}
.note .acts{margin-top:12px;gap:6px}
.note .acts .b2,.note .acts .b1{min-height:40px;font-size:15px;padding:0 12px}
.note[data-s="resolved"]{background:transparent}
.note[data-s="resolved"] .n-body{color:var(--muted)}
.note[data-s="resolved"] .n-who b::after{content:" · resolved";font-weight:500;color:var(--ok)}
.note.active{box-shadow:inset 0 0 0 2px var(--ink)}

/* ---------- link-expiry chip ---------- */
.expiry{display:inline-flex;align-items:center;gap:8px;padding:5px 12px 6px 10px;border-radius:var(--r);box-shadow:inset 0 0 0 1px var(--rule);background:var(--card);font-size:14px;line-height:20px;font-weight:500;color:var(--ink);font-variant-numeric:tabular-nums;white-space:nowrap}
.expiry .ic{width:15px;height:15px}
.expiry[data-s="soon"]{box-shadow:inset 0 0 0 1.5px var(--ink)}
.expiry[data-s="gone"]{background:transparent;color:var(--muted);text-decoration:line-through;text-decoration-thickness:1.5px}
.token{font-variant-numeric:tabular-nums;letter-spacing:.01em;word-break:break-all}

/* ---------- empty state ---------- */
.empty{padding:40px 0 8px;border-top:1px solid var(--rule-strong);max-width:560px}
.empty .e-mark{display:block;width:56px;height:8px;background:var(--rule);margin:0 0 20px}
.empty h3{font-family:var(--f-serif);font-weight:400;font-size:28px;line-height:34px;margin:0 0 10px}
.empty p{color:var(--muted);font-size:18px;line-height:28px}
.empty .acts{margin-top:24px}

/* placeholder while an area is being put together (stub views) */
.hold{padding:96px var(--gutter) 120px}
.hold .t-title{margin:0 0 20px;max-width:640px}
.hold .t-dek{max-width:600px}
.hold .ellen{margin:40px 0 0;max-width:560px}
.hold.on-band{background:var(--band);color:#fff;min-height:100vh;min-height:100svh;display:flex;flex-direction:column;justify-content:flex-end}
.hold.on-band .t-dek{color:var(--band-muted)}
.hold.on-band .section-h::before{background:#fff}

/* ---------- toast ---------- */
.toast{position:fixed;z-index:60;left:50%;bottom:24px;transform:translateX(-50%);max-width:min(560px,calc(100vw - 32px));display:flex;align-items:center;gap:12px;background:var(--band);color:#fff;padding:14px 20px 15px 18px;border-radius:var(--r);box-shadow:0 0 0 1px var(--band-rule),0 10px 30px rgba(22,19,15,.28);font-size:17px;line-height:24px;font-weight:500;animation:wt-toast-in var(--t-dialog) var(--ease-out)}
.toast::before{content:"";flex:none;width:12px;height:7px;border-left:2px solid #fff;border-bottom:2px solid #fff;transform:rotate(-45deg) translate(1px,-2px)}
.toast .t-act{--ring-base:0 0 #0000;margin-left:8px;background:none;border:0;color:#fff;font-weight:600;text-decoration:underline;text-underline-offset:4px;padding:4px;--ring-gap:var(--band);--focus:#fff}
@keyframes wt-toast-in{from{opacity:0;transform:translate(-50%,6px)}to{opacity:1;transform:translate(-50%,0)}}

/* ---------- dialog: scale-in from 0.96 ---------- */
.dlg{border:0;padding:0;margin:auto;max-width:min(560px,calc(100vw - 32px));width:100%;background:var(--card);color:var(--ink);border-radius:var(--r);box-shadow:0 0 0 1px var(--rule),0 24px 64px rgba(22,19,15,.35)}
.dlg[open]{animation:wt-dlg-in var(--t-dialog) var(--ease-out)}
.dlg::backdrop{background:rgba(15,13,11,.62)}
.dlg .d-top{height:8px;width:56px;background:var(--rule-strong);margin:28px 28px 0}
.dlg .d-body{padding:20px 28px 8px}
.dlg h2{font-family:var(--f-serif);font-weight:400;font-size:30px;line-height:36px;letter-spacing:-.005em;margin:0 0 10px}
.dlg p{font-size:18px;line-height:28px;color:var(--muted)}
.dlg .acts{padding:20px 28px 28px}
.dlg.on-band{background:var(--band);color:#fff;box-shadow:0 0 0 2px var(--rec)}
.dlg.on-band .d-top{background:#fff}
.dlg.on-band p{color:var(--band-muted)}
.dlg.on-band .b1{background:#fff;color:#16130F;min-height:72px;font-size:20px;font-weight:600;padding:0 28px}
.dlg.on-band .b2{--ring-base:inset 0 0 0 2px #fff;color:#fff;min-height:72px;font-size:20px;padding:0 24px}
@media (hover:hover){.dlg.on-band .b1:hover{background:#ECE7DE}.dlg.on-band .b2:hover{background:var(--band-key-hi)}}
@keyframes wt-dlg-in{from{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}

/* =====================================================================
   SHELLS
   ===================================================================== */
[data-for]{display:none}
body[data-shell="family"] [data-for="family"]{display:block}
body[data-shell="storyteller"] [data-for="storyteller"]{display:block}
body[data-shell="bare"] [data-for]{display:none}

/* family top bar */
.topbar{position:sticky;top:0;z-index:30;background:var(--page);border-bottom:1px solid var(--rule)}
.topbar-in{max-width:1280px;margin:0 auto;min-height:var(--top-h);padding:10px 32px;display:flex;align-items:center;gap:40px}
.topbar-mark{font-size:26px;line-height:30px;padding:4px 0 6px}
.nav{display:flex;align-items:stretch;gap:4px;align-self:stretch}
.nav a{--ring-base:0 0 #0000;position:relative;display:flex;align-items:center;padding:0 14px;font-size:17px;line-height:24px;font-weight:500;color:var(--muted);text-decoration:none;border-radius:var(--r)}
.nav a::after{content:"";position:absolute;left:14px;bottom:-11px;width:0;height:5px;background:var(--rule-strong)}
@media (hover:hover){.nav a:hover{color:var(--ink);background:var(--hover)}}
.nav a[aria-current="page"]{color:var(--ink)}
.nav a[aria-current="page"]::after{width:calc(100% - 28px)}
.topbar-end{margin-left:auto;display:flex;align-items:center;gap:20px}
.topbar-plate .n{white-space:nowrap}
.switch-view{--ring-base:inset 0 0 0 1.5px var(--ink);display:inline-flex;align-items:center;gap:10px;min-height:44px;padding:0 14px 0 12px;border-radius:var(--r);box-shadow:var(--ring-base);font-size:15px;line-height:20px;font-weight:500;color:var(--ink);text-decoration:none;white-space:nowrap}
.switch-view::before{content:"";flex:none;width:16px;height:12px;border-radius:2px;box-shadow:inset 0 0 0 1.75px currentColor;background:linear-gradient(currentColor,currentColor) 50% calc(100% - 3px)/6px 1.75px no-repeat}
@media (hover:hover){.switch-view:hover{background:var(--hover)}}
.switch-view.on-band{--ring-base:inset 0 0 0 1.5px #fff;color:#fff}
@media (hover:hover){.switch-view.on-band:hover{background:var(--band-key-hi)}}
.sv-short{display:none}

/* family footer */
.foot{border-top:1px solid var(--rule);margin-top:auto}
.foot-in{max-width:1280px;margin:0 auto;padding:28px 32px 36px;display:flex;align-items:center;gap:16px 32px;flex-wrap:wrap}
.foot-mark{font-size:22px}
.foot-line{flex:1 1 320px}
.foot-acts{display:flex;align-items:center;gap:12px}

/* storyteller footer: a quiet band below the full-bleed studio */
.sfoot{background:var(--band);color:#fff;border-top:1px solid var(--band-rule)}
.sfoot-in{padding:20px 40px 24px;display:flex;align-items:center;gap:16px 24px;flex-wrap:wrap}
.sfoot-mark{font-size:22px;color:#fff;margin-right:auto}
.sfoot .theme-toggle{background:var(--band-key)}

body[data-shell="storyteller"]{background:var(--band)}

/* ---------- reduced motion: fades only ---------- */
@media (prefers-reduced-motion:reduce){
  .caption .w{transition:opacity var(--t-word)}
  .caption .w.hid{transform:none}
  .key,.k2,.end,.b1,.b2,.play,.choice .dot::after,.switch .track::after{transition:none}
  .key:active,.k2:active,.end:active,.b1:active,.b2:active,.play:active{transform:none}
  .key[aria-busy="true"]::after,.b1[aria-busy="true"]::after,.b2[aria-busy="true"]::after{animation:none;width:100%;opacity:.35}
  .dlg[open]{animation:wt-fade var(--t-dialog) linear}
  .toast{animation:wt-fade var(--t-dialog) linear}
}
@keyframes wt-fade{from{opacity:0}to{opacity:1}}

/* =====================================================================
   REFLOW
   ===================================================================== */
@media (max-width:1180px){
  .topbar-in{gap:24px;padding:10px 24px}
  .sv-long{display:none}.sv-short{display:inline}
  .with-rail{grid-template-columns:minmax(0,1fr);max-width:var(--col)}
  .with-rail .rail{position:static;margin-top:40px}
}
@media (max-width:900px){
  .topbar-in{flex-wrap:wrap;gap:0 16px;padding:10px 16px 0}
  .nav{order:3;width:100%;margin:6px -10px 0;gap:0;justify-content:space-between;min-height:48px}
  .nav a{padding:0 10px;font-size:16px}
  .nav a::after{left:10px;bottom:0}
  .nav a[aria-current="page"]::after{width:calc(100% - 20px)}
  .topbar-end{gap:10px}
  :root{--top-h:120px}
}
@media (max-width:760px){
  :root{--gutter:16px}
  .page{padding:48px var(--gutter) 72px}
  .hold{padding:64px var(--gutter) 88px}
  .t-title{font-size:36px;line-height:40px}
  .t-chapter{font-size:26px;line-height:32px}
  .t-dek{font-size:18px;line-height:28px}
  .page-head{margin-bottom:36px}
  .section{margin-top:56px}
  .key{min-width:0;width:100%;min-height:96px;padding:14px 20px;justify-content:flex-start}
  .key .lab b{font-size:22px;line-height:28px}
  .k2{width:100%}
  .caption{font-size:28px;line-height:40px}
  .caption .box{padding:2px 0 3px}
  .lt .n{font-size:28px;line-height:30px}
  .lt.broadcast .n{font-size:24px;line-height:24px;padding:10px 16px 8px}
  .lt.broadcast .s{padding:5px 16px 6px}
  .story{font-size:19px;line-height:32px}
  .q legend,.q .q-title{font-size:30px;line-height:36px}
  .clip .said{font-size:17px;line-height:26px;left:12px;right:12px;bottom:12px}
  .clip .bar{flex-wrap:wrap}
  .foot-in{padding:24px 16px 32px}
  .sfoot-in{padding:18px 16px 22px}
  .dlg .acts{flex-direction:column;align-items:stretch}
  .toast{bottom:16px;left:16px;right:16px;transform:none;max-width:none;animation:wt-fade var(--t-dialog) linear}
}
@media (max-width:480px){
  .topbar-mark{font-size:22px}
  .topbar-plate .s,.topbar-plate .pl-rest{display:none}
  .topbar-plate .n{font-size:15px;padding:6px 10px 5px}
  .switch-view{padding:0 10px;font-size:14px}
  .nav a{padding:0 7px;font-size:15px}
  .nav a::after{left:7px}
  .nav a[aria-current="page"]::after{width:calc(100% - 14px)}
  .nav{margin:6px -7px 0}
  .row .r-end{grid-column:1;grid-row:auto;text-align:left;align-self:start}
  .b1,.b2{white-space:normal;text-align:center}
}
