/* ===========================================================================
   modularCISO — brutalist design system (v0.43.0 redesign)
   ---------------------------------------------------------------------------
   Single shared stylesheet for every page under /site. Pages link it in
   <head> and keep their own <style> block only for page-specific rules.

   Token contract (approved brand tokens):
     --accent      #FF3B00  fills, buttons (ink text on it), large type, bars
     --accent-text #C42E00  small orange text/labels (<24px needs this)
     --ink         #111111  text, 4px/2px borders, dark blocks
     --paper       #FFFFFF  page background
     --paper-2     #F6F4EF  subtle fills: selected/done, callouts, bar tracks
     --muted       #555555  secondary text (>=4.5:1 on paper)

   Legacy aliases below keep the older page CSS (--black/--red/--gray-*, and
   the short --b/--r/--g4 set used by the tool pages) pointing at these
   tokens, so a page adopts the new palette as soon as it links this file and
   drops its own :root block.
   =========================================================================== */

:root {
  /* --- approved tokens --- */
  --accent: #FF3B00;
  --accent-text: #C42E00;
  --ink: #111111;
  --paper: #FFFFFF;
  --paper-2: #F6F4EF;
  --muted: #555555;

  /* --- derived surfaces --- */
  --paper-3: #EDE9E0;          /* heat-map mid band, deeper fills   */
  --rule: #DDDDDD;             /* hairline inside bordered boxes    */
  --on-ink: #FFFFFF;           /* text on ink blocks                */
  --block: var(--ink);         /* "dark block" fill: headers, bands */
  --on-block: var(--on-ink);   /* text on a dark block              */
  --ok: #1F6B3A;               /* "saved" / done states             */

  /* --- structure --- */
  --bw-structural: 4px;
  --bw-component: 2px;
  --border-structural: var(--bw-structural) solid var(--ink);
  --border-component: var(--bw-component) solid var(--ink);
  --border-hairline: 1px solid var(--rule);
  --shell: 1440px;
  --measure: 1360px;

  /* --- type --- */
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --prose: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  --text-scale: 1;             /* lesson text-size control writes this */

  /* --- legacy aliases: long set (home, learn, about, auth, legal) --- */
  --black: var(--ink);
  --white: var(--paper);
  --off-white: var(--paper-2);
  --red: var(--accent);
  --red-dim: #FF3B0015;
  --green: var(--ok);
  --green-dim: #1F6B3A15;
  --gray-100: var(--paper-2);
  --gray-200: var(--rule);
  --gray-400: #8A8A8A;
  --gray-600: var(--muted);
  --gray-800: #2A2A2A;
  --border: var(--border-structural);
  --border-thick: var(--border-structural);
  --border-thin: var(--border-hairline);

  /* --- legacy aliases: short set (tool pages) --- */
  --b: var(--ink);
  --w: var(--paper);
  --r: var(--accent);
  --rd: #FF3B0015;
  --g: var(--ok);
  --gd: #1F6B3A15;
  --g1: var(--paper-2);
  --g2: var(--rule);
  --g4: #8A8A8A;
  --g6: var(--muted);
  --g8: #2A2A2A;
  --m: var(--mono);
  --s: var(--serif);
  --bd: var(--border-component);
  --bt: var(--border-structural);
  --ow: var(--paper-2);

  /* --- status / slide-deck accents used by a few pages --- */
  --green-bg: #1F6B3A15;
  --red-bg: #FF3B0015;
  --yellow: #8A6400;
  --yellow-bg: #8A640015;
  --amber: #8A6400;
  --thin: var(--border-hairline);
}

/* Dark mode: the lesson rail toggle sets data-theme on <html>; with no
   explicit choice the OS preference decides. Tokens are redefined, so every
   component and every legacy alias follows without further rules. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --ink: #F2EFE9;
    --paper: #121110;
    --paper-2: #1E1C1A;
    --paper-3: #2A2724;
    --muted: #A9A29A;
    --rule: #3A3631;
    --on-ink: #121110;
    --block: #23201D;
    --on-block: #F7F4EF;
    --accent-text: #FF7A4D;
    --gray-400: #8E877F;
    --gray-800: #D6D0C8;
    --red-dim: #FF3B0026;
    --green-dim: #1F6B3A26;
    --rd: #FF3B0026;
    --gd: #1F6B3A26;
  }
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --ink: #F2EFE9;
  --paper: #121110;
  --paper-2: #1E1C1A;
  --paper-3: #2A2724;
  --muted: #A9A29A;
  --rule: #3A3631;
  --on-ink: #121110;
  --block: #23201D;
  --on-block: #F7F4EF;
  --accent-text: #FF7A4D;
  --gray-400: #8E877F;
  --gray-800: #D6D0C8;
  --red-dim: #FF3B0026;
  --green-dim: #1F6B3A26;
  --rd: #FF3B0026;
  --gd: #1F6B3A26;
}

/* Slide decks opt out of the theme — see .iframe-wrapper below. */
[data-deck] {
  color-scheme: dark;
  --b: #111111;
  --w: #FFFFFF;
  --ink: #F2EFE9;
  --paper: #111111;
  --paper-2: #1A1A1A;
  --rule: #333333;
  --muted: #999999;
  --g1: #1A1A1A;
  --g2: #333333;
}

/* ---------------------------------------------------------------- base ---- */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* The hidden attribute has to win.
   A browser's own [hidden] { display: none } is the weakest rule there is, so
   any class that sets a display — .btn is inline-flex, .palette-backdrop is
   flex — silently defeats it. Scripts here hide things by setting .hidden,
   and without this the element keeps its layout while believing it is gone:
   the Sign in button stayed on screen after signing in, and Escape stopped
   closing the search palette. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: smooth; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: calc(14px * var(--text-scale));
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); }
a:hover { color: var(--accent-text); }

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

:root { --header-h: 76px; }
:where(.lesson, .quiz-section, [id]) { scroll-margin-top: calc(var(--header-h) + 16px); }

img { max-width: 100%; height: auto; }

/* Long literals — a policy page's SPF record, a command, a hash — must wrap
   or scroll rather than widen the page on a phone. */
pre { overflow-x: auto; max-width: 100%; }
code, kbd, samp { font-family: var(--mono); overflow-wrap: anywhere; word-break: break-word; }
pre code { word-break: normal; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
  position: absolute; left: 8px; top: -56px; z-index: 300;
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  background: var(--ink); color: var(--on-ink); font-weight: 700; font-size: 13px;
  letter-spacing: .14em; text-decoration: none; transition: top .12s;
}
.skip-link:focus { top: 8px; color: var(--on-ink); }

.shell { max-width: var(--shell); margin: 0 auto; }
.measure { max-width: var(--measure); margin: 0 auto; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* --------------------------------------------------------------- type ----- */

.display {
  font-family: var(--serif);
  font-weight: 400;
  line-height: .9;
  letter-spacing: -.02em;
}
.display em, .display .accent { font-style: italic; color: var(--accent); }

.label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.label-accent { color: var(--accent-text); }
.label-sm { font-size: 11px; letter-spacing: .16em; font-weight: 700; text-transform: uppercase; }
.muted { color: var(--muted); }

/* --------------------------------------------------------- components ----- */

/* Buttons: .btn is the base; -ink filled, -accent filled, -line outlined. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 20px;
  border: var(--border-component); background: var(--paper); color: var(--ink);
  font: inherit; font-size: 13px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--paper-2); color: var(--ink); }
.btn-ink, .btn-black, .btn-b, .btn-primary { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.btn-ink:hover, .btn-black:hover, .btn-b:hover, .btn-primary:hover { background: var(--gray-800); color: var(--on-ink); }
.btn-outline, .btn-secondary { background: var(--paper); color: var(--ink); }
.btn-accent, .btn-red { background: var(--accent); color: #111111; border-color: var(--ink); }
.btn-accent:hover, .btn-red:hover { background: var(--accent-text); color: var(--paper); }
.btn-line, .btn-o { background: var(--paper); color: var(--ink); }
.btn-lg { min-height: 56px; padding: 0 26px; font-size: 14px; }
.btn-sm { min-height: 40px; padding: 0 12px; font-size: 12px; letter-spacing: .1em; }
.btn[aria-pressed='true'], .btn.is-active, .btn.active { background: var(--ink); color: var(--on-ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Chip / tag */
.chip {
  display: inline-flex; align-items: center; min-height: 32px; padding: 4px 10px;
  border: var(--border-component); background: var(--paper);
  font-size: 12px; font-weight: 600; text-decoration: none;
}
.chip-fill { background: var(--paper-2); }
.chip-lg { min-height: 52px; padding: 0 22px; font-size: 14px; }
.tag {
  display: inline-flex; align-items: center; padding: 3px 7px;
  border: var(--border-component); background: var(--paper);
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
}
.tag-done { background: var(--ink); color: var(--on-ink); }
.tag-start { background: var(--accent); color: #111111; }

/* Progress bar: 2px outline, paper-2 track, accent fill. */
.bar { height: 6px; border: var(--border-component); background: var(--paper-2); }
.bar > span, .bar > .bar-fill, .bar > .progress-fill {
  display: block; height: 100%; width: 0; background: var(--accent);
}
.bar-lg { height: 10px; }

/* Legacy progress block used by module pages. */
.progress-block { display: flex; flex-direction: column; gap: 8px; }
.progress-label { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.progress-bar { height: 10px; border: var(--border-component); background: var(--paper-2); }
.progress-fill { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* Boxed panel */
.box { border: var(--border-component); background: var(--paper); padding: 18px 20px; }
.box-structural { border: var(--border-structural); }
.box-fill { background: var(--paper-2); }
.box-head {
  background: var(--block); color: var(--on-block); padding: 10px 18px;
  font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
}
.box-ink { background: var(--block); color: var(--on-block); }
.box-ink a { color: var(--on-block); }

/* -------------------------------------------------------------- chrome ---- */

.banner {
  background: var(--accent); color: #111111; text-align: center;
  padding: 12px 16px; font-size: 13px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
}
.banner a { color: #111111; text-decoration: underline; }
/* legacy name on existing pages */
.launch-banner {
  background: var(--accent); color: #111111; text-align: center;
  padding: 12px 16px; font-size: 13px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  position: static;
}
.launch-banner a { color: #111111; text-decoration: underline; margin-left: 10px; }

.site-header {
  position: sticky; top: 0; z-index: 120;
  border-bottom: var(--border-structural); background: var(--paper);
}
.site-header-inner {
  max-width: var(--shell); margin: 0 auto;
  padding: 14px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 20px;
}
.wordmark {
  font-weight: 700; font-size: 20px; letter-spacing: .3em;
  text-transform: uppercase; text-decoration: none; color: var(--ink);
}
.wordmark-sm { font-size: 18px; }

.site-nav { display: flex; flex-wrap: wrap; gap: 4px; font-size: 13px; font-weight: 600; letter-spacing: .12em; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
  text-decoration: none; text-transform: uppercase; border-bottom: 3px solid transparent;
}
.site-nav a:hover { background: var(--paper-2); }
.site-nav a[aria-current='page'], .site-nav a.is-current { border-bottom-color: var(--accent); }

.search {
  flex: 1 1 240px; display: flex; align-items: center; gap: 10px;
  border: var(--border-component); padding: 0 12px; min-height: 44px; background: var(--paper);
}
.search svg { flex: none; }
.search input {
  border: 0; outline: 0; flex: 1; min-width: 0;
  font: inherit; font-size: 14px; background: transparent; color: var(--ink);
}
.search .kbd {
  font-size: 12px; border: 1px solid var(--ink); padding: 2px 6px;
  color: var(--muted); white-space: nowrap;
}

.header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-left: auto; }
.account-btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px;
  background: var(--ink); color: var(--on-ink); text-decoration: none;
  font-weight: 700; letter-spacing: .14em; font-size: 13px; text-transform: uppercase;
}
.account-btn:hover { color: var(--on-ink); }
.account-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #111111;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; overflow: hidden;
}
.account-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Account widget injected by /shared/nav-user.js */
.nav-user { position: relative; display: flex; align-items: center; }
.account-btn-label { display: none; }
@media (min-width: 720px) { .account-btn-label { display: inline; } }
.nav-user-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 200;
  min-width: 230px; background: var(--paper); border: var(--border-structural);
  box-shadow: 6px 6px 0 var(--ink);
}
.nav-user-menu a, .nav-user-menu .nav-user-logout {
  display: block; width: 100%; text-align: left; padding: 12px 16px;
  border: 0; border-bottom: var(--border-hairline); background: var(--paper);
  color: var(--ink); font: inherit; font-size: 12px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; text-decoration: none; cursor: pointer;
}
.nav-user-menu a:hover, .nav-user-menu .nav-user-logout:hover { background: var(--paper-2); color: var(--ink); }
.nav-user-menu .nav-user-logout { color: var(--accent-text); border-bottom: 0; }
.nav-user-id { padding: 14px 16px; border-bottom: var(--border-component); background: var(--paper-2); }
.nav-user-name { display: block; font-size: 13px; font-weight: 700; }
.nav-user-email { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.nav-user-tier { margin-top: 8px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.nav-user-reading { padding: 12px 16px; border-bottom: var(--border-hairline); }
.nav-user-reading-label { display: block; font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.nav-user-reading-row { display: flex; flex-wrap: wrap; gap: 6px; }
.nav-user-reading-row .btn { min-height: 36px; padding: 0 10px; letter-spacing: .04em; text-transform: none; }

/* Reading preferences, on the account page */
.reading-settings { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.reading-settings .btn { text-transform: none; letter-spacing: .04em; }

/* The sticky header says which lesson you are in, so orientation does not
   require scrolling back to the top. */
.breadcrumb-lesson { font-weight: 700; color: var(--ink); }
.breadcrumb-lesson:empty { display: none; }
.breadcrumb-sep:empty { display: none; }

/* Reading progress strip under the lesson header */
.read-bar { height: 6px; background: var(--paper-2); border-top: 1px solid var(--rule); }
.read-bar > span { display: block; height: 100%; width: 0; background: var(--accent); }

.breadcrumb { font-size: 13px; color: var(--muted); flex: 1 1 auto; min-width: 0; }
.breadcrumb a { color: var(--muted); }
.breadcrumb [aria-current='page'], .breadcrumb .here { color: var(--ink); font-weight: 600; }

.site-footer {
  background: var(--block); color: var(--on-block);
  padding: 32px 24px; border-top: var(--bw-structural) solid var(--accent);
}
.site-footer a { color: var(--on-block); }
.site-footer-inner {
  max-width: var(--shell); margin: 0 auto;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; font-size: 13px;
}
.site-footer-links { display: flex; flex-wrap: wrap; gap: 20px; }
.site-footer-brand { letter-spacing: .3em; font-weight: 700; }

/* ------------------------------------------------------- app shell/side --- */

.app-shell { display: flex; flex-wrap: wrap; align-items: stretch; }

.workspace {
  flex: 1 1 280px; max-width: 320px;
  background: var(--paper); color: var(--ink);
  border-right: var(--border-structural); padding: 24px 0;
}
.workspace-label { padding: 8px 24px; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; }
.workspace-item {
  display: flex; gap: 10px; align-items: center; min-height: 48px; padding: 0 24px;
  text-decoration: none; font-size: 14px; color: var(--ink);
  border-left: var(--bw-structural) solid transparent; background: var(--paper);
}
.workspace-item:hover { background: var(--paper-2); color: var(--ink); }
.workspace-item[aria-current='page'], .workspace-item.is-current {
  border-left-color: var(--accent); background: var(--paper-2); font-weight: 700;
}
.workspace-item .badge { margin-left: auto; color: var(--muted); }
.workspace-item .badge-new { color: var(--accent); }
.workspace-module {
  display: flex; flex-direction: column; gap: 8px; padding: 12px 24px;
  text-decoration: none; font-size: 13px; color: var(--ink);
}
.workspace-module:hover { background: var(--paper-2); color: var(--ink); }
.workspace-module-row { display: flex; gap: 10px; align-items: center; }
.workspace-module-row .n { color: var(--muted); }
.workspace-module-row .s { margin-left: auto; color: var(--muted); }
.workspace-module-row .s-done { color: var(--accent-text); }

.app-main { flex: 999 1 640px; min-width: 0; padding: 0 40px; }

/* ----------------------------------------------------------- home page --- */

.hero {
  padding: 64px 0 48px; display: flex; flex-wrap: wrap; gap: 40px;
  align-items: flex-end; border-bottom: var(--border-structural);
}
.hero-head { flex: 999 1 480px; }
.hero h1 { margin: 16px 0 0; font-size: clamp(56px, 9vw, 136px); line-height: .86; }
.hero-aside { flex: 1 1 300px; display: flex; flex-direction: column; gap: 20px; }
.hero-sub { font-size: 16px; line-height: 1.75; color: var(--gray-800); }

.section { padding: 48px 0; }
.section-head {
  display: flex; flex-wrap: wrap; justify-content: space-between;
  align-items: flex-end; gap: 16px; margin-bottom: 32px;
}
.section-title { font-family: var(--serif); font-weight: 400; font-size: clamp(36px, 5vw, 64px); line-height: .95; }

/* Role cards: grid with shared 4px rules, selected = paper-2 + badge. */
.role-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  border-top: var(--border-structural); border-left: var(--border-structural);
}
.role-card {
  text-align: left; display: flex; flex-direction: column; gap: 10px; padding: 24px;
  border: 0; border-right: var(--border-structural); border-bottom: var(--border-structural);
  background: var(--paper); color: var(--ink); font: inherit; min-height: 180px; cursor: pointer;
}
.role-card:hover { background: var(--paper-2); }
.role-card[aria-pressed='true'], .role-card.is-selected { background: var(--paper-2); }
.role-card-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; }
.role-card-name { font-family: var(--serif); font-size: 40px; line-height: 1; }
.role-card-badge { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.role-card-desc { font-size: 13px; line-height: 1.6; color: var(--gray-800); }
.role-card-cta { margin-top: auto; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }

/* Route: three stages, each a rule-connected list of module cards. */
.route-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px; }
.stage-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.stage-num {
  width: 44px; height: 44px; border: var(--border-component);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
}
.stage-num-1 { background: var(--ink); color: var(--on-ink); }
.stage-num-2 { background: var(--accent); color: #111111; }
.stage-num-3 { background: var(--paper); color: var(--ink); }
.stage-name { font-size: 13px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.stage-list {
  border-left: var(--border-structural); margin-left: 20px; padding-left: 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.route-card, .module-card {
  display: flex; flex-direction: column; gap: 10px; padding: 14px 16px;
  background: var(--paper); border: var(--border-component); text-decoration: none;
  color: var(--ink);
}
.route-card:hover, .module-card:hover { background: var(--paper-2); color: var(--ink); }
.route-card.is-done, .module-card.is-done { background: var(--paper-2); }
.route-card-row { display: flex; gap: 14px; align-items: center; }
.route-card-num { font-family: var(--serif); font-size: 32px; line-height: 1; width: 40px; flex: none; }
.route-card-body { flex: 1; min-width: 0; }
.route-card-title { font-weight: 700; font-size: 14px; }
.route-card-meta { font-size: 12px; color: var(--muted); }

.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }

.band {
  background: var(--block); color: var(--on-block); padding: 40px;
  display: flex; flex-wrap: wrap; gap: 32px; align-items: center;
}
.band a:not(.btn) { color: var(--on-block); }
.band-copy { flex: 999 1 400px; }
.band-title { font-family: var(--serif); font-size: clamp(32px, 4.5vw, 52px); line-height: 1; margin-top: 10px; }

/* ---------------------------------------------------------- lesson page --- */

.lesson-layout {
  max-width: var(--measure); margin: 0 auto;
  padding: 40px 24px; display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start;
}
.lesson-toc { flex: 1 1 260px; max-width: 300px; border: var(--border-component); position: sticky; top: calc(var(--header-h) + 16px); }
.lesson-toc-head { padding: 18px 20px; border-bottom: var(--border-component); background: var(--block); color: var(--on-block); }
.lesson-toc-module { display: block; font-size: 11px; letter-spacing: .18em; font-weight: 700; color: var(--accent); text-transform: uppercase; }
.lesson-toc-title { display: block; font-family: var(--serif); font-size: 30px; line-height: 1.05; margin-top: 4px; letter-spacing: 0; text-transform: none; }
.lesson-toc-count { display: block; font-size: 12px; margin-top: 10px; letter-spacing: .04em; text-transform: none; font-weight: 400; }
.lesson-toc-link {
  display: flex; gap: 12px; align-items: center; padding: 12px 20px;
  border-bottom: var(--border-hairline); text-decoration: none; font-size: 13px;
  background: var(--paper); color: var(--ink);
}
.lesson-toc-link:hover { background: var(--paper-2); color: var(--ink); }
.lesson-toc-link.is-current { background: var(--paper-2); font-weight: 700; }
.lesson-toc-mark {
  flex: none; width: 22px; height: 22px; border: var(--border-component);
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px;
  background: var(--paper); color: var(--ink);
}
.lesson-toc-link.is-done .lesson-toc-mark { background: var(--ink); color: var(--on-ink); }
.lesson-toc-link.is-current .lesson-toc-mark { background: var(--accent); color: #111111; }

.lesson-main { flex: 999 1 560px; min-width: 0; max-width: 760px; }
.lesson-rail { flex: 1 1 240px; max-width: 280px; display: flex; flex-direction: column; gap: 20px; position: sticky; top: calc(var(--header-h) + 16px); }

.lesson-counter { font-size: 12px; font-weight: 700; letter-spacing: .18em; color: var(--accent-text); text-transform: uppercase; }
.lesson-h1 { margin: 10px 0 18px; font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 6vw, 80px); line-height: .92; }
.lesson-h1 em, .lesson-h1 .accent { font-style: italic; color: var(--accent); }

.meta-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; font-size: 12px; font-weight: 600; }
.meta-chips > span { border: var(--border-component); padding: 4px 10px; }
.meta-chips .provenance { background: var(--paper-2); }

.learn-box { border: var(--border-component); padding: 18px 22px; margin-bottom: 32px; background: var(--paper-2); }
.learn-box-label { font-size: 12px; font-weight: 700; letter-spacing: .16em; margin-bottom: 8px; text-transform: uppercase; }
.learn-box-list { font-size: 14px; line-height: 1.8; }

.prose { font-family: var(--prose); font-size: calc(19px * var(--text-scale)); line-height: 1.75; color: var(--gray-800); }
.prose p { margin: 0 0 22px; }
.prose h2 { font-family: var(--serif); font-weight: 400; font-size: calc(40px * var(--text-scale)); margin: 36px 0 12px; color: var(--ink); line-height: 1.05; }
.prose h3 { font-family: var(--serif); font-weight: 400; font-size: calc(28px * var(--text-scale)); margin: 28px 0 10px; color: var(--ink); }
.prose ul, .prose ol { margin: 0 0 22px 24px; }
.prose li { margin-bottom: 8px; }
.prose strong { font-weight: 700; color: var(--ink); }
.prose a { text-decoration: underline; }

/* Key Concept / callouts: 4px border, ink title bar. */
.concept, .callout { border: var(--border-structural); margin: 28px 0; background: var(--paper); }
.concept-head, .callout-label {
  display: block; background: var(--block); color: var(--on-block); padding: 10px 18px;
  font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
}
.concept-body, .callout > *:not(.callout-label) { padding: 0 22px; }
.concept-body { padding: 20px 22px; font-size: 15px; line-height: 1.7; }
.callout { padding-bottom: 14px; }
.callout > .callout-label + * { padding-top: 16px; }
/* Key Concept: ink title bar, as the approved lesson design has it. Accent
   fills are reserved for the one "Try it now" card per module, so the page
   has a single loud element rather than three competing ones. */
.callout-key { background: var(--paper-2); }
.callout-source {
  margin-top: 14px; padding-top: 10px; border-top: var(--border-hairline);
  font-family: var(--mono); font-size: 12px; line-height: 1.6; color: var(--muted);
}
.callout-source a { color: var(--accent-text); }
.callout-example > .callout-label { background: var(--gray-800); }
.callout-framework > .callout-label { background: var(--accent-text); }

.try-it {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
  padding: 20px 22px; background: var(--accent); color: #111111;
  text-decoration: none; border: var(--border-structural);
}
.try-it:hover { color: #111111; background: var(--accent-text); }
.try-it-label { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.try-it-title { font-size: 17px; font-weight: 700; }
.try-it-cta { font-weight: 700; font-size: 14px; letter-spacing: .14em; text-transform: uppercase; }

.lesson-nav {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  margin-top: 48px; padding-top: 24px; border-top: var(--border-structural);
}

.rail-box { border: var(--border-component); padding: 18px; background: var(--paper); }
.rail-label { font-size: 12px; font-weight: 700; letter-spacing: .16em; margin-bottom: 12px; text-transform: uppercase; }
.rail-links { display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.rail-links a { text-decoration: none; padding-left: 13px; }
.rail-links a.is-current { font-weight: 700; border-left: 3px solid var(--accent); padding-left: 10px; }
.rail-terms { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.rail-terms span { border: 1px solid var(--ink); padding: 4px 8px; }
.rail-controls { display: flex; flex-direction: column; gap: 10px; }
.rail-controls .btn { letter-spacing: .04em; text-transform: none; font-weight: 600; min-height: 44px; }

/* Provenance moved out of the top of the article and into a footnote at the
   end of the page; the module meta row links down to it. */
.content-notes { margin: 56px 0 0; padding-top: 20px; border-top: var(--border-structural); }
.content-notes-label { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.content-notes .callout { border: var(--border-component); margin: 16px 0 0; background: var(--paper-2); }
.content-notes .callout-label { background: transparent; color: var(--muted); padding: 12px 18px 0; font-size: 11px; }
.content-notes .callout p, .content-notes .callout li { font-size: 13px; line-height: 1.7; color: var(--gray-800); }
.fn-ref { font-size: .7em; line-height: 0; vertical-align: super; }
.fn-ref a { text-decoration: none; padding: 0 2px; color: var(--accent-text); font-weight: 700; }
.fn-ref a:hover { text-decoration: underline; }

/* Module page legacy structures, restyled. */
.module-header { padding: 40px 0 24px; border-bottom: var(--border-structural); margin-bottom: 32px; }
.module-num {
  display: inline-block; vertical-align: middle;
  font-family: var(--serif); font-size: 56px; line-height: 1; color: var(--accent);
}
.module-title { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 6vw, 72px); line-height: .95; margin: 8px 0; }
.module-subtitle { font-size: 15px; line-height: 1.7; color: var(--muted); max-width: 64ch; }
.module-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; font-size: 12px; font-weight: 600; }
.module-meta > span { border: var(--border-component); padding: 4px 10px; }
.module-version { font-size: 12px; color: var(--muted); }
.lesson { border-bottom: var(--border-structural); padding: 36px 0; }
.lesson:last-of-type { border-bottom: 0; }
.lesson-header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.lesson-num { font-family: var(--serif); font-size: 36px; line-height: 1; color: var(--accent); }
.lesson-header h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 4.4vw, 48px); line-height: 1; }
.next-module { border: var(--border-structural); padding: 24px; margin: 40px 0; display: block; text-decoration: none; background: var(--paper-2); }
.next-label { font-size: 12px; font-weight: 700; letter-spacing: .16em; color: var(--accent-text); text-transform: uppercase; }
.next-title { font-family: var(--serif); font-size: 32px; line-height: 1.05; margin-top: 6px; }

.table-wrapper { overflow-x: auto; max-width: 100%; margin: 0 0 22px; border: var(--border-component); }
.content-table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 13px; }
.content-table th, .content-table td { padding: 10px 12px; text-align: left; border-bottom: var(--border-hairline); }
.content-table thead th { background: var(--block); color: var(--on-block); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.content-table tbody tr:last-child td { border-bottom: 0; }
/* Embedded slide decks.
   The decks lay themselves out with `height: 100vh` and scroll internally, so
   the embed has to be a real box: with no height they collapse to the
   browser's default 150px and all a reader sees is the deck's footer bar. */
.iframe-wrapper { border: var(--border-structural); margin: 0 0 26px; background: #111111; }
.iframe-bar {
  display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between;
  padding: 8px 14px; border-bottom: var(--border-component);
  background: var(--block); color: var(--on-block);
  font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
}
.iframe-bar a { color: var(--on-block); text-decoration: none; border-bottom: 1px solid currentColor; }
.iframe-bar a:hover { color: var(--accent); }
.iframe-wrapper iframe {
  display: block; width: 100%; border: 0;
  aspect-ratio: 16 / 10; min-height: 440px; max-height: 78vh;
}
@media (max-width: 900px) {
  .iframe-wrapper iframe { aspect-ratio: 4 / 3; min-height: 360px; }
}

/* Quiz */
.quiz-section { border: var(--border-structural); margin: 48px 0; padding: 28px 24px; background: var(--paper-2); }
.quiz-section h2 { font-family: var(--serif); font-weight: 400; font-size: 44px; line-height: 1; }
.quiz-desc { font-size: 14px; color: var(--muted); margin: 8px 0 24px; }
.quiz-question { border: var(--border-component); background: var(--paper); padding: 18px 20px; margin-bottom: 16px; }
.q-num { font-size: 11px; font-weight: 700; letter-spacing: .16em; color: var(--accent-text); text-transform: uppercase; }
.q-text { font-size: 15px; font-weight: 700; margin: 6px 0 14px; }
.quiz-options { display: flex; flex-direction: column; gap: 8px; }
.quiz-options label { display: flex; gap: 10px; align-items: flex-start; border: var(--border-component); padding: 10px 12px; font-size: 13px; cursor: pointer; }
.quiz-options label:hover { background: var(--paper-2); }
.q-feedback { margin-top: 12px; font-size: 13px; font-weight: 600; }
.quiz-result { border: var(--border-structural); padding: 20px; margin-top: 20px; background: var(--paper); }
.score { font-family: var(--serif); font-size: 56px; line-height: 1; }
.score-label { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }

/* ---------------------------------------------- legacy page scaffolding ---
   Class names the existing pages (and the structure tests) already use. They
   are styled here so a page can drop its own copy of these rules and inherit
   the redesign instead. */

.logo {
  font-weight: 700; font-size: 18px; letter-spacing: .3em;
  text-transform: uppercase; text-decoration: none; color: var(--ink);
}
nav .nav-inner, .nav-inner {
  max-width: var(--shell); margin: 0 auto; padding: 14px 24px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
}
.nav-meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.nav-meta a { color: var(--muted); text-decoration: none; }
.nav-meta a:hover { color: var(--accent-text); }

/* The module page's two-column shell becomes the three-column lesson view. */
.page {
  max-width: var(--measure); margin: 0 auto;
  padding: 40px 24px; display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start;
}
.content { flex: 999 1 560px; min-width: 0; max-width: 860px; }
.sidebar {
  flex: 1 1 260px; max-width: 300px; border: var(--border-component);
  background: var(--paper); position: sticky; top: calc(var(--header-h) + 16px);
  max-height: calc(100vh - var(--header-h) - 32px); overflow-y: auto;
}
.sidebar-label {
  padding: 18px 20px; background: var(--block); color: var(--on-block);
  font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
}
.sidebar ol { list-style: none; margin: 0; padding: 0; }
.sidebar ol li { margin: 0; }
.sidebar ol li a {
  display: flex; gap: 12px; align-items: center; padding: 12px 20px;
  border-bottom: var(--border-hairline); text-decoration: none; font-size: 13px; color: var(--ink);
}
.sidebar ol li a:hover { background: var(--paper-2); color: var(--ink); }
.sidebar ol li a.active, .sidebar ol li a.is-current { background: var(--paper-2); font-weight: 700; }
.sidebar .progress-block { padding: 16px 20px; border-top: var(--border-component); }

.module-meta span.tier, .tier { background: var(--paper-2); font-weight: 700; }
.content-provenance-meta {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}

/* Lesson prose: the module pages write plain <p>/<h3> inside .lesson, so the
   reading treatment is attached to those rather than to a wrapper class. */
.lesson p, .lesson li { font-family: var(--prose); font-size: calc(17px * var(--text-scale)); line-height: 1.75; color: var(--gray-800); }
.lesson p { margin: 0 0 20px; }
.lesson h3 {
  font-family: var(--serif); font-weight: 400; color: var(--ink);
  font-size: calc(30px * var(--text-scale)); line-height: 1.1; margin: 32px 0 12px;
}
.lesson ul, .lesson ol { margin: 0 0 20px 24px; }
.lesson li { margin-bottom: 8px; }
.lesson strong { font-weight: 700; color: var(--ink); }
.lesson a { text-decoration: underline; }
.lesson a.btn, .lesson .try-it, .lesson .learn-method { text-decoration: none; }
.lesson .callout p, .lesson .callout li { font-family: var(--mono); font-size: calc(14px * var(--text-scale)); line-height: 1.7; }
.lesson table p { font-family: var(--mono); font-size: 13px; margin: 0; }

.video-placeholder {
  border: var(--border-component); background: var(--paper-2);
  padding: 28px; text-align: center; margin: 0 0 22px;
}
.video-placeholder .play-icon { font-size: 32px; color: var(--accent-text); }
.video-placeholder .video-title { font-weight: 700; font-size: 14px; margin-top: 8px; }
.video-placeholder .video-duration { font-size: 12px; color: var(--muted); }

/* Quiz answer states */
.quiz-options input[type='radio'] { margin-top: 4px; accent-color: var(--accent); }
.quiz-options label.correct { background: var(--green-dim); border-color: var(--ok); }
.quiz-options label.incorrect { background: var(--red-dim); border-color: var(--accent-text); }
.q-feedback { display: none; }
.q-feedback.show { display: block; }
.q-feedback.correct { color: var(--ok); }
.q-feedback.incorrect { color: var(--accent-text); }

footer { background: var(--block); color: var(--on-block); padding: 32px 24px; border-top: var(--bw-structural) solid var(--accent); }
footer a { color: var(--on-block); }
footer a:hover { color: var(--accent); }
footer .footer-inner, .footer-inner {
  max-width: var(--shell); margin: 0 auto;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; font-size: 13px;
}
.footer-left { letter-spacing: .3em; font-weight: 700; }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; list-style: none; }

/* ------------------------------------------------------------ tool page --- */

.tool-header-inner {
  max-width: var(--shell); margin: 0 auto;
  padding: 14px 24px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
}
.save-status { font-size: 12px; font-weight: 700; color: var(--ok); white-space: nowrap; }
.save-status[data-state='dirty'] { color: var(--accent-text); }
.save-status[data-state='error'] { color: var(--accent-text); }
.save-status[data-state='local'] { color: var(--muted); }

.split { max-width: var(--shell); margin: 0 auto; display: flex; flex-wrap: wrap; align-items: stretch; }
.split-list {
  flex: 1 1 420px; max-width: 500px;
  border-right: var(--border-structural); padding: 20px 24px;
}
.split-detail { flex: 999 1 560px; min-width: 0; padding: 28px 40px 56px; }

.list-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.list-head h2 { margin: 0; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; font-size: 12px; font-weight: 600; }

.row-card {
  display: flex; width: 100%; gap: 14px; align-items: center; text-align: left;
  padding: 12px; margin-bottom: 8px; background: var(--paper);
  border: var(--border-component); color: var(--ink); font: inherit; min-height: 64px; cursor: pointer;
}
.row-card:hover { background: var(--paper-2); }
.row-card.is-selected, .row-card[aria-selected='true'] { border: var(--border-structural); background: var(--paper-2); }
.row-card-body { flex: 1; min-width: 0; }
.row-card-title { font-size: 14px; font-weight: 700; }
.row-card-meta { font-size: 12px; color: var(--muted); }
.score-square {
  flex: none; width: 44px; height: 44px; display: inline-flex; align-items: center;
  justify-content: center; font-weight: 700; background: var(--paper-2); color: var(--ink);
}
.score-square.sev-high { background: var(--ink); color: var(--on-ink); }
.score-square.sev-med { background: var(--accent); color: #111111; }
.score-square.sev-low { background: var(--paper-2); color: var(--ink); }

.detail-label { font-size: 12px; font-weight: 700; letter-spacing: .18em; color: var(--accent-text); text-transform: uppercase; }
.detail-title { margin: 8px 0 28px; font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 4.6vw, 56px); line-height: .98; }
.detail-cols { display: flex; flex-wrap: wrap; gap: 36px; }
.detail-form { flex: 1 1 320px; display: flex; flex-direction: column; gap: 20px; }
.detail-side { flex: 1 1 260px; max-width: 360px; display: flex; flex-direction: column; gap: 20px; }

.field { display: flex; flex-direction: column; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.field input, .field select, .field textarea {
  background: var(--paper); color: var(--ink); border: var(--border-component);
  font: inherit; font-size: 14px; font-weight: 400; letter-spacing: 0; text-transform: none;
}
.field input, .field select { min-height: 48px; padding: 0 10px; }
.field textarea { padding: 10px; line-height: 1.6; resize: vertical; }
.field-row { display: flex; flex-wrap: wrap; gap: 12px; }
.field-row > .field { flex: 1 1 140px; }

fieldset.scale { border: 0; margin: 0; padding: 0; }
fieldset.scale legend { font-size: 12px; font-weight: 700; letter-spacing: .14em; margin-bottom: 8px; text-transform: uppercase; }
.scale-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.scale-grid button {
  min-height: 48px; background: var(--paper); color: var(--ink);
  border: var(--border-component); font: inherit; font-weight: 700; cursor: pointer;
}
.scale-grid button:hover { background: var(--paper-2); }
.scale-grid button[aria-pressed='true'] { background: var(--ink); color: var(--on-ink); }

.heat { border: var(--border-structural); padding: 18px; }
.heat-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 12px; }
.heat-score { font-family: var(--serif); font-size: 28px; line-height: 1.1; white-space: nowrap; }
.heat-score .heat-band { color: var(--accent-text); }
.heat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin-top: 12px; }
.heat-cell { aspect-ratio: 1; background: var(--paper-2); outline: none; outline-offset: -4px; }
.heat-cell.band-high { background: var(--ink); }
.heat-cell.band-med { background: var(--accent); }
.heat-cell.band-low { background: var(--paper-3); }
.heat-cell.band-min { background: var(--paper-2); }
.heat-cell.is-current { outline: var(--bw-structural) solid var(--accent); }
.heat-axis { display: flex; justify-content: space-between; font-size: 11px; margin-top: 8px; }

.learn-method { display: block; border: var(--border-structural); padding: 16px 18px; text-decoration: none; background: var(--paper-2); }
.learn-method:hover { background: var(--paper-3); color: var(--ink); }
.learn-method-label { display: block; font-size: 11px; font-weight: 700; letter-spacing: .16em; color: var(--accent-text); text-transform: uppercase; }
.learn-method-title { display: block; margin-top: 4px; font-size: 14px; font-weight: 700; }

.empty-state { border: var(--border-component); padding: 24px; text-align: center; background: var(--paper-2); font-size: 13px; }
.empty-state p { margin-bottom: 14px; }

/* Card grids used by /tools, /learn and the content pages. */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0; border-top: var(--border-structural); border-left: var(--border-structural); }
.card {
  display: flex; flex-direction: column; gap: 10px; padding: 24px;
  border-right: var(--border-structural); border-bottom: var(--border-structural);
  background: var(--paper); text-decoration: none; color: var(--ink);
}
.card:hover { background: var(--paper-2); color: var(--ink); }
.card-title { font-family: var(--serif); font-size: 30px; line-height: 1.05; }
.card-desc { font-size: 13px; line-height: 1.6; color: var(--muted); }
.card-cta { margin-top: auto; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }

/* ---------------------------------------------------- cookie/storage notice */

.cookie-notice {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 300;
  background: var(--paper); border-top: var(--border-structural);
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -6px 0 rgba(17, 17, 17, .08);
}
.cookie-notice-inner {
  max-width: var(--measure); margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between;
}
.cookie-notice-text { flex: 1 1 420px; font-size: 13px; line-height: 1.65; margin: 0; }
.cookie-notice-text a { color: var(--accent-text); }
.cookie-notice .btn { flex: 0 0 auto; }
@media (max-width: 560px) {
  .cookie-notice-inner { gap: 10px; }
  .cookie-notice .btn { width: 100%; }
}
@media print { .cookie-notice { display: none !important; } }

/* ------------------------------------------------------- command palette -- */

.palette-backdrop {
  position: fixed; inset: 0; z-index: 400; background: rgba(17, 17, 17, .45);
  display: flex; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px;
}
.palette {
  width: min(680px, 100%); background: var(--paper); border: var(--border-structural);
  display: flex; flex-direction: column; max-height: 70vh;
}
.palette-input-row { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: var(--border-component); min-height: 56px; }
.palette-input-row input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; color: var(--ink); }
.palette-results { overflow-y: auto; }
.palette-result {
  display: flex; gap: 12px; align-items: center; width: 100%; text-align: left;
  padding: 12px 16px; border: 0; border-bottom: var(--border-hairline);
  background: var(--paper); color: var(--ink); font: inherit; text-decoration: none; cursor: pointer;
}
.palette-result[aria-selected='true'], .palette-result:hover { background: var(--paper-2); }
.palette-kind { flex: none; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-text); width: 72px; }
.palette-title { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; }
.palette-ctx { font-size: 12px; color: var(--muted); }
.palette-empty { padding: 24px 16px; font-size: 13px; color: var(--muted); }
.palette-foot { border-top: var(--border-component); padding: 10px 16px; font-size: 11px; color: var(--muted); display: flex; gap: 16px; flex-wrap: wrap; }

/* -------------------------------------------------------------- mobile ---- */

@media (max-width: 900px) {
  .app-shell { display: block; }
  .workspace {
    max-width: none; width: 100%;
    border-right: 0; border-bottom: var(--border-structural); padding: 16px 0;
  }
  .app-main { padding: 0 20px; }
  /* Stacked, a sticky column has the whole page to travel through and ends
     up floating over the article. Below the breakpoint it scrolls normally. */
  .sidebar, .lesson-toc, .lesson-rail {
    position: static; max-width: none; width: 100%;
    max-height: none; overflow: visible;
  }
  .split-list { max-width: none; border-right: 0; border-bottom: var(--border-structural); }
  .split-detail { padding: 24px 20px 48px; }
  .site-header-inner, .tool-header-inner { padding: 12px 16px; gap: 12px; }
  .search { order: 10; flex-basis: 100%; }
  .hero { padding: 40px 0 32px; }
  .band { padding: 28px 20px; }
}

@media (max-width: 560px) {
  .site-header .crumb-module-title, .site-header .crumb-sep, .site-header .crumb-readtime { display: none; }
  .container, .lesson-layout { padding-left: 16px; padding-right: 16px; }
  .app-main { padding: 0 16px; }
  .site-nav { gap: 0; }
  .site-nav a { padding: 0 10px; }
  .role-card-name { font-size: 32px; }
  .lesson-nav > * { flex: 1 1 100%; }
}

/* --------------------------------------------------------------- print ---- */

@media print {
  .banner, .launch-banner, .site-nav, .search, .header-actions, .workspace,
  .lesson-rail, .read-bar, .palette-backdrop, .site-footer { display: none !important; }
  body { font-size: 11pt; }
  .prose { font-size: 11pt; }
  a { text-decoration: underline; }
}
