/*
 * Bali portal in v2's look (drafted 2026-10-12). v2's teacher portal (design_handoff_bali_2: Pass 2
 * components, Pass 4 web chrome, the Teacher Portal home) on the Bali Design System's tokens, with
 * v3's rulings kept: text-tertiary is stone-600, a text field's edge is border-input (stone-500),
 * a refusal is said in the primary ink (never red), and v3's states and words (Not here, Silent,
 * Left, Unknown; no passes).
 */
:root {
  --green-50: #F0F7F3; --green-100: #DCEDE3; --green-200: #BCDCCA; --green-300: #92C3A9;
  --green-400: #62A483; --green-500: #3F8765; --green-600: #2C6F51; --green-700: #245A43;
  --green-800: #1E4936; --green-900: #18392B;
  --stone-50: #F7F5F2; --stone-100: #EFECE7; --stone-200: #E3DFD8; --stone-300: #D2CCC2;
  --stone-400: #ABA59A; --stone-500: #8A847A; --stone-600: #6B665D; --stone-700: #524E47;
  --orange-50: #FBF4EC; --orange-100: #F7E6D2; --orange-300: #E5AF6F; --orange-400: #DB9347;
  --orange-700: #8C4F1E; --orange-800: #6F3F1B;
  --red-100: #FAE3E0; --red-300: #E89B92; --red-600: #A93D31; --red-700: #8C342B;

  --surface-page: var(--stone-50);
  --surface-card: #FFFFFF;
  --surface-sunken: var(--stone-100);
  --border-default: var(--stone-200);
  --border-strong: var(--stone-300);
  --border-input: var(--stone-500);
  --text-primary: #211F1B;
  --text-secondary: #5B564E;
  --text-tertiary: var(--stone-600);
  --text-brand: var(--green-700);
  --action-primary-bg: var(--green-700);
  --action-primary-bg-hov: var(--green-800);
  --action-primary-fg: #FFFFFF;

  --state-focused-fg: var(--green-700);   --state-focused-bg: var(--green-100);
  --state-notjoined-fg: var(--stone-700); --state-notjoined-bg: var(--stone-100);
  --state-emergency-fg: var(--orange-800); --state-emergency-bg: var(--orange-100);
  --state-revoked-fg: var(--red-700);     --state-revoked-bg: var(--red-100);
  --state-ended-fg: var(--stone-600);     --state-ended-bg: var(--stone-100);

  --arc-track: var(--stone-200);
  --arc-fill: var(--green-600);
  --focus-ring: 0 0 0 2px var(--surface-page), 0 0 0 4px var(--green-600);
  --shadow-1: 0 1px 2px rgba(33, 28, 21, 0.06);
  --shadow-2: 0 2px 8px rgba(33, 28, 21, 0.08), 0 1px 2px rgba(33, 28, 21, 0.05);
  --shadow-3: 0 8px 24px rgba(33, 28, 21, 0.12), 0 2px 6px rgba(33, 28, 21, 0.06);
  --softpulse: rgba(219, 147, 71, 0.35);

  --font-ui: "Instrument Sans", -apple-system, "SF Pro Text", "Segoe UI", sans-serif;
  --font-num: ui-rounded, "SF Pro Rounded", "Instrument Sans", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
}

/* ---- base ---- */
.app {
  font-family: var(--font-ui); color: var(--text-primary); background: var(--surface-page);
  font-size: 15px; line-height: 22px; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
}
.app *, .app *::before, .app *::after { box-sizing: border-box; }
.app h1, .app h2, .app h3, .app h4, .app p, .app ul, .app ol, .app figure, .app fieldset, .app legend, .app dl, .app dd { margin: 0; padding: 0; }
.app ul, .app ol { list-style: none; }
.app fieldset { border: 0; min-width: 0; }
.app a { color: var(--text-brand); }
.app :focus-visible { outline: none; box-shadow: var(--focus-ring); }
.ic { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ink-2 { color: var(--text-secondary); }
.ink-3 { color: var(--text-tertiary); }
.caption { font-size: 13px; line-height: 18px; }
.semibold { font-weight: 600; }

/* ---- the app shell: v2's 216 px side menu; on a phone it stacks above the page ---- */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; position: relative; }
.sidenav {
  flex: 1 1 216px; background: var(--surface-card); border-right: 1px solid var(--border-default);
  padding: 32px 12px 14px; display: flex; flex-direction: column; gap: 2px;
}
.brand { display: flex; align-items: center; gap: 9px; padding: 4px 10px 18px; font-size: 16px; line-height: 22px; font-weight: 600; color: var(--text-primary); text-decoration: none; border-radius: 8px; }
.navlink { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--text-secondary); text-decoration: none; }
.app .navlink { color: var(--text-secondary); }
.navlink .ic { width: 17px; height: 17px; }
.navlink:hover { background: var(--surface-sunken); }
.app .navlink[aria-current="page"] { background: var(--surface-sunken); color: var(--text-primary); font-weight: 600; }
.nav-gap { flex: 1; min-height: 24px; }
.navfoot { display: flex; align-items: center; gap: 9px; margin-top: 8px; padding: 12px 6px 0 10px; border-top: 1px solid var(--border-default); }
.ava { width: 28px; height: 28px; border-radius: 50%; background: var(--green-200); color: var(--green-800); display: grid; place-items: center; font-size: 11px; line-height: 1; font-weight: 600; flex: none; }
.who { min-width: 0; font-size: 13px; line-height: 17px; font-weight: 600; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; border: 0; background: none; color: var(--text-tertiary); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--surface-sunken); color: var(--text-primary); }
.navfoot .icon-btn { margin-left: auto; }

.main { flex: 999 1 560px; min-width: 0; max-width: 1260px; padding: 30px 36px 56px; display: flex; flex-direction: column; gap: 22px; position: relative; }
.main.wide { max-width: none; }

/* ---- type ---- */
.greet h1 { font-size: 28px; line-height: 34px; font-weight: 600; letter-spacing: -0.015em; }
.meta { font-size: 13.5px; line-height: 19px; color: var(--text-secondary); }
.greet .meta { margin-top: 3px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.page-h1 { font-size: 26px; line-height: 32px; font-weight: 600; letter-spacing: -0.01em; }
.page-head .meta { margin-top: 2px; }
.framing { margin-top: 4px; font-size: 15px; line-height: 22px; font-style: italic; color: var(--text-secondary); }
.h-card { font-size: 18px; line-height: 24px; font-weight: 600; }
.wlabel { display: flex; align-items: center; gap: 8px; font-size: 11.5px; line-height: 15px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-tertiary); }
.wlabel .ic { width: 14px; height: 14px; }
.kicker { font-size: 11.5px; line-height: 15px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-brand); }
.kicker.quiet { color: var(--text-tertiary); }
.big { font-family: var(--font-num); font-size: 28px; line-height: 32px; font-weight: 600; }

/* ---- layout ---- */
.cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.col-main { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.col-rail { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* ---- cards ---- */
.wcard { background: var(--surface-card); border: 1px solid var(--border-default); border-radius: 14px; padding: 20px; box-shadow: var(--shadow-1); }
.wcard > .wlabel { margin-bottom: 14px; }
.livecard { border-color: var(--green-200); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.lc-head { display: flex; align-items: center; gap: 14px; }
.lc-title { flex: 1; min-width: 0; }
.lc-title h2 { font-size: 18px; line-height: 24px; font-weight: 600; }
.lc-meta { margin-top: 1px; font-size: 12.5px; line-height: 17px; color: var(--text-secondary); }
.count { flex: none; text-align: right; }
.count .t { font-family: var(--font-num); font-size: 30px; line-height: 34px; font-weight: 600; }
.count .sub { font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.note { font-size: 12.5px; line-height: 17px; color: var(--text-tertiary); }
.row .note { margin-left: auto; }
.schedrow { display: flex; align-items: center; gap: 14px; padding: 15px 18px; background: var(--surface-card); border: 1px solid var(--border-default); border-radius: 14px; }
.schedrow .when { width: 78px; flex: none; font-family: var(--font-num); font-size: 13px; line-height: 17px; font-weight: 600; color: var(--text-secondary); }
.schedrow .what { flex: 1; min-width: 0; }
.schedrow .what b { display: block; font-size: 15px; line-height: 20px; font-weight: 600; }
.schedrow .what span { font-size: 12.5px; line-height: 17px; color: var(--text-tertiary); }
.schedrow.is-live { border-color: var(--green-200); }
.schedrow.is-live .when { color: var(--green-700); }
.quiet { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--text-brand); text-decoration: none; border-radius: 6px; }
.quiet:hover { text-decoration: underline; text-underline-offset: 2px; }
.empty { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 32px; }
.empty h2 { font-size: 20px; line-height: 26px; font-weight: 600; }
.empty p { max-width: 36rem; color: var(--text-secondary); }
.empty .btn { margin-top: 6px; }
.list-hair > li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; padding: 11px 0; border-top: 1px solid var(--border-default); }
.list-hair > li:last-child { border-bottom: 1px solid var(--border-default); }
.mono { font-family: var(--font-mono); font-weight: 500; }

/* ---- buttons: v2's 10 px corners ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-size: 15px; line-height: 20px; font-weight: 600; white-space: nowrap; text-decoration: none; cursor: pointer; transition: background-color 150ms var(--ease-standard); }
.btn .ic { width: 16px; height: 16px; }
.app .btn-primary { background: var(--action-primary-bg); color: var(--action-primary-fg); }
.btn-primary:hover { background: var(--action-primary-bg-hov); }
.app .btn-secondary { background: var(--surface-card); color: var(--text-primary); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-sunken); }
.app .btn-ghost { background: transparent; color: var(--text-brand); }
.btn-ghost:hover { background: var(--surface-sunken); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13.5px; line-height: 18px; }
.btn-lg { height: 48px; font-size: 16px; }
.btn-block { width: 100%; }
.btn[aria-pressed="true"] { background: var(--surface-sunken); border-color: var(--text-primary); }
.btn[aria-disabled="true"] { opacity: 0.55; cursor: default; }
.btn.apart { margin-left: auto; }

/* ---- state chips: color + icon + label, never color alone ---- */
.chip { display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid transparent; border-radius: 999px; white-space: nowrap; font-weight: 600; }
.chip .lbl { font-weight: 500; }
.chip-mini { padding: 3px 10px; gap: 6px; font-size: 13px; line-height: 18px; }
.chip-mini .ic { width: 13px; height: 13px; }
.chip.is-focused { color: var(--state-focused-fg); background: var(--state-focused-bg); }
.chip.is-notjoined { color: var(--state-notjoined-fg); background: var(--state-notjoined-bg); }
.chip.is-emergency { color: var(--state-emergency-fg); background: var(--state-emergency-bg); }
.chip.is-revoked { color: var(--state-revoked-fg); background: var(--state-revoked-bg); }
.chip.is-ended { color: var(--state-ended-fg); background: var(--state-ended-bg); }
.chip.is-silent { color: var(--state-ended-fg); background: var(--state-ended-bg); border-style: dashed; border-color: var(--border-strong); }
.chip.is-unknown { color: var(--text-primary); background: transparent; border-style: dashed; border-color: var(--border-strong); }
/* bali-softpulse: an unlock's chip swells and fades twice, then rests */
@keyframes softpulse { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 50% { box-shadow: 0 0 0 6px var(--softpulse); } }
.pulse { animation: softpulse 1.2s var(--ease-standard) 2; }
.pulse-frame { box-shadow: 0 0 0 6px var(--softpulse); }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } .btn { transition: none; } }

.summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* ---- the class header: the ring, the name, the countdown, the controls ---- */
.class-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; }
.class-head .title { min-width: 0; }
.class-head h1 { font-size: 26px; line-height: 32px; font-weight: 600; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.class-head .meta { margin-top: 2px; }
.countdown { display: flex; flex-direction: column; padding-left: 18px; border-left: 1px solid var(--border-default); }
.countdown .t { font-family: var(--font-num); font-size: 28px; line-height: 32px; font-weight: 600; }
.countdown .sub { font-size: 12.5px; line-height: 17px; color: var(--text-secondary); }
.class-head .actions { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.grid-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }

/* ---- the join code ---- */
.code { display: inline-block; font-family: var(--font-mono); font-weight: 600; letter-spacing: 0.16em; color: var(--text-primary); background: var(--surface-sunken); border: 1px solid var(--border-default); border-radius: 10px; padding: 4px 10px 4px calc(10px + 0.16em); font-size: 17px; line-height: 26px; }
.code-card { padding: 16px 26px 16px calc(26px + 0.16em); border-radius: 14px; font-size: 40px; line-height: 48px; }
.code-proj { padding: 8px 18px 8px calc(18px + 0.16em); border-radius: 12px; font-size: 34px; line-height: 44px; }
.codewell { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* ---- the length picker: v2's segmented control; the pick also carries a check ---- */
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-sunken); }
.seg label { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 8px; font-size: 14px; line-height: 18px; font-weight: 600; color: var(--text-secondary); cursor: pointer; }
.seg label.on { background: var(--surface-card); color: var(--text-primary); box-shadow: var(--shadow-1); }
.seg label .ic { width: 15px; height: 15px; }
.seg input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ---- fields ---- */
.field label, .flabel { display: block; font-weight: 500; }
.input { display: block; width: 100%; height: 40px; margin-top: 8px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-input); background: var(--surface-card); color: var(--text-primary); font: inherit; font-size: 16px; line-height: 24px; }
.input.mono { font-family: var(--font-mono); font-weight: 500; }
textarea.input { height: auto; min-height: 88px; padding: 8px 12px; resize: vertical; }
.input[aria-invalid="true"] { border-color: var(--text-primary); }
.help { margin-top: 8px; font-size: 13px; line-height: 18px; color: var(--text-tertiary); }
.refusal { margin-top: 8px; color: var(--text-primary); }

/* ---- tables: v2's wtable ---- */
.table-box { overflow-x: auto; border: 1px solid var(--border-default); border-radius: 12px; background: var(--surface-card); }
.wtable { width: 100%; border-collapse: collapse; }
.wtable th { padding: 11px 16px; background: var(--surface-sunken); border-bottom: 1px solid var(--border-default); text-align: left; font-size: 11.5px; line-height: 15px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-tertiary); white-space: nowrap; }
.wtable td { padding: 12px 16px; border-bottom: 1px solid var(--border-default); font-size: 14px; line-height: 19px; vertical-align: middle; }
.wtable tr:last-child td { border-bottom: 0; }
.wtable td .sub { display: block; font-size: 12px; line-height: 16px; color: var(--text-tertiary); }
.wtable .num { text-align: right; white-space: nowrap; }
.wtable th.num { text-align: right; }
.wtable tr.is-open td { background: var(--green-50); }
.wtable a { color: var(--text-primary); font-weight: 600; text-decoration: none; }
.wtable a:hover { text-decoration: underline; }

/* ---- filter pills: the pick is filled, never told by color alone ---- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters a { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface-card); color: var(--text-secondary); font-size: 13.5px; line-height: 18px; font-weight: 500; text-decoration: none; }
.app .filters a[aria-current="page"] { background: var(--green-700); border-color: var(--green-700); color: #FFFFFF; font-weight: 600; }

/* ---- bars ---- */
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 116px minmax(0, 1fr) 70px; gap: 12px; align-items: center; font-size: 13.5px; line-height: 18px; }
.bar-row .v { text-align: right; color: var(--text-secondary); }
.track { height: 10px; border-radius: 999px; background: var(--surface-sunken); overflow: hidden; }
.fill { height: 100%; border-radius: 999px; background: var(--green-700); }

/* ---- the event timeline ---- */
.tl { display: flex; flex-direction: column; }
.tl .ev { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding-bottom: 18px; }
.tl .ev:last-child { padding-bottom: 0; }
.tl .ev::before { content: ""; position: absolute; left: 12.5px; top: 26px; bottom: 2px; width: 1px; background: var(--border-default); }
.tl .ev:last-child::before { display: none; }
.tl .dot { position: relative; z-index: 1; width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center; background: var(--surface-sunken); color: var(--text-secondary); }
.tl .dot .ic { width: 13px; height: 13px; }
/* the timeline stays neutral: the icon and the words say what happened, no color behind them */
.tl .what { padding-top: 3px; font-size: 14px; line-height: 20px; }
.tl .what small { display: block; font-size: 12.5px; line-height: 17px; color: var(--text-secondary); }
.tl .when { padding-top: 4px; font-size: 12.5px; line-height: 17px; font-weight: 500; color: var(--text-tertiary); }

/* ---- the unlock toast: sticky until closed; never on the projector ---- */
.toast { position: absolute; top: 18px; right: 18px; z-index: 6; width: 380px; max-width: calc(100% - 36px); display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px 10px 14px 16px; background: var(--surface-card); border: 1px solid var(--border-default); border-top: 3px solid var(--orange-400); border-radius: 14px; box-shadow: var(--shadow-3); }
.toast .t-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--state-emergency-bg); color: var(--state-emergency-fg); }
.toast .t-icon .ic { width: 18px; height: 18px; }
.toast .t-title { font-size: 15px; line-height: 20px; font-weight: 600; }
.toast .t-sub { margin-top: 2px; font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.app .toast .t-act { display: inline-block; margin-top: 8px; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--orange-700); text-decoration: none; border-radius: 6px; }
.toast .icon-btn { width: 32px; height: 32px; margin-top: -6px; }

/* ---- the side panel: one student, or asking a question, or picking slides ---- */
.panel { position: absolute; top: 0; right: 0; bottom: 0; z-index: 5; width: 372px; max-width: 100%; display: flex; flex-direction: column; background: var(--surface-card); border-left: 1px solid var(--border-default); box-shadow: var(--shadow-3); overflow-y: auto; }
.panel-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 14px 16px 20px; border-bottom: 1px solid var(--border-default); }
.panel-head h2 { font-size: 18px; line-height: 24px; font-weight: 600; }
.panel-head .grow { flex: 1; min-width: 0; }
.panel-body { padding: 18px 20px 24px; display: flex; flex-direction: column; gap: 22px; }
.panel h3 { margin-bottom: 12px; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-tertiary); }

/* ---- the live feed's state, over the page ---- */
.reconnect { position: absolute; top: 14px; left: 50%; z-index: 6; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface-card); box-shadow: var(--shadow-2); font-size: 13px; line-height: 18px; font-weight: 500; color: var(--text-secondary); white-space: nowrap; }
.reconnect .pip { width: 7px; height: 7px; border-radius: 50%; background: var(--stone-500); }

/* ---- a dialog over the page ---- */
.scrim { position: absolute; inset: 0; z-index: 9; display: flex; align-items: flex-start; justify-content: center; padding: 120px 24px 24px; background: rgba(33, 28, 21, 0.32); }
.dialog { width: 460px; max-width: 100%; display: flex; flex-direction: column; gap: 18px; padding: 24px; background: var(--surface-card); border-radius: 14px; box-shadow: var(--shadow-3); }
.dialog h2 { font-size: 19px; line-height: 25px; font-weight: 600; }
.dialog .actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

/* ---- said lines ---- */
.notice { padding: 12px 16px; border-radius: 10px; border: 1px solid var(--border-default); background: var(--surface-sunken); color: var(--text-primary); }
.said { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.sheet-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 48px; align-items: start; }
.sheet-item { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sheet-item > .wlabel { margin-bottom: 2px; }
.sheet-group { grid-column: 1 / -1; padding-top: 22px; border-top: 1px solid var(--border-default); font-size: 18px; line-height: 24px; font-weight: 600; }

/* ---- Live lesson: questions and slides ---- */
.lesson { display: flex; flex-direction: column; gap: 16px; }
.lesson-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.lesson-title { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.prompt { font-size: 18px; line-height: 24px; font-weight: 600; text-wrap: pretty; }
.results { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px 40px; }
.results .opts-col { flex: 999 1 440px; min-width: 0; }
.answered { flex: 1 1 160px; display: flex; flex-direction: column; gap: 4px; padding-left: 24px; border-left: 1px solid var(--border-default); }
.answered .line { display: flex; align-items: baseline; gap: 8px; }
.opts { margin-top: 14px; display: flex; flex-direction: column; gap: 14px; }
.opt { display: grid; grid-template-columns: 28px minmax(0, 1fr) 3rem; align-items: center; column-gap: 12px; row-gap: 6px; }
.opt .txt { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-width: 0; }
.opt .n { text-align: right; font-size: 14px; line-height: 20px; font-weight: 500; }
.opt .qbar { grid-column: 2; height: 8px; border-radius: 999px; background: var(--stone-500); }
.opt.right .qbar { background: var(--green-600); }
.letter { width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center; flex: none; background: var(--surface-sunken); color: var(--text-primary); font-size: 14px; line-height: 20px; font-weight: 600; }
.right .letter { background: var(--green-100); color: var(--green-700); }
.tag-right { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; line-height: 15px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-brand); }
.tag-right .ic { width: 14px; height: 14px; }
.guard { margin-top: 8px; color: var(--text-secondary); }
.pick-list > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border-default); }
.pick-list > li:last-child { border-bottom: 1px solid var(--border-default); }
.pick-list .q { font-weight: 600; overflow-wrap: anywhere; }
.answer-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto 36px; gap: 10px; align-items: center; }
.answer-row .input { margin-top: 0; }
.answer-row .refusal { grid-column: 2 / -1; margin-top: 0; }
.link-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--text-brand); cursor: pointer; }
.link-btn .ic { width: 16px; height: 16px; }
.mini-opts { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.mini-opts li { display: inline-flex; align-items: center; gap: 8px; }
.mini-opts .letter { width: 24px; height: 24px; font-size: 13px; line-height: 18px; }
.qcard { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 20px; align-items: start; }
.slide { margin: 0; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 12px; border: 1px solid var(--border-default); background: #FFFFFF; box-shadow: var(--shadow-1); }
.slide svg { display: block; width: 100%; height: 100%; }
.slide-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px 28px; }
.slide-row .slide { flex: 0 1 420px; }
.slide-row .slide-side { flex: 1 1 260px; display: flex; flex-direction: column; gap: 12px; }
.deck-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; padding: 14px 16px; background: var(--surface-card); border: 1px solid var(--border-default); border-radius: 14px; }
.deck-row .file { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-sunken); color: var(--text-secondary); }
.deck-row .file .ic { width: 18px; height: 18px; }
.deck-row .name { font-weight: 600; overflow-wrap: anywhere; }
.deck-row > .said, .deck-row > .deck-said { grid-column: 2 / -1; }
.progress { margin-top: 6px; width: 15rem; max-width: 100%; height: 4px; border-radius: 999px; background: var(--surface-sunken); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: 999px; background: var(--green-700); }

/* ---- the projector (Present): no side menu, one size up, read from the back of the room ---- */
.proj { min-height: 100vh; padding: 36px 48px 40px; display: flex; flex-direction: column; gap: 22px; }
.proj .class-head h1 { font-size: 36px; line-height: 42px; }
.proj .countdown .t { font-size: 44px; line-height: 48px; }
.proj .countdown .sub { font-size: 16px; line-height: 22px; }
.proj .summary .chip { padding: 8px 15px; gap: 9px; font-size: 16px; line-height: 22px; }
.proj .summary .chip .ic { width: 18px; height: 18px; }
.p-card { display: flex; flex-direction: column; gap: 28px; padding: 36px 44px; background: var(--surface-card); border: 1px solid var(--border-default); border-radius: 20px; box-shadow: var(--shadow-1); }
.p-prompt { margin-top: 10px; max-width: 64rem; font-size: 34px; line-height: 40px; font-weight: 600; letter-spacing: -0.01em; }
.p-count { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.p-count .t { font-family: var(--font-num); font-size: 44px; line-height: 48px; font-weight: 600; }
.p-count .of { font-size: 20px; line-height: 28px; color: var(--text-secondary); }
.p-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.p-opt { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; column-gap: 20px; row-gap: 14px; min-height: 108px; padding: 22px 24px; border: 1px solid var(--border-default); border-radius: 14px; background: var(--surface-card); }
.p-opt .letter { width: 48px; height: 48px; font-size: 24px; line-height: 30px; }
.p-opt .t { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; font-size: 24px; line-height: 30px; font-weight: 600; }
.p-opt .n { font-family: var(--font-num); font-size: 28px; line-height: 32px; font-weight: 600; }
.p-opt .qbar { grid-column: 2 / -1; height: 12px; border-radius: 999px; background: var(--stone-500); }
.p-opt.right { border: 2px solid var(--green-600); background: var(--green-50); padding: 21px 23px; }
.p-opt.right .qbar { background: var(--green-600); }
.p-opt .tag-right { font-size: 14px; line-height: 20px; }
.p-foot { font-size: 20px; line-height: 28px; color: var(--text-secondary); }
.p-slide { margin: 0 auto; height: 760px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 14px; border: 1px solid var(--border-default); background: #FFFFFF; box-shadow: var(--shadow-1); }
.p-slide svg { display: block; width: 100%; height: 100%; }

/* ---- the entry pages: v2's quiet, brand-forward stage ---- */
.stage { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px 72px; }
.stage-stack { width: 100%; max-width: 400px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.stage-name { margin-top: 10px; font-size: 24px; line-height: 30px; font-weight: 600; }
.stage-tag { font-size: 14px; line-height: 20px; color: var(--text-secondary); }
.stage-card { width: 100%; margin-top: 22px; display: flex; flex-direction: column; gap: 18px; padding: 24px; background: var(--surface-card); border: 1px solid var(--border-default); border-radius: 14px; box-shadow: var(--shadow-1); }
.stage-card h1 { font-size: 20px; line-height: 26px; font-weight: 600; }
.stage-foot { width: 100%; padding: 14px 4px 0; font-size: 13.5px; line-height: 19px; color: var(--text-secondary); text-align: center; }
.stage-links { width: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; padding-top: 10px; font-size: 13.5px; line-height: 19px; }
.stage-links a { font-weight: 500; text-underline-offset: 2px; }

/* ---- students on the web: no side menu (a student has only their classes) ---- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; padding: 0 32px; background: var(--surface-card); border-bottom: 1px solid var(--border-default); }
.topbar .brand { padding: 0; }
.s-main { max-width: 1260px; margin: 0 auto; padding: 30px 36px 56px; display: flex; flex-direction: column; gap: 22px; }
.s-lesson { display: grid; grid-template-columns: minmax(0, 1fr) 25rem; gap: 24px; align-items: start; }
.s-lesson > .s-card { grid-column: 2; grid-row: 1; }
.s-card { display: flex; flex-direction: column; gap: 14px; padding: 22px; background: var(--surface-card); border: 1px solid var(--border-default); border-radius: 16px; box-shadow: var(--shadow-1); }
.s-opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface-card); color: var(--text-primary); font: inherit; font-size: 17px; line-height: 26px; text-align: left; cursor: pointer; }
.s-opt:hover { background: var(--surface-sunken); }
.s-opt[aria-pressed="true"] { background: var(--green-700); border-color: var(--green-700); color: #FFFFFF; font-weight: 600; }
.s-opt[aria-pressed="true"] .letter { background: #FFFFFF; color: var(--green-700); }
.s-opt .grow, .s-done .grow { flex: 1; min-width: 0; }
.s-done { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--border-default); background: var(--surface-card); color: var(--text-secondary); font-size: 17px; line-height: 26px; }
.s-done.mine { background: var(--surface-sunken); border-color: var(--border-strong); color: var(--text-primary); }
.s-done.right { background: var(--green-50); border: 2px solid var(--green-600); padding: 11px 15px; color: var(--text-primary); }
.s-mark { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; line-height: 15px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--state-notjoined-fg); }
.s-mark.right { color: var(--text-brand); }
.s-privacy { display: flex; align-items: flex-start; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border-default); color: var(--text-tertiary); }
.s-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.s-phone { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.s-remind { display: flex; align-items: flex-start; gap: 12px; }
.s-remind .ic { width: 20px; height: 20px; margin-top: 1px; }

/* ---- pieces the class page, the classes and the recap share ---- */
.roster { columns: 3; column-gap: 32px; }
.roster li { padding: 6px 0; break-inside: avoid; }
.classcard { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 18px 20px; text-decoration: none; }
.app a.classcard { color: var(--text-primary); }
a.classcard:hover { border-color: var(--border-strong); }
.classcard .grow { flex: 1; min-width: 0; }
.classcard .name { font-size: 17px; line-height: 22px; font-weight: 600; overflow-wrap: anywhere; }
.classcard .sub { margin-top: 2px; font-size: 13px; line-height: 18px; color: var(--text-tertiary); }
.stats { display: flex; flex-wrap: wrap; gap: 16px 40px; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .k { font-size: 12.5px; line-height: 17px; color: var(--text-tertiary); }
.stat .v { font-family: var(--font-num); font-size: 24px; line-height: 30px; font-weight: 600; }
.axis { display: flex; justify-content: space-between; font-size: 12px; line-height: 16px; color: var(--text-tertiary); }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; line-height: 20px; font-weight: 600; text-decoration: none; border-radius: 6px; }
.back .ic { width: 16px; height: 16px; }

/* ---- the live grid: v2's tinted tiles, every one the same size and shape (the owner's pick, 2026-10-12) ---- */
.cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.cells > li { display: flex; min-width: 0; }
.cells .tx { display: flex; flex-direction: column; min-width: 0; }
.cells .nm, .cells .st, .cells .dt { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cells .nm { font-size: 15px; line-height: 20px; font-weight: 600; }
.cells .st { font-size: 13px; line-height: 18px; font-weight: 600; }
.cells .dt { font-size: 12.5px; line-height: 17px; font-weight: 500; min-height: 17px; }
.cells .st .ic { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; }
.cells button { width: 100%; font-family: inherit; text-align: left; cursor: pointer; }
.tile { display: grid; grid-template-columns: 20px minmax(0, 1fr); column-gap: 10px; align-items: start; height: 84px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid transparent; }
.tile > .ic { width: 20px; height: 20px; margin-top: 1px; }
.tile.is-selected { box-shadow: 0 0 0 2px var(--surface-page), 0 0 0 4px var(--green-600); }
.t-focused { background: var(--state-focused-bg); color: var(--state-focused-fg); }
.t-emergency { background: var(--state-emergency-bg); color: var(--state-emergency-fg); }
.t-revoked { background: var(--state-revoked-bg); color: var(--state-revoked-fg); }
.t-ended { background: var(--state-ended-bg); color: var(--state-ended-fg); }
.t-notjoined { background: var(--state-notjoined-bg); color: var(--state-notjoined-fg); }
.t-silent { background: var(--state-ended-bg); color: var(--state-ended-fg); border-style: dashed; border-color: var(--border-strong); }
.t-unknown { background: transparent; color: var(--text-primary); border-style: dashed; border-color: var(--border-strong); }
.tile-proj { height: 100px; padding: 12px 18px; grid-template-columns: 24px minmax(0, 1fr); column-gap: 12px; }
.tile-proj > .ic { width: 24px; height: 24px; }
.cells .tile-proj .nm { font-size: 21px; line-height: 28px; }
.cells .tile-proj .st { font-size: 17px; line-height: 24px; }
.cells .tile-proj .dt { font-size: 15px; line-height: 22px; min-height: 22px; }
.cells--proj { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cells .tile-proj .st .ic { width: 16px; height: 16px; }

/* ---- the recap: who wasn't focused the whole time first, a thin line each, its moments marked ---- */
.mk { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; background: var(--surface-card); border: 1.5px solid var(--stone-400); color: var(--text-secondary); }
.mk .ic { width: 10px; height: 10px; stroke-width: 2.25; }
.mk.k-unlock { border-color: var(--orange-400); color: var(--orange-800); }
.mk.k-off { border-color: var(--red-300); color: var(--red-700); }
.mk.k-silent { border-style: dashed; }
.mline { position: relative; display: block; height: 22px; }
.mline .ln { position: absolute; top: 10px; height: 2px; border-radius: 1px; background: var(--stone-300); }
.mline .mk { position: absolute; top: 2px; margin-left: -9px; }
.xrows > li { display: grid; grid-template-columns: 170px minmax(0, 1fr) minmax(0, 1.15fr); gap: 6px 18px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border-default); }
.xrows > li:last-child { border-bottom: 1px solid var(--border-default); }
.xrows .who { font-size: 15px; line-height: 20px; font-weight: 600; overflow-wrap: anywhere; }
.xrows > li.xhead { padding: 0 0 6px; border-top: 0; }
.xrows .says { font-size: 14px; line-height: 20px; color: var(--text-secondary); }
.namelist { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.namelist li { padding: 3px 10px; border-radius: 999px; background: var(--surface-sunken); font-size: 13.5px; line-height: 19px; }

/* ---- questions suggested from slides (AI) ---- */
.switch { position: relative; flex: none; width: 44px; height: 26px; padding: 0; border: 0; border-radius: 999px; background: var(--stone-300); cursor: pointer; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }
.switch[aria-checked="true"] { background: var(--green-600); }
.switch[aria-checked="true"]::after { left: 21px; }
.setting { display: flex; align-items: flex-start; gap: 14px; }
.setting .grow { flex: 1; min-width: 0; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface-card); font-size: 12px; line-height: 16px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.tag .ic { width: 12px; height: 12px; }
.sugg { display: flex; flex-direction: column; gap: 12px; }
.sugg-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.sugg .mini-opts { margin-top: 0; }
.sugg-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border-default); }
.sugg.is-kept { background: var(--surface-sunken); box-shadow: none; }
.callout { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.edit-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 18rem); gap: 20px 28px; align-items: start; }

/* Narrower than 1024 px (a laptop at 150% zoom or more): one column, the question first, as on
   the phone. The card is first in the page's order at every width, so the keyboard reaches it first. */
@media (max-width: 1px) {
  .s-lesson { grid-template-columns: minmax(0, 1fr); }
  .s-lesson > .s-card { grid-column: auto; grid-row: auto; }
  .edit-cols { grid-template-columns: minmax(0, 1fr); }
}
/* Too narrow for the side menu beside the page (a 720 px window, or 200% zoom): it becomes one bar on top */
@media (max-width: 1px) {
  .shell { align-content: flex-start; }
  .sidenav { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--border-default); }
  .sidenav .brand { padding: 4px 12px 4px 4px; }
  .nav-gap { display: none; }
  .navfoot { margin: 0 0 0 auto; padding: 0; border-top: 0; }
}
@media (max-width: 1px) {
  .main, .s-main { padding: 22px 16px 40px; }
  .topbar { padding: 0 16px; }
  .sheet-grid { grid-template-columns: minmax(0, 1fr); }
  /* PV1, a phone: the bar takes three rows, Bali and the account on top, then the six links, three to a row */
  .navfoot { order: 1; }
  .nav-gap { display: block; order: 2; flex-basis: 100%; min-height: 0; }
  .sidenav .navlink { order: 3; }
  /* a class live: the header laid out as Home's live card, the name at its size, the countdown at the right,
     the controls on a line of their own; Present, the projector's view, is left to a computer, here and on Home */
  .class-head { gap: 14px; }
  .class-head .title { flex: 1 1 0; }
  .class-head h1 { font-size: 18px; line-height: 24px; }
  .countdown { padding-left: 0; border-left: 0; text-align: right; }
  .class-head .actions { margin-left: 0; flex-basis: 100%; }
  .grid-bar > .btn { display: none; }
  .livecard .btn-secondary { display: none; }
  .row .note { margin-left: 0; }
  /* Home: Recent activity is hidden; the live card's line keeps the latest unlock */
  [aria-labelledby="ra-h"] { display: none; }
  /* the grid: two columns of short tiles, every one the size of the tallest, nothing cut (the owner's pick) */
  .cells-sm { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 8px; }
  .cells .tile-sm { display: block; height: auto; padding: 10px 12px; }
  .cells .tile-sm .nm, .cells .tile-sm .st { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
  .cells .tile-sm .dt { display: inline; white-space: normal; overflow: visible; min-height: 0; }
}
