/* The app's look: "Acquisition Bay".
   Neutral instrument chrome (hairlines, channel tags, LUT ramps, tabular readouts) so only the data carries color.
   Subject colors come from neurons.js as --st-*; canvases sit in a fixed dark well; the slide viewer and its
   panels share one dark room. Radii: 4px controls, 8px panes and dialogs. No shadows except popovers. */

/* ---------- tokens ---------- */
:root, [data-theme="dark"] {
  --bg: #111416; --surface: #171b1e; --surface-2: #1e2327;
  --fg: #e9ebe6; --muted: #9ba5a6;
  --accent: #ece8dc; --accent-fg: #101315; --accent-soft: rgb(236 232 220 / .08);
  --key: #6aa1ff; --hy: #f2b544; --formula: #b48cff; --clinical: #ff7a7a; --mnemonic: #4fd18b; --check: #3cc9c0; --beyond: #8e9799;
  --good: #4fd18b; --bad: #ff7a7a; --mask: #f2b544; --mask-fg: #1b1505;
  --g1: #7d93ff; --g2: #5ef2a0; --g3: #ff6b8f; --g4: #ffd36b;
  --lamp: radial-gradient(120vmax 70vmax at 50% -30%, rgb(255 246 228 / .06), transparent 60%);
  --pop-shadow: 0 8px 24px rgb(0 0 0 / .45);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f2f3f1; --surface: #ffffff; --surface-2: #e9ebe8;
  --fg: #15181a; --muted: #575f63;
  --accent: #1a1d20; --accent-fg: #f5f4ef; --accent-soft: rgb(26 29 32 / .06);
  --key: #2f62e6; --hy: #94600f; --formula: #7a4fd6; --clinical: #c53030; --mnemonic: #1b7a48; --check: #0e7770; --beyond: #626b70;
  --good: #1b7a48; --bad: #b92b2b; --mask: #f2b544; --mask-fg: #1b1505;
  --g1: #3f5bd9; --g2: #12985a; --g3: #d6336c; --g4: #b7791f;
  --lamp: none;
  --pop-shadow: 0 8px 24px rgb(16 20 24 / .14);
  color-scheme: light;
}
[data-theme="sepia"] {
  --bg: #f3ead8; --surface: #fbf5e8; --surface-2: #efe4cd;
  --fg: #3b2f20; --muted: #6a5a44;
  --accent: #2e2418; --accent-fg: #fbf5e8; --accent-soft: rgb(46 36 24 / .07);
  --key: #3a5c9c; --hy: #8a5608; --formula: #7a4fa8; --clinical: #a83232; --mnemonic: #376d37; --check: #26706a; --beyond: #6a5a44;
  --good: #376d37; --bad: #9c2c2c; --mask: #d99a2b; --mask-fg: #1b1505;
  --g1: #3e64a8; --g2: #2f7c74; --g3: #a83232; --g4: #a86a12;
  --lamp: none;
  --pop-shadow: 0 8px 24px rgb(60 40 10 / .14);
  color-scheme: light;
}
/* Vivid themes: app.js injects --bg --surface --surface-2 --border --accent --accent-fg --accent-soft --g1 --g2 --g3 inline. */
[data-theme="vivid"] {
  --fg: #eef0f7; --muted: #a7adc2;
  --key: #7cb4ff; --hy: #fbbf24; --formula: #c4a7ff; --clinical: #ff8a8a; --mnemonic: #5be3a0; --check: #45e0d4; --beyond: #a7adc2;
  --good: #5be3a0; --bad: #ff8a8a; --mask: #fbbf24; --mask-fg: #1b1505; --g4: #ffd36b;
  --lamp: radial-gradient(70vw 55vh at 12% -12%, color-mix(in srgb, var(--g1) 9%, transparent), transparent 70%);
  --pop-shadow: 0 8px 24px rgb(0 0 0 / .45);
  color-scheme: dark;
}
[data-theme="vivid-light"] {
  --fg: #16151f; --muted: #5a5d70;
  --key: #2f62e6; --hy: #94600f; --formula: #7a4fd6; --clinical: #c53030; --mnemonic: #1b7a48; --check: #0e7770; --beyond: #5a5d70;
  --good: #1b7a48; --bad: #b92b2b; --mask: #f2b544; --mask-fg: #1b1505; --g4: #b7791f;
  --lamp: radial-gradient(70vw 55vh at 12% -12%, color-mix(in srgb, var(--g1) 9%, transparent), transparent 70%);
  --pop-shadow: 0 8px 24px rgb(30 20 60 / .14);
  color-scheme: light;
}
:root {
  /* hairlines derive from fg/bg only, so vivid themes keep working */
  --line: color-mix(in srgb, var(--fg) 13%, transparent);
  --line-strong: color-mix(in srgb, var(--fg) 55%, var(--bg));
  /* the eyepiece: canvases sit in this well in every theme */
  --well: #080b0c;
  /* the dark room: slide viewer, AI tutor, flag panel, and text over the well or the Focus sky */
  --room-bg: #0c0f10; --room-surface: #13171a; --room-surface-2: #1b2024;
  --room-line: rgb(233 235 230 / .13); --room-line-strong: rgb(233 235 230 / .42);
  --room-fg: #e9ebe6; --room-muted: #a3acad;
  --room-ink: #ece8dc; --room-ink-fg: #101315;
  --room-flag: #f2b544; --room-flag-fg: #1b1505;
  --room-rec: #c8312c; --room-rec-fg: #ffffff; --room-err: #ff9d96;
  --room-select: #4f7cff;
  --paper: #ffffff; --paper-ink: #111111;
  --display: Archivo, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ui: Archivo, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Chivo Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --read: "Source Serif 4", Georgia, serif;
  --size: 16px;
  --r-ctl: 4px; --r-pane: 8px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-move: cubic-bezier(.65, 0, .35, 1);
}
[data-font="lexend"] {
  --ui: Lexend, system-ui, sans-serif; --read: Lexend, system-ui, sans-serif; --display: Lexend, system-ui, sans-serif;
}
/* reticle tick length; motion.js animates the lock-on, CSS only sets the end state */
@property --tick { syntax: "<length>"; inherits: true; initial-value: 10px; }

/* ---------- base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: var(--size); }
body {
  margin: 0; color: var(--fg); font: 400 1rem/1.55 var(--ui); -webkit-font-smoothing: antialiased;
  background: var(--lamp) fixed, var(--bg);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:is(p, li, .small, .eyebrow, .notes, .commons-msg) a:not(.btn, .chip, .lec-row) {
  text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 3px;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.ic { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
kbd { font: 400 max(12px, .75rem)/1.4 var(--mono); padding: 0 5px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); }
mark { background: color-mix(in srgb, var(--hy) 35%, transparent); color: inherit; border-radius: 2px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; flex: none; }

/* browser surfaces: selection, caret and scrollbars wear the palette, not the browser default */
::selection { background: color-mix(in srgb, var(--key) 30%, transparent); }
:where(input, textarea, [contenteditable]) { caret-color: var(--key); }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border: 3px solid var(--bg); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--fg) 42%, var(--bg)); }
/* the slide viewer and its panels are their own dark room, so their scrollbars tint from room ink */
.viewer, .ai-log { scrollbar-color: var(--room-line-strong) transparent; }
.viewer ::-webkit-scrollbar-thumb, .ai-log::-webkit-scrollbar-thumb { border-color: var(--room-bg); background: var(--room-line-strong); }

/* type roles */
h1, h2, h3 { margin: 0; line-height: 1.25; text-wrap: balance; }
h1, .display {
  font-family: var(--display); font-stretch: 118%; font-weight: 300; letter-spacing: -.02em; line-height: 1.04;
}
h1 { font-size: clamp(2.25rem, 4.4vw, 3rem); }
h2 { font-family: var(--ui); font-stretch: 100%; font-weight: 560; font-size: 1.2rem; letter-spacing: -.01em; }
h3 { font-weight: 600; font-size: 1rem; letter-spacing: -.005em; }
em { font-style: normal; font-weight: 600; }
/* data labels: mono, lowercase, tabular, never under 12px */
.eyebrow, .section-label, .kicker, .today-date, .tour-step, .flag-h, .palette-results .kind, .slide-cards-pop .kind, .sel-idea .kind {
  font-family: var(--mono); font-size: max(12px, .78rem); font-weight: 400; letter-spacing: 0; text-transform: lowercase; font-variant-numeric: tabular-nums;
}
/* one inline run: the channel bar, links and text wrap together, never as separate blocks */
.eyebrow { color: var(--muted); display: block; }
.eyebrow > .subject-dot { vertical-align: -2px; margin-right: 8px; }
.eyebrow a { text-transform: none; }
/* mono tags that hold only slide numbers, subject names and theme names follow the same lowercase rule */
.src, .ai-sub, .scope-caption, .subject-filter .chip, .unlock-chip { text-transform: lowercase; }
.section-label { color: var(--muted); margin: 10px 0 -8px; }
.kicker { margin: 0; color: var(--muted); }

/* ---------- form fields (zero specificity, so components override) ---------- */
:where(input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="color"]), select, textarea) {
  min-height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-ctl);
  background-color: var(--surface); color: var(--fg); font: 400 .95rem/1.3 var(--ui);
}
:where(textarea) { padding: 9px 12px; }
::placeholder { color: var(--muted); opacity: 1; }

/* ---------- shell ---------- */
.shell { display: flex; max-width: 1440px; margin: 0 auto; min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; z-index: 2; height: 100dvh; width: 232px; flex: none; padding: 20px 12px;
  display: flex; flex-direction: column; gap: 24px; border-right: 1px solid var(--line); background: var(--lamp) fixed, var(--bg);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px; color: var(--fg); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; flex: none; fill: none; stroke: var(--g2); stroke-width: 1.6; stroke-linecap: round; }
.brand-mark circle { fill: var(--g2); stroke: none; }
.brand-mark circle:first-child { fill: color-mix(in srgb, var(--g2) 30%, transparent); stroke: var(--g2); stroke-width: 1.6; }
.brand-name, .brand-mobile { font-family: var(--display); font-stretch: 112%; font-weight: 500; font-size: 1.1rem; letter-spacing: -.01em; }
/* "eequalsmcsquared" is long: it fits the 232px sidebar at 1rem, and never pushes past it */
.brand-name { font-size: 1rem; letter-spacing: -.02em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav, #sideNav { position: relative; display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 38px; padding: 0 10px 0 14px; border-radius: var(--r-ctl); color: var(--muted); font-weight: 500; transition: background-color .16s var(--ease-out), color .16s var(--ease-out); }
@media (pointer: coarse) { .nav a, .side-link { min-height: 44px; } }
/* a phone in landscape gets the sidebar in a short window: let it scroll so Settings and Theme stay reachable */
@media (max-height: 560px) { .sidebar { overflow-y: auto; overscroll-behavior: contain; gap: 16px; padding-block: 12px; } }
.nav a:hover { background: color-mix(in srgb, var(--fg) 5%, transparent); color: var(--fg); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--fg); }
/* without motion.js the current item still gets its 2px bar */
#sideNav:not(:has(.nav-tick)) a[aria-current="page"] { box-shadow: inset 2px 0 0 var(--accent); }
.nav-tick { position: absolute; left: 0; top: 0; width: 2px; height: 20px; background: var(--accent); pointer-events: none; }
.nav-l { display: flex; align-items: center; gap: 10px; }
.nav-l svg { width: 18px; height: 18px; flex: none; }
.badge {
  font: 500 max(12px, .75rem)/1.5 var(--mono); font-variant-numeric: tabular-nums; min-width: 22px; padding: 0 5px;
  border-radius: 2px; background: var(--accent); color: var(--accent-fg); text-align: center;
}
.side-foot { margin-top: auto; padding: 0 10px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.side-link { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 6px 0; transition: color .16s var(--ease-out); }
.side-link:hover { color: var(--fg); text-decoration: none; }
.side-link .ic { width: 18px; height: 18px; }
.side-link:hover, .side-link[aria-current] { color: var(--fg); text-decoration: none; }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 12px 24px; background: var(--lamp) fixed, var(--bg); }
.brand-mobile { display: none; color: var(--fg); margin-right: auto; }
.search-btn {
  margin-left: auto; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; min-width: 240px;
  border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--surface); color: var(--muted);
}
.search-btn:hover { border-color: var(--line-strong); color: var(--fg); }
.search-btn span { margin-right: auto; }
.topbar .chip { height: 40px; padding: 0 12px; }
.help-btn { width: 40px; padding: 0; justify-content: center; font: 500 .95rem var(--ui); }
.topbar .topbar-theme { display: none; }
.topbar-settings[aria-current] { border-color: var(--accent); }
main { padding: 8px 24px 120px; outline: none; }
.page { max-width: 980px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
/* narrow pages share the wide pages' left edge; only the reading measure narrows */
.page.narrow { max-width: 980px; }
.page.narrow > * { width: 100%; max-width: 760px; }
.tabbar { display: none; }
.commons-frame { display: none; flex: 1; min-height: 0; width: 100%; border: 0; background: var(--bg); }
body.commons-mode .main-col, body.atlas-mode .main-col { height: 100dvh; }
body.commons-mode #view, body.atlas-mode #view { display: none; }
body.commons-mode #commonsFrame, body.atlas-mode #atlasFrame { display: block; }
@media (max-width: 820px) { body.commons-mode .main-col, body.atlas-mode .main-col { height: calc(100dvh - 66px - env(safe-area-inset-bottom)); } }
@media (min-width: 821px) { .topbar .topbar-settings { display: none; } }
@media (max-width: 820px) {
  .sidebar { display: none; }
  .topbar { padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); }
  .brand-mobile { display: block; line-height: 44px; min-height: 44px; min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: clamp(.8rem, 4vw, 1.1rem); font-stretch: 100%; }
  .topbar { gap: 6px; }
  .topbar > :not(.brand-mobile) { flex: none; }
  .search-btn { min-width: 0; margin-left: 0; height: 44px; width: 44px; justify-content: center; padding: 0; }
  .search-btn span, .search-btn kbd { display: none; }
  .topbar .chip { height: 44px; }
  .help-btn { width: 44px; }
  .topbar .topbar-theme { display: inline-flex; }
  main { padding: 4px 16px 140px; }
  /* WCAG 2.5.5: comfortable touch targets on the phone (the compact .sm variant stays small on purpose) */
  main .btn:not(.sm) { min-height: 44px; }
  .player .icon-btn, .reward .icon-btn { width: 44px; height: 44px; }
  .tabbar { display: flex; position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; background: var(--bg); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; padding: 8px 2px 6px; font-size: 11px; color: var(--muted); position: relative; }
  .tabbar a > span:not(.badge) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a[aria-current="page"] { color: var(--fg); }
  .tabbar a[aria-current="page"]::before { content: ""; position: absolute; top: -1px; left: 50%; width: 20px; height: 2px; margin-left: -10px; background: var(--accent); }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar .badge { position: absolute; top: 3px; left: 55%; min-width: 18px; padding: 0 4px; font-size: 12px; line-height: 16px; }
}

/* ---------- buttons, tags, segmented controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border-radius: var(--r-ctl); border: 1px solid var(--line-strong); background: transparent; color: var(--fg);
  font: 500 .94rem/1.2 var(--ui); white-space: nowrap; transition: background-color .18s, border-color .18s, color .18s;
}
.btn:hover { background: color-mix(in srgb, var(--fg) 6%, transparent); text-decoration: none; }
.btn:active { translate: 0 1px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--bg)); }
.btn.ghost { border-color: transparent; }
.btn.ghost:hover { background: color-mix(in srgb, var(--fg) 7%, transparent); }
.btn.big { min-height: 44px; padding: 0 20px; font-size: 1rem; }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: .88rem; gap: 6px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn .ic { width: 1.05em; height: 1.05em; }
.btn kbd { color: inherit; border-color: currentColor; opacity: .7; }
.icon-btn {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center; padding: 0;
  border-radius: var(--r-ctl); border: 1px solid var(--line); background: transparent; color: var(--fg); font-size: .9rem;
  transition: background-color .18s var(--ease-out), border-color .18s var(--ease-out), color .18s var(--ease-out);
}
.icon-btn:hover { border-color: var(--line-strong); text-decoration: none; }
.icon-btn:active { translate: 0 1px; }
.icon-btn .ic { width: 18px; height: 18px; }
.icon-btn.quiet { border-color: transparent; color: var(--muted); }
.icon-btn.quiet:hover { color: var(--fg); background: color-mix(in srgb, var(--fg) 7%, transparent); }

/* tags: the chip, preset, mood and unlock controls all wear the channel-tag look */
.chip, .preset, .mood, .unlock-chip {
  position: relative; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px;
  border-radius: var(--r-ctl); border: 1px solid var(--line); background: transparent; color: var(--fg);
  font: 500 max(12px, .75rem)/1 var(--mono); letter-spacing: 0; font-variant-numeric: tabular-nums; white-space: nowrap;
  transition: background-color .18s, border-color .18s, color .18s;
}
.chip:hover, .preset:hover, .mood:hover, button.unlock-chip:hover { border-color: var(--line-strong); text-decoration: none; }
.chip:active, .preset:active, .mood:active, button.unlock-chip:active { translate: 0 1px; }
.chip[aria-pressed="true"], .chip[aria-current="page"], .mood[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.chip:disabled { opacity: .45; cursor: default; }
.chip .ic, .preset .ic, .mood .ic, .unlock-chip .ic { width: 14px; height: 14px; }
/* subject tags carry a 2x12 LUT bar, black up to the stain */
.chip.has-ch::before { content: ""; flex: none; width: 2px; height: 12px; background: linear-gradient(to top, color-mix(in srgb, var(--ch, var(--muted)) 15%, black), var(--ch, var(--muted))); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
/* text fields that borrowed the chip class */
input.chip, select.chip { height: 40px; padding: 0 12px; border-color: var(--line-strong); background: var(--surface); font: 400 .95rem/1.2 var(--ui); white-space: normal; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r-ctl); }
.seg a, .seg button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border: 0; border-radius: 2px;
  background: transparent; color: var(--muted); font: 500 .9rem/1.2 var(--ui);
}
.seg a:hover, .seg button:hover { color: var(--fg); background: color-mix(in srgb, var(--fg) 6%, transparent); text-decoration: none; }
.seg [aria-current="page"], .seg [aria-pressed="true"],
.seg [aria-current="page"]:hover, .seg [aria-pressed="true"]:hover { background: var(--accent); color: var(--accent-fg); }
.seg [aria-pressed="true"] .muted, .seg [aria-current="page"] .muted { color: inherit; opacity: .72; }
.seg .muted { font: 400 max(12px, .75rem) var(--mono); }
.seg.wrap { flex-wrap: wrap; }

.switch {
  position: relative; width: 44px; height: 24px; flex: none; padding: 0; border-radius: 999px;
  border: 1px solid var(--line-strong); background: transparent; transition: background-color .24s, border-color .24s;
}
.switch span { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .24s var(--ease-out), background-color .24s; }
.switch[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.switch[aria-checked="true"] span { transform: translateX(20px); background: var(--accent-fg); }

/* touch sizing also covers a phone turned sideways (wider than 820px but still a finger) and tablets */
@media (max-width: 820px), (pointer: coarse) {
  .btn, .btn.big, .btn.sm { min-height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  /* a 28px tag grows to a 46px target; wrapped tag rows get an 18px row gap (end of file) so targets never overlap */
  .chip::after, .preset::after, .mood::after, button.unlock-chip::after { content: ""; position: absolute; inset: -9px -3px; }
  .switch::after { content: ""; position: absolute; inset: -10px -2px; }
  input.chip, select.chip { height: 44px; font-size: max(1rem, 16px); }
  .seg a, .seg button { min-height: 44px; min-width: 44px; justify-content: center; }
  :where(input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="color"]), select, textarea) { min-height: 44px; font-size: max(1rem, 16px); }
  /* inline text links: vertical padding grows the hit box to 44px without moving the line */
  .eyebrow a, #aiKeyStatus a, .set-ctl .small a, .commons-msg a { padding-block: 15px; }
}

/* ---------- containers ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pane); padding: 18px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 14px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty h2 { color: var(--fg); margin-bottom: 6px; }
.notice { margin: 0; font-size: .875rem; color: var(--muted); }
.with-icon { display: flex; gap: 8px; align-items: flex-start; }
.with-icon .ic { margin-top: 2px; }
.subject-dot { display: inline-block; flex: none; width: 2px; height: 14px; background: var(--st, var(--muted)); }
.s-anatomy { --st: var(--st-anatomy, var(--muted)); }
.s-physio { --st: var(--st-physio, var(--muted)); }
.s-biochem { --st: var(--st-biochem, var(--muted)); }
.s-other { --st: var(--st-other, var(--muted)); }

/* panes: a hairline grid; the seams are the container's background showing through a 1px gap */
.panes {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1px;
  background: var(--line); background-clip: padding-box; border: 1px solid var(--line); border-radius: var(--r-pane); overflow: clip;
}
.pane {
  position: relative; isolation: isolate; min-width: 0; padding: 20px;
  background-color: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pane);
}
.panes > .pane, .pane-stack > .pane { border: 0; border-radius: 0; }
.panes > * { grid-column: span 12; }
.panes > .span-5 { grid-column: span 5; }
.panes > .span-6 { grid-column: span 6; }
.panes > .span-7 { grid-column: span 7; }
.panes > .span-12 { grid-column: span 12; }
/* an odd last half-width pane takes the full row instead of leaving a seam-colored hole */
.panes > .span-6:nth-child(odd of .span-6):nth-last-child(1 of .span-6) { grid-column: span 12; }
.pane-stack { display: flex; flex-direction: column; gap: 1px; min-width: 0; background: var(--line); }
.panes > .pane-stack { background: transparent; }
.pane-stack > .pane { flex: 1 0 auto; }
@media (max-width: 900px) {
  .panes > .span-5, .panes > .span-6, .panes > .span-7, .panes > .span-12 { grid-column: 1 / -1; }
}
.pane h2 { font-size: 1.05rem; }
.pane > h2 { margin-bottom: 12px; }
.pane-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.pane-head > .switch { align-self: center; }
/* a title beside a control gets a control-height line, so a button's label shares its baseline without pushing it
   down, and side-by-side heads (Soundscape | Binaural) put their titles on one line across the seam */
.pane-head:has(> .btn, > .switch) > h2 { line-height: 32px; }
@media (max-width: 820px) { .pane-head:has(> .btn, > .switch) > h2 { line-height: 44px; } }
/* the 14px button label's baseline sits ~2.4px lower in its box than the title's; the negative margin keeps it on the
   shared baseline without lowering the title */
.pane-head > .btn { margin-top: -3px; }
/* a trailing ghost button's label ends on the content edge, not 12px short of it */
.pane-head > .btn.ghost:last-child { margin-right: -12px; }
.pane-head p { margin: 4px 0 0; max-width: 62ch; }
@media (max-width: 560px) { .pane { padding: 16px; } }

/* reticle: 10px L-ticks at top-left and bottom-right; they lock on (16px) under the pointer */
.reticle {
  --tc: color-mix(in srgb, var(--fg) 35%, transparent); --ti: 10px;
  background-image: linear-gradient(var(--tc), var(--tc)), linear-gradient(var(--tc), var(--tc)), linear-gradient(var(--tc), var(--tc)), linear-gradient(var(--tc), var(--tc));
  background-size: var(--tick) 1px, 1px var(--tick), var(--tick) 1px, 1px var(--tick);
  background-position: left var(--ti) top var(--ti), left var(--ti) top var(--ti), right var(--ti) bottom var(--ti), right var(--ti) bottom var(--ti);
  background-repeat: no-repeat;
}
@media (hover: hover) { .reticle:hover { --tick: 16px; } }
.reticle:focus-within { --tick: 16px; }

/* cursor light: motion.js sets --mx/--my and .lit; the glow sits above the surface, under the content */
.pane::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--fg) 8%, transparent), transparent 70%);
  opacity: 0; transition: opacity .3s;
}
.pane.lit::after { opacity: 1; }
.pane.no-light::after { content: none; }

/* ---------- lecture list ---------- */
.lec-list { display: flex; flex-direction: column; }
.card.lec-list { background: none; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; overflow: visible; }
.lec-row { display: flex; align-items: center; gap: 14px; padding: 12px 8px; border-top: 1px solid var(--line); color: var(--fg); min-width: 0; border-radius: var(--r-ctl); transition: background-color .18s var(--ease-out); }
.lec-row:first-child { border-top: 0; }
.lec-row:hover, .lec-row:focus-visible { background: color-mix(in srgb, var(--fg) 7%, transparent); text-decoration: none; }
.lec-row:active { translate: 0 1px; }
.lec-row .thumb { width: 88px; aspect-ratio: 16/9; flex: none; border-radius: var(--r-ctl); object-fit: cover; background: var(--surface-2); border: 1px solid var(--line); transition: border-color .18s var(--ease-out), transform .18s var(--ease-out); }
.lec-row:hover .thumb, .lec-row:focus-visible .thumb { border-color: var(--line-strong); transform: scale(1.045); }
/* a lecture without slides: a dashed empty slot that says so, not a failed image */
.lec-row div.thumb { display: grid; place-items: center; text-align: center; background: transparent; border-style: dashed; border-color: var(--line-strong); }
.lec-row div.thumb::after { content: "no slides"; font: 400 12px/1 var(--mono); color: var(--muted); }
.lec-row .meta { flex: 1; min-width: 0; }
.lec-row .title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.lec-row .counts { font: 400 max(12px, .78rem) var(--mono); font-variant-numeric: tabular-nums; text-transform: lowercase; color: var(--muted); white-space: nowrap; }
@media (max-width: 560px) { .lec-row .thumb { width: 64px; } .lec-row .counts { display: none; } }

/* ---------- lecture page ---------- */
.lec-head { display: flex; flex-direction: column; gap: 10px; }
.lec-tabs { position: sticky; top: 64px; z-index: 4; background: var(--lamp) fixed, var(--bg); overflow-x: auto; scrollbar-width: none; }
.lec-tabs .seg { display: flex; flex-wrap: nowrap; gap: 24px; padding: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; white-space: nowrap; }
.lec-tabs .seg a { min-height: 44px; margin-bottom: -1px; padding: 0; border-radius: 0; color: var(--muted); font-size: .95rem; }
.lec-tabs .seg a:hover { background: none; color: var(--fg); }
.lec-tabs .seg a[aria-current="page"], .lec-tabs .seg a[aria-current="page"]:hover { background: none; color: var(--fg); box-shadow: inset 0 -2px 0 var(--accent); }
/* a tab's count: any span inside the tab link */
.lec-tabs a > span { font: 400 max(12px, .75rem) var(--mono); font-variant-numeric: tabular-nums; color: var(--muted); }
@media (max-width: 820px) { .lec-tabs { top: calc(max(10px, env(safe-area-inset-top)) + 54px); } }
.objectives { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.objectives .ic, .lec-objectives .ic { width: 1em; height: 1em; margin-left: 6px; vertical-align: -.15em; }
.objectives .ic.ok { color: var(--good); } .objectives .ic.miss { color: var(--bad); }
.notes { font: 400 1.06rem/1.7 var(--read); max-width: 72ch; }
.notes p { margin: 0 0 12px; }
.note-section { scroll-margin-top: 120px; border-top: 1px solid var(--line); padding-top: 22px; margin-top: 10px; }
.note-section h2 { font-family: var(--ui); margin-bottom: 4px; }
.sec-tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 14px; font-family: var(--ui); }
/* source tags: slide numbers and recording timestamps */
.src {
  position: relative; display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px; margin-left: 4px; vertical-align: 2px;
  font: 400 max(12px, .72rem)/1 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: 0; color: var(--muted);
  border: 1px solid var(--line); border-radius: 3px; background: transparent; cursor: pointer; white-space: nowrap;
}
.src:hover { color: var(--fg); border-color: var(--line-strong); }
.src .ic { width: 11px; height: 11px; }
.src.said { color: var(--check); border-color: color-mix(in srgb, var(--check) 45%, var(--line)); }
@media (max-width: 820px) { .src::after { content: ""; position: absolute; inset: -12px -4px; } }

/* callouts: no box; a hairline on top, a channel bar and mono label on the left */
.callout, .check {
  --c: var(--beyond);
  display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); column-gap: 20px; row-gap: 0; align-items: start;
  margin: 0 0 16px; padding: 12px 0 2px; border-top: 1px solid var(--line); font: 400 .97rem/1.6 var(--ui);
}
.callout > *, .check > * { grid-column: 2; min-width: 0; }
.callout > .label, .check > .label {
  grid-column: 1; grid-row: 1 / span 12; display: flex; flex-direction: column; gap: 8px; margin: 0; padding-top: 4px;
  font: 400 max(12px, .75rem)/1.35 var(--mono); letter-spacing: 0; text-transform: lowercase; color: var(--muted); overflow-wrap: anywhere;
}
.callout > .label::before, .check > .label::before {
  content: ""; width: 2.5rem; height: 3px; flex: none; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 20%, black), var(--c));
}
.callout.key { --c: var(--key); } .callout.hy { --c: var(--hy); } .callout.formula { --c: var(--formula); }
.callout.clinical { --c: var(--clinical); } .callout.mnemonic { --c: var(--mnemonic); } .callout.beyond { --c: var(--beyond); }
.callout.said { --c: var(--check); } .check { --c: var(--check); }
.callout.sample { --c: var(--beyond); font-size: .92rem; }
/* not from your slides / not from your recording: the channel bar is dashed */
.callout.beyond > .label::before, .callout.sample > .label::before { background: repeating-linear-gradient(90deg, var(--c) 0 6px, transparent 6px 10px); }
.callout.formula .body { font-family: var(--mono); font-size: .9rem; }
.callout > .src, .check > button { justify-self: start; margin: 6px 0 0; }
.check .answer { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
@media (max-width: 560px) {
  .callout, .check { grid-template-columns: minmax(0, 1fr); }
  .callout > *, .check > *, .callout > .label, .check > .label { grid-column: 1; }
  .callout > .label, .check > .label { grid-row: auto; flex-direction: row; align-items: center; gap: 10px; padding: 0 0 6px; }
  .callout > .label::before, .check > .label::before { width: 1.5rem; }
}
.table-wrap { overflow-x: auto; margin: 0 0 14px; border: 1px solid var(--line); border-radius: var(--r-pane); }
.table-wrap table { width: 100%; border-collapse: collapse; font: .9rem/1.45 var(--ui); }
.table-wrap caption { text-align: left; padding: 10px 12px 6px; font-weight: 600; caption-side: top; }
.table-wrap th, .table-wrap td { padding: 8px 12px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.table-wrap th { font-weight: 600; border-bottom: 1px solid var(--line-strong); }
.flow { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 6px; font: .95rem/1.45 var(--ui); counter-reset: f; }
.flow li { display: flex; gap: 10px; align-items: flex-start; }
.flow li::before { counter-increment: f; content: counter(f, decimal-leading-zero); flex: none; width: 2.2em; font: 400 max(12px, .75rem)/1.85 var(--mono); font-variant-numeric: tabular-nums; color: var(--muted); }
.flow.quiz li.hidden-step span { color: transparent; background: var(--surface-2); border-radius: 2px; cursor: pointer; user-select: none; }
.simple { font: .95rem/1.55 var(--ui); border-top: 1px solid var(--line); padding: 10px 0 0; margin: 0 0 12px; }
.focus-mode .sidebar, .focus-mode .topbar, .focus-mode .tabbar, .focus-mode .lec-tabs, .focus-mode .hide-in-focus { display: none !important; }
.listen-active { background: color-mix(in srgb, var(--hy) 18%, transparent); border-radius: 2px; transition: background-color .2s; }

/* slides */
.slide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.slide-tile { display: flex; flex-direction: column; padding: 0; overflow: hidden; text-align: left; cursor: zoom-in; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-ctl); }
.slide-tile:hover { border-color: var(--line-strong); }
.slide-tile img { width: 100%; aspect-ratio: 16/9; object-fit: contain; background: var(--paper); display: block; }
.slide-tile .cap { padding: 8px 10px; display: flex; justify-content: space-between; gap: 8px; font: 400 max(12px, .75rem) var(--mono); font-variant-numeric: tabular-nums; text-transform: lowercase; color: var(--muted); }
.slide-tile .marked { color: var(--fg); }
.slide-tile .flag-mark { color: var(--hy); margin-right: 6px; }
.card-count { margin-left: 6px; padding: 1px 6px; font: 400 max(12px, .72rem) var(--mono); font-variant-numeric: tabular-nums; color: var(--fg); border: 1px solid var(--line-strong); border-radius: 3px; }

/* ---------- slide viewer: the dark room ---------- */
dialog { color: var(--fg); }
.viewer { border: 0; padding: 0; margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: var(--room-bg); color: var(--room-fg); }
.viewer::backdrop { background: var(--room-bg); }
.viewer[open] { display: flex; flex-direction: column; }
.viewer :focus-visible { outline-color: var(--room-ink); }
.viewer .muted { color: var(--room-muted); }
.viewer a { color: var(--room-fg); }
.viewer input[type="checkbox"] { accent-color: var(--room-ink); }
.viewer ::placeholder { color: var(--room-muted); }
.viewer-head > #viewerClose { flex: none; }
.viewer-actions { margin-left: auto; }
.viewer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); border-bottom: 1px solid var(--room-line); }
.viewer-title { font-weight: 500; font-size: .95rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-actions { display: flex; gap: 6px; flex: none; }
.viewer-main { flex: 1; min-height: 0; display: flex; }
.viewer-stage { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.viewer-status { position: absolute; left: 50%; top: 12px; z-index: 3; margin: 0; transform: translateX(-50%); padding: 8px 14px; border-radius: var(--r-ctl); background: var(--room-ink); color: var(--room-ink-fg); font-size: .88rem; font-weight: 560; pointer-events: none; opacity: 0; transition: opacity .2s; }
.viewer-status:not(.on) { padding: 0; }
.viewer-status.on { opacity: 1; }
.viewer-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; padding: 12px 8px; }
/* a size container, so the slide fits whatever room the bars and Slide text leave and never rides up over the toolbar */
.viewer-fig { margin: 0; display: grid; place-items: center; min-height: 0; min-width: 0; height: 100%; container-type: size; }
.viewer-nav { height: 64px; border: 1px solid var(--room-line); border-radius: var(--r-ctl); background: transparent; color: var(--room-fg); font-size: 2rem; line-height: 1; }
.viewer-nav:hover:not(:disabled) { background: var(--room-surface); border-color: var(--room-line-strong); }
.viewer-nav:disabled { opacity: .2; }
.chip.dark { background: transparent; border-color: var(--room-line); color: var(--room-fg); }
.chip.dark:hover { border-color: var(--room-line-strong); background: var(--room-surface); }
.chip.dark[aria-pressed="true"], .mark-tools .chip[aria-pressed="true"] { background: var(--room-ink); border-color: var(--room-ink); color: var(--room-ink-fg); }
.chip.dark.save:not(:disabled) { background: var(--room-ink); border-color: var(--room-ink); color: var(--room-ink-fg); }
.chip.dark.flag-toggle.flagged { background: var(--room-flag); border-color: var(--room-flag); color: var(--room-flag-fg); }
.chip.card-pill { border-color: var(--room-line-strong); }
.viewer-ocr { max-height: 30dvh; overflow: auto; padding: 12px 20px 20px; font-size: .9rem; color: var(--room-fg); border-top: 1px solid var(--room-line); white-space: pre-wrap; }
@media (max-width: 820px) {
  .viewer-body { grid-template-columns: 1fr; padding: 8px; }
  .viewer-nav { display: none; }
  /* many tools on a narrow screen: the toolbar scrolls sideways and the title steps aside;
     the block padding keeps each tag's 44px hit area inside the scroller */
  .viewer-head { gap: 8px; padding-block: 4px; padding-top: max(4px, env(safe-area-inset-top)); }
  .viewer-title { display: none; }
  .viewer-actions { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; justify-content: flex-start; padding: 8px; margin-inline: -8px 0; }
  .viewer-actions .chip { flex: none; }
  /* phones have no Esc: Close sits outside the scroller, so nothing passes under it; the scroller's right edge
     fades to show there are more tools */
  .viewer-actions { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent); }
  #viewerHelp, .ai-head .chip[data-icon] { min-width: 44px; justify-content: center; }
}

/* image + masks share one box sized by width, so masks stay on their labels at any size */
.occl { --w: 16; --h: 9; position: relative; width: 100%; aspect-ratio: var(--w) / var(--h); background: var(--paper); border-radius: var(--r-ctl); overflow: hidden; container-type: inline-size; }
.occl img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.viewer-fig .occl { width: min(100cqw, 100cqh * var(--w) / var(--h)); }
@media (max-width: 820px) {
  /* the tutor sheet covers the lower 60%, so pin the slide to the top 40% */
  .viewer.ai-open .viewer-body { align-items: start; }
  .viewer.ai-open .viewer-fig { height: auto; container-type: normal; }
  .viewer.ai-open .viewer-fig .occl { width: min(100%, calc((40dvh - 70px) * var(--w) / var(--h))); }
}
.flash .occl { max-width: calc(62dvh * var(--w) / var(--h)); margin: 0 auto; }
.mask { position: absolute; background: var(--mask); border-radius: 3px; box-shadow: 0 0 0 2px rgb(0 0 0 / .25); display: grid; place-items: center; color: var(--mask-fg); font: 600 .75rem var(--ui); }
.mask.target { animation: pulse 1.6s ease-in-out infinite; }
.mask.revealed { background: transparent; box-shadow: 0 0 0 2px var(--good); animation: none; }
.mask.other { background: color-mix(in srgb, var(--mask) 55%, var(--room-surface-2)); animation: none; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--mask) 45%, transparent); } }

/* drawing a hand-made occlusion card */
.draw-bar { display: flex; flex-direction: column; gap: 8px; padding: 10px 16px 14px; border-top: 1px solid var(--room-line); }
.draw-hint { margin: 0; font-size: .85rem; color: var(--room-muted); }
.draw-fields { display: flex; gap: 8px; flex-wrap: wrap; }
.draw-fields input { flex: 1 1 220px; min-width: 0; }
.draw-fields input, .ai-form textarea, .ai-setup input, .flag-note textarea { background-color: var(--room-bg); border: 1px solid var(--room-line-strong); color: var(--room-fg); border-radius: var(--r-ctl); }
.draw-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.draw-each { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--room-muted); margin-right: auto; }
.occl.drawing { cursor: crosshair; touch-action: none; outline: 2px dashed var(--room-flag); outline-offset: 2px; }
.occl .mask.drawn { background: color-mix(in srgb, var(--mask) 80%, transparent); animation: none; }

/* your own marks on a slide: highlighter, pen, typed notes */
.marks { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.marks path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.marks path.hl { opacity: .38; mix-blend-mode: multiply; }
.mark-text { position: absolute; transform: translateY(-50%); font: 600 2.1cqw/1.25 var(--ui); padding: .15em .35em; border-radius: .2em; background: rgb(255 255 255 / .9); box-shadow: 0 0 0 1px rgb(0 0 0 / .18); white-space: pre-wrap; max-width: 45%; pointer-events: none; }
.mark-input { position: absolute; z-index: 2; transform: translateY(-50%); font: 600 2.1cqw/1.25 var(--ui); min-width: 12em; min-height: 0; padding: .15em .35em; border-radius: .2em; border: 2px solid var(--room-select); background: var(--paper); color: var(--paper-ink); resize: none; }
@media (pointer: coarse) { .mark-input { font-size: max(16px, 2.1cqw); } }  /* iOS zooms in on any field under 16px */
.occl.marking { touch-action: none; cursor: crosshair; outline: 2px dashed var(--room-ink); outline-offset: 2px; }
.occl.marking.tool-text { cursor: text; }
.occl.marking.tool-erase { cursor: cell; }
.occl.marking.tool-select { cursor: crosshair; }
.mark-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 10px 16px 14px; border-top: 1px solid var(--room-line); }
.mark-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.swatches { display: inline-flex; gap: 6px; margin-right: 4px; }
.swatch { position: relative; width: 24px; height: 24px; padding: 0; border-radius: var(--r-ctl); border: 1px solid var(--room-line-strong); background: var(--sw); }
.swatch[aria-checked="true"] { outline: 2px solid var(--room-ink); outline-offset: 2px; }
/* 44px hit areas on touch; the wider gap keeps neighbors from overlapping */
@media (max-width: 820px), (pointer: coarse) { .swatches { gap: 20px; } .swatch::after { content: ""; position: absolute; inset: -11px; } }

/* selecting part of a slide */
.sel-box { position: absolute; border: 2px dashed var(--room-select); background: color-mix(in srgb, var(--room-select) 12%, transparent); border-radius: 2px; pointer-events: none; }
.sel-mask { position: absolute; background: color-mix(in srgb, var(--room-select) 28%, transparent); outline: 2px solid var(--room-select); border-radius: 2px; pointer-events: none; }

/* popovers in the room: slide cards and the selection menu */
.slide-cards-pop, .sel-menu {
  display: flex; flex-direction: column; overflow-y: auto; max-height: 60dvh;
  background: var(--room-surface-2); color: var(--room-fg); border: 1px solid var(--room-line-strong); border-radius: var(--r-pane); box-shadow: 0 8px 24px rgb(0 0 0 / .5);
}
.slide-cards-pop { position: absolute; z-index: 6; top: 60px; right: 16px; width: min(380px, calc(100vw - 32px)); padding: 12px 14px; gap: 10px; }
.slide-cards-pop[hidden] { display: none; }
.scp-head { display: flex; flex-direction: column; gap: 2px; }
.scp-head span { font: 400 max(12px, .75rem) var(--mono); color: var(--room-muted); }
.slide-cards-pop ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.slide-cards-pop li { font-size: .85rem; line-height: 1.4; padding: 8px 0; border-top: 1px solid var(--room-line); }
.slide-cards-pop .kind, .sel-idea .kind { display: block; color: var(--room-muted); margin-bottom: 2px; }
.sel-menu { position: fixed; z-index: 8; width: min(380px, calc(100vw - 16px)); padding: 10px 12px; gap: 8px; }
.sel-menu .row { gap: 6px; }
.sel-what { font-size: .82rem; color: var(--room-muted); }
.sel-out:empty { display: none; }
.sel-out { display: flex; flex-direction: column; font-size: .88rem; }
.sel-idea { display: grid; gap: 3px; padding: 8px 0; border-top: 1px solid var(--room-line); }
.sel-idea .chip { justify-self: start; margin-top: 4px; }

/* AI tutor panel: an unboxed transcript with mono speaker tags */
.ai-panel { width: 400px; flex: none; display: flex; flex-direction: column; min-height: 0; background: var(--room-surface); border-left: 1px solid var(--room-line); color: var(--room-fg); }
.ai-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--room-line); }
.ai-head strong { font-weight: 560; }
.ai-sub { font: 400 max(12px, .75rem) var(--mono); color: var(--room-muted); }
.ai-log { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 16px; font-size: .93rem; line-height: 1.6; }
.ai-msg { padding: 0; background: none; border-radius: 0; overflow-wrap: anywhere; }
.ai-msg::before { display: block; margin-bottom: 4px; font: 400 max(12px, .75rem)/1.3 var(--mono); letter-spacing: 0; color: var(--room-muted); }
.ai-msg.me::before { content: "you"; }
.ai-msg:not(.me, .note, .err)::before { content: "tutor"; }
.ai-msg.err::before { content: "error"; color: var(--room-err); }
.flag-body .ai-msg::before { content: none; }
.ai-msg.me { padding-top: 14px; border-top: 1px solid var(--room-line); }
.ai-msg.note { color: var(--room-muted); font-size: .85rem; }
.ai-msg.note .ic { width: 1em; height: 1em; margin-right: 6px; vertical-align: -.15em; }
.ai-msg.err { color: var(--room-err); }
.ai-msg.thinking, .ai-msg.live { color: var(--room-muted); }
.ai-msg p { margin: 0 0 8px; } .ai-msg p:last-child { margin: 0; }
.ai-msg ul, .ai-msg ol { margin: 0 0 8px; padding-left: 20px; }
.ai-msg .occl { margin-top: 8px; }
.ai-msg.note.divider { padding-top: 8px; border-top: 1px solid var(--room-line); text-align: center; font: 400 max(12px, .75rem) var(--mono); text-transform: lowercase; }
.ai-quick { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 14px 0; border-top: 1px solid var(--room-line); }
.ai-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 14px 6px; }
.ai-form textarea { flex: 1; min-width: 0; min-height: 40px; max-height: 120px; resize: none; padding: 9px 12px; font: inherit; font-size: .93rem; }
.ai-mic, .ai-send { width: 40px; height: 40px; flex: none; display: grid; place-items: center; padding: 0; border-radius: var(--r-ctl); border: 1px solid var(--room-line-strong); background: transparent; color: var(--room-fg); font-size: 1.1rem; }
.ai-send { background: var(--room-ink); border-color: var(--room-ink); color: var(--room-ink-fg); }
.ai-mic[aria-pressed="true"] { background: var(--room-rec); border-color: var(--room-rec); color: var(--room-rec-fg); }
.ai-voice { display: flex; align-items: center; gap: 10px; padding: 10px 14px 0; }
.ai-voice-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; flex: none; border-radius: var(--r-ctl); border: 1px solid var(--room-line-strong); background: transparent; color: var(--room-fg); font-weight: 500; }
.ai-voice-btn:hover:not(:disabled) { background: var(--room-surface-2); }
.ai-voice-btn[aria-pressed="true"] { background: var(--room-rec); border-color: var(--room-rec); color: var(--room-rec-fg); }
.ai-voice-btn:disabled { opacity: .55; }
.ai-voice-status { font-size: .8rem; color: var(--room-muted); min-width: 0; }
.ai-speak { display: flex; align-items: center; gap: 8px; padding: 2px 14px 12px; font-size: .8rem; color: var(--room-fg); }
.ai-speak span { color: var(--room-muted); }
.ai-setup { display: flex; flex-direction: column; gap: 8px; }
.ai-setup a { color: var(--room-fg); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 820px) {
  .ai-panel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; width: auto; height: 60dvh; border-left: 0; border-top: 1px solid var(--room-line-strong); border-radius: var(--r-pane) var(--r-pane) 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .ai-mic, .ai-send { width: 44px; height: 44px; }
  .ai-voice-btn { height: 44px; }
  /* 16px or more, or iOS zooms the page on focus (scoped to .viewer so it beats the base .flag-note rule below) */
  .viewer .flag-note textarea, .viewer .ai-form textarea { font-size: max(1rem, 16px); }
  /* hiding parts of a slide: the tutor or flag sheet steps aside so the draw bar and Save card show; it comes back after */
  .viewer.drawing .ai-panel { display: none; }
  .viewer.drawing.ai-open .viewer-body { align-items: center; }
  .viewer.drawing.ai-open .viewer-fig { height: 100%; container-type: size; }
  .viewer.drawing.ai-open .viewer-fig .occl { width: min(100cqw, 100cqh * var(--w) / var(--h)); }
}

/* flagged slides: the panel shares the AI panel's room */
.flag-body { gap: 12px; }
.flag-empty p { margin: 0 0 12px; color: var(--room-muted); }
.flag-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--room-muted); }
.flag-note { display: flex; flex-direction: column; gap: 6px; }
.flag-note label { font-weight: 560; font-size: .88rem; }
.flag-note label .muted { font-weight: 400; }
.flag-note textarea { width: 100%; resize: vertical; min-height: 56px; padding: 8px 10px; font: inherit; font-size: .92rem; }
.flag-note .small { color: var(--room-muted); }
.flag-res { display: flex; flex-direction: column; gap: 10px; }
.flag-finding { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0 0; border-top: 1px solid var(--room-line); }
.flag-finding .small { color: var(--room-muted); margin-top: 2px; }
.spinner { width: 18px; height: 18px; flex: none; margin-top: 2px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--room-flag) 30%, transparent); border-top-color: var(--room-flag); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.flag-refind { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--room-muted); }
.flag-h { color: var(--room-muted); margin: 6px 0 0; }
.flag-video { display: grid; grid-template-columns: 132px 1fr; gap: 10px; align-items: start; }
.flag-video.playing { grid-template-columns: 1fr; }
.flag-video .small { color: var(--room-muted); }
.flag-video a { color: var(--room-fg); text-decoration: underline; text-underline-offset: 3px; }
.flag-thumb { position: relative; padding: 0; border: 0; border-radius: var(--r-ctl); overflow: hidden; background: var(--well); cursor: pointer; aspect-ratio: 16 / 9; }
.flag-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.flag-thumb .play { position: absolute; inset: 0; display: grid; place-items: center; color: var(--room-fg); font-size: 1.3rem; background: color-mix(in srgb, var(--well) 30%, transparent); }
.flag-embed { aspect-ratio: 16 / 9; border-radius: var(--r-ctl); overflow: hidden; background: var(--well); }
.flag-embed iframe { width: 100%; height: 100%; border: 0; }
.flag-title { font-weight: 560; font-size: .9rem; line-height: 1.35; }
.flag-pics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.flag-pic { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.flag-pic.big { grid-column: 1 / -1; }
.flag-pic button { padding: 0; border: 0; border-radius: var(--r-ctl); overflow: hidden; background: var(--paper); cursor: zoom-in; }
.flag-pic.big button { cursor: zoom-out; }
.flag-pic img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; display: block; }
.flag-pic.big img { aspect-ratio: auto; max-height: 70dvh; }
.flag-pic figcaption { font-size: max(12px, .74rem); color: var(--room-muted); display: flex; flex-direction: column; gap: 2px; }
.flag-pic figcaption a { color: var(--room-muted); overflow-wrap: anywhere; }
.pic-credit { overflow-wrap: anywhere; }
.pic-credit a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.flag-read { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--r-ctl); border: 1px solid var(--room-line); color: var(--room-fg); text-decoration: none; }
.flag-read:hover { background: var(--room-surface-2); border-color: var(--room-line-strong); text-decoration: none; }
.flag-read .small { color: var(--room-muted); }
.flag-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--room-muted); padding-top: 4px; }
.flag-actions { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--room-line); }
.flag-actions a.chip { text-decoration: none; }
.flag-row { align-items: center; }
.flag-row-img { width: 88px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-ctl); flex: none; background: var(--surface-2); border: 1px solid var(--line); }
.flag-row .flag-status { margin-top: 2px; font: 400 max(12px, .75rem) var(--mono); color: var(--fg); }

/* ---------- review ---------- */
.flash { min-height: 260px; display: flex; flex-direction: column; gap: 14px; }
#flash { cursor: pointer; }
.flash .front { font-size: 1.35rem; font-weight: 500; line-height: 1.4; }
.flash .back { font: 400 1.05rem/1.6 var(--read); border-top: 1px solid var(--line); padding-top: 14px; }
.cloze-blank { display: inline-block; min-width: 5ch; border-bottom: 2px solid var(--hy); color: transparent; }
.cloze-fill { color: var(--hy); font-weight: 600; }
.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.grades button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; border-radius: var(--r-ctl); border: 1px solid var(--line-strong); background: transparent; font-weight: 500; transition: background-color .18s; }
.grades button:hover { background: color-mix(in srgb, var(--fg) 6%, transparent); }
.grades button:active { translate: 0 1px; }
.grades button small { font: 400 max(12px, .75rem) var(--mono); font-variant-numeric: tabular-nums; color: var(--muted); }
.grades .again { border-color: color-mix(in srgb, var(--bad) 65%, var(--line)); }
.grades .good { border-color: color-mix(in srgb, var(--good) 65%, var(--line)); }
/* the four grades cascade up as the answer develops, drawing the eye to the grading action
   (reduced-motion users get them instantly via the global reduce kill-switch) */
.grades button { animation: lm-grade-in .34s var(--ease-out) both; }
.grades button:nth-child(2) { animation-delay: .045s; }
.grades button:nth-child(3) { animation-delay: .09s; }
.grades button:nth-child(4) { animation-delay: .135s; }
@keyframes lm-grade-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.progress { height: 2px; background: var(--line); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); transition: width .24s var(--ease-out); }

/* ---------- questions ---------- */
.stem { font: 400 1.05rem/1.65 var(--read); }
.choices { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.choice { display: flex; gap: 8px; align-items: stretch; }
.choice button.pick { flex: 1; display: flex; gap: 12px; text-align: left; padding: 12px 14px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: transparent; line-height: 1.45; }
.choice button.pick:hover:not(:disabled) { border-color: var(--line-strong); background: color-mix(in srgb, var(--fg) 4%, transparent); }
.choice .letter { font: 500 .9rem/1.6 var(--mono); color: var(--muted); flex: none; width: 1.2em; }
.choice.struck .pick span:last-child { text-decoration: line-through; color: var(--muted); }
.choice.right .pick { border-color: var(--good); }
.choice.right .letter { color: var(--good); }
.choice.wrong .pick { border-color: var(--bad); }
.choice.wrong .letter { color: var(--bad); }
.choice .strike { flex: none; width: 44px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: transparent; color: var(--muted); font: 500 .85rem var(--mono); }
.choice .strike:hover { border-color: var(--line-strong); color: var(--fg); }
.why { font-size: .9rem; color: var(--muted); padding: 4px 4px 0 34px; }
.choice.right + .why, .choice.wrong + .why { color: var(--fg); }
.takeaway { border-top: 1px solid var(--line); padding-top: 12px; }

/* ---------- palette ---------- */
.palette { width: min(640px, calc(100vw - 32px)); max-height: min(70dvh, 560px); margin: 10dvh auto auto; padding: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-pane); box-shadow: var(--pop-shadow); }
.palette[open] { display: flex; flex-direction: column; }
.palette::backdrop { background: rgb(0 0 0 / .5); }
.palette input { min-height: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; padding: 16px 18px; font-size: max(1.05rem, 16px); outline: none; }
.palette-results { overflow: auto; padding: 6px; }
.palette-results a { display: block; position: relative; padding: 10px 12px; border-radius: var(--r-ctl); color: var(--fg); }
.palette-results a:hover, .palette-results a.active { background: var(--surface-2); text-decoration: none; }
.palette-results .kind { color: var(--muted); }
.palette-results .snip { font-size: .85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- player ---------- */
.player { position: fixed; z-index: 15; left: 50%; transform: translateX(-50%); bottom: 16px; width: min(640px, calc(100vw - 24px)); display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-pane); box-shadow: var(--pop-shadow); }
@media (max-width: 820px) { .player { bottom: calc(64px + env(safe-area-inset-bottom)); } }
.player-info { flex: 1; min-width: 0; }
.player-title { font-weight: 560; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-line { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-bar { height: 2px; background: var(--line); margin-top: 6px; overflow: hidden; }
.player-bar > div { height: 100%; width: 0; background: var(--accent); }
.player-rate select { min-height: 34px; padding: 0 6px; font: 400 max(12px, .8rem) var(--mono); background-color: transparent; }

/* ---------- guided tips (spotlight + popover) ---------- */
.tour { border: 0; padding: 0; margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: transparent; overflow: hidden; }
.tour::backdrop { background: transparent; }
.tour.no-target { background: rgb(0 0 0 / .6); }
.tour-hole { position: fixed; border-radius: var(--r-pane); box-shadow: 0 0 0 9999px rgb(0 0 0 / .6), 0 0 0 2px var(--accent); pointer-events: none; transition: all .24s var(--ease-out); }
.tour-pop { position: fixed; width: min(360px, calc(100vw - 24px)); display: flex; flex-direction: column; gap: 8px; padding: 16px 16px 12px; background: var(--surface); color: var(--fg); border: 1px solid var(--line-strong); border-radius: var(--r-pane); box-shadow: var(--pop-shadow); transition: top .24s var(--ease-out), left .24s var(--ease-out); }
.tour-step { color: var(--muted); }
.tour-title { font-size: 1.1rem; margin: 0; }
.tour-body { font-size: .93rem; line-height: 1.55; color: var(--fg); }
.tour-body p { margin: 0 0 6px; } .tour-body p:last-child { margin: 0; }
.tour-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 4px; }
.tour-skip { border: 0; background: none; color: var(--muted); font-size: .85rem; min-height: 36px; padding: 0; }
.tour-skip:hover { color: var(--fg); text-decoration: underline; }
.tour-nav { display: flex; gap: 6px; }
.tour-nav .btn { min-height: 36px; padding: 0 14px; }
@media (max-width: 820px) { .tour-skip, .tour-nav .btn { min-height: 44px; } }
@media (max-width: 520px) { .tour-pop { left: 12px !important; right: 12px; width: auto; } }

/* ---------- Today ---------- */
.today-head { display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }
.today-date { margin: 0; color: var(--muted); }
.today-head h1 { font-size: clamp(3rem, 6.4vw, 4.5rem); }
.lede { margin: 0; font-size: 1.18rem; color: color-mix(in srgb, var(--fg) 88%, var(--muted)); max-width: 60ch; }
.today-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.page.today .panes { margin-top: 10px; }
.rings-body { display: flex; align-items: center; gap: 28px; margin: 12px 0 16px; flex-wrap: wrap; }
.rings { width: 170px; height: 170px; flex: none; transform: rotate(-90deg); overflow: visible; }
.ring-bg, .ring-fg { fill: none; stroke-width: 9; }
.ring-bg { opacity: .14; }
/* arcs sit at their final value; motion.js sweeps them in */
.ring-fg { stroke-linecap: butt; stroke-dasharray: 100 101; stroke-dashoffset: calc(100 - var(--p)); }
.r-cards { stroke: var(--g1); color: var(--g1); } .r-focus { stroke: var(--g2); color: var(--g2); } .r-q { stroke: var(--g3); color: var(--g3); }
.ring-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.ring-legend li { display: flex; gap: 10px; align-items: baseline; }
.ring-legend .dot { width: 12px; height: 3px; flex: none; background: currentColor; transform: translateY(-.3em); }
.ring-legend li > span:last-child { display: flex; flex-direction: column; gap: 2px; color: var(--muted); font-size: .88rem; }
.ring-legend b { color: var(--fg); font: 400 1.5rem/1.1 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.ring-legend .of { color: var(--muted); font-size: .85rem; letter-spacing: 0; }
.net-mini {
  padding: 0; min-height: 280px; overflow: hidden; background-color: var(--well); color: var(--room-fg);
  --tc: color-mix(in srgb, var(--room-fg) 40%, transparent);
}
.net-mini:hover { text-decoration: none; }
.net-mini canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* the canvas paints opaque, so the reticle ticks are repeated on a layer above it */
.net-mini.reticle::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image: inherit; background-size: inherit; background-position: inherit; background-repeat: inherit;
}
.net-mini-cap {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 48px 20px 16px; display: flex; flex-direction: column; gap: 2px;
  background: linear-gradient(to top, color-mix(in srgb, var(--well) 92%, transparent), transparent); pointer-events: none;
}
.net-mini-cap b { font-family: var(--display); font-stretch: 118%; font-weight: 300; font-size: 1.6rem; line-height: 1.1; letter-spacing: -.02em; }
.net-mini-cap span { color: var(--room-muted); font-size: .88rem; }
.net-mini-cap .btn { pointer-events: auto; align-self: flex-start; margin-top: 10px; background: color-mix(in srgb, var(--well) 60%, transparent); border-color: var(--room-line-strong); color: var(--room-fg); }
.net-mini-cap .btn:hover { background: color-mix(in srgb, var(--room-fg) 10%, var(--well)); }
.net-mini :focus-visible { outline-color: var(--room-ink); }
.list-pane .lec-list { margin: 8px -20px -20px; }
.list-pane .lec-row { padding: 12px 20px; }
.list-pane .lec-row:first-child { border-top: 1px solid var(--line); }
.list-pane > a.small { display: inline-block; margin-top: 12px; }
.list-pane > .small.muted { margin: -4px 0 0; }
@media (max-width: 560px) { .list-pane .lec-list { margin: 8px -16px -16px; } .list-pane .lec-row { padding: 12px 16px; } }

/* your sign, drawn as its constellation */
.stars-card { display: flex; align-items: center; gap: 18px; }
.stars-card.ask { display: block; }
.stars-card.ask h3 { font-family: var(--display); font-stretch: 118%; font-weight: 300; font-size: 1.6rem; letter-spacing: -.02em; margin: 4px 0 2px; }
.constellation { width: 78px; height: 78px; flex: none; overflow: visible; }
.constellation line { stroke: var(--g1); stroke-width: 1; opacity: .7; }
.constellation circle { fill: var(--fg); }
.stars-text { flex: 1; min-width: 0; }
.stars-line { margin: 4px 0 0; font-family: var(--display); font-stretch: 112%; font-weight: 340; font-size: 1.3rem; line-height: 1.3; letter-spacing: -.01em; text-wrap: pretty; }
.sign-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.bday { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.bday input { min-height: 36px; padding: 0 10px; font-size: max(.9rem, 16px); }
@media (max-width: 560px) {
  /* rings: a smaller dial keeps the legend beside it; sign: constellation and pencil share row 1, the line runs full width */
  .rings-body { flex-wrap: nowrap; gap: 18px; }
  .rings { width: 128px; height: 128px; }
  .stars-card:not(.ask) { flex-wrap: wrap; align-items: flex-start; gap: 12px; }
  .stars-card .constellation { width: 56px; height: 56px; }
  .stars-card > .icon-btn { margin-left: auto; }
  .stars-text { order: 3; flex: 1 1 100%; }
  .stars-line { font-size: 1.15rem; }
  /* hero actions share one left edge instead of a ragged stack */
  .today-actions .btn { flex: 1 1 100%; justify-content: flex-start; }
  /* the network caption moves below the well so it never sits on the arbors */
  .net-mini { display: flex; flex-direction: column; min-height: 0; }
  .net-mini canvas { position: relative; inset: auto; height: 200px; flex: none; }
  .net-mini.reticle::before { bottom: auto; height: 200px; }
  /* the opaque well fill covers the pane's own corner ticks; the ::before set marks the canvas instead */
  .net-mini-cap { position: relative; padding: 12px 16px 16px; background: var(--well); }
}
.settings-page .panes { margin: 6px 0 0; }
.settings-page .pane, .settings-page .card { margin: 0; }
/* settings rows: one shared label column, so every control starts on the same x */
.set-row { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 8px 16px; align-items: center; }
.set-ctl { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; min-width: 0; }
@media (max-width: 560px) { .set-row { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Focus page ---------- */
.focus-page { position: relative; }
/* the sky canvas fills the stage box only: it paints above the well fill and below the ring */
.stage > .focus-sky { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.focus-page > * { position: relative; z-index: 1; }
/* the stage is a framed well holding the sky, so its text uses the room tokens in every theme */
.stage {
  min-height: min(74vh, 660px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  padding: 12px 16px 28px; color: var(--room-fg);
  isolation: isolate; background: var(--well); border: 1px solid var(--line); border-radius: var(--r-pane); overflow: clip;
}
.stage :focus-visible { outline-color: var(--room-ink); }
.ring-wrap { position: relative; width: min(340px, 78vw); aspect-ratio: 1; }
.ring-wrap.reticle { --tc: color-mix(in srgb, var(--room-fg) 40%, transparent); --ti: 0px; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring-track { fill: none; stroke: color-mix(in srgb, var(--room-fg) 12%, transparent); stroke-width: 2; }
.ring-bar { fill: none; stroke: var(--g2); stroke-width: 3; stroke-linecap: butt; stroke-dasharray: 100 101; stroke-dashoffset: 100; transition: stroke-dashoffset .6s linear; }
.ring-wrap:is([data-phase="short"], [data-phase="long"]) .ring-bar { stroke: var(--g1); }
/* the dial: 60 ticks outside the ring, the current second lit */
.dial .tick { stroke: color-mix(in srgb, var(--room-fg) 26%, transparent); stroke-width: 1; vector-effect: non-scaling-stroke; }
.dial .tick.major { stroke: color-mix(in srgb, var(--room-fg) 55%, transparent); }
.dial .tick.lit { stroke: var(--g2); stroke-width: 2; }
.ring-wrap:is([data-phase="short"], [data-phase="long"]) .dial .tick.lit { stroke: var(--g1); }
#ringWrap[role="slider"] { cursor: grab; touch-action: none; }
/* on touch the page still scrolls past the dial: vertical swipes pan (pointercancel ends the scrub), sideways drags scrub */
@media (pointer: coarse) { #ringWrap[role="slider"] { touch-action: pan-y pinch-zoom; } }
#ringWrap[role="slider"]:active { cursor: grabbing; }
#ringWrap[role="slider"]:focus-visible { outline: none; }
#ringWrap[role="slider"]:focus-visible .ring { outline: 2px solid var(--room-ink); outline-offset: 4px; border-radius: 50%; }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; color: var(--room-fg); pointer-events: none; }
.ring-phase { font: 400 max(12px, .82rem) var(--mono); text-transform: lowercase; color: var(--room-muted); }
.ring-time { font: 200 clamp(4rem, 15vw, 6rem)/1 var(--mono); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.ring-round { font: 400 max(12px, .78rem) var(--mono); font-variant-numeric: tabular-nums; text-transform: lowercase; color: var(--room-muted); }
.focus-controls { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.stage .btn:not(.primary) { background: color-mix(in srgb, var(--room-bg) 55%, transparent); border-color: var(--room-line-strong); color: var(--room-fg); }
.stage .btn:not(.primary):hover { background: color-mix(in srgb, var(--room-bg) 75%, transparent); }
.stage .btn.ghost { border-color: transparent; background: transparent; }
.stage .btn.ghost:hover { background: color-mix(in srgb, var(--room-fg) 8%, transparent); }
.stage .btn.primary { background: var(--room-ink); border-color: var(--room-ink); color: var(--room-ink-fg); }
.stage .btn.primary:hover { background: color-mix(in srgb, var(--room-ink) 88%, var(--room-bg)); }
.timer-settings { width: min(520px, 100%); }
.timer-settings summary { list-style: none; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 6px; min-height: 36px; color: var(--room-muted); font-size: .9rem; }
.timer-settings summary:hover { color: var(--room-fg); }
.timer-settings summary::-webkit-details-marker { display: none; }
.timer-grid { margin-top: 12px; display: grid; gap: 12px; padding: 16px; border-radius: var(--r-pane); background: var(--surface); border: 1px solid var(--line); color: var(--fg); }
.timer-grid :focus-visible { outline-color: var(--accent); }
.len-row { display: flex; align-items: center; gap: 10px; } .len-row span { flex: 1; }
.len-row input { width: 76px; min-height: 36px; padding: 0 8px; font: 400 max(1rem, 16px) var(--mono); font-variant-numeric: tabular-nums; }
.check-row { display: flex; gap: 10px; align-items: center; }
@media (max-width: 820px) {
  .timer-settings summary, .len-row input, .check-row { min-height: 44px; }
}

/* mixer: channel rows with a LUT bar, a mono level and a fader */
.mixer { display: flex; flex-direction: column; }
/* open rows packed from the top; any spare pane height collects above the master fader */
.mixer .channels { flex: none; align-content: start; row-gap: 8px; }
/* centered, so the canvas never pushes the title off the baseline the neighbouring pane heads share */
/* the spectrum gives way first when the header gets tight (large text, Lexend), so Play sounds is never cut off */
.pane-head:has(> .spectrum) { flex-wrap: wrap; row-gap: 4px; }
.pane-head > .spectrum + .btn { flex: none; }
.spectrum { display: block; flex: 1 1 0; min-width: 0; max-width: 128px; align-self: center; height: 24px; margin-left: auto; color: var(--fg); }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.channels { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; column-gap: 0; }
@media (max-width: 420px) { .spectrum { max-width: 72px; } }
/* one row per channel: the LUT bar above, then toggle, fader and level side by side */
.channel {
  display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr) 3ch; grid-template-areas: "lut lut lut" "toggle fader level";
  align-items: center; column-gap: 16px; padding-bottom: 4px;
}
/* a neutral ramp: subject color stays with the four stains, not ten hues of sound */
.lut { grid-area: lut; display: block; height: 3px; background: linear-gradient(90deg, transparent, var(--fg)); opacity: .3; transition: opacity .24s; }
.channel.on .lut { opacity: 1; }
.channel-toggle { grid-area: toggle; display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 40px; padding: 0; border: 0; background: none; color: var(--muted); font-weight: 500; text-align: left; }
.channel-toggle:hover, .channel.on .channel-toggle, .channel-toggle[aria-pressed="true"] { color: var(--fg); }
.channel-icon { width: 20px; height: 20px; flex: none; display: grid; place-items: center; color: inherit; }
.channel-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.level { grid-area: level; min-width: 3ch; text-align: right; font: 400 max(12px, .75rem)/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--muted); }
.channel.on .level { color: var(--fg); }
.channel .fader { grid-area: fader; }
.master { display: flex; align-items: center; gap: 12px; margin-top: 16px; color: var(--muted); }
.master .fader { flex: 1; }
.mixer > .master { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
/* faders: 2px track, 10x18 ink cap with a center line */
.fader { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 24px; margin: 0; padding: 0; background: transparent; cursor: pointer; }
.fader::-webkit-slider-runnable-track { height: 2px; background: var(--line-strong); border: 0; }
.fader::-moz-range-track { height: 2px; background: var(--line-strong); border: 0; }
.fader::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 10px; height: 18px; margin-top: -8px; border: 0; border-radius: 2px; background: linear-gradient(var(--accent-fg), var(--accent-fg)) center / 100% 1px no-repeat, var(--accent); }
.fader::-moz-range-thumb { width: 10px; height: 18px; border: 0; border-radius: 2px; background: linear-gradient(var(--accent-fg), var(--accent-fg)) center / 100% 1px no-repeat, var(--accent); }
.fader:focus-visible { outline: none; }
.fader:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--accent); outline-offset: 2px; }
.fader:focus-visible::-moz-range-thumb { outline: 2px solid var(--accent); outline-offset: 2px; }
.fader:disabled { opacity: .45; cursor: default; }
@media (max-width: 820px) { .fader { height: 44px; } .channel-toggle { min-height: 44px; } }
.bands { margin: 12px 0 8px; }
@media (max-width: 560px) {
  .mixer .channels { row-gap: 0; }
  .channel { column-gap: 12px; }
  .bands { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .bands button { justify-content: center; padding: 0 6px; }
}
.senses { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.sense { display: flex; gap: 12px; }
.sense .ic { color: var(--muted); margin-top: 3px; }
.sense b { display: block; font-weight: 560; }
.sense span { display: block; line-height: 1.45; }
/* the network well and its readouts */
.scope { position: relative; border-radius: var(--r-ctl); overflow: hidden; background: var(--well); border: 1px solid var(--line); }
.net { width: 100%; height: clamp(300px, 46vh, 480px); display: block; }
.net-empty { position: absolute; left: 0; right: 0; bottom: 18px; margin: 0; padding: 0 16px; text-align: center; color: var(--room-muted); }
.net-foot { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: flex-start; justify-content: space-between; margin-top: 16px; }
.stains { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .88rem; }
.stains li { display: flex; gap: 8px; align-items: center; }
.stains .muted { font: 400 max(12px, .75rem) var(--mono); }
.stain-dot { width: 2px; height: 14px; flex: none; background: var(--c); }
.scale-bar { display: flex; align-items: center; gap: 8px; margin: 0; font: 400 max(12px, .75rem) var(--mono); color: var(--muted); }
.scale-bar .bar { width: 24px; height: 6px; flex: none; border-inline: 1px solid currentColor; background: linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat; }
.net-progress { flex: 1; min-width: 220px; max-width: 380px; }
.meter { height: 3px; background: var(--line); overflow: hidden; margin: 2px 0 6px; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, color-mix(in srgb, var(--g2) 15%, black), var(--g2)); }
.rank-badge { flex: none; padding: 6px 8px; font: 500 max(12px, .75rem)/1 var(--mono); text-transform: lowercase; color: var(--fg); border: 1px solid var(--line-strong); border-radius: var(--r-ctl); white-space: nowrap; }
.unlocks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.unlock-chip { color: var(--muted); border-style: dashed; }
.unlock-chip.on { color: var(--fg); border-style: solid; }
.unlock-chip .sw { width: 2px; height: 12px; flex: none; background: linear-gradient(to top, color-mix(in srgb, var(--sw) 15%, black), var(--sw)); }

/* the timer pill on other pages */
.focus-pill { position: fixed; right: 18px; bottom: 18px; z-index: 15; display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: var(--r-pane); background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--pop-shadow); }
/* with the notes player open, the pill stacks above it instead of over it */
body:has(#player:not([hidden])) .focus-pill { bottom: 92px; }
.pill-open { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px 0 2px; border: 0; border-radius: var(--r-ctl); background: none; color: var(--fg); }
.pill-ring { width: 34px; height: 34px; transform: rotate(-90deg); }
.pill-track { fill: none; stroke: var(--line); stroke-width: 3; }
.pill-bar { fill: none; stroke: var(--g2); stroke-width: 3; stroke-linecap: butt; stroke-dasharray: 100 101; stroke-dashoffset: 100; transition: stroke-dashoffset .5s linear; }
.focus-pill:is([data-phase="short"], [data-phase="long"]) .pill-bar { stroke: var(--g1); }
.pill-text { display: flex; flex-direction: column; line-height: 1.2; text-align: left; }
.pill-text b { font: 500 .95rem var(--mono); font-variant-numeric: tabular-nums; }
.pill-text span { font: 400 max(12px, .72rem) var(--mono); text-transform: lowercase; color: var(--muted); }
.pill-sound { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: var(--r-ctl); background: transparent; color: var(--fg); }
.pill-sound:hover { border-color: var(--line-strong); }
.pill-sound .ic { width: 18px; height: 18px; }
@media (max-width: 820px) {
  .focus-pill { bottom: calc(70px + env(safe-area-inset-bottom)); right: 12px; }
  body:has(#player:not([hidden])) .focus-pill { bottom: calc(138px + env(safe-area-inset-bottom)); }
  .pill-open { min-height: 44px; } .pill-sound { width: 44px; height: 44px; }
}
.fx-layer { position: fixed; inset: 0; width: 100vw; height: 100dvh; pointer-events: none; z-index: 60; opacity: 0; transition: opacity .9s var(--ease-out); }
.fx-layer.on { opacity: 1; }

/* ---------- dialogs: round complete, breathing, the movie question, Commons ---------- */
.reward, .movie, .breathe, .commons-dlg {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; overflow: hidden auto;
  color: var(--fg); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-pane); box-shadow: var(--pop-shadow);
}
.reward::backdrop, .movie::backdrop, .breathe::backdrop, .commons-dlg::backdrop { background: rgb(0 0 0 / .62); }
.reward-x { position: absolute; top: 12px; right: 12px; z-index: 2; margin: 0; }
.reward-x .icon-btn { background: color-mix(in srgb, var(--well) 70%, transparent); border-color: var(--room-line-strong); color: var(--room-fg); }
.reward-x :focus-visible { outline-color: var(--room-ink); }
.reward-scope { position: relative; background: var(--well); }
.reward-net { width: 100%; height: 270px; display: block; }
.scope-caption { position: absolute; left: 16px; bottom: 12px; margin: 0; display: flex; align-items: center; gap: 8px; font: 400 max(12px, .75rem) var(--mono); color: var(--room-muted); }
.reward-text { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 10px; }
.reward-text .display { font-size: 2.1rem; margin: 0; }
.reward-text > p { margin: 0; }
.reward-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.unlock { margin: 0; display: flex; align-items: center; gap: 10px; padding: 12px 0 0; border-top: 1px solid var(--line); }
.unlock .ic { color: var(--g4); }
.unlock .chip { margin-left: auto; }
.sense-card { display: flex; gap: 12px; padding: 12px 0 0; border-top: 1px solid var(--line); }
.sense-card .ic { color: var(--muted); margin-top: 3px; }
.checkin { display: flex; flex-direction: column; gap: 10px; padding: 12px 0 0; border-top: 1px solid var(--line); }
.checkin-q { display: flex; gap: 8px; align-items: center; }
.checkin-q .ic { color: var(--muted); }
.moods { display: flex; flex-wrap: wrap; gap: 6px; }
.mood { height: 32px; }
#checkinNote { font-size: max(.9rem, 16px); }
.checkin-reply:empty { display: none; }
.checkin-reply { line-height: 1.5; }
.checkin-reply p { margin: 0; }
.typing { display: inline-flex; gap: 4px; } .typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: typing 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 50% { opacity: .2; transform: translateY(-3px); } }
.breathe { padding: 28px 22px; display: none; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.breathe[open] { display: flex; }
.breathe-orb { width: 120px; height: 120px; margin: 30px; border-radius: 50%; border: 1px solid var(--g2); background: color-mix(in srgb, var(--g2) 16%, transparent); transform: scale(.7); transition: transform 4s ease-in-out; }
.breathe-orb.in, .breathe-orb.hold { transform: scale(1.35); }
.breathe-orb.out, .breathe-orb.hold2 { transform: scale(.7); }
.breathe-label { font-family: var(--display); font-stretch: 118%; font-weight: 300; font-size: 2rem; letter-spacing: -.02em; }
#breatheCount { font-family: var(--mono); font-variant-numeric: tabular-nums; }
/* the movie question opens as a small card; the answer takes over the whole screen */
.movie .reward-fx { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.movie:not(.revealed) .reward-fx { display: none; }
.movie.revealed { width: 100vw; height: 100dvh; max-width: none; max-height: none; border-radius: 0; border: 0; background: var(--well); color: var(--room-fg); }
.movie-ask { padding: 34px 28px 26px; display: flex; flex-direction: column; gap: 14px; }
.movie-ask .display { font-size: 2.3rem; margin: 0; }
#movieText { min-height: 0; padding: 10px 2px; border: 0; border-bottom: 1px solid var(--line-strong); border-radius: 0; background: transparent; color: var(--fg); font-family: var(--display); font-stretch: 118%; font-weight: 300; font-size: 1.7rem; line-height: 1.2; letter-spacing: -.02em; }
#movieText:focus { outline: none; border-bottom-color: var(--accent); box-shadow: 0 1px 0 var(--accent); }
.movie-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.movie-ask .small { margin: 0; }
.movie-reveal {
  position: relative; z-index: 1; min-height: 100dvh; display: flex; flex-direction: column; justify-content: flex-end; gap: 14px; padding: clamp(24px, 6vw, 80px);
  color: var(--room-fg); pointer-events: none; animation: rise 1s var(--ease-out) both .5s;
  background: linear-gradient(to top, color-mix(in srgb, var(--well) 90%, transparent), color-mix(in srgb, var(--well) 35%, transparent) 48%, transparent 72%);
}
.movie-reveal .movie-actions { pointer-events: auto; }
.movie-reveal .kicker { color: color-mix(in srgb, var(--room-fg) 78%, transparent); }
.movie-reveal .display { font-size: clamp(2.6rem, 6.5vw, 5.4rem); line-height: .98; margin: 0; max-width: 15ch; }
.movie-reveal em { color: var(--m1, var(--room-fg)); }
.movie-line { margin: 0; font-size: 1.22rem; max-width: 46ch; color: var(--room-fg); }
.movie-note { margin: 0; max-width: 52ch; color: var(--room-muted); }
.movie-reveal .btn:not(.primary) { color: var(--room-fg); border-color: var(--room-line-strong); }
.movie-reveal .btn.ghost { border-color: var(--room-line-strong); }
.movie-reveal .btn.primary { background: var(--room-ink); border-color: var(--room-ink); color: var(--room-ink-fg); }
.movie-reveal :focus-visible { outline-color: var(--room-ink); }
@keyframes rise { from { opacity: 0; transform: translateY(20px); } }

/* Commons: share a text card with classmates (Settings section + the room picker dialog) */
.commons-steps { margin: 0; padding: 0; list-style: none; counter-reset: cs; display: flex; flex-direction: column; gap: 6px; color: var(--muted); }
.commons-steps li { position: relative; padding-left: 2.2em; }
.commons-steps li::before { counter-increment: cs; content: counter(cs, decimal-leading-zero); position: absolute; left: 0; top: 0; font: 400 max(12px, .75rem)/1.9 var(--mono); font-variant-numeric: tabular-nums; }
.commons-steps b { color: var(--fg); font-weight: 560; }
.commons-input { flex: 1; min-width: min(240px, 100%); font-size: max(.9rem, 16px); }
.commons-msg { margin: 0; font-size: .9rem; color: var(--muted); }
.commons-msg:empty { display: none; }
.commons-msg.ok { color: var(--good); } .commons-msg.bad { color: var(--bad); }
.commons-msg .ic { vertical-align: -3px; margin-right: 6px; }
.commons-dlg { width: min(520px, calc(100vw - 24px)); }
.commons-body { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.commons-card { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.commons-pick { display: flex; flex-direction: column; gap: 10px; }
.commons-pick > p, #commonsPick > p { margin: 0; }
.commons-rooms { display: flex; flex-direction: column; gap: 6px; max-height: 40dvh; overflow-y: auto; }
.commons-room { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: transparent; color: var(--fg); text-align: left; }
.commons-room:hover { border-color: var(--line-strong); }
.commons-room[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.commons-room span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.commons-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- phone hit areas ----------
   after every tag-row gap shorthand above, so these win by source order: an 18px row gap against
   the 28px tag's 46px target gives a 46px row pitch, and no two targets overlap */
@media (max-width: 820px) {
  .chips, .presets, .moods, .unlocks, .ai-quick, .sign-chips { row-gap: 18px; }
  .player-rate select, .ai-speak, .bday input, .palette-results a { min-height: 44px; }
}

/* ---------- motion: theme reveal, reduced motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
  ::view-transition-new(root) { animation: lm-reveal .5s var(--ease-out) both; }
}
/* --vt-x/--vt-y: the click point, set on :root by app.js (lengths in px) */
@keyframes lm-reveal {
  from { clip-path: circle(0 at var(--vt-x, 50%) var(--vt-y, 50%)); }
  to { clip-path: circle(150vmax at var(--vt-x, 50%) var(--vt-y, 50%)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ---------- print ---------- */
@media print {
  .sidebar, .topbar, .tabbar, .lec-tabs, .player, .focus-pill, .sec-tools, .hide-in-focus, .btn, .chip { display: none !important; }
  body { background: #fff; color: #000; } main { padding: 0; }
  .card { border: 0; padding: 0; }
  .callout, .check { border-top-color: #999; } .check .answer { display: block !important; }
  .note-section { break-inside: avoid-page; }
}
