/* styles.css — class-based, RTL-safe styling for eTutor (team-i18n).
 *
 * Replaces the former inline styles in app.jsx so the layout can mirror under
 * dir="rtl" (ar/he/fa/ur). Directional spacing/alignment uses CSS *logical*
 * properties (margin-inline, padding-inline, inset-inline, text-align:start/end)
 * which flip automatically with the document direction. Genuinely dynamic values
 * (computed colors, bar widths, animation) remain inline in JSX — they are
 * direction-neutral and cannot break RTL.
 */

/* ── palette ─────────────────────────────────────────────────────────────── */
:root {
  --bg: #f6f8f7; --panel: #ffffff; --panel2: #eef3f2; --line: #dce4e7;
  --ink: #18242d; --mute: #697985; --faint: #7b8991;
  --teal: #007d74; --teal-soft: #e1f3ef; --amber: #a85d14; --amber-soft: #fff1d9;
  --crimson: #9e4249; --blue: #3569a6; --blue-soft: #e9f0fa; --gold: #a85d14;
  --shadow: 0 18px 50px rgba(30,51,60,.08);
  --font-ui: Inter, 'Noto Sans', ui-sans-serif, system-ui, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', SFMono-Regular, Consolas, monospace;
}

/* ── base ────────────────────────────────────────────────────────────────── */
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-ui); }
* { box-sizing: border-box; }
.nr { font-family: var(--font-ui); }
button, input, select, textarea { font-family: inherit; }

/* Script-aware fonts so CJK / Arabic / Devanagari render with coverage. */
:lang(zh) { font-family: 'Noto Sans SC', var(--font-ui); }
:lang(ja) { font-family: 'Noto Sans JP', var(--font-ui); }
:lang(ko) { font-family: 'Noto Sans KR', var(--font-ui); }
:lang(hi) { font-family: 'Noto Sans Devanagari', var(--font-ui); }
:lang(ar), :lang(he), :lang(fa), :lang(ur) { font-family: 'Noto Sans Arabic', var(--font-ui); }

.scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
input[type=range] { -webkit-appearance: none; height: 4px; border-radius: 4px; background: var(--line); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--teal); cursor: pointer; border: 2px solid var(--bg); }
@keyframes flick { 0%, 100% { opacity: 1; } 50% { opacity: .82; } }

/* ── color/utility helpers ───────────────────────────────────────────────── */
.t-mute { color: var(--mute); } .t-faint { color: var(--faint); } .t-ink { color: var(--ink); }
.t-teal { color: var(--teal); } .t-amber { color: var(--amber); } .t-blue { color: var(--blue); } .t-crimson { color: var(--crimson); }
.app { min-height: 100vh; }
.loading { padding: 40px; color: var(--faint); }
.center-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.stack { display: grid; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.grow { flex: 1; }
.spacer { flex: 1; }
.muted-note { color: var(--faint); font-size: 11px; }

/* ── buttons ─────────────────────────────────────────────────────────────── */
.btn { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; font-size: 13px; cursor: pointer; transition: background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease; }
.btn:hover:not(:disabled) { border-color: #b7c9c9; box-shadow: 0 4px 12px rgba(24,36,45,.08); transform: translateY(-1px); }
.btn:focus-visible, .field:focus-visible, .select:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(53,105,166,.3); outline-offset: 2px; }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: var(--teal); color: #fff; border-color: var(--teal); font-weight: 700; }
.btn-warn { background: var(--amber); color: #fff; border-color: var(--amber); }
.btn-reset { background: var(--line); color: var(--ink); }
.btn-muted { background: transparent; color: var(--mute); border-color: var(--line); }
.btn-danger { background: #fff; color: var(--crimson); border-color: rgba(158,66,73,.35); }
.btn-clear { background: var(--panel); color: var(--faint); border: 1px solid var(--line); }
.btn-ai { background: var(--teal-soft); color: var(--teal); border: 1px solid #b6dfd7; font-size: 12px; }
.btn-replace { background: var(--crimson); color: #fff; inline-size: 100%; margin-block-start: 4px; }
.btn-outline { border: 1px solid var(--line); }
.btn-block { inline-size: 100%; }
.btn-bold { font-weight: 600; }
.btn-start { text-align: start; }
.btn-tiny { font-size: 11px; padding: 3px 8px; }

/* toggle group (slot select, view-as) */
.toggle { background: var(--panel2); color: var(--mute); border: 1px solid var(--line); }
.toggle.is-active { background: var(--blue); color: #fff; border-color: var(--blue); }
.seg { display: flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--panel); }
.seg__btn { background: transparent; color: var(--mute); border: none; border-radius: 0; padding: 6px 10px; cursor: pointer; font-size: 12.5px; }
.seg__btn + .seg__btn { border-inline-start: 1px solid var(--line); }
.seg__btn.is-active { background: var(--teal); color: #fff; }

/* ── atoms ───────────────────────────────────────────────────────────────── */
.h { font-size: 17px; font-weight: 600; margin-block-end: 12px; }
.h .dim { color: var(--faint); font-weight: 400; font-size: 13px; }
.sub { font-size: 11px; color: var(--mute); text-transform: uppercase; letter-spacing: .08em; margin-block-end: 6px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: 0 2px 8px rgba(27,57,64,.04); }
.card--flush { padding: 0; }
.card-mb-sm { margin-block-end: 12px; }
.span2 { grid-column: span 2; }
.dim { color: var(--faint); font-weight: 400; font-size: 13px; }
.vmid { vertical-align: middle; }
.link { color: var(--blue); cursor: pointer; }
.link--mute { color: var(--mute); cursor: pointer; }
.ok { color: var(--teal); font-size: 12px; margin-block-end: 8px; }
.auth-foot { display: flex; justify-content: space-between; margin-block-start: 10px; font-size: 11.5px; color: var(--faint); }
.pill { font-size: 10.5px; padding: 2px 8px; border-radius: 20px; border: 1px solid var(--line); color: var(--mute); }
/* the catalogue's newest arrivals — /browse tags them so a new bench is not invisible among 200 cards */
.pill-new { border-color: rgba(47, 143, 127, .45); color: var(--teal); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; font-size: 9.5px; }
.helptext { color: var(--mute); font-size: 12.5px; margin-block-end: 12px; }

.field { inline-size: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; color: var(--ink); padding: 10px 12px; font-size: 13px; margin-block-end: 12px; }
.select { background: var(--panel); border: 1px solid var(--line); border-radius: 9px; color: var(--ink); padding: 9px 11px; font-size: 13px; }

.err { color: var(--crimson); font-size: 12px; }
.err-box { color: var(--crimson); font-size: 12px; margin-block-end: 12px; border: 1px solid var(--crimson); border-radius: 6px; padding: 8px 10px; }

/* ── meter / gauge ───────────────────────────────────────────────────────── */
.meter { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.meter__label { font-size: 10px; color: var(--mute); text-transform: uppercase; letter-spacing: .06em; }
.meter__value { font-size: 19px; font-weight: 600; }
.meter__unit { font-size: 11px; color: var(--faint); }
.gauge { text-align: end; }
.gauge__label { font-size: 10px; color: var(--mute); letter-spacing: .1em; }
.gauge__value { font-size: 22px; font-weight: 600; }

/* ── top bar ─────────────────────────────────────────────────────────────── */
.topbar { position: relative; z-index: 10; background: var(--panel); color: var(--ink); border-block-end: 1px solid var(--line); padding: 10px 22px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: nowrap; }
.brand { font-size: 20px; font-weight: 750; letter-spacing: .01em; white-space: nowrap; }
.brand--lg { font-size: 28px; margin-block-end: 4px; }
.brand__sub { color: var(--mute); font-size: 13px; }
.topbar__right { display: flex; gap: 8px 12px; align-items: center; justify-content: flex-end; flex-wrap: nowrap; min-width: 0; }
.topbar__tools, .topbar__account { display: flex; gap: 7px; align-items: center; flex-wrap: nowrap; min-width: 0; }
.topbar__account { border-inline-start: 1px solid var(--line); padding-inline-start: 12px; }
.topbar .usermeta { overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .topbar__right { width: 100%; }
  .topbar__tools, .topbar__account { width: 100%; }
  .topbar__account { border-inline-start: 0; border-block-start: 1px solid var(--line); padding-inline-start: 0; padding-block-start: 12px; }
}
.usermeta { font-size: 12px; color: var(--mute); white-space: nowrap; }

/* ── circuit lab ─────────────────────────────────────────────────────────── */
.lab { background: var(--bg); color: var(--ink); min-height: 100vh; }
.lab__header { border-block-end: 1px solid var(--line); padding: 16px 20px; display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.lab__title { font-size: 24px; font-weight: 600; }
.lab__summary { color: var(--faint); font-size: 12px; margin-block-start: 2px; }
.lab__tasks { padding: 12px 20px; border-block-end: 1px solid var(--line); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.lab__goal { padding: 10px 20px; color: var(--amber); font-size: 13px; border-block-end: 1px solid var(--line); background: var(--panel); }
.task-btn { border: 1px solid var(--line); }
.task-btn.is-active { background: var(--teal); color: var(--bg); font-weight: 600; }
.task-btn.is-done { border-color: var(--teal); }

.lab__grid { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(360px, 2fr) minmax(260px, 1.2fr); gap: 1px; background: var(--line); }
.lab__col { background: var(--bg); padding: 18px; }
.lab__col--flex { display: flex; flex-direction: column; }
.lab__col--assess { min-height: 540px; }
.meter-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-block-start: 12px; }

.range-row { display: flex; align-items: center; gap: 10px; margin-block-end: 16px; }
.range-val { color: var(--amber); inline-size: 54px; text-align: end; }
.range-val--wide { inline-size: 64px; }

.palette-row { display: flex; justify-content: space-between; align-items: center; }
.statusbar { margin-block-start: 12px; padding: 9px 12px; border-radius: 6px; background: var(--panel); font-size: 12.5px; }
.hints { color: var(--mute); font-size: 12px; line-height: 1.5; padding-inline-start: 18px; margin-block-start: 8px; }

.bars { display: grid; gap: 8px; margin-block-end: 14px; }
.bar-head { display: flex; justify-content: space-between; font-size: 12px; margin-block-end: 3px; }
.bar-track { height: 7px; background: var(--panel2); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; transition: width .4s; }

.evidence { flex: 1; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); min-height: 120px; }
.evidence__empty { padding: 14px; color: var(--faint); font-size: 12px; }
.evidence__row { padding: 8px 10px; border-block-end: 1px solid var(--line); display: flex; gap: 8px; font-size: 12px; }
.evidence__verb { inline-size: 78px; flex-shrink: 0; }
.evidence__time { color: var(--faint); font-size: 10px; }
.xapi { background: #0a0d12; border: 1px solid var(--line); border-radius: 6px; padding: 10px; font-size: 10.5px; color: var(--teal); max-height: 150px; overflow: auto; margin-block-end: 10px; }
.footnote { margin-block-start: 10px; font-size: 10.5px; color: var(--faint); line-height: 1.5; }
.between { display: flex; justify-content: space-between; align-items: baseline; }

.schematic { inline-size: 100%; background: #0a0d12; border: 1px solid var(--line); border-radius: 8px; }

/* ── dashboards ──────────────────────────────────────────────────────────── */
.page { padding: 22px; max-width: 1200px; margin-inline: auto; }
.card-mb { margin-block-end: 22px; }
.tutor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.chip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-block-end: 22px; }

/* tutor row */
.tutor-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.tutor-row__main { flex: 1; min-width: 200px; }
.tutor-row__title { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tutor-row__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
/* Per-tutor mini-class controls: visibility segmented control + access-code row. */
.assign-controls { display: flex; flex-direction: column; gap: 2px; margin-inline-end: 4px; }
.access-code { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; letter-spacing: .06em; color: var(--blue); background: rgba(108,182,255,.12); border: 1px solid var(--line); border-radius: 6px; padding: 4px 9px; user-select: all; }
.tutor-name { font-size: 17px; font-weight: 600; }

/* concept catalog */
.legend { display: flex; gap: 12px; flex-wrap: wrap; margin-block-end: 12px; }
.legend__item { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--faint); }
.fit { font-size: 9.5px; font-weight: 600; border: 1px solid currentColor; border-radius: 4px; padding: 1px 5px; letter-spacing: .04em; text-transform: uppercase; flex-shrink: 0; }
.chip { display: flex; align-items: center; gap: 7px; text-align: start; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; color: var(--ink); padding: 7px 9px; font-size: 12px; cursor: pointer; line-height: 1.35; }
.cat { border-block-start: 1px solid var(--line); }
.cat__head { inline-size: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; background: transparent; border: none; color: var(--ink); padding: 11px 2px; cursor: pointer; text-align: start; }
.cat__caret { color: var(--teal); margin-inline-end: 8px; }
.cat__name { font-size: 15px; font-weight: 600; }
.cat__count { color: var(--faint); font-size: 11px; margin-inline-start: 8px; }
.cat__body { padding: 0 2px 14px; }
.cat__blurb { color: var(--faint); font-size: 11.5px; margin-block-end: 9px; }
.cat__ai { display: flex; align-items: center; gap: 10px; margin-block-start: 11px; }

/* login */
.login-card { inline-size: 460px; max-inline-size: 100%; }
.provider-link { display: block; text-align: center; text-decoration: none; font-weight: 600; }
.divider { border-block-start: 1px solid var(--line); margin: 4px 0 16px; padding-block-start: 14px; color: var(--faint); font-size: 11px; }
.role-btn { text-align: start; display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--line); }
.role-btn.is-active { background: var(--blue); color: var(--bg); border-color: var(--blue); }

/* admin */
.user-row { display: flex; justify-content: space-between; padding: 10px 16px; border-block-end: 1px solid var(--line); font-size: 12.5px; }
.kv { font-size: 12.5px; }

/* roster modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 10; }
.modal { inline-size: 640px; max-inline-size: 100%; max-block-size: 80vh; overflow: auto; }
.modal--wide { inline-size: 760px; }
.roster-row { border-block-start: 1px solid var(--line); padding: 10px 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; }

.flex-end { display: flex; justify-content: flex-end; margin-block-end: 8px; }

/* language picker */
.lang-select { background: var(--panel2); color: var(--mute); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font-size: 12px; }

/* concept diagram (AI-generated SVG) */
.concept-diagram { margin-block-end: 16px; }
.concept-diagram__svg { background: #0a0d12; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.concept-diagram__svg svg { display: block; width: 100%; height: auto; }

/* difficulty switcher bar (above the lab) */
.difficulty-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 20px; border-block-end: 1px solid var(--line); background: var(--panel); }
.t-crimson { color: var(--crimson); }

/* generation progress panel */
.gen { margin-block-start: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); }
.gen__head { display: flex; align-items: center; gap: 10px; margin-block-end: 10px; }
.gen__title { font-size: 13px; color: var(--ink); flex: 1; }
.gen__time { font-size: 12px; color: var(--mute); font-variant-numeric: tabular-nums; }
.gen__bar { height: 6px; background: var(--line); border-radius: 6px; overflow: hidden; margin-block-end: 10px; }
.gen__bar-fill { height: 100%; background: var(--teal); transition: width .5s ease; }
.gen__steps { display: grid; gap: 4px; }
.gen__step { font-size: 12px; color: var(--faint); transition: color .3s; }
.gen__step.is-active { color: var(--teal); }
.gen__step.is-done { color: var(--mute); }
.gen__dot { display: inline-block; inline-size: 14px; }
.spinner { inline-size: 14px; block-size: 14px; border: 2px solid var(--line); border-block-start-color: var(--teal); border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* conceptual study view (fit === stretch: not lab-graded) */
.study { padding: 18px 20px; max-width: 760px; }
.study__list { color: var(--mute); font-size: 13px; line-height: 1.6; padding-inline-start: 18px; margin: 6px 0 18px; }
.study__list b { color: var(--ink); }

/* ===================== landing (STEM Bench — pilot) ===================== */
.landing { max-width: 1040px; margin: 0 auto; padding: 0 20px 60px; }
.landing-nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; border-block-end: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 5; }
.landing-brand { font-size: 20px; font-weight: 600; letter-spacing: .02em; }
.pilot-badge { font-size: 10px; font-weight: 700; letter-spacing: .12em; color: var(--bg); background: var(--amber); border-radius: 4px; padding: 2px 6px; margin-inline-start: 8px; vertical-align: middle; }
.btn-lg { padding: 11px 20px; font-size: 14px; }

/* The bench a visitor asked for by URL (a gallery "open the bench →" link), shown above the hero so
   the answer to "where is my bench" is the first thing on the page rather than the last. */
.landing-wanted { text-align: center; margin: 20px 0 0; padding: 20px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.landing-wanted__label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.landing-wanted__name { font-size: 24px; font-weight: 700; margin: 6px 0 8px; }
.landing-wanted__desc { color: var(--mute); font-size: 13.5px; line-height: 1.6; max-width: 620px; margin: 0 auto; }
.landing-wanted__note { color: var(--faint); font-size: 12px; margin-block-start: 10px; }

.landing-hero { position: relative; text-align: center; padding: 64px 12px 40px; overflow: hidden; }
/* Full-bleed video background: span the viewport width while content stays in the .landing container. */
.landing-hero__bg { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 100vw; height: 100%; z-index: 0; pointer-events: none; }
.landing-hero__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Dark scrim (top→bottom fade into page bg) keeps the hero copy readable over the video. */
.landing-hero__scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(13,17,23,.30) 0%, rgba(13,17,23,.45) 60%, var(--bg) 100%); }
.landing-hero > *:not(.landing-hero__bg) { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) { .landing-hero__video { display: none; } }
.pilot-tag { display: inline-block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--amber); border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; margin-block-end: 22px; }
.landing-title { font-size: 56px; font-weight: 700; line-height: 1.05; margin: 0; background: linear-gradient(90deg, var(--teal), var(--blue)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.landing-tagline { font-size: 19px; color: var(--ink); margin: 12px 0 18px; }
.landing-lede { max-width: 620px; margin: 0 auto 28px; color: var(--mute); font-size: 14.5px; line-height: 1.65; }

/* animated bench vignettes in the hero (public/landing/*.svg) */
.bench-anim-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; max-width: 920px; margin: 40px auto 14px; }
.bench-anim { margin: 0; border-radius: 14px; overflow: hidden; background: #0a1c2a; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.35); transition: transform .25s ease, box-shadow .25s ease; }
.bench-anim:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(0,0,0,.5), 0 0 0 1px var(--anim-accent, var(--teal)); }
.bench-anim__img { display: block; width: 100%; height: auto; }
.bench-anim-caption { color: var(--faint); font-size: 12.5px; max-width: 560px; margin: 0 auto; }
@media (max-width: 720px) { .bench-anim-strip { grid-template-columns: 1fr; max-width: 420px; } }

.landing-section { padding: 34px 0; border-block-start: 1px solid var(--line); }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.feature-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.feature-card__title { color: var(--teal); font-weight: 600; font-size: 14px; margin-block-end: 8px; }
.feature-card__desc { color: var(--mute); font-size: 13px; line-height: 1.55; }

.bench-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-block-start: 14px; }
/* Domain tabs on the public landing showcase (Mathematics, Physics, …). */
.bench-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: 16px; padding-block-end: 14px; border-block-end: 1px solid var(--line); }
.bench-tab { font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--mute); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 7px 15px; display: inline-flex; align-items: center; gap: 8px; transition: color .15s, border-color .15s, background .15s; }
.bench-tab:hover { color: var(--ink); border-color: var(--faint); }
.bench-tab.is-active { color: var(--bg); background: var(--teal); border-color: var(--teal); }
.bench-tab__count { font-size: 10.5px; font-weight: 600; color: inherit; opacity: .7; background: rgba(127,127,127,.18); border-radius: 999px; padding: 0 7px; }
.bench-tab.is-active .bench-tab__count { background: rgba(0,0,0,.18); opacity: .85; }
.bench-tabpanel { margin-block-start: 4px; }
.bench-sample-note { margin-block-start: 14px; font-size: 11.5px; color: var(--faint); letter-spacing: .02em; }
.bench-sample-note__all { color: var(--teal); text-decoration: none; font-weight: 600; }
.bench-sample-note__all:hover { text-decoration: underline; }
/* Course grouping on the public landing showcase (Mathematics, Physics, …). */
.bench-cat { margin-block-start: 26px; }
.bench-cat:first-child { margin-block-start: 8px; }
.bench-cat__head { display: flex; align-items: baseline; gap: 10px; padding-block-end: 6px; border-block-end: 1px solid var(--line); }
.bench-cat__name { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--ink, #1a2733); }
.bench-cat__count { font-size: 11px; color: var(--mute); border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; }
.bench-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; transition: transform .15s, border-color .15s; }
.bench-card:hover { transform: translateY(-2px); border-color: var(--faint); }
.bench-card__name { font-weight: 600; font-size: 15px; margin-block-end: 6px; }
.bench-card__desc { color: var(--mute); font-size: 12.5px; line-height: 1.5; }
.bench-card--soon { border-style: dashed; background: transparent; }
/* Live bench card: hover lift + two actions (try the example / read the docs). */
.bench-card--live { display: flex; flex-direction: column; }
.bench-card--live .bench-card__desc { flex: 1; }
.bench-card__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-block-start: 12px; }
.bench-card__btn { font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; background: transparent; border: 1px solid currentColor; border-radius: 7px; padding: 6px 11px; line-height: 1.1; }
.bench-card__btn:hover { filter: brightness(1.15); transform: translateY(-1px); }
.bench-card__link { font: inherit; font-size: 12px; cursor: pointer; background: none; border: none; color: var(--mute); padding: 6px 2px; }
.bench-card__link:hover { color: var(--ink, #1a2733); text-decoration: underline; }

/* Live-example popup: a near-fullscreen overlay holding the real lab in preview mode. */
.bench-demo-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .72); display: flex; align-items: center; justify-content: center; padding: 2vh 2vw; z-index: 200; }
.bench-demo-shell { position: relative; inline-size: min(1360px, 96vw); block-size: 94vh; overflow: auto; border-radius: 14px; background: #0a1c2a; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8); }
/* The benchkit Tutor root hard-codes min-height:100vh for full-page use; inside the
   94vh popup shell that guarantees a permanent scrollbar. Pin it to fill the shell
   instead so it only scrolls when the lab content genuinely overflows. */
.bench-demo-shell > div { min-block-size: 100% !important; }
.bench-demo-toolbar { position: fixed; inset-block-start: calc(3vh + 8px); inset-inline-end: calc(3vw + 8px); z-index: 210; display: flex; gap: 8px; align-items: center; }
.bench-demo-close { inline-size: 36px; block-size: 36px; border-radius: 50%; border: 1px solid rgba(180, 200, 220, .4); background: rgba(10, 28, 42, .85); color: #cddce7; font-size: 16px; cursor: pointer; line-height: 1; }
.bench-demo-close:hover { background: rgba(20, 44, 64, .95); }
.tutor-preview-header { position: sticky; inset-block-start: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 18px; background: #0a1c2a; color: #cddce7; border-bottom: 1px solid rgba(180, 200, 220, .25); }
.tutor-preview-header strong { overflow-wrap: anywhere; }
.tutor-preview-header .bench-demo-close { flex-shrink: 0; }
.tutor-preview-shell > div { min-block-size: 0 !important; }
.bench-demo-msg { padding: 48px 24px; text-align: center; color: #9fb6c6; font-size: 14px; }

/* "Tutors on this bench" — the preview's way out: a pill in the demo toolbar that drops down the
   PUBLIC units authored over this bench, because the preview itself has no tutor to assess. */
.bench-demo-tutors { position: relative; }
.bench-demo-pill { display: inline-flex; align-items: center; gap: 5px; block-size: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid rgba(180, 200, 220, .4); background: rgba(10, 28, 42, .85); color: #cddce7; font-size: 12.5px; cursor: pointer; line-height: 1; white-space: nowrap; }
.bench-demo-pill:hover { background: rgba(20, 44, 64, .95); }
.bench-demo-menu { position: absolute; inset-block-start: 42px; inset-inline-end: 0; inline-size: min(360px, 88vw); max-block-size: min(60vh, 520px); overflow: auto; padding: 10px; border-radius: 12px; border: 1px solid rgba(180, 200, 220, .35); background: #0d2333; box-shadow: 0 22px 50px -12px rgba(0, 0, 0, .75); }
.bench-demo-menu__note { font-size: 11.5px; line-height: 1.5; color: #9fb6c6; padding: 2px 4px 9px; border-block-end: 1px solid rgba(180, 200, 220, .18); margin-block-end: 6px; }
.bench-demo-menu__empty { font-size: 12px; line-height: 1.5; color: #8fa6b6; padding: 8px 4px; }
.bench-demo-menu__row { display: block; padding: 8px 9px; border-radius: 8px; text-decoration: none; color: #dbe7ef; }
.bench-demo-menu__row:hover { background: rgba(40, 78, 106, .55); }
.bench-demo-menu__name { display: block; font-size: 13px; font-weight: 600; }
.bench-demo-menu__meta { display: block; font-size: 11px; color: #93a9b9; margin-block-start: 2px; }

/* Bench documentation modal — parchment/gold theme matching the contextual help card
   (contextual-help.js #cx-help-card). Warm cream surface, gold header, brown ink. */
.bench-doc-overlay { position: fixed; inset: 0; background: rgba(20, 14, 4, .5); display: flex; align-items: center; justify-content: center; padding: 4vh 4vw; z-index: 260; }
.bench-doc { inline-size: min(720px, 100%); max-block-size: 90vh; display: flex; flex-direction: column; color: #1d2838; background: linear-gradient(180deg, rgba(255, 255, 255, .96) 0%, rgba(247, 244, 236, .94) 100%), #fbf8ef; border: 1px solid rgba(130, 100, 40, .35); border-radius: 14px; overflow: hidden; box-shadow: 0 28px 60px rgba(8, 14, 28, .55), 0 12px 24px rgba(8, 14, 28, .4), 0 2px 6px rgba(8, 14, 28, .3), inset 0 1px 0 rgba(255, 255, 255, .9), 0 0 0 1px rgba(0, 0, 0, .18); }
.bench-doc__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 22px; background: linear-gradient(180deg, #c9a84c 0%, #b89638 100%); color: #231708; border-block-end: 1px solid rgba(130, 100, 40, .45); }
.bench-doc__title { font-family: 'Playfair Display', Georgia, serif; font-size: 20px; font-weight: 700; line-height: 1.15; color: #231708; }
.bench-doc__field { font-family: 'IBM Plex Mono', monospace; font-size: 10px; text-transform: uppercase; color: #5e4d24; margin-block-start: 5px; letter-spacing: .12em; }
.bench-doc__close { flex: 0 0 auto; inline-size: 28px; block-size: 26px; border-radius: 7px; border: 1px solid rgba(0, 0, 0, .18); background: rgba(255, 255, 255, .2); color: #231708; font-size: 15px; cursor: pointer; line-height: 1; }
.bench-doc__close:hover { background: rgba(255, 255, 255, .5); }
.bench-doc__body { padding: 14px 22px 22px; overflow: auto; background: linear-gradient(180deg, #fbf8ef 0%, #f5efdc 100%); }
.bench-doc__lede { font-size: 14.5px; line-height: 1.6; color: #3a2f15; margin: 4px 0 6px; }
.bench-doc__h { font-family: 'Playfair Display', Georgia, serif; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: #8a7549; margin: 20px 0 8px; font-weight: 700; }
.bench-doc__objlist { margin: 0; padding-inline-start: 18px; }
.bench-doc__objlist li { font-size: 13.5px; line-height: 1.55; margin-block-end: 6px; color: #3a2f15; }
.bench-doc__law { font-size: 14px; font-weight: 600; color: #231708; margin-block-end: 8px; }
.bench-doc__eqs { display: flex; flex-wrap: wrap; gap: 8px; }
.bench-doc__eqs code { font-family: 'IBM Plex Mono', Menlo, monospace; font-size: 12.5px; background: #f4ecd5; border: 1px solid rgba(130, 100, 40, .25); border-radius: 6px; padding: 4px 9px; color: #3a2f15; }
.bench-doc__assume { font-size: 12.5px; color: #6b5c3f; line-height: 1.55; margin-block-start: 8px; }
.bench-doc__cap { font-weight: 600; color: #231708; }
.bench-doc__prog { font-size: 13.5px; line-height: 1.6; color: #3a2f15; margin: 6px 0; }
.bench-doc__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-block-start: 6px; }
.bench-doc__chip { font-size: 11.5px; background: #fff; border: 1px solid rgba(130, 100, 40, .3); border-radius: 14px; padding: 3px 10px; color: #3a2f15; }
.bench-doc__chip--std { font-weight: 700; color: #231708; }

/* Guided learning journey — large in-app popup framing the alwaysAI hosted UI (kin to the
   "Explore concepts" map modal). Sits above the bench-doc modal so it can open over it. */
.learn-overlay { position: fixed; inset: 0; background: rgba(6, 14, 22, .72); display: flex; align-items: center; justify-content: center; padding: 2vh 2vw; z-index: 320; }
.learn-shell { display: flex; flex-direction: column; inline-size: min(1360px, 96vw); block-size: 94vh; border-radius: 14px; overflow: hidden; background: #0a1c2a; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8); }
.learn-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border-block-end: 1px solid rgba(180, 200, 220, .18); background: rgba(13, 49, 74, .55); }
.learn-title { font-size: 14px; font-weight: 600; color: #cddce7; letter-spacing: .02em; }
.learn-actions { display: flex; align-items: center; gap: 8px; }
.learn-close { inline-size: 34px; block-size: 34px; border-radius: 50%; border: 1px solid rgba(180, 200, 220, .4); background: rgba(10, 28, 42, .85); color: #cddce7; font-size: 15px; cursor: pointer; line-height: 1; }
.learn-close:hover { background: rgba(20, 44, 64, .95); }
.learn-body { position: relative; flex: 1; min-height: 0; background: #0a1c2a; }
.learn-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px; color: #9fb6c6; font-size: 13px; pointer-events: none; }
.learn-frame { inline-size: 100%; block-size: 100%; border: none; display: block; }

/* Learn modal — Explore-concept layout: concept list (left) → journey (right). */
.learn-split { flex: 1; min-height: 0; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.learn-list { overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 6px; border-inline-end: 1px solid rgba(180, 200, 220, .18); background: rgba(13, 49, 74, .35); }
.learn-list__cap { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: #7fa0b6; padding: 2px 4px 4px; }
.learn-item { display: flex; align-items: center; gap: 8px; text-align: start; cursor: pointer; border-radius: 9px; padding: 8px 10px; border: 1px solid rgba(180, 200, 220, .22); background: rgba(255, 255, 255, .04); color: #cddce7; font: inherit; font-size: 13px; line-height: 1.3; }
.learn-item:hover { background: rgba(255, 255, 255, .08); }
.learn-item.is-active { border-color: #e3b341; background: rgba(227, 179, 65, .16); }
.learn-item__fit { flex: 0 0 auto; font-size: 9px; text-transform: uppercase; letter-spacing: .04em; color: #0a1c2a; font-weight: 700; border-radius: 5px; padding: 2px 6px; }
.learn-item__label { flex: 1; }
.learn-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.learn-modebar { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-block-end: 1px solid rgba(180, 200, 220, .18); background: rgba(13, 49, 74, .4); }
.learn-modes { display: inline-flex; border: 1px solid rgba(180, 200, 220, .3); border-radius: 8px; overflow: hidden; }
.learn-mode { font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; border: none; background: transparent; color: #9fb6c6; padding: 6px 14px; }
.learn-mode + .learn-mode { border-inline-start: 1px solid rgba(180, 200, 220, .3); }
.learn-mode:hover { color: #cddce7; }
.learn-mode.is-active { background: rgba(214, 73, 47, .85); color: #fff; }
.learn-modebar__concept { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #cddce7; font-size: 13px; font-weight: 600; }
.learn-body--split { flex: 1; }

.landing-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block-start: 28px; margin-block-start: 24px; border-block-start: 1px solid var(--line); color: var(--faint); font-size: 12px; flex-wrap: wrap; }
/* Global attribution shown beneath every signed-in view. */
.app-footnote { text-align: center; color: var(--faint); font-size: 11.5px; padding: 22px 16px 28px; margin-block-start: 16px; border-block-start: 1px solid var(--line); }
.landing-back { max-width: 460px; margin: 18px auto -6px; padding: 0 20px; }
@media (max-width: 560px) { .landing-title { font-size: 40px; } }

/* Sortable table of a teacher's custom benches (teacher dashboard "Your bench" card). */
/* "Your benches", grouped by course. The list is not loaded until a heading is opened — the
   dashboard fetches per-course COUNTS first (GET /tutors?group=subject) and a course's rows only
   when it is expanded — so the heading is the load control, not just a disclosure. */
.tutor-cat { border: 1px solid var(--line); border-radius: 10px; margin-block-start: 8px; overflow: hidden; }
.tutor-cat__head { inline-size: 100%; display: flex; align-items: center; gap: 9px; padding: 10px 12px; background: transparent; border: 0; cursor: pointer; text-align: start; font: inherit; color: inherit; }
.tutor-cat__head:hover { background: rgba(0, 0, 0, .035); }
.tutor-cat__caret { color: var(--mute); font-size: 11px; }
.tutor-cat__name { font-weight: 600; font-size: 14px; }
.tutor-cat__count { font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: rgba(0, 0, 0, .06); color: var(--mute); }
.tutor-cat__benches { flex: 1; min-inline-size: 0; font-size: 11.5px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tutor-cat .bench-table { margin-block-start: 0; }
.tutor-cat .muted-note { padding: 10px 12px; }
.tutor-cat__loading { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.tutor-sub { border-block-start: 1px solid var(--line); }
.tutor-sub__head { padding-inline-start: 30px; }
.tutor-sub .bench-table { margin-block-start: 0; }

/* The popup is resizable and remembers its size. A teacher with a wide screen has more room than
   a fixed dialog width can guess at, and this is the one list they scan rather than glance at. */
.modal--sizable { position: relative; inline-size: min(1180px, 94vw); block-size: min(780px, 84vh); max-inline-size: 98vw; max-block-size: 96vh; min-inline-size: 420px; min-block-size: 320px; resize: both; overflow: auto; display: flex; flex-direction: column; }
.modal--sizable.is-max { inline-size: 98vw !important; block-size: 96vh !important; }
.modal--sizable::after { content: ""; position: absolute; inset-block-end: 3px; inset-inline-end: 3px; inline-size: 12px; block-size: 12px; pointer-events: none;
  background: linear-gradient(135deg, transparent 0 55%, var(--faint) 55% 62%, transparent 62% 74%, var(--faint) 74% 81%, transparent 81%); opacity: .7; }
.modal--sizable > .modal-body { flex: 1; min-block-size: 0; overflow: auto; }

/* The row actions must stay reachable however wide the table gets: the table scrolls sideways
   inside its own box (the page never does) and the Actions column is pinned to the trailing edge,
   so the buttons are on screen at every scroll position. */
.bench-table-scroll { inline-size: 100%; overflow-x: auto; }
.bench-table-scroll .bench-table { min-inline-size: max-content; }
.bench-table-scroll th.actions, .bench-table-scroll td.actions { position: sticky; inset-inline-end: 0; background: var(--panel); box-shadow: inset 1px 0 0 var(--line); }
.bench-table-scroll tbody tr:hover td.actions, .bench-table-scroll tbody tr.is-active td.actions { background: var(--panel2); }

.bench-table { inline-size: 100%; border-collapse: collapse; font-size: 12.5px; margin-block-start: 10px; }
.bench-table th, .bench-table td { text-align: start; padding: 7px 10px; border-block-end: 1px solid var(--line); vertical-align: middle; }
.bench-table thead th { color: var(--mute); text-transform: uppercase; letter-spacing: .06em; font-size: 10.5px; font-weight: 600; cursor: pointer; user-select: none; white-space: nowrap; }
.bench-table thead th:hover { color: var(--ink); }
.bench-table tbody tr { cursor: pointer; }
.bench-table tbody tr:hover { background: var(--panel2); }
.bench-table tbody tr.is-active { background: var(--panel2); box-shadow: inset 3px 0 0 var(--teal); }
.bench-table .num { text-align: end; font-variant-numeric: tabular-nums; }
.bench-table .actions { white-space: nowrap; width: 1%; }
.bench-table .sg-col { min-width: 200px; white-space: nowrap; }
.bench-table .chk { width: 1%; white-space: nowrap; text-align: center; cursor: default; }
.bench-table .chk input { cursor: pointer; }

/* ===========================================================================
   Responsive / mobile pass
   The client has no build step — these are plain media queries layered onto the
   existing class-based styles. The two three-panel "workbench" layouts are
   inline-styled in benchkit.js; they carry .bk-workbench / .bk-explore-split
   hooks and are overridden with !important here because inline styles otherwise
   win the cascade. Spacing uses logical properties so it stays RTL-safe.
   ========================================================================== */

/* Belt-and-braces: never let a stray wide child force horizontal page scroll. */
@media (max-width: 720px) { html, body { overflow-x: hidden; } }

/* ── tablet / small laptop: collapse the three-panel workbenches ─────────── */
@media (max-width: 960px) {
  /* app.jsx circuit lab */
  .lab__grid { grid-template-columns: 1fr; }
  .lab__col--assess { min-height: 0; }

  /* Bench harness: the experiment includes its task, followed by optional support. */
  .bk-workbench { grid-template-columns: 1fr !important; padding: 14px 14px 48px !important; }
  .bk-workbench > .bk-experiment { order: -1; }
}

/* ── phone ──────────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .page { padding: 16px 14px; }
  .topbar { padding: 12px 14px; }
  .brand { font-size: 18px; }
  .brand--lg { font-size: 22px; }
  .lab__header, .lab__tasks, .lab__goal, .difficulty-bar { padding-inline: 14px; }
  .lab__title { font-size: 20px; }

  /* dense fixed-column grids → fewer columns */
  .meter-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }

  /* split modals (benchkit "Explore concepts" + the Learn modal) → stack,
     capping the list pane so the content/map below stays reachable */
  .bk-explore-split { grid-template-columns: 1fr !important; grid-template-rows: auto 1fr; }
  .bk-explore-split > :first-child { max-block-size: 40vh; }
  .learn-split { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .learn-list { max-block-size: 38vh; }

  /* modals: less wasted margin, taller; full-bleed shells go edge to edge */
  .modal-overlay, .bench-doc-overlay { padding: 10px; }
  .modal { max-block-size: 92vh; }
  .bench-doc { max-block-size: 94vh; }
  .bench-demo-overlay, .learn-overlay { padding: 0; }
  .bench-demo-shell, .learn-shell { inline-size: 100vw; block-size: 100dvh; border-radius: 0; }
  .bench-demo-toolbar { inset-block-start: 8px; inset-inline-end: 8px; }

  /* wide tables scroll horizontally inside their card instead of the whole page */
  .bench-table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }

  /* tighten the public landing */
  .landing { padding: 0 14px 48px; }
  .landing-hero { padding: 40px 8px 28px; }
  .landing-title { font-size: 38px; }
  .landing-tagline { font-size: 16px; }
  .landing-lede { font-size: 13.5px; }
  .landing-section { padding: 26px 0; }
  .landing-nav { padding: 14px 0; }
}

/* ── small phone ────────────────────────────────────────────────────────── */
@media (max-width: 460px) {
  .meter-grid, .stat-grid { grid-template-columns: 1fr; }
  .landing-title { font-size: 30px; }
  .btn-lg { padding: 9px 14px; font-size: 13px; }
}

/* ── mobile notice ────────────────────────────────────────────
   Phones are NOT blocked — the responsive pass above keeps the app usable — but
   below iPad width the workbench, Learn, Explore and Deep-Learning views are tight,
   so we advise a larger device with a non-modal bar at the bottom. Hidden above
   phone widths, and hidden for good once dismissed (the script sets [hidden] and
   remembers it in localStorage). */
#mobile-note { display: none; }
@media (max-width: 767px) {
  #mobile-note:not([hidden]) {
    display: flex; position: fixed; inset-inline: 0; inset-block-end: 0; z-index: 9998;
    align-items: center; gap: 12px; text-align: start;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
    background: var(--panel); color: var(--ink);
    border-block-start: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(0, 0, 0, .18);
  }
}
.mn-body { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--mute); }
.mn-body b { color: var(--ink); font-weight: 600; }
.mn-dismiss { flex: none; font: inherit; font-size: 12.5px; cursor: pointer; color: var(--faint); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; }
.mn-dismiss:hover { color: var(--ink); border-color: var(--faint); }
/* Keep the bar off the last row of content while it is up (no-op where :has is unsupported). */
@media (max-width: 767px) {
  body:has(#mobile-note:not([hidden])) .page,
  body:has(#mobile-note:not([hidden])) .landing,
  body:has(#mobile-note:not([hidden])) .bk-workbench { padding-block-end: 96px !important; }
}


/* ── bench designer: pre-flight findings ────────────────────────────────────
   The invariants a bench design must satisfy, reported against the teacher's own
   form before a model call is spent (server/benchPreflight.js). A blocker is red,
   a warning amber; each carries the sentence that fixes it. */
.preflight { margin-block-start: 12px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); }
.preflight--failed { border-color: color-mix(in srgb, var(--crimson) 45%, var(--line)); }
/* a design that came back outside the complexity band it was asked for: still a real bench, so it
   reads as a caution rather than a failure */
.preflight--warn { border-color: color-mix(in srgb, var(--amber) 55%, var(--line)); background: color-mix(in srgb, var(--amber) 6%, var(--panel2)); }
/* the model-choice warning: a spend decision, so it reads as a decision and not as a hint */
.preflight--model { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); background: color-mix(in srgb, var(--gold) 7%, var(--panel2)); }
.preflight__head { font-size: 12.5px; font-weight: 600; margin-block-end: 8px; }
.preflight__item { display: flex; gap: 9px; align-items: flex-start; padding-block: 5px; }
.preflight__dot { inline-size: 6px; block-size: 6px; border-radius: 50%; background: var(--gold); margin-block-start: 6px; flex: none; }
.preflight__dot--block { background: var(--crimson); }
.preflight__msg { font-size: 12.5px; color: var(--ink); }
.preflight__fix { font-size: 11.5px; color: var(--mute); line-height: 1.5; margin-block-start: 2px; }


/* ── roster: outcome AND process ────────────────────────────────────────────
   The roster used to be one mastery number per learner. These carry the process
   the platform already records: how purposeful the moves were, how much of the
   work followed the ideal path, and what support was taken up. */
.roster-summary { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--mute); padding-block: 8px; }
.roster-row--rich { align-items: center; gap: 14px; }
.roster-row__who { flex: 1 1 190px; min-inline-size: 0; }
.roster-row__process { display: flex; flex-direction: column; gap: 4px; inline-size: 165px; flex: none; }
.mini-bar { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--faint); }
.mini-bar span { inline-size: 62px; text-transform: uppercase; letter-spacing: .04em; }
.mini-bar b { inline-size: 30px; text-align: end; color: var(--mute); font-weight: 600; font-variant-numeric: tabular-nums; }
.mini-bar__track { flex: 1; block-size: 4px; border-radius: 3px; background: var(--line); overflow: hidden; }
.mini-bar__fill { block-size: 100%; border-radius: 3px; }
.mini-bar--empty b { color: var(--faint); }

/* ── one learner's process (the drill-down) ───────────────────────────────── */
.proc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-block: 6px 12px; }
.proc-card { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.proc-card__title { font-size: 12.5px; color: var(--ink); margin-block-end: 7px; }
.intent-bar { display: flex; block-size: 10px; border-radius: 5px; overflow: hidden; margin-block: 6px 6px; background: var(--line); }
.intent-bar__seg { block-size: 100%; }
.intent-key { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11px; color: var(--mute); margin-block-end: 12px; }
.intent-key i { display: inline-block; inline-size: 8px; block-size: 8px; border-radius: 2px; margin-inline-end: 5px; }
.proc-line { font-size: 12.5px; color: var(--mute); padding-block: 3px; border-block-start: 1px solid var(--line); }
.proc-timeline { max-block-size: 210px; overflow-y: auto; }

/* class view: objectives across, learners down */
.heat th { text-align: center; }
.heat th:first-child, .heat td:first-child { text-align: start; }
.heat__cell { text-align: center; }
.heat__dot { display: inline-block; inline-size: 15px; block-size: 15px; border-radius: 4px; }

/* ── Critical evaluation wizard (admin) — app.jsx BenchEvalModal ────────────────────────────────
   Same parchment surface as the bench documentation modal, at working-document width: this is a
   review desk, not a card. Everything is scoped under .bev so it cannot leak into the dashboards. */
/* The wizard's own overlay. It predates the .modal-backdrop rules below and .modal-overlay sits at
   z-index 10 — far below the bench harness it is opened from. Fixed, centred, and above everything. */
.bev-overlay { position: fixed; inset: 0; background: rgba(20, 14, 4, .55); display: flex; align-items: center; justify-content: center; padding: 2vh 2vw; z-index: 300; }
/* Size comes from an inline style (see BenchEvalModal) so the drag handle below can overwrite it.
   `resize` needs a non-visible overflow, which the flex column already has. */
.modal.bev { inline-size: min(1080px, 94vw); block-size: min(880px, 90vh); max-inline-size: 98vw; max-block-size: 96vh; min-inline-size: 380px; min-block-size: 300px; resize: both; display: flex; flex-direction: column; padding: 0; overflow: hidden; background: linear-gradient(180deg, #fbf8ef 0%, #f5efdc 100%); color: #1d2838; border: 1px solid rgba(130, 100, 40, .35); border-radius: 14px; box-shadow: 0 28px 60px rgba(8, 14, 28, .55), 0 12px 24px rgba(8, 14, 28, .4); }
.bev-headbtns { display: flex; gap: 6px; flex: 0 0 auto; }
.modal.bev .modal-x { cursor: pointer; }
/* The resize grip, drawn where the browser puts its handle so it reads as draggable. */
.modal.bev::after { content: ""; position: absolute; inset-block-end: 3px; inset-inline-end: 3px; inline-size: 12px; block-size: 12px; pointer-events: none;
  background: linear-gradient(135deg, transparent 0 45%, rgba(130, 100, 40, .5) 45% 55%, transparent 55% 70%, rgba(130, 100, 40, .5) 70% 80%, transparent 80%); }
@media (max-width: 640px) { .modal.bev { inline-size: 96vw !important; block-size: 94vh !important; resize: none; } }
.modal.bev .bench-doc__head { flex: 0 0 auto; padding: 13px 20px; }
.modal.bev { position: relative; }
.bev-tabs { flex: 0 0 auto; display: flex; align-items: center; gap: 4px; padding: 8px 16px 0; border-block-end: 1px solid rgba(130, 100, 40, .25); background: rgba(255, 255, 255, .4); flex-wrap: wrap; }
.bev-tabs__spacer { flex: 1 1 auto; }
.bev-tab { font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; border: 1px solid transparent; border-block-end: none; background: none; color: #6b5c3f; padding: 7px 13px; border-radius: 8px 8px 0 0; }
.bev-tab:hover { color: #231708; background: rgba(255, 255, 255, .5); }
.bev-tab--on { background: #fbf8ef; border-color: rgba(130, 100, 40, .3); color: #231708; }
.bev-tab__badge { margin-inline-start: 6px; font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; background: rgba(130, 100, 40, .14); border-radius: 10px; padding: 1px 6px; }
.bev-model { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: #2f6f5f; background: rgba(47, 111, 95, .1); border: 1px solid rgba(47, 111, 95, .3); border-radius: 12px; padding: 3px 9px; }
.bev-model--off { color: #8a6a1e; background: rgba(180, 140, 40, .12); border-color: rgba(180, 140, 40, .35); }
.bev-body { flex: 1 1 auto; min-block-size: 0; padding: 14px 20px 22px; overflow: auto; overscroll-behavior: contain; }
.bev-alert { flex: 0 0 auto; margin: 10px 20px 0; padding: 8px 12px; border-radius: 8px; background: rgba(200, 60, 60, .1); border: 1px solid rgba(200, 60, 60, .3); color: #8e2b2b; font-size: 13px; }
.bev-ok { margin-block-end: 10px; padding: 8px 12px; border-radius: 8px; background: rgba(47, 143, 127, .12); border: 1px solid rgba(47, 143, 127, .35); color: #1f5f52; font-size: 13px; }
.bev-busy { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; margin: 10px 20px 0; padding: 9px 13px; border-radius: 8px; background: rgba(130, 100, 40, .1); border: 1px solid rgba(130, 100, 40, .3); font-size: 13px; color: #5e4d24; flex-wrap: wrap; }
.bev-busy__clock { font-family: 'IBM Plex Mono', monospace; font-weight: 700; }
.bev-busy__note { font-size: 11.5px; color: #8a7a55; }
.bev-spin { inline-size: 13px; block-size: 13px; border-radius: 50%; border: 2px solid rgba(130, 100, 40, .3); border-block-start-color: #b89638; animation: bev-spin 900ms linear infinite; }
@keyframes bev-spin { to { transform: rotate(360deg); } }

/* audit */
.bev-scorerow { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-block-end: 14px; }
.bev-score { inline-size: 88px; text-align: center; border-radius: 12px; padding: 10px 6px; background: #fff; border: 2px solid rgba(130, 100, 40, .3); }
.bev-score__n { font-family: 'Playfair Display', Georgia, serif; font-size: 32px; font-weight: 700; line-height: 1; color: #231708; }
.bev-score__g { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #6b5c3f; margin-block-start: 3px; }
.bev-score--strong { border-color: #2f8f7f; } .bev-score--sound { border-color: #4a86c8; }
.bev-score--thin { border-color: #c8912a; } .bev-score--needswork { border-color: #b3453a; }
.bev-scoremeta { flex: 1 1 320px; min-inline-size: 240px; }
.bev-counts { display: flex; gap: 14px; font-size: 13px; font-weight: 600; margin-block-end: 5px; }
.bev-prov { font-size: 12px; color: #6b5c3f; line-height: 1.6; }
.bev-dim { color: #8a7a55; }
.bev-scoreact { display: flex; flex-direction: column; gap: 7px; }
.bev-dimrow { border-block-start: 1px solid rgba(130, 100, 40, .18); padding-block: 9px; }
.bev-dimhead { display: flex; align-items: center; gap: 10px; }
.bev-dimname { font-size: 13px; font-weight: 650; color: #231708; flex: 0 0 auto; min-inline-size: 190px; }
.bev-bar { flex: 1 1 auto; block-size: 7px; border-radius: 4px; background: rgba(130, 100, 40, .16); overflow: hidden; }
.bev-bar__fill { display: block; block-size: 100%; border-radius: 4px; }
.bev-dimscore { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: #6b5c3f; inline-size: 30px; text-align: end; }
.bev-find { display: flex; gap: 9px; font-size: 12.5px; line-height: 1.55; color: #3a2f15; margin: 5px 0 0 8px; }
.bev-find--ok { color: #2f8f7f; }
.bev-sev { font-family: 'IBM Plex Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; flex: 0 0 58px; padding-block-start: 2px; }
.bev-fix { color: #8a7a55; }
.bev-review { margin-block-start: 16px; padding-block-start: 12px; border-block-start: 2px solid rgba(130, 100, 40, .3); }

/* the document */
.bev-lenses { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; margin-block-end: 12px; }
.bev-lens { text-align: start; font: inherit; cursor: pointer; background: #fff; border: 1px solid rgba(130, 100, 40, .28); border-radius: 10px; padding: 10px 12px; color: #3a2f15; display: flex; flex-direction: column; gap: 3px; }
.bev-lens:hover { border-color: rgba(130, 100, 40, .55); }
.bev-lens--on { border-color: #b89638; border-width: 2px; background: #fffdf6; }
.bev-lens__icon { font-size: 17px; }
.bev-lens__name { font-size: 13px; font-weight: 650; color: #231708; }
.bev-lens__blurb { font-size: 11.5px; line-height: 1.45; color: #6b5c3f; }
.bev-lens__have { font-size: 11px; color: #2f8f7f; }
.bev-explain { font-size: 12px; line-height: 1.6; color: #6b5c3f; background: rgba(255, 255, 255, .55); border-inline-start: 3px solid rgba(130, 100, 40, .35); padding: 8px 12px; border-radius: 0 8px 8px 0; margin-block-end: 12px; }
.bev-doc { font-size: 13.5px; line-height: 1.65; color: #2b2416; }
.bev-h { font-family: 'Playfair Display', Georgia, serif; font-weight: 700; color: #231708; margin: 18px 0 7px; }
.bev-h1 { font-size: 20px; } .bev-h2 { font-size: 16px; }
.bev-h3 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .07em; color: #8a7549; }
.bev-h4 { font-size: 12px; color: #6b5c3f; }
.bev-p { margin: 7px 0; }
.bev-list { margin: 6px 0; padding-inline-start: 20px; }
.bev-list li { margin-block-end: 4px; }
.bev-list--tight { margin: 2px 0; font-size: 12.5px; }
.bev-quote { margin: 8px 0; padding-inline-start: 12px; border-inline-start: 3px solid rgba(130, 100, 40, .35); color: #5e4d24; font-style: italic; }
.bev-hr { border: none; border-block-start: 1px solid rgba(130, 100, 40, .25); margin: 14px 0; }
.bev-pre { font-family: 'IBM Plex Mono', Menlo, monospace; font-size: 11.5px; line-height: 1.5; background: #f4ecd5; border: 1px solid rgba(130, 100, 40, .25); border-radius: 8px; padding: 10px 12px; overflow-x: auto; margin: 8px 0; white-space: pre; }
.bev-pre--tight { font-size: 11px; padding: 6px 9px; margin: 3px 0; }
.bev-code { font-family: 'IBM Plex Mono', Menlo, monospace; font-size: 12px; background: rgba(130, 100, 40, .12); border-radius: 4px; padding: 1px 5px; }
.bev-tablewrap { overflow-x: auto; margin: 9px 0; }
.bev-table { border-collapse: collapse; font-size: 12px; min-inline-size: 100%; }
.bev-table th, .bev-table td { border: 1px solid rgba(130, 100, 40, .25); padding: 5px 9px; text-align: start; vertical-align: top; }
.bev-table th { background: rgba(130, 100, 40, .12); font-weight: 650; color: #231708; white-space: nowrap; }

/* the proposal */
.bev-empty { text-align: center; padding: 20px 10px; }
.bev-entry { border: 1px solid rgba(130, 100, 40, .25); border-radius: 10px; padding: 9px 12px; margin-block-end: 8px; background: rgba(255, 255, 255, .55); }
.bev-entry--on { border-color: #2f8f7f; background: rgba(47, 143, 127, .07); }
.bev-entry--bad { border-color: rgba(179, 69, 58, .45); background: rgba(179, 69, 58, .06); }
.bev-entry__head { display: flex; align-items: center; gap: 8px; cursor: pointer; flex-wrap: wrap; }
.bev-entry__body { margin-block-start: 5px; margin-inline-start: 22px; }
.bev-kind { font-family: 'IBM Plex Mono', monospace; font-size: 11px; background: rgba(130, 100, 40, .13); border-radius: 5px; padding: 2px 7px; color: #5e4d24; }
.bev-addr { font-size: 12.5px; font-weight: 650; color: #231708; }
.bev-val { font-size: 13px; line-height: 1.55; color: #2b2416; }
.bev-why { font-size: 11.5px; color: #6b5c3f; font-style: italic; margin-block-start: 4px; }
.bev-err { font-size: 11.5px; color: #8e2b2b; margin-block-start: 3px; }
.bev-codechange { border: 1px dashed rgba(179, 69, 58, .45); border-radius: 10px; padding: 9px 12px; margin-block-end: 8px; background: rgba(179, 69, 58, .05); }
.bev-codechange__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-block-end: 3px; }

/* the worklist card in the admin console */
.bev-worklist { display: flex; flex-direction: column; gap: 3px; margin-block-start: 8px; }
.bev-work { display: flex; align-items: center; gap: 10px; font: inherit; text-align: start; cursor: pointer; background: none; border: none; border-block-end: 1px solid var(--line, rgba(130, 100, 40, .18)); padding: 7px 4px; color: inherit; }
.bev-work:hover { background: rgba(130, 100, 40, .07); }
.bev-work__score { font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 700; inline-size: 34px; text-align: center; border-radius: 6px; padding: 3px 0; color: #fff; background: #4a86c8; }
.bev-work__score--strong { background: #2f8f7f; } .bev-work__score--sound { background: #4a86c8; }
.bev-work__score--thin { background: #c8912a; } .bev-work__score--needswork, .bev-work__score--error { background: #b3453a; }
.bev-work__name { font-size: 13px; font-weight: 600; flex: 0 0 auto; min-inline-size: 180px; }
.bev-work__meta { font-size: 11.5px; color: var(--mute, #8a7a55); }
.bev-mw { border-inline-start-width: 3px; }
.bev-mw--none { border-inline-start-color: #b3453a; }
.bev-mw--weak { border-inline-start-color: #c8912a; }
.bev-mw--strong { border-inline-start-color: #2f8f7f; }
.bev-mw--redirected { border-inline-start-color: #4a86c8; }

/* ── model picker + "use a model on my own computer" wizard (team-llm-selection) ──────────
 * The kit ships these styles against its own variable names (--accent-solid, --pine-100, …);
 * mapped here onto this app's palette so the picker looks like the rest of the app rather
 * than like a package that was dropped into it. */
.model-picker, .local-wizard { width: min(560px, 100%); max-height: 90vh; overflow-y: auto; }

.local-wizard-steps {
  display: flex; gap: 6px; margin: 10px 0 4px; padding: 0; list-style: none;
  font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint);
}
.local-wizard-steps li { padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; }
.local-wizard-steps li.is-current { border-color: var(--teal); color: var(--teal); }
.local-wizard-steps li.is-done { color: var(--mute); }

.local-wizard-kinds { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px 10px; margin: 10px 0; }
.local-wizard-legend { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--mute); padding: 0 6px; }

.local-option {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px;
  cursor: pointer; font-size: 13px;
}
.local-option:hover { background: var(--panel2); }
.local-option.is-current { background: var(--panel2); box-shadow: inset 0 0 0 1px var(--teal); }
/* A locked row is legible, not hidden: the price is the reason it is locked. */
.local-option.is-locked { color: var(--mute); }
.local-option.is-off { opacity: .5; }
.local-option-name { flex: 1; }
.local-option-off { color: var(--crimson); font-size: 11px; }
.local-option-price { font-size: 11px; color: var(--mute); white-space: nowrap; }

.local-wizard-howto { margin: 10px 0; padding-inline-start: 18px; font-size: 12.5px; line-height: 1.6; }
.local-wizard-cmds { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 4px; }
.local-wizard-tool { display: block; font-size: 10.5px; color: var(--mute); }
.local-wizard-howto code, .local-wizard-cmds code, .local-wizard .bench-doc__lede code {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 6px;
  padding: 2px 6px; font-size: 11.5px; word-break: break-all; user-select: all;
}
.local-wizard-hint { font-size: 11.5px; color: var(--mute); margin: 6px 0; }
.local-wizard-error { font-size: 12px; color: var(--crimson); margin: 8px 0; }

.local-wizard-field { display: block; margin: 10px 0; font-size: 12.5px; }
.local-wizard-field span { display: block; color: var(--mute); margin-bottom: 4px; }
.local-wizard-field input {
  width: 100%; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel2); color: var(--ink);
}
.local-wizard-field input:focus { outline: none; border-color: var(--teal); }

.local-wizard-nav { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
.local-wizard-sample { border: 1px solid var(--line); border-left: 3px solid var(--teal); border-radius: 8px; padding: 8px 10px; margin-top: 10px; }
.local-wizard-sample-meta { font-size: 10.5px; color: var(--mute); margin: 0 0 4px; }
.local-wizard-sample-text { font-size: 12.5px; line-height: 1.55; margin: 0; white-space: pre-wrap; }
.local-link-btn { background: none; border: 0; padding: 0; color: var(--blue); cursor: pointer; font: inherit; text-decoration: underline; }
.local-link-btn:disabled { color: var(--faint); cursor: default; }

/* ── .modal-backdrop: a true popup ──────────────────────────────────────────────────────────────
   This class had NO rules, so every dialog using it (⚙ Account & AI, 🧠 Your AI, the local-model
   wizard, Task × Action analysis) rendered inline in the page flow — inside the top bar — rather
   than over the page. Fixed, dimmed, centred, above the bench harness and its overlays (the
   highest of which is .learn-overlay at 320); a dialog stacked on another (the local wizard over
   🧠) comes later in the DOM at the same z-index, so it lands on top. The page behind stops
   scrolling while one is open. */
.modal-backdrop { position: fixed; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center;
  padding: 3vh 3vw; background: rgba(0, 0, 0, .62); overscroll-behavior: contain; }
body:has(.modal-backdrop) { overflow: hidden; }
/* A .bench-doc keeps its parchment surface; every other dialog gets the app's own panel. */
.modal-backdrop > .modal:not(.bench-doc) { background: var(--panel); color: var(--ink); border: 1px solid var(--line);
  border-radius: 12px; padding: 0 18px 18px; box-shadow: 0 28px 60px rgba(0, 0, 0, .55), 0 12px 24px rgba(0, 0, 0, .4); }
.modal-backdrop > .modal:not(.bench-doc) > .bench-doc__head { margin: 0 -18px 12px; border-radius: 11px 11px 0 0; }
.modal-backdrop > .modal:not(.bench-doc) .bench-doc__lede { color: var(--mute); font-size: 13px; }
.modal-backdrop .modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0 10px; }
.modal-backdrop .modal-x { flex: 0 0 auto; background: none; border: 0; color: inherit; font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px; }



/* Preview: the microworld owns the space; supporting controls are disclosures/callouts. */
.tutor-preview-header { padding: 7px 12px; gap: 8px; font-size: 12px; }
.preview-difficulty, .bk-preview-resources { padding: 5px 14px; background: #102536; color: #cddce7; font-size: 12px; border-bottom: 1px solid #294457; }
.preview-difficulty > summary, .bk-preview-resources > summary { cursor: pointer; padding: 3px 0; }
.preview-difficulty .difficulty-bar { padding: 8px 0; }
.bk-preview-options { position: relative; z-index: 25; display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 12px; background: #102536; color: #dfe9f1; }
.bk-preview-options button, .bk-support-close { cursor: pointer; border: 1px solid #456278; border-radius: 6px; padding: 5px 9px; background: #17364b; color: #dfe9f1; font-size: 12px; }
.bk-preview-options button[aria-pressed="true"] { border-color: #62c9bb; background: #20524f; }
.bk-preview-options button:focus-visible, .bk-preview-support button:focus-visible { outline: 2px solid #62c9bb; outline-offset: 2px; }
.bk-display-popover { position: absolute; inset-block-start: 100%; inset-inline-end: 10px; inline-size: min(460px, calc(100vw - 40px)); max-block-size: 65dvh; overflow: auto; padding: 14px; background: #102b3d; border: 1px solid #456278; border-radius: 10px; box-shadow: 0 12px 35px #0009; }
.bk-focused-preview .bk-workbench { position: relative; grid-template-columns: minmax(0,1fr) !important; max-width: none !important; padding: 8px 12px 16px !important; }
.bk-focused-preview .bk-preview-support { position: absolute; top: 8px; z-index: 20; width: min(350px, calc(100% - 24px)); max-height: 70dvh; overflow: auto; padding: 8px; background: #102536; border: 1px solid #456278; border-radius: 10px; box-shadow: 0 12px 35px #0009; }
.bk-preview-support-left { left: 12px; }
.bk-preview-support-right { right: 12px; }
.bk-support-close { position: sticky; top: 0; z-index: 5; }


/* Compact preview launchers; full names remain available to keyboard and assistive technology. */
.preview-icon-button { display: inline-flex; align-items: center; justify-content: center; inline-size: 34px; block-size: 32px; box-sizing: border-box; border: 1px solid #456278; border-radius: 6px; background: #17364b; color: #dfe9f1; cursor: pointer; padding: 5px !important; vertical-align: middle; list-style: none; }
.preview-icon-button::-webkit-details-marker { display: none; }
.preview-icon-button:hover, .preview-icon-button:focus-visible { background: #20524f; outline: 2px solid #62c9bb; outline-offset: 1px; }
.preview-difficulty, .bk-preview-resources { padding-block: 3px; }


.bench-heading { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 8px 12px; }
.bench-heading > svg { flex-shrink: 0; }
.bench-heading-copy { min-width: 0; }
.bench-heading-title { font-family: "Fraunces", Georgia, serif; font-size: 21px; font-weight: 600; line-height: 1.15; color: #edf0e9; overflow-wrap: anywhere; }
.bench-heading-summary { font-family: "Spectral", Georgia, serif; font-size: 12px; font-style: italic; line-height: 1.35; color: #9fb6c6; margin-top: 3px; }
.tutor-preview-header .bench-heading { padding: 0; }
@media (max-width: 600px) { .bench-heading-title { font-size: 18px; } }

/* Bench display controls stay reachable when every optional panel is hidden. */
.bk-toolbar-menu { position: relative; font-family: system-ui, sans-serif; font-size: 13px; }
.bk-toolbar-menu > summary { list-style: none; }
.bk-toolbar-menu > summary::-webkit-details-marker { display: none; }
.bk-toolbar-menu > summary::after { content: " ▾"; }
.bk-toolbar-popover { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 80; width: 300px; max-width: calc(100vw - 40px); max-height: 70vh; overflow-y: auto; padding: 16px; background: #13314a; color: #eaf1f6; border: 1px solid #3a5e78; border-radius: 12px; box-shadow: 0 14px 40px #06162280; }
.bk-resource-actions { display: flex; flex-direction: column; gap: 10px; }
.bk-resource-actions > button, .bk-resource-actions > a { text-align: start; }
@media (max-width: 720px) {
  .bk-toolbar-menu { position: static; }
  .bk-toolbar-popover { position: fixed; top: 100px; inset-inline: 20px; width: auto; }
}

/* A single control strip, with the remaining viewport reserved for the bench. */
.bench-demo-shell:has(.bk-bench-viewport) { overflow: hidden; }
.bench-demo-shell > .bench-player { min-block-size: 0 !important; }
.bk-bench-viewport { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.bk-unified-toolbar { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; padding: 4px 12px; background: #102536; position: relative; z-index: 30; }
.bk-unified-toolbar .bk-preview-options { padding: 0; flex-wrap: nowrap; position: static; }
.bk-unified-toolbar .bk-preview-resources, .bk-unified-toolbar .preview-difficulty { padding: 0; border: 0; }
.bk-difficulty-slot { display: contents; }
/* Disclosures overlay the bench instead of adding another toolbar row. */
.bk-unified-toolbar .bk-preview-resources > .bk-resources-content,
.bk-unified-toolbar .preview-difficulty > .difficulty-bar { position: absolute; inset-inline: 8px; top: 100%; z-index: 40; max-height: 65dvh; overflow: auto; padding: 14px !important; background: #102536; border: 1px solid #456278; border-radius: 10px; box-shadow: 0 12px 35px #0009; }
.bk-bench-viewport .bk-workbench { flex: 1; min-height: 0; width: 100%; align-items: stretch !important; padding: 8px 12px !important; gap: 10px !important; }
.bk-bench-viewport .bk-experiment { display: flex; flex-direction: column; min-height: 0; }
.bk-experiment > :first-child { flex: 0 0 auto; }
.bk-figure-viewport { flex: 1; min-height: 0; min-width: 0; overflow: hidden; position: relative; }
.bk-figure-content { transform-origin: top left; display: flow-root; }
.bk-bench-viewport .bk-workbench > div:not(.bk-experiment) { min-height: 0; max-height: 100%; overflow: auto; overscroll-behavior: contain; }
.bk-focused-preview .bk-preview-support { max-height: calc(100% - 16px); }
.bk-bench-viewport > .bk-workbench + div { flex: 0 0 auto; padding-bottom: 6px !important; font-size: 10px !important; }
@media (max-width: 720px) {
  .bk-bench-viewport:not(.bk-focused-preview) .bk-workbench { position: relative; grid-template-columns: minmax(0,1fr) !important; }
  .bk-bench-viewport:not(.bk-focused-preview) .bk-workbench > div:not(.bk-experiment) { position: absolute; top: 8px; bottom: 8px; width: min(320px, calc(100% - 24px)); z-index: 20; background: #102536; padding: 8px; border-radius: 10px; }
  .bk-bench-viewport:not(.bk-focused-preview) .bk-workbench > div:first-child { left: 12px; }
  .bk-bench-viewport:not(.bk-focused-preview) .bk-workbench > div:last-child { right: 12px; }
}
.bk-unified-toolbar > div:not(.bk-difficulty-slot) { min-width: 0; width: 100%; }
.bk-bench-viewport:not(.bk-focused-preview) .bk-unified-toolbar > div > div > div:first-child { flex-wrap: nowrap !important; align-items: center !important; padding: 6px 0 !important; gap: 8px !important; }
.bk-bench-viewport:not(.bk-focused-preview) .bk-unified-toolbar > div > div > div:first-child > div:first-child { flex: 1; min-width: 0; overflow: hidden; }
.bk-bench-viewport:not(.bk-focused-preview) .bk-unified-toolbar > div > div > div:first-child > div:last-child { flex-wrap: nowrap !important; gap: 6px !important; }

/* Keep the resources bar and its preview notice in one overlay. Nested View /
   Resources menus must escape the bar rather than be clipped by a scroll box. */
.bk-unified-toolbar .bk-preview-resources > .bk-resources-content {
  z-index: 60;
  overflow: visible;
  max-height: none;
}
.bk-unified-toolbar .bk-preview-options { z-index: auto; }
.bk-unified-toolbar .bk-display-popover { z-index: 60; }
.bk-unified-toolbar .bk-preview-resources .bk-toolbar-popover { z-index: 80; }
@media (min-width: 721px) {
  .bk-preview-resources .bk-toolbar-popover { inset-inline-start: 0; inset-inline-end: auto; }
}

.auth-foot { gap: 12px; flex-wrap: wrap; }
.auth-foot > button { appearance: none; border: 0; background: none; padding: 0; font: inherit; text-align: start; }
.auth-foot > button:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }


/* Landing keeps its immersive dark hero while the signed-in learning workspace uses the light studio canvas. */
body:has(.landing) { background: #101820; color: #f3f6f5; }
/* Landing, learner, teacher, and admin views share the same application palette. */
.landing { color: var(--ink); }
code, pre, kbd, .access-code, .xapi, .range-val, .meter__value, .gauge__value { font-family:var(--font-mono); }



/* Keep account and role controls readable when the app toolbar reaches desktop width limits. */
@media (max-width: 1450px) and (min-width: 761px) {
  .topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 14px;
    row-gap: 8px;
  }
  .topbar__right { display: contents; }
  .topbar__tools {
    grid-column: 2;
    grid-row: 1;
    justify-content: flex-end;
    flex-wrap: nowrap;
  }
  .topbar__account {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-end;
    border-inline-start: 0;
    border-block-start: 1px solid var(--line);
    padding-inline-start: 0;
    padding-block-start: 8px;
  }
}
@media (max-width: 760px) {
  .topbar { display: flex; }
  .topbar__right { display: flex; flex-direction: column; align-items: stretch; }
}


/* Teacher analysis takes over the canvas so evidence can be read without the authoring page behind it. */
.learning-analysis-overlay {
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  overflow: hidden;
  background: var(--bg);
}
.learning-analysis-modal {
  inline-size: 100%;
  max-inline-size: none;
  max-block-size: none;
  block-size: 100dvh;
  margin: 0;
  padding: clamp(20px, 3vw, 44px);
  overflow: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.learning-analysis-modal .between {
  position: sticky;
  inset-block-start: calc(-1 * clamp(20px, 3vw, 44px));
  z-index: 2;
  padding-block: 8px 14px;
  background: var(--panel);
  border-block-end: 1px solid var(--line);
}
@media (max-width: 700px) {
  .learning-analysis-modal { padding: 16px; }
  .learning-analysis-modal .between { inset-block-start: -16px; }
}


/* Teacher assignment workspace */
.assignment-overlay {
  position: fixed; inset: 0; z-index: 150; overflow-y: auto;
  padding: clamp(12px, 2.5vw, 28px); background: rgba(13, 27, 34, .72);
  backdrop-filter: blur(4px);
}
.assignment-workspace {
  inline-size: min(1180px, 100%); margin-inline: auto; padding: clamp(18px, 3vw, 30px);
  border-color: #cfdcdd; box-shadow: 0 24px 70px rgba(10, 31, 38, .22);
}
.assignment-workspace__header {
  justify-content: space-between; align-items: center; gap: 16px;
  padding-block-end: 14px; border-block-end: 1px solid var(--line);
}
.assignment-workspace__header h2 { margin: 0; font-size: clamp(20px, 2.4vw, 27px); }
.assignment-workspace > p { color: var(--mute); line-height: 1.55; }
.assignment-form { margin-block-start: 18px; }
.assignment-form > summary {
  cursor: pointer; color: var(--ink); font-size: 17px; font-weight: 700;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel2);
}
.assignment-form[open] > summary { margin-block-end: 18px; border-color: #b8d8d3; }
.assignment-field { display: grid; gap: 7px; margin-block: 12px; color: var(--ink); font-size: 13px; font-weight: 650; }
.assignment-field input, .assignment-field select {
  inline-size: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid #cbd8dc;
  border-radius: 8px; background: var(--panel); color: var(--ink); font-size: 14px;
}
.assignment-field--compact { display: flex; align-items: center; flex-wrap: wrap; }
.assignment-field--compact select { inline-size: auto; min-inline-size: 180px; }
.assignment-form > .muted-note { margin: -4px 0 14px; line-height: 1.5; }
.assignment-options {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 9px; margin-block: 14px;
}
.assignment-options label, .assignment-live-option, .assignment-tasks label {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--panel);
  color: var(--ink); line-height: 1.45; cursor: pointer;
}
.assignment-options label { min-height: 50px; }
.assignment-options label:has(input:checked), .assignment-live-option:has(input:checked),
.assignment-tasks label:has(input:checked) {
  border-color: #8bc9bd; background: var(--teal-soft);
}
.assignment-options input, .assignment-live-option input, .assignment-tasks input,
.assignment-safeguard__confirm input { flex: 0 0 auto; inline-size: 17px; block-size: 17px; margin: 2px 0 0; accent-color: var(--teal); }
.assignment-live-option { margin-block: 16px 10px; font-weight: 650; }
.assignment-privacy {
  margin: 0 0 18px; padding: 12px 14px; border-inline-start: 3px solid var(--blue);
  border-radius: 0 8px 8px 0; background: var(--blue-soft); color: #344f6c;
  font-size: 12.5px; line-height: 1.55;
}
.assignment-section-title { display: block; margin-block: 18px 9px; font-size: 15px; }
.assignment-tasks { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 8px; }
.assignment-safeguard {
  margin-block: 18px; padding: 15px; border: 1px solid #e2c38d; border-radius: 11px;
  background: #fff8eb;
}
.assignment-safeguard > details > summary { cursor: pointer; font-weight: 700; color: #75470f; }
.assignment-safeguard p, .assignment-safeguard li { line-height: 1.55; }
.assignment-safeguard__confirm {
  display: flex; align-items: flex-start; gap: 9px; margin-block-start: 14px;
  padding: 12px; border: 1px solid #dfbd7a; border-radius: 8px;
  background: #fff; font-weight: 650; line-height: 1.45; cursor: pointer;
}
.assignment-form > .btn { margin: 5px 8px 5px 0; }
.assignment-form > .muted-note { max-width: 850px; }
.assignment-panel {
  margin-block-start: 16px; padding: 16px; border: 1px solid var(--line);
  border-radius: 11px; background: var(--panel2);
}
.assignment-panel h3 { margin-block: 0 12px; font-size: 16px; }
.assignment-panel > .btn { margin: 4px 6px 4px 0; }
.assignment-panel input[readonly] { inline-size: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
@media (max-width: 620px) {
  .assignment-overlay { padding: 0; }
  .assignment-workspace { min-height: 100dvh; border-radius: 0; padding: 16px; }
  .assignment-workspace__header { align-items: flex-start; }
  .assignment-workspace__header h2 { font-size: 20px; }
  .assignment-field--compact { align-items: stretch; flex-direction: column; }
  .assignment-field--compact select { inline-size: 100%; }
  .assignment-form > .btn { inline-size: 100%; margin: 5px 0; }
  .assignment-panel { padding: 12px; }
}


/* Assignment monitoring, replay, and action-linked feedback */
.assignment-analysis-text { white-space: pre-wrap; line-height: 1.55; }
.assignment-table-wrap { max-inline-size: 100%; overflow-x: auto; }
.assignment-table { inline-size: 100%; border-collapse: collapse; font-size: 12.5px; }
.assignment-table th, .assignment-table td { padding: 9px 8px; border-block-end: 1px solid var(--line); text-align: start; vertical-align: top; }
.assignment-table th { color: var(--mute); font-weight: 650; background: var(--panel2); }
.assignment-block-label { display: block; }
.assignment-replay-range { display: block; inline-size: 100%; margin-block-start: 8px; }
.assignment-replay-card { margin-block: 10px; padding: 12px; }
.assignment-action-data {
  max-block-size: 180px; overflow: auto; white-space: pre-wrap;
  font: 12px/1.5 var(--font-mono); overflow-wrap: anywhere;
}
.assignment-feedback { margin-block-start: 12px; padding-block-start: 12px; border-block-start: 1px solid var(--line); }
.assignment-feedback__input {
  display: block; inline-size: 100%; margin-block-start: 6px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--panel);
  resize: vertical; font: inherit;
}
.assignment-feedback__actions { justify-content: space-between; margin-block-start: 6px; gap: 10px; }
