/* ALDOCTOR LMS — base design system.
   Logical properties only (inline-start/end) so the same rules serve RTL and LTR. */

:root {
  color-scheme: light;
  --brand: #14506b;
  --brand-ink: #0c3446;
  --brand-soft: #e6f0f4;
  --accent: #e8a13a;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --hover: #f1f4f7;
  --text: #17202b;
  --text-2: #3a4654;
  --muted: #5b6978;
  --border: #dde3ea;
  --input-bg: #ffffff;
  --input-border: #c7d0da;
  --chip-bg: #eef1f5;
  --chip-text: #2c3946;
  --on-brand: #ffffff;
  --link: #14506b;
  --side-bg: #0c3446;
  --side-text: #d5e2e8;
  --side-muted: #8fa9b6;
  --side-hover: rgba(255, 255, 255, .08);
  --scrim: rgba(10, 20, 30, .45);
  --ok: #17794b;
  --ok-soft: #e4f4ec;
  --ok-line: #b9e0cb;
  --ok-ink: #0f5a37;
  --warn: #9a5b00;
  --warn-soft: #fdf1dc;
  --warn-line: #f1d9a8;
  --warn-ink: #7a4800;
  --danger: #b93226;
  --danger-soft: #fbe9e7;
  --danger-line: #f1c1bb;
  --danger-ink: #8f241a;
  --info: #1c64a3;
  --info-soft: #e5f0fa;
  --info-line: #bcd6ee;
  --info-ink: #154d7f;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 32, 48, .06), 0 4px 14px rgba(16, 32, 48, .05);
  --side-w: 256px;
  --top-h: 60px;
  --font: "Segoe UI", "Noto Sans Arabic", "Noto Sans", Tahoma, Arial, sans-serif;
}

/* Night: chosen by the person (data-theme="dark"), or following the device when they chose nothing. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --brand: #4fa3c7;
  --brand-ink: #0a1d27;
  --brand-soft: #16303d;
  --accent: #f0b45a;
  --bg: #0f151b;
  --surface: #17202a;
  --surface-2: #1c2632;
  --hover: #223040;
  --text: #e4ebf1;
  --text-2: #c3cfda;
  --muted: #94a3b2;
  --border: #2b3946;
  --input-bg: #111921;
  --input-border: #3a4a59;
  --chip-bg: #253240;
  --chip-text: #d6e1ea;
  --on-brand: #06131a;
  --link: #7cc4e3;
  --side-bg: #0a141b;
  --side-text: #c9d7df;
  --side-muted: #7f97a4;
  --side-hover: rgba(255, 255, 255, .06);
  --scrim: rgba(0, 0, 0, .6);
  --ok: #5fd39a;
  --ok-soft: #133024;
  --ok-line: #23523b;
  --ok-ink: #9fe8c2;
  --warn: #f2bd62;
  --warn-soft: #33270f;
  --warn-line: #5a4416;
  --warn-ink: #f6d59a;
  --danger: #ff8a7d;
  --danger-soft: #3a1915;
  --danger-line: #6a2a22;
  --danger-ink: #ffc0b8;
  --info: #79b8f0;
  --info-soft: #132a3d;
  --info-line: #24486a;
  --info-ink: #b8dbfa;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    color-scheme: dark;
    --brand: #4fa3c7; --brand-ink: #0a1d27; --brand-soft: #16303d; --accent: #f0b45a;
    --bg: #0f151b; --surface: #17202a; --surface-2: #1c2632; --hover: #223040;
    --text: #e4ebf1; --text-2: #c3cfda; --muted: #94a3b2; --border: #2b3946;
    --input-bg: #111921; --input-border: #3a4a59; --chip-bg: #253240; --chip-text: #d6e1ea;
    --on-brand: #06131a; --link: #7cc4e3;
    --side-bg: #0a141b; --side-text: #c9d7df; --side-muted: #7f97a4; --side-hover: rgba(255, 255, 255, .06); --scrim: rgba(0, 0, 0, .6);
    --ok: #5fd39a; --ok-soft: #133024; --ok-line: #23523b; --ok-ink: #9fe8c2;
    --warn: #f2bd62; --warn-soft: #33270f; --warn-line: #5a4416; --warn-ink: #f6d59a;
    --danger: #ff8a7d; --danger-soft: #3a1915; --danger-line: #6a2a22; --danger-ink: #ffc0b8;
    --info: #79b8f0; --info-soft: #132a3d; --info-line: #24486a; --info-ink: #b8dbfa;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.3; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .8em; }
a { color: var(--link); }
img, svg { max-width: 100%; }
.ico { flex: none; vertical-align: middle; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.skip {
  position: absolute; inset-inline-start: 8px; top: -60px; z-index: 100;
  background: var(--brand-ink); color: #fff; padding: 8px 14px; border-radius: 8px;
}
.skip:focus { top: 8px; }

/* ── app shell ── */
.shell { display: flex; min-height: 100vh; }
.side {
  width: var(--side-w); flex: none; background: var(--side-bg); color: var(--side-text);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side__brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px; font-weight: 700; font-size: 1.05rem; color: #fff; text-decoration: none; }
.side__mark { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: var(--brand-ink); display: grid; place-items: center; font-weight: 800; }
.side__sec { padding: 14px 18px 4px; font-size: .74rem; letter-spacing: .04em; text-transform: uppercase; color: var(--side-muted); }
.side__nav { list-style: none; margin: 0; padding: 0 10px; }
.side__nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px;
  color: var(--side-text); text-decoration: none; font-size: .95rem;
}
.side__nav a:hover { background: var(--side-hover); color: #fff; }
.side__nav a[aria-current="page"] { background: var(--brand); color: #fff; font-weight: 600; }
.side__foot { margin-top: auto; padding: 14px 18px; font-size: .78rem; color: var(--side-muted); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top {
  height: var(--top-h); background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; padding: 0 18px; position: sticky; top: 0; z-index: 20;
}
.top__title { font-weight: 700; font-size: 1.05rem; margin-inline-end: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top__menu { display: none; }
.top__user { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--muted); }
.top__user strong { color: var(--text); }
.top form { margin: 0; }
.page { padding: 22px; max-width: 1280px; width: 100%; margin: 0 auto; }
.page__head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.page__head h1 { margin: 0; margin-inline-end: auto; }
.crumbs { font-size: .86rem; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }

.scrim { display: none; }

@media (max-width: 900px) {
  .side {
    position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 60; height: 100dvh;
    transform: translateX(-105%); transition: transform .2s ease;
  }
  [dir="rtl"] .side { transform: translateX(105%); }
  .shell.is-nav-open .side { transform: none; }
  .shell.is-nav-open .scrim { display: block; position: fixed; inset: 0; background: var(--scrim); z-index: 50; }
  .top__menu { display: inline-flex; }
  .top { padding: 0 10px; }
  .top__user .top__name { display: none; }
  .page { padding: 14px 12px; }
}
@media (max-width: 560px) {
  /* The page heading repeats the title; keep the bar for the help and language controls. */
  .top__title { visibility: hidden; }
}

/* ── buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: .92rem;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--hover); }
.btn--primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn--primary:hover { background: var(--brand-ink); }
.btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--danger:hover { filter: brightness(.92); background: var(--danger); }
.btn--ghost { border-color: transparent; background: transparent; }
.btn--ghost:hover { background: var(--hover); }
.btn--sm { min-height: 30px; padding: 3px 10px; font-size: .84rem; }
.btn--icon { padding: 7px; min-width: 38px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ── cards, grids ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card__head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.card__head h2, .card__head h3 { margin: 0; margin-inline-end: auto; }
.grid { display: grid; gap: 14px; }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat__label { color: var(--muted); font-size: .86rem; }
.stat__value { font-size: 1.6rem; font-weight: 700; line-height: 1.25; }
.stat__hint { color: var(--muted); font-size: .8rem; }

/* ── forms ── */
.form { display: grid; gap: 14px; }
.form--cols { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.field { display: grid; gap: 5px; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field > label, .label { font-weight: 600; font-size: .9rem; }
.field .hint, .hint { color: var(--muted); font-size: .82rem; }
.field .err { color: var(--danger); font-size: .84rem; }
.req::after { content: " *"; color: var(--danger); }
input[type="text"], input[type="password"], input[type="email"], input[type="tel"], input[type="number"],
input[type="date"], input[type="time"], input[type="search"], input[type="url"], select, textarea {
  width: 100%; min-height: 40px; padding: 8px 11px; font: inherit; color: var(--text);
  background: var(--input-bg); color: var(--text); border: 1px solid var(--input-border); border-radius: 8px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--brand-soft); border-color: var(--brand); }
.check { display: flex; align-items: flex-start; gap: 8px; }
.check input { width: 18px; height: 18px; margin-top: 3px; flex: none; }
.ltr { direction: ltr; text-align: start; unicode-bidi: plaintext; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.filters .field { flex: 1 1 160px; max-width: 260px; }
.filters .field--grow { max-width: none; flex: 2 1 220px; }

/* ── tables ── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.t { width: 100%; border-collapse: collapse; font-size: .92rem; }
.t th, .t td { padding: 10px 12px; text-align: start; border-bottom: 1px solid var(--border); vertical-align: middle; }
.t th { background: var(--surface-2); font-weight: 700; font-size: .84rem; color: var(--muted); white-space: nowrap; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover { background: var(--surface-2); }
.t .actions { white-space: nowrap; text-align: end; }
.t .actions form { display: inline; }

@media (max-width: 720px) {
  /* Tables become stacked cards so nothing scrolls sideways on a phone. */
  .t--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .t--stack, .t--stack tbody, .t--stack tr, .t--stack td { display: block; width: 100%; }
  .t--stack tr { border-bottom: 1px solid var(--border); padding: 8px 0; }
  .t--stack td { border: 0; padding: 4px 12px; display: flex; gap: 10px; justify-content: space-between; align-items: baseline; }
  .t--stack td::before { content: attr(data-label); color: var(--muted); font-size: .82rem; flex: none; }
  .t--stack td.actions { justify-content: flex-start; flex-wrap: wrap; }
  .t--stack td.actions::before { content: none; }
}

/* ── chips, alerts ── */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--chip-bg); color: var(--chip-text); white-space: nowrap; }
.chip--ok { background: var(--ok-soft); color: var(--ok); }
.chip--warn { background: var(--warn-soft); color: var(--warn); }
.chip--danger { background: var(--danger-soft); color: var(--danger); }
.chip--info { background: var(--info-soft); color: var(--info); }
.chip--quiz { background: var(--warn-soft); color: var(--warn); font-size: .72rem; padding: 1px 7px; }
/* the unlock list: how each item was opened, one line per opening */
.cl-via + .cl-via { margin-top: 6px; }
.cl-via .small { margin-top: 2px; }
.cl-table tr.cl-quiz td { background: color-mix(in srgb, var(--warn-soft) 35%, transparent); }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 9px; border: 1px solid; margin-bottom: 14px; }
.alert--success { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok-ink); }
.alert--error { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger-ink); }
.alert--info { background: var(--info-soft); border-color: var(--info-line); color: var(--info-ink); }
.alert--warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-ink); }
.alert p:last-child { margin: 0; }
.empty { text-align: center; color: var(--muted); padding: 34px 14px; }
.empty strong { display: block; color: var(--text); margin-bottom: 4px; }

/* ── tabs, pagination ── */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"] { color: var(--brand); border-bottom-color: var(--brand); }
.pager { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: space-between; margin-top: 12px; font-size: .88rem; color: var(--muted); }
.pager__links { display: flex; gap: 6px; }

/* ── auth pages ── */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 20px 14px; background: linear-gradient(160deg, var(--brand-ink), var(--brand)); }
.auth__card { width: 100%; max-width: 420px; background: var(--surface); border-radius: 14px; padding: 26px 24px; box-shadow: 0 18px 50px rgba(0, 0, 0, .25); }
.auth__brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; margin-bottom: 4px; }
.auth__sub { color: var(--muted); margin-bottom: 18px; }
.auth__links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 16px; font-size: .9rem; }
.auth--family { background: linear-gradient(160deg, #3b2a5a, #6a4a8f); }
.auth__lang { margin-top: 14px; text-align: center; }
.auth__lang button { background: none; border: 0; color: #fff; text-decoration: underline; cursor: pointer; font: inherit; }

/* ── help drawer ── */
.drawer { position: fixed; inset-block: 0; inset-inline-end: 0; width: min(460px, 100vw); background: var(--surface); z-index: 80; box-shadow: -8px 0 30px rgba(0, 0, 0, .18); display: flex; flex-direction: column; }
[dir="rtl"] .drawer { box-shadow: 8px 0 30px rgba(0, 0, 0, .18); }
.drawer__head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.drawer__head h2 { margin: 0; margin-inline-end: auto; font-size: 1.02rem; }
.drawer__body { padding: 16px; overflow-y: auto; flex: 1; }
.drawer-scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 70; }

.guide h3 { margin-top: 1.2em; color: var(--brand-ink); font-size: .98rem; }
.guide ol, .guide ul { margin: 0 0 .8em; padding-inline-start: 1.3em; }
.guide li { margin-bottom: .35em; }
.guide dl { margin: 0; }
.guide dt { font-weight: 700; margin-top: .6em; }
.guide dd { margin: 0; color: var(--text-2); }
.guide__meta { color: var(--muted); font-size: .82rem; margin-bottom: 10px; }
.guide__risk { background: var(--warn-soft); border-radius: 8px; padding: 8px 12px; }
.guide__risk ul { margin: 0; }

/* ── permission matrix ── */
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: start; font-weight: 600; }
.matrix input[type="checkbox"] { width: 18px; height: 18px; }

.kv { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 6px 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.checklist li:last-child { border-bottom: 0; }
.checklist .is-done { color: var(--muted); text-decoration: line-through; }

.codebox { direction: ltr; text-align: start; font-family: ui-monospace, Consolas, monospace; font-size: .86rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; overflow-wrap: anywhere; user-select: all; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .side, .top, .btn, .filters, .drawer, .no-print { display: none !important; }
  :root { color-scheme: light; --bg: #fff; --surface: #fff; --text: #000; --muted: #333; --border: #999; --link: #000; }
  body { background: #fff; }
  .card, .table-wrap { box-shadow: none; border-color: #999; }
}

/* ── lessons and receipts ── */
.prose { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; }
.receipt { display: block; max-width: 100%; max-height: 420px; margin-top: 8px; border: 1px solid var(--border); border-radius: 8px; }
fieldset.field { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin: 0 0 12px; min-width: 0; }
fieldset.field legend { padding: 0 6px; font-weight: 600; }
fieldset.field .field { margin: 4px 0 10px; padding-inline-start: 28px; }
.checklist li > .ico { flex: none; margin-top: 2px; }
.checklist li > div { flex: 1; min-width: 0; }
.checklist li h3 { margin: 6px 0 0; font-size: 1rem; }

/* ── unread badge (sidebar and lists) ── */
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: #fff; font-size: .74rem; font-weight: 700; flex: none; }
.badge--quiet { background: var(--muted); }
.side__nav .badge { margin-inline-start: auto; background: var(--accent); color: #1d1300; }

/* class QR on the register */
.qr-box { max-width: 240px; padding: 10px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.qr-box svg { display: block; width: 100%; height: auto; }

/* top-bar search (staff) */
.top__search { flex: 0 1 240px; min-width: 0; }
.top__search input { width: 100%; }
.top__searchlink { display: none; }
.top__user .top__name { white-space: nowrap; }
/* Below a wide desktop the bar has no room for a field: a magnifier opens the search page instead. */
@media (max-width: 1180px) { .top__search { display: none; } .top__searchlink { display: inline-flex; } }

/* way back from a detail page to its list */
.crumbs { margin-block-end: var(--s-3, 12px); font-size: .9rem; }
.crumbs a { display: inline-flex; gap: .35em; align-items: center; text-decoration: none; }
.crumbs a:hover, .crumbs a:focus-visible { text-decoration: underline; }
[dir="rtl"] .crumbs a span { transform: scaleX(-1); }
@media print { .crumbs { display: none; } }

/* Phone width: the help button keeps its icon and its name for screen readers, the words go
   (in English "How to use this page" pushed the sign-out button off a 375px screen). */
@media (max-width: 460px) {
  .top [data-help] span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .top { gap: 6px; }
}

/* ── online tests ── */
.quizq { scroll-margin-top: calc(var(--top-h) + 64px); }
.quizq--ok { border-inline-start: 4px solid var(--ok); }
.quizq--bad { border-inline-start: 4px solid var(--danger); }
.quizq__body { font-size: 1.05rem; line-height: 1.8; overflow-wrap: anywhere; }
.quizq__img { display: block; max-width: min(100%, 560px); height: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.quizq__opts { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.quizq__opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; min-height: 44px; }
.quizq__opt:hover { background: var(--brand-soft); }
.quizq__opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.quizq__opt:has(input:disabled) { cursor: default; }
.quizq__opt input { margin-block-start: .3em; flex: none; }
.quizq__fill input { display: inline-block; width: 11em; max-width: 100%; margin: 2px 4px; }
.quizq__pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 14em); gap: 10px; align-items: center; }
.quizq__pair label { margin: 0; overflow-wrap: anywhere; }
.quizq__text { white-space: normal; overflow-wrap: anywhere; }
.quizq__ol { margin: 0; padding-inline-start: 1.4em; }
.quizq__key { margin-block-start: 10px; }
.quizbar { position: sticky; top: var(--top-h); z-index: 5; display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; padding: 10px 14px; margin-block-end: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.quizbar__time { margin-inline-start: auto; }
.quizbar__time strong { font-size: 1.15rem; }
.quizbar--soon .quizbar__time strong { color: var(--danger); }
.quiznav { align-items: center; margin-block: 14px 6px; }
.quizopt { display: flex; gap: 10px; align-items: center; margin-block-end: 8px; }
.quizopt input[type="text"] { flex: 1 1 auto; min-width: 0; }
.quizopt--pair input[type="text"] { flex: 1 1 0; }
.quizmark { margin-block: -6px 18px; padding: 10px 12px; background: var(--brand-soft); border-radius: var(--radius); }
@media (max-width: 560px) {
  .quizq__pair { grid-template-columns: 1fr; }
  .quizopt--pair { flex-wrap: wrap; }
  .quizbar__time { margin-inline-start: 0; }
}
@media print { .quizbar, .quiznav, .quizmark { display: none; } }

.quizq__key { margin: 0 0 10px; padding-inline-start: 1.3em; }
.quizq__key li.is-right { font-weight: 600; }

/* theme switch in the top bar */
.theme-toggle .ico--moon { display: none; }
:root[data-theme="dark"] .theme-toggle .ico--sun { display: none; }
:root[data-theme="dark"] .theme-toggle .ico--moon { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .ico--sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .ico--moon { display: inline; }
}
.auth__theme { position: fixed; inset-block-start: 10px; inset-inline-end: 10px; color: #fff; }

/* learning: progress bars, announcements, questions */
.progress { block-size: 10px; border-radius: 999px; background: var(--chip-bg); overflow: hidden; margin-block: 8px 4px; }
.progress > span { display: block; block-size: 100%; background: var(--ok); border-radius: inherit; }
.progress--sm { block-size: 6px; inline-size: 120px; display: inline-block; vertical-align: middle; margin: 0 0 0 6px; }
.news { padding-block: 10px; border-block-start: 1px solid var(--border); }
.news:first-of-type { border-block-start: 0; }
.news h3 { margin: 0; }
.qa { padding-block: 10px; border-block-start: 1px solid var(--border); }
.qa--open { border-inline-start: 3px solid var(--warn); padding-inline-start: 10px; }
.qa__answer { margin-inline-start: 18px; padding: 8px 10px; border-radius: var(--radius); background: var(--surface-2); margin-block: 6px; }

/* course rating */
.review { margin-block: 8px; }
.stars { border: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.stars label { display: inline-flex; gap: 4px; align-items: center; color: var(--accent); }

/* ══ Visual refresh (2026-10): softer surfaces, clearer hierarchy, calmer controls.
   Overrides only; every colour comes from the tokens, so day and night follow. ══ */
:root { --radius: 14px; --radius-sm: 10px; --ring: 0 0 0 3px var(--brand-soft); --shadow-lg: 0 10px 30px rgba(16, 32, 48, .08); }
::selection { background: var(--brand-soft); color: var(--text); }
html { scroll-behavior: smooth; }
body { font-size: 15.5px; letter-spacing: .005em; }
h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 1.12rem; font-weight: 700; }
a { text-underline-offset: 3px; }
.eyebrow { margin: 0 0 4px; font-size: .82rem; font-weight: 700; color: var(--brand); letter-spacing: .02em; }

/* shell */
.side { border-inline-end: 1px solid rgba(255, 255, 255, .04); }
.side__brand { padding: 18px 18px 14px; }
.side__mark { border-radius: 11px; box-shadow: 0 4px 14px rgba(232, 161, 58, .35); }
.side__sec { padding: 18px 20px 6px; font-size: .7rem; font-weight: 700; letter-spacing: .08em; }
.side__nav { padding: 0 10px; display: grid; gap: 2px; }
.side__nav a { padding: 9px 12px; border-radius: var(--radius-sm); transition: background .15s, color .15s; border-inline-start: 3px solid transparent; }
.side__nav a[aria-current="page"] { background: rgba(255, 255, 255, .1); border-inline-start-color: var(--accent); color: #fff; }
.side__nav a .ico { opacity: .85; }
.top { background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); }
.page { padding: 26px 28px 40px; }
.page__head { margin-bottom: 18px; }
@media (max-width: 900px) { .page { padding: 16px 12px 32px; } }

/* surfaces */
.card { border-radius: var(--radius); padding: 20px 22px; border-color: color-mix(in srgb, var(--border) 80%, transparent); box-shadow: var(--shadow); }
.card > h2:first-child { margin-bottom: 12px; }
.card__head { margin-bottom: 14px; }
.stat { border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); border-block-start: 3px solid var(--brand); text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
a.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat--pick[aria-current="page"] { outline: 2px solid var(--accent); outline-offset: 2px; }
.stat__value { font-size: 1.75rem; font-weight: 800; }
.table-wrap { border-radius: var(--radius); box-shadow: var(--shadow); }
.t th { font-size: .78rem; letter-spacing: .03em; padding-block: 11px; }
.t td { padding-block: 12px; }
.empty { border: 1px dashed var(--border); border-radius: var(--radius); background: var(--surface); padding: 40px 16px; }
.alert { border-radius: var(--radius-sm); }

/* controls */
.btn { min-height: 40px; padding: 8px 16px; border-radius: var(--radius-sm); transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn--primary { box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 35%, transparent); }
.btn--primary:hover { background: color-mix(in srgb, var(--brand) 88%, #000); border-color: color-mix(in srgb, var(--brand) 88%, #000); }
.btn--sm { min-height: 32px; padding: 4px 12px; border-radius: 9px; }
.form .btn { justify-self: start; }
input[type="text"], input[type="password"], input[type="email"], input[type="tel"], input[type="number"],
input[type="date"], input[type="time"], input[type="search"], input[type="url"], input[type="datetime-local"], select, textarea {
  min-height: 42px; border-radius: var(--radius-sm); transition: border-color .15s, box-shadow .15s;
}
input[type="datetime-local"] { width: 100%; padding: 8px 11px; font: inherit; color: var(--text); background: var(--input-bg); border: 1px solid var(--input-border); }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: var(--ring); border-color: var(--brand); }
.chip { padding: 3px 10px; }
.tabs { gap: 6px; border-bottom-width: 1px; }
.tabs a { border-radius: var(--radius-sm) var(--radius-sm) 0 0; transition: color .15s, background .15s; }
.tabs a:hover { background: var(--hover); color: var(--text); }

/* lists */
.checklist li { padding-block: 8px; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.timeline li { padding-inline-start: 14px; border-inline-start: 2px solid var(--border); }

/* auth pages */
.auth__card { border-radius: 18px; padding: 30px 28px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }

/* plain buttons stand out from the card they sit on, in day and night */
.btn:not(.btn--primary):not(.btn--danger):not(.btn--ghost) { background: var(--surface-2); border-color: var(--input-border); }
.btn:not(.btn--primary):not(.btn--danger):not(.btn--ghost):hover { background: var(--hover); }
.t td:first-child a, .t td a strong { overflow-wrap: normal; }
/* icon-only buttons keep a square shape (the refresh padding above is for text buttons) */
.btn--icon { padding: 8px; min-width: 40px; }
.btn .ico { flex: none; min-width: 18px; }

/* ══ ALDOCTOR brand identity (from aldoctoracademy.com): night purple, ALDOCTOR yellow, lavender.
   --brand is the brand colour for text, links and borders; --primary is the yellow of the main buttons. ══ */
:root {
  color-scheme: light;
  --font: "IBM Plex Sans Arabic", "IBM Plex Sans", "Segoe UI", Tahoma, Arial, sans-serif;
  --font-display: "Bricolage Grotesque", "Alexandria", "IBM Plex Sans Arabic", "Segoe UI", sans-serif;
  --primary: #ffd400; --on-primary: #0a0800; --primary-hover: #f2c900;
  --brand: #6a3fb0; --brand-ink: #3d2270; --brand-soft: #f1eafb; --accent: #ffd400; --link: #6a3fb0;
  --bg: #f6f3fb; --surface: #ffffff; --surface-2: #f8f5fc; --hover: #f0eaf8;
  --text: #1a1426; --text-2: #3b3150; --muted: #6b5f80; --border: #e4dcef;
  --input-bg: #ffffff; --input-border: #cfc3df; --chip-bg: #f0eaf8; --chip-text: #4b3a6a; --on-brand: #ffffff;
  --side-bg: #100d1a; --side-text: #c9b8de; --side-muted: #8a7da0; --side-hover: rgba(201, 184, 222, .08); --scrim: rgba(8, 7, 13, .55);
  --info: #6a3fb0; --info-soft: #f1eafb; --info-line: #d9c8f2; --info-ink: #4b2a85;
  --shadow: 0 1px 2px rgba(26, 20, 38, .05), 0 6px 18px rgba(26, 20, 38, .06);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --brand: #c9b8de; --brand-ink: #ece5f6; --brand-soft: #2c2639; --accent: #ffd400; --link: #d9c9ee; --on-brand: #100d1a;
  --bg: #100d1a; --surface: #1a1626; --surface-2: #211c2e; --hover: #2a2338;
  --text: #ffffff; --text-2: #dcd6e6; --muted: #a497b8; --border: #2f2a3c;
  --input-bg: #141020; --input-border: #463e57; --chip-bg: #2c2639; --chip-text: #e2d8ef;
  --side-bg: #08070d; --side-text: #c9b8de; --side-muted: #7d7192; --side-hover: rgba(201, 184, 222, .08); --scrim: rgba(0, 0, 0, .6);
  --info: #c3a6f5; --info-soft: #2a2140; --info-line: #4a3a6e; --info-ink: #e0d2fb;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .3);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    color-scheme: dark;
    --brand: #c9b8de; --brand-ink: #ece5f6; --brand-soft: #2c2639; --accent: #ffd400; --link: #d9c9ee; --on-brand: #100d1a;
    --bg: #100d1a; --surface: #1a1626; --surface-2: #211c2e; --hover: #2a2338;
    --text: #ffffff; --text-2: #dcd6e6; --muted: #a497b8; --border: #2f2a3c;
    --input-bg: #141020; --input-border: #463e57; --chip-bg: #2c2639; --chip-text: #e2d8ef;
    --side-bg: #08070d; --side-text: #c9b8de; --side-muted: #7d7192; --side-hover: rgba(201, 184, 222, .08); --scrim: rgba(0, 0, 0, .6);
    --info: #c3a6f5; --info-soft: #2a2140; --info-line: #4a3a6e; --info-ink: #e0d2fb;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .3);
  }
}
h1, h2, h3, .side__brand, .stat__value, .btn, .auth__brand, .cert__title, .cert__name { font-family: var(--font-display); }
h1 { font-weight: 800; }
/* main buttons: the yellow pill of the site */
.btn { border-radius: 999px; }
.btn--primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); box-shadow: 0 4px 14px rgba(255, 212, 0, .22); }
.btn--primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); }
.btn--icon { border-radius: 12px; }
.skip { background: var(--side-bg); }
.side__mark { color: var(--on-primary); }
.side { background: var(--side-bg); background-image: radial-gradient(120% 60% at 50% 0%, rgba(122, 76, 184, .22), transparent 70%); }
.side__nav a[aria-current="page"] { background: rgba(122, 76, 184, .5); border-inline-start-color: var(--primary); }
.tabs a[aria-current="page"] { color: var(--link); border-bottom-color: var(--primary); }
.stat { border-block-start-color: var(--primary); }
.eyebrow { color: var(--link); text-transform: uppercase; letter-spacing: .08em; }
.lk [aria-pressed="true"] { color: var(--surface); }
.progress > span { background: linear-gradient(90deg, var(--primary), #f2a900); }
/* sign-in pages: the dark purple glow of the site */
.auth, .auth--family { background: #100d1a; background-image: radial-gradient(70% 55% at 50% 0%, rgba(122, 76, 184, .45), transparent 70%), radial-gradient(40% 35% at 85% 100%, rgba(255, 212, 0, .08), transparent 70%); }
.auth__card { border: 1px solid rgba(201, 184, 222, .16); }
.auth__lang button, .auth__theme { color: #c9b8de; }

/* logo, Dr. Maher */
.side__brand { padding: 20px 18px 12px; }
.side__logo { display: block; inline-size: 100%; max-inline-size: 190px; block-size: auto; }
.auth { grid-template-columns: auto; gap: 24px; justify-items: center; }
.auth__col { display: grid; justify-items: center; gap: 16px; inline-size: 100%; max-inline-size: 420px; }
.auth__logo { inline-size: min(300px, 80%); block-size: auto; }
.auth__hero { display: none; }
@media (min-width: 980px) {
  .auth { grid-template-columns: minmax(0, 420px) minmax(0, 420px); align-items: center; justify-content: center; gap: 56px; }
  .auth__hero { display: block; inline-size: 100%; max-inline-size: 420px; block-size: auto; filter: drop-shadow(0 30px 60px rgba(122, 76, 184, .45)); }
}
.auth__brand { justify-content: center; color: var(--muted); font-size: .95rem; font-weight: 600; }
.hello { display: flex; align-items: center; gap: 16px; margin-block-end: 16px; padding: 14px 18px; border-radius: var(--radius); background: #100d1a; background-image: radial-gradient(80% 120% at 0% 0%, rgba(122, 76, 184, .5), transparent 70%); color: #fff; }
.hello img { inline-size: 84px; block-size: 84px; object-fit: cover; object-position: top; border-radius: 50%; background: rgba(201, 184, 222, .12); flex: none; }
.hello p { margin: 0; font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; }


/* 3D DNA (js/dna.js): behind the sign-in pages and, quietly, in the dashboard menu */
.dna-bg { position: fixed; inset: 0; inline-size: 100%; block-size: 100%; z-index: 0; pointer-events: none; }
.auth { position: relative; z-index: 1; background-color: transparent; }
body:not(.site):has(> .dna-bg) { background: #100d1a; }
.auth, .auth--family { background-image: radial-gradient(70% 55% at 50% 0%, rgba(122, 76, 184, .45), transparent 70%), radial-gradient(40% 35% at 85% 100%, rgba(255, 212, 0, .08), transparent 70%); background-color: transparent; }
.side { isolation: isolate; }
.side__dna { position: absolute; inset: 0; inline-size: 100%; block-size: 100vh; z-index: -1; pointer-events: none; }
.auth__home { display: flex; justify-content: center; inline-size: 100%; }

/* "How to use" on the sign-in pages */
.auth__help { display: inline-flex; align-items: center; gap: 6px; color: #c9b8de; font-size: .92rem; text-decoration: underline; text-underline-offset: 3px; }
.auth__help:hover { color: #ffd400; }

/* a label that wraps its own input (row forms in tables): the field sits under the text, full width */
.field > label:not(.check):has(> input, > select, > textarea) { display: grid; gap: 5px; }
.field > label:not(.check) > input:not([type="checkbox"]):not([type="radio"]), .field > label:not(.check) > select, .field > label:not(.check) > textarea { inline-size: 100%; min-inline-size: 0; }
td details[open] { min-inline-size: min(280px, 80vw); }
td details[open] > form { margin-block-start: 8px; }
.pre { white-space: pre-line; margin: 6px 0; overflow-wrap: anywhere; }
/* a form never spreads its rows to fill a taller neighbour (two forms side by side) */
.form { align-content: start; }
.form > .btn, .form > button { align-self: start; }

/* group page: choose students to add */
.pick__find { flex: 1 1 260px; }
.pick__table td:first-child, .pick__table th:first-child { inline-size: 36px; }
.pick__go { margin-block-start: 12px; }
.pick__codes { margin-block-start: 14px; padding: 10px 14px; border: 1px dashed var(--border); border-radius: var(--radius); }
.pick__codes summary { cursor: pointer; color: var(--link); font-weight: 600; }
.pick__codes[open] summary { margin-block-end: 10px; }
.pick__table tbody tr { cursor: pointer; }
.pick__table tbody tr:has(.js-pick:checked), .pick__table tbody tr:has(.js-pick:checked):hover { background: var(--brand-soft); }
.pick__table td:last-child { white-space: nowrap; }
.pick__go { position: sticky; inset-block-end: 0; z-index: 5; padding: 12px 14px; margin-inline: -14px; background: var(--surface); border-block-start: 1px solid var(--border); box-shadow: 0 -8px 18px rgba(16, 32, 48, .06); }
@media (max-width: 720px) {
  /* one compact line per student: tick · name, code and year · groups now */
  .pick__table tbody tr { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "box name code" "box year year" "box now now"; gap: 2px 12px; align-items: center; padding: 10px 12px; }
  .pick__table tbody td { display: block; inline-size: auto; padding: 0; }
  .pick__table tbody td::before { content: none; }
  .pick__table td:nth-child(1) { grid-area: box; }
  .pick__table td:nth-child(2) { grid-area: code; color: var(--muted); font-size: .85rem; }
  .pick__table td:nth-child(3) { grid-area: name; font-weight: 600; }
  .pick__table td:nth-child(4) { grid-area: year; color: var(--muted); font-size: .85rem; }
  .pick__table td:nth-child(5) { grid-area: now; font-size: .85rem; }
  .pick__table td:nth-child(6), .pick__table td:nth-child(7) { display: none; }
  .pick__table td:first-child input { inline-size: 20px; block-size: 20px; }
  .pick__go { flex-wrap: wrap; }
  .pick__go .btn--primary { flex: 1 1 100%; }
}

/* 0.20.0 Import from the old site */
.import-run { display: grid; gap: 12px; margin-block-start: 8px; }
.import-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 6px; }
.import-steps li { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-size: .92rem; }
.import-steps li::before { content: "○"; color: var(--muted); }
.import-steps li .import-steps__name { flex: 1; }
.import-steps li .import-steps__state { color: var(--muted); }
.import-steps li.is-running { border-color: var(--warn-line); background: var(--warn-soft); }
.import-steps li.is-running::before { content: "◔"; color: var(--warn-ink); }
.import-steps li.is-done { border-color: var(--ok-line); background: var(--ok-soft); }
.import-steps li.is-done::before { content: "✓"; color: var(--ok-ink); font-weight: 700; }
.import-steps li.is-failed { border-color: var(--danger-line); background: var(--danger-soft); }
.import-steps li.is-failed::before { content: "!"; color: var(--danger-ink); font-weight: 700; }
.import-bar { block-size: 8px; border-radius: 99px; background: var(--border); overflow: hidden; }
.import-bar i { display: block; block-size: 100%; inline-size: 0; background: var(--brand); transition: inline-size .3s; }
.import-msg { margin: 0; font-weight: 600; min-block-size: 1.4em; }
.import-run > .btn { justify-self: start; }

/* 0.21.0 pictures with the choices of a test */
.quizq__optimg { display: inline-block; vertical-align: middle; max-inline-size: min(100%, 220px); max-block-size: 160px; block-size: auto; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.quizq__opt .quizq__optimg, .quizq__pair .quizq__optimg { display: block; margin-block: 4px; }
.quizq__key .quizq__optimg, .chip .quizq__optimg { max-block-size: 64px; max-inline-size: 96px; }
.quizq__pics { display: flex; flex-wrap: wrap; gap: 12px; margin-block-end: 10px; }
.quizq__pics figure { margin: 0; text-align: center; }
.quizq__pics figcaption { font-weight: 700; }
.quizopt__pic { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.quizopt__file { max-inline-size: 190px; font-size: .82rem; }
@media (max-width: 640px) { .quizopt { flex-wrap: wrap; } .quizopt__pic { flex-basis: 100%; } }

/* 0.21.0 menu sections open and close */
.side__group { margin: 0; }
.side__group > summary.side__sec {
  list-style: none; cursor: pointer; user-select: none; display: flex; align-items: center; gap: 8px;
  margin: 4px 10px 0; padding: 11px 12px; border-radius: var(--radius-sm);
  font-size: .8rem; font-weight: 700; letter-spacing: .02em; text-transform: none; color: var(--side-text);
  transition: background .15s, color .15s;
}
.side__group > summary.side__sec::-webkit-details-marker { display: none; }
.side__group > summary.side__sec:hover { background: var(--side-hover); color: #fff; }
.side__group > summary.side__sec:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.side__group > summary.side__sec::after {
  content: ""; margin-inline-start: 6px; inline-size: 7px; block-size: 7px;
  border-inline-end: 2px solid currentColor; border-block-end: 2px solid currentColor;
  transform: rotate(45deg); transition: transform .2s; opacity: .8;
}
.side__group:not([open]) > summary.side__sec::after { transform: rotate(-45deg); }
[dir="rtl"] .side__group > summary.side__sec::after { transform: rotate(-45deg); }
[dir="rtl"] .side__group:not([open]) > summary.side__sec::after { transform: rotate(45deg); }
.side__count { margin-inline-start: auto; min-inline-size: 22px; padding: 1px 7px; border-radius: 99px; background: rgba(255, 255, 255, .08); color: var(--side-muted); font-size: .72rem; text-align: center; }
.side__group[open] > summary .side__count { visibility: hidden; }
.side__group[data-here] > summary.side__sec { color: #fff; }
.side__group > .side__nav { padding-block-end: 6px; }
@media (prefers-reduced-motion: reduce) { .side__group > summary.side__sec::after { transition: none; } }

/* 0.23.0 class content and access */
.class-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-block: 4px 14px; }
.step-n { display: inline-grid; place-items: center; inline-size: 28px; block-size: 28px; border-radius: 50%; background: var(--accent); color: #1d1300; font-size: .9rem; margin-inline-end: 6px; }
.class-mats { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.class-more { margin-block-start: 10px; }
.class-more > summary { list-style: none; cursor: pointer; display: inline-flex; }
.class-more > summary::-webkit-details-marker { display: none; }
.class-more[open] > summary { margin-block-end: 10px; }
.class-days input { max-inline-size: 140px; }
.class-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-block-start: 10px; position: sticky; inset-block-end: 0; background: var(--surface); padding-block: 8px; border-block-start: 1px solid var(--border); }
.class-bulk input[type="number"] { inline-size: 90px; }
.class-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.class-log li { padding-block-end: 8px; border-block-end: 1px dashed var(--border); line-height: 1.8; }
.class-log li:last-child { border-block-end: 0; }
.class-log__at { color: var(--muted); font-size: .85rem; margin-inline-end: 8px; }

/* 0.23.2 import: what will not come over */
.left-out > summary { cursor: pointer; }
.left-out h4 { margin: 12px 0 4px; font-size: .95rem; }
.left-out ul { margin: 0; padding-inline-start: 20px; }
.left-out li { margin-block: 2px; overflow-wrap: anywhere; }

/* 0.24.0 class test and assignment */
.class-sub { margin-block-start: 18px; padding-block-start: 14px; border-block-start: 1px dashed var(--border); }
.class-sub h3 { margin: 0 0 8px; font-size: 1rem; }
.class-row { display: grid; gap: 4px; }
.class-gate { margin-block-start: 10px; }

/* 0.24.0 import: compare with the old site */
.verify { margin-block: 18px; padding-block-start: 14px; border-block-start: 1px dashed var(--border); }
.verify .small { overflow-wrap: anywhere; }

/* 0.25.0 course content builder (topics with lessons, tests and assignments) */
.course-sum { display: grid; gap: 10px; }
.course-sum__facts { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); }
.course-sum__facts > span { display: inline-flex; align-items: center; gap: 6px; }
.course-sum__counts { display: flex; flex-wrap: wrap; gap: 6px; }
.course-sum .btn-row { margin: 0; }
.cb { display: grid; gap: 14px; }
.cb-topic { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: visible; }
.cb-topic[open] { border-color: color-mix(in srgb, var(--brand) 35%, var(--border)); }
.cb-topic__head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; list-style: none; background: var(--surface-2); border-radius: var(--radius); font-weight: 700; }
.cb-topic[open] > .cb-topic__head { border-end-start-radius: 0; border-end-end-radius: 0; border-block-end: 1px solid var(--border); }
.cb-topic__head::-webkit-details-marker { display: none; }
.cb-topic__head::before { content: ""; inline-size: 8px; block-size: 8px; border-inline-end: 2px solid currentColor; border-block-end: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s; opacity: .6; }
.cb-topic:not([open]) > .cb-topic__head::before { transform: rotate(-45deg); }
[dir="rtl"] .cb-topic:not([open]) > .cb-topic__head::before { transform: rotate(135deg); }
.cb-topic__title { margin-inline-end: auto; }
.cb-empty { margin: 12px 16px 0; }
.cb-items { list-style: none; margin: 0; padding: 6px 8px; display: grid; }
.cb-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; flex-wrap: wrap; }
.cb-item + .cb-item { border-block-start: 1px solid var(--border); border-radius: 0; }
.cb-item:hover { background: var(--hover); }
.cb-item:target { background: var(--brand-soft); }
.cb-item__icon { display: inline-grid; place-items: center; inline-size: 30px; block-size: 30px; border-radius: 8px; flex: none; background: var(--chip-bg); color: var(--muted); }
.cb-item--lesson .cb-item__icon { background: var(--info-soft); color: var(--info); }
.cb-item--quiz .cb-item__icon { background: var(--warn-soft); color: var(--warn); }
.cb-item--assignment .cb-item__icon { background: var(--ok-soft); color: var(--ok); }
.cb-item__main { display: grid; gap: 1px; margin-inline-end: auto; min-inline-size: 0; flex: 1 1 200px; }
.cb-item__main a { font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.cb-item__main a:hover { text-decoration: underline; }
.cb-item__move { display: inline-flex; gap: 2px; }
/* "Who watched / who took it": the lesson's people, centre or online, attended or not. */
.cb-item__who { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.cb-item__who svg { inline-size: 16px; block-size: 16px; }
.cb-item__more, .cb-add__one { position: relative; }
.cb-item__more > summary, .cb-add__one > summary { list-style: none; }
.cb-item__more > summary::-webkit-details-marker, .cb-add__one > summary::-webkit-details-marker { display: none; }
.cb-pop { position: absolute; z-index: 20; inset-inline-end: 0; inset-block-start: calc(100% + 6px); min-inline-size: 260px; display: grid; gap: 8px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
.cb-add .cb-pop { inset-inline-end: auto; inset-inline-start: 0; }
details:not([open]) > .cb-pop { display: none; }
.cb-add__end .cb-pop { inset-inline-start: auto; inset-inline-end: 0; }
.cb-pop form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cb-pop label { font-size: .85rem; color: var(--muted); }
.cb-add { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 16px 14px; border-block-start: 1px dashed var(--border); }
.cb-add__end { margin-inline-start: auto; }
.cb-newtopic { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px; border: 1px dashed var(--border); border-radius: var(--radius); }
.cb-newtopic input { flex: 1 1 240px; }
.cb-n { flex: none; inline-size: 96px !important; min-inline-size: 96px; display: inline-block; margin-inline-start: 6px; }
.check:has(.cb-n) { align-items: center; flex-wrap: wrap; }
@media (max-width: 560px) {
  .cb-pop { position: static; min-inline-size: 0; inline-size: 100%; box-sizing: border-box; margin-block-start: 6px; box-shadow: none; }
  .cb-pop input, .cb-pop select { min-inline-size: 0; max-inline-size: 100%; flex: 1 1 140px; }
  .cb-add__one[open], .cb-add__end:has(details[open]), .cb-item__more[open] { flex-basis: 100%; margin-inline-start: 0; }
  .cb-item__move { order: 3; }
}

/* 0.26.0 pick lessons and tests from a course (class page, online tab) */
.pick { display: grid; gap: 8px; margin-block: 8px 12px; }
.pick-course { margin: 14px 0 4px; font-size: 1rem; }
.pick-sec { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.pick-sec > summary { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; list-style: none; font-weight: 700; background: var(--surface-2); border-radius: var(--radius); }
.pick-sec > summary::-webkit-details-marker { display: none; }
.pick-sec > summary::before { content: ""; inline-size: 7px; block-size: 7px; border-inline-end: 2px solid currentColor; border-block-end: 2px solid currentColor; transform: rotate(45deg); opacity: .6; transition: transform .15s; }
.pick-sec:not([open]) > summary::before { transform: rotate(-45deg); }
[dir="rtl"] .pick-sec:not([open]) > summary::before { transform: rotate(135deg); }
.pick-sec[open] > summary { border-end-start-radius: 0; border-end-end-radius: 0; border-block-end: 1px solid var(--border); }
.pick-sec__title { margin-inline-end: auto; }
.pick-items { list-style: none; margin: 0; padding: 4px 6px; display: grid; }
.pick-items li + li { border-block-start: 1px solid var(--border); }
.pick-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; cursor: pointer; flex-wrap: wrap; }
.pick-item:hover { background: var(--hover); }
.pick-item:has(input:checked) { background: var(--brand-soft); }
.pick-item input[type="radio"], .pick-item input[type="checkbox"] { inline-size: 18px; block-size: 18px; flex: none; margin: 0; accent-color: var(--brand); }
.pick-item__text { display: grid; gap: 1px; margin-inline-end: auto; min-inline-size: 0; flex: 1 1 180px; }
.pick-item__text > span:first-child { font-weight: 600; overflow-wrap: anywhere; }
.pick-item--lesson .cb-item__icon { background: var(--info-soft); color: var(--info); }
.pick-item--quiz .cb-item__icon { background: var(--warn-soft); color: var(--warn); }
.pick-item--new .cb-item__icon { background: var(--ok-soft); color: var(--ok); }
.pick-new { display: grid; gap: 6px; padding: 6px; border: 1px dashed var(--border); border-radius: var(--radius); margin-block-end: 10px; }
.pick-new__fields { display: flex; flex-wrap: wrap; gap: 8px; padding-inline: 8px 8px; padding-block-end: 6px; }
.pick-new__fields input { flex: 1 1 220px; min-inline-size: 0; }
.pick-new__fields select { flex: 0 1 240px; min-inline-size: 0; }
/* The opening order of what was picked: numbered steps, ↑ ↓, "one after the other" or "together". */
.porder { display: grid; gap: 12px; margin-block: 12px; padding: 16px; border-radius: calc(var(--radius) + 4px); border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--border)); background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 9%, var(--surface)), var(--surface) 60%); }
.porder[hidden] { display: none; }
.porder__head { display: flex; gap: 12px; align-items: flex-start; }
.porder__head h3 { margin: 0 0 2px; font-size: 1.05rem; }
.porder__head p { margin: 0; }
.porder__icon { flex: none; display: grid; place-items: center; inline-size: 40px; block-size: 40px; border-radius: 12px; background: var(--brand); color: #fff; }
.porder__icon svg { inline-size: 22px; block-size: 22px; }
.porder__modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 8px; }
.porder__mode { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.porder__mode:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent); }
.porder__mode span { display: grid; gap: 2px; }
.porder__mode small { color: var(--muted); }
.porder__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; counter-reset: none; }
.porder__item { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.porder__item + .porder__item::before { content: ""; position: absolute; inset-inline-start: 25px; inset-block-start: -8px; block-size: 8px; border-inline-start: 2px dashed color-mix(in srgb, var(--brand) 50%, var(--border)); }
.porder__num { flex: none; display: grid; place-items: center; inline-size: 30px; block-size: 30px; border-radius: 50%; font-weight: 700; background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); }
.porder__item--quiz .porder__num { background: var(--warn-soft); color: var(--warn); }
.porder__text { display: grid; gap: 1px; margin-inline-end: auto; min-inline-size: 0; }
.porder__text strong { overflow-wrap: anywhere; }
.porder__text small { color: var(--muted); }
.porder__quizmode { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.porder__quizmode[hidden] { display: none; }
.porder__quizmode select { inline-size: auto; }
.pick-gate { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-block: 10px; }
.pick-gate select { inline-size: auto; }
.pick-go { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding-block-start: 12px; border-block-start: 1px solid var(--border); }
.pick-go .field { margin: 0; }
.pick-now { margin-block-end: 8px; }
.pick-wrap[open] > summary { margin-block-end: 10px; }
.pick-whats { display: grid; gap: 4px; }

/* 0.27.0 class exam in the register, filter bars, the student page of a course */
.class-exam__form { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.class-exam__form .field { flex: 1 1 180px; min-width: 0; margin: 0; }
.class-exam__form .field:nth-child(3) { flex: 0 1 130px; }
.class-exam__form .btn-row { flex: 1 1 100%; }
.exam-cell { white-space: nowrap; }
.t input.exam-mark { width: 6.5em; max-width: 100%; padding: 6px 8px; text-align: center; }
.row-filter { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin: 0 0 12px; }
.row-filter input[type=search] { flex: 1 1 200px; min-width: 0; }
.row-filter select { flex: 0 1 190px; min-width: 0; }
.inline-form { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form input { width: 12em; }
.bulk-bar { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; padding-top: 12px; }
.bulk-bar input[type=number] { width: 13em; }
.bulk-bar input[type=text] { flex: 1 1 160px; min-width: 0; }
.cs-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cs-log li { border-bottom: 1px dashed var(--border); padding-bottom: 8px; }
.cs-log li:last-child { border-bottom: 0; }
@media (max-width: 640px) {
  .t input.exam-mark { width: 8em; }
  .row-filter select { flex: 1 1 100%; }
}

/* ══ 0.28.0 phone first: compact cards, small counters, tidy top bar, bottom tabs, folded filters ══ */
.side__tools, .tabbar, .m-only { display: none; }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.quick__item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; font-weight: 700; box-shadow: var(--shadow); min-height: 54px; }
.quick__item:hover { border-color: var(--brand); color: var(--brand); }
.quick__ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); flex: none; }
.filters-toggle { display: none; }

@media (max-width: 720px) {
  /* Inputs at 16px: phones do not zoom the page when one is tapped. */
  input, select, textarea { font-size: 16px; }
  .btn { min-height: 40px; }
  .btn--sm { min-height: 36px; }
  h1 { font-size: 1.45rem; line-height: 1.35; }
  .card { padding: 14px; }
  .page__head { gap: 8px; }
  .page__head .btn { padding-inline: 12px; }
  .m-only { display: flex; }

  /* Counters: three small tiles a row, not one screen each. */
  .grid--stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .grid--stats:has(> :nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--stats:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 9px 10px; box-shadow: none; }
  .stat__label { font-size: .74rem; line-height: 1.35; }
  .stat__value { font-size: 1.2rem; line-height: 1.25; overflow-wrap: anywhere; }
  .stat__hint { font-size: .7rem; }

  /* Tables: each row a small card; the main cell is its title and the other values sit side by side. */
  .table-wrap:has(> .t--stack) { border: 0; background: transparent; overflow: visible; }
  .t--stack tbody { display: grid; gap: 8px; }
  .t--stack tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 11px 13px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; position: relative; width: 100%; }
  .t--stack tbody tr:hover { background: var(--surface); }
  .t--stack td { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 5px; width: auto; max-width: 100%; min-width: 0; padding: 0; border: 0; justify-content: flex-start; }
  .t--stack td::before { content: attr(data-label); color: var(--muted); font-size: .74rem; font-weight: 400; }
  .t--stack td:not([data-label])::before, .t--stack td[data-label=""]::before { content: none; }
  .t--stack td.t-main { display: block; order: -1; width: 100%; font-size: 1rem; font-weight: 700; line-height: 1.5; }
  .t--stack td.t-main::before { content: none; }
  .t--stack td.t-main .small, .t--stack td.t-main .muted { font-weight: 400; }
  .t--stack td.t-wide { width: 100%; }
  .t--stack td.t-wide input[type=text] { flex: 1 1 auto; min-width: 0; }
  .t--stack td.actions { width: 100%; justify-content: flex-start; gap: 6px; padding-top: 4px; }
  .t--stack td, .t--stack td.actions { white-space: normal; }
  .t--stack td.actions form { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; max-width: 100%; }
  .t--stack { table-layout: fixed; }
  .t--stack td.actions:empty { display: none; }
  /* The row's tick box (a cell without a label) sits in the corner; a labelled one ("absent") stays in line. */
  .t--stack td:not([data-label]):has(> input[type=checkbox]:only-child) { position: absolute; inset-inline-end: 12px; top: 12px; }
  .t--stack tr:has(> td:not([data-label]) > input[type=checkbox]:only-child) { padding-inline-end: 44px; }
  .t--stack tr:has(> td:not([data-label]) > input[type=checkbox]:only-child) > td { padding-inline-end: 0; }
  .t--stack tr:has(> td:not([data-label]) > input[type=checkbox]:only-child) > td.t-main { padding-inline-end: 34px; }
  .t--stack td[data-label]:has(> input[type=checkbox]) { align-items: center; }
  .t--stack tbody input[type=checkbox] { width: 22px; height: 22px; }
  .t--stack td > input[type=text], .t--stack td > input:not([type]) { width: 7.5em; }
  .t--stack td.t-wide > input[type=text] { width: auto; }
  .t--stack td details { width: 100%; }
  .t-hide-m { display: none !important; }
  /* The group's student picker keeps its own grid (tick box, name, code, year). */
  .t--stack.pick__table tbody td:first-child { position: static !important; }
  .t--stack.pick__table tbody tr, .t--stack.pick__table tbody tr > td.t-main { padding-inline-end: 12px; }
  .t--stack.pick__table tbody tr > td.t-main { padding-inline-end: 0; }
  /* "Select all" stays on a phone: the header shows only its tick box, as one line above the cards. */
  .t--stack thead:has([data-check-all]) { position: static; width: auto; height: auto; overflow: visible; clip: auto; display: block; }
  .t--stack thead:has([data-check-all]) tr { display: flex; padding: 0 2px 8px; border: 0; background: none; }
  .t--stack thead:has([data-check-all]) th { display: none; }
  .t--stack thead:has([data-check-all]) th:has([data-check-all]) { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0; color: var(--text); font-size: .9rem; }
  .t--stack th:has([data-check-all])::after { content: "اختيار الكل"; }
  .t--stack th:has([data-check-all]):lang(en)::after { content: "Select all"; }
  .t--stack thead [data-check-all] { width: 22px; height: 22px; }
  .t--stack thead th:has([data-check-all]) { inline-size: auto !important; white-space: nowrap; }

  /* A save button that stays in reach while you go down a long list. */
  .sticky-save { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); z-index: 4; padding: 10px; margin-inline: -4px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(6px); border-radius: 12px; justify-content: center; }
  .sticky-save .btn { flex: 1 1 auto; max-width: 420px; }

  /* Top bar: menu, search and help only; day/night, language and sign out live in the menu. */
  .top .theme-toggle, .top form:has(> input[name=lang]), .top__user { display: none !important; }
  .side__tools { display: grid; gap: 10px; padding: 14px 16px; border-top: 1px solid rgba(201, 184, 222, .18); }
  .side__me { display: flex; align-items: center; gap: 10px; color: var(--side-text); text-decoration: none; }
  .side__me span { display: grid; line-height: 1.3; }
  .side__me small { color: var(--side-muted); }
  .side__row { display: flex; flex-wrap: wrap; gap: 6px; }
  .side__row form { margin: 0; }
  .side__row .btn { background: rgba(255, 255, 255, .06); color: var(--side-text); border-color: rgba(201, 184, 222, .2); }

  /* Bottom tabs with the most used pages; "More" opens the full menu. */
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; inset: auto 0 0 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(26, 20, 38, .08); padding-bottom: env(safe-area-inset-bottom, 0px); padding-inline: max(env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)); }
  .tabbar a, .tabbar button { display: grid; justify-items: center; gap: 2px; padding: 8px 2px 7px; min-height: 56px; color: var(--muted); text-decoration: none; font: inherit; font-size: .72rem; font-weight: 600; background: none; border: 0; cursor: pointer; }
  .tabbar span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar .ico { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"] { color: var(--brand); }
  .tabbar a[aria-current="page"] .ico { color: var(--brand); }
  body:has(.tabbar) .page { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  /* While a test is being answered there is no bottom bar: no tap leaves it by mistake. */
  body:has(.quizbar) .tabbar { display: none; }
  body:has(.quizbar) .page { padding-bottom: 24px; }

  /* Filters: folded behind one button (the search box stays); the button says how many are on. */
  .filters-toggle { display: inline-flex; }
  .filters.is-folded:not(.is-open) > .field:not(.field--keep), .filters.is-folded:not(.is-open) > label.check, .filters.is-folded:not(.is-open) > fieldset { display: none; }
  .filters.is-folded .field--keep { flex: 1 1 100%; max-width: none; }
  .filters .field { max-width: none; flex: 1 1 140px; }

  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .quick__item { padding: 12px; font-size: .95rem; box-shadow: none; }
}
@media print { .tabbar, .side__tools, .sticky-save { display: none !important; } }
.sched { border-bottom: 1px dashed var(--border); padding: 8px 0; }
.sched > summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; list-style: none; }
.sched > summary::-webkit-details-marker { display: none; }
.sched__edit { margin-inline-start: auto; font-size: .82rem; font-weight: 700; color: var(--brand); }
.sched[open] > summary .sched__edit { visibility: hidden; }
.sched > form { margin: 10px 0 4px; }
.sched--add { border-bottom: 0; }
.sched--add > summary { color: var(--brand); font-weight: 700; }

/* 0.29.0 lesson video upload (video server) */
.vup { display: grid; gap: 12px; }
.vup h3 { margin: 0; }
.vup__panel { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.vup__bar { height: 12px; border-radius: 999px; background: var(--border); overflow: hidden; }
.vup__bar span { display: block; height: 100%; width: 0; background: var(--primary, var(--brand)); border-radius: inherit; transition: width .4s ease; }
.vup[data-state-now="done"] .vup__bar span { background: var(--ok); }
.vup[data-state-now="waiting"] .vup__bar span, .vup[data-state-now="paused"] .vup__bar span { background: var(--warn); }
.vup__nums { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; font-size: .9rem; color: var(--muted); }
.vup__nums strong { font-size: 1.2rem; color: var(--text); }
.vup__msg { margin: 0; font-weight: 600; }
.vup__resume p { margin: 0 0 8px; }
.vup-wrap > summary { margin-block: 6px; }
.vup-wrap[open] > summary { margin-block-end: 12px; }
@media (prefers-reduced-motion: reduce) { .vup__bar span { transition: none; } }

/* 0.30.0 undo: the button on the done message, and the page that asks first */
.alert--undo { align-items: center; }
.alert--undo .alert__text { flex: 1 1 auto; min-inline-size: 0; }
.alert__undo { flex: none; display: inline-flex; align-items: center; gap: 6px; background: var(--surface, #fff); }
.alert__undo svg { inline-size: 16px; block-size: 16px; }
.undo-ask__q { font-size: 1.15rem; margin-block: 0 4px; }
.undo-ask__list { margin-block: 6px 14px; padding-inline-start: 22px; display: grid; gap: 6px; }
.undo-ask__list li { line-height: 1.6; }
@media (max-width: 640px) {
  .alert--undo { flex-wrap: wrap; }
  .alert__undo { min-block-size: 40px; }
  .undo-ask .btn-row .btn { flex: 1 1 100%; min-block-size: 46px; justify-content: center; }
  .undo-ask .btn-row form { flex: 1 1 100%; display: flex; }
}

/* 0.30.0 content protection (protected roles only: html.pg-on, see page-guard.js) */
.pg-on body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.pg-on input, .pg-on textarea, .pg-on select, .pg-on [contenteditable="true"] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
.pg-on img, .pg-on video { -webkit-user-drag: none; }
.pg-shield { position: fixed; inset: 0; z-index: 2147483001; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: #120a24; color: #fff; text-align: center; }
.pg-shield[hidden] { display: none; }
.pg-shield__box { display: grid; gap: 10px; max-inline-size: 440px; }
.pg-shield__box strong { font-size: 1.35rem; }
.pg-shield__box p { margin: 0; line-height: 1.7; color: #ddd3f0; }
.pg-shield__box small { color: #b9a9d6; }
.pg-covered .page, .pg-covered .side { filter: blur(18px); }
@media print {
  .pg-on body > * { display: none !important; }
  .pg-on body::after { content: attr(data-pg-print); display: block; font-size: 24px; text-align: center; margin-block-start: 30vh; }
}

/* 0.31.0 register: find a student, save one mark */
.reg-search { display: flex; align-items: center; gap: 10px; margin-block: 0 12px; }
.reg-search input { flex: 1 1 auto; max-inline-size: 420px; }
.exam-msg { margin-inline-start: 6px; }
.exam-msg--ok { color: var(--ok); }
.exam-msg--err { color: var(--danger); }
.reg-search[hidden] { display: none; }

/* 0.31.5 the staff menu: no DNA, bigger and bold text, its colour down the whole page */
.side__group > summary.side__sec { font-size: 1.12rem; font-weight: 800; padding-block: 13px; }
.side__nav a { font-size: 1.2rem; font-weight: 700; padding-block: 11px; }
.side__nav a .ico { inline-size: 24px; block-size: 24px; }
.side__count { font-size: .85rem; font-weight: 700; }
@media (min-width: 901px) {
  :root { --side-w: 288px; }
  [dir="rtl"] .shell { background: linear-gradient(to left, var(--side-bg) var(--side-w), transparent var(--side-w)); }
  [dir="ltr"] .shell { background: linear-gradient(to right, var(--side-bg) var(--side-w), transparent var(--side-w)); }
}

/* 0.31.6 reviews to approve */
.review-list { display: grid; gap: 14px; }
.review-item__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.review-item__stars { color: #d9a900; letter-spacing: .1em; font-size: 1.05rem; }
.review-item__body { margin: 10px 0 6px; line-height: 1.8; white-space: pre-line; }
.review-item .btn-row form { display: inline; }

/* course lines: new student / student file */

/* the student file: who did what */
.who-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.who-log__item { display: grid; grid-template-columns: 9.5em 11em 1fr; gap: 4px 14px; padding: 8px 0 8px 0; border-bottom: 1px solid var(--border); align-items: baseline; padding-inline-start: 12px; border-inline-start: 3px solid var(--border); }
.who-log__item--open { border-inline-start-color: var(--ok); }
.who-log__item--close { border-inline-start-color: var(--danger); }
.who-log__item--group { border-inline-start-color: var(--info); }
.who-log__when { color: var(--muted); font-size: .85rem; }
.who-log__who { font-weight: 600; }
.who-more { margin-top: 10px; }
.who-more > summary, .enrol-add > summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.enrol-add { margin-top: 12px; }
.enrol-list li .chip { margin-inline-start: 4px; }
@media (max-width: 720px) { .who-log__item { grid-template-columns: 1fr; gap: 2px; } }

/* ── segmented tabs (quiz results: centre / online …; attempts) ── */
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.seg a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; color: var(--text); font-weight: 600; font-size: .9rem; background: var(--surface); min-height: 38px; }
.seg a[aria-current="page"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.seg__n { font-size: .78rem; padding: 0 7px; border-radius: 999px; background: var(--chip-bg); color: var(--chip-text); }
.seg a[aria-current="page"] .seg__n { background: rgba(255, 255, 255, .25); color: inherit; }

/* ── quiz results table ── */
.qres__score { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.qres__bar { block-size: 6px; inline-size: min(160px, 100%); background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-block: 5px 2px; }
.qres__bar span { display: block; block-size: 100%; border-radius: 999px; }
.qres__bar .is-ok { background: var(--ok); }
.qres__bar .is-bad { background: var(--danger); }
.qres td.actions { white-space: nowrap; }

/* ── an attempt summary: ring, counts, number strip ── */
.qsum { display: grid; grid-template-columns: auto 1fr; gap: 14px 22px; align-items: center; }
.qsum__ring { --p: 0; inline-size: 116px; block-size: 116px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--surface-2) 0); }
.qsum__ring.is-ok { background: conic-gradient(var(--ok) calc(var(--p) * 1%), var(--surface-2) 0); }
.qsum__ring.is-bad { background: conic-gradient(var(--danger) calc(var(--p) * 1%), var(--surface-2) 0); }
.qsum__ringin { inline-size: 92px; block-size: 92px; border-radius: 50%; background: var(--surface); display: grid; place-content: center; text-align: center; gap: 2px; }
.qsum__ringin strong { font-size: 1.45rem; line-height: 1.1; }
.qsum__verdict { margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.qsum__counts { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.qsum__c { display: flex; align-items: baseline; gap: 6px; padding: 6px 12px; border-radius: 10px; background: var(--surface-2); border-inline-start: 4px solid var(--border); }
.qsum__c strong { font-size: 1.2rem; }
.qsum__c--right { border-color: var(--ok); }
.qsum__c--part { border-color: var(--info); }
.qsum__c--wrong { border-color: var(--danger); }
.qsum__c--wait { border-color: var(--warn); }
.qsum__map { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; padding-block-start: 12px; border-block-start: 1px solid var(--border); }
.qsum__wait { display: flex; gap: 14px; align-items: center; }
.qsum__wait p { margin: 4px 0 0; }
.qsum__icon { inline-size: 48px; block-size: 48px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 1.5rem; background: var(--ok-soft); color: var(--ok); }
.qsec { margin: 22px 0 10px; font-size: 1.1rem; }

/* number pills: the strip on the summary and in the test bar */
.qpill { display: inline-grid; place-items: center; min-inline-size: 34px; block-size: 34px; padding: 0 6px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 700; font-size: .85rem; text-decoration: none; cursor: pointer; font-family: inherit; }
.qpill--done { background: var(--brand-soft); border-color: var(--brand); color: var(--text); }
.qpill--here { outline: 2px solid var(--brand); outline-offset: 1px; }
.qpill--right { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.qpill--wrong { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.qpill--blank { background: var(--surface-2); color: var(--muted); border-style: dashed; }
.qpill--part { background: var(--info-soft); border-color: var(--info); color: var(--info); }
.qpill--wait { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }

/* ── a question: number badge, state, choices as big cards ── */
.quizq__head { display: flex; align-items: center; gap: 10px; margin-block-end: 10px; flex-wrap: wrap; }
.quizq__num { inline-size: 34px; block-size: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); font-weight: 800; }
.quizq__title { margin: 0; font-size: 1rem; flex: 1 1 auto; }
.quizq__pts { margin-inline-start: auto; }
.quizq__state { font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.quizq__state--ok { background: var(--ok-soft); color: var(--ok); }
.quizq__state--bad { background: var(--danger-soft); color: var(--danger); }
.quizq__state--part { background: var(--info-soft); color: var(--info); }
.quizq__state--blank { background: var(--surface-2); color: var(--muted); }
.quizq__state--wait { background: var(--warn-soft); color: var(--warn); }
.quizq--ok { border-inline-start: 5px solid var(--ok); }
.quizq--bad { border-inline-start: 5px solid var(--danger); }
.quizq--part { border-inline-start: 5px solid var(--info); }
.quizq--blank { border-inline-start: 5px dashed var(--border); }
.quizq--wait { border-inline-start: 5px solid var(--warn); }
.quizq__choices { display: grid; gap: 10px; }
.quizq__choices--tf { grid-template-columns: 1fr 1fr; }
.quizq__opt { position: relative; align-items: center; padding: 12px 14px; border-width: 2px; border-radius: 12px; transition: border-color .15s, background-color .15s; }
.quizq__opt input { position: absolute; opacity: 0; inline-size: 1px; block-size: 1px; }
.quizq__opt:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.quizq__choices--tf .quizq__opt { justify-content: center; font-weight: 700; min-height: 54px; }
.quizq__letter { inline-size: 30px; block-size: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--border); font-weight: 800; font-size: .9rem; color: var(--muted); }
.quizq__opt:has(input:checked) .quizq__letter { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.quizq__opt:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 24%, var(--surface)); box-shadow: 0 0 0 1px var(--brand); font-weight: 700; }
.quizq__optbody { flex: 1 1 auto; overflow-wrap: anywhere; line-height: 1.6; }
.quizq__marks { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.quizq__mark { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 2px solid var(--border); border-radius: 12px; }
.quizq__mark--mine-right, .quizq__mark--right { border-color: var(--ok); background: var(--ok-soft); }
.quizq__mark--mine-right .quizq__letter, .quizq__mark--right .quizq__letter { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.quizq__mark--right { border-style: dashed; }
.quizq__mark--mine-wrong { border-color: var(--danger); background: var(--danger-soft); }
.quizq__mark--mine-wrong .quizq__letter { background: var(--danger); border-color: var(--danger); color: var(--surface); }
.quizq__mark--mine { border-color: var(--brand); background: var(--brand-soft); }
.quizq__tag { font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface); border: 1px solid currentColor; white-space: nowrap; }
.quizq__tag--right { color: var(--ok); }

/* ── the test bar: title, clock, progress, numbers ── */
.quizbar { display: block; padding: 10px 14px 12px; }
.quizbar__top { display: flex; align-items: center; gap: 10px; }
.quizbar__title { flex: 1 1 auto; min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quizbar__time { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--brand-soft); margin: 0; }
.quizbar__time--free { background: var(--surface-2); font-size: .85rem; }
.quizbar--soon .quizbar__time { background: var(--danger-soft); color: var(--danger); animation: qpulse 1s ease-in-out infinite; }
@keyframes qpulse { 50% { opacity: .65; } }
@media (prefers-reduced-motion: reduce) { .quizbar--soon .quizbar__time { animation: none; } }
.quizbar__prog { display: flex; align-items: center; gap: 10px; margin-block-start: 8px; flex-wrap: wrap; }
.quizbar__track { flex: 1 1 140px; block-size: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.quizbar__track span { display: block; block-size: 100%; background: var(--brand); border-radius: 999px; transition: inline-size .25s; }
.quizbar__map { display: flex; gap: 6px; margin-block-start: 10px; overflow-x: auto; padding-block-end: 2px; scrollbar-width: thin; }
.quizbar__map .qpill { flex: none; }
.quizform .quizq { scroll-margin-top: calc(var(--top-h) + 150px); }
.quiznav { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; }
.quiznav__finish { margin-inline-start: auto; }

/* ── the first page of a test ── */
.qhero { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); margin-block-end: 16px; }
.qhero__crumb { margin: 0 0 4px; color: var(--muted); font-size: .9rem; }
.qhero__title { margin: 0 0 10px; font-size: 1.6rem; }
.qhero__intro { margin: 0 0 14px; line-height: 1.8; }
.qhero__facts { list-style: none; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.qhero__facts li { padding: 12px; border-radius: 12px; background: var(--surface-2); display: grid; gap: 4px; }
.qhero__facts span { color: var(--muted); font-size: .82rem; }
.qhero__facts strong { font-size: 1.15rem; }
.qhero__rules { margin: 0 0 16px; padding-inline-start: 1.2em; color: var(--muted); line-height: 1.8; }
.btn--lg { min-height: 50px; padding-inline: 28px; font-size: 1.05rem; }
.qhero__go { inline-size: min(100%, 320px); justify-content: center; }

@media (max-width: 720px) {
  .qsum { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .qsum__verdict, .qsum__counts { justify-content: center; }
  .qsum__map { justify-content: center; }
  .qhero { padding: 16px; }
  .qhero__title { font-size: 1.3rem; }
  .qhero__facts { grid-template-columns: 1fr 1fr; }
  .qhero__go { inline-size: 100%; }
  .quizq__head { gap: 8px; }
  .quizq__pts { margin-inline-start: 0; }
  .quiznav { position: sticky; bottom: 0; z-index: 4; background: var(--bg, var(--surface)); padding: 10px 0; border-block-start: 1px solid var(--border); }
  .quiznav .btn { flex: 1 1 0; justify-content: center; min-height: 46px; }
  .quizbar__map .qpill { min-inline-size: 32px; block-size: 32px; }
  .seg { flex-wrap: nowrap; overflow-x: auto; padding-block-end: 4px; }
  .seg a { flex: none; }
}

/* ── the student file in tabs ── */
.sttabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: thin; border-bottom: 1px solid var(--border); margin: 6px 0 16px; position: sticky; top: var(--top-h); z-index: 6; background: var(--bg); padding-block-start: 4px; }
.sttabs a { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 700; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; min-height: 44px; }
.sttabs a .ico { inline-size: 16px; block-size: 16px; }
.sttabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.sttabs:not(.is-on) a[aria-current="page"] { color: var(--muted); border-bottom-color: transparent; }
.stpanel { display: grid; gap: 16px; }
.stpanel > .card, .stpanel > .grid { margin: 0; }

/* overview: one card per course */
.stcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 12px; }
.stcard { display: grid; align-content: start; gap: 8px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); text-decoration: none; color: var(--text); transition: border-color .15s; }
.stcard:hover { border-color: var(--accent); }
.stcard > .chip { justify-self: start; }
.stcard__title { font-weight: 800; font-size: 1.05rem; }
.stcard__nums { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.stcard__nums span { display: grid; font-size: .78rem; color: var(--muted); }
.stcard__nums b { font-size: 1.15rem; color: var(--text); }

/* a course tab */
.sthero__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-block-end: 12px; }
.sthero__head h2 { margin: 0; }
.sthero__links { margin-inline-start: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.stkpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); gap: 10px; }
.stkpi { display: grid; gap: 3px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.stkpi__label { font-size: .82rem; color: var(--muted); font-weight: 600; }
.stkpi strong { font-size: 1.5rem; line-height: 1.2; }
.stkpi__bar { block-size: 6px; background: var(--surface); border-radius: 999px; overflow: hidden; margin-block-start: 4px; }
.stkpi__bar span { display: block; block-size: 100%; background: var(--accent); border-radius: 999px; }
.stchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.stdots { display: flex; flex-wrap: wrap; gap: 4px; margin-block-end: 10px; }
.stdot { inline-size: 14px; block-size: 14px; border-radius: 4px; background: var(--surface-2); }
.stdot--present { background: var(--ok); }
.stdot--late { background: var(--warn); }
.stdot--absent { background: var(--danger); }
.stdot--excused { background: var(--info); }
.stmore > summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.stlist { list-style: none; margin: 0; padding: 0; display: grid; }
.stlist li { display: flex; align-items: center; gap: 10px 14px; padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.stlist li:last-child { border-bottom: 0; }
.stlist li.is-closed { opacity: .6; }
.stlist__main { flex: 1 1 220px; min-inline-size: 0; overflow-wrap: anywhere; }
.stlist__val { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 720px) {
  .sttabs { margin-inline: -12px; padding-inline: 8px; }
  .sthero__links { margin-inline-start: 0; inline-size: 100%; }
  .stkpis { grid-template-columns: 1fr 1fr; }
  .stkpi strong { font-size: 1.25rem; }
  .stlist__val { inline-size: 100%; }
}

/* ── a student's courses (add / edit student, his file): one card per course ── */
.enrol { display: grid; gap: 12px; }
.enrol > .btn { justify-self: start; }
.enrol__line { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); }
.enrol__line + .enrol__line { margin-top: 12px; }
.enrol__line--existing { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.enrol__line.is-removed { opacity: .75; border-style: dashed; border-color: var(--danger); }
.enrol__line fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.enrol__line legend { padding: 0; margin-bottom: 8px; font-weight: 700; font-size: .92rem; }
.enrol .enrol__line .field { margin: 0; padding-inline-start: 0; }
.enrol__top { display: flex; gap: 10px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.enrol__course { flex: 1 1 260px; }
.enrol__coursename { display: block; font-size: 1.1rem; padding-block: 6px; }
.enrol__remove { flex: none; }
.enrol__removed { margin: 0; }
.enrol__body { display: grid; gap: 14px; }
.enrol__modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 10px; }
.enrol__modes legend { grid-column: 1 / -1; }
.enrol__card, .enrol__opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 2px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; }
.enrol__card input, .enrol__opt input { margin-top: 4px; flex: none; inline-size: 18px; block-size: 18px; }
.enrol__card span, .enrol__opt span { display: grid; gap: 3px; }
.enrol__card small, .enrol__opt small { color: var(--muted); line-height: 1.6; font-size: .82rem; }
.enrol__card:has(input:checked), .enrol__opt:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.enrol__opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 8px; }
.enrol__sub { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 10px 14px; margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--surface); border: 1px dashed var(--border); }
.enrol__sub > .hint, .enrol__sub > .enrol__plan, .enrol__sub > .enrol__picks { grid-column: 1 / -1; margin: 0; }
.enrol__n { max-inline-size: 8em; }
.enrol__picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 6px 14px; max-block-size: 320px; overflow: auto; padding: 4px; }
.enrol__plan { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

@media (max-width: 720px) { .enrol__modes, .enrol__opts { grid-template-columns: 1fr 1fr; gap: 8px; } .enrol__card, .enrol__opt { padding: 10px; } .enrol__card small, .enrol__opt small { font-size: .76rem; } }

/* My lessons: a package of classes, one dot per class (filled = open) */
.pkg { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 12px; margin: 6px 0 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.pkg__dots { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.pkg__dots span { inline-size: 12px; block-size: 12px; border-radius: 50%; border: 2px solid var(--accent); }
.pkg__dots span.is-on { background: var(--accent); }
.stopen { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 12px; }

/* Timetable: the week, one column per day (Saturday → Friday); one column under each other on a phone */
.tt-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.tt__range { margin: 0 0 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tt { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: start; }
.tt__day { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; display: grid; gap: 6px; min-inline-size: 0; }
.tt__day.is-today { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 35%, transparent); }
.tt__day.is-past { opacity: .78; }
.tt__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.tt__empty { margin: 4px 0; }
.tt__item { display: grid; gap: 2px; padding: 8px 9px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); border-inline-start: 4px solid var(--info); color: inherit; text-decoration: none; min-inline-size: 0; overflow-wrap: anywhere; }
a.tt__item:hover { border-color: var(--primary); }
.tt__item.is-online { border-inline-start-color: var(--accent); }
.tt__item--planned { border-style: dashed; border-inline-start-style: solid; opacity: .85; }
.tt__item--exam { border-inline-start-color: var(--warn); background: var(--warn-soft); }
.tt__item.is-cancelled { border-inline-start-color: var(--danger); text-decoration: line-through; opacity: .7; }
.tt__item.is-cancelled .chip { text-decoration: none; }
.tt__item.is-done { border-inline-start-color: var(--ok); }
.tt__item.is-now { border-inline-start-color: var(--ok); box-shadow: 0 0 0 2px var(--ok-soft); }
.tt__time { font-size: .8rem; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.tt__title { font-size: .92rem; line-height: 1.35; }
.tt__meta { font-size: .78rem; color: var(--muted); }
.tt__tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.tt__tags .chip { font-size: .72rem; padding: 1px 7px; }
@media (max-width: 1100px) { .tt { grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); } }
@media print { .tt { grid-template-columns: repeat(7, 1fr); gap: 4px; } .tt__day { padding: 4px; } .tt__item { padding: 4px; } }
.receipt-preview { max-inline-size: 220px; max-block-size: 260px; border-radius: 10px; border: 1px solid var(--border); object-fit: contain; }

/* A student's courses across the top of his pages (one course at a time) */
.cswitch { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; margin: 0 0 14px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.cswitch__item { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; min-inline-size: 190px; max-inline-size: 280px; padding: 8px 12px 8px 8px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface); color: inherit; text-decoration: none; scroll-snap-align: start; transition: border-color .15s, transform .15s; }
.cswitch__item:hover { border-color: color-mix(in srgb, var(--primary, var(--brand)) 60%, var(--border)); transform: translateY(-1px); }
.cswitch__item[aria-current="page"] { border-color: var(--primary, var(--brand)); background: color-mix(in srgb, var(--primary, var(--brand)) 12%, var(--surface)); }
.cswitch__item--all { min-inline-size: 150px; }
.cswitch__img { flex: none; inline-size: 46px; block-size: 46px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; color: var(--on-primary, #fff); background: linear-gradient(135deg, var(--primary, var(--brand)), var(--accent)); }
.cswitch__img img { inline-size: 100%; block-size: 100%; object-fit: cover; }
.cswitch__img svg { inline-size: 22px; block-size: 22px; }
.cswitch__txt { display: grid; gap: 1px; min-inline-size: 0; }
.cswitch__txt strong { font-size: .92rem; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cswitch__txt small { color: var(--muted); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* My lessons with several courses: choose one first */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 16px; margin-bottom: 16px; }
.ccard { display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s, border-color .15s; }
.ccard:hover { transform: translateY(-3px); border-color: var(--primary, var(--brand)); }
.ccard__img { aspect-ratio: 16 / 9; display: grid; place-items: center; font-size: 3rem; font-weight: 800; color: var(--on-primary, #fff); background: linear-gradient(135deg, var(--primary, var(--brand)), var(--accent)); overflow: hidden; }
.ccard__img img { inline-size: 100%; block-size: 100%; object-fit: cover; }
.ccard__body { padding: 14px 16px 16px; display: grid; gap: 8px; flex: 1; }
.ccard__body h2 { margin: 0; font-size: 1.1rem; line-height: 1.35; }
.ccard__meta { color: var(--muted); font-size: .84rem; }
.ccard__desc { color: var(--muted); font-size: .86rem; margin: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ccard__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }

/* A group that gathers others (a revision) */
.chips-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; padding: 0; list-style: none; }
.stack-sm { display: grid; gap: 6px; margin: 8px 0; }

/* ── 0.36 the student's pages: by state, the week as a table, the lesson, the test pictures ── */
.lx { display: grid; gap: 12px; margin-block: 10px 6px; }
.lx-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.lx-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; border: 2px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); cursor: pointer; font: inherit; text-align: start; transition: border-color .15s, transform .15s, background-color .15s; }
.lx-tile:hover { transform: translateY(-1px); }
.lx-tile__n { font-family: var(--font-display, var(--font)); font-size: 1.75rem; font-weight: 800; line-height: 1.1; }
.lx-tile__l { font-size: .86rem; font-weight: 600; color: var(--muted); }
.lx-tile--open .lx-tile__n { color: var(--primary, var(--accent)); }
.lx-tile--done .lx-tile__n { color: var(--ok); }
.lx-tile--locked .lx-tile__n { color: var(--muted); }
.lx-tile[aria-pressed="true"] { border-color: var(--primary, var(--brand)); background: color-mix(in srgb, var(--primary, var(--brand)) 9%, var(--surface)); }
.lx-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lx-head h3 { margin: 12px 2px 2px; font-size: .95rem; color: var(--brand); }
.lx-item { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-inline-start: 4px solid var(--border); border-radius: 14px; background: var(--surface); }
.lx-item--open { border-inline-start-color: var(--primary, var(--accent)); background: linear-gradient(90deg, color-mix(in srgb, var(--primary, var(--accent)) 7%, var(--surface)), var(--surface) 60%); }
[dir="rtl"] .lx-item--open { background: linear-gradient(270deg, color-mix(in srgb, var(--primary, var(--accent)) 7%, var(--surface)), var(--surface) 60%); }
.lx-item--done { border-inline-start-color: var(--ok); }
.lx-item--locked { opacity: .82; }
.lx-ico { display: grid; place-items: center; inline-size: 44px; block-size: 44px; border-radius: 50%; background: var(--chip-bg); color: var(--muted); }
.lx-ico svg { inline-size: 20px; block-size: 20px; }
.lx-item--open .lx-ico { background: var(--primary, var(--accent)); color: var(--on-primary, #000); }
.lx-item--done .lx-ico { background: var(--ok-soft); color: var(--ok); }
.lx-body { display: flex; flex-direction: column; gap: 2px; min-inline-size: 0; }
.lx-kind { font-size: .76rem; font-weight: 700; letter-spacing: .02em; color: var(--muted); }
.lx-title { font-weight: 700; font-size: 1.02rem; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
a.lx-title:hover { text-decoration: underline; }
.lx-meta, .lx-why { display: flex; gap: 6px; align-items: flex-start; font-size: .84rem; color: var(--muted); }
.lx-why { color: var(--text-2); }
.lx-meta svg, .lx-why svg { inline-size: 15px; block-size: 15px; flex: none; margin-block-start: 2px; }
.lx-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .84rem; color: var(--muted); }
.lx-facts span { display: inline-flex; gap: 5px; align-items: center; }
.lx-facts svg { inline-size: 14px; block-size: 14px; }
.lx-act { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.lx-group { display: grid; gap: 8px; }
.lx-group__h { display: flex; gap: 8px; align-items: center; margin: 10px 2px 0; font-size: 1.08rem; }
.lx-group__h svg { inline-size: 20px; block-size: 20px; color: var(--primary, var(--accent)); }
.lx-score { display: inline-flex; align-items: baseline; gap: 4px; padding: 4px 10px; border-radius: 999px; background: var(--chip-bg); }
.lx-score b { font-size: 1.15rem; }
.lx-score small { color: var(--muted); }
.lx-score.is-pass b { color: var(--ok); }
.lx-score.is-fail b { color: var(--danger); }
.lx-next { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; margin-block: 12px; padding: 16px 18px; border-radius: 18px; text-decoration: none; color: var(--text); border: 2px solid var(--primary, var(--accent)); background: linear-gradient(120deg, color-mix(in srgb, var(--primary, var(--accent)) 16%, var(--surface)), var(--surface)); box-shadow: var(--shadow); }
.lx-next__play { display: grid; place-items: center; inline-size: 52px; block-size: 52px; border-radius: 50%; background: var(--primary, var(--accent)); color: var(--on-primary, #000); }
.lx-next__play svg { inline-size: 24px; block-size: 24px; }
.lx-next__body { display: flex; flex-direction: column; gap: 2px; min-inline-size: 0; }
.lx-next__k { font-size: .8rem; font-weight: 700; color: var(--muted); }
.lx-next strong { font-size: 1.12rem; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .lx-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lx-item { grid-template-columns: 38px minmax(0, 1fr); }
  .lx-ico { inline-size: 38px; block-size: 38px; }
  .lx-act { grid-column: 1 / -1; justify-content: flex-start; }
  .lx-next { grid-template-columns: auto minmax(0, 1fr); }
  .lx-next .btn { grid-column: 1 / -1; justify-self: stretch; justify-content: center; }
}

/* the timetable */
.sched-next { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; margin-block: 12px; padding: 16px 18px; border-radius: 18px; background: linear-gradient(120deg, #3d2270, #6a3fb0); color: #fff; box-shadow: var(--shadow); }
.sched-next__date { display: grid; place-items: center; align-content: center; inline-size: 74px; block-size: 74px; border-radius: 16px; background: var(--primary, var(--accent)); color: var(--on-primary, #000); line-height: 1.05; text-align: center; }
.sched-next__day { font-family: var(--font-display, var(--font)); font-size: 1.9rem; font-weight: 800; }
.sched-next__mon { font-size: .72rem; font-weight: 700; }
.sched-next__body { display: flex; flex-direction: column; gap: 3px; min-inline-size: 0; }
.sched-next__k { font-size: .82rem; opacity: .85; }
.sched-next__t { font-size: 1.2rem; }
.sched-next__g { font-size: .9rem; opacity: .9; overflow-wrap: anywhere; }
.sched-next .chip { background: rgba(255, 255, 255, .16); color: #fff; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.week__day { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface-2); min-block-size: 120px; }
.week__day.has-class { background: var(--surface); }
.week__day.is-today { border-color: var(--primary, var(--accent)); box-shadow: 0 0 0 1px var(--primary, var(--accent)); }
.week__name { padding: 8px 10px; font-weight: 800; font-size: .9rem; text-align: center; background: var(--chip-bg); }
.week__day.is-today .week__name { background: var(--primary, var(--accent)); color: var(--on-primary, #000); }
.week__slots { display: grid; gap: 6px; padding: 8px; align-content: start; flex: 1; }
.week__free { font-size: .8rem; color: var(--muted); text-align: center; padding-block: 14px; }
.week__slot { display: grid; gap: 2px; padding: 8px 9px; border-radius: 10px; background: color-mix(in srgb, var(--brand) 12%, var(--surface)); border-inline-start: 3px solid var(--brand); }
.week__time { font-weight: 800; font-size: .92rem; white-space: nowrap; text-align: start; unicode-bidi: isolate; }
.week__group { font-size: .82rem; font-weight: 600; overflow-wrap: anywhere; }
.week__meta { font-size: .74rem; color: var(--muted); }
.sched-table tr.is-next td { background: color-mix(in srgb, var(--primary, var(--accent)) 10%, var(--surface)); }
.sched-table tr.is-cancelled td { text-decoration: line-through; color: var(--muted); }
.sched-table tr.is-cancelled td.actions { text-decoration: none; }
@media (max-width: 900px) {
  .week { grid-template-columns: 1fr; }
  .week__day { flex-direction: row; min-block-size: 0; }
  .week__day:not(.has-class) { display: none; }
  .week__name { display: grid; place-items: center; inline-size: 92px; flex: none; }
  .week__slots { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}
@media (max-width: 560px) { .sched-next { grid-template-columns: auto minmax(0, 1fr); } .sched-next .chip { grid-column: 1 / -1; justify-self: start; } }

/* the lesson page */
.lsn-hero { margin-block-end: 14px; padding: 18px 20px; border-radius: 20px; background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--brand) 22%, var(--surface)), var(--surface) 70%); border: 1px solid var(--border); }
.lsn-back { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); text-decoration: none; margin-block-end: 6px; }
.lsn-back svg { inline-size: 16px; block-size: 16px; }
[dir="rtl"] .lsn-back svg { transform: scaleX(-1); }
.lsn-hero__row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.lsn-hero h1 { margin: 0; font-family: var(--font-display, var(--font)); font-size: clamp(1.4rem, 3.4vw, 2.1rem); }
.lsn-hero__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-block-start: 10px; }
.lsn-hero__chips .chip svg { inline-size: 14px; block-size: 14px; }
.lsn { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.lsn__main, .lsn__side { display: grid; gap: 14px; min-inline-size: 0; }
.lsn__side { position: sticky; top: calc(var(--top-h) + 12px); }
.lsn__main .card, .lsn__side .card { margin: 0; }
.lsn-part__head { display: flex; gap: 10px; align-items: center; margin-block-end: 10px; }
.lsn-part__head h2 { flex: 1; margin: 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.lsn-part__ico { display: grid; place-items: center; inline-size: 36px; block-size: 36px; border-radius: 10px; background: var(--chip-bg); color: var(--brand); flex: none; }
.lsn-part--video .lsn-part__ico { background: var(--primary, var(--accent)); color: var(--on-primary, #000); }
.lsn-part__ico svg { inline-size: 18px; block-size: 18px; }
.lsn-part--video { padding: 12px; }
.lsn-text { font-size: 1.02rem; line-height: 1.8; white-space: pre-line; }
.lsn-file { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px; border: 1px dashed var(--input-border); border-radius: 12px; text-decoration: none; color: var(--text); }
.lsn-file:hover { background: var(--hover); }
.lsn-file__ico { display: grid; place-items: center; inline-size: 42px; block-size: 42px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); }
.lsn-file__name { display: flex; flex-direction: column; font-weight: 600; overflow-wrap: anywhere; }
.lsn-steps ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.lsn-steps a { display: flex; gap: 8px; align-items: center; padding: 7px 8px; border-radius: 8px; color: var(--text); text-decoration: none; }
.lsn-steps a:hover { background: var(--hover); }
.lsn-steps svg { inline-size: 16px; block-size: 16px; color: var(--brand); flex: none; }
.lsn-done.is-done { border-color: var(--ok-line); background: var(--ok-soft); }
.lsn-done__ok { display: flex; gap: 8px; align-items: center; margin: 0 0 6px; font-weight: 800; color: var(--ok); }
.btn--block { display: flex; inline-size: 100%; justify-content: center; }
.lsn-test { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; margin-block-start: 6px; border-radius: 10px; border: 1px solid var(--border); text-decoration: none; color: var(--text); }
.lsn-test:hover { border-color: var(--primary, var(--brand)); }
.lsn-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lsn-nav__a { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); text-decoration: none; color: var(--text); }
.lsn-nav__a--next { text-align: end; grid-column: 2; }
.lsn-nav__a:hover { border-color: var(--primary, var(--brand)); }
@media (max-width: 980px) { .lsn { grid-template-columns: 1fr; } .lsn__side { position: static; } }

/* test pictures: the size and place the teacher chose, fitted by the system, tap to enlarge */
.quizq__body { font-size: 1.06rem; line-height: 1.75; }
.quizq__stem { display: grid; gap: 10px; margin-block-end: 6px; }
.quizq__stem--below .quizq__fig { order: 2; }
.quizq__stem--side:not(.quizq__stem--noimg) { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
.quizq__fig { margin: 0; display: grid; justify-items: center; gap: 4px; }
.quizq__img { display: block; max-inline-size: 100%; block-size: auto; border: 1px solid var(--border); border-radius: 12px; background: #fff; cursor: zoom-in; }
.quizq__img--auto, .quizq__img--full { inline-size: 100%; max-inline-size: 900px; max-block-size: 78vh; object-fit: contain; }
.quizq__img--full { max-inline-size: 100%; }
.quizq__img--s { inline-size: min(100%, 260px); }
.quizq__img--m { inline-size: min(100%, 440px); }
.quizq__img--l { inline-size: min(100%, 680px); }
.quizq__zoomhint { font-size: .74rem; color: var(--muted); }
.quizq__pics--auto .quizq__optimg, .quizq__pics--full .quizq__optimg { max-inline-size: 100%; inline-size: min(100%, 900px); max-block-size: 78vh; object-fit: contain; }
.quizq__pics--l .quizq__optimg { max-inline-size: 100%; inline-size: min(100%, 680px); max-block-size: none; }
.quizq__pics--m .quizq__optimg { max-inline-size: 100%; inline-size: min(100%, 440px); max-block-size: none; }
.quizq__pics--auto, .quizq__pics--full, .quizq__pics--l { display: grid; gap: 10px; }
.quizq__pics figure { margin: 0; }
.quizq__pics .quizq__optimg { cursor: zoom-in; background: #fff; }
.zoomer { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 14px; background: rgba(8, 7, 13, .92); overflow: auto; cursor: zoom-out; }
.zoomer img { max-inline-size: none; inline-size: min(1400px, 100%); block-size: auto; border-radius: 10px; background: #fff; touch-action: pinch-zoom; }
.zoomer button { position: fixed; inset-block-start: 12px; inset-inline-end: 12px; }
@media (max-width: 720px) {
  .quizq__stem--side:not(.quizq__stem--noimg) { grid-template-columns: 1fr; }
  .quizq__img, .quizq__img--s, .quizq__img--m, .quizq__img--l { inline-size: 100%; max-inline-size: 100%; }
  .quizq__pics .quizq__optimg { inline-size: 100%; max-inline-size: 100%; }
}
.quizform .quizq { padding: 18px; border-radius: 16px; }
.quizq__opt:has(input:checked) { border-color: var(--primary, var(--brand)); background: color-mix(in srgb, var(--primary, var(--brand)) 10%, var(--surface)); }
.qimg-look { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-block-start: 8px; }
.devsw { display: flex; gap: 6px; margin-block: 10px; }
.devsw .btn[aria-pressed="true"] { border-color: var(--primary, var(--brand)); background: color-mix(in srgb, var(--primary, var(--brand)) 14%, var(--surface)); }
.devframe[data-devframe="phone"] .devframe__screen { inline-size: 390px; max-inline-size: 100%; margin-inline: auto; padding: 14px 10px; border: 10px solid #222; border-radius: 34px; max-block-size: 760px; overflow: auto; background: var(--bg); }
.devframe[data-devframe="phone"] .quizq__stem--side { grid-template-columns: 1fr; }
.devframe[data-devframe="phone"] .quizq__img, .devframe[data-devframe="phone"] .quizq__pics .quizq__optimg { inline-size: 100%; max-inline-size: 100%; }
.devframe__edit { margin: -6px 0 14px; }
.cards-search { margin-block: 6px 14px; }

/* the question form: the picture with the question as the student sees it, dragged into place */
.qpic { gap: 6px; }
.qstage { display: grid; gap: 8px; margin-block-start: 6px; padding: 12px; border: 1px dashed var(--input-border); border-radius: 14px; background: var(--surface-2); }
.qstage__bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.qstage__lbl { font-size: .8rem; font-weight: 700; color: var(--muted); margin-inline-end: 4px; }
.qstage__bar .btn[aria-pressed="true"] { border-color: var(--primary, var(--brand)); background: var(--primary, var(--brand)); color: var(--on-primary, var(--on-brand)); font-weight: 700; }
.qstage__canvas { padding: 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); min-block-size: 80px; transition: box-shadow .15s; }
.qstage__canvas .quizq__fig { cursor: grab; }
.qstage__canvas .quizq__fig:active { cursor: grabbing; }
.qstage__canvas .quizq__img { cursor: grab; }
.qstage__canvas.is-dragging { box-shadow: 0 0 0 2px var(--primary, var(--brand)) inset; }
.qstage__canvas[data-drop="above"] .qstage__text { border-block-start: 4px solid var(--primary, var(--brand)); }
.qstage__canvas[data-drop="below"] .qstage__text { border-block-end: 4px solid var(--primary, var(--brand)); }
.qstage__canvas[data-drop="side"] .qstage__text { border-inline-start: 4px solid var(--primary, var(--brand)); }
.qstage__text { margin: 0; min-block-size: 1.6em; white-space: pre-line; }
.qstage__text:empty::before { content: "…"; color: var(--muted); }
.qform-points { align-items: start; }
.qform-points input { max-inline-size: 160px; }

/* ── the class page: several lessons, "about it", what each lesson opens after ── */
.pick-row { display: flex; align-items: center; gap: 4px; }
.pick-row > .pick-item { flex: 1 1 auto; min-inline-size: 0; }
.pick-info { display: inline-grid; place-items: center; inline-size: 34px; block-size: 34px; border-radius: 50%; color: var(--muted); flex: none; }
.pick-info:hover, .pick-info:focus-visible { background: var(--hover); color: var(--brand); }
.pick-info svg { inline-size: 18px; block-size: 18px; }
.class-lesson + .class-lesson { border-block-start: 1px dashed var(--border); padding-block-start: 10px; margin-block-start: 10px; }
.class-after { align-items: flex-end; margin-block-end: 6px; }
.class-after .hint { flex-basis: 100%; }

/* ── the order of the courses ── */
.corder { list-style: none; margin: 0 0 12px; padding: 0; counter-reset: corder; display: grid; gap: 6px; }
.corder__item { counter-increment: corder; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); transition: background .3s; }
.corder__item--moved { background: var(--brand-soft); }
.corder__n::before { content: counter(corder); display: inline-grid; place-items: center; min-inline-size: 28px; block-size: 28px; border-radius: 50%; background: var(--hover); font-weight: 700; }
.corder__text { flex: 1 1 auto; min-inline-size: 0; display: grid; }
.corder__btns { display: flex; gap: 4px; flex: none; }

/* ── the parent's first page: the child at a glance ── */
.ov { display: grid; gap: 16px; }
.ov-hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; }
.ov-hero p { margin: 2px 0; }
.ov-hero__groups { color: var(--muted); display: flex; align-items: center; gap: 6px; }
.ov-hero__groups svg { inline-size: 16px; block-size: 16px; }
.ov-hero__next strong { font-size: 1.05rem; }
.ov-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.ov-tile { display: grid; gap: 4px; align-content: start; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); border-block-start: 4px solid var(--brand); box-shadow: var(--shadow); color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.ov-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg, var(--shadow)); }
.ov-tile__label { color: var(--muted); font-size: .88rem; font-weight: 600; }
.ov-tile__value { font-family: var(--font-display); font-size: 2rem; font-weight: 800; line-height: 1.1; }
.ov-tile__value small { font-size: 1rem; color: var(--muted); font-weight: 600; }
.ov-tile__hint { color: var(--muted); font-size: .82rem; }
.ov-tile--good { border-block-start-color: var(--ok); }
.ov-tile--good .ov-tile__value { color: var(--ok); }
.ov-tile--mid { border-block-start-color: var(--warn); }
.ov-tile--bad { border-block-start-color: var(--danger); }
.ov-tile--bad .ov-tile__value { color: var(--danger); }
.ov-bar { display: block; block-size: 6px; border-radius: 3px; background: var(--hover); overflow: hidden; margin-block-start: 6px; }
.ov-bar > span { display: block; block-size: 100%; background: currentColor; opacity: .55; border-radius: 3px; }
.ov-tile--good .ov-bar > span { background: var(--ok); opacity: 1; }
.ov-tile--mid .ov-bar > span { background: var(--warn); opacity: 1; }
.ov-tile--bad .ov-bar > span { background: var(--danger); opacity: 1; }
.ov-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; align-items: start; }
.ov-card h2 { font-size: 1.1rem; }
.ov-chart { margin: 0 0 10px; }
.ov-chart svg { inline-size: 100%; block-size: auto; display: block; }
.ov-chart__band--high { fill: var(--ok); opacity: .08; }
.ov-chart__band--low { fill: var(--danger); opacity: .08; }
.ov-chart__grid { stroke: var(--border); stroke-dasharray: 3 4; }
.ov-chart__axis { fill: var(--muted); font-size: 11px; }
.ov-chart__line { fill: none; stroke: var(--brand); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.ov-chart__dot { stroke: var(--surface); stroke-width: 2; fill: var(--warn); }
.ov-chart__dot--high { fill: var(--ok); }
.ov-chart__dot--low { fill: var(--danger); }
[dir="rtl"] .ov-chart svg { transform: scaleX(-1); }
[dir="rtl"] .ov-chart__axis { display: none; }
.ov-list { list-style: none; margin: 0; padding: 0; display: grid; }
.ov-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-block-start: 1px solid var(--border); }
.ov-list li:first-child { border-block-start: 0; }
.ov-sub { font-weight: 700; margin: 6px 0 2px; }
.ov-sub--bad { color: var(--danger); }
.ov-strip { list-style: none; margin: 6px 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ov-strip__d { display: inline-block; inline-size: 22px; block-size: 22px; border-radius: 6px; background: var(--hover); vertical-align: middle; }
.ov-strip__d--present { background: var(--ok); }
.ov-strip__d--late { background: var(--warn); }
.ov-strip__d--makeup { background: var(--info); }
.ov-strip__d--excused { background: var(--info); opacity: .45; }
.ov-strip__d--absent { background: var(--danger); }
.ov-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--muted); }
.ov-legend .ov-strip__d { inline-size: 12px; block-size: 12px; border-radius: 3px; }
.ov-counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0; }
.ov-counts div { background: var(--hover); border-radius: var(--radius); padding: 8px; text-align: center; }
.ov-counts dt { font-size: .8rem; color: var(--muted); }
.ov-counts dd { margin: 0; font-size: 1.3rem; font-weight: 800; }
.ov-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ov-notes p { margin: 2px 0 0; }
.auth-phone { margin-block-end: 10px; }
.auth-more { margin-block: 8px 14px; }
.auth-more > summary { cursor: pointer; color: var(--muted); font-size: .92rem; margin-block-end: 8px; }
@media (max-width: 520px) { .ov-counts { grid-template-columns: repeat(2, 1fr); } .ov-tile__value { font-size: 1.7rem; } }
.ov-tile__value--text { font-size: 1.35rem; }
.ov-legend__i { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }

/* A new student's phone already registered to another student: said while typing. */
.dup-box { margin-block-start: 6px; padding: 10px 12px; border-radius: var(--radius); background: var(--warn-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); }
.dup-box strong { color: var(--warn); }
.dup-box ul { margin: 4px 0 0; padding-inline-start: 1.2em; }
.dup-ok { margin-block-start: 6px; }
.dup-ok[hidden], .dup-box[hidden] { display: none; }

/* Following up the students of a course: level cards, score and bars. */
.trk-levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 10px; margin-block: 0 16px; }
.trk-level { --tone: var(--brand); display: grid; gap: 2px; padding: 14px 16px; border-radius: calc(var(--radius) + 4px); background: var(--surface); border: 1px solid var(--border); border-block-start: 4px solid var(--tone); text-decoration: none; color: var(--text); transition: transform .15s ease, box-shadow .15s ease; }
.trk-level:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, .08); }
.trk-level[aria-current="page"] { background: color-mix(in srgb, var(--tone) 12%, var(--surface)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--tone) 45%, transparent); }
.trk-level__n { font-size: 1.8rem; font-weight: 800; line-height: 1.1; color: var(--tone); }
.trk-level__t { font-weight: 700; }
.trk-level__s { font-size: .8rem; color: var(--muted); }
.trk-level--zero { --tone: #8a8f98; }
.trk-level--weak { --tone: #d64545; }
.trk-level--average { --tone: #d99a1c; }
.trk-level--good { --tone: #2f8fd8; }
.trk-level--excellent { --tone: #1f9d55; }
.trk-score { display: inline-grid; place-items: center; min-inline-size: 46px; block-size: 46px; padding-inline: 6px; border-radius: 50%; font-weight: 800; font-size: 1.05rem; color: #fff; background: #8a8f98; }
.trk-score--weak { background: #d64545; }
.trk-score--average { background: #d99a1c; }
.trk-score--good { background: #2f8fd8; }
.trk-score--excellent { background: #1f9d55; }
.trk-bar { display: inline-block; vertical-align: middle; inline-size: 90px; block-size: 8px; border-radius: 99px; background: var(--chip-bg); overflow: hidden; margin-inline-end: 6px; }
.trk-bar > span { display: block; block-size: 100%; border-radius: inherit; background: #1f9d55; }
.trk-bar--mid > span { background: #d99a1c; }
.trk-bar--low > span { background: #d64545; }
.trk-num { font-weight: 700; }
.trk-table td { vertical-align: top; }
.trk-file { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.trk-file__item { display: flex; gap: 12px; align-items: center; }
.trk-file__text { min-inline-size: 0; }
/* With the warning shown, the phone takes its own row so the fields beside it keep their size. */
.form--cols > .field:has(.dup-box:not([hidden])) { grid-column: 1 / -1; }
.form--cols > .field:has(.dup-box:not([hidden])) > input { max-inline-size: 420px; }

/* lesson page: watch a video first; student page: a video still being prepared */
.vprev { margin-top: .5rem; }
.vprev > summary { cursor: pointer; display: inline-flex; gap: .4rem; align-items: center; font-weight: 600; color: var(--brand, var(--accent)); }
.vprev__frame { position: relative; aspect-ratio: 16 / 9; max-width: 100%; margin-top: .6rem; border-radius: 12px; overflow: hidden; background: #000; }
.vprev__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lsn-wait__spin { width: 42px; height: 42px; border-radius: 50%; border: 4px solid rgba(127,127,127,.25); border-top-color: var(--accent); animation: lsn-spin 1s linear infinite; }
@keyframes lsn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .lsn-wait__spin { animation-duration: 3s; } }

/* 0.50.0 the student's lesson page: the video first and wide, one column of reading beside a
   slim column of "what to do", the questions under the reading (not under everything) */
.lsn-hero { padding: 16px 20px 14px; }
.lsn-hero__top { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: space-between; margin-block-end: 4px; }
.lsn-hero__course { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.lsn-hero__course svg { inline-size: 15px; block-size: 15px; }
.lsn-hero__place { font-size: .82rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--chip-bg); color: var(--muted); }
.lsn-star.is-on { background: var(--primary, var(--accent)); color: var(--on-primary, #000); border-color: transparent; }
.lsn { grid-template-columns: minmax(0, 1fr) 300px; grid-template-areas: "main side" "qa side"; }
.lsn__main { grid-area: main; }
.lsn__side { grid-area: side; align-self: start; }
.lsn-qa { grid-area: qa; margin: 0; }
.lsn-video { display: grid; gap: 8px; }
.lsn-video .lk-player__frame { border-radius: 16px; box-shadow: 0 18px 40px -22px rgba(0,0,0,.65); }
.lsn-video__title { display: flex; gap: 8px; align-items: center; margin: 0; font-size: 1rem; }
.lsn-video__title svg { inline-size: 18px; block-size: 18px; color: var(--brand); }
.lsn-wait { display: grid; place-items: center; align-content: center; gap: 10px; aspect-ratio: 16 / 9; max-width: 100%; padding: 20px; text-align: center; border-radius: 16px; background: radial-gradient(120% 120% at 50% 0%, color-mix(in srgb, var(--brand) 18%, var(--surface)), var(--surface)); border: 1px dashed var(--border); }
.lsn-wait strong { font-size: 1.15rem; }
.lsn-wait p { margin: 0; max-inline-size: 42ch; color: var(--muted); }
.lsn-part { padding: 16px 18px; }
.lsn-part__head { margin-block-end: 8px; }
.lsn-file--link .lsn-file__ico { background: var(--chip-bg); color: var(--brand); }
.lsn-nav { grid-template-columns: 1fr 1fr; }
.lsn-nav__a { flex-direction: row; align-items: center; gap: 10px; }
.lsn-nav__txt { display: flex; flex-direction: column; gap: 2px; min-inline-size: 0; flex: 1; }
.lsn-nav__txt strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lsn-nav__arrow { display: grid; place-items: center; flex: none; inline-size: 34px; block-size: 34px; border-radius: 50%; background: var(--chip-bg); color: var(--brand); }
.lsn-nav__arrow svg { inline-size: 18px; block-size: 18px; }
/* the "back" icon points to the start of the line: previous keeps it, next turns it around */
[dir="rtl"] .lsn-nav__a--prev .lsn-nav__arrow svg { transform: scaleX(-1); }
.lsn-nav__a--next .lsn-nav__arrow svg { transform: scaleX(-1); }
[dir="rtl"] .lsn-nav__a--next .lsn-nav__arrow svg { transform: none; }
.lsn__side .card { padding: 14px 16px; }
.lsn__side h2 { font-size: 1rem; margin: 0 0 8px; }
.lsn-done .hint { margin: 8px 0 0; }
.lsn-note textarea { min-block-size: 90px; }
@media (max-width: 980px) {
  .lsn { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "side" "qa"; }
  .lsn-video .lk-player__frame { border-radius: 12px; }
}
@media (max-width: 560px) {
  .lsn-hero { padding: 12px 14px; }
  .lsn-nav { grid-template-columns: minmax(0, 1fr); }
  .lsn-nav__a--next { grid-column: auto; }
}

/* ══ 0.51.0 "clear and bright": larger type, white text that is really white, brighter secondary
   text and borders, and a bright colour per summary card. Tokens only change here; every page
   follows. ══ */
:root {
  --text: #120c22; --text-2: #2a2140; --muted: #4f4569; --border: #d9cff0;
  --input-border: #bfb1dc; --chip-bg: #ece4fb; --chip-text: #3b2370;
  --brand: #6d28d9; --link: #6d28d9;
  --bg: #f6f2ff; --surface: #ffffff; --surface-2: #faf7ff; --hover: #efe8fd;
  --side-text: #efe7ff; --side-muted: #b3a6d3;
  --t1: #7c3aed; --t2: #0284c7; --t3: #db2777; --t4: #d97706; --t5: #0d9488; --t6: #4f46e5;
  --ok: #15803d; --warn: #b45309; --danger: #dc2626; --info: #6d28d9;
}
:root[data-theme="dark"] {
  --bg: #0e0a1c; --surface: #1c1533; --surface-2: #251c42; --hover: #2f2552;
  --text: #ffffff; --text-2: #f3eefc; --muted: #cdc2e6; --border: #3b3060;
  --input-bg: #160f2b; --input-border: #54467f; --chip-bg: #31275a; --chip-text: #f1eaff;
  --brand: #c4b0ff; --link: #d4c4ff; --brand-soft: #2e2455;
  --side-bg: #0b0817; --side-text: #f1eaff; --side-muted: #a99cd0;
  --t1: #a78bfa; --t2: #38bdf8; --t3: #f472b6; --t4: #fbbf24; --t5: #2dd4bf; --t6: #818cf8;
  --ok: #4ade80; --warn: #fbbf24; --danger: #fb7185; --info: #c4b5fd;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg: #0e0a1c; --surface: #1c1533; --surface-2: #251c42; --hover: #2f2552;
    --text: #ffffff; --text-2: #f3eefc; --muted: #cdc2e6; --border: #3b3060;
    --input-bg: #160f2b; --input-border: #54467f; --chip-bg: #31275a; --chip-text: #f1eaff;
    --brand: #c4b0ff; --link: #d4c4ff; --brand-soft: #2e2455;
    --side-bg: #0b0817; --side-text: #f1eaff; --side-muted: #a99cd0;
    --t1: #a78bfa; --t2: #38bdf8; --t3: #f472b6; --t4: #fbbf24; --t5: #2dd4bf; --t6: #818cf8;
    --ok: #4ade80; --warn: #fbbf24; --danger: #fb7185; --info: #c4b5fd;
  }
}

/* type: one size up everywhere, and the small print readable */
body { font-size: 16.5px; line-height: 1.65; }
h1 { font-size: clamp(1.7rem, 2.6vw, 2.15rem); }
h2 { font-size: 1.22rem; }
.small, small, .hint, .t th { font-size: .9rem; }
.hint, .muted { color: var(--muted); }
.t td { font-size: 1rem; }
.t th { color: var(--text-2); font-weight: 700; letter-spacing: .01em; }
label, .field > label { font-size: .98rem; font-weight: 700; color: var(--text-2); }
input, select, textarea { font-size: 1rem; }
.top__title { font-size: 1.12rem; }
.side__nav a { font-size: 1.02rem; color: var(--side-text); }

/* a bright colour per summary card: its stripe, its number and a soft wash */
.grid--stats > .stat { --tone: var(--t1); position: relative; overflow: hidden; border-block-start: 4px solid var(--tone);
  background: linear-gradient(160deg, color-mix(in srgb, var(--tone) 16%, var(--surface)) 0%, var(--surface) 62%); }
.grid--stats > .stat:nth-child(6n+2) { --tone: var(--t2); }
.grid--stats > .stat:nth-child(6n+3) { --tone: var(--t3); }
.grid--stats > .stat:nth-child(6n+4) { --tone: var(--t4); }
.grid--stats > .stat:nth-child(6n+5) { --tone: var(--t5); }
.grid--stats > .stat:nth-child(6n+6) { --tone: var(--t6); }
.stat__label { font-size: 1rem; font-weight: 700; color: var(--text-2); }
.stat__value { font-size: 2.3rem; line-height: 1.1; color: var(--tone, var(--text)); }
.stat__hint { font-size: .9rem; color: var(--muted); }
.stat--pick[aria-current="page"] { outline: 3px solid var(--tone, var(--accent)); outline-offset: 3px; }

/* chips readable */
.chip { font-size: .9rem; font-weight: 700; }

/* forms: every box on one line and one height. A field no longer stretches its box to the
   tallest neighbour (the label stays on top, the box right under it, the hint under the box). */
.field { align-content: start; }
.grid > .field, .form .grid { align-items: start; }
input[type="text"], input[type="password"], input[type="email"], input[type="tel"], input[type="number"],
input[type="date"], input[type="time"], input[type="search"], input[type="url"], input[type="datetime-local"],
select:not([multiple]):not([size]) { block-size: 48px; min-height: 48px; padding-block: 0; font-size: 1rem; }
textarea { font-size: 1rem; }
/* the list arrow always sits at the far end of the box, the same in every list */
:root { --sel-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%234f4569' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] { --sel-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23e6dcff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]):not([data-theme="dark"]) { --sel-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23e6dcff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); } }
select:not([multiple]):not([size]) { -webkit-appearance: none; appearance: none; background-image: var(--sel-arrow); background-repeat: no-repeat; background-size: 14px; background-position: right 14px center; padding-inline-start: 12px; padding-inline-end: 40px; }
[dir="rtl"] select:not([multiple]):not([size]) { background-position: left 14px center; }

/* 0.51.2 the helices behind the page: as tall as the largest viewport (a phone's address bar never resizes them) */
.dna-bg { block-size: 100vh; block-size: 100lvh; }

/* 0.54.0 lesson page: choose a video already on the video server */
.vlib { margin-block-start: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.vlib__sum { display: flex; align-items: center; gap: 14px; padding: 16px 18px; cursor: pointer; list-style: none; }
.vlib__sum::-webkit-details-marker { display: none; }
.vlib__sum b { display: block; font-size: 1.05rem; }
.vlib__sum small { display: block; color: var(--muted); line-height: 1.6; }
.vlib__ico { display: grid; place-items: center; flex: none; inline-size: 44px; block-size: 44px; border-radius: 14px; background: var(--primary, var(--accent)); color: var(--on-primary, #000); }
.vlib__ico svg { inline-size: 22px; block-size: 22px; }
.vlib[open] .vlib__sum { border-block-end: 1px solid var(--border); }
.vlib__bar { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 18px 0; }
.vlib__bar input[type="search"] { flex: 1 1 220px; min-inline-size: 0; }
.vlib__bar select { flex: 0 1 220px; min-inline-size: 0; inline-size: auto; }
.vlib__msg { margin: 10px 18px 0; color: var(--muted); }
.vlib__msg:empty { display: none; }
.vlib__peek { display: grid; gap: 8px; justify-items: start; margin: 14px 18px 0; }
.vlib__frame { position: relative; inline-size: 100%; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.vlib__frame iframe { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; border: 0; }
.vlib__list { display: grid; gap: 8px; margin: 0; padding: 14px 18px; list-style: none; }
.vlib__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.vlib__row.is-here { border-color: var(--ok, #4ade80); }
.vlib__main { display: grid; gap: 4px; min-inline-size: 0; flex: 1 1 260px; }
.vlib__t { overflow-wrap: anywhere; }
.vlib__meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: .9rem; color: var(--muted); }
.vlib__col { font-weight: 700; color: var(--text-2); }
.vlib__st { font-weight: 800; }
.vlib__st--ok { color: var(--ok); } .vlib__st--wait { color: var(--warn); } .vlib__st--bad { color: var(--danger); }
.vlib__used { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .88rem; color: var(--muted); }
.vlib__acts { display: flex; gap: 8px; flex: none; }
.vlib__pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0 18px 16px; }
@media (max-width: 560px) { .vlib__acts, .vlib__acts .btn { inline-size: 100%; } .vlib__acts .btn { flex: 1; } }

/* 0.55.0 student page: a ban from one subject only */
.sban { display: grid; gap: 10px; }
.sban h3 { margin: 0; font-size: 1.05rem; }
.sban__list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.sban__item { display: grid; gap: 10px; padding: 12px 14px; border: 1px solid var(--danger); border-radius: 14px; background: var(--surface); }
.sban__item .chip { margin-block-end: 4px; }
.sban__lift { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.sban__lift .field { flex: 1 1 200px; margin: 0; }

/* 0.55.1 register: everyone who came, in one number (make-ups are inside it, not on top of it) */
.stat--total { --tone: var(--ok, #4ade80); display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-block-end: 14px;
  border-block-start: 4px solid var(--tone); background: linear-gradient(160deg, color-mix(in srgb, var(--tone) 18%, var(--surface)) 0%, var(--surface) 70%); }
.stat--total .stat__value { font-size: 3rem; }

/* 0.55.2 lesson access: the holders card filters as a whole, by centre and by online */
.stat--split { display: grid; gap: 6px; }
.stat__cover { display: block; color: inherit; text-decoration: none; }
.stat__split { display: flex; flex-wrap: wrap; gap: 6px; }
.stat__split a { padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: .9rem; color: var(--text-2); text-decoration: none; }
.stat__split a:hover, .stat__split a[aria-current="page"] { border-color: var(--tone, var(--accent)); color: var(--text); }

/* 0.55.3 Lesson access, by lesson: the course's sections, its lessons and tests, with their counts */
.ax .cb-item { align-items: center; }
.ax__meta b { color: var(--text); font-weight: 800; }
.ax__n { display: grid; justify-items: center; min-inline-size: 64px; line-height: 1.1; }
.ax__n b { font-size: 1.35rem; color: var(--text); }
.ax__n small { font-size: .72rem; color: var(--muted); text-align: center; }

/* 0.55.4 cards that filter a list in place, and a lessons / tests switch */
.stat--pick[aria-current="true"] { outline: 3px solid var(--tone, var(--accent)); outline-offset: 3px; }
.stat__split a[aria-current="true"] { border-color: var(--tone, var(--accent)); color: var(--text); }
.seg { display: flex; flex-wrap: wrap; gap: 8px; margin-block-end: 12px; }
.seg .btn svg { inline-size: 16px; block-size: 16px; }

/* 0.56.0 the student's home: his courses with their pictures, and everything still to do */
.sh-hero { position: relative; display: flex; align-items: center; gap: 14px; overflow: hidden; margin-block-end: 22px; padding: 22px 20px; border-radius: 22px; color: #fff;
  background: #120e22; background-image: radial-gradient(120% 140% at 100% 0%, rgba(245, 197, 24, .28), transparent 55%), radial-gradient(90% 120% at 0% 100%, rgba(122, 76, 184, .65), transparent 70%); box-shadow: 0 18px 40px -24px rgba(0, 0, 0, .8); }
.sh-hero__txt { display: grid; gap: 8px; flex: 1; min-inline-size: 0; position: relative; z-index: 1; }
.sh-hero__hi { margin: 0; font-size: 1rem; color: rgba(255, 255, 255, .78); }
.sh-hero__title { margin: 0; font-family: var(--font-display); font-size: clamp(1.45rem, 5.6vw, 2.1rem); line-height: 1.2; color: #fff; text-wrap: balance; }
.sh-pill { display: inline-flex; align-items: center; gap: 8px; justify-self: start; max-inline-size: 100%; padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); color: #fff; text-decoration: none; font-size: .92rem; }
.sh-pill svg { inline-size: 18px; block-size: 18px; flex: none; color: #f5c518; }
.sh-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-live { justify-self: start; }
.sh-hero__img { flex: none; inline-size: 104px; block-size: 104px; object-fit: cover; object-position: top; border-radius: 50%; background: rgba(255, 255, 255, .08); border: 3px solid rgba(245, 197, 24, .55); }
.sh-sec { margin-block-end: 24px; }
.sh-h { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 1.25rem; }
.sh-count { display: inline-grid; place-items: center; min-inline-size: 28px; block-size: 28px; padding-inline: 8px; border-radius: 999px; background: var(--brand); color: var(--on-brand); font-size: .95rem; }

.sh-rail { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.sh-course { display: flex; flex-direction: column; overflow: hidden; border-radius: 20px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); }
.sh-course__img { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: linear-gradient(135deg, var(--brand), #7a4cb8); color: #fff; text-decoration: none; }
.sh-course__img img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; transition: transform .4s ease; }
.sh-course__img:hover img { transform: scale(1.04); }
.sh-course__letter { position: absolute; inset: 0; display: grid; place-items: center; font-size: 4rem; font-weight: 800; opacity: .9; }
.sh-course__shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(10, 8, 20, .88) 0%, rgba(10, 8, 20, .25) 55%, transparent 80%); }
.sh-course__over { position: absolute; inset-inline: 16px; inset-block-end: 14px; display: grid; gap: 2px; }
.sh-course__name { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; line-height: 1.2; text-shadow: 0 2px 10px rgba(0, 0, 0, .5); }
.sh-course__meta { font-size: .88rem; color: rgba(255, 255, 255, .82); }
.sh-course__play { position: absolute; inset-block-start: 12px; inset-inline-end: 12px; display: grid; place-items: center; inline-size: 48px; block-size: 48px; border-radius: 50%; background: #f5c518; color: #120e22; box-shadow: 0 8px 20px -6px rgba(245, 197, 24, .7); }
.sh-course__play svg { inline-size: 22px; block-size: 22px; }
.sh-course__body { display: grid; gap: 12px; padding: 14px 16px 16px; }
.sh-course__prog { display: grid; gap: 2px; }
.sh-course__prog .progress { margin: 0; }
.sh-course__left { display: flex; flex-wrap: wrap; gap: 6px; }
.sh-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: var(--chip-bg); font-size: .85rem; font-weight: 700; }
.sh-chip svg { inline-size: 14px; block-size: 14px; }
.sh-course__cta { display: grid; justify-items: start; gap: 0; padding: 12px 16px; text-align: start; border-radius: 14px; }
.sh-course__cta span { font-size: .85rem; font-weight: 700; opacity: .8; }
.sh-course__cta b { font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-inline-size: 100%; }
.sh-course__clear { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--ok); font-weight: 700; }
.sh-course__clear svg { inline-size: 18px; block-size: 18px; }
.sh-course__all { justify-self: center; font-size: .92rem; color: var(--muted); }

.sh-tasks { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.sh-task { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); color: inherit; text-decoration: none; transition: transform .15s, border-color .15s; }
.sh-task:hover { transform: translateY(-2px); border-color: var(--tone); }
.sh-task--lesson { --tone: #7a4cb8; } .sh-task--quiz { --tone: #f5c518; } .sh-task--assignment { --tone: #22c3a6; }
.sh-task__ico { display: grid; place-items: center; flex: none; inline-size: 44px; block-size: 44px; border-radius: 14px; background: color-mix(in srgb, var(--tone) 20%, transparent); color: var(--tone); }
.sh-task__ico svg { inline-size: 22px; block-size: 22px; }
.sh-task__main { display: grid; gap: 2px; flex: 1; min-inline-size: 0; }
.sh-task__main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-task__main small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-due { color: var(--warn); font-weight: 700; }
.sh-task__go { flex: none; padding: 8px 14px; border-radius: 999px; background: var(--tone); color: #120e22; font-weight: 800; font-size: .9rem; }
.sh-task--lesson .sh-task__go { color: #fff; }
.sh-more { display: block; margin-block-start: 10px; text-align: center; font-weight: 700; }
.sh-empty { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 18px; border: 1px dashed var(--border); background: var(--surface); }
.sh-empty svg { inline-size: 40px; block-size: 40px; color: #f5c518; flex: none; }
.sh-empty p { margin: 2px 0 0; color: var(--muted); }

.sh-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-block-end: 18px; }
.sh-stat { display: grid; gap: 2px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); color: inherit; text-decoration: none; }
.sh-stat b { font-size: 1.5rem; line-height: 1.1; }
.sh-stat span { font-weight: 700; font-size: .92rem; }
.sh-stat small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-warn { margin-block-end: 18px; }
.sh-recent summary { cursor: pointer; font-weight: 800; font-size: 1.05rem; }
.sh-recent[open] summary { margin-block-end: 10px; }
.sh-devices { margin-block-start: 18px; }

@media (max-width: 700px) {
  .sh-hero { padding: 18px 16px; border-radius: 18px; }
  .sh-hero__img { inline-size: 76px; block-size: 76px; }
  /* several courses: a swipeable row of big picture cards */
  .sh-rail:not(.sh-rail--one) { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; margin-inline: -12px; padding: 2px 12px 10px; scrollbar-width: none; }
  .sh-rail:not(.sh-rail--one)::-webkit-scrollbar { display: none; }
  .sh-rail:not(.sh-rail--one) .sh-course { flex: 0 0 86%; scroll-snap-align: center; }
  .sh-task { padding: 10px 12px; gap: 10px; }
  .sh-task__ico { inline-size: 40px; block-size: 40px; }
  .sh-task__go { padding: 7px 12px; font-size: .85rem; }
  .sh-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
