/* Learn2Write components: framework-free primitives shared by the site (Tailwind build), the portals and the staff app
   (Bootstrap). Every value comes from l2w-tokens.css; density comes from [data-density] on <body>. design.md documents each one.
   Prefix: l2w-. Never restyle Bootstrap classes here (portal.css / site.css bridge those). */

/* ---------- Icons (Lucide sprite, <l2w-icon> tag helper) ---------- */
.l2w-icon { width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: -.2em; fill: none; stroke: currentColor;
    stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.l2w-icon--20 { width: 20px; height: 20px; vertical-align: -.3em; }
.l2w-icon--24 { width: 24px; height: 24px; }
.l2w-icon--filled { fill: currentColor; }
.l2w-icon--spin { animation: l2w-spin 1s linear infinite; }
@keyframes l2w-spin { to { transform: rotate(360deg); } }

/* ---------- Utilities ---------- */
.l2w-visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.l2w-stack { display: flex; flex-direction: column; gap: var(--l2w-space-4); }
.l2w-stack--tight { gap: var(--l2w-space-2); }
.l2w-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--l2w-space-2); }
.l2w-muted { color: var(--l2w-text-muted); }
.l2w-num { font-variant-numeric: tabular-nums; }
.l2w-display { font-family: var(--l2w-font-display); font-weight: 600; letter-spacing: -.01em; color: var(--l2w-ink); }
/* XP-11 (staging review 29 Oct): a readable measure. Prose and notices stop at 70 characters a line (--l2w-measure); tables, grids
   and forms keep their own width. .l2w-prose caps a block; in the family and school portals (_PortalLayout) every paragraph and
   notice in <main> is capped by default (a centred paragraph stays centred). */
.l2w-prose { max-width: var(--l2w-measure); }
:where(.portal-body #main) :where(p, .l2w-notice) { max-width: var(--l2w-measure); }
:where(.portal-body #main) :where(.text-center p, p.text-center, .l2w-empty p) { margin-inline: auto; }
:where(.portal-body #main) :where(td p, th p, .l2w-table p, .table p) { max-width: none; }

/* ---------- Buttons: radius 6, one height per density ---------- */
.l2w-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--l2w-space-2); min-height: var(--l2w-control-height);
    padding: 0 var(--l2w-control-pad-x); border: 1px solid transparent; border-radius: var(--l2w-radius-control);
    font: var(--l2w-weight-semibold) var(--l2w-control-size)/1.2 var(--l2w-font-sans); text-decoration: none; white-space: nowrap;
    cursor: pointer; background: var(--l2w-surface); color: var(--l2w-ink); border-color: var(--l2w-border-strong);
    transition: background-color var(--l2w-duration-fast) var(--l2w-ease-out), border-color var(--l2w-duration-fast) var(--l2w-ease-out); }
.l2w-btn:hover { background: var(--l2w-paper-deep); color: var(--l2w-ink); }
.l2w-btn:focus-visible { outline: var(--l2w-focus-outline); outline-offset: 2px; }
.l2w-btn[disabled], .l2w-btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.l2w-btn--primary { background: var(--l2w-action); border-color: var(--l2w-action); color: var(--l2w-on-action); }
.l2w-btn--primary:hover { background: var(--l2w-action-strong); border-color: var(--l2w-action-strong); color: var(--l2w-on-action); }
.l2w-btn--ghost { background: transparent; border-color: transparent; color: var(--l2w-action-strong); }
.l2w-btn--ghost:hover { background: var(--l2w-action-tint); color: var(--l2w-action-strong); }
.l2w-btn--danger { background: var(--l2w-surface); border-color: var(--l2w-danger); color: var(--l2w-danger); }
.l2w-btn--danger:hover { background: var(--l2w-danger-tint); color: var(--l2w-danger); }
.l2w-btn--coral { background: var(--l2w-coral-strong); border-color: var(--l2w-coral-strong); color: var(--l2w-on-action); } /* site CTAs only */
.l2w-btn--coral:hover { background: var(--l2w-coral-stronger); border-color: var(--l2w-coral-stronger); color: var(--l2w-on-action); }
.l2w-btn--sm { min-height: calc(var(--l2w-control-height) - 8px); padding: 0 calc(var(--l2w-control-pad-x) - 4px); font-size: var(--l2w-text-13); }
.l2w-btn--block { display: flex; width: 100%; }
.l2w-btn--icon { padding: 0; width: var(--l2w-control-height); }

/* ---------- Fields ---------- */
.l2w-field-group { display: flex; flex-direction: column; gap: var(--l2w-space-1); }
.l2w-label { font: var(--l2w-weight-semibold) var(--l2w-text-14)/1.3 var(--l2w-font-sans); color: var(--l2w-ink); }
.l2w-hint { font-size: var(--l2w-text-13); color: var(--l2w-text-muted); }
.l2w-error { font-size: var(--l2w-text-13); color: var(--l2w-danger); }
/* "Thu 1 Oct 2026" under a staff date field (js/l2w.js, UAT L2W-53) */
.l2w-date-echo { display: block; font-size: var(--l2w-text-12); color: var(--l2w-text-muted); font-variant-numeric: tabular-nums; min-height: 1em; }
.l2w-field { display: block; width: 100%; min-height: var(--l2w-control-height); padding: 8px var(--l2w-control-pad-x);
    border: 1px solid var(--l2w-border-strong); border-radius: var(--l2w-radius-control); background: var(--l2w-surface);
    color: var(--l2w-ink); font: var(--l2w-weight-regular) var(--l2w-control-size)/1.4 var(--l2w-font-sans); }
.l2w-field:focus { outline: none; border-color: var(--l2w-action); box-shadow: var(--l2w-focus-ring); }
.l2w-field[aria-invalid="true"], .l2w-field.input-validation-error { border-color: var(--l2w-danger); }
textarea.l2w-field { min-height: 6rem; }
.l2w-check { display: inline-flex; align-items: flex-start; gap: var(--l2w-space-2); font-size: var(--l2w-body-size); }
.l2w-check input { width: 18px; height: 18px; margin-top: .15em; accent-color: var(--l2w-action); }

/* ---------- Cards ---------- */
.l2w-card { background: var(--l2w-surface); border: 1px solid var(--l2w-border); border-radius: var(--l2w-radius-card); padding: var(--l2w-card-pad); }
.l2w-card--flush { padding: 0; overflow: hidden; }
.l2w-card__title { margin: 0 0 var(--l2w-space-3); font: var(--l2w-weight-semibold) var(--l2w-text-17)/1.3 var(--l2w-font-sans); color: var(--l2w-ink); }
[data-density="reading"] .l2w-card__title { font-family: var(--l2w-font-display); font-size: var(--l2w-text-20); }
.l2w-card--auth { max-width: 440px; margin: 0 auto; }

/* ---------- Chips (the only pills) ---------- */
.l2w-chip { display: inline-flex; align-items: center; gap: var(--l2w-space-1); padding: 2px 10px; border-radius: var(--l2w-radius-pill);
    font: var(--l2w-weight-semibold) var(--l2w-text-13)/1.5 var(--l2w-font-sans); background: var(--l2w-surface-sunken); color: var(--l2w-status-sent); white-space: nowrap; }

/* Filter chips on a staff grid (the outbox "UAT only" chip): a link that switches one filter on or off. */
.l2w-filter-chips { display: flex; flex-wrap: wrap; gap: var(--l2w-space-2); align-items: center; }
.l2w-filter-chips a.l2w-chip { min-height: var(--l2w-target-min); padding-inline: var(--l2w-space-3); text-decoration: none; color: var(--l2w-ink); }
.l2w-filter-chips a.l2w-chip:hover { background: var(--l2w-action-tint); }
.l2w-filter-chips a.l2w-chip.is-current { background: var(--l2w-ink); color: var(--l2w-text-on-ink); }

/* Billing › Payments: a payment's origin (Core PaymentOrigins). Old site stays the neutral chip; the word carries the meaning. */
.l2w-chip--origin[data-origin="old-site-renewal"] { background: var(--l2w-status-assigned-tint); color: var(--l2w-status-assigned); }
.l2w-chip--origin[data-origin="new-site"] { background: var(--l2w-success-tint); color: var(--l2w-success); }
.l2w-chip--origin[data-origin="new-site-renewal"] { background: var(--l2w-info-tint); color: var(--l2w-info); }
.l2w-chip--origin[data-origin="test"] { background: var(--l2w-warning-tint); color: var(--l2w-warning); }
/* Something the admin still has to set (a client with no time zone yet, F9). */
.l2w-chip--warning { background: var(--l2w-warning-tint); color: var(--l2w-warning); }
/* Pill colour ROLES (staging review 29 Oct, XP-07; design.md §3 "Pill roles"): one job per colour, the word always says it.
   Paper states use .l2w-status--* (dot + word); every other pill picks ONE of these. */
.l2w-chip--neutral { background: var(--l2w-pill-neutral-bg); color: var(--l2w-pill-neutral-fg); }        /* a count or fact: "8 left" */
.l2w-chip--new { background: var(--l2w-pill-new-bg); color: var(--l2w-pill-new-fg); }                    /* unread: "1 new", "New" */
.l2w-chip--info { background: var(--l2w-pill-info-bg); color: var(--l2w-pill-info-fg); }                 /* for information */
.l2w-chip--good { background: var(--l2w-pill-good-bg); color: var(--l2w-pill-good-fg); }                 /* free, active, done */
.l2w-chip--attention { background: var(--l2w-pill-attention-bg); color: var(--l2w-pill-attention-fg); }  /* paused, test, AI off */
.l2w-chip--problem { background: var(--l2w-pill-problem-bg); color: var(--l2w-pill-problem-fg); }        /* send again, overdue */
a.l2w-chip { text-decoration: none; }

/* ---------- Paper status (same colour per state for every audience) ---------- */
.l2w-status { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--l2w-radius-pill);
    font: var(--l2w-weight-semibold) var(--l2w-text-13)/1.5 var(--l2w-font-sans); white-space: nowrap;
    color: var(--l2w-status-sent); background: var(--l2w-status-sent-tint); }
.l2w-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.l2w-status--received { color: var(--l2w-status-received); background: var(--l2w-status-received-tint); }
.l2w-status--assigned { color: var(--l2w-status-assigned); background: var(--l2w-status-assigned-tint); }
.l2w-status--marking { color: var(--l2w-status-marking); background: var(--l2w-status-marking-tint); }
.l2w-status--ready { color: var(--l2w-status-ready); background: var(--l2w-status-ready-tint); }
.l2w-status--returned { color: var(--l2w-status-returned); background: var(--l2w-status-returned-tint); }
.l2w-status--checking { color: var(--l2w-status-checking); background: var(--l2w-status-checking-tint); }
.l2w-status--updating { color: var(--l2w-status-updating); background: var(--l2w-status-updating-tint); }
.l2w-status--none { color: var(--l2w-text-muted); background: transparent; border: 1px dashed var(--l2w-border-strong); }
/* 18 Nov 2026: an earlier attempt of a paper that was sent again (school portals) — the journey's "Sent" colour, nothing to do */
.l2w-status--resent { color: var(--l2w-status-sent); background: var(--l2w-status-sent-tint); }
/* 19 Nov 2026 (Issues NOW 6): the class grid's "Assigned" — given to the student, nothing sent yet. Dashed like "Not sent" (no paper
   yet), in the information colour so it reads as set work, not a gap. */
.l2w-status--tosend { color: var(--l2w-pill-info-fg); background: var(--l2w-pill-info-bg); border: 1px dashed currentColor; }

/* ---------- NOW 10 (E-7): the class Status set — exactly eight states for every school page ----------
   Each has a fill, an outline and a small inline icon (rendered as <l2w-icon> by the markup: square, up-arrow, pencil, return-arrow,
   none for Marked, dash, right-arrow, exclamation). Text is the state's own dark colour on its light fill (≥ 4.5:1). Marked keeps the
   year-level band (.cs-lvl--*) as its fill and shows only its marks. The parent portal keeps .l2w-status--* (its own words). */
.l2w-cell { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--l2w-radius-control);
    font: var(--l2w-weight-semibold) var(--l2w-text-13)/1.4 var(--l2w-font-sans); white-space: nowrap; border: 1px solid currentColor;
    text-decoration: none; }
.l2w-cell .l2w-icon { flex: none; width: 12px; height: 12px; }
.l2w-cell--assigned { color: var(--l2w-pill-info-fg); background: var(--l2w-pill-info-bg); border-style: dashed; }
.l2w-cell--submitted { color: var(--l2w-status-received); background: var(--l2w-status-received-tint); }
.l2w-cell--marking { color: var(--l2w-status-marking); background: var(--l2w-status-marking-tint); }
.l2w-cell--sentback { color: var(--l2w-status-returned); background: var(--l2w-status-returned-tint); }
.l2w-cell--marked { color: var(--l2w-status-ready); background: var(--l2w-status-ready-tint); }
.l2w-cell--na { color: var(--l2w-text-muted); background: var(--l2w-surface); border: 1px dashed var(--l2w-border-strong); font-weight: var(--l2w-weight-regular, 400); }
.l2w-cell--left { color: var(--l2w-ink-soft); background: var(--l2w-surface-sunken); border: 1px dotted var(--l2w-border-strong); font-weight: var(--l2w-weight-regular, 400); }
.l2w-cell--blocked { color: var(--l2w-pill-problem-fg); background: var(--l2w-pill-problem-bg); border-width: 2px; }

/* ---------- Timeline (paper journey) ---------- */
.l2w-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.l2w-timeline__step { position: relative; display: grid; grid-template-columns: 24px 1fr; gap: var(--l2w-space-3); padding-bottom: var(--l2w-space-4); }
.l2w-timeline__step:last-child { padding-bottom: 0; }
.l2w-timeline__step::before { content: ""; position: absolute; left: 11px; top: 24px; bottom: 0; width: 2px; background: var(--l2w-border); }
.l2w-timeline__step:last-child::before { display: none; }
.l2w-timeline__dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--l2w-surface);
    border: 2px solid var(--l2w-border-strong); color: var(--l2w-text-muted); }
.l2w-timeline__step--done .l2w-timeline__dot { background: var(--l2w-status-ready); border-color: var(--l2w-status-ready); color: var(--l2w-on-action); }
.l2w-timeline__step--done::before { background: var(--l2w-status-ready); }
.l2w-timeline__step--current .l2w-timeline__dot { border-color: var(--l2w-action); color: var(--l2w-action); box-shadow: var(--l2w-focus-ring); }
.l2w-timeline__label { font-weight: var(--l2w-weight-semibold); color: var(--l2w-ink); }
.l2w-timeline__step--todo .l2w-timeline__label { color: var(--l2w-text-muted); font-weight: var(--l2w-weight-medium); }
.l2w-timeline__meta { font-size: var(--l2w-text-13); color: var(--l2w-text-muted); }

/* ---------- Notices (inline) and toast ---------- */
.l2w-notice { display: flex; gap: var(--l2w-space-3); align-items: flex-start; padding: var(--l2w-space-3) var(--l2w-space-4);
    border: 1px solid var(--l2w-border); border-left: 4px solid var(--l2w-info); border-radius: var(--l2w-radius-control);
    background: var(--l2w-info-tint); color: var(--l2w-ink); font-size: var(--l2w-body-size); }
.l2w-notice--success { border-left-color: var(--l2w-success); background: var(--l2w-success-tint); }
.l2w-notice--warning { border-left-color: var(--l2w-warning); background: var(--l2w-warning-tint); }
.l2w-notice--danger { border-left-color: var(--l2w-danger); background: var(--l2w-danger-tint); }
/* Switch (UAT R-24): an on/off setting that saves when changed. A <button role="switch" aria-checked> inside its own form,
   so it works without JS; the form's data-l2w-confirm states the effect before it changes. Visible label + "On/Off" word:
   the state is never colour-only. */
.l2w-switch { display: inline-flex; align-items: center; gap: var(--l2w-space-3); min-height: var(--l2w-control-height); padding: 0;
    border: 0; background: transparent; color: var(--l2w-ink); font: inherit; font-weight: var(--l2w-weight-semibold); text-align: left; cursor: pointer; }
.l2w-switch__track { position: relative; flex: none; width: 44px; height: 24px; border-radius: 999px; background: var(--l2w-border-strong);
    transition: background-color var(--l2w-duration-fast); }
.l2w-switch__thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--l2w-surface);
    box-shadow: 0 1px 2px rgb(10 45 75 / .3); transition: transform var(--l2w-duration-fast); }
.l2w-switch[aria-checked="true"] .l2w-switch__track { background: var(--l2w-action); }
.l2w-switch[aria-checked="true"] .l2w-switch__thumb { transform: translateX(20px); }
.l2w-switch:focus-visible { outline: var(--l2w-focus-outline); outline-offset: 2px; border-radius: var(--l2w-radius-control); }
.l2w-switch__state { font-weight: var(--l2w-weight-regular); color: var(--l2w-text-muted); }

/* "Technical details" (design.md §11): settings names, file names and raw payloads live only inside this fold (UAT R-23). */
.l2w-tech > summary { cursor: pointer; color: var(--l2w-text-muted); font-size: var(--l2w-text-13); width: fit-content; }
.l2w-tech > summary:focus-visible { outline: var(--l2w-focus-outline); outline-offset: 2px; border-radius: 4px; }
.l2w-tech[open] > summary { margin-bottom: var(--l2w-space-1); }
.l2w-tech code { overflow-wrap: anywhere; }
.l2w-notice__close { margin-left: auto; border: 0; background: transparent; color: inherit; cursor: pointer; padding: 2px; border-radius: 4px; }

/* Toast: a one-line confirmation that floats under the header (fixed, so the page never shifts), then goes away.
   The host is rendered once per layout (Shared/_Toasts); l2w.js sets its top from the header and runs the timers. */
.l2w-toast-host { position: fixed; z-index: var(--l2w-z-toast); top: var(--l2w-toast-top, 88px); right: var(--l2w-space-4);
    display: grid; gap: var(--l2w-space-2); width: min(26rem, calc(100vw - 2 * var(--l2w-space-4))); pointer-events: none; }
.l2w-toast { pointer-events: auto; display: flex; gap: var(--l2w-space-3); align-items: flex-start; padding: var(--l2w-space-3) var(--l2w-space-3) var(--l2w-space-3) var(--l2w-space-4);
    --l2w-toast-accent: color-mix(in srgb, var(--l2w-success) 45%, var(--l2w-text-on-ink));
    background: var(--l2w-ink); color: var(--l2w-text-on-ink); border-left: 4px solid var(--l2w-toast-accent); border-radius: var(--l2w-radius-card);
    box-shadow: var(--l2w-shadow-float); font: var(--l2w-weight-medium) var(--l2w-text-15)/1.45 var(--l2w-font-sans);
    animation: l2w-enter var(--l2w-duration) var(--l2w-ease-out); }
.l2w-toast > .l2w-icon { flex: none; margin-top: 1px; color: var(--l2w-toast-accent); }
/* Accents are lightened towards the on-ink text so icon and border keep 3:1 on the ink ground. */
.l2w-toast--info { --l2w-toast-accent: var(--l2w-sky); }
.l2w-toast--warning { --l2w-toast-accent: color-mix(in srgb, var(--l2w-warning) 35%, var(--l2w-text-on-ink)); }
.l2w-toast__text { flex: 1; min-width: 0; }
.l2w-toast__close { flex: none; display: grid; place-items: center; width: 32px; height: 32px; margin: -6px -4px -6px 0; border: 0; border-radius: var(--l2w-radius-control);
    background: transparent; color: inherit; cursor: pointer; }
.l2w-toast__close:hover { background: color-mix(in srgb, var(--l2w-text-on-ink) 14%, transparent); }
.l2w-toast__close:focus-visible { outline: 2px solid var(--l2w-sky); outline-offset: 1px; }
@media (max-width: 575.98px) { .l2w-toast-host { right: var(--l2w-space-4); left: var(--l2w-space-4); width: auto; } }

/* ---------- Floating layers: menu, dialog, action bar (the ONE shadow) ---------- */
.l2w-menu { position: absolute; z-index: var(--l2w-z-menu); min-width: 14rem; margin: 0; padding: var(--l2w-space-2); list-style: none;
    background: var(--l2w-surface); border: 1px solid var(--l2w-border); border-radius: var(--l2w-radius-card); box-shadow: var(--l2w-shadow-float);
    animation: l2w-enter var(--l2w-duration) var(--l2w-ease-out); }
.l2w-menu a, .l2w-menu button { display: flex; align-items: center; gap: var(--l2w-space-2); width: 100%; padding: 8px 10px; border: 0;
    border-radius: var(--l2w-radius-control); background: transparent; color: var(--l2w-ink); font: var(--l2w-weight-medium) var(--l2w-text-14)/1.3 var(--l2w-font-sans);
    text-align: left; text-decoration: none; cursor: pointer; }
.l2w-menu a:hover, .l2w-menu button:hover, .l2w-menu a:focus-visible, .l2w-menu button:focus-visible { background: var(--l2w-paper-deep); outline: none; }
.l2w-menu__heading { padding: 8px 10px 4px; font-size: var(--l2w-text-12); font-weight: var(--l2w-weight-bold); letter-spacing: .06em; text-transform: uppercase; color: var(--l2w-text-muted); }
.l2w-menu__sep { height: 1px; margin: var(--l2w-space-2) 0; background: var(--l2w-border); }

.l2w-dialog { border: 1px solid var(--l2w-border); border-radius: var(--l2w-radius-card); padding: 0; max-width: min(34rem, calc(100vw - 32px));
    background: var(--l2w-surface); color: var(--l2w-ink); box-shadow: var(--l2w-shadow-float); }
.l2w-dialog::backdrop { background: var(--l2w-scrim); }
.l2w-dialog[open] { animation: l2w-enter var(--l2w-duration) var(--l2w-ease-out); }
.l2w-dialog__body { padding: var(--l2w-space-6); }
.l2w-dialog__title { margin: 0 0 var(--l2w-space-2); font: var(--l2w-weight-semibold) var(--l2w-text-20)/1.3 var(--l2w-font-sans); }
.l2w-dialog__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--l2w-space-2); padding: var(--l2w-space-4) var(--l2w-space-6);
    border-top: 1px solid var(--l2w-border); background: var(--l2w-paper-cool); border-radius: 0 0 var(--l2w-radius-card) var(--l2w-radius-card); }

/* Drawer (28 Oct 2026, the evaluator's child progress): a native modal <dialog> anchored to the right edge, full height — a reading
   panel beside the work, never a form. The panel fills the dialog, so a click on the dialog itself is a click on the backdrop. No
   entrance animation (it opens over the evaluator workspace: design.md section 7). Full width on a phone. */
.l2w-drawer { position: fixed; inset: 0 0 0 auto; margin: 0; padding: 0; width: min(30rem, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh;
    border: 0; border-left: 1px solid var(--l2w-border); border-radius: var(--l2w-radius-card) 0 0 var(--l2w-radius-card);
    background: var(--l2w-surface); color: var(--l2w-ink); box-shadow: var(--l2w-shadow-float); }
.l2w-drawer::backdrop { background: var(--l2w-scrim); }
.l2w-drawer__panel { position: relative; height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: var(--l2w-space-6); }
.l2w-drawer__close { position: absolute; top: var(--l2w-space-3); right: var(--l2w-space-3); color: var(--l2w-ink-soft); }
@media (max-width: 575.98px) { .l2w-drawer { width: 100vw; border-radius: 0; border-left: 0; } .l2w-drawer__panel { padding: var(--l2w-space-4); } }

.l2w-actionbar { position: sticky; bottom: calc(var(--l2w-tabbar-h, 0px) + var(--l2w-space-4)); z-index: var(--l2w-z-actionbar); display: flex; flex-wrap: wrap; align-items: center;
    gap: var(--l2w-space-3); margin-top: var(--l2w-space-4); padding: var(--l2w-space-3) var(--l2w-space-4); background: var(--l2w-ink); color: var(--l2w-text-on-ink);
    border-radius: var(--l2w-radius-card); box-shadow: var(--l2w-shadow-float); animation: l2w-rise var(--l2w-duration) var(--l2w-ease-out); }
.l2w-actionbar[hidden] { display: none; }
.l2w-actionbar__text { font-weight: var(--l2w-weight-semibold); margin-right: auto; }
.l2w-actionbar .l2w-btn:not(.l2w-btn--primary) { background: transparent; color: var(--l2w-text-on-ink); border-color: rgb(252 249 243 / .4); }
.l2w-actionbar .l2w-btn:not(.l2w-btn--primary):hover { background: rgb(252 249 243 / .12); }
.l2w-actionbar .l2w-btn:focus-visible { outline-color: var(--l2w-sky); }

@keyframes l2w-enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes l2w-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Meters (score per area) ---------- */
.l2w-meter { display: grid; grid-template-columns: minmax(8rem, 1fr) 3fr auto; align-items: center; gap: var(--l2w-space-3); }
.l2w-meter__track { height: 8px; border-radius: var(--l2w-radius-pill); background: var(--l2w-surface-sunken); overflow: hidden; }
.l2w-meter__fill { height: 100%; border-radius: inherit; background: var(--l2w-action); }
.l2w-meter__value { font-variant-numeric: tabular-nums; font-weight: var(--l2w-weight-semibold); min-width: 3.5rem; text-align: right; }
@media (max-width: 575.98px) { .l2w-meter { grid-template-columns: 1fr auto; } .l2w-meter__track { grid-column: 1 / -1; order: 3; } }

/* ---------- Empty state ---------- */
.l2w-empty { display: grid; justify-items: center; gap: var(--l2w-space-2); padding: var(--l2w-space-8) var(--l2w-space-4); text-align: center;
    color: var(--l2w-text-muted); border: 1px dashed var(--l2w-border-strong); border-radius: var(--l2w-radius-card); }
.l2w-empty .l2w-icon { width: 24px; height: 24px; }

/* ---------- Data tables (compact tool surface) ---------- */
.l2w-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--l2w-body-size); background: var(--l2w-surface); }
.l2w-table th { position: sticky; top: 0; background: var(--l2w-paper-cool); color: var(--l2w-text-muted); font-size: var(--l2w-text-13);
    font-weight: var(--l2w-weight-semibold); text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--l2w-border); white-space: nowrap; }
.l2w-table td { height: var(--l2w-row-height); padding: 4px 12px; border-bottom: 1px solid var(--l2w-border); vertical-align: middle; }
.l2w-table tr:last-child td { border-bottom: 0; }
.l2w-table-wrap { overflow-x: auto; border: 1px solid var(--l2w-border); border-radius: var(--l2w-radius-card); }

/* Page intro: first sentence, then "Learn more" (l2w.js, [data-l2w-intro]) */
.l2w-intro__toggle { border: 0; background: none; padding: 0 2px; color: var(--l2w-action-strong); font: inherit; font-weight: var(--l2w-weight-semibold);
    text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.l2w-intro__toggle:focus-visible { outline: var(--l2w-focus-outline); outline-offset: 2px; border-radius: 2px; }

/* ---------- Filters: client filter + date range chip (design.md §10; Shared/_ClientFilter, Shared/_DateRange) ---------- */
.l2w-filter { min-width: 12rem; }
.l2w-filterbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--l2w-space-3); }
.l2w-range { position: relative; display: inline-block; }
.l2w-range > summary { list-style: none; cursor: pointer; }
.l2w-range > summary::-webkit-details-marker { display: none; }
.l2w-range__chip { min-height: 28px; background: var(--l2w-action-tint); color: var(--l2w-action-strong); border: 1px solid transparent; }
.l2w-range__chip:hover { border-color: var(--l2w-action); }
.l2w-range > summary:focus-visible { outline: var(--l2w-focus-outline); outline-offset: 2px; }
.l2w-range__menu { top: calc(100% + 4px); left: 0; min-width: 17rem; }
.l2w-range__menu a.is-current { background: var(--l2w-action-tint); color: var(--l2w-action-strong); }
.l2w-range__fields { display: grid; grid-template-columns: 1fr 1fr; gap: var(--l2w-space-2); padding: 0 10px var(--l2w-space-2); }
.l2w-range__custom .l2w-btn { display: inline-flex; width: auto; margin: 0 10px 4px; justify-content: center; background: var(--l2w-action);
    color: var(--l2w-on-action); font-weight: var(--l2w-weight-semibold); }
.l2w-range__custom .l2w-btn:hover { background: var(--l2w-action-strong); color: var(--l2w-on-action); }
@media (max-width: 575.98px) { .l2w-range__menu { left: auto; right: 0; min-width: min(17rem, calc(100vw - 32px)); } }

/* ---------- KPI tiles (Overview, dashboards): a figure, what it is, and its period; the tile links to the list behind it ---------- */
.l2w-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); gap: var(--l2w-space-3); }
.l2w-tile { display: flex; flex-direction: column; gap: var(--l2w-space-1); padding: var(--l2w-card-pad); background: var(--l2w-surface);
    border: 1px solid var(--l2w-border); border-radius: var(--l2w-radius-card); min-width: 0; }
.l2w-tile:hover { border-color: var(--l2w-border-strong); }
.l2w-tile__link { display: flex; flex-direction: column; gap: 2px; color: var(--l2w-ink); text-decoration: none; }
.l2w-tile__link:hover .l2w-tile__label { color: var(--l2w-action-strong); text-decoration: underline; text-underline-offset: 2px; }
.l2w-tile__link:focus-visible { outline: var(--l2w-focus-outline); outline-offset: 4px; border-radius: 2px; }
.l2w-tile__value { font: var(--l2w-weight-bold) var(--l2w-text-24)/1.2 var(--l2w-font-sans); font-variant-numeric: tabular-nums; color: var(--l2w-ink); }
.l2w-tile__label { font: var(--l2w-weight-semibold) var(--l2w-text-14)/1.3 var(--l2w-font-sans); color: var(--l2w-ink); }
.l2w-tile__meta { font-size: var(--l2w-text-13); color: var(--l2w-text-muted); }
.l2w-tile__period { align-self: flex-start; border: 0; background: none; padding: 0; font: inherit; font-size: var(--l2w-text-13);
    color: var(--l2w-action-strong); text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; }
.l2w-tile__period:focus-visible { outline: var(--l2w-focus-outline); outline-offset: 2px; border-radius: 2px; }
.l2w-tile--alert { border-left: 3px solid var(--l2w-danger); }
.l2w-tile--alert .l2w-tile__value { color: var(--l2w-danger); }
.l2w-tile--warn { border-left: 3px solid var(--l2w-warning); }
.l2w-tile--muted .l2w-tile__value { color: var(--l2w-text-muted); }
.l2w-section-title { margin: var(--l2w-space-6) 0 var(--l2w-space-2); font: var(--l2w-weight-semibold) var(--l2w-text-15)/1.3 var(--l2w-font-sans); color: var(--l2w-ink); }
.l2w-info { color: var(--l2w-text-muted); font-size: var(--l2w-text-13); }

/* Tabs (2026-09-30): links along a rule; the current one is underlined in action blue. Server-rendered (?tab=), no JS. */
.l2w-tabs { display: flex; flex-wrap: wrap; gap: var(--l2w-space-4); border-bottom: 1px solid var(--l2w-border); }
.l2w-tabs a { padding: var(--l2w-space-2) 0; color: var(--l2w-text-muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; }
.l2w-tabs a:hover { color: var(--l2w-ink); }
.l2w-tabs a[aria-current="page"] { color: var(--l2w-ink); border-bottom-color: var(--l2w-action); }

/* ---------- Pager + grid regions (Shared/_Pager, wwwroot/js/grid.js; design.md §10 "Pager"). One pager for staff and portals.
   Full: "Showing 26–50 of 312", a page window, Previous / Next, rows per page. Compact (portals): Previous · Page 2 of 9 · Next.
   No motion anywhere (design.md §7): the region dims while the next page loads and keeps its height; nothing slides or fades. */
.l2w-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--l2w-space-2) var(--l2w-space-4);
    padding: var(--l2w-space-2) var(--l2w-space-3); border-top: 1px solid var(--l2w-border); background: var(--l2w-paper-cool);
    color: var(--l2w-text-muted); font-size: var(--l2w-text-13); font-variant-numeric: tabular-nums; }
.l2w-pager__summary { margin: 0; }
.l2w-pager__summary strong { color: var(--l2w-ink); font-weight: var(--l2w-weight-semibold); }
.l2w-pager__nav { margin-left: auto; }
.l2w-pager__list { display: flex; flex-wrap: wrap; align-items: center; gap: var(--l2w-space-1); margin: 0; padding: 0; list-style: none; }
.l2w-pager__num, .l2w-pager__step { display: inline-flex; align-items: center; justify-content: center; gap: var(--l2w-space-1);
    min-width: var(--l2w-control-height); min-height: var(--l2w-control-height); padding: 0 var(--l2w-space-2);
    border: 1px solid var(--l2w-border); border-radius: var(--l2w-radius-control); background: var(--l2w-surface);
    color: var(--l2w-action-strong); font-weight: var(--l2w-weight-semibold); line-height: 1.2; text-decoration: none; }
a.l2w-pager__num:hover, a.l2w-pager__step:hover { background: var(--l2w-action-tint); border-color: var(--l2w-action); color: var(--l2w-action-strong); }
.l2w-pager a:focus-visible { outline: var(--l2w-focus-outline); outline-offset: 2px; }
.l2w-pager__num[aria-current="page"] { background: var(--l2w-action); border-color: var(--l2w-action); color: var(--l2w-on-action); }
.l2w-pager__step[aria-disabled="true"] { background: transparent; color: var(--l2w-text-muted); cursor: default; }
.l2w-pager__gap { min-width: var(--l2w-space-4); text-align: center; color: var(--l2w-text-muted); }
.l2w-pager__where { padding: 0 var(--l2w-space-2); color: var(--l2w-ink); font-weight: var(--l2w-weight-semibold); white-space: nowrap; }
.l2w-pager__size { display: inline-flex; align-items: center; gap: var(--l2w-space-2); margin: 0; white-space: nowrap; }
.l2w-pager__select { display: inline-block; width: auto; min-height: var(--l2w-control-height); padding-block: 0; }
/* Compact (portals): sits under a list or timeline, not inside a table card. The words stay: families read them. */
.l2w-pager--compact { margin-top: var(--l2w-space-6); padding: 0; border-top: 0; background: transparent; font-size: var(--l2w-body-size); }
.l2w-pager--compact .l2w-pager__nav { margin-left: 0; }
/* Full (staff): below 768 px the arrows carry Previous / Next for screen readers only (design.md §8). */
@media (max-width: 767.98px) {
    .l2w-pager:not(.l2w-pager--compact) .l2w-pager__word { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
/* A region grid.js repaints (.js-grid-region, [data-grid-auto] or the pager's target): dimmed and height-locked while it loads
   (--l2w-grid-lock, set by grid.js), parked under the sticky bar when scrolled to (--l2w-grid-sticky), and focusable after a
   page change, with no ring for mouse users. */
.js-grid-region.is-loading, .l2w-grid-region.is-loading { opacity: .55; pointer-events: none; min-height: var(--l2w-grid-lock, auto); }
/* CT-11: html scroll-padding-top already keeps a scrolled-to region below the sticky header (l2w-chrome.css); no second offset here */
.l2w-grid-region { scroll-margin-top: 0; }
.l2w-grid-region:focus { outline: none; }
.l2w-grid-region:focus-visible { outline: var(--l2w-focus-outline); outline-offset: 2px; }

/* ---------- Tap targets (UAT retest R-16, design.md §12): every small control, stand-alone link and tick box on a reading or
   working page has a hit area of at least --l2w-target-min (44 px). Tool density (staff) is untouched: its token is 24 px and
   these rules are scoped to the two roomy densities. Links inside a sentence keep their line (WCAG 2.5.8's inline exception). */
:where([data-density="reading"], [data-density="working"]) .l2w-btn--sm { min-height: var(--l2w-target-min); }
:where([data-density="reading"], [data-density="working"]) .l2w-btn--icon { min-width: var(--l2w-target-min); min-height: var(--l2w-target-min); }
:where([data-density="reading"], [data-density="working"]) .btn-sm { display: inline-flex; align-items: center; justify-content: center; min-height: var(--l2w-target-min); }
:where([data-density="reading"], [data-density="working"]) :is(.l2w-menu a, .l2w-menu button, .dropdown-item) { display: flex; align-items: center; min-height: var(--l2w-target-min); }
:where([data-density="reading"], [data-density="working"]) .l2w-check { min-height: var(--l2w-target-min); padding-block: 10px; cursor: pointer; }
:where([data-density="reading"], [data-density="working"]) .l2w-check input { width: 22px; height: 22px; }
:where([data-density="reading"], [data-density="working"]) .form-check:not(.form-switch):not(.form-check-inline) { display: flex; align-items: center; gap: var(--l2w-space-2); min-height: var(--l2w-target-min); padding-left: 0; }
:where([data-density="reading"], [data-density="working"]) .form-check:not(.form-switch):not(.form-check-inline) .form-check-input { float: none; flex: none; width: 22px; height: 22px; margin: 0; }
:where([data-density="reading"], [data-density="working"]) .form-check:not(.form-switch):not(.form-check-inline) .form-check-label { padding-block: 10px; cursor: pointer; }
:where([data-density="reading"], [data-density="working"]) .form-check-inline { display: inline-flex; align-items: center; min-height: var(--l2w-target-min); }
:where([data-density="reading"], [data-density="working"]) .form-check-inline .form-check-input { flex: none; margin-top: 0; margin-right: .5em; }
:where([data-density="reading"], [data-density="working"]) .breadcrumb-item a { display: inline-flex; align-items: center; min-height: var(--l2w-target-min); }
:where([data-density="reading"], [data-density="working"]) :is(.l2w-pager__num, .l2w-pager__step, .l2w-pager__select) { min-width: var(--l2w-target-min); min-height: var(--l2w-target-min); }
/* a tick box alone in a table cell (the class grid): the label around it is the target */
.l2w-hit { display: inline-flex; align-items: center; justify-content: center; min-width: var(--l2w-target-min); min-height: var(--l2w-target-min); cursor: pointer; }

/* ---------- File slots (UX 27 Oct, must-have 2; Shared/_FileSlots) ----------
   Four fixed places — Assignment · Genre guidance · Example answer · Feedback — each a 40 px circle in a 44 px target. An empty slot
   is a blank space (no dashed icon). A tooltip (data-tip) shows on hover and keyboard focus; the link carries the full name. */
.l2w-fileslots { display: inline-flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.l2w-fileslots > li { display: block; width: 44px; height: 44px; }
.l2w-fileslot { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; text-decoration: none; }
.l2w-fileslot__dot { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--l2w-on-action); }
.l2w-fileslot--assignment .l2w-fileslot__dot { background: var(--l2w-slot-assignment); }
.l2w-fileslot--guidance .l2w-fileslot__dot { background: var(--l2w-slot-guidance); }
.l2w-fileslot--example .l2w-fileslot__dot { background: var(--l2w-slot-example); color: var(--l2w-slot-example-glyph); }
.l2w-fileslot--feedback .l2w-fileslot__dot { background: var(--l2w-slot-feedback); }
.l2w-fileslot:hover .l2w-fileslot__dot { filter: brightness(1.08); box-shadow: 0 0 0 3px var(--l2w-paper-deep); }
.l2w-fileslot:focus-visible { outline: var(--l2w-focus-outline); outline-offset: 0; }
/* the one "new" mark on the Feedback slot (must-have 4) */
.l2w-fileslot.is-new::before { content: ""; position: absolute; top: 2px; right: 2px; z-index: 1; width: 11px; height: 11px; border-radius: 50%;
    background: var(--l2w-action); border: 2px solid var(--l2w-surface); }
.l2w-fileslot[data-tip]::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 6px); z-index: var(--l2w-z-menu);
    transform: translateX(-50%); padding: 4px 8px; border-radius: var(--l2w-radius-control); background: var(--l2w-ink); color: var(--l2w-text-on-ink);
    font: var(--l2w-weight-semibold) var(--l2w-text-13)/1.3 var(--l2w-font-sans); white-space: nowrap; pointer-events: none; opacity: 0;
    transition: opacity var(--l2w-duration-fast); }
.l2w-fileslot[data-tip]:hover::after, .l2w-fileslot[data-tip]:focus-visible::after { opacity: 1; }
/* with script the shared tooltip (js/l2w-tooltip.js) takes over: top layer, flips, long-press; this CSS bubble is the no-JS fallback */
html[data-l2w-tips] .l2w-fileslot[data-tip]::after { content: none; }
/* QA 14 Nov 2026: the feedback page's F spelt out ("View Feedback PDF") — the letter on its colour, then the words, at every width */
.l2w-fileslots > li.l2w-fileslots__wide { width: auto; }
.l2w-fileslot.l2w-fileslot--spelt { display: inline-flex; gap: var(--l2w-space-2); width: auto; height: 44px; padding: 0 var(--l2w-space-3) 0 3px;
    border: 1px solid var(--l2w-border); border-radius: var(--l2w-radius-pill); background: var(--l2w-surface); color: var(--l2w-ink); }
.l2w-fileslot--spelt .l2w-fileslot__dot { width: 36px; height: 36px; }
.l2w-fileslot__spelt { font-size: var(--l2w-text-14); font-weight: var(--l2w-weight-semibold); white-space: nowrap; }
.l2w-fileslot--spelt:hover { border-color: var(--l2w-action); }
.l2w-fileslot--spelt:hover .l2w-fileslot__dot { box-shadow: none; }
@media (max-width: 767.98px) { .l2w-fileslots__gap { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .l2w-fileslot[data-tip]::after { transition: none; } }

/* ---------- Tooltip (staging review 29 Oct: XS1, S2/PA-14, TC6, EN4; js/l2w-tooltip.js; design.md §10) ----------
   ONE bubble for [data-tip] (and [data-l2w-tip] titles): ink, 13 px, at most 18rem wide, in the top layer (a popover) so nothing
   clips it; above the control, or below when there is no room; floating elevation; fades in (none under reduced motion). */
.l2w-tip { position: fixed; inset: auto; top: 0; left: 0; z-index: var(--l2w-z-tip); margin: 0; max-width: min(18rem, calc(100vw - 16px)); padding: 6px 10px;
    border: 0; border-radius: var(--l2w-radius-control); background: var(--l2w-ink); color: var(--l2w-text-on-ink); box-shadow: var(--l2w-shadow-float);
    font: var(--l2w-weight-semibold) var(--l2w-text-13)/1.35 var(--l2w-font-sans); text-align: left; overflow: visible; pointer-events: none;
    visibility: hidden; opacity: 0; transition: opacity var(--l2w-duration-fast) var(--l2w-ease-out); }
.l2w-tip.is-open { visibility: visible; opacity: 1; }
.l2w-tip[popover]:not(:popover-open) { display: none; }
.l2w-tip__arrow { position: absolute; left: var(--l2w-tip-x, 50%); width: 10px; height: 10px; margin-left: -5px; background: inherit; transform: rotate(45deg); }
.l2w-tip[data-side="above"] .l2w-tip__arrow { bottom: -4px; }
.l2w-tip[data-side="below"] .l2w-tip__arrow { top: -4px; }
.l2w-tip__text { position: relative; display: block; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) { .l2w-tip { transition: none; } }
/* a long-press shows the tip, so the phone's own callout must not cover it */
@media (pointer: coarse) { [data-tip] { -webkit-touch-callout: none; } }

/* ---------- In-app guides and icon legends (staging review 29 Oct: Pages/Help — School guide, Evaluator guide, icons) ----------
   The manual's chapter with a contents list beside it from 1024 px; headings land below the sticky header (scroll-padding). */
.l2w-guide__head { margin-bottom: var(--l2w-space-6); }
.l2w-guide__title { margin: 0; font-size: var(--l2w-text-30); line-height: 1.2; }
[data-density="working"] .l2w-guide__title { font-size: var(--l2w-text-24); }
[data-density="tool"] .l2w-guide__title { font-size: var(--l2w-text-20); }
.l2w-guide__meta { margin: var(--l2w-space-2) 0 0; color: var(--l2w-text-muted); font-size: var(--l2w-text-14); }
.l2w-guide__meta a, .l2w-guide__toc a, .l2w-guide__body a { color: var(--l2w-action-strong); }
.l2w-guide__grid { display: grid; gap: var(--l2w-space-6); }
@media (min-width: 1024px) {
    .l2w-guide__grid { grid-template-columns: 16rem minmax(0, 1fr); align-items: start; }
    .l2w-guide__toc { position: sticky; top: calc(var(--l2w-sticky-h, 64px) + var(--l2w-space-2)); max-height: calc(100vh - var(--l2w-sticky-h, 64px) - 24px); overflow-y: auto; }
}
.l2w-guide__toc summary { display: flex; align-items: center; min-height: var(--l2w-target-min); font-weight: var(--l2w-weight-semibold); cursor: pointer; }
.l2w-guide__toc ol { margin: 0; padding-left: 1.25rem; font-size: var(--l2w-text-14); }
.l2w-guide__toc li { margin: 2px 0; }
.l2w-guide__body h2 { margin: var(--l2w-space-8) 0 var(--l2w-space-3); font-size: var(--l2w-text-20); font-weight: var(--l2w-weight-semibold); line-height: 1.3; }
.l2w-guide__body h3 { margin: var(--l2w-space-6) 0 var(--l2w-space-2); font-size: var(--l2w-text-17); font-weight: var(--l2w-weight-semibold); }
.l2w-guide__body h4 { margin: var(--l2w-space-4) 0 var(--l2w-space-2); font-size: var(--l2w-text-16); font-weight: var(--l2w-weight-semibold); }
.l2w-guide__body blockquote { margin: var(--l2w-space-3) 0; padding: var(--l2w-space-2) var(--l2w-space-4); border-left: 3px solid var(--l2w-border-strong); color: var(--l2w-ink-soft); }
.l2w-guide__body .lf-guide__table { overflow-x: auto; margin-bottom: var(--l2w-space-4); }
.l2w-guide__body .lf-guide__table table { margin: 0; font-size: var(--l2w-text-14); }
.l2w-legend__title { margin: 0 0 var(--l2w-space-2); font-size: var(--l2w-text-17); font-weight: var(--l2w-weight-semibold); }
.l2w-legend__list { margin: 0; }
.l2w-legend__row { display: grid; grid-template-columns: minmax(10rem, 15rem) minmax(0, 1fr); gap: var(--l2w-space-2) var(--l2w-space-4); align-items: center;
    padding: var(--l2w-space-2) 0; border-top: var(--l2w-elev-border); }
.l2w-legend__row:first-child { border-top: 0; }
.l2w-legend__row dt { display: flex; flex-wrap: wrap; align-items: center; gap: var(--l2w-space-2); font-weight: var(--l2w-weight-semibold); }
.l2w-legend__row dd { margin: 0; }
.l2w-legend__icon { display: inline-grid; place-items: center; width: 36px; height: 36px; border: var(--l2w-elev-border); border-radius: var(--l2w-radius-control); background: var(--l2w-surface); }
@media (max-width: 575.98px) { .l2w-legend__row { grid-template-columns: 1fr; } }

/* ---------- Retest 31 Oct: FS1 / PA-13 file-slot letters, their legend line, and FS2 labelled chips (Shared/_FileSlots,
   Shared/_FileSlotsLegend). The legacy colours and the blank empty slots stay; each tile carries its letter (A/Q, G, E, F). */
.l2w-fileslot__letter { font: var(--l2w-weight-bold) var(--l2w-text-16)/1 var(--l2w-font-sans); letter-spacing: 0; }
.l2w-fileslot__name { display: none; } .l2w-fileslot__pname { display: none; }   /* Nov 14 mobile pass: shown only in a parent's paper rows on a phone (l2w-family.css) */
.l2w-fslegend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--l2w-space-2) var(--l2w-space-4); margin: 0;
    padding: var(--l2w-space-2) var(--l2w-space-4); border-top: 1px solid var(--l2w-border); font-size: var(--l2w-text-13); color: var(--l2w-text); }
.l2w-fslegend__item { display: inline-flex; align-items: center; gap: 6px; }
.l2w-fslegend__key .l2w-fileslot__dot { width: 22px; height: 22px; font: var(--l2w-weight-bold) var(--l2w-text-12)/1 var(--l2w-font-sans); }
.l2w-fslegend__gap { color: var(--l2w-text-muted); }
@media (max-width: 767.98px) { .l2w-fslegend__gap { display: none; } }   /* phones collapse the gaps (above) */
/* FS2: from 1024 px a slot with Chips is a labelled chip — the letter on its colour, then the short name (no tooltip needed) */
@media (min-width: 1024px) {
    .l2w-fileslots--chips { flex-wrap: wrap; gap: var(--l2w-space-2); }
    .l2w-fileslots--chips > li { width: auto; height: auto; }
    .l2w-fileslots--chips > .l2w-fileslots__gap { display: none; }
    .l2w-fileslots--chips .l2w-fileslot { display: inline-flex; gap: var(--l2w-space-2); width: auto; height: 44px; padding: 0 var(--l2w-space-3) 0 3px;
        border: 1px solid var(--l2w-border); border-radius: var(--l2w-radius-pill); background: var(--l2w-surface); color: var(--l2w-ink); }
    .l2w-fileslots--chips .l2w-fileslot__dot { width: 36px; height: 36px; }
    .l2w-fileslots--chips .l2w-fileslot__name { display: inline; font-size: var(--l2w-text-14); font-weight: var(--l2w-weight-semibold); white-space: nowrap; }
    .l2w-fileslots--chips .l2w-fileslot:hover { border-color: var(--l2w-action); }
    .l2w-fileslots--chips .l2w-fileslot:hover .l2w-fileslot__dot { box-shadow: none; }
    .l2w-fileslots--chips .l2w-fileslot[data-tip]::after { content: none; }
}

/* ---------- Retest 31 Oct (BH-02): an in-place swap (js/l2w-swap.js) hides what follows the pressed tab behind a skeleton until the
   new view is in (the old content is never read as the new one); its space is kept so nothing moves. */
.l2w-swap-wait { visibility: hidden; }
.l2w-swap-skel { display: grid; gap: var(--l2w-space-3); padding: var(--l2w-space-4) 0; }
.l2w-swap-skel > span { display: block; height: 14px; border-radius: var(--l2w-radius-control); background: var(--l2w-surface-sunken); }
.l2w-swap-skel > span:first-child { width: 40%; height: 22px; }
.l2w-swap-skel > span:nth-child(2) { width: 92%; }
.l2w-swap-skel > span:nth-child(3) { width: 78%; }
@media (prefers-reduced-motion: no-preference) {
    .l2w-swap-skel > span { animation: l2w-swap-pulse 1.2s ease-in-out infinite alternate; }
    @keyframes l2w-swap-pulse { from { opacity: 1; } to { opacity: .55; } }
}

/* Today, the admin triage page (Overview A, 11 Nov 2026). Three lanes: needs someone now · keep an eye on · all clear. A lane is
   a card with a coloured top rule and its word (never colour alone); a row is ONE link: figure, what it counts, where it goes.
   Laptop: three columns, the first wider. Tablet: "now" across the top, the other two side by side. Phone: one column. */
.l2w-triage { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); gap: var(--l2w-space-3); align-items: start; margin-top: var(--l2w-space-3); }
@media (max-width: 1199.98px) { .l2w-triage { grid-template-columns: repeat(2, minmax(0, 1fr)); } .l2w-lane--now { grid-column: 1 / -1; } }
@media (max-width: 767.98px) { .l2w-triage { grid-template-columns: minmax(0, 1fr); } }
/* "Issues NOW 8" (owner 20 Nov 2026: "Why so dull? The triage and the floor pages: the items are sort of behind an opaqueness"): the
   lane is the quiet surface and its rows are crisp white cards with the lane's colour on their edge — before, grey rows sat on white. */
.l2w-lane { display: flex; flex-direction: column; gap: var(--l2w-space-2); min-width: 0; padding: var(--l2w-space-3); background: var(--l2w-paper-cool);
    border: 1px solid var(--l2w-border); border-top: 3px solid var(--l2w-lane, var(--l2w-border-strong)); border-radius: var(--l2w-radius-card); }
.l2w-lane--now { --l2w-lane: var(--l2w-danger); }
.l2w-lane--watch { --l2w-lane: var(--l2w-warning); }
.l2w-lane--clear { --l2w-lane: var(--l2w-success); }
.l2w-lane__title { display: flex; align-items: center; gap: var(--l2w-space-2); margin: 0; font: var(--l2w-weight-semibold) var(--l2w-text-15)/1.3 var(--l2w-font-sans); color: var(--l2w-ink); }
.l2w-lane__title .l2w-icon { color: var(--l2w-lane); }
.l2w-lane__count { margin-left: auto; min-width: 24px; padding: 0 8px; border-radius: var(--l2w-radius-pill); background: var(--l2w-surface-sunken); color: var(--l2w-text-muted);
    font-size: var(--l2w-text-13); line-height: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.l2w-lane__rows, .l2w-lane__clear { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--l2w-space-2); }
.l2w-lane__empty { display: flex; align-items: center; gap: var(--l2w-space-2); margin: 0; color: var(--l2w-text-muted); font-size: var(--l2w-text-14); }
.l2w-lane__empty .l2w-icon { color: var(--l2w-success); }
.l2w-lane__note { margin: 0; font-size: var(--l2w-text-13); color: var(--l2w-text-muted); }
.l2w-triage__row { display: grid; grid-template-columns: minmax(3ch, auto) minmax(0, 1fr) auto; align-items: center; gap: var(--l2w-space-3); min-height: 56px;
    padding: var(--l2w-space-2) var(--l2w-space-3); border: 1px solid var(--l2w-border); border-left: 4px solid var(--l2w-lane, var(--l2w-border-strong));
    border-radius: var(--l2w-radius-control); background: var(--l2w-surface); box-shadow: var(--l2w-shadow-raised);
    color: var(--l2w-ink); text-decoration: none; }
.l2w-triage__row:hover { border-color: var(--l2w-border-strong); border-left-color: var(--l2w-lane, var(--l2w-border-strong)); background: var(--l2w-surface);
    color: var(--l2w-ink); box-shadow: var(--l2w-shadow-float); }
.l2w-triage__row:focus-visible { outline: var(--l2w-focus-outline); outline-offset: 2px; }
.l2w-triage__value { font: var(--l2w-weight-bold) var(--l2w-text-24)/1 var(--l2w-font-sans); font-variant-numeric: tabular-nums; text-align: right; }
.l2w-lane--now .l2w-triage__value { color: var(--l2w-danger); }
.l2w-lane--watch .l2w-triage__value { color: var(--l2w-warning); }
.l2w-triage__text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.l2w-triage__label { font: var(--l2w-weight-semibold) var(--l2w-text-15)/1.3 var(--l2w-font-sans); color: var(--l2w-ink); }
.l2w-triage__detail { font-size: var(--l2w-text-13); line-height: 1.35; color: var(--l2w-text-muted); }
.l2w-triage__go { display: inline-flex; align-items: center; gap: 4px; font: var(--l2w-weight-semibold) var(--l2w-text-13)/1 var(--l2w-font-sans); color: var(--l2w-action-strong); white-space: nowrap; }
.l2w-triage__row:hover .l2w-triage__go { text-decoration: underline; text-underline-offset: 2px; }
.l2w-lane__clear a { display: flex; align-items: flex-start; gap: var(--l2w-space-2); min-height: 28px; padding: 3px 0; color: var(--l2w-ink); font-size: var(--l2w-text-14); text-decoration: none; }
.l2w-lane__clear a:hover { color: var(--l2w-action-strong); text-decoration: underline; text-underline-offset: 2px; }
.l2w-lane__clear .l2w-icon { flex: none; margin-top: 3px; color: var(--l2w-success); }
/* A strip of facts under the lanes: label over figure, one quiet row that wraps. */
.l2w-strip { margin-top: var(--l2w-space-6); padding-top: var(--l2w-space-3); border-top: 1px solid var(--l2w-border); }
.l2w-strip__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--l2w-space-2) var(--l2w-space-3); margin-bottom: var(--l2w-space-3); }
.l2w-strip__head .l2w-section-title { margin: 0; }
.l2w-strip__asof { font-size: var(--l2w-text-13); color: var(--l2w-text-muted); }
.l2w-strip__items { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: var(--l2w-space-3) var(--l2w-space-4); margin: 0; }
.l2w-strip__item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.l2w-strip__item dt { font: var(--l2w-weight-medium) var(--l2w-text-13)/1.3 var(--l2w-font-sans); color: var(--l2w-text-muted); }
.l2w-strip__item dt a { color: inherit; text-decoration: underline; text-decoration-color: var(--l2w-border-strong); text-underline-offset: 3px; }
.l2w-strip__item dt a:hover { color: var(--l2w-action-strong); }
.l2w-strip__item dd { display: flex; flex-direction: column; gap: 1px; margin: 0; }
.l2w-strip__value { font: var(--l2w-weight-bold) var(--l2w-text-20)/1.25 var(--l2w-font-sans); font-variant-numeric: tabular-nums; color: var(--l2w-ink); }
.l2w-strip__meta { font-size: var(--l2w-text-12); line-height: 1.35; color: var(--l2w-text-muted); }
@media (max-width: 479.98px) { .l2w-strip__items { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* A folded section (details): its summary reads as a section title with a chevron that turns when open. */
.l2w-fold__summary { display: flex; align-items: center; gap: var(--l2w-space-2); min-height: 40px; cursor: pointer; list-style: none;
    font: var(--l2w-weight-semibold) var(--l2w-text-15)/1.3 var(--l2w-font-sans); color: var(--l2w-ink); }
.l2w-fold__summary::-webkit-details-marker { display: none; }
.l2w-fold__summary:focus-visible { outline: var(--l2w-focus-outline); outline-offset: 2px; border-radius: 2px; }
.l2w-fold__chevron { transition: transform var(--l2w-duration) var(--l2w-ease-out); color: var(--l2w-text-muted); }
.l2w-fold[open] > .l2w-fold__summary .l2w-fold__chevron { transform: rotate(90deg); }

/* ---- Client requests ("Ask Learn2Write") and a client's Activity tab (12 Nov 2026) ---- */
.l2w-requests { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--l2w-space-3); }
.l2w-request { display: grid; gap: var(--l2w-space-2); border-left: 3px solid var(--l2w-border); }
.l2w-request--waiting { border-left-color: var(--l2w-danger); }
.l2w-request__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--l2w-space-2); }
.l2w-request__subject { margin: 0; font: var(--l2w-weight-semibold) var(--l2w-text-16)/1.3 var(--l2w-font-sans); color: var(--l2w-ink); }
.l2w-request__body { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.l2w-request__reply { padding: var(--l2w-space-3); background: var(--l2w-surface-sunken); border-radius: var(--l2w-radius-card); }
.l2w-request__acts { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--l2w-space-3); }
.l2w-request__answer { flex: 1 1 22rem; min-width: 0; }
.l2w-request__answer > summary { cursor: pointer; color: var(--l2w-action); font-weight: var(--l2w-weight-medium); }
.l2w-activity__week { display: flex; flex-wrap: wrap; align-items: center; gap: var(--l2w-space-2); margin: 0 0 var(--l2w-space-4); padding: var(--l2w-space-3) var(--l2w-space-4);
    background: var(--l2w-surface); border: 1px solid var(--l2w-border); border-radius: var(--l2w-radius-card); color: var(--l2w-ink); font-weight: var(--l2w-weight-medium); }
.l2w-activity__week .l2w-icon { color: var(--l2w-text-muted); }
.l2w-activity__chips { display: flex; flex-wrap: wrap; gap: var(--l2w-space-2); margin: 0 0 var(--l2w-space-3); }
.l2w-activity__chips > a { text-decoration: none; }
.l2w-activity { list-style: none; margin: 0 0 var(--l2w-space-3); padding: 0; background: var(--l2w-surface); border: 1px solid var(--l2w-border); border-radius: var(--l2w-radius-card); }
.l2w-activity__item { display: grid; grid-template-columns: 11rem minmax(0, 1fr) auto; gap: var(--l2w-space-1) var(--l2w-space-4); align-items: baseline;
    padding: var(--l2w-space-2) var(--l2w-space-4); border-top: 1px solid var(--l2w-border); }
.l2w-activity__item:first-child { border-top: 0; }
.l2w-activity__when { color: var(--l2w-text-muted); font-size: var(--l2w-text-14); font-variant-numeric: tabular-nums; }
.l2w-activity__what { overflow-wrap: anywhere; }
@media (max-width: 767.98px) {
    .l2w-activity__item { grid-template-columns: minmax(0, 1fr); }
    .l2w-activity__kind { justify-self: start; }
}

/* ---------- NOW 10 (D-1/D-2): the shared side panel .l2w-panel — a right slide-in beside the content (420 px), a full-height bottom
   sheet under 1024 px. It scrolls on its own; the page behind stays usable. Script (class-cells.js) opens it, moves focus into it and
   closes it on Close, Esc and a click outside. The teacher list's .tl-panel is the same pattern. ---------- */
.l2w-panel { position: fixed; z-index: calc(var(--l2w-z-actionbar) + 5); top: 0; right: 0; bottom: 0; width: min(420px, 100vw); overflow-y: auto; overscroll-behavior: contain;
    background: var(--l2w-surface); border-left: 1px solid var(--l2w-border); box-shadow: -12px 0 32px color-mix(in srgb, var(--l2w-ink) 18%, transparent);
    animation: l2w-panel-in var(--l2w-duration, .18s) var(--l2w-ease-out, ease-out); }
.l2w-panel[hidden] { display: none; }
.l2w-panel:focus { outline: none; }
.l2w-panel:focus-visible { outline: var(--l2w-focus-outline); outline-offset: -3px; }
.l2w-panel__body { display: grid; gap: var(--l2w-space-3); padding: var(--l2w-space-4) var(--l2w-space-5, 20px) var(--l2w-space-6); }
@keyframes l2w-panel-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 1023.98px) {
    .l2w-panel { top: auto; left: 0; width: auto; max-height: 85vh; border-left: 0; border-top: 1px solid var(--l2w-border);
        border-radius: var(--l2w-radius-card) var(--l2w-radius-card) 0 0; box-shadow: 0 -12px 32px color-mix(in srgb, var(--l2w-ink) 18%, transparent); }
    .l2w-panel::before { content: ""; display: block; width: 40px; height: 4px; margin: var(--l2w-space-2) auto 0; border-radius: var(--l2w-radius-control); background: var(--l2w-border-strong); }
}
@media (prefers-reduced-motion: reduce) { .l2w-panel { animation: none; } }
