/* Shared lesson player. Layout: one lesson "stage" (the scene being narrated) over captions and controls; the check follows in the same frame.
   Twisted VoIP look: slate frame, orange for actions and progress; phishing "tells" marked in a warning red. */
:root {
  --bg: #f4f5f7; --surface: #ffffff; --ink: #141a24; --ink-2: #3c4656; --muted: #5d6676; --line: #e2e5ea;
  --brand: #ff9602; --brand-text: #b45309; --brand-ink: #1a1a1a; --slate: #1f2937; --slate-2: #2c3747; --focus: #141a24;
  --warn: #b42318; --warn-strong: #b42318; --warn-soft: #fde8e6; --ok: #15803d; --ok-soft: #e3f4e8; --mail-bg: #fbfbfc;
  --font-ui: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0f141b; --surface: #171e28; --ink: #eef1f5; --ink-2: #c3cad5; --muted: #8b95a5; --line: #2a3442; --brand-text: #ffad33; --focus: #eef1f5; --warn-strong: #b42318;
  --slate: #0b1018; --slate-2: #1a2230; --warn: #ff6b5e; --warn-soft: #3a1f1d; --ok: #4ade80; --ok-soft: #14301f; --mail-bg: #1c2430;
  color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #0f141b; --surface: #171e28; --ink: #eef1f5; --ink-2: #c3cad5; --muted: #8b95a5; --line: #2a3442; --brand-text: #ffad33; --focus: #eef1f5; --warn-strong: #b42318;
  --slate: #0b1018; --slate-2: #1a2230; --warn: #ff6b5e; --warn-soft: #3a1f1d; --ok: #4ade80; --ok-soft: #14301f; --mail-bg: #1c2430;
  color-scheme: dark }

* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font-ui); margin: 0; }
.wrap { max-width: 980px; margin: 0 auto; padding-inline: 16px; padding-block: 20px 40px; display: grid; gap: 16px; }
.mono { font-family: var(--font-mono); }

/* course bar */
.course { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.brandline { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .01em; }
.brandline { gap: 14px; flex-wrap: wrap; }
/* our logo is black + orange on transparent: on a dark page it sits on a white chip */
.tvlogo { height: 26px; width: auto; display: block; }
.brandtext { display: grid; line-height: 1.2; padding-left: 14px; border-left: 2px solid var(--line); }
.brandtext #brand { font-weight: 800; font-size: 15px; }
.brandtext small { font-weight: 600; font-size: 12px; color: var(--muted); letter-spacing: .02em; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tvlogo { background: #fff; padding: 5px 8px; border-radius: 8px; box-sizing: content-box; } }
:root[data-theme="dark"] .tvlogo { background: #fff; padding: 5px 8px; border-radius: 8px; box-sizing: content-box; }
@media (max-width: 520px) { .tvlogo { height: 20px; } .brandtext { padding-left: 10px; } }
.meta { color: var(--muted); font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; }
.meta b { color: var(--ink-2); font-weight: 600; }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; background: var(--surface); }
.langbtn { font: inherit; font-size: 13px; font-weight: 700; border: 0; background: transparent; color: var(--muted); padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.langbtn[aria-pressed="true"] { background: var(--slate); color: #fff; }
.langbtn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1 { font-size: clamp(24px, 3.4vw, 34px); line-height: 1.15; margin: 0; letter-spacing: -.02em; text-wrap: balance; font-weight: 800; }

/* stage */
.player { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stage { position: relative; background: var(--slate); aspect-ratio: 16 / 9; max-width: 100%; overflow: hidden; }
@media (max-width: 620px) { .stage { aspect-ratio: 3 / 4; } .stage .scene { padding-top: 48px; } }
.scene { position: absolute; inset: 0; display: grid; place-items: center; padding: 4%; opacity: 0; transition: opacity .45s ease; pointer-events: none; }
.scene.on { opacity: 1; pointer-events: auto; }
.chip-step { position: absolute; top: 14px; left: 14px; background: rgba(255,255,255,.1); color: #e6ebf2; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; }

/* shared lesson parts: warning marks, labels pinned to what they mark, entry animation */
.anchor { position: relative; }
.tell { border-radius: 4px; transition: background .3s, box-shadow .3s, color .3s; }
.tell.lit { background: var(--warn-soft); box-shadow: 0 0 0 2px var(--warn); color: var(--warn); }
.tag { position: absolute; right: 10px; top: -11px; background: var(--warn-strong); color: #fff; font-size: 11.5px; font-weight: 800; letter-spacing: .04em; padding: 4px 9px; border-radius: 999px; opacity: 0; transition: .3s; white-space: nowrap; z-index: 1; }
.tag.on { opacity: 1; }
@keyframes arrive { from { transform: translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } }
[data-managed] { display: none; }
body.managed [data-managed] { display: revert; }

/* closing scene: what to do (every lesson) */
.todo { width: min(720px, 94%); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.todo .card { background: var(--surface); border-radius: 12px; padding: 16px; display: grid; gap: 6px; align-content: start; color: var(--ink-2); font-size: clamp(12px, 1.5vw, 14px); }
.todo .card h3 { margin: 0; color: var(--ink); font-size: 1.08em; }
.todo .card .big { font-family: var(--font-mono); color: var(--ink); font-weight: 500; }
.scene.on .todo .card { animation: arrive .5s both; }
.scene.on .todo .card:nth-child(2) { animation-delay: .25s; }
.scene.on .todo .card:nth-child(3) { animation-delay: .5s; }
.todo .card .ct-org { color: var(--ink); font-weight: 600; }
.todo .card.key { box-shadow: inset 0 0 0 2px var(--brand); }
@media (max-width: 620px) { .todo { grid-template-columns: 1fr; gap: 8px; } .todo .card { padding: 10px 12px; } .todo .card p { display: none; } }

/* captions and controls */
.caption { padding: 14px 18px; min-height: 76px; font-size: 15.5px; color: var(--ink); border-bottom: 1px solid var(--line); }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 18px; }
.btn { font: inherit; font-weight: 700; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 8px 14px; border-radius: 9px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible, .opt:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.progress { flex: 1 1 220px; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; min-width: 0; }
.progress i { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; position: relative; }
.progress i.done { background: var(--brand); }
.progress i .fill { position: absolute; inset: 0; width: 0; background: var(--brand); }
.time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.voice-note { color: var(--muted); font-size: 12.5px; padding: 0 18px 12px; }

/* check */
.check { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: grid; gap: 14px; }
.check h2 { margin: 0; font-size: 20px; letter-spacing: -.01em; }
.qcount { color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.q { font-size: 17px; font-weight: 700; margin: 0; max-width: 62ch; text-wrap: balance; }
.opts { display: grid; gap: 8px; }
.opt { font: inherit; text-align: left; background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; }
.opt:hover:not(:disabled) { border-color: var(--muted); }
.opt.right { border-color: var(--ok); background: var(--ok-soft); }
.opt.wrong { border-color: var(--warn); background: var(--warn-soft); }
.opt:disabled { cursor: default; }
.why { border-radius: 10px; padding: 12px 14px; background: var(--bg); color: var(--ink-2); }
.why b { color: var(--ink); }
.done { text-align: center; display: grid; gap: 10px; justify-items: center; padding: 10px 0 4px; }
.seal { width: 64px; height: 64px; border-radius: 50%; background: var(--brand); display: grid; place-items: center; }
.done .score { font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.done p { margin: 0; color: var(--ink-2); max-width: 52ch; }
.support { font-family: var(--font-mono); background: var(--bg); padding: 2px 8px; border-radius: 6px; user-select: all; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* course home: the lesson list */
.home { display: grid; gap: 18px; }
.home p.lede { margin: 0; color: var(--ink-2); max-width: 64ch; }
.lessons { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.lcard { font: inherit; text-align: left; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 4px; cursor: pointer; }
.lcard:hover:not(:disabled) { border-color: var(--muted); }
.lcard:disabled { cursor: default; background: transparent; border-style: dashed; }
.lcard .num { font-size: 12px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--brand-text); }
.lcard:disabled .num { color: var(--muted); }
.lcard b { font-size: 15.5px; }
.lcard small { color: var(--muted); }
.lcard:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.backlink { font: inherit; font-size: 14px; font-weight: 700; color: var(--ink-2); background: none; border: 0; padding: 0; cursor: pointer; justify-self: start; }
.backlink:hover { color: var(--ink); text-decoration: underline; }
[hidden] { display: none !important; }
/* trainee site: each lesson's state on their list */
.lcard.st-done small { color: var(--ok); font-weight: 600; }
.lcard.st-overdue small { color: var(--warn); font-weight: 600; }
.lcard.st-due { box-shadow: inset 0 0 0 2px var(--brand); }
.savenote { font-size: 14px; color: var(--muted); display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }

/* accessibility and legal */
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--surface); color: var(--ink); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { top: 8px; }
.opt .mark-r, .opt .mark-w { font-weight: 800; margin-right: 6px; }
.opt.right .mark-r { color: var(--ok); } .opt.wrong .mark-w { color: var(--warn); }
.q:focus { outline: none; }
.transcript { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 18px; }
.transcript summary { cursor: pointer; font-weight: 700; padding: 12px 0; }
.transcript summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.transcript ol { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 8px; color: var(--ink-2); }
.legal { margin-top: 12px; color: var(--muted); font-size: 13px; display: grid; gap: 6px; }
.legal a { color: var(--ink-2); }
.legal nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }
main { display: grid; gap: 16px; }
main:focus { outline: none; }
/* the footer sits at the bottom of the window on short pages (header, content, footer) */
.wrap { min-height: 100vh; min-height: 100dvh; grid-template-rows: auto 1fr auto; }
main { align-content: start; }
.legal { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 8px; }
