/* Jelli Academy. The jelli.us world (jelli-www public/styles/home.css): the night, its dawn glow, yellow for the one
   action that moves things, grape and lilac for the rest, Outfit for headings and Onest for text. Hand CSS, no library. */
:root {
  --night: #080024;
  --card: #12102a;
  --raised: #1a1538;
  --desk: #16123a;
  --line: rgba(210, 178, 239, 0.18);
  --line-strong: rgba(210, 178, 239, 0.34);
  --text: #f2eef7;
  --muted: #c9bfd8;
  --dim: #a99fba;
  --lilac: #d3b1f2;
  --grape: #8440bd;
  --grape-light: #aa72e0;
  --button: #ffe66c;
  --on-yellow: #180538;
  --good: #86e3b8;
  --bad: #ff9aa8;
  --warn: #ffc27a;
  --sky: #8fd0ff;
  --display: "Outfit", sans-serif;
  --body: "Onest", "Outfit", sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 68px;
  --radius: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background: var(--night);
  background-image: radial-gradient(60rem 24rem at 12% -6rem, rgba(220, 90, 231, 0.2), transparent 70%), radial-gradient(52rem 22rem at 92% -8rem, rgba(132, 64, 189, 0.3), transparent 70%);
  background-repeat: no-repeat;
  font: 400 16px/1.6 var(--body);
  caret-color: var(--button);
  scrollbar-color: var(--grape) var(--night);
}
main { flex: 1; }
main:focus { outline: none; }
::selection { background: var(--grape); color: #fff; }
h1, h2, h3 { font-family: var(--display); line-height: 1.12; text-wrap: balance; margin: 0; letter-spacing: -0.012em; }
h1 { font-size: clamp(34px, 4.2vw, 56px); font-weight: 600; }
h2 { font-size: clamp(24px, 2.6vw, 34px); font-weight: 500; }
h3 { font-size: 19px; font-weight: 600; }
p { margin: 0; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--button); outline-offset: 3px; border-radius: 4px; }
.num, td.num, th.num { font-variant-numeric: tabular-nums; text-align: end; white-space: nowrap; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--gutter); }
.lead { color: var(--muted); font-size: 18px; line-height: 1.55; max-width: 62ch; }
.fine { color: var(--dim); font-size: 14px; line-height: 1.5; }
.block { display: block; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 0.04em; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.86em; color: var(--lilac); }

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 10px; background: var(--button); color: var(--on-yellow); font: 600 15px var(--display); text-decoration: none; }
.skip:focus { top: 12px; }

/* Buttons and links */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 12px 22px; border: 1.5px solid var(--button); border-radius: 12px; background: var(--button); color: var(--on-yellow); font: 600 15px/1.2 var(--display); text-decoration: none; transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(244, 214, 61, 0.18); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn.ghost:hover { border-color: var(--lilac); box-shadow: none; background: rgba(255, 255, 255, 0.05); }
.btn.small { min-height: 38px; padding: 8px 14px; font-size: 14px; border-radius: 10px; }
.btn.big { min-height: 60px; padding: 16px 30px; font-size: 18px; border-radius: 14px; }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--raised); border-color: var(--line); color: var(--dim); cursor: not-allowed; transform: none; box-shadow: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.arrow { width: 1em; height: 1em; flex: none; vertical-align: -0.15em; }
.arrow.back { transform: scaleX(-1); }
[dir="rtl"] .arrow { transform: scaleX(-1); }
[dir="rtl"] .arrow.back { transform: none; }
.text-link, .text-button { display: inline-flex; align-items: center; gap: 6px; color: var(--button); font: 600 15px var(--display); text-decoration: none; background: none; border: 0; padding: 4px 0; }
.text-link:hover, .text-button:hover { text-decoration: underline; }
.text-button:disabled, .text-button[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.danger-text { color: var(--bad); }
.actions, .links-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.links-row { margin-top: 28px; }

/* Header and footer. Signed out: the logo, two links and Sign in. Signed in: the portal's links and the cog. */
.site-header { position: sticky; top: 0; z-index: 30; background: rgba(8, 0, 36, 0.8); backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2); border-bottom: 1px solid var(--line); }
.site-nav { display: flex; align-items: center; gap: 32px; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; text-decoration: none; flex: none; padding: 4px 0; }
.brand-logo { display: block; width: 78px; }
.brand-logo svg { display: block; width: 100%; height: auto; }
.nav-links { display: flex; gap: 26px; margin: 0; padding: 0; list-style: none; font: 500 15px var(--display); }
.nav-links a { text-decoration: none; color: var(--muted); padding: 6px 0; white-space: nowrap; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
.nav-links a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--button); }
.nav-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.cog { width: 40px; min-height: 40px; padding: 0; border-radius: 12px; }
.cog svg { width: 21px; height: 21px; transition: transform 0.5s var(--ease); }
.cog[aria-expanded="true"] { border-color: var(--lilac); background: rgba(255, 255, 255, 0.06); }
.cog[aria-expanded="true"] svg { transform: rotate(45deg); }
@media (max-width: 560px) {
  .site-nav { gap: 16px; }
  .brand-logo { width: 68px; }
  .nav-links { gap: 16px; font-size: 14px; }
}
@media (max-width: 420px) {
  /* Two links or more, the logo, the flag and Sign in (or the cog) don't share 390px: the links take their own scrolling row. */
  .site-nav:has(.nav-links li:nth-child(2)) { flex-wrap: wrap; padding-block: 10px; row-gap: 4px; }
  .site-nav:has(.nav-links li:nth-child(2)) .nav-links { order: 3; width: 100%; overflow-x: auto; }
}

/* The cog's menu (src/lib/reading.ts keeps its switches): a popover under the header's end, Esc or a click outside
   closes it, and focus goes back to the cog. */
.settings-menu { --edge: max(var(--gutter), calc((100vw - 1200px) / 2 + var(--gutter))); }
.settings-menu:popover-open { position: fixed; inset: calc(var(--header-h) + 8px) var(--edge) auto auto; margin: 0; width: min(300px, calc(100vw - 32px)); padding: 18px; display: grid; gap: 14px; color: var(--text); background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 22px 50px rgba(3, 0, 18, 0.5); animation: menu-in 0.2s var(--ease); }
[dir="rtl"] .settings-menu:popover-open { inset: calc(var(--header-h) + 8px) auto auto var(--edge); }
.settings-menu fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 12px; }
.settings-menu legend { font: 600 13px var(--display); color: var(--muted); letter-spacing: 0.02em; margin-bottom: 4px; }
.settings-menu .sign-out { justify-content: flex-start; width: 100%; margin-top: 2px; }
.settings-menu .fine { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px); } }

/* The flag button and its menu (src/lib/language.ts): jelli.us's (jelli-www site.css .nav-language and its menu).
   Each name in the system's font, in its own script: the site's fonts are Latin only. */
.lang-button { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; min-height: 40px; padding: 0; border: 1.5px solid var(--line-strong); border-radius: 12px; background: rgba(255, 255, 255, 0.04); cursor: pointer; transition: background 0.2s, border-color 0.2s; }
.lang-button:hover, .lang-button[aria-expanded="true"] { border-color: var(--lilac); background: rgba(255, 255, 255, 0.08); }
.lang-button img, .language-options img { display: block; flex: none; width: 24px; height: 18px; border-radius: 3px; }
.language-menu { --edge: max(var(--gutter), calc((100vw - 1200px) / 2 + var(--gutter))); }
.language-menu:popover-open { position: fixed; inset: calc(var(--header-h) + 8px) var(--edge) auto auto; margin: 0; width: min(440px, calc(100vw - 36px)); max-height: calc(100dvh - var(--header-h) - 32px); overflow-y: auto; padding: 21px; color: var(--text); background: rgba(23, 13, 46, 0.98); border: 1px solid rgba(208, 183, 236, 0.24); border-radius: 20px; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); animation: menu-in 0.2s var(--ease); }
[dir="rtl"] .language-menu:popover-open { inset: calc(var(--header-h) + 8px) auto auto var(--edge); }
/* The panel, title and rows are jelli.us's numbers (jelli-www home.css .download-popover, site.css .language-options). */
.language-menu > strong { display: block; font: 600 19px var(--display); color: var(--text); }
.language-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; margin: 12px 0 0; padding: 0; list-style: none; }
.language-options a { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 8px 10px; border-radius: 10px; color: #e8e0f2; text-decoration: none; font: 500 14px/1.25 system-ui, -apple-system, "Segoe UI", sans-serif; }
.language-options a:hover { background: rgba(255, 255, 255, 0.1); }
.language-options a:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.language-options a[aria-current] { background: rgba(255, 255, 255, 0.08); color: var(--button); }
@media (forced-colors: active) { .lang-button { border-color: ButtonText; } .language-options a[aria-current] { outline: 2px solid Highlight; outline-offset: -2px; } }

/* Read aloud's Listen buttons (src/lib/reading.ts), and what the Reading switches change. */
.read-aloud { justify-self: start; }
.read-aloud svg { width: 18px; height: 18px; }
:root:not([data-read-aloud]) .read-aloud, .read-aloud[data-playing] .read-idle, .read-aloud:not([data-playing]) .read-stop { display: none; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.sec-head h2 { font-size: 24px; }
/* Larger text: the type is set in px, so the page's content is zoomed rather than the root font-size. The phone keeps
   its own size (the app has its own text sizes; the bezel its width), so its slot zooms back to 1. */
:root[data-large-text] main { zoom: 1.25; }
:root[data-large-text] .phone-slot { zoom: 0.8; }

.site-footer { margin-top: 96px; border-top: 1px solid var(--line); padding: 56px 0 64px; background: linear-gradient(180deg, rgba(18, 16, 42, 0), rgba(18, 16, 42, 0.8)); }
.home .site-footer, .landing .site-footer { margin-top: 0; }
.site-footer.slim { margin-top: 64px; padding: 24px 0 32px; background: none; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1.2fr; gap: 40px; }
.footer-brand .brand-logo { width: 72px; margin-bottom: 14px; }
.footer-brand p { color: var(--muted); font: 500 18px/1.4 var(--display); max-width: 20ch; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, max-content); gap: 10px 32px; align-content: start; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); text-decoration: underline; }
.footer-fine { display: grid; gap: 6px; align-content: start; color: var(--dim); font-size: 14px; }
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  /* Two columns that share the width, so a long word (nl, ru, fr…) wraps instead of pushing the page sideways. */
  .footer-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-links a { overflow-wrap: break-word; }
}

/* Surfaces, forms, tables */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.panel > * + * { margin-top: 12px; }
.notice { padding: 12px 16px; border-radius: 12px; background: rgba(170, 114, 224, 0.14); border: 1px solid var(--line-strong); color: var(--text); margin-bottom: 16px; }
.notice.error { background: rgba(255, 154, 168, 0.12); border-color: rgba(255, 154, 168, 0.45); }
.notice-line:empty { display: none; }
.notice-line { color: var(--good); margin: 8px 0; }
.status { color: var(--muted); padding: 16px 0; }
.status.error p { color: var(--bad); margin-bottom: 10px; }
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field label, .choices legend { font: 600 15px var(--display); color: var(--text); }
.field input, .field select, .field textarea, .answer input { width: 100%; min-height: 46px; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, 0.05); font-size: 16px; }
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible, .answer input:focus-visible { outline: 3px solid var(--button); outline-offset: 1px; }
/* A date's parts take focus inside it, which :focus-visible doesn't see on the field itself. */
.field input[type="date"]:focus-within { outline: 3px solid var(--button); outline-offset: 1px; }
.field select option { background: var(--card); }
select:not([multiple]):not([size]) { appearance: none; -webkit-appearance: none; padding-inline-end: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23c9bfd8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 12px 8px; }
[dir="rtl"] select:not([multiple]):not([size]) { background-position: left 14px center; }
@media (forced-colors: active) { select:not([multiple]):not([size]) { appearance: auto; background-image: none; padding-inline-end: 14px; } }
.field input[aria-invalid="true"], .answer input[aria-invalid="true"] { border-color: var(--bad); }
.hint { color: var(--dim); font-size: 14px; }
.field-error { color: var(--bad); font-size: 15px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.inline-field { grid-template-columns: 1fr 96px; align-items: center; }
.choices { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
.choices legend { margin-bottom: 8px; }
.option { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.option:has(input:checked) { border-color: var(--button); background: rgba(255, 230, 108, 0.06); }
.option input { margin-top: 4px; accent-color: var(--button); width: 18px; height: 18px; flex: none; }
.option > span { display: grid; gap: 2px; }
.option > span > span { color: var(--muted); font-size: 15px; }
.switch { display: inline-flex; align-items: center; gap: 10px; font: 600 15px var(--display); cursor: pointer; }
.switch input { appearance: none; width: 44px; height: 26px; border-radius: 13px; background: var(--raised); border: 1px solid var(--line-strong); position: relative; margin: 0; flex: none; cursor: pointer; transition: background 0.2s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform 0.2s var(--ease), background 0.2s; }
.switch input:checked { background: var(--grape); border-color: var(--grape-light); }
.switch input:checked::after { transform: translateX(18px); background: #fff; }
.segmented { display: inline-flex; padding: 4px; margin: 0 0 22px; border: 1px solid var(--line-strong); border-radius: 12px; gap: 4px; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segmented span { display: block; padding: 8px 18px; border-radius: 9px; font: 600 15px var(--display); color: var(--muted); }
.segmented input:checked + span { background: var(--button); color: var(--on-yellow); }
.segmented input:focus-visible + span { outline: 3px solid var(--button); outline-offset: 2px; }

/* position: relative so what's absolutely placed inside (an .sr-only name in a far column) scrolls with the table
   instead of widening the page. */
.table-scroll { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { padding: 12px 14px; text-align: start; vertical-align: top; border-bottom: 1px solid var(--line); }
.table thead th { font: 600 13px var(--display); color: var(--muted); letter-spacing: 0.02em; background: var(--card); position: sticky; top: 0; }
.table tbody th { font-weight: 600; }
.table tbody tr:last-child > * { border-bottom: 0; }
.table.compact th, .table.compact td { padding: 8px 12px; }
.table tr.strong > * { font-weight: 700; }
.table .neg, .neg { color: var(--bad); }
.warn { color: var(--warn); font-weight: 600; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font: 600 12px/1.6 var(--display); background: var(--raised); color: var(--muted); white-space: nowrap; }
.tag.good { background: rgba(134, 227, 184, 0.14); color: var(--good); }
.tag.bad { background: rgba(255, 154, 168, 0.14); color: var(--bad); }
.meter { display: block; height: 6px; border-radius: 3px; background: var(--raised); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--good); border-radius: 3px; }
.fill-0 { width: 0; } .fill-1 { width: 10%; } .fill-2 { width: 20%; } .fill-3 { width: 30%; } .fill-4 { width: 40%; } .fill-5 { width: 50%; }
.fill-6 { width: 60%; } .fill-7 { width: 70%; } .fill-8 { width: 80%; } .fill-9 { width: 90%; } .fill-10 { width: 100%; }

/* ---------- Home: the hero's two desks (views/Home.astro) ----------
   The copy on the start side; on the end side the teacher's desk floats over the student's phone, and the desk's one
   yellow button fills the phone. The phone is the lesson page's .device (below, with the Phone island), scaled. */
.hero { position: relative; isolation: isolate; overflow-x: clip; padding-block: clamp(24px, 4.5vh, 64px) clamp(64px, 9vw, 112px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr); gap: clamp(32px, 4vw, 64px); align-items: center; }
.hero-copy { display: grid; gap: 22px; justify-items: start; }
.hero-copy h1 { font-size: clamp(40px, 4.3vw, 60px); font-weight: 700; line-height: 1.03; letter-spacing: -0.03em; }
.accent { display: block; color: var(--lilac); }
.hero-copy .lead { font-size: clamp(18px, 1.4vw, 20px); max-width: 44ch; }
.hero-copy .actions { margin-top: 6px; }
.scene { position: relative; display: flex; justify-content: flex-end; align-items: flex-start; min-width: 0; }
/* jelli.us's blurred grape glow behind its phone (jelli-www home.css .scene:before). */
.scene::before { content: ""; position: absolute; z-index: -1; inset: 6% -12% 4% 30%; border-radius: 50%; background: radial-gradient(closest-side, rgba(153, 67, 222, 0.42), rgba(220, 90, 231, 0.12) 60%, transparent); filter: blur(28px); pointer-events: none; }
.demo-phone { --s: 0.72; flex: none; }
.desk { position: absolute; z-index: 2; inset-inline-start: 0; bottom: 36px; width: min(320px, 56%); display: grid; gap: 12px; padding: 18px 20px; border-radius: 22px; background: rgba(26, 21, 56, 0.9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line-strong); box-shadow: 0 30px 70px rgba(3, 0, 18, 0.6); }
.desk-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-family: var(--display); }
.desk-head strong { font-size: 19px; }
.desk-month { color: var(--lilac); font-size: 14px; font-weight: 500; }
.desk-roster { list-style: none; margin: 0; padding: 0; display: grid; }
.desk-roster li { display: grid; grid-template-columns: 30px minmax(0, 1fr); grid-template-areas: "av who" "av life"; align-items: center; column-gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.3; }
.desk-avatar { grid-area: av; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font: 600 12px var(--display); color: var(--on-yellow); }
.desk-avatar.a0 { background: #b7a0f3; } .desk-avatar.a1 { background: #79d9b0; } .desk-avatar.a2 { background: #68cce0; } .desk-avatar.a3 { background: #ffb27d; }
.desk-roster .who { grid-area: who; font-weight: 600; font-family: var(--display); }
.desk-roster .life { grid-area: life; color: var(--dim); font-size: 13px; }
.desk-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; padding-top: 4px; }
.demo-note { color: var(--dim); font-size: 13px; }

/* Maya's Jelli, drawn at the phone's own size (a 393pt screen; the frame scales it). */
.demo-app { display: flex; flex-direction: column; gap: 14px; min-height: 0; padding: 10px 24px 8px; overflow: hidden; background: radial-gradient(130% 46% at 50% -6%, rgba(132, 64, 189, 0.45), transparent 72%); }
.demo-head { display: grid; gap: 2px; }
.demo-head strong { font: 700 32px/1.1 var(--display); letter-spacing: -0.01em; }
.demo-head span { color: var(--muted); font-size: 17px; }
.demo-pay { display: grid; gap: 4px; padding: 18px 20px; border-radius: 24px; background: rgba(134, 227, 184, 0.1); border: 1px solid rgba(134, 227, 184, 0.3); }
.demo-pay span { color: var(--muted); font-size: 16px; }
.demo-pay strong { font: 600 40px/1.1 var(--display); color: var(--good); font-variant-numeric: tabular-nums; }
.demo-pay .demo-pay-note { color: var(--dim); font-size: 15px; }
.demo-label { font: 600 18px var(--display); color: var(--muted); margin-top: 6px; }
.feed-empty { color: var(--dim); font-size: 19px; line-height: 1.45; padding: 4px 2px; }
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.feed-item { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 22px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); }
.feed-mark { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; }
.feed-mark svg { width: 24px; height: 24px; }
.feed-item.pay .feed-mark { background: rgba(134, 227, 184, 0.16); color: var(--good); }
.feed-item.bill .feed-mark { background: rgba(143, 208, 255, 0.14); color: var(--sky); }
.feed-item.card .feed-mark { background: rgba(255, 230, 108, 0.16); color: var(--button); }
.feed-item.card { border-color: rgba(255, 230, 108, 0.5); background: rgba(255, 230, 108, 0.06); }
.feed-text { display: grid; min-width: 0; }
.feed-text strong { font: 600 19px/1.25 var(--display); }
.feed-text span { color: var(--dim); font-size: 15px; line-height: 1.35; }
.feed-amount { font: 600 19px var(--display); font-variant-numeric: tabular-nums; }
.feed-item.pay .feed-amount { color: var(--good); }
.demo-label:has(+ .demo-jars) { margin-top: auto; }
.demo-jars { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.demo-jar { --fill: 0; display: grid; grid-template-columns: 66px minmax(0, 1fr); align-items: center; gap: 6px; padding: 10px 12px 10px 4px; border-radius: 22px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); }
.demo-jar-text { display: grid; gap: 2px; min-width: 0; }
.demo-jar-text span { color: var(--muted); font-size: 15px; }
.demo-jar-text strong { font: 600 20px var(--display); font-variant-numeric: tabular-nums; }
.demo-jar.j0 { --tone: #7ba5da; } .demo-jar.j1 { --tone: #47aa39; } .demo-jar.j2 { --tone: #ff5eb5; } .demo-jar.j3 { --tone: #2ac4d8; }
/* A Jar as the app draws one (jelli-app ui/Jar.tsx, its own three images): the back masks the liquid, which is clipped
   from the bottom up to --fill, then the glass and lid on top. */
.jar { position: relative; display: block; width: 66px; aspect-ratio: 1; }
.jar > * { position: absolute; inset: 0; width: 100%; height: 100%; }
.jar-liquid { background: var(--tone); -webkit-mask: url("/art/jars/jar-back.png") center / contain no-repeat; mask: url("/art/jars/jar-back.png") center / contain no-repeat; }
.jar-liquid, .jar-sparkle { clip-path: inset(calc(6% + 91% * (1 - var(--fill))) 0 3% 0); transition: clip-path 1.1s var(--ease); }
.jar-sparkle { background: url("/art/jars/jar-sparkle.png") center / contain no-repeat; }
.arrive { animation: arrive 0.6s var(--ease) both; }
.feed-item.card.arrive { animation: arrive 0.6s var(--ease) both, flip 0.7s var(--ease) 0.15s both; transform-origin: 50% 50%; }
@keyframes arrive { from { opacity: 0; transform: translateY(-14px) scale(0.98); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes flip { from { transform: rotateX(80deg); } to { transform: none; } }
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .scene { justify-content: center; gap: 28px; align-items: center; }
  .desk { position: static; width: min(372px, 100%); }
}
@media (max-width: 720px) {
  .scene { flex-direction: column; }
  .scene::before { inset: 30% -20% 0; }
}

/* ---------- Public bands: a centered head, then the band's content ---------- */
.band { padding-block: clamp(64px, 9vw, 120px); border-top: 1px solid var(--line); overflow-x: clip; }
.band-head { display: grid; gap: 16px; justify-items: center; text-align: center; max-width: 760px; margin: 0 auto clamp(40px, 6vw, 72px); }
.band-head h2, .close-head h2 { font-size: clamp(32px, 4vw, 52px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.05; }
.band-head .lead { margin-inline: auto; }

/* One week in class: four moments, a drawing beside its words, alternating sides. */
.week-story { overflow-x: clip; }
.moment { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: center; padding-block: clamp(28px, 4vw, 56px); }
.moment.flip { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
.moment.flip > .mock { order: 2; }
.moment-copy { display: grid; gap: 16px; justify-items: start; max-width: 46ch; }
.moment-copy h3, .moment-copy h2 { font-size: clamp(28px, 2.8vw, 40px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.08; }
.moment-copy p { color: var(--muted); font-size: 18px; line-height: 1.6; }
@media (max-width: 860px) {
  .moment, .moment.flip { grid-template-columns: 1fr; gap: 28px; }
  .moment.flip > .mock { order: 0; }
}
.mock { position: relative; margin: 0; min-width: 0; }
.moment .pz-stage { box-shadow: 0 30px 70px rgba(3, 0, 18, 0.5); }

/* The lesson: the Presenter's stage, drawn (islands/Presenter.tsx is the real one). */
.slide { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.slide-stage { position: relative; aspect-ratio: 16 / 9; border-radius: 20px; overflow: hidden; border: 1px solid var(--line-strong); background: radial-gradient(70% 90% at 80% 0%, rgba(132, 64, 189, 0.5), transparent 70%), radial-gradient(60% 70% at 0% 100%, rgba(220, 90, 231, 0.2), transparent 70%), var(--desk); box-shadow: 0 30px 70px rgba(3, 0, 18, 0.5); container-type: inline-size; }
.slide-chapter { position: absolute; top: 4cqw; inset-inline-start: 4.5cqw; font: 600 max(11px, 1.7cqw) var(--display); color: var(--lilac); }
.slide-scene { position: absolute; inset: 10cqw 6cqw 15cqw 27cqw; display: grid; align-content: center; gap: 2.4cqw; }
.slide-h { font: 700 max(15px, 3.6cqw)/1.1 var(--display); letter-spacing: -0.01em; }
.slide-row { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 0.8cqw 2cqw; }
.slide-label { font-size: max(11px, 1.8cqw); color: var(--muted); }
.slide-row b { font: 700 max(12px, 2.4cqw) var(--display); font-variant-numeric: tabular-nums; }
.slide-track { grid-column: 1 / -1; height: max(7px, 1.6cqw); border-radius: 99px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.slide-track > span { display: block; height: 100%; border-radius: inherit; }
.slide-row.r0 .slide-track > span { width: 100%; background: var(--button); }
.slide-row.r1 .slide-track > span { width: 78%; background: var(--good); }
.slide-row.r2 .slide-track > span { width: 22%; background: var(--bad); }
.slide-row.r2 .slide-track { box-shadow: 0 0 0 2px var(--button); }
.slide-jj { position: absolute; inset-inline-start: 3cqw; bottom: 3.5cqw; width: 19cqw; height: auto; filter: drop-shadow(0 1cqw 2cqw rgba(0, 0, 0, 0.4)); }
.slide-caption { position: absolute; inset-inline: 25cqw 5cqw; bottom: 3.5cqw; text-align: center; }
.slide-caption > span { display: inline; padding: 0.35em 0.6em; border-radius: 8px; background: rgba(8, 0, 36, 0.86); color: #fff; font: 500 max(12px, 2.1cqw)/1.55 var(--body); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.slide-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.slide-play { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--button); color: var(--on-yellow); flex: none; }
.slide-play svg { width: 18px; height: 18px; }
.slide-chapters { display: flex; gap: 4px; flex: 1; min-width: 0; overflow: hidden; }
.slide-chapters > span { padding: 6px 11px; border-radius: 99px; border: 1px solid transparent; font: 500 13px var(--body); color: var(--dim); white-space: nowrap; }
.slide-chapters > .is-now { color: var(--text); background: var(--raised); border-color: var(--line-strong); }
.slide-cc { padding: 5px 8px; border-radius: 8px; border: 1px solid var(--lilac); color: var(--lilac); font: 600 12px var(--display); }
.slide-progress { flex: 1 0 100%; height: 4px; border-radius: 4px; background: var(--raised); overflow: hidden; }
.slide-progress > span { display: block; width: 28%; height: 100%; background: linear-gradient(90deg, var(--grape-light), var(--button)); }
@media (max-width: 600px) {
  /* A phone: a taller stage, JJ up in the corner, the scene across the whole width (the Presenter does the same). */
  .slide-stage { aspect-ratio: 4 / 3.6; }
  .slide-scene { inset: 13cqw 6cqw 24cqw; gap: 3cqw; }
  .slide-jj { inset-inline-start: auto; inset-inline-end: 4cqw; top: 2.5cqw; bottom: auto; width: 15cqw; }
  .slide-caption { inset-inline: 5cqw; bottom: 4cqw; }
  .slide-cc { display: none; }
}

/* The Lab: a Chromebook, the week's steps on the left, Jelli docked on the right. */
.laptop { display: grid; justify-items: center; }
.laptop-lid { width: 92%; padding: 2.4% 2.4% 3%; border-radius: 20px 20px 6px 6px; background: linear-gradient(180deg, #24222c, #121117); box-shadow: inset 0 0 0 1px #3a3844, 0 30px 70px rgba(3, 0, 18, 0.5); container-type: inline-size; }
.laptop-screen { aspect-ratio: 16 / 10; display: grid; grid-template-columns: minmax(0, 1fr) 32cqw; gap: 3.5cqw; padding: 3.6cqw 4cqw 0; border-radius: 6px; overflow: hidden; background: radial-gradient(60% 50% at 10% 0%, rgba(220, 90, 231, 0.16), transparent 70%), var(--night); }
.laptop-base { position: relative; width: 100%; height: clamp(10px, 1.6vw, 16px); border-radius: 0 0 16px 16px; background: linear-gradient(180deg, #4a4854, #1c1b22); box-shadow: 0 18px 34px rgba(3, 0, 18, 0.55); }
.laptop-base::before { content: ""; position: absolute; top: 0; left: 50%; width: 16%; height: 40%; border-radius: 0 0 8px 8px; background: #2a2933; transform: translateX(-50%); }
.lap-lesson { display: flex; flex-direction: column; gap: 1.2cqw; min-width: 0; }
.lap-week { font: 600 max(9px, 1.7cqw) var(--display); color: var(--lilac); }
.lap-title { font: 700 max(13px, 3.7cqw)/1.1 var(--display); letter-spacing: -0.01em; }
.lap-lab { margin-top: 1.2cqw; font: 600 max(10px, 2cqw) var(--display); color: var(--muted); }
.lap-steps { list-style: none; margin: 0; padding: 0; display: grid; }
.lap-steps li { display: flex; align-items: center; gap: 1.6cqw; padding: 1.2cqw 0; border-top: 1px solid var(--line); font-size: max(9px, 1.85cqw); line-height: 1.3; color: var(--text); }
.lap-mark { display: grid; place-items: center; flex: none; width: 3.6cqw; height: 3.6cqw; border-radius: 50%; border: 1px solid var(--line-strong); font: 600 max(8px, 1.6cqw) var(--display); color: var(--muted); }
.lap-mark svg { width: 70%; height: 70%; }
.lap-steps .is-done { color: var(--muted); }
.lap-steps .is-done .lap-mark { background: rgba(134, 227, 184, 0.16); border-color: transparent; color: var(--good); }
.lap-steps .is-now .lap-mark { border-color: var(--button); color: var(--button); }
.lap-phone { position: relative; display: flex; flex-direction: column; gap: 1.4cqw; padding: 6cqw 2.2cqw 0; border: 0.9cqw solid #0b0a10; border-bottom: 0; border-radius: 4.6cqw 4.6cqw 0 0; background: radial-gradient(120% 40% at 50% 0%, rgba(132, 64, 189, 0.45), transparent 70%), var(--night); box-shadow: 0 0 0 1px #3a3844; }
.lap-island { position: absolute; top: 1.4cqw; left: 50%; width: 9cqw; height: 2.4cqw; border-radius: 2cqw; background: #000; transform: translateX(-50%); }
.lap-phone > strong { font: 700 max(11px, 2.8cqw) var(--display); }
.lap-row { display: flex; justify-content: space-between; align-items: center; gap: 1cqw; padding: 1.4cqw 1.6cqw; border-radius: 2cqw; background: rgba(255, 255, 255, 0.06); font-size: max(8px, 1.5cqw); }
.lap-row > span:first-child { display: grid; min-width: 0; }
.lap-row b { font: 600 max(9px, 1.7cqw) var(--display); }
.lap-row i { font-style: normal; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lap-row > span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.lap-row .lap-in { color: var(--good); }
.lap-row.is-lit { box-shadow: 0 0 0 2px var(--button); background: rgba(255, 230, 108, 0.08); }

/* Life Cards: a hand of three, in CardInbox's type colors. */
.fan { height: clamp(330px, 32vw, 420px); display: grid; place-items: center; }
.fan-card { --c: var(--lilac); grid-area: 1 / 1; display: flex; flex-direction: column; gap: 10px; width: clamp(140px, 16vw, 220px); aspect-ratio: 5 / 7; padding: clamp(16px, 1.6vw, 22px); border-radius: 20px; background: linear-gradient(165deg, color-mix(in srgb, var(--c) 20%, var(--card)), var(--card) 58%); border: 1.5px solid color-mix(in srgb, var(--c) 62%, transparent); box-shadow: 0 26px 54px rgba(3, 0, 18, 0.55); transform-origin: 50% 130%; }
.fan-card.t-must { --c: var(--bad); transform: translate(-60%, 5%) rotate(-10deg); }
.fan-card.t-choice { --c: var(--grape-light); z-index: 1; transform: translateY(-4%); }
.fan-card.t-windfall { --c: var(--good); z-index: 2; transform: translate(60%, 5%) rotate(10deg); }
.fan-card strong { font: 600 clamp(17px, 1.7vw, 22px)/1.15 var(--display); }
.fan-text { color: var(--muted); font-size: clamp(12px, 1.1vw, 14px); line-height: 1.45; }
.fan-card .card-amount { margin-top: auto; font-size: clamp(15px, 1.4vw, 19px); color: var(--c); }
.fan-options { margin-top: auto; display: grid; gap: 6px; }
.fan-options > span { padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--raised); font: 500 clamp(11px, 1vw, 13px) var(--display); }
.fan-options > span:first-child { border-color: var(--c); }

/* The teacher's class page, drawn (islands/TeacherApp + teach/Roster). */
.dash { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 20px 22px; border-radius: 20px; background: var(--card); border: 1px solid var(--line-strong); box-shadow: 0 30px 70px rgba(3, 0, 18, 0.5); font-size: 14px; }
.dash-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.dash-class { display: block; font: 600 24px/1.2 var(--display); }
.dash-month { color: var(--lilac); font: 500 14px var(--display); }
.dash-code { display: grid; justify-items: end; gap: 4px; }
.dash-code span { color: var(--dim); font-size: 12px; }
.dash-code strong { font: 600 22px/1 var(--display); letter-spacing: 0.16em; color: var(--button); }
.dash-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.dash-tabs { list-style: none; display: flex; gap: 2px; margin: 0; padding: 0; min-width: 0; overflow: hidden; }
.dash-tabs li { padding: 8px 9px; margin-bottom: -1px; border-bottom: 2px solid transparent; font: 600 13px var(--display); color: var(--muted); white-space: nowrap; }
.dash-tabs .is-on { color: var(--text); border-bottom-color: var(--button); }
.dash-hide { display: inline-flex; align-items: center; gap: 8px; flex: none; padding-bottom: 4px; font: 600 12px var(--display); color: var(--muted); }
.dash-switch { position: relative; width: 30px; height: 18px; border-radius: 9px; background: var(--raised); border: 1px solid var(--line-strong); }
.dash-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); }
.dash-row { display: grid; grid-template-columns: minmax(0, 1.7fr) 0.55fr 0.6fr minmax(0, 1.25fr); align-items: center; gap: 10px; padding: 10px 8px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.dash-head { border-top: 0; padding-block: 4px; font: 600 11.5px/1.25 var(--display); color: var(--muted); }
.dash-who strong { display: block; font: 600 14px var(--display); }
.dash-who em { display: block; font-style: normal; color: var(--dim); font-size: 12px; }
.dash-who .tag { margin-top: 4px; }
.dash-row.needs { background: rgba(255, 154, 168, 0.06); border-radius: 10px; }
.warn-n { color: var(--bad); font-weight: 600; }
.dash-min { display: flex; align-items: center; gap: 8px; }
.dash-min .meter { flex: 1; }
.dash-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding-top: 2px; color: var(--dim); font-size: 12.5px; }
.dash-start { pointer-events: none; }
@media (max-width: 480px) {
  .fan-card.t-must { transform: translate(-52%, 5%) rotate(-9deg); }
  .fan-card.t-windfall { transform: translate(52%, 5%) rotate(9deg); }
  .dash { padding: 16px; }
  .dash-hide { display: none; }
  .dash-row { grid-template-columns: minmax(0, 1.6fr) 0.5fr 0.5fr minmax(0, 1fr); gap: 6px; padding-inline: 4px; }
  .dash-min .meter { display: none; }
}

/* The year in one strip. */
.weeks { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(18, minmax(0, 1fr)); gap: 5px; }
.weeks li { display: grid; place-items: center; height: clamp(40px, 4.4vw, 56px); border-radius: 10px; background: var(--card); border: 1px solid var(--line); font: 600 14px var(--display); color: var(--muted); font-variant-numeric: tabular-nums; }
.weeks li:nth-child(-n + 2) { background: rgba(211, 177, 242, 0.14); color: var(--lilac); }
.weeks li:nth-child(n + 3):nth-child(-n + 14) { background: rgba(255, 230, 108, 0.12); color: var(--button); }
.weeks li:nth-child(n + 15):nth-child(-n + 17) { background: rgba(170, 114, 224, 0.22); color: var(--lilac); }
.weeks li:nth-child(18) { background: rgba(134, 227, 184, 0.14); color: var(--good); }
.spans { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
.spans li { display: grid; align-content: start; gap: 6px; padding-top: 16px; border-top: 3px solid var(--line-strong); color: var(--muted); }
.spans li strong { font: 600 20px var(--display); color: var(--text); }
.span-weeks { font: 600 13px var(--display); color: var(--dim); font-variant-numeric: tabular-nums; }
.spans li:nth-child(1) { border-color: var(--lilac); } .spans li:nth-child(2) { border-color: var(--button); } .spans li:nth-child(3) { border-color: var(--grape-light); } .spans li:nth-child(4) { border-color: var(--good); }
@media (max-width: 960px) { .spans { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .weeks { grid-template-columns: repeat(9, minmax(0, 1fr)); } }
@media (max-width: 480px) { .spans { grid-template-columns: 1fr; } }

/* Ways in, under JJ: students, teachers, districts. */
.paths-band { background: radial-gradient(60rem 28rem at 50% 0%, rgba(132, 64, 189, 0.24), transparent 70%); }
.close-head { display: flex; align-items: center; justify-content: center; gap: clamp(20px, 3vw, 36px); margin-bottom: clamp(36px, 5vw, 56px); }
.close-jj { flex: none; width: clamp(84px, 9vw, 120px); }
.close-jj svg { display: block; width: 100%; height: auto; }
.close-head > div { display: grid; gap: 14px; justify-items: start; }
.paths { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1.25fr 1fr 1fr; border: 1px solid var(--line-strong); border-radius: 24px; overflow: hidden; background: rgba(18, 16, 42, 0.7); }
.path { display: grid; gap: 12px; align-content: start; padding: clamp(24px, 3vw, 36px); border-inline-start: 1px solid var(--line); }
.path:first-child { border-inline-start: 0; background: rgba(255, 230, 108, 0.05); }
.path h4 { margin: 0; font: 600 24px var(--display); }
.path p { color: var(--muted); }
.path .actions { margin-top: 6px; }
@media (max-width: 860px) {
  .paths { grid-template-columns: 1fr; }
  .path { border-inline-start: 0; border-top: 1px solid var(--line); }
  .path:first-child { border-top: 0; }
}
@media (max-width: 600px) { .close-head { flex-direction: column; align-items: flex-start; } }

/* ---------- Teachers and districts (views/Teachers.astro, Districts.astro): a hero with a drawing, then bands ---------- */
.page-hero { position: relative; isolation: isolate; overflow-x: clip; padding-block: clamp(32px, 6vw, 80px) clamp(64px, 9vw, 112px); }
.page-hero::before { content: ""; position: absolute; z-index: -1; inset: 0 -10% 10% 45%; border-radius: 50%; background: radial-gradient(closest-side, rgba(153, 67, 222, 0.32), transparent); filter: blur(30px); pointer-events: none; }
.page-hero-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.page-hero-copy { display: grid; gap: 22px; justify-items: start; }
.page-hero-copy h1 { font-size: clamp(40px, 4.6vw, 64px); font-weight: 700; line-height: 1.03; letter-spacing: -0.03em; max-width: 13ch; }
.page-hero-copy .actions { gap: 14px 24px; margin-top: 4px; }
@media (max-width: 960px) { .page-hero-grid { grid-template-columns: 1fr; } }

.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; counter-reset: flow; }
.flow li { position: relative; display: grid; gap: 10px; align-content: start; }
.flow li:not(:last-child)::after { content: ""; position: absolute; top: 24px; inset-inline: 64px -20px; height: 1px; background: linear-gradient(90deg, var(--line-strong), transparent); }
.flow-n { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--raised); border: 1px solid var(--line-strong); font: 600 19px var(--display); color: var(--lilac); }
.flow li:first-child .flow-n { background: var(--button); border-color: var(--button); color: var(--on-yellow); }
.flow h3 { font-size: 21px; margin-top: 6px; }
.flow p { color: var(--muted); }
@media (max-width: 860px) {
  .flow { grid-template-columns: 1fr 1fr; }
  .flow li::after { display: none; }
}
@media (max-width: 480px) { .flow { grid-template-columns: 1fr; } }

.checks { list-style: none; margin: 0 auto; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; max-width: 980px; }
.checks.one { grid-template-columns: 1fr; margin: 0; }
.checks li { display: flex; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); font-size: 17px; }
.checks li::before { content: ""; flex: none; width: 24px; height: 24px; margin-top: 1px; border-radius: 50%; background: rgba(134, 227, 184, 0.14) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3.2 3L15 6.5' fill='none' stroke='%2386e3b8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 15px no-repeat; }
@media (max-width: 760px) { .checks { grid-template-columns: 1fr; } }

.glance { padding: clamp(22px, 2.6vw, 32px); border-radius: 24px; background: rgba(26, 21, 56, 0.85); border: 1px solid var(--line-strong); box-shadow: 0 30px 70px rgba(3, 0, 18, 0.5); }
.glance h2 { font: 600 13px var(--display); color: var(--muted); letter-spacing: 0.02em; margin-bottom: 10px; }
.glance ul { list-style: none; margin: 0; padding: 0; display: grid; }
.glance a { display: flex; align-items: center; gap: 14px; padding: 13px 4px; border-top: 1px solid var(--line); font: 600 clamp(16px, 1.4vw, 19px) var(--display); text-decoration: none; }
.glance li:first-child a { border-top: 0; }
.glance a .arrow { margin-inline-start: auto; color: var(--dim); transition: transform 0.2s var(--ease), color 0.2s; }
.glance a:hover .arrow { color: var(--button); transform: translateX(3px); }
[dir="rtl"] .glance a:hover .arrow { transform: scaleX(-1) translateX(3px); }
.glance-mark { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: rgba(134, 227, 184, 0.14); color: var(--good); }
.glance-mark svg { width: 16px; height: 16px; }

.answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(32px, 5vw, 72px); }
.answer-block { display: grid; gap: 12px; align-content: start; padding-block: 28px 32px; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--header-h) + 24px); }
.answer-block h2 { font-size: clamp(24px, 2.2vw, 30px); font-weight: 600; }
.answer-block p { color: var(--muted); font-size: 17px; }
.answer-block:target { border-top-color: var(--button); }
.pills { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pills li { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-strong); font: 500 14px var(--display); color: var(--lilac); }
@media (max-width: 760px) { .answers { grid-template-columns: 1fr; } }

/* Keep / never chips (the privacy page, data we collect). */
.keep-never { margin-top: 24px; display: grid; grid-template-columns: 1fr 1.4fr; gap: 20px 56px; }
.keep-never h3 { margin-bottom: 14px; color: var(--muted); font-size: 16px; }
.keep, .never { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.keep li, .never li { padding: 10px 16px 10px 40px; border-radius: 999px; font: 500 16px var(--display); background-repeat: no-repeat; background-position: 14px 50%; background-size: 16px; }
.keep li { background-color: rgba(134, 227, 184, 0.12); color: var(--good); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4.5 10.5l3.5 3.2L15.5 6' fill='none' stroke='%2386e3b8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.never li { background-color: rgba(255, 154, 168, 0.1); color: var(--bad); text-decoration: line-through; text-decoration-thickness: 1.5px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 5.5l9 9m0-9l-9 9' fill='none' stroke='%23ff9aa8' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E"); }
@media (max-width: 760px) { .keep-never { grid-template-columns: 1fr; } }

/* ---------- Articles (privacy, accessibility, data we collect) ---------- */
.article { padding-block: clamp(40px, 6vw, 72px) 0; }
.article-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; max-width: 760px; padding-bottom: 36px; border-bottom: 1px solid var(--line); }
/* A long word ("Конфиденциальность") breaks rather than pushing a phone's page sideways. */
.article-head h1 { font-size: clamp(38px, 4.4vw, 58px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.04; overflow-wrap: break-word; hyphens: auto; }
.article-body { max-width: 760px; }
.keep-block { max-width: 960px; margin-top: 36px; padding: clamp(22px, 3vw, 36px); border-radius: 24px; background: rgba(26, 21, 56, 0.7); border: 1px solid var(--line-strong); }
.keep-block h2 { font-size: clamp(24px, 2.6vw, 32px); font-weight: 600; }
.article-body > section { padding-top: 34px; }
.article-body h2 { font-size: 26px; margin: 34px 0 12px; }
.article-body > section > h2 { margin-top: 0; }
.article-body p + p { margin-top: 12px; }
.article-body :is(ul:not([role]), ol) { margin: 12px 0 0; padding-inline-start: 22px; display: grid; gap: 8px; color: var(--text); }
.article-body p { color: #e4dcee; }
.article-body .never { margin: 8px 0 14px; }
.article-body ol + p, .article-body ul + p { margin-top: 12px; }
.article-body .copy-label { margin-top: 16px; }
.article-body .copy-label + .copy-line { margin-top: 4px; }
.copy-line code { overflow-wrap: anywhere; font-size: 15px; }
.fields th[scope="row"] { min-width: 180px; }
.field-group { margin-top: 30px; }
.field-group h3 { margin-bottom: 8px; }
.retention { margin-bottom: 12px; font-size: 15px; }

/* ---------- Sign in (islands/SignIn.tsx: one screen at /sign-in/ and /join/) ----------
   jelli.app's front door (jelli-apps/jelli-app/src/auth/signin.css) in the Academy's night: JJ glowing over a short
   hello, then one glass card, and "I'm a teacher" under it. Wide (≥ 960px) puts JJ and the words beside the card, as the
   app's brand panel sits beside its form. The school buttons keep each brand's own rules (mark, colors, words, type);
   yellow stays for the one main action, the PIN or email submit. */
.signin { max-width: 480px; padding-block: 36px 0; display: grid; gap: 28px; }
.signin-head { position: relative; isolation: isolate; display: grid; gap: 10px; justify-items: center; text-align: center; }
.signin-head::before { content: ""; position: absolute; z-index: -1; top: -32px; left: 50%; width: 300px; height: 240px; translate: -50% 0; border-radius: 50%; background: radial-gradient(closest-side, rgba(220, 90, 231, 0.4), rgba(132, 64, 189, 0.16) 62%, transparent); pointer-events: none; }
.signin-head img { width: 104px; filter: drop-shadow(0 16px 22px rgba(3, 0, 18, 0.55)); animation: signin-bob 3.2s ease-in-out infinite alternate; }
.signin-head h1 { font-size: clamp(32px, 4vw, 48px); }
.signin-head .lead { font-size: 17px; max-width: 34ch; }
@keyframes signin-bob { to { transform: translateY(-6px); } }
.signin-main { display: grid; gap: 14px; }
.signin-card { display: grid; gap: 18px; padding: 28px; border-radius: 24px; border-color: rgba(255, 255, 255, 0.08); background: color-mix(in srgb, var(--desk) 82%, transparent); box-shadow: 0 30px 80px rgba(3, 0, 18, 0.45); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.signin-card > * + * { margin-top: 0; }
.signin-card > .notice { margin: 0; }
.signin-card form, .student-signin { display: grid; gap: 16px; }
.signin-h { font: 600 16px/1.3 var(--display); color: var(--muted); text-align: center; letter-spacing: 0; margin-top: 4px; }
.signin-card .pin-input { letter-spacing: 0.3em; }
.signin-card form > .btn { width: 100%; margin-top: 4px; }
.signin-card .fine { text-align: center; }
.signin-or { display: flex; align-items: center; gap: 14px; color: var(--dim); font: 500 14px var(--display); }
.signin-or::before, .signin-or::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
/* Sign in with Jelli: a third way in, apart from the student and teacher card. */
.signin-jelli { display: grid; gap: 10px; justify-items: center; text-align: center; margin-top: 8px; padding: 22px; border-radius: 20px; }
.signin-jelli h2 { margin: 0; }
.signin-jelli p { margin: 0; color: var(--muted); }
.signin-switch { justify-self: center; padding: 8px 12px; border: 0; background: none; color: var(--muted); font: 500 15px var(--display); text-decoration: underline; text-underline-offset: 4px; }
.signin-switch:hover { color: var(--text); }

/* The school buttons: one stack, each mark at the start, the words centered. Hover and press lay the words' own color
   over the fill at 8% and 12% (Google's state layers), which suits every brand's fill. */
.providers { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.provider { position: relative; overflow: hidden; display: grid; grid-template-columns: 24px 1fr 24px; align-items: center; justify-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 6px 14px; border: 0; border-radius: 10px; font: 500 16px/1.2 system-ui, sans-serif; transition: transform 0.2s var(--ease); }
.provider::after { content: ""; position: absolute; inset: 0; background: currentColor; opacity: 0; transition: opacity 0.15s; pointer-events: none; }
.provider:hover::after { opacity: 0.08; }
.provider:active::after { opacity: 0.12; }
.provider:active { transform: scale(0.98); }
.provider svg { width: 20px; height: 20px; }
/* Apple (HIG): the white style on a dark background, mark and words both black, the system font near 40% of the height. */
.provider.apple { background: #fff; color: #000; font: 500 18px/1.2 -apple-system, BlinkMacSystemFont, system-ui, sans-serif; }
.provider.apple svg { width: 18px; height: 18px; margin-top: -3px; }
/* Google's dark theme: #131314, a 1px #8E918F stroke inside, #E3E3E3 words, the four-color G. */
.provider.google { background: #131314; color: #e3e3e3; box-shadow: inset 0 0 0 1px #8e918f; font: 500 15px/1.2 "Google Sans", Roboto, system-ui, sans-serif; }
/* Microsoft's dark theme: #2F2F2F, white words in Segoe UI Semibold, the four squares. */
.provider.microsoft { background: #2f2f2f; color: #fff; font: 600 15px/1.2 "Segoe UI", system-ui, sans-serif; }
.provider.microsoft svg { width: 19px; height: 19px; }
/* Clever's own Log in with Clever button: #2265F8, white words, its yellow mark. */
.provider.clever { background: #2265f8; color: #fff; }
.provider.clever svg { width: 21px; height: 21px; }
/* ClassLink publishes no button: its logo file's blue and white cloud. */
.provider.classlink { background: #0a4d7f; color: #fff; }
.provider.classlink svg { width: 26px; height: 19px; }

.sent { display: grid; gap: 12px; justify-items: center; text-align: center; }
.sent h2 { font-size: 24px; }
.sent-icon { display: grid; place-items: center; width: 84px; height: 84px; margin-bottom: 4px; border-radius: 50%; background: rgba(255, 230, 108, 0.14); color: var(--button); }
.sent-icon svg { width: 38px; height: 38px; }
.callback-failed { display: grid; gap: 14px; justify-items: start; }
@media (max-width: 480px) {
  .signin { padding-block-start: 20px; gap: 22px; }
  .signin-head img { width: 88px; }
  .signin-card { padding: 22px 18px; border-radius: 20px; }
}
@media (min-width: 960px) {
  .signin { max-width: 1040px; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); align-items: start; column-gap: clamp(48px, 7vw, 112px); padding-block-start: 64px; }
  .signin-head { position: sticky; top: calc(var(--header-h) + 64px); padding-block: 48px; }
  .signin-head img { width: 128px; }
  .signin-head::before { top: 0; width: 460px; height: 380px; }
  .signin-head .lead { font-size: 18px; }
}
@media (forced-colors: active) {
  .provider { border: 1px solid ButtonText; }
  .signin-or::before, .signin-or::after { background: CanvasText; }
}

/* ---------- Student portal ---------- */
.portal-page { padding-block: 40px 0; }
.portal-head { display: grid; gap: 10px; margin-bottom: 28px; }
.cards-lead { margin: -16px 0 24px; }
.self-check { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.self-check li { display: grid; gap: 6px; justify-items: start; padding-top: 12px; border-top: 1px solid var(--line); }
.self-check li:first-child { border-top: 0; padding-top: 0; }
.class-head { display: grid; gap: 8px; margin-bottom: 24px; }
.today { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 26px 28px; margin-bottom: 20px; }
.today > * + * { margin-top: 0; }
.today-lesson { display: grid; gap: 4px; text-decoration: none; }
.today-go { display: grid; justify-items: center; gap: 10px; }
.today-alone { color: var(--muted); font-size: 14px; padding: 12px 4px; text-decoration: underline; text-underline-offset: 3px; }
.today-lesson strong { font: 600 30px var(--display); }
.today-lesson span { color: var(--muted); }
.today-lesson:hover strong { text-decoration: underline; text-underline-offset: 5px; }
.today-k { font-size: 15px; }
/* A learner on their own: where they live (first), Next week, their settings. */
.solo-setup { display: grid; gap: 16px; max-width: 560px; margin-inline: auto; padding: 28px; }
.solo-setup .actions, .solo-region .actions { margin-top: 4px; }
.solo-region { display: grid; gap: 12px; }
.solo-region h3 { margin: 0; font-size: 18px; }
.next-week { display: grid; gap: 10px; justify-items: start; padding: 22px 26px; margin-bottom: 20px; border-color: var(--line-strong); }
.next-week h2 { font-size: 22px; }
.solo-settings { display: grid; gap: 12px; justify-items: start; margin-top: 16px; }
.solo-settings h2 { font-size: 20px; }
.solo-settings .confirm { justify-self: stretch; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.home-grid h2 { font-size: 20px; }
.count { font: 600 22px var(--display); color: var(--button); }
.mini-list { list-style: none; margin: 0; padding: 0; display: grid; }
.mini-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.mini-list li:first-child { border-top: 0; }
.score-mini { display: flex; gap: 32px; margin: 0; }
.score-mini dt { color: var(--muted); font-size: 14px; }
.score-mini dd { margin: 0; font: 600 26px var(--display); font-variant-numeric: tabular-nums; }

.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.life-card { --c: var(--lilac); position: relative; display: grid; gap: 10px; align-content: start; min-height: 300px; padding: 22px; border-radius: 20px; background: var(--card); border: 1.5px solid color-mix(in srgb, var(--c) 55%, transparent); }
.life-card.t-must { --c: var(--bad); } .life-card.t-choice { --c: var(--grape-light); } .life-card.t-windfall { --c: var(--good); }
.life-card.t-class { --c: var(--sky); } .life-card.t-burnout { --c: var(--warn); } .life-card.t-recharge { --c: var(--button); }
.card-type { justify-self: start; font: 600 12px var(--display); letter-spacing: 0.06em; text-transform: uppercase; color: var(--c); }
.life-card h2 { font-size: 24px; }
.card-amount { font: 600 22px var(--display); font-variant-numeric: tabular-nums; }
.face-down { place-items: center; text-align: center; background: repeating-linear-gradient(135deg, var(--card) 0 14px, var(--raised) 14px 28px); }
.face-down img { width: 64px; }
.card-options { display: grid; gap: 8px; }
.option-button { display: grid; justify-items: start; text-align: start; gap: 2px; min-height: 0; padding: 12px 14px; }
.option-button span { color: var(--muted); font: 400 14px var(--body); }
.card-picked { color: var(--good); font-weight: 600; }
.card-lesson summary { cursor: pointer; color: var(--lilac); font: 600 14px var(--display); padding-block: 4px; }
.card-lesson p { margin-top: 8px; color: var(--muted); }
.is-busy { opacity: 0.7; }

.score { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; }
.score-months { grid-column: 1 / -1; }
.score-months h2 { margin-bottom: 14px; font-size: 22px; }
.score-total { display: flex; justify-content: space-between; align-items: baseline; }
.score-total h2, .score-joy h2 { font-size: 22px; }
.big-number { font: 600 48px/1 var(--display); font-variant-numeric: tabular-nums; }
.big-number span { font-size: 20px; color: var(--dim); }
.score-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.score-lines li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
.score-lines .meter { grid-column: 1 / -1; }
.line-label { font-weight: 600; }
.line-points { font-variant-numeric: tabular-nums; color: var(--muted); }
/* A line that hasn't started yet reads quieter: its label muted and its meter faded, never its words (opacity failed contrast). */
.score-lines .is-later .line-label { color: var(--muted); }
.score-lines .is-later .meter { opacity: 0.5; }
@media (max-width: 760px) { .score { grid-template-columns: 1fr; } }

/* ---------- Lesson page with the phone ---------- */
.lesson { padding-block: 22px 0; }
.lesson-head { display: grid; gap: 10px; max-width: 760px; padding-bottom: 30px; }
.lesson-head.coming { justify-items: start; padding-block: 40px; }
.lesson-meta { display: flex; gap: 10px; color: var(--lilac); font: 500 16px var(--display); }
.lesson-meta span + span::before { content: "·"; margin-inline-end: 10px; color: var(--dim); }
.goals { margin: 0; padding-inline-start: 22px; display: grid; gap: 8px; }
.vocab-words { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.vocab-words li { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-strong); font: 500 15px var(--display); color: var(--lilac); }
.vocab { margin: 14px 0 0; display: grid; gap: 12px; }
.vocab div { display: grid; grid-template-columns: minmax(120px, 0.35fr) 1fr; gap: 14px; }
.vocab dt { font: 600 16px var(--display); color: var(--lilac); }
.vocab dd { margin: 0; color: var(--muted); }
.lab-overview { padding-inline-start: 22px; display: grid; gap: 6px; color: var(--muted); }
.life-slot { margin-bottom: 26px; display: grid; gap: 12px; }
.labs { display: grid; gap: 22px; }
.lab { display: grid; gap: 12px; }
.lab-head { display: grid; gap: 6px; }
.lab-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--dim); font-size: 14px; }
.lab.is-done .lab-head h3::after { content: ""; display: inline-block; width: 18px; height: 18px; margin-inline-start: 8px; vertical-align: -2px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4.5 10.5l3.5 3.2L15.5 6' fill='none' stroke='%2386e3b8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; }
.step { display: grid; grid-template-columns: 30px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.step-mark { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 600 14px var(--display); border: 1.5px solid var(--line-strong); color: var(--muted); }
.step.is-done .step-mark { background: rgba(134, 227, 184, 0.16); border-color: transparent; color: var(--good); }
.step-mark svg { width: 18px; height: 18px; }
.step.is-done .step-body > p:first-child { color: var(--muted); }
.step-body { display: grid; gap: 8px; justify-items: start; }
.answer { display: grid; gap: 6px; width: 100%; }
.answer label { font: 600 14px var(--display); }
.answer-row { display: flex; gap: 8px; max-width: 420px; }
.decision fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.decision legend { margin-bottom: 8px; }
.decision { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line-strong); border-radius: var(--radius); }
.decision-made, .lab-complete { color: var(--good); font-weight: 600; }
.life { display: grid; gap: 18px; justify-items: start; }
.life > .life-picks, .life > .month-math { justify-self: stretch; }
.life-picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.career-facts { list-style: none; margin: 4px 0 0; padding: 0; color: var(--dim); font-size: 14px; display: grid; gap: 2px; }
.life > .month-math { max-width: 460px; }
.confirm { display: grid; gap: 12px; padding: 16px; border-radius: var(--radius); border: 1px solid var(--button); }
.quiz h2 { font-size: 24px; margin-bottom: 10px; }

/* ---- The week page (pages/week/[n].astro): a bar with the week's title and its tabs, then one panel at a time.
   On a laptop the phone sits beside the Lab (and beside the lesson while a slide drives it); on a narrow screen it's
   the Jelli tab. --wk-top is where a panel starts below the viewport's top, so full-frame things fit the rest. */
.lesson-page { --wk-bar-h: 56px; --wk-top: calc(var(--header-h) + var(--wk-bar-h)); }
.wk-bar { position: sticky; top: var(--wk-head, var(--header-h)); z-index: 20; background: rgba(8, 0, 36, 0.9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.wk-bar-inner { display: flex; align-items: center; gap: 10px 20px; min-height: var(--wk-bar-h); }
.wk-title { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; align-items: center; min-width: 0; flex: 0 1 auto; }
.wk-back, .wk-steps a { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: var(--muted); text-decoration: none; }
.wk-back { grid-row: span 2; }
.wk-back:hover, .wk-steps a:hover { background: var(--raised); color: var(--text); }
.wk-kicker { margin: 0; font: 600 12px/1.2 var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--lilac); }
.wk-title h1 { margin: 0; font: 700 19px/1.25 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-tabs { display: flex; gap: 2px; margin-inline: auto; padding: 4px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.wk-tab { position: relative; min-height: 36px; padding: 0 16px; border: 0; border-radius: 10px; background: none; color: var(--muted); font: 600 15px var(--display); white-space: nowrap; cursor: pointer; }
.wk-tab:hover { color: var(--text); }
.wk-tab[aria-selected="true"] { background: var(--raised); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.wk-tab:focus-visible { outline: 3px solid var(--button); outline-offset: 1px; }
.wk-tab.t-jelli { display: none; }
.wk-steps { display: flex; gap: 2px; flex: none; }
.wk-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; padding-block: 22px 40px; }
.wk-panel { grid-column: 1; grid-row: 1; min-width: 0; outline: none; }
.wk-panel[hidden] { display: none; }
.wk-card { padding: 22px 24px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.wk-card .sec-head h2 { font-size: 20px; }
.wk-intro { display: grid; gap: 22px; justify-items: start; width: 100%; max-width: 1000px; margin-inline: auto; }
.wk-lead { margin: 0; max-width: 44ch; font: 500 clamp(20px, 2.4vw, 26px)/1.4 var(--display); text-wrap: pretty; }
.wk-intro-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; width: 100%; }
.wk-go { gap: 8px; }
.wk-lab { max-width: 780px; }
.wk-lab > .sec-head h2 { font-size: 24px; }
.wk-wrap { display: grid; gap: 16px; width: 100%; max-width: 780px; margin-inline: auto; }
.family { background: rgba(211, 177, 242, 0.06); }
.wk-phone { display: none; min-width: 0; }
.wk-return { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--raised); color: var(--text); font: 600 15px var(--display); cursor: pointer; }
.wk-return:hover { border-color: var(--lilac); }
.wk-return[hidden] { display: none; }
@media (width >= 1024px) {
  /* The phone's column is as wide as the drawn iPhone at the height there is (417×876 in its own pixels, plus its caption). */
  .wk { --phone-col: min(417px, calc((100dvh - var(--wk-top) - 76px) * 417 / 876)); }
  .wk[data-tab="lab"] .wk-body, body[data-lesson-phone="slide"] .wk[data-tab="lesson"] .wk-body { grid-template-columns: minmax(0, 1fr) var(--phone-col); }
  .wk[data-tab="lab"] .wk-phone, body[data-lesson-phone="slide"] .wk[data-tab="lesson"] .wk-phone { display: block; grid-column: 2; grid-row: 1; position: sticky; top: calc(var(--wk-top) + 16px); height: calc(100dvh - var(--wk-top) - 32px); }
  /* The lesson takes the whole width; the phone's column opens only while a slide drives the phone (Presenter sets
     "slide"), and the stage eases over to make room. ponytail: the stage resizes on those slides; Ben wants it as
     big as it can be the rest of the time (Nov 7 2026). */
  .wk[data-tab="lesson"] .wk-body { padding-block: 10px; transition: grid-template-columns 0.35s var(--ease); }
}
@media (width < 1024px) {
  .lesson-page { --wk-bar-h: 108px; }
  .wk-bar-inner { flex-wrap: wrap; padding-block: 8px; }
  .wk-title { flex: 1 1 0; }
  .wk-steps { order: 2; }
  .wk-tabs { order: 3; flex: 1 0 100%; margin: 0; overflow-x: auto; scrollbar-width: none; }
  .wk-tab { flex: 1 0 auto; padding: 0 12px; }
  .wk-tab.t-jelli { display: none; }
  body[data-phone] .wk-tab.t-jelli { display: block; }
  /* The lesson wants Jelli: a dot on its tab. */
  body[data-lesson-phone="slide"] .wk[data-tab="lesson"] .wk-tab.t-jelli::after { content: ""; position: absolute; top: 7px; inset-inline-end: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--button); }
  .wk[data-tab="jelli"] .wk-phone { display: flex; flex-direction: column; gap: 8px; grid-column: 1; grid-row: 1; height: calc(100dvh - var(--wk-top) - 28px - var(--practice-h, 0px) - var(--banner-room, 0px)); }
  .wk[data-tab="jelli"] .wk-phone .phone { flex: 1; min-height: 0; }
  .wk-body { padding-block: 16px 28px; }
}
:root[data-large-text] .wk-phone { zoom: 0.8; }

/* The phone: drawn as an iPhone at its own size (a 393×852 screen in a 12px frame) and scaled to fit (--s, set by the
   Phone island), so a short screen shows a smaller phone, never a squashed one. The app's own background tints the
   status bar and the home strip (--app-bg). On a narrow screen the drawing goes and the app fills its tab. */
.phone { height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; align-content: start; gap: 8px; --s: 1; }
/* A practice slide's phone (Phone island): a plain line above it, on a laptop and in a narrow screen's Phone tab. Empty, it
   stays in the page (a screen reader hears it fill) but out of the grid. */
.phone:has(> .phone-practice:not(:empty)) { grid-template-rows: auto minmax(0, 1fr) auto; }
.phone-practice { justify-self: stretch; margin: 0; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--grape-light); background: rgba(132, 64, 189, 0.18); color: var(--text); font: 500 13px/1.35 var(--body); text-align: center; }
.phone-practice:empty { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); }
.phone-practice b { display: inline-block; margin-inline-end: 6px; padding: 1px 8px; border-radius: 999px; background: var(--grape); color: #fff; font: 700 12px var(--display); letter-spacing: 0.04em; text-transform: uppercase; }
.phone-practice.is-failed { border-color: var(--line-strong); background: var(--raised); color: var(--muted); }
.device { --app-bg: var(--night); position: relative; width: 417px; height: 876px; padding: 12px; border-radius: 68px; background: #0b0a10; box-shadow: inset 0 0 0 1.5px #3a3844, inset 0 0 0 5px #0b0a10, 0 0 0 1.5px #5c5966, 0 0 0 3px #1c1b22, 0 40px 80px rgba(3, 0, 18, 0.55); transform: scale(var(--s)); transform-origin: top center; margin: 0 calc(417px * (var(--s) - 1) / 2) calc(876px * (var(--s) - 1)); color: #fff; }
.device.is-light { color: #000; }
.device-screen { position: relative; height: 100%; display: grid; grid-template-rows: 54px minmax(0, 1fr) 22px; border-radius: 56px; overflow: hidden; background: var(--app-bg); }
.device-status { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 6px 34px 0 46px; font: 600 17px/1 -apple-system, "SF Pro Text", "Inter", var(--body); font-variant-numeric: tabular-nums; }
.device-island { position: absolute; top: 11px; left: 50%; width: 126px; height: 37px; border-radius: 20px; background: #000; transform: translateX(-50%); }
.device-icons { display: flex; align-items: center; gap: 6px; }
.device-icons svg { height: 12px; width: auto; fill: currentColor; }
.device iframe { display: block; width: 100%; height: 100%; border: 0; background: var(--app-bg); }
.device-home { justify-self: center; align-self: center; width: 140px; height: 5px; border-radius: 3px; background: currentColor; opacity: 0.85; }
.device-key { position: absolute; width: 4px; border-radius: 2px; background: #2b2a32; }
.device-key.k-action { left: -4px; top: 168px; height: 34px; }
.device-key.k-up { left: -4px; top: 232px; height: 62px; }
.device-key.k-down { left: -4px; top: 306px; height: 62px; }
.device-key.k-side { right: -4px; top: 260px; height: 100px; }
.phone-chin { margin: 0; color: var(--dim); font: 500 12px var(--display); letter-spacing: 0.02em; text-align: center; }
.phone-missing { height: 100%; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px; text-align: center; color: var(--text); }
.phone-missing img { width: 80px; }
@media (width < 1024px) {
  .phone { grid-template-rows: minmax(0, 1fr); }
  .phone:has(> .phone-practice:not(:empty)) { grid-template-rows: auto minmax(0, 1fr); }
  .phone .device { width: 100%; height: 100%; padding: 0; border-radius: 18px; transform: none; margin: 0; box-shadow: none; background: none; overflow: hidden; border: 1px solid var(--line); }
  .phone .device-screen { grid-template-rows: minmax(0, 1fr); border-radius: 0; }
  .phone .device-status, .phone .device-home, .phone .device-key, .phone-chin { display: none; }
}

/* The Life Card banner (CardBanner): fixed at the lesson's start corner, clear of the docked or floating phone. While it
   shows, it says the room it takes at the bottom of the screen (--banner-room), and the lesson player and the Jelli tab
   stand above it, so it never covers their controls (the player's bar, the app's tab bar). */
.card-banner { position: fixed; z-index: 35; inset-inline-start: 24px; bottom: 24px; max-width: min(440px, calc(100vw - 48px)); display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; padding: 14px 12px 14px 18px; border-radius: var(--radius); background: var(--raised); border: 1.5px solid rgba(255, 230, 108, 0.55); box-shadow: 0 18px 44px rgba(3, 0, 18, 0.5); }
.card-banner-text { font: 600 16px var(--display); }
/* An empty live region stays in the page (so its words are announced when they come) but out of the banner's layout. */
.card-banner .card-banner-text:empty { position: absolute; }
.card-banner-close { display: grid; place-items: center; width: 36px; height: 36px; margin-inline-start: auto; border: 0; border-radius: 10px; background: none; color: var(--muted); }
.card-banner-close:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.card-banner-close svg { width: 18px; height: 18px; }
@media (max-width: 600px) { .card-banner { inset-inline: 16px; bottom: 16px; max-width: none; } }

/* ---------- Teacher ---------- */
.classes h1, .class-page h1 { margin-bottom: 8px; }
.classes > h1 { margin-bottom: 20px; }
.class-list { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 10px; }
.class-link { display: grid; grid-template-columns: minmax(0, 1.4fr) auto 1fr 1fr; gap: 16px; align-items: center; padding: 18px 22px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); text-decoration: none; }
.class-link:hover { border-color: var(--lilac); }
.class-link strong { font: 600 19px var(--display); }
.class-link .code { font: 600 16px var(--display); letter-spacing: 0.18em; color: var(--button); }
.class-link span { color: var(--muted); }
@media (max-width: 700px) { .class-link { grid-template-columns: 1fr 1fr; } }
.create-class, .narrow-form { max-width: 640px; display: grid; gap: 18px; }
.create-class > * + *, .narrow-form > * + * { margin-top: 0; }
.create-class .btn, .narrow-form .btn { justify-self: start; }
.back-link { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; margin-bottom: 18px; color: var(--muted); text-decoration: none; font: 500 15px var(--display); }
.back-link:hover { color: var(--text); text-decoration: underline; }
.leave-ask { border-color: var(--button); margin-bottom: 18px; }
.class-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.join-line { margin-top: 6px; display: grid; gap: 4px; }
.join-line p { margin: 0; }
.join-url, .copy-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.join-url .mono { overflow-wrap: anywhere; color: var(--button); }
.tabs-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin: 26px 0 20px; border-bottom: 1px solid var(--line); }
/* min-width 0: the class's tabs scroll in their own row on a narrow screen rather than widen the page. */
.tabs-bar nav { min-width: 0; max-width: 100%; }
.tabs { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; overflow-x: auto; }
.tabs a { display: block; padding: 12px 14px; font: 600 15px var(--display); color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--button); }
.tabs-bar .switch { padding-bottom: 10px; }
.tab-body { display: grid; gap: 22px; }
/* A section holding a wide table shrinks to the column (its table scrolls) rather than widen the page. */
.tab-body > * { min-width: 0; }
.tab-body > h2 { font-size: 24px; }
.roster th[scope="row"] { min-width: 170px; }
.roster .who { display: block; }
.roster tr.needs > * { background: rgba(255, 154, 168, 0.05); }
.roster .tag { margin-top: 4px; }
.row-actions { white-space: nowrap; }
.row-actions .text-button + .text-button { margin-inline-start: 14px; }
.add-students { max-width: 640px; display: grid; gap: 12px; }
.add-students > * + * { margin-top: 0; }
.add-students .btn { justify-self: start; }
/* The teacher's username prefix and the Google Classroom import, beside Add students. */
.prefix, .classroom { max-width: 640px; display: grid; gap: 10px; }
.prefix > *, .classroom > * { margin: 0; }
.prefix .actions, .classroom .btn { justify-self: start; }
.classroom-done { display: grid; gap: 6px; }
/* A PIN student's ways in, under their home's boxes. */
.ways { max-width: 640px; margin-top: 16px; display: grid; gap: 10px; }
.ways > * { margin: 0; }
.pin-cards { display: grid; gap: 14px; border-color: var(--button); }
.pin-cards:focus { outline: none; }
.pin-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.pin-card { padding: 16px; border: 1.5px dashed var(--line-strong); border-radius: 14px; display: grid; gap: 8px; }
.pin-card dl { margin: 0; display: grid; gap: 4px; }
.pin-card dl div { display: grid; gap: 0; }
.pin-card dt { color: var(--dim); font-size: 13px; }
.pin-card dd { margin: 0; font-weight: 600; font-size: 17px; white-space: nowrap; }
.roster-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
/* The upload box: a dashed drop zone with a ghost button; the real file input covers it invisibly. */
.file-drop { position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1.5px dashed var(--line-strong); border-radius: 12px; background: rgba(255, 255, 255, 0.03); transition: border-color 0.2s, background 0.2s; }
.file-drop:hover, .file-drop:has(.file-input:active) { border-color: var(--lilac); background: rgba(211, 177, 242, 0.06); }
.file-drop:focus-within { outline: 3px solid var(--button); outline-offset: 2px; }
.file-drop .btn { pointer-events: none; flex: none; }
.file-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim); font-size: 14px; }
.file-name.is-set { color: var(--text); font-weight: 600; }
.import-preview { display: grid; gap: 10px; }
.import-preview h4 { margin: 0; font: 600 16px var(--display); }
.import-scroll { max-height: 360px; overflow-y: auto; }
.import-table tr.flag > * { background: rgba(255, 194, 122, 0.06); }
.import-table .tag { margin-inline-end: 10px; }
.anyway { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; white-space: nowrap; cursor: pointer; }
.anyway input { width: 18px; height: 18px; margin: 0; accent-color: var(--button); }
.take-class { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; margin-top: 14px; }
.take-class .fine { flex: 1 1 260px; max-width: 60ch; }
.take-class .notice-line, .take-class .field-error { flex-basis: 100%; margin: 0; }
/* Practising as a student (src/views/PracticeBar.astro): a pill at the corner of every page, so no layout moves. */
.practice-bar { position: fixed; inset-inline-start: 16px; bottom: 16px; z-index: 40; display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px); padding-block: 8px; padding-inline: 16px 8px; border-radius: 14px; background: var(--raised); border: 1.5px solid var(--button); box-shadow: 0 14px 34px rgba(3, 0, 18, 0.5); font: 600 15px var(--display); }
@media (forced-colors: active) { .practice-bar { border-color: CanvasText; } }
/* While practising, nothing sits under the pill: the page ends above it, a focused control scrolls clear of it, and what
   sizes from the viewport (the full-frame lesson, the narrow Jelli tab) takes --practice-h off its height. */
html[data-practising] { --practice-h: 80px; scroll-padding-bottom: var(--practice-h); }
html[data-practising] body { padding-bottom: var(--practice-h); }
.month-now { display: grid; gap: 10px; justify-items: start; }
.month-now > * + * { margin-top: 0; }
.big-line { font: 600 24px var(--display); }
.pace { display: grid; gap: 14px; }
.pace > * + * { margin-top: 0; }
.pace-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px 24px; }
.deck { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.deck-card { --c: var(--lilac); display: grid; gap: 8px; align-content: start; padding: 18px; border-radius: var(--radius); background: var(--card); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); }
.deck-card.t-must { --c: var(--bad); } .deck-card.t-choice { --c: var(--grape-light); } .deck-card.t-windfall { --c: var(--good); }
.deck-card.t-class { --c: var(--sky); } .deck-card.t-burnout { --c: var(--warn); } .deck-card.t-recharge { --c: var(--button); }
.deck-card .btn, .deck-card .tag { justify-self: start; }
.deck-card ul { margin: 0; padding-inline-start: 18px; }
.settings .panel { max-width: 640px; }
.field-row-form { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.field-row-form > * + * { margin-top: 0; }
.field-row-form .field { flex: 1; min-width: 220px; }
.toggles { display: grid; gap: 8px; justify-items: start; }
.toggles > * + * { margin-top: 0; }
.toggles .hint { margin: -2px 0 10px 54px; }
.danger { border-color: rgba(255, 154, 168, 0.45); display: grid; gap: 12px; }
.danger > * + * { margin-top: 0; }
.danger-btn { background: var(--bad); border-color: var(--bad); color: #2a0010; justify-self: start; }
.danger-btn:hover { box-shadow: 0 10px 24px rgba(255, 154, 168, 0.2); }
.stats th .block { font-weight: 400; }
/* A district admin's portal (islands/DistrictApp): the facts and the report's totals wrap on a phone. */
.district-facts, .district-totals { flex-wrap: wrap; gap: 14px 32px; margin-top: 10px; }
.district-facts dd { font-size: 18px; }
.district .roster-tools h2 { margin: 0; }

/* Class groups (teach/ClassList.tsx): the class list under the teacher's own group headings, each with move up and down,
   rename and delete in place; a Group select and Move beside each class. */
.group-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 14px; }
.group-bar .notice-line { margin: 0; }
.group-bar > button { margin-inline-start: auto; }
.group-name-form { flex: 1 1 100%; display: flex; align-items: end; flex-wrap: wrap; gap: 10px 12px; }
.group-name-form .field { flex: 1 1 240px; max-width: 420px; }
.group-name-form .actions { gap: 10px; }
.class-group { margin-bottom: 30px; }
.class-group .class-list { margin-bottom: 0; }
.group-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.group-head h2 { font-size: 22px; font-weight: 600; }
.group-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; }
.icon-btn { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border-radius: 10px; border: 1px solid var(--line-strong); background: none; color: var(--text); }
.icon-btn:hover { border-color: var(--lilac); background: rgba(255, 255, 255, 0.05); }
.icon-btn[aria-disabled="true"] { color: var(--dim); border-color: var(--line); background: none; cursor: not-allowed; }
.icon-btn svg { width: 18px; height: 18px; }
.group-confirm { display: grid; gap: 10px; padding: 14px 16px; margin-bottom: 12px; border-radius: 12px; border: 1px solid rgba(255, 154, 168, 0.45); background: rgba(255, 154, 168, 0.06); }
.class-item { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.class-item .class-link { flex: 1 1 420px; min-width: 0; }
.move-class { display: flex; align-items: center; gap: 8px; flex: none; }
.move-class select { min-height: 38px; max-width: 200px; padding-block: 7px; padding-inline-start: 12px; border-radius: 10px; border: 1px solid var(--line-strong); background-color: rgba(255, 255, 255, 0.05); font-size: 14px; }
.move-class select option { background: var(--card); }
.move-class select:focus-visible { outline: 3px solid var(--button); outline-offset: 1px; }
@media (forced-colors: active) { .icon-btn { border-color: ButtonText; } }

/* Graduation (week 18). */
.graduate { display: grid; gap: 20px; }
.graduate .actions { display: flex; flex-wrap: wrap; gap: 12px; }
.certificate { text-align: center; padding-block: 40px; }
.certificate-name { font: 700 34px/1.2 var(--display); margin-block: 12px; text-wrap: balance; }

/* Projector-friendly print of the PIN cards: only the cards. */
@media print {
  body { background: #fff; color: #000; }
  body * { visibility: hidden; }
  .pin-cards, .pin-cards * { visibility: visible; color: #000 !important; }
  .pin-cards { position: absolute; inset: 0 auto auto 0; width: 100%; border: 0; background: #fff; }
  .pin-cards .notice, .no-print { display: none !important; }
  .pin-card { border-color: #000; break-inside: avoid; }
  /* Graduation: the Jar plan and the certificate, each on its own page. */
  .graduate, .graduate * { visibility: visible; color: #000 !important; }
  .graduate { position: absolute; inset: 0 auto auto 0; width: 100%; }
  .graduate .panel { border: 0; background: #fff; box-shadow: none; }
  .graduate .certificate { break-before: page; border: 3px double #000; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .btn, .segmented span, .tag, .card-banner, .wk-tab[aria-selected="true"] { border: 1px solid ButtonText; }
  .meter > span { background: Highlight; }
}

/* A control busy mid-request keeps focus (aria-disabled, not disabled), so a keyboard user keeps their place. */
.switch input[aria-disabled="true"] { cursor: not-allowed; opacity: 0.6; }

/* ---- The lesson player (islands/Presenter.tsx): a stage of fixed proportions (16:9; 4:5 on a narrow screen) that
   fills the lesson tab and never changes size, JJ in the corner, captions over the scene, and one row of controls
   under it. Everything on the stage is sized in --u (a hundredth of its width), so it scales as one picture; a scene
   too long for its box shrinks its type (--fit, set by the player). Every motion stops under prefers-reduced-motion. */
.pz { --pz-h: calc(100dvh - var(--wk-top, var(--header-h)) - 20px - var(--practice-h, 0px) - var(--banner-room, 0px)); --bar-h: 40px; position: relative; display: grid; gap: 8px; width: min(100%, calc((var(--pz-h) - var(--bar-h) - 8px) * 16 / 9)); margin-inline: auto; outline: none; }
.pz-stage { --u: 1cqw; position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: radial-gradient(70% 90% at 80% 0%, rgba(132, 64, 189, 0.38), transparent 70%), radial-gradient(60% 70% at 0% 100%, rgba(220, 90, 231, 0.16), transparent 70%), var(--desk); container-type: inline-size; }
.pz:fullscreen { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.5vh; background: var(--night); }
.pz:fullscreen .pz-stage, .pz:fullscreen .pz-bar { width: min(96vw, calc((96vh - var(--bar-h)) * 16 / 9)); }
.pz-scene { position: absolute; inset: 0; display: grid; place-items: center; padding: calc(var(--u) * 6) calc(var(--u) * 7) calc(var(--u) * 11.5) calc(var(--u) * 18); font-size: calc(var(--u) * var(--fit, 1)); overflow: hidden; }
.pz-where { position: absolute; top: calc(var(--u) * 2); left: calc(var(--u) * 2.5); margin: 0; display: flex; align-items: center; gap: calc(var(--u) * 0.8); max-width: 60%; color: var(--muted); font: 600 calc(var(--u) * 1.5)/1.2 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pz-where span { display: inline-grid; place-items: center; min-width: calc(var(--u) * 2.4); height: calc(var(--u) * 2.4); border-radius: 99px; background: rgba(211, 177, 242, 0.16); color: var(--lilac); }
.pz-jj { position: absolute; left: calc(var(--u) * 2.5); bottom: calc(var(--u) * 3); width: calc(var(--u) * 14); filter: drop-shadow(0 calc(var(--u) * 1) calc(var(--u) * 2) rgba(0, 0, 0, 0.35)); }
.pz-jj svg { width: 100%; height: auto; display: block; }
.pz-example { position: absolute; top: calc(var(--u) * 2); right: calc(var(--u) * 2.5); margin: 0; padding: calc(var(--u) * 0.6) calc(var(--u) * 1.4); border-radius: 99px; background: rgba(255, 194, 122, 0.14); color: var(--warn); font-size: calc(var(--u) * 1.4); }
.pz-caption { position: absolute; left: calc(var(--u) * 18); right: calc(var(--u) * 6); bottom: calc(var(--u) * 3); margin: 0; text-align: center; pointer-events: none; }
.pz-hush { position: absolute; top: calc(var(--u) * 3); left: 50%; transform: translateX(-50%); z-index: 3; }
.pz-caption span { display: inline; padding: 0.35em 0.6em; border-radius: 0.4em; background: rgba(8, 0, 36, 0.82); color: #fff; font: 500 calc(var(--u) * 2.3)/1.45 var(--body); box-decoration-break: clone; -webkit-box-decoration-break: clone; }

.pz-scene.is-behind { filter: blur(calc(var(--u) * 0.6)) brightness(0.55) saturate(0.75); transform: scale(1.03); }
.pz-cover { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: calc(var(--u) * 1.6); padding: calc(var(--u) * 6); text-align: center; background: linear-gradient(180deg, rgba(8, 0, 36, 0.2), rgba(8, 0, 36, 0.78)); }
.pz-cover h3 { margin: 0; max-width: 18ch; font: 700 calc(var(--u) * 5)/1.05 var(--display); letter-spacing: -0.02em; text-wrap: balance; }
.pz-kicker { margin: 0; color: var(--lilac); font: 600 calc(var(--u) * 1.6) var(--display); text-transform: uppercase; letter-spacing: 0.08em; }
.pz-cover-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; margin-top: calc(var(--u) * 1); }
.pz-play-big { min-height: 56px; padding-inline: 30px; font-size: 17px; animation: pz-breathe 2.6s var(--ease) infinite; }
.pz-done { width: 100%; margin: 0 0 calc(var(--u) * 0.5); color: var(--good); font: 600 calc(var(--u) * 2.2) var(--display); }
.pz-quiet { margin: 0; color: var(--dim); font-size: calc(var(--u) * 1.5); }

.pz-ask, .pz-wait { position: absolute; left: calc(var(--u) * 18); right: calc(var(--u) * 5); bottom: calc(var(--u) * 4); max-height: calc(100% - var(--u) * 8); overflow-y: auto; padding: calc(var(--u) * 2.2) calc(var(--u) * 2.6); border-radius: calc(var(--u) * 1.4); background: rgba(18, 16, 42, 0.95); border: 1px solid var(--line-strong); box-shadow: 0 calc(var(--u) * 2) calc(var(--u) * 5) rgba(0, 0, 0, 0.45); outline: none; animation: pz-rise 0.45s var(--ease) both; }
.pz-ask:focus-visible { outline: 2px solid var(--button); outline-offset: 3px; }
/* While a question is up, the slide fits the room above its panel; folded, the panel is just its question. */
.pz-stage.is-asking .pz-scene { bottom: calc(var(--ask-room, 0px) + var(--u) * 4); padding-bottom: calc(var(--u) * 2); }
.pz-ask-fold { float: inline-end; margin: 0 0 4px 12px; font-size: 13px; }
.pz-ask.is-small > :not(.pz-prompt, .pz-ask-fold) { display: none; }
.pz-prompt { margin: 0 0 calc(var(--u) * 1.4); font: 600 calc(var(--u) * 2.5)/1.25 var(--display); }
.pz-options { display: grid; gap: calc(var(--u) * 1); }
.pz-option { display: flex; align-items: center; gap: calc(var(--u) * 1.2); width: 100%; min-height: 44px; padding: calc(var(--u) * 1.1) calc(var(--u) * 1.4); border-radius: calc(var(--u) * 1); border: 1.5px solid var(--line-strong); background: var(--raised); color: var(--text); font: 500 calc(var(--u) * 2)/1.3 var(--body); text-align: start; cursor: pointer; transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease); }
.pz-option:hover:not(:disabled) { border-color: var(--lilac); transform: translateX(4px); }
.pz-option.is-right { border-color: var(--good); background: rgba(134, 227, 184, 0.14); }
.pz-option.is-wrong { border-color: var(--bad); background: rgba(255, 154, 168, 0.12); }
.pz-option.is-out { opacity: 0.55; }
.pz-key { display: inline-grid; place-items: center; flex: none; width: calc(var(--u) * 2.8); height: calc(var(--u) * 2.8); border-radius: calc(var(--u) * 0.6); background: rgba(211, 177, 242, 0.16); color: var(--lilac); font: 700 calc(var(--u) * 1.5) var(--display); }
.pz-number { display: flex; align-items: center; gap: 10px; font: 600 calc(var(--u) * 2.5) var(--display); }
.pz-number input { width: 9em; min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 1.5px solid var(--line-strong); background: var(--night); color: var(--text); font: inherit; }
.pz-verdict { margin: calc(var(--u) * 1.4) 0 0; color: var(--warn); font: 500 calc(var(--u) * 1.9)/1.4 var(--body); }
.pz-verdict:empty { display: none; }
.pz-verdict.good { color: var(--good); }
.pz-unsure { margin-top: calc(var(--u) * 1); font-size: calc(var(--u) * 1.7); }
.pz-wait { display: flex; align-items: center; justify-content: space-between; gap: calc(var(--u) * 2); }
.pz-wait p { margin: 0; font: 600 calc(var(--u) * 2.1) var(--display); }
.pz-wait-text { display: grid; gap: calc(var(--u) * 0.8); min-width: 0; }
.pz-wait .pz-wait-note { color: var(--lilac); font: 500 calc(var(--u) * 1.7)/1.35 var(--body); }
.pz-wait-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.pz-wait .pz-wait-demo { flex: none; max-width: 45%; color: var(--lilac); font: 500 calc(var(--u) * 1.7)/1.35 var(--body); text-align: end; }
.pz-to-jelli { display: none; }
@media (width < 1024px) { body[data-phone] .pz-to-jelli { display: inline-flex; } }

/* The transcript opens over the stage, so the player never changes height. */
.pz-transcript { position: absolute; inset: calc(var(--u) * 1.5); inset-inline-start: auto; width: min(100% - var(--u) * 3, 560px); overflow: auto; padding: 16px 20px; border-radius: 14px; background: rgba(18, 16, 42, 0.97); border: 1px solid var(--line-strong); box-shadow: 0 18px 44px rgba(3, 0, 18, 0.5); z-index: 3; animation: pz-rise 0.3s var(--ease) both; }
.pz-transcript h4 { margin: 10px 0 6px; font: 600 14px var(--display); color: var(--lilac); }
.pz-transcript ol { margin: 0; padding-inline-start: 18px; display: grid; gap: 4px; }
.pz-transcript .text-button { color: var(--muted); font: 400 15px/1.45 var(--body); text-align: start; }
.pz-transcript .text-button.is-now { color: var(--text); font-weight: 600; }
/* A follower reads the transcript; the teacher moves the lesson. */
.pz-transcript .text-button:disabled { opacity: 1; cursor: default; text-decoration: none; }
.pz-close { position: sticky; top: 0; float: inline-end; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 10px; background: var(--raised); color: var(--muted); cursor: pointer; }
.pz-close:hover { color: var(--text); }
.pz-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }

/* The bar: one row that never wraps. The chapters are the progress meter. */
.pz-bar { position: relative; display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; height: var(--bar-h); }
.pz-btn { display: inline-grid; place-items: center; flex: none; min-width: 36px; height: 36px; padding: 0 9px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--card); color: var(--text); font: 600 13px var(--display); cursor: pointer; }
.pz-btn:hover:not(:disabled) { border-color: var(--lilac); }
.pz-btn:disabled { opacity: 0.4; cursor: default; }
.pz-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pz-btn svg .fill { fill: currentColor; stroke: none; }
.pz-main { background: var(--button); border-color: var(--button); color: var(--on-yellow); min-width: 44px; }
.pz-btn.is-on { border-color: var(--lilac); color: var(--lilac); }
.pz-track { flex: 1 1 auto; min-width: 48px; display: flex; gap: 3px; margin: 0 6px; padding: 0; list-style: none; }
.pz-track li { flex: var(--grow, 1) 1 0; min-width: 4px; }
.pz-seg { position: relative; display: block; width: 100%; height: 36px; padding: 0; border: 0; background: none; cursor: pointer; }
.pz-seg::before, .pz-seg-fill { content: ""; position: absolute; top: 50%; height: 6px; border-radius: 3px; transform: translateY(-50%); }
.pz-seg::before { inset-inline: 0; background: var(--raised); box-shadow: inset 0 0 0 1px var(--line); transition: height 0.2s; }
.pz-seg-fill { inset-inline-start: 0; width: var(--p, 0%); background: linear-gradient(90deg, var(--grape-light), var(--button)); transition: width 0.6s var(--ease); }
.pz-seg:hover::before, .pz-seg.is-now::before { height: 10px; }
.pz-seg.is-now .pz-seg-fill { height: 10px; }
.pz-seg:focus-visible { outline: 3px solid var(--button); outline-offset: 2px; border-radius: 6px; }
.pz-menu { position: absolute; inset-inline-end: 0; bottom: calc(100% + 8px); z-index: 5; display: grid; gap: 12px; min-width: 240px; padding: 14px 16px; border-radius: 14px; background: var(--raised); border: 1px solid var(--line-strong); box-shadow: 0 18px 44px rgba(3, 0, 18, 0.55); animation: pz-rise 0.2s var(--ease) both; }
.pz-menu label { display: flex; align-items: center; justify-content: space-between; gap: 14px; font: 600 14px var(--display); }
.pz-menu select { min-height: 40px; padding-block: 0; padding-inline-start: 12px; border-radius: 10px; border: 1px solid var(--line-strong); background-color: var(--card); color: var(--text); font: 600 14px var(--display); }
.pz-menu-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--card); color: var(--text); font: 600 14px var(--display); cursor: pointer; }
.pz-menu-row.is-on { border-color: var(--lilac); color: var(--lilac); }
.pz-menu kbd { font: 600 12px var(--display); color: var(--dim); }
.pz-menu-cc { display: none; }
@media (max-width: 360px) { .pz-bar .pz-text { display: none; } .pz-menu-cc { display: flex; } }

/* Scenes: sized in em of the scene (1em = --u × --fit), so a long one shrinks as a whole. */
.pz-heading { margin: 0 0 2em; font: 700 3.4em/1.1 var(--display); }
.pz-title { text-align: center; }
.pz-title h3 { margin: 0; font: 700 4.4em/1.08 var(--display); letter-spacing: -0.02em; text-wrap: balance; animation: pz-rise 0.6s var(--ease) both; }
.pz-title p { margin: 0.8em 0 0; color: var(--muted); font-size: 2em; animation: pz-rise 0.6s 0.15s var(--ease) both; }
.pz-paper { width: min(100%, 60em); padding: 1.6em 2.4em; border-radius: 1.6em; background: #fbf8ff; color: #1b1235; box-shadow: 0 2em 5em rgba(0, 0, 0, 0.4); transform: rotate(-0.6deg); animation: pz-drop 0.7s var(--ease) both; }
.pz-paper-head { display: flex; justify-content: space-between; align-items: baseline; gap: 2em; padding-bottom: 0.8em; border-bottom: 2px solid #e2d8f1; font-size: 1.55em; color: #6b5c86; }
.pz-paper-head strong { color: #1b1235; font: 700 1.3em var(--display); }
.pz-rows { margin: 0; padding: 0; list-style: none; }
.pz-row { display: flex; justify-content: space-between; gap: 2em; padding: 0.3em 0.5em; border-radius: 0.5em; font-size: 1.7em; line-height: 1.35; animation: pz-line 0.5s var(--ease) both; transition: background 0.4s, transform 0.4s var(--ease); }
.pz-row + .pz-row { border-top: 1px dashed #e7def3; }
.pz-row.tone-total { font-weight: 700; }
.pz-row.tone-out .pz-row-value { color: #b3264a; }
.pz-row.tone-in { font-weight: 700; color: #0f6b47; }
.pz-row.tone-note { color: #5b4a7a; }
.pz-row.is-lit { background: #fff1a8; transform: scale(1.02); box-shadow: 0 0 0 2px #ffe066; }
.pz-row.is-dim { opacity: 0.4; }
.pz-split { width: 100%; max-height: 100%; }
.pz-bars { display: grid; gap: 1.6em; margin: 0; padding: 0; list-style: none; }
.pz-bitem { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 0.5em 2em; opacity: 0.25; transition: opacity 0.5s; }
.pz-bitem.is-on { opacity: 1; }
.pz-bar-label { font-size: 2em; color: var(--muted); }
.pz-bar-value { font: 700 2.5em var(--display); }
.pz-bar-track { grid-column: 1 / -1; height: 2.2em; border-radius: 99px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.pz-bar-fill { display: block; height: 100%; width: var(--w, 0%); border-radius: inherit; background: var(--lilac); transition: width 1.1s var(--ease); }
.pz-bitem.tone-in .pz-bar-fill { background: var(--good); }
.pz-bitem.tone-out .pz-bar-fill { background: var(--bad); }
.pz-bitem.tone-total .pz-bar-fill { background: var(--button); }
.pz-bitem.is-lit .pz-bar-track { box-shadow: 0 0 0 2px var(--button); }
.pz-counter { text-align: center; }
.pz-counter-n { margin: 0; display: grid; font: 700 9em/1 var(--display); animation: pz-pop 0.6s var(--ease) both; }
.pz .num { direction: ltr; unicode-bidi: isolate; }
.pz-counter-n span:not(.num) { margin-top: 0.15em; color: var(--muted); font: 500 0.22em var(--body); }

@keyframes pz-rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes pz-drop { from { opacity: 0; transform: translateY(-18px) rotate(-3deg); } }
@keyframes pz-line { from { opacity: 0; transform: translateX(-10px); } }
@keyframes pz-pop { from { opacity: 0; transform: scale(0.85); } }
@keyframes pz-breathe { 50% { box-shadow: 0 0 0 8px rgba(255, 230, 108, 0.14); } }
@media (prefers-reduced-motion: reduce) {
  .pz *, .pz *::before { animation: none !important; transition: none !important; }
}
@media (max-width: 640px) {
  /* A phone: the scene across the whole stage. JJ is a badge beside the chapter's title, the captions a slim strip
     under the scene (never over its words), and the scene's type stays readable: its em never goes under --em-min
     (9px, so the smallest scene text is about 14px); a scene still too long scrolls inside itself (the player sets
     --fit no lower, and makes it focusable). The chrome is in px, so it doesn't grow with the stage. The home page's
     demo keeps a 4:5 stage; the week page's fills its tab (below). */
  .pz { width: min(100%, calc((var(--pz-h) - var(--bar-h) - 10px) * 4 / 5)); gap: 8px; }
  .pz-stage { --u: max(9px, 2.4cqw); aspect-ratio: 4 / 5; border-radius: 14px; }
  .pz-scene { --em-min: 9px; inset: 46px 0 58px; padding: 4px 12px; place-items: safe center; overflow-y: auto; overscroll-behavior: contain; }
  .pz-stage:has(.pz-example) .pz-scene { top: 86px; }
  .pz-jj { left: 8px; top: 6px; right: auto; bottom: auto; width: 30px; }
  .pz-where { top: 6px; left: 46px; height: 34px; max-width: calc(100% - 54px); gap: 8px; font-size: 14px; }
  .pz-where span { min-width: 22px; height: 22px; font-size: 12px; }
  .pz-example { top: 44px; left: 8px; right: 8px; padding: 4px 10px; border-radius: 10px; font-size: 12px; line-height: 1.3; text-align: start; }
  .pz-caption { left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 6px 12px; background: rgba(8, 0, 36, 0.9); border-top: 1px solid var(--line); }
  .pz-caption span { padding: 0; background: none; font: 500 15px/1.35 var(--body); }
  .pz-paper { width: 100%; padding: 1.2em 1.4em; }
  /* The cover scrolls if it must. */
  .pz-cover { gap: 12px; padding: 16px; place-content: safe center; overflow-y: auto; }
  .pz-cover h3 { font-size: calc(var(--u) * 3.6); }
  .pz-ask, .pz-wait { left: 8px; right: 8px; bottom: 8px; max-height: calc(100% - 52px); }
  .pz-wait { flex-direction: column; align-items: stretch; }
  .pz-wait .pz-wait-demo { max-width: none; text-align: start; }
  .pz-bar { gap: 4px; }
  .pz-btn { min-width: 40px; height: 40px; padding: 0 8px; }
  .pz-track { margin: 0 2px; }
  /* The week page: next to no gutter, and a stage as tall as the room between the week's bar and the controls (the
     small viewport's height, so it never changes size as a phone's address bar comes and goes, or between slides). */
  .wk[data-tab="lesson"] .wk-body { padding: 6px 6px 8px; }
  .wk .pz { --pz-h: calc(100svh - var(--wk-top) - 14px - var(--practice-h, 0px) - var(--banner-room, 0px)); width: 100%; }
  .wk .pz-stage { aspect-ratio: auto; height: max(340px, calc(var(--pz-h) - var(--bar-h) - 8px)); }
}

/* The week's lessons: a "1/3" button in the player's bar opens their list, a native popover anchored above it (centered
   where the browser can't anchor). */
.pz-lessons { anchor-name: --pz-lessons; font-variant-numeric: tabular-nums; }
.pz-lessons-pop { position-anchor: --pz-lessons; position-area: top span-right; inset: auto; margin: 0 0 8px; padding: 8px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--raised); color: var(--text); box-shadow: 0 18px 44px rgba(3, 0, 18, 0.55); }
@supports not (position-area: top) { .pz-lessons-pop { inset: 0; margin: auto; } }
.lessons ol { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.lessons a { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; align-items: center; min-width: 260px; max-width: 360px; padding: 6px 12px 6px 6px; border-radius: 10px; color: var(--muted); text-decoration: none; }
.lessons a:hover { color: var(--text); background: var(--card); }
.lessons a[aria-current="true"] { color: var(--text); background: var(--card); box-shadow: inset 0 0 0 1px var(--button); }
.lessons a:focus-visible { outline: 3px solid var(--button); outline-offset: 1px; }
.lessons-n { grid-row: span 2; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line-strong); font: 600 12px var(--display); }
.lessons a.is-done .lessons-n { background: rgba(134, 227, 184, 0.16); border-color: transparent; color: var(--good); }
.lessons-n svg { width: 15px; height: 15px; }
.lessons-t { font: 600 14px/1.25 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lessons-m { font-size: 12px; color: var(--dim); white-space: nowrap; }

/* ---- Wrap-up: the quiz (answered here for a class), the turn-in, and a Lab's read-only preview */
.quiz-form ol { display: grid; gap: 18px; margin: 0 0 16px; padding-inline-start: 22px; }
.quiz-form fieldset { display: grid; gap: 8px; border: 0; margin: 0; padding: 0; }
.quiz-form legend, .quiz-form label:not(.option) { display: block; margin-bottom: 8px; font-weight: 600; }
.quiz-form input:not([type="radio"]), .quiz-form textarea, .turnin textarea, .work select, .work-week select { min-height: 44px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, 0.05); font-size: 16px; }
.quiz-form textarea, .turnin textarea { width: 100%; resize: vertical; }
.quiz-form .answer-row { align-items: center; }
.quiz-form input:focus-visible, .quiz-form textarea:focus-visible, .turnin textarea:focus-visible, .work select:focus-visible, .work-week select:focus-visible { outline: 3px solid var(--button); outline-offset: 1px; }
.quiz-score { font: 600 20px var(--display); outline: none; margin-bottom: 12px; }
.quiz-right strong { color: var(--good); }
.quiz-wrong strong { color: var(--warn); }
.quiz-choices { margin: 0; padding-inline-start: 22px; color: var(--muted); list-style: upper-alpha; }
.quiz-choices .is-right { color: var(--good); font-weight: 600; }
.self-check + .btn { margin-top: 16px; }
.turnin { display: grid; gap: 8px; margin-top: 14px; }
.turnin label { font-weight: 600; }
.turnin .actions { display: flex; align-items: center; gap: 12px; }
.turnin-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.lab-preview .decision ul { margin: 6px 0 0; padding-inline-start: 22px; display: grid; gap: 4px; color: var(--muted); }
.work-week { display: inline-flex; align-items: center; gap: 10px; font: 600 15px var(--display); }
.work details summary { cursor: pointer; color: var(--lilac); font: 600 14px var(--display); }
.work details .turnin-text { margin-top: 8px; max-width: 60ch; }
.work-answers { display: grid; gap: 8px; margin: 8px 0 0; padding-inline-start: 20px; text-align: start; max-width: 50ch; }
.work td.num details { margin-top: 6px; }
.quiz-results { outline: none; }
.work-answers .quiz-right { color: var(--good); }
.work-answers .quiz-wrong { color: var(--warn); }


/* ---- Present mode: a student following the teacher's lesson, the projector, and the teacher's presenter view. */
.live-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px rgba(134, 227, 184, 0.18); vertical-align: middle; }
.live-follow { display: grid; gap: 12px; }
.live-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 14px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line-strong); }
.live-now { margin: 0; font-weight: 600; }
.seg-choice { display: inline-flex; flex-wrap: wrap; gap: 6px; padding: 4px; border-radius: 12px; background: var(--night); border: 1px solid var(--line); }
.seg-choice button { min-height: 48px; padding: 6px 12px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); font: inherit; text-align: start; cursor: pointer; }
.seg-choice button span { display: block; font-size: 13px; color: var(--dim); }
.seg-choice button.is-on { background: var(--raised); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.seg-choice button.is-on strong { color: var(--button); }
.live-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.live-step { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 12px 0; padding: 12px 14px; border-radius: 12px; background: rgba(255, 230, 108, 0.08); border: 1px solid rgba(255, 230, 108, 0.4); }
.live-step p { margin: 0; }
.pz-option.is-picked { border-color: var(--button); box-shadow: inset 0 0 0 1px var(--button); }
.pz-option { position: relative; overflow: hidden; }
.pz-option > * { position: relative; }
.pz-count { margin-inline-start: auto; font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; }
.pz-bar-fill { position: absolute !important; inset: 0 auto 0 0; width: var(--w, 0%); background: rgba(170, 114, 224, 0.28); transition: width 0.6s var(--ease); }
.pz-option.is-right .pz-bar-fill { background: rgba(134, 227, 184, 0.3); }
.pz-class-ask .pz-option { cursor: default; }
.pz-class-ask .pz-option:hover { transform: none; }
.pz-live-count { margin: 0 0 8px; color: var(--good); font-weight: 600; font-variant-numeric: tabular-nums; }
.pz-class-number { display: grid; gap: 4px; font: 600 calc(var(--u) * 2.2)/1.3 var(--display); }
.pz-class-number p { margin: 0; }
.pz-class-number .good { color: var(--good); font-size: calc(var(--u) * 3.2); }
.class-actions { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: flex-start; }
.lessons-form.is-ask { border-color: rgba(255, 230, 108, 0.45); }
.seen-lessons { display: grid; gap: 4px; padding: 0; margin: 0 0 16px; list-style: none; }

/* The projector window: the lesson only, full screen, no site chrome; readable from the back row. */
body[data-screen="projector"] .site-header, body[data-screen="projector"] .site-footer, body[data-screen="projector"] .skip { display: none; }
body[data-screen="projector"] .portal-page { max-width: none; padding: 0; }
.projector { position: relative; display: grid; gap: 12px; min-height: 100dvh; padding: 16px; align-content: start; font-size: 20px; }
.projector.is-embedded { min-height: 0; padding: 0; }
.projector .pz { font-size: 32px; }
.projector-here { position: absolute; inset-inline-end: 24px; top: 16px; z-index: 2; margin: 0; padding: 6px 12px; border-radius: 999px; background: rgba(8, 0, 36, 0.8); border: 1px solid var(--line-strong); font-weight: 600; font-variant-numeric: tabular-nums; }
.projector-join { margin: 0; color: var(--muted); }
.projector-lab, .projector-card { display: grid; gap: 16px; padding: 48px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line-strong); }
.projector-lab h2 { font: 700 clamp(32px, 4vw, 56px)/1.15 var(--display); margin: 0; text-wrap: balance; }
.projector-count { margin: 0; font: 700 clamp(28px, 3vw, 44px)/1 var(--display); color: var(--good); font-variant-numeric: tabular-nums; }
.projector-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.projector-card .life-card { padding: 32px; border-radius: var(--radius); background: linear-gradient(160deg, #2c1a52, #1b1238); border: 1px solid var(--line-strong); }
.projector-card h2 { font: 700 clamp(32px, 3.6vw, 52px)/1.1 var(--display); margin: 8px 0; }
.projector-tally { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; font-size: 24px; }
.projector-tally li { position: relative; display: flex; gap: 12px; padding: 14px 18px; border-radius: 12px; background: var(--raised); border: 1px solid var(--line); overflow: hidden; }
.projector-tally li > * { position: relative; }
.present-msg { display: grid; gap: 12px; justify-items: start; padding: 48px 16px; }
.present-here { display: grid; gap: 8px; }
.present-back { justify-self: start; }

/* The presenter view: the teacher's laptop. */
.presenter-view { display: grid; gap: 16px; padding-block: 16px 48px; }
.pv-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.pv-head h1 { margin: 0; font-size: clamp(24px, 3vw, 32px); }
.pv-here { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--good); }
.pv-head .switch { margin-inline-start: auto; }
.pv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; align-items: start; }
.pv-grid .panel { display: grid; gap: 8px; }
.pv-grid h2 { margin: 0; font-size: 18px; }
.pv-notes ul, .pv-week ul, .pv-key ul, .pv-cards { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pv-big { margin: 0; font: 700 28px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.pv-help { margin: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(255, 194, 122, 0.55); }
.pv-key .good { color: var(--good); font-weight: 600; }
.pv-controls .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pv-end { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px; border-radius: 12px; background: var(--raised); }
.pv-end p { flex-basis: 100%; margin: 0; }
.pv-start .actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 720px) {
  .projector-card { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .pz-bar-fill { transition: none; }
}

/* Present mode, Game Day and the practice phone beside the Lab: the step on the left, the phone on the right. */
.projector-stage { display: grid; gap: 24px; align-items: start; }
.projector-stage.has-phone { grid-template-columns: minmax(0, 1fr) auto; }
.projector-phone { margin-top: 40px; height: min(78dvh, 852px); aspect-ratio: 393 / 852; max-width: 100%; border-radius: 44px; padding: 12px; background: #000; border: 1px solid var(--line-strong); }
.projector-phone iframe { width: 100%; height: 100%; border: 0; border-radius: 34px; background: var(--night); }
.check-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.check-tiles li { display: grid; gap: 4px; padding: 16px; border-radius: 12px; background: var(--raised); border: 1px solid var(--line); }
.check-tiles b { font: 700 1.6em/1.1 var(--display); color: var(--button); font-variant-numeric: tabular-nums; }
.pv-check .check-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pv-check .check-tiles b { font-size: 1.3em; }
@media (max-width: 900px) { .projector-stage.has-phone { grid-template-columns: minmax(0, 1fr); } }
