/* Everything in this file is application chrome, and it all lives in the
   `eduai.app` layer — after tokens, material and components, before overrides.
   That ordering is declared once in `theme/system/tokens.css`, which is what
   retires the specificity tricks this file used to need to win a cascade it was
   already supposed to win. The tenant stylesheet stays UNLAYERED and therefore
   still outranks all of it, which is the correct precedence for a white label. */

@layer eduai.app {
/* =============================================================================
   Application chrome.

   Rule 1 of `theme-system/src/tokens.css`, which this file obeys without exception:
   a component may only READ tokens. It never writes a literal colour, radius, blur,
   shadow or duration. Everything below is composed from `--space-*`, `--radius-*`,
   `--text-*`, the semantic colour roles and `.mat` (the material surface).

   Layout and structure only. The look lives in the theme.
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body,
#root {
  height: 100%;
}

/* THE BROWSER'S OWN JUMPS, MADE INTO TRAVEL. This is what turns the skip link and every
   in-page anchor from a cut into a scroll; nothing in JavaScript can reach those, because
   the browser performs them itself.

   ⚠ IT ALSO REACHES FOCUS. Tabbing to something off screen scrolls it into view, and
     that scroll is now animated too. It is short, it is the same movement either way, and
     the alternative - smooth anchors without it - does not exist in CSS.

   ⚠ IT DOES NOT REACH `scrollTo`/`scrollIntoView` CALLS THAT NAME A BEHAVIOUR. An
     explicit `behavior` wins over this declaration, which is what lets `lib/scroll.ts`
     jump instantly across a long distance while anchors still glide. */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  /* No exception, and no slower variant: the reader asked for less movement across their
     visual field, and a long slow scroll is more of it rather than less. */
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--seed-font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  font-weight: var(--weight-body);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--seed-font-display);
  font-weight: var(--weight-strong);
  line-height: var(--leading-tight);
  margin: 0;
}

/* A card title written `h3.label` takes the body's leading, as the prototype's
   panel heading does. It has to be restated here rather than in `components.css`:
   the rule above sits in this later layer and would otherwise set it back to the
   display leading, 8px shorter. */
h1.label,
h2.label,
h3.label,
h4.label {
  line-height: var(--leading-body);
}

/* ⚠ `:not(.btn)`, AND THE LAYER IS WHY. `eduai.app` is declared AFTER
   `eduai.components` in `tokens.css`, and layer order is settled BEFORE specificity is
   looked at — so a bare `a { color }` here beats `.btn`'s own `--btn-fg` no matter how
   many classes that rule carries. Every anchor styled as a button was therefore painted
   `--brand`, which on `.btn--primary` is brand text on a brand fill: I read the two
   computed values in the running app and they are the same colour, so 1:1. That is four
   register buttons on the public landing page and the learner's "take this exam", each
   of them a rectangle with nothing legible in it.

   `:where()`, NOT A BARE `:not()`, and that part is not cosmetic either. `:not(.btn)`
   would raise this selector from 0,0,1 to 0,1,1 and it would start beating `.tile--link`
   (0,1,0), which sets `color: inherit` so a dashboard tile's number is text rather than a
   link colour — a rule written to work around this one anchor at a time, back when the
   bare `a` lost to it. `:where()` contributes nothing, so the specificity is exactly what
   it was and only `.btn` changes hands. Measured both ways in the running app. */
a {
  /* ⚠ THE ONE HALF THAT STAYS UNNARROWED. Without it the UA's own
     `a[href] { text-decoration: underline }` comes back, and a button-shaped anchor grows
     a line under its label — which is the second thing this pair of rules was doing for
     `.btn` all along, and the only one it was doing correctly. Measured after narrowing
     both halves at once and watching the underline reappear. */
  text-decoration: none;
}

a:where(:not(.btn, .nav-item)) {
  color: var(--brand);
}

/* Same exclusion, same reason: a line under a control's label reads as a mistake, which
   is what `.tile--link`'s comment says about the number on a dashboard tile. */
a:where(:not(.btn, .nav-item)):hover {
  text-decoration: underline;
}

/* --- boot ------------------------------------------------------------------
   Shown while `POST /auth/refresh` is in flight. Nothing authenticated may render
   until it answers, so this is the first thing a returning user sees.
   -------------------------------------------------------------------------- */

.boot {
  display: grid;
  place-items: center;
  min-height: 100dvh;
}

.boot__spinner {
  width: var(--space-6);
  height: var(--space-6);
  border: var(--focus-ring-width) solid var(--border);
  border-top-color: var(--brand);
  border-radius: var(--r-pill);
  /* `--dur-indicator`, NOT `--dur-slow`.
     Every `--dur-*` token is a multiple of `--motion-scale`, and reduced motion
     sets that to 0 — so `calc(0ms * 4)` is 0ms and the block below, which meant
     to slow the spinner down, stopped it dead. The one indicator that the app is
     doing anything was deleted for exactly the readers least able to guess.
     Reduced motion means REPLACE the animation, not remove the feedback. */
  animation: boot-spin var(--dur-indicator) linear infinite;
}

@keyframes boot-spin {
  to {
    transform: rotate(1turn);
  }
}

@media (prefers-reduced-motion: reduce) {
  /* Rotation swapped for an opacity pulse rather than slowed. A slow rotation is
     still rotation; a pulse carries the same "still working" message with no
     movement across the visual field at all.

     Both periods are multiples of `--dur-indicator`, which is the one duration token
     allowed inside this query: every other `--dur-*` is scaled by `--motion-scale`, and
     this is the query that sets it to 0 — so any of them would resolve to 0s and freeze
     the pulse that just replaced the spin. `--ease-in-out` rather than the bare keyword,
     which is a different curve. */
  .boot__spinner {
    animation-name: boot-pulse;
    animation-duration: calc(var(--dur-indicator) * 1.5);
    animation-timing-function: var(--ease-in-out);
  }
  .impersonation__dot {
    animation-name: boot-pulse;
    animation-duration: calc(var(--dur-indicator) * 2);
  }
}

@keyframes boot-pulse {
  50% {
    opacity: 0.35;
  }
}

/* --- the impersonation banner ----------------------------------------------
   Contract §3: the backend provides no banner, no flag and no visual affordance,
   and building an unmissable one is "not optional". It is therefore sticky, full
   width, and painted in the danger role — an operator must never lose track of
   the fact that every action is being audited as somebody else.
   -------------------------------------------------------------------------- */

.impersonation {
  position: sticky;
  top: 0;
  z-index: var(--z-banner);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: var(--danger);
  color: var(--text-on-brand);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.impersonation__dot {
  width: var(--space-2);
  height: var(--space-2);
  border-radius: var(--r-pill);
  background: var(--text-on-brand);
  /* Same reasoning as the boot spinner: this is an audit-safety affordance the
     file itself calls unmissable, so its duration must not run through
     `--motion-scale` and be zeroed to a standstill. */
  animation: impersonation-pulse var(--dur-indicator) var(--ease-out) infinite alternate;
}

@keyframes impersonation-pulse {
  from {
    opacity: 0.35;
  }
  to {
    opacity: 1;
  }
}

.impersonation__text {
  flex: 1 1 auto;
}

.impersonation__timer {
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}

/* --- the public / auth surface ---------------------------------------------
   §4 of the architecture doc: sign-in, registration, join-by-code, the password
   flows, legal, certificate verification, public portfolio and guest entry are
   NOT a fourth app. They are unauthenticated routes both origins serve.
   -------------------------------------------------------------------------- */

.auth-page {
  display: grid;
  /* `minmax(0, 1fr)`, not the implicit `auto` column: that column took the min-content of the
     widest thing inside - a legal table on the consent step made it 428 px at 320 and the
     site's clip cut the whole column off; a 63-character e-mail on the sign-in card pushed it
     5 px past the edge (candidate audit B14, B15). */
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  min-height: 100dvh;
  padding: var(--space-4);
}

.auth-card {
  width: 100%;
  max-width: 26rem;
  padding: var(--space-6);
  border-radius: var(--r-xl);
}

/* Registration only: two groups of fields side by side, so the whole form is visible
   without scrolling on a laptop. Stacks back to one column below the tablet breakpoint. */
.auth-card--wide {
  max-width: 52rem;
}

.register-form {
  gap: var(--space-3);
}

.register-form__columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-6);
  align-items: start;
}

/* A tutor with no kind to pick: the owner's group alone, on the narrow card. */
.register-form__columns--single {
  grid-template-columns: minmax(0, 1fr);
}

.register-form__group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-inline-size: 0;
}

.register-form__heading {
  margin: 0;
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-md);
  font-weight: var(--weight-strong);
  color: var(--text);
}

/* Two short fields on one row: given and family name, patronymic and gender. */
.register-form__pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.register-form__pair > .form-field {
  min-inline-size: 0;
}

@media (max-width: 48rem) {
  .register-form__columns {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
  }
}

@media (max-width: 30rem) {
  .register-form__pair {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* The way back to the home page, above the title on the sign-in and registration cards.
   Quiet on purpose: the form is the thing the card is for, and this is the way out. */
.auth-card__home {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  /* 19px tall, its text's height, like the footer's links (row 45): the floor makes it a
     24px target. */
  min-block-size: var(--target-min);
  margin-bottom: var(--space-3);
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}

.auth-card__home:hover {
  color: var(--text);
  text-decoration: underline;
}

.auth-card__home:active {
  color: var(--text);
}

@media (prefers-reduced-motion: reduce) {
  .auth-card__home {
    transition: none;
  }
}

.auth-card__title {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-2);
}

.auth-card__lede {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin: 0 0 var(--space-5);
}

.auth-card__footer {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: var(--text-sm);
}

/* "Geri" and "Şifrəni unutmusunuz?" were plain inline links, 23x19 (row 45). Inline-flex
   with a floor gives them a 24px hit area; the footer centres its items, so nothing moves. */
.auth-card__footer > a {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--target-min);
}

/* --- forms ---------------------------------------------------------------- */

.form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

/* Two fields a reader fills together, side by side, so a short form fits its dialog
   without scrolling. `minmax(0, 1fr)` rather than `1fr`: an input keeps an intrinsic
   width of about twenty characters and would otherwise widen its own track. A phone
   gets one column back. */
/* The learner's join box: the code field takes the width, the button keeps its own. Wraps
   under the field on a narrow card rather than squeezing the field to nothing. */
/* The group's "add a learner" picker: one row per person, the name leading and the button
   or the "already in" badge at the end. */
.add-learners__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.add-learners__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-block: var(--space-1);
  border-bottom: 1px solid var(--border-subtle);
}

.add-learners__item:last-child {
  border-bottom: none;
}

.add-learners__who {
  display: flex;
  flex-direction: column;
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

/* The file manager's usage band: the total and its categories on one line. */
.files-usage {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-3) var(--space-4);
  margin-block-end: var(--space-4);
}

.files-usage__main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-4);
  min-inline-size: 0;
}

.files-usage__figure {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
}

/* Still the lead, one step up from body rather than a display size. */
.files-usage__figure strong {
  font-size: var(--text-xl);
  font-weight: var(--weight-strong);
  font-variant-numeric: tabular-nums;
}

.files-usage__categories {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.files-usage__meter,
.files-usage__error {
  flex-basis: 100%;
}

.file-name {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-inline-size: 0;
}

.file-name__icon {
  flex: none;
  color: var(--text-secondary);
  inline-size: 1.25rem;
  block-size: 1.25rem;
}

.file-name__text {
  display: flex;
  flex-direction: column;
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

.file-actions {
  flex-wrap: nowrap;
  gap: var(--space-1);
  justify-content: flex-end;
}

.file-actions__delete {
  color: var(--danger-strong);
}

.join-group__form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.join-group__input {
  flex: 1 1 12rem;
  min-inline-size: 0;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

.join-group__input::placeholder {
  text-transform: none;
  letter-spacing: normal;
}

/* A guardian in one cell: the name, and the address that belongs to it underneath. */
.guardian-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

/* Unlinking is the destructive act on this screen, so its word carries the danger colour
   even as a quiet ghost button; the confirm dialog repeats it in the same role. */
.guardian-unlink {
  color: var(--danger-strong);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.form-row .field {
  inline-size: 100%;
  min-inline-size: 0;
}

@media (max-width: 30rem) {
  .form-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* The shared `.label` is an eyebrow - tracked and tertiary - and stays that way
   for the section headings that use it. A field label is not an eyebrow: it sits
   just above its control in plain sentence case, so it reads as the control's
   name rather than as a category marker. Scoped with the child combinator so a
   heading nested deeper inside a form keeps the eyebrow treatment. */
.form-field > .label {
  letter-spacing: var(--tracking-normal);
  font-weight: var(--weight-body);
  color: var(--text-secondary);
}

/* §14: "Map `errors{}` onto form fields by camelCase key." This is where they land. */
/* A password input with its show/hide button inside the box, at the end. The input keeps
   the room the button takes, so a long password never runs under it. */
.password-field {
  position: relative;
}

.password-field__input {
  padding-inline-end: calc(var(--control-sm) + var(--space-2));
}

/* Edge draws its own reveal button in a password input; two eyes would be one too many. */
.password-field__input::-ms-reveal {
  display: none;
}

.password-field__toggle {
  position: absolute;
  inset-block: 0;
  inset-inline-end: var(--space-1);
  margin-block: auto;
  display: inline-grid;
  place-items: center;
  inline-size: var(--control-sm);
  block-size: var(--control-sm);
  padding: 0;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}

.password-field__toggle:hover {
  background: var(--surface-2);
  color: var(--text);
}

.password-field__toggle:active {
  background: var(--surface-3);
}

.password-field__toggle:disabled {
  opacity: var(--opacity-disabled);
  cursor: not-allowed;
}

.password-field__toggle[aria-pressed="true"] {
  color: var(--brand-strong);
}

@media (prefers-reduced-motion: reduce) {
  .password-field__toggle {
    transition: none;
  }
}

.form-field__error {
  color: var(--danger);
  font-size: var(--text-sm);
}

.form-field[data-invalid='true'] .field {
  border-color: var(--danger);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  /* The whole label is the hit target, and it was only as tall as its text: 19px (tutor
     device test, row 45). The floor makes the row 24px without changing the box or the
     words; a label that wraps is taller than this already. */
  min-block-size: var(--target-min);
}

/* --- alerts ---------------------------------------------------------------
   `detail` from a problem document goes here verbatim: it is already localised
   server-side, which is why this client ships no error dictionary.
   -------------------------------------------------------------------------- */

/* A NEUTRAL CARD WITH A COLOURED BAR, not a box tinted in its own severity. The
   prototype's `.alert` is `--surface-2` with a 3px rail down the leading edge and
   the severity in the rail and the heading only, so a page carrying a warning and
   an error still reads as one page rather than as two coloured blocks. Severity
   is still never colour alone - the heading text carries it too. */
.alert {
  --alert-rail: var(--text-tertiary);
  position: relative;
  padding: var(--space-4);
  /* The rail, then the prototype's 12px gap, then the text. */
  padding-inline-start: calc(var(--space-4) + var(--rail-w) + var(--space-3));
  border-radius: var(--r-sm);
  font-size: var(--text-sm);
  background: var(--surface-2);
  color: var(--text);
  border: 0;
}

/* A pill INSIDE the padding, not a border along the edge. The prototype's rail is
   a 3px element standing 16px in from the card's edge with rounded ends, so it
   reads as a mark beside the words rather than as a coloured side of the box. */
.alert::before {
  content: "";
  position: absolute;
  inset-block: var(--space-4);
  inset-inline-start: var(--space-4);
  inline-size: var(--rail-w);
  border-radius: var(--r-pill);
  background: var(--alert-rail);
}

/* INSIDE GLASS, NO FILL (owner, 2026-10-18) - the same call as the inner planes in
   material.css. An alert inside a panel or a dialog read as a white card behind the
   text; there the material shows through, the rail carries the severity, and a hairline
   in the inset's own edge keeps the box. On the page ground the fill stays: there is
   no glass behind the words there, only the moving scene. */
[data-family="glass"] :is(.mat, .mat-inset) .alert {
  background: transparent;
  border: 1px solid rgb(var(--light-rgb) / calc(var(--glass-edge-alpha) * 0.8));
}

.alert--danger {
  --alert-rail: var(--danger);
}

.alert--warning {
  --alert-rail: var(--warning);
}

.alert--success {
  --alert-rail: var(--success);
}

.alert--info {
  --alert-rail: var(--info);
}

/* Forced colours paints every background as Canvas, which would erase the rail and
   leave the alert unbounded. A real border restores the box, and the rail opts
   out of the adjustment so it stays a visible mark. */
@media (forced-colors: active) {
  .alert {
    border: 1px solid CanvasText;
  }
  .alert::before {
    forced-color-adjust: none;
    background: CanvasText;
  }
}

.alert__trace {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* The disclosure that keeps the trace id reachable for support and out of the sentence.
   A real target (24px tall) for the summary, the code wrapping rather than widening the
   alert on a phone.

   ⚠ A LIST ITEM, BECAUSE THAT IS WHAT DRAWS THE DISCLOSURE'S OWN MARKER. This was
     `inline-flex`, for the centring, and any display but `list-item` takes a summary's marker
     away - so the closed disclosure read as "Dəstək üçün kod" with nothing after it and
     nothing to say it opens (device test 2026-10-29, row 38). The marker is back and the
     line is centred in its 24px with `align-content` instead. */
.alert__trace summary {
  cursor: pointer;
  min-block-size: var(--space-6);
  display: list-item;
  align-content: center;
}

.alert__trace code {
  display: block;
  overflow-wrap: anywhere;
  user-select: all;
}

/* --- the shell ------------------------------------------------------------
   Two columns, and the left one NEVER LEAVES THE SCREEN.

   `position: sticky` with `height: 100dvh` rather than a fixed element: sticky keeps
   the sidebar in the grid, so the main column's width is still computed from it and no
   width has to be duplicated as a margin. The document scrolls; the sidebar rides along
   pinned at the top and scrolls its own overflow when the menu is longer than the
   viewport. A forty-item menu was previously scrolling away with the page, which is what
   made the product feel like a list of links rather than a place.

   The `--shell-*` values are local geometry, not theme tokens: they describe THIS layout
   and nothing else reads them. Everything with a look — colour, radius, blur, shadow,
   duration — still comes from the contract.
   -------------------------------------------------------------------------- */

/* TWO FLOATING PANELS OVER THE GROUND, not two regions flush to the window.
   The gutter is what makes them read as objects on a surface rather than as
   partitions of one: the ground runs behind and around them, so the material has
   something to bend at every edge instead of only along the inner one. */
.shell {
  --shell-sidebar: 264px;
  --shell-topbar: 46px;
  --shell-gutter: var(--space-3);

  display: grid;
  grid-template-columns: var(--shell-sidebar) minmax(0, 1fr);
  gap: var(--shell-gutter);
  padding: var(--shell-gutter);
  min-height: 100dvh;
}

/* THE GROUND THE GLASS READS IS liqui's BACKDROP (owner, 2026-10-04: "fix the liqui
   background"). `GlassBackdrop`, mounted by `ThemeProvider` in the glass family, draws the
   aurora, the rings, the band, the rules and the vignette (material.css). The older
   three-layer sky/ridge/city ground that stood here was painted ABOVE it, at
   `--z-behind`, and its opaque sky hid liqui's completely: measured on 2026-10-03, hiding
   `.glass-backdrop` changed 0% of the pixels in dark mode and a faint 40% in light. It is
   gone, so the backdrop the prototype was approved on is the one on screen. */

/* THE ORGANISATION'S OWN PICTURE (owner, 2026-10-03: the owner may put a picture on the
   background, and everybody in the organisation sees it). `TenantGround` renders it only
   when one is set; it covers the built-in ground completely, at the same depth and after
   it in the document, so nothing about the built-in ground has to know it exists.

   THE VEIL IS THE PAGE COLOUR AT A MEASURED STRENGTH. `--tenant-ground-veil` is worked out
   from the picture and the active theme (`theme/tenantGroundStore.ts`): the smallest strength at
   which no patch of the picture is darker, in the light theme, or lighter, in the dark, than
   the built-in ground below ever gets - `--ground-veil-bound`. Page titles, notes, tables and
   their badges are drawn straight on this ground, and every one of their colours was tuned
   on the built-in one. Mixed in sRGB because that is the arithmetic the measurement assumes:
   a translucent layer over a picture is blended channel by channel in sRGB.

   It fades with reduced transparency like the built-in ground: at that point every surface
   above it is solid, and a photograph behind solid panels is only a cost. */
.tenant-ground {
  position: fixed;
  inset: 0;
  z-index: var(--z-behind);
  pointer-events: none;
  background: var(--tenant-ground-image) center / cover no-repeat;
  opacity: calc(1 - var(--a11y-reduce-transparency));
}

.tenant-ground::after {
  content: "";
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--bg) calc(var(--tenant-ground-veil) * 100%), transparent);
}

[data-family="traditional"] .tenant-ground { display: none; }

/* HOW FAR A VEILED PICTURE MAY REACH TOWARD THE TEXT, MEASURED. The end nearer the text: the
   darkest the light ground may get, the lightest the dark one may. 0.642 and 0.042 are WCAG
   luminances, and they are proven numbers rather than a copy of whatever ground is drawn:
   2026-10-03, four test pictures veiled to exactly these bounds left no text element of the
   home and students pages below AA that was not below it with no picture (1068 measured).
   They began as the reach of the older sky/ridge/city ground. liqui's backdrop, which
   replaced it on 2026-10-04, measures 0.493-0.898 (light) and 0.002-0.102 (dark) - wider at
   its thin ring and band lines, 0.670 and 0.051 at the 1st and 99th percentile - and the text
   over it was measured again then: 204 page elements and 126 dialog/page elements, nothing
   below AA but the dark-mode primary button that reads 3.52:1 on any ground. The bounds stay
   at the stricter, proven values. */
:root[data-mode="light"] {
  --ground-veil-bound: 0.642;
}

:root[data-mode="dark"] {
  --ground-veil-bound: 0.042;
}

/* ⚠ OVER AN ORGANISATION'S PICTURE, A BADGE'S TINT IS LAID ON THE PAGE COLOUR, NOT ON THE
   PICTURE. A status badge is a 12% tint with `-strong` text, and the theme compiler picks
   that text step by measuring it against the tint FLATTENED OVER THE PAGE COLOUR (see the
   note on `.badge--success` in components.css). Over a picture the tint is flattened over
   whatever the picture is instead: measured 2026-10-03 over a veiled night photo, the green
   "Active" badge read 4.27:1, below AA, while every neutral text on the same ground passed.
   Giving the tint the page colour underneath makes the fill exactly what the compiler
   measured, wherever the badge lands.

   Only while a picture is shown: on the built-in ground nothing changes. */
:root:has(.tenant-ground) .badge--success {
  background: linear-gradient(var(--success-subtle), var(--success-subtle)), var(--bg);
}

/* WARNING: THE SAME FOR A GREEN BADGE IN A PHONE'S LIST, IN THE LIGHT (owner, 2026-10-15, design
   review #4). On a phone the list's glass sits over the backdrop's cyan wash, and the tint
   flattened over that measured 3.4-4.4:1 ("Aktiv", "Qoşulub", "Təsdiqlənib",
   "Qiymətləndirilib"). Laid on the opaque surface instead, the fill is again one the compiler
   measured `--success-strong` against. Only the stacked lists (`DataTable stackOnNarrow`), only
   under their 40rem, only in the light, where it was measured. */
@media (max-width: 40rem) {
  :root[data-mode="light"] .meetings-list .badge--success {
    background: linear-gradient(var(--success-subtle), var(--success-subtle)), var(--surface-1);
  }
}

:root:has(.tenant-ground) .badge--warning {
  background: linear-gradient(var(--warning-subtle), var(--warning-subtle)), var(--bg);
}

:root:has(.tenant-ground) .badge--danger {
  background: linear-gradient(var(--danger-subtle), var(--danger-subtle)), var(--bg);
}

:root:has(.tenant-ground) .badge--info {
  background: linear-gradient(var(--info-subtle), var(--info-subtle)), var(--bg);
}

:root:has(.tenant-ground) .badge--brand {
  background: linear-gradient(var(--brand-subtle), var(--brand-subtle)), var(--bg);
}

/* THICKER GLASS, NOT HIGHER GLASS. The sidebar is the one surface the prototype
   gives its own tint: denser than a panel so the rail of navigation reads as a
   solid edge of the app, without being nearer to the viewer. */
.shell__sidebar {
  --glass-tint-alpha: var(--glass-tint-alpha-thick);
  /* No lit bar across the rail's short top and bottom ends (owner, 2026-09-29); its long sides keep
     the line. */
  --glass-specular-ends: 0;
  position: sticky;
  top: var(--shell-gutter);
  z-index: var(--z-sidebar);
  align-self: start;
  height: calc(100dvh - var(--shell-gutter) * 2);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--r-lg);
  overflow: hidden;
}

/* ⚠ THE SIDEBAR IS A `.mat`, NOT A HAND-ROLLED PIECE OF GLASS, and the reason is the one
   rule the material system will not bend on: GLASS CANNOT SAMPLE GLASS. A backdrop-filter
   declared here rather than by `.mat` looks identical and is not: the neutraliser that
   stops nested glass is `[data-family="glass"] .mat .mat`, which needs a `.mat` ANCESTOR,
   so a bespoke blur silently disables the guard for everything it contains.

   Being a real material also means it honours `--a11y-reduce-transparency` — a
   hand-rolled alpha does not, and a viewer with the OS setting on would keep a blurred,
   translucent sidebar while every other surface went solid.

   It carries the material's own radius now: the column floats inside a gutter rather than
   meeting two screen edges, so it has four corners again. Everything else about the
   material is the theme's business. */
.shell__sidebar {
  border-radius: var(--r-lg);
}

/* EVERY PANE FLOATS OVER THE SCENE (owner, 2026-09-29) - the sidebar and the top bar first, then
   every card on every screen the same way. Each gives back more of the light behind it (brightness
   and saturation), sits higher off the page on a longer, softer shadow, and carries no lit bar
   along its flat top and bottom edges, which on a wide surface read as two rails.

   The selector is the material's own list of outermost glass surfaces: a `.mat` that is not inside
   another, and an inset, empty state or table on the page ground. Nested panes have no backdrop to
   brighten and keep their own shadow. */
/* ⚠ BRIGHTNESS AND SATURATION ARE NO LONGER OVERRIDDEN HERE (owner, 2026-10-03). This rule
   used to lift every outer pane to brightness 112% and saturation 155%; the material is
   liqui's now, which runs saturation 170% from the knob and no brightness lift, and an
   override in this layer would beat it. The shadow lines that stood here fed the old
   five-layer stack, which material.css has replaced with liqui's rim and elevation. */
[data-family="glass"] :is(.mat, .mat-inset, .empty-state, .table-scroll):not(.mat *):not(.mat-inset *) {
  --glass-specular-ends: 0;
}

/* THE FILTER IS A SMALL PANE FLOATING ON THE RAIL, the way the rail and the top bar float on the
   page (owner, 2026-09-29): no edge line on any side, a half-clear fill and a soft shadow under it.
   It cannot blur - glass cannot sample glass, and it sits inside the rail's `.mat` - so the pane is
   drawn rather than blurred. The border keeps its width and goes clear, so focus can still colour
   it; focus keeps the pane and adds its glow. The menu filter only: on every form field the same
   treatment left an empty field all but invisible, and the owner took it back. */
[data-family="glass"] .shell__sidebar .field {
  --pane-shadow: 0 8px 18px -8px
    rgb(var(--shadow-rgb) / calc(0.7 * (1 - var(--a11y-reduce-transparency))));
  border-color: transparent;
  background-color: color-mix(
    in oklab,
    var(--surface-2) calc((42% + 58% * var(--a11y-reduce-transparency))),
    transparent
  );
  box-shadow: var(--pane-shadow);
}
/* FOCUS IS THE PANE LIGHTING UP, NOT A BLUE FRAME (owner, 2026-09-30). A text field matches
   `:focus-visible` on a mouse click as well as from the keyboard, so the global outline and the
   field's own ring drew two blue edges round the filter for as long as anyone typed in it. Here
   the pane brightens and gains a light inner rim instead: still a visible focus state for the
   keyboard (WCAG 2.4.7), in the rail's own material. The outline is removed only because this
   rule draws its replacement; forced colours restores a system one below. */
[data-family="glass"] .shell__sidebar .field:focus-visible {
  outline: none;
  border-color: transparent;
  background-color: color-mix(
    in oklab,
    var(--surface-2) calc((68% + 32% * var(--a11y-reduce-transparency))),
    transparent
  );
  box-shadow:
    var(--pane-shadow),
    inset 0 0 0 1px rgb(var(--light-rgb) / 0.42);
}
@media (forced-colors: active) {
  [data-family="glass"] .shell__sidebar .field:focus-visible {
    outline: 2px solid Highlight;
  }
}

/* A link, because the brand is how a reader gets back to the dashboard from anywhere.
   The global `a { color: var(--brand) }` and `a:hover { text-decoration: underline }`
   are both wrong for it, so both are overridden here rather than weakened globally. */
.shell__brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  border-radius: var(--r-md);
  color: var(--text);
  text-decoration: none;
  min-width: 0;
  transition: background-color var(--dur-fast) var(--ease-out);
}

.shell__brand:hover {
  text-decoration: none;
  background: var(--surface-2);
}

[data-family="glass"] .shell__brand:hover {
  background: var(--surface-2);
}

.shell__mark {
  display: grid;
  place-items: center;
  flex: none;
  width: var(--avatar-md);
  height: var(--avatar-md);
  border-radius: var(--r-sm);
  background: var(--brand);
  color: var(--text-on-brand);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
}

/* The teacher's own picture in the mark's place (owner, 2026-11-17): it fills the same square. */
.shell__mark--photo {
  overflow: hidden;
  background: var(--surface-2);
}

.shell__mark--photo img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

.shell__brandtext {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: var(--leading-tight);
}

.shell__brandname {
  font-family: var(--seed-font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Which KIND of tenant this workspace belongs to. A driving school, a university and a
   private tutor share this shell and differ only in the vocabulary of the menu, so the
   kind is the one word that says which product you are looking at. */
.shell__kind {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell__filter {
  display: block;
  padding-inline: var(--space-1);
}

.shell__filter .field {
  min-height: var(--space-7);
  font-size: var(--text-sm);
}

/* The scrolling part. Only this scrolls, so the brand and the filter box stay put while
   a long section is being read. */
.shell__nav {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding-block: var(--space-2);
  scrollbar-width: thin;
}

/* SCROLLBARS ARE GLASS TOO (owner, 2026-09-29). The native one paints an opaque dark track, which
   read as a black slab down the side of the glass sidebar. `scrollbar-color` inherits, so one rule on
   the root reaches every scroller: a translucent thumb of the text colour on a transparent track,
   which takes its colour from whatever the glass is over in either mode. Setting it also drops the
   classic arrow buttons on Windows. */
:root {
  scrollbar-color: color-mix(in oklab, var(--text) 38%, transparent) transparent;
}

.shell__noresults {
  padding: var(--space-4) var(--space-3);
}

/* --- a menu section -------------------------------------------------------- */

.navgroup {
  display: flex;
  flex-direction: column;
}

.navgroup__head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-5) var(--space-3) var(--space-2);
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-tertiary);
  font: inherit;
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
  cursor: pointer;
  transition:
    color var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out);
}

.navgroup__head:hover {
  color: var(--text);
  background: var(--surface-2);
}

[data-family="glass"] .navgroup__head:hover {
  background: var(--surface-2);
}

.navgroup__icon {
  flex: none;
  opacity: 0.9;
}

.navgroup__label {
  flex: 1 1 auto;
  text-align: start;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.navgroup__count {
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
}

.navgroup__chevron {
  flex: none;
  transition: transform var(--dur-base) var(--ease-out);
}

.navgroup__head[aria-expanded="true"] .navgroup__chevron {
  transform: rotate(180deg);
}

/* Items sit inside a rule-marked well, so a glance tells you which links belong to
   which heading without another box or another colour. */
.navgroup__items {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-inline-start: calc(var(--space-4) + var(--space-1));
  padding-inline-start: var(--space-2);
  border-inline-start: 1px solid var(--border-subtle);
}

.shell__nav .nav-item {
  gap: var(--space-2);
}

.nav-item__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Not built yet — a dot, not a disabled item. A disabled item teaches "does not
   exist"; this one teaches "coming", which is the truth. */
/* ⚠ TINTS, NOT `--surface-2`, IN THE CONSOLE'S SIDEBAR (owner, 2026-11-12). The shared rule fills
   a hovered or current row with `--surface-2`, an opaque colour, which on the glass rail read as
   a flat grey slab pasted over the material. Here the fill is the text colour at low strength
   over whatever is behind it: a faint light wash in dark mode, a faint dark one in light mode,
   and the glass still shows through. The current row keeps its brand rail and weight, so it
   never relies on the fill alone (WCAG 1.4.1).

   CONSOLE ONLY: scoped to `[data-origin="apex"]` (set on `.shell` in Shell.tsx), because console
   work must not change the tenant or learner sidebars without the owner asking. The brand block
   ("Platforma konsolu") hovers the same way as the rows. */
[data-origin="apex"] .shell__sidebar {
  --nav-fill-hover: color-mix(in oklab, var(--text) 7%, transparent);
  --nav-fill-current: color-mix(in oklab, var(--text) 10%, transparent);
  --nav-fill-press: color-mix(in oklab, var(--text) 13%, transparent);
}

[data-origin="apex"] .shell__nav .nav-item {
  border-radius: var(--r-md);
}

[data-origin="apex"] .shell__nav .nav-item:hover {
  background: var(--nav-fill-hover);
}

[data-origin="apex"] .shell__nav .nav-item[aria-current="page"] {
  background: var(--nav-fill-current);
}

[data-origin="apex"] .shell__nav .nav-item[aria-current="page"]:hover,
[data-origin="apex"] .shell__nav .nav-item:active {
  background: var(--nav-fill-press);
}

[data-origin="apex"] .shell__sidebar .shell__brand:hover {
  background: var(--nav-fill-hover);
}

[data-origin="apex"] .shell__sidebar .shell__brand:active {
  background: var(--nav-fill-press);
}

/* The console's side menu (owner, 2026-11-12; `ConsoleMenu` in Shell.tsx, apex only). Its groups
   reuse `.navgroup`, so they look like every other menu's sections; the rules below change only
   how they sit in the console, scoped to `[data-origin="apex"]`.

   ⚠ THE GAP ABOVE A HEADING IS A MARGIN, NOT PADDING. The shared heading carries 20px of padding
     above its label and 8px below, so its hover fill was a tall box with the text at the bottom,
     ending on the pixel where the first item began. In the console the padding is even, so the
     fill hugs the label, the space between entries sits outside it, and the hover is the same
     soft tint as a row's (`--nav-fill-*`). */
[data-origin="apex"] .shell__nav .navgroup__head {
  margin-block-start: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--r-md);
}

[data-origin="apex"] .shell__nav .navgroup__head:hover {
  background: var(--nav-fill-hover);
}

[data-origin="apex"] .shell__nav .navgroup__head:active {
  background: var(--nav-fill-press);
}

[data-origin="apex"] .shell__nav .navgroup__items {
  margin-block-start: var(--space-1);
}

/* A standalone line after a group gets the same air above it that a heading has. */
[data-origin="apex"] .shell__nav .navgroup + .nav-item {
  margin-block-start: var(--space-2);
}

/* --- the console's people directory (`pages/platform/Users.tsx`, owner 2026-11-12) ----------
   The "more filters" panel: three groups (who, account, dates), each a grid that is two columns
   on a phone and as many as fit on a wide screen. One `.mat-inset` on the page ground, so it
   draws its own edge under glass. */
.users-filters {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-5);
  margin-block-end: var(--space-4);
}

[data-family="glass"] .users-filters {
  border-color: var(--border);
}

.users-filters__group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.users-filters__title {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-strong);
}

.users-filters__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(11rem, 100%), 1fr));
  gap: var(--space-3);
  align-items: end;
}

.users-filters__ranges {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(19rem, 100%), 1fr));
  gap: var(--space-4);
}

.users-range {
  margin: 0;
  padding: 0;
  border: 0;
  min-inline-size: 0;
}

.users-range__pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.users-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* A several-at-once select (`components/MultiSelect.tsx`): the searchable select's field and
   list, with a tick on every chosen row. A field that holds a choice wears the brand edge, so a
   bar of filters shows at a glance which ones are set. */
.multiselect-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-inline-size: 0;
}

.multiselect .combo__field[data-active] {
  border-color: var(--brand);
}

.multiselect__option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.multiselect__tick {
  display: inline-grid;
  place-items: center;
  flex: none;
  inline-size: 1rem;
  block-size: 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xs);
  font-size: 0.75rem;
}

.multiselect__tick[data-on] {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--text-on-brand);
}

/* --- Abunələr's wide table (`pages/platform/Tenants.tsx`, owner 2026-11-12) -------------------
   Every cell on one line, so the table grows sideways and scrolls inside its own box, and the
   subscriber's name pinned at the start so a row is never read without knowing whose it is.
   The pinned cell needs a ground of its own or the scrolled columns show through it. */
.subs-tiles {
  margin-block-end: var(--space-4);
}

.subs-tile {
  padding: var(--space-3) var(--space-4);
}

[data-family="glass"] .subs-tile {
  border-color: var(--border);
}

.subs-tile__hint {
  color: var(--text-tertiary);
}

.subs-table .table th,
.subs-table .table td {
  white-space: nowrap;
}

/* The pinned column must meet the box's edge, or the columns scrolling beneath it show through
   the box's own inner padding on its left. So the box gives up its side padding and the first and
   last cells take it instead. */
.subs-table .table-scroll:not(.mat *):not(.mat-inset *) {
  padding-inline: 0;
}

.subs-table .table td:first-child,
.subs-table .table th:first-child > .sort-head {
  padding-inline-start: var(--space-5);
}

.subs-table .table td:last-child,
.subs-table .table th:last-child > .sort-head {
  padding-inline-end: var(--space-5);
}

.subs-table .table th:first-child,
.subs-table .table td:first-child {
  position: sticky;
  inset-inline-start: 0;
  z-index: 2;
  min-inline-size: 15rem;
  transition: background-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}

/* ⚠ NO GROUND OF ITS OWN UNTIL THE TABLE IS SCROLLED SIDEWAYS (owner, 2026-11-12: the pinned
   column "looks ugly" as a grey slab). At rest it is part of the table like any other column;
   only once columns pass beneath it (`TableScroll` marks the frame `data-more-start`) does it take
   a solid ground and a soft edge, which is the moment it needs one. */
.subs-table .table-frame[data-more-start] .table th:first-child,
.subs-table .table-frame[data-more-start] .table td:first-child {
  /* Frosted, not opaque: the columns passing beneath show through blurred, so the pinned column
     reads as a pane of the same table rather than a grey slab laid over it. */
  background: color-mix(in oklch, var(--bg-elevated) 94%, transparent);
  backdrop-filter: blur(var(--glass-blur));
  box-shadow:
    inset -1px 0 0 var(--border-subtle),
    var(--space-2) 0 var(--space-3) calc(var(--space-2) * -1) rgb(var(--shadow-rgb) / var(--glass-shadow-2-alpha));
}

/* A whole row lights under the pointer, the pinned cell with it. */
.subs-table .table tbody tr {
  transition: background-color var(--dur-fast) var(--ease-out);
}

.subs-table .table tbody tr:hover {
  background: var(--surface-2);
}

.subs-avatar {
  flex: none;
}

/* The pinned heading sits above the other headings, which a scrolled row of them would otherwise
   paint over. */
.subs-table .table th:first-child {
  z-index: 3;
}

.usage-cell {
  display: inline-flex;
  flex-direction: column;
  gap: var(--space-1);
  min-inline-size: 6rem;
}

.usage-cell[data-tone="warning"] .meter__fill {
  background: var(--warning);
}

.usage-cell[data-tone="danger"] .meter__fill {
  background: var(--danger);
}

/* --- Abunələr's statistics cards and result line (owner, 2026-11-12) -----------------------
   Four cards: revenue, renewals, the subscription mix as one bar with a legend, and the leading
   plans as bars. Under the filters, one line saying how many there are, how many the filters
   keep and which of those are shown, with the page size beside it. */
.subs-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr));
  gap: var(--space-3);
  margin-block-end: var(--space-4);
}

/* A note above the stats row (Müraciətlər's "reading is audited") sat flush on the cards. */
.alert + .subs-stats {
  margin-block-start: var(--space-4);
}

.subs-stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  min-inline-size: 0;
}

[data-family="glass"] .subs-stat {
  border-color: var(--border);
}

.subs-stat__label {
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.subs-stat__value {
  font-size: var(--text-xl);
  font-weight: var(--weight-strong);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.subs-stat__sub {
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.subs-mix {
  display: flex;
  gap: 2px;
  block-size: 8px;
  border-radius: var(--r-pill);
  overflow: hidden;
  background: var(--surface-3);
}

.subs-mix__seg {
  flex-basis: 0;
}

.subs-mix__seg--paying {
  background: var(--success);
}

.subs-mix__seg--trialing {
  background: var(--brand);
}

.subs-mix__seg--pastDue {
  background: var(--warning);
}

.subs-mix__seg--ended {
  background: var(--danger);
}

.subs-mix__seg--none {
  background: var(--text-tertiary);
}

/* Tariflər's line states (owner, 2026-11-13), on the same bar and legend. */
.plan-mix--onSale {
  background: var(--success);
}

.plan-mix--hidden {
  background: var(--brand);
}

.plan-mix--draft {
  background: var(--warning);
}

.plan-mix--retired {
  background: var(--text-tertiary);
}

/* İstifadəçilər's cards (owner, 2026-11-13): account status, then how recently people signed in. */
.user-mix--Active,
.user-mix--week {
  background: var(--success);
}

.user-mix--Invited {
  background: var(--warning);
}

.user-mix--Disabled {
  background: var(--danger);
}

.user-mix--month {
  background: var(--brand);
}

.user-mix--earlier {
  background: color-mix(in oklch, var(--brand) 40%, var(--surface-3));
}

.user-mix--never {
  background: var(--text-tertiary);
}

/* What needs a hand: each line a button that sets its filter. */
.user-flags {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-inline: calc(var(--space-2) * -1);
}

.user-flag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  inline-size: 100%;
  padding: var(--space-1) var(--space-2);
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--text-secondary);
  font: inherit;
  font-size: var(--text-xs);
  text-align: start;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}

.user-flag strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.user-flag:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}

.user-flag:disabled {
  cursor: default;
  opacity: 0.6;
}

.users-check[data-ok] {
  gap: var(--space-1);
  color: var(--success-strong);
}

/* İstifadəçi xidmətləri's mix bars and legend dots (`serviceKit.tsx`, owner 2026-11-13). */
.svc-tone--success {
  background: var(--success);
}

.svc-tone--warning {
  background: var(--warning);
}

.svc-tone--danger {
  background: var(--danger);
}

.svc-tone--brand {
  background: var(--brand);
}

.svc-tone--info {
  background: color-mix(in oklch, var(--brand) 40%, var(--surface-3));
}

.svc-tone--muted {
  background: var(--text-tertiary);
}

/* A sent notice read back whole, its line breaks kept. */
.ann-body {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* In the notice's details the text sits in its own card, and Edit / Cancel close the dialog's body. */
.ann-card {
  margin-top: var(--space-2);
  padding: var(--space-3) var(--space-4);
}

.ann-actions {
  margin-top: var(--space-4);
}

/* A row's own buttons stay on one line beside each other rather than stacking in a narrow cell. */
.row-actions {
  flex-wrap: nowrap;
  white-space: nowrap;
}

/* Platforma elanları: who a notice reaches (owner, 2026-11-13). Sets of conditions joined by OR. */
.aud-heading {
  margin: var(--space-3) 0 0;
  font-size: inherit;
}

.aud-mode {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.aud-check {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}

.aud-group {
  margin: 0;
  padding: var(--space-3) var(--space-4) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  min-inline-size: 0;
}

.aud-group__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-2);
}

.aud-group__section {
  margin: var(--space-3) 0 var(--space-2);
  font-size: inherit;
  color: var(--text-secondary);
}

.aud-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
  gap: var(--space-3);
  align-items: end;
}

.aud-field {
  min-inline-size: 0;
}

.aud-or {
  align-self: center;
  font-weight: 600;
  color: var(--brand);
  letter-spacing: 0.08em;
}

.aud-or__word {
  color: var(--brand);
}

.aud-days {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  margin: 0;
  padding: 0;
  border: 0;
}

.aud-when {
  display: grid;
  gap: var(--space-2);
  max-inline-size: 24rem;
}

.aud-preview {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
}

.aud-preview__sample {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: var(--space-1) var(--space-4);
}

.aud-found {
  display: grid;
  gap: var(--space-2);
  max-block-size: 16rem;
  overflow: auto;
}

.aud-found .grow,
.aud .grow,
.stack > .row > .grow {
  flex: 1 1 auto;
  min-inline-size: 0;
}

.subs-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.subs-legend li {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.subs-legend strong {
  margin-inline-start: auto;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.subs-legend__dot {
  inline-size: 0.5rem;
  block-size: 0.5rem;
  border-radius: var(--r-pill);
}

.subs-bars {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: var(--text-xs);
}

.subs-bars li {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2);
}

.subs-bars__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
}

.subs-bars__bar {
  display: block;
  block-size: 6px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  overflow: hidden;
}

.subs-bars__bar > span {
  display: block;
  block-size: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.subs-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-block: var(--space-2);
}

.subs-result__counts {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin: 0;
  color: var(--text-secondary);
}

.subs-result__counts strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.subs-result__size {
  gap: var(--space-2);
}

.subs-result__size .field,
.subs-result__size .combo {
  inline-size: 5.5rem;
}

/* The address, its copy mark beside it and - when it is not live - its state under it. */
.addr-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
}

.addr-cell__line {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.copy-btn {
  inline-size: var(--control-xs);
  block-size: var(--control-xs);
  color: var(--text-tertiary);
}

.copy-btn:hover {
  color: var(--brand-strong);
}

.copy-btn[data-copied] {
  color: var(--success-strong);
}

/* --- filter slots sized by what they hold (owner, 2026-11-12: "unknown text lengths should have
   wider selects and static ones static") -------------------------------------------------------
   xs   yes/no, a three-letter currency           sm   a period, a short word
   md   a status, a kind                          lg   a plan, a metric, an address state - free text
   date one date range "01.11.2026 – 30.11.2026"  num  one number range "100 – 300 GB"
   grow the search box, taking what room is left
   The control inside fills its slot; a slot never stretches to fill a row. */
.fslot {
  flex: none;
  min-inline-size: 0;
}

/* ⚠ `.filter-bar .fslot`, NOT `.fslot` ALONE, for the field: `.filter-bar .field` further down
   sets `width: auto; min-width: 10rem`, and at equal weight the later rule won - the search slot
   grew while the box inside it stayed 10rem. */
.fslot > *,
.fslot .combo,
.fslot .form-field,
.fslot .multiselect-field,
.filter-bar .fslot .field,
.fslot .field {
  inline-size: 100%;
  width: 100%;
  min-inline-size: 0;
  min-width: 0;
}

/* A label longer than its slot ends in an ellipsis rather than wrapping the row out of line. */
.fslot .label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fslot--xs {
  inline-size: 8.5rem;
}

.fslot--sm {
  inline-size: 10rem;
}

.fslot--md {
  inline-size: 12rem;
}

.fslot--lg {
  inline-size: 17rem;
}

.fslot--date {
  inline-size: 14.5rem;
}

/* A date-and-time range reads "01.11.2026 09:00 – 30.11.2026 23:59". */
.fslot--datetime {
  inline-size: 20rem;
}

.fslot--num {
  inline-size: 9rem;
}

.fslot--grow {
  flex: 1 1 14rem;
}

@media (max-width: 40rem) {
  .fslot,
  .fslot--grow {
    flex: 1 1 100%;
    inline-size: auto;
  }
}

/* The "more filters" panel as dense rows: the row's name in a narrow column at the start,
   its fields flowing beside it, a hairline between rows. */
.dfilters {
  gap: 0;
  padding-block: var(--space-2);
}

.dfilters__row {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: var(--space-3);
  align-items: start;
  padding-block: var(--space-3);
}

.dfilters__row + .dfilters__row {
  border-block-start: 1px solid var(--border-subtle);
}

.dfilters__title {
  margin: 0;
  /* Level with the fields' own labels. */
  padding-block-start: 2px;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dfilters__fields {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  align-items: end;
}

@media (max-width: 48rem) {
  .dfilters__row {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-2);
  }
}

/* --- clickable cells in the console's lists (owner, 2026-11-12: "dont use a href with underline
   and blue colour, use something nice that i would click on") --------------------------------
   `.cell-link` is a row's way in: the name in the ink of the page, a chevron that brightens and
   moves on hover, and a soft ground under the whole cell. `.chip-btn` is a small action or a
   count you can open - a plan, a version, a subscriber count, a copy button. Neither is
   underlined, and neither leans on colour alone: the chevron and the chip's edge say "press". */
.cell-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: calc(var(--space-1) * -1) calc(var(--space-2) * -1);
  padding: var(--space-1) var(--space-2);
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--text);
  font: inherit;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}

.cell-link__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cell-link__title {
  font-weight: var(--weight-strong);
}

.cell-link--fill {
  display: flex;
  inline-size: calc(100% + var(--space-2) * 2);
  gap: var(--space-3);
}

.cell-link--fill .cell-link__text {
  flex: 1;
  min-inline-size: 0;
}

.cell-link__arrow {
  flex: none;
  color: var(--text-tertiary);
  transition: transform var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

/* No underline on hover, as an `<a>` either: the global `a:hover` draws one and outranks the
   class's own `text-decoration`, and a line under a row's name is exactly what the owner did
   not want (2026-11-12). The ground and the arrow say "press". */
.cell-link:hover,
.chip-btn:hover {
  text-decoration: none;
}

.cell-link:hover {
  background: var(--surface-2);
}

.cell-link:hover .cell-link__arrow {
  color: var(--brand-strong);
  transform: translateX(2px);
}

.cell-link:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  line-height: 1.6;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

.chip-btn:hover {
  border-color: var(--brand-border);
  background: var(--brand-subtle);
  color: var(--brand-strong);
}

.chip-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.chip-btn__aside {
  color: var(--text-tertiary);
}

.chip-btn--accent {
  border-color: var(--brand-border);
  color: var(--brand-strong);
}

/* A column heading that orders the rows (`pages/platform/sortable.tsx`), drawn the way a
   DataTables heading is: the WHOLE cell is the button - the `<th>` gives its padding to it - with
   a pair of arrows at the far end, both faint until the column orders the rows, then the one that
   applies lit. The ordering column's heading wears a quiet brand ground. */
.table th:has(> .sort-head) {
  padding: 0;
}

.sort-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  inline-size: 100%;
  min-block-size: 100%;
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: start;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background-color var(--dur-fast) var(--ease-out);
}

.sort-head:hover {
  background: var(--surface-2);
  color: var(--text);
}

.sort-head:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

.sort-head__marks {
  display: inline-flex;
  flex-direction: column;
  flex: none;
  line-height: 0;
  font-size: 0.7rem;
}

.sort-head__mark {
  color: var(--text-tertiary);
  opacity: 0.45;
}

.sort-head__mark + .sort-head__mark {
  margin-block-start: -0.3em;
}

.sort-head[data-dir] {
  background: var(--brand-subtle);
  color: var(--text);
}

.sort-head__mark[data-on] {
  color: var(--brand-strong);
  opacity: 1;
}

/* A count on a tab (Abunələr's "Paket istəkləri"): always drawn, a quiet grey at 0, and the
   brand colour once anything is waiting, so a waiting queue is seen from across the screen. */
.tab-count {
  display: inline-grid;
  place-items: center;
  min-inline-size: 1.25rem;
  block-size: 1.25rem;
  margin-inline-start: var(--space-2);
  padding-inline: var(--space-1);
  border-radius: var(--r-pill);
  background: var(--surface-3);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
  font-variant-numeric: tabular-nums;
}

.tab-count[data-waiting] {
  background: var(--brand);
  color: var(--text-on-brand);
}

/* Who is in an organisation, in one cell: three rows of label, bar and figure. The total's bar
   is the make-up of every account; the learners' bar is held against the plan's limit (the only
   head count a plan caps) and turns amber, then red, as it fills. */
.people-cell {
  display: grid;
  gap: var(--space-1);
  min-inline-size: 13rem;
}

.people-cell__row {
  display: grid;
  grid-template-columns: 4.5rem 1fr auto;
  align-items: center;
  gap: var(--space-2);
}

.people-cell__label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--text-secondary);
}

.people-cell__value {
  min-inline-size: 3.5rem;
  text-align: end;
  color: var(--text);
}

.people-cell__bar {
  display: flex;
  block-size: 6px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  overflow: hidden;
}

.people-cell__seg {
  block-size: 100%;
  transition: width var(--dur-slow) var(--ease-out);
}

.people-cell__seg--students,
.people-cell__dot--students {
  background: var(--brand);
}

.people-cell__seg--teachers,
.people-cell__dot--teachers {
  background: var(--success);
}

/* Staff (owners and admins) take a colour mixed from two of the theme's own, so it stays apart
   from the learners' brand and the teachers' green in every theme; parents are the quiet grey. */
.people-cell__seg--staff,
.people-cell__dot--staff {
  background: color-mix(in oklch, var(--brand) 45%, var(--danger));
}

.people-cell__seg--parents,
.people-cell__dot--parents {
  background: var(--text-tertiary);
}

.people-cell__row[data-tone="warning"] .people-cell__seg--students {
  background: var(--warning);
}

.people-cell__row[data-tone="danger"] .people-cell__seg--students {
  background: var(--danger);
}

.people-cell__dot {
  inline-size: 0.5rem;
  block-size: 0.5rem;
  border-radius: var(--r-pill);
}

/* --- one field for a date range (`components/DateRangeField.tsx`, owner 2026-11-12) ------------
   Closed: a field reading "01.11.2026 – 30.11.2026" with the calendar mark and, once set, a clear.
   Open: the two ends as tabs over our own calendar, each with its own clear. */
.daterange {
  min-inline-size: 0;
}

.daterange__box {
  position: relative;
  display: flex;
  align-items: center;
}

.daterange__field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  inline-size: 100%;
  padding-inline-end: calc(var(--space-7) + var(--control-xs));
  text-align: start;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.daterange__field[data-active] {
  border-color: var(--brand);
}

.daterange__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.daterange__icon {
  position: absolute;
  inset-inline-end: var(--space-3);
  color: var(--text-tertiary);
  pointer-events: none;
}

.daterange__panel {
  position: fixed;
  inset: auto;
  margin: 0;
}

.daterange__ends {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  margin-block-end: var(--space-2);
}

.daterange__end {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}

.daterange__end[data-active] {
  border-color: var(--brand);
  background: var(--brand-subtle);
}

.daterange__end-pick {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: var(--space-1) var(--space-2);
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.daterange__end-clear {
  inline-size: var(--control-xs);
  block-size: var(--control-xs);
  margin-inline-end: var(--space-1);
  color: var(--text-tertiary);
}

/* The chosen end's clock, under the calendar (`withTime`, owner 2026-11-13). */
.daterange__time {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-block-start: var(--space-2);
  padding-block-start: var(--space-2);
  border-block-start: 1px solid var(--border);
}

.daterange__time .field {
  inline-size: 6rem;
  text-align: center;
}

/* --- one subscriber's page (`pages/platform/TenantDetail.tsx`, owner 2026-11-12) ----------------
   A header card - avatar, name, badges, kind / slug / address, the two next actions - over a row
   of four figures; then tabs whose content is cards on a two-column grid that folds to one. Each
   card is a `.mat-inset` on the page ground, so under glass it draws its own edge. */
.sub-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-5);
}

[data-family="glass"] .sub-head,
[data-family="glass"] .sub-card {
  border-color: var(--border);
}

.sub-head__top {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.sub-head__avatar {
  inline-size: 3rem;
  block-size: 3rem;
  font-size: var(--text-md);
}

.sub-head__who {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-1);
  min-inline-size: min(100%, 16rem);
}

.sub-head__title {
  gap: var(--space-2);
  align-items: center;
}

.sub-head__name {
  margin: 0;
  font-size: var(--text-xl);
  font-weight: var(--weight-strong);
  line-height: 1.2;
}

.sub-head__meta {
  gap: var(--space-2);
  align-items: center;
  color: var(--text-secondary);
}

.sub-head__actions {
  gap: var(--space-2);
  flex-wrap: wrap;
}

.sub-head__figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr));
  gap: var(--space-3);
  padding-block-start: var(--space-4);
  border-block-start: 1px solid var(--border-subtle);
}

.sub-figure {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-inline-size: 0;
}

.sub-figure[data-wide] {
  grid-column: span 2;
}

@media (max-width: 40rem) {
  .sub-figure[data-wide] {
    grid-column: auto;
  }
}

.sub-figure__label {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: var(--weight-strong);
}

.sub-detail__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(24rem, 100%), 1fr));
  gap: var(--space-4);
  align-items: start;
}

.sub-card .section-title {
  margin: 0;
  font-size: var(--text-md);
}

.sub-card--danger {
  border-color: var(--danger-border);
}

/* Two cards side by side, half the width each and THE SAME HEIGHT (owner, 2026-11-12), folding
   to one column on a narrow screen. Every tab is built of these so it fits one screen. */
.sub-detail__pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  align-items: stretch;
}

.sub-detail__pair > * {
  min-inline-size: 0;
  block-size: 100%;
}

@media (max-width: 56rem) {
  .sub-detail__pair {
    grid-template-columns: minmax(0, 1fr);
  }
}

.sub-card__actions {
  gap: var(--space-2);
  margin-block-start: auto;
}

/* A card that folds (Tarif və limitlər's İstisnalar and Funksiyalar). The whole head is the
   control; the chevron turns when it is open. */
.sub-fold {
  padding: 0;
}

.sub-fold__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  cursor: pointer;
  list-style: none;
  border-radius: inherit;
}

.sub-fold__head::-webkit-details-marker {
  display: none;
}

/* Hover lights the words and the chevron, not a slab across the whole card (owner, 2026-11-12:
   the full-width grey bar on mouse-over looked broken). */
.sub-fold__head:hover .section-title {
  color: var(--brand-strong);
}

.sub-fold__head:hover .sub-fold__chevron {
  color: var(--brand-strong);
}

.sub-fold__head:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

.sub-fold__chevron {
  margin-inline-start: auto;
  color: var(--text-tertiary);
  transition: transform var(--dur-fast) var(--ease-out);
}

.sub-fold[open] .sub-fold__chevron {
  transform: rotate(180deg);
}

.sub-fold__body {
  padding: 0 var(--space-5) var(--space-5);
}

/* The subscriber page's tables are dense: tighter rows and a small avatar, so a tab's list fits
   a screen beside its header. */
.sub-detail .table td {
  padding-block: var(--space-2);
}

.sub-detail .subs-avatar {
  inline-size: var(--avatar-sm);
  block-size: var(--avatar-sm);
  font-size: 0.625rem;
}

/* The people list's name and email on one line, the email quieter, so a row is one line high. */
.sub-members .cell-link__text {
  flex-direction: row;
  align-items: baseline;
  gap: var(--space-2);
  white-space: nowrap;
}

.sub-members .table-scroll:not(.mat *):not(.mat-inset *) {
  padding-block: var(--space-2);
}

.sub-members .filter-bar .subs-result__size .field,
.sub-members .filter-bar .subs-result__size .combo {
  inline-size: 4.75rem;
  min-inline-size: 0;
}

.sub-members .filter-bar .subs-result__counts {
  margin-inline-end: var(--space-3);
}

/* "Platformadakı yeri": three tiles - size, activity, rank - each a plain answer over this
   organisation's bar beside the median's, and the rank as a marker on a line-up. */
.standing {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.standing__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  gap: var(--space-4);
}

.standing__tile {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-inline-size: 0;
}

.standing__label {
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.standing__answer {
  font-weight: var(--weight-strong);
}

.standing__bars {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.standing__bar {
  display: grid;
  grid-template-columns: 3.5rem 1fr 2.5rem;
  align-items: center;
  gap: var(--space-2);
}

.standing__bar strong {
  text-align: end;
}

.standing__track {
  display: block;
  block-size: 6px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  overflow: hidden;
}

.standing__fill {
  display: block;
  block-size: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.standing__fill--median {
  background: var(--text-tertiary);
}

.standing__lineup {
  position: relative;
  display: block;
  block-size: 6px;
  margin-block: var(--space-2);
  border-radius: var(--r-pill);
  background: linear-gradient(to right, var(--brand), var(--surface-3));
}

.standing__marker {
  position: absolute;
  inset-block-start: 50%;
  inline-size: 0.875rem;
  block-size: 0.875rem;
  margin-inline-start: -0.4375rem;
  margin-block-start: -0.4375rem;
  border: 2px solid var(--brand);
  border-radius: var(--r-pill);
  background: var(--bg-elevated);
}

/* An empty list inside a half-width card: one quiet line, centred. */
.sub-empty {
  margin: 0;
  padding: var(--space-4) 0;
  text-align: center;
}

/* The comparison figures, one row across the top of Audit. */
.sub-compare {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* The header's people figure: one bar, and each group as a coloured figure on one line. */
.people-cell--compact {
  min-inline-size: 0;
}

.people-cell--compact .people-cell__row {
  grid-template-columns: auto 1fr auto;
}

.people-cell__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  color: var(--text-secondary);
}

.people-cell__legend > span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.people-cell__legend strong {
  color: var(--text);
}

.people-cell__legend > span[data-tone="warning"] strong {
  color: var(--warning-strong);
}

.people-cell__legend > span[data-tone="danger"] strong {
  color: var(--danger-strong);
}

/* A tighter header, so the tabs start higher. */
.sub-head {
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
}

.sub-head__figures {
  padding-block-start: var(--space-3);
}

/* The subscription's facts: label over value, three across, so six facts take two rows. */
.sub-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3) var(--space-4);
  margin: 0;
}

.sub-facts > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-inline-size: 0;
}

.sub-facts dt {
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.sub-facts dd {
  margin: 0;
  font-weight: var(--weight-medium);
  overflow-wrap: anywhere;
}

/* A badge in a tile wraps inside the tile, as the definition list's and the schedule's do: a long
   state ("Məktub göndərilib, şifrə hələ təyin olunmayıb") ran out of its column onto the next
   tile's figures (organisation walk 2026-11-19). */
.sub-facts dd > .badge {
  /* Its own width in a stacked value, never stretched to the tile's. */
  align-self: flex-start;
  max-inline-size: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* A long value - an address, an id - takes two tiles rather than breaking mid-word in one. */
.sub-facts > div[data-wide] {
  grid-column: span 2;
}

@media (max-width: 40rem) {
  .sub-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Label and value on one line each, label left in the secondary ink, value right. */
.sub-lines {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.sub-lines > div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding-block: var(--space-2);
  border-block-end: 1px solid var(--border-subtle);
}

.sub-lines > div:last-child {
  border-block-end: 0;
}

.sub-lines dt {
  color: var(--text-secondary);
}

.sub-lines dd {
  margin: 0;
  text-align: end;
  font-weight: var(--weight-medium);
}

.sub-meters {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.sub-meters li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(8rem, 12rem);
  align-items: center;
  gap: var(--space-3);
}

.sub-meters .usage-cell {
  min-inline-size: 0;
}

.sub-form__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr));
  gap: var(--space-3) var(--space-4);
  align-items: start;
}

/* --- one field for a number range (`components/NumberRangeField.tsx`, owner 2026-11-12) ------
   The closed field is the date range's; the panel holds Min / Max boxes, a two-thumb slider and
   the rule in words. The slider is two range inputs on one track: the inputs ignore the pointer,
   their thumbs take it, so either thumb can be dragged wherever the other one sits. */
.numrange__panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.numrange__boxes {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: var(--space-2);
}

.numrange__box {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-inline-size: 0;
}

.numrange__box .field {
  inline-size: 100%;
  font-variant-numeric: tabular-nums;
}

.numrange__dash {
  padding-block-end: var(--space-2);
  color: var(--text-tertiary);
}

.numrange__slider {
  position: relative;
  block-size: 1.5rem;
}

.numrange__track {
  position: absolute;
  inset-inline: 0;
  inset-block-start: 50%;
  block-size: 4px;
  margin-block-start: -2px;
  border-radius: var(--r-pill);
  background: linear-gradient(
    to right,
    var(--surface-3) var(--lo),
    var(--brand) var(--lo),
    var(--brand) var(--hi),
    var(--surface-3) var(--hi)
  );
}

.numrange__slider input[type="range"] {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  margin: 0;
  background: none;
  pointer-events: none;
  appearance: none;
}

.numrange__slider input[type="range"]::-webkit-slider-runnable-track {
  background: none;
}

.numrange__slider input[type="range"]::-webkit-slider-thumb {
  inline-size: 1rem;
  block-size: 1rem;
  border: 2px solid var(--brand);
  border-radius: var(--r-pill);
  background: var(--bg-elevated);
  cursor: grab;
  pointer-events: auto;
  appearance: none;
}

.numrange__slider input[type="range"]::-moz-range-thumb {
  inline-size: 1rem;
  block-size: 1rem;
  border: 2px solid var(--brand);
  border-radius: var(--r-pill);
  background: var(--bg-elevated);
  cursor: grab;
  pointer-events: auto;
}

.numrange__slider input[type="range"]:focus-visible::-webkit-slider-thumb {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.numrange__ends {
  display: flex;
  justify-content: space-between;
  margin-block-start: calc(var(--space-2) * -1);
  font-variant-numeric: tabular-nums;
}

.numrange__rule {
  margin: 0;
  padding: var(--space-2);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  text-align: center;
}

.numrange__rule--bad {
  background: var(--danger-subtle);
  color: var(--danger-strong);
}

/* A plain badge (no tone) wears an edge in the console like the toned ones appear to (owner,
   2026-11-12: "add border to that avto as well"): on the dark ground its grey fill alone
   vanished. Inset, so the badge does not grow. */
[data-origin="apex"] .badge:not([class*="badge--"]) {
  box-shadow: inset 0 0 0 1px var(--border);
}

/* A feature's effective value that is not its inherited one (`Features.tsx`, owner 2026-11-12):
   a gold edge, so the organisation's own decisions stand out in a column of defaults. Gold is the
   theme's warning hue; the word still says which value it is, so colour is never the only cue. */
[data-origin="apex"] .badge[data-differs] {
  box-shadow: inset 0 0 0 2px var(--warning);
}

/* --- a plan as a card, and plans side by side (`components/PlanCard.tsx`, owner 2026-11-12) ----
   Shared: the console's Tariflər draws it today and the landing page is meant to. Each card is a
   `.mat-inset` on the page ground - a grid of them is exactly the wall of sibling `.mat` the
   theme rules warn about - so under glass it draws its own edge. */
.plan-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.plan-cards__group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.plan-cards__heading {
  margin: 0;
  font-size: var(--text-md);
  font-weight: var(--weight-strong);
}

.plan-cards__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(18rem, 100%), 1fr));
  gap: var(--space-4);
  align-items: start;
}

.plan-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  min-inline-size: 0;
}

[data-family="glass"] .plan-card {
  border-color: var(--border);
}

.plan-card[data-highlighted] {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
}

.plan-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.plan-card__title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-inline-size: 0;
}

.plan-card__name {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: var(--weight-strong);
  overflow-wrap: anywhere;
}

.plan-card__select {
  flex: none;
}

.plan-card__badges {
  gap: var(--space-1);
}

.plan-card__price {
  margin: 0;
}

.plan-card__amount {
  font-size: var(--text-xl);
  font-weight: var(--weight-strong);
  font-variant-numeric: tabular-nums;
}

.plan-card__description {
  margin: 0;
}

.plan-card__section {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-block-start: var(--space-3);
  border-block-start: 1px solid var(--border-subtle);
}

.plan-card__heading {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.plan-card__lines {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin: 0;
}

.plan-card__line {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: var(--text-sm);
}

.plan-card__line dt {
  color: var(--text-secondary);
}

.plan-card__line dd {
  margin: 0;
  text-align: end;
  font-weight: var(--weight-medium);
}

.plan-card__features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(9rem, 100%), 1fr));
  gap: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
}

.plan-card__features li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-tertiary);
}

.plan-card__features li[data-included] {
  color: var(--text);
}

.plan-card__features li[data-included] svg {
  color: var(--success);
}

.plan-card__foot {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-block-start: auto;
}

.plan-view-toggle {
  gap: 2px;
}

.plan-view-toggle .btn[aria-pressed="true"] {
  background: var(--brand-subtle);
  color: var(--brand-strong);
}

/* Which plans are picked, and the way to compare them: pinned to the bottom of the view while
   anything is picked, so it never has to be scrolled back to. */
.plan-compare-bar {
  position: sticky;
  inset-block-end: var(--space-4);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  align-self: center;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--r-pill);
}

.plan-compare .table th[scope="row"] {
  color: var(--text-secondary);
  font-weight: var(--weight-medium);
  white-space: nowrap;
}

.plan-compare__name {
  display: block;
  color: var(--text);
  font-weight: var(--weight-strong);
}

.plan-compare__code {
  display: block;
  font-weight: var(--weight-regular);
}

/* ⚠ THE COMPARISON SCROLLS ITSELF, SO ITS HEADER CAN STAY (owner, 2026-11-13: "visuals in modal
   are off"). In the dialog's body the plan names scrolled away after a few rows and the reader
   lost which column was which. Here the body hands its height to the table's frame, the frame
   scrolls, and the header row sticks to its top. Columns share the width equally after the
   label column. */
.modal__body:has(> .plan-compare) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.plan-compare {
  min-block-size: 0;
  overflow: auto;
}

.plan-compare > .table {
  table-layout: fixed;
  inline-size: 100%;
}

.plan-compare > .table th:first-child {
  inline-size: 13rem;
}

.plan-compare > .table thead th {
  position: sticky;
  inset-block-start: 0;
  z-index: 1;
  vertical-align: bottom;
  background: var(--surface-1);
}

.plan-compare > .table :is(th, td) {
  padding-block: var(--space-2);
}

.plan-compare__group th {
  padding-block-start: var(--space-4);
  color: var(--text);
  font-weight: var(--weight-strong);
}

.plan-compare__mark {
  color: var(--text-tertiary);
}

.plan-compare__mark[data-included] {
  color: var(--success);
}

/* --- the plan dialog (owner, 2026-11-13: "visuals in modal are off, like height") ----------
   One height for all three tabs: the sheet is sized once and the body takes what is left, so
   switching tabs or waiting for a tab to load no longer resizes it. On a short window the
   window's own cap still wins. */
.modal:has(> .modal__body > .plan-dialog--tabs) {
  block-size: min(47rem, calc(100dvh - var(--space-6) * 2));
}

.modal[open]:has(> .modal__body > .plan-dialog--tabs) > .modal__body {
  flex: 1 1 auto;
  max-height: none;
}

.plan-dialog {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Each row of the form is a grid, so every field fills its share; `minmax(0, …)` because an
   input's intrinsic width would otherwise widen its own track. */
.plan-form__grid {
  display: grid;
  gap: var(--space-3);
  align-items: start;
}

.plan-form__grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.plan-form__grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Price, currency, period, trial, visibility: the money and the audience a little wider. */
.plan-form__grid--terms {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr) minmax(0, 1fr) minmax(0, 0.8fr) minmax(0, 1.2fr);
}

.plan-form__grid :is(.field, .combo) {
  inline-size: 100%;
}

@media (max-width: 40rem) {
  .plan-form__grid--2,
  .plan-form__grid--3,
  .plan-form__grid--terms {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* The plan's life beside Save: wraps on a narrow sheet rather than pushing Save out. */
.plan-form__life {
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* İmkanlar as two columns of tiles: the name and its code, the switch at the end. Doubled
   class because `.plain`, later in this file, sets `display: flex` at the same weight. */
.plain.plan-features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.plan-features__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
}

@media (max-width: 40rem) {
  .plain.plan-features {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* A limit and what it means, on one line rather than the meaning dangling under the box. */
.plan-quota__limit {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.plan-quota__limit > .field {
  inline-size: 8rem;
  flex: none;
}

.plan-quota__limit > .tiny {
  white-space: nowrap;
}

/* A screen `CONSOLE_MENU` does not place: drawn last, flat, below a rule, so it shows as
   unplaced rather than vanishing. */
.navflat__rest {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-block-start: var(--space-3);
  padding-block-start: var(--space-3);
  border-block-start: 1px solid var(--border);
}

.navflat__rest:first-child {
  margin-block-start: 0;
  padding-block-start: 0;
  border-block-start: 0;
}

.nav-item__pending {
  margin-inline-start: auto;
  color: var(--warning);
  font-weight: var(--weight-strong);
}

/* --- the topbar ------------------------------------------------------------
   Pinned under nothing: the impersonation banner is `sticky top:0` and would collide,
   so the topbar sticks at 0 too and the banner simply wins the z-order. In the ordinary
   case there is no banner and the topbar is the only pinned row.
   -------------------------------------------------------------------------- */

.shell__body {
  display: flex;
  flex-direction: column;
  gap: var(--shell-gutter);
  min-width: 0;
}

.shell__topbar {
  position: sticky;
  top: var(--shell-gutter);
  z-index: var(--z-topbar);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  /* A hard height. With vertical padding the 34px burger pushed the bar to 52
     and the 46px token stopped describing anything. */
  block-size: var(--shell-topbar);
  padding: 0 var(--space-4);
  /* Same reasoning as the sidebar: a `.mat`, so the account menu it contains is caught by
     the nested-glass guard instead of being blurred twice. It keeps the material's radius
     now that it floats inside the gutter rather than spanning the window. */
  border-radius: var(--r-lg);
}

/* The page's visible name. Every screen's h1 is hidden (the owner's call), so this
   line is the one place a screen says where the reader is, and it is shown at all
   times rather than faded in on scroll. See the note in `Shell.tsx`. */
.shell__where {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--seed-font-display);
  font-size: var(--text-base);
  font-weight: var(--weight-strong);
  letter-spacing: -0.01em;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* WARNING: ON A PHONE THE NAME TAKES A LINE OF ITS OWN UNDER THE CONTROLS (device test row
   39). The burger, the finder, the bell, the appearance switch and the account menu are 44px
   targets under a finger, and at 320px they left the name 3px of the 81px "Dərs cədvəli" needs - one
   letter, or "Ana s..." and "Şagird..." elsewhere. Hiding it is not an option: every screen's
   own h1 is hidden (see above), so this is the only name a screen shows. Nor is dropping a
   control. So below 30rem the bar wraps: the controls keep their row and their places, and the
   name, at its own size, reads in full beneath them. The bar grows by that one line. */
@media (max-width: 30rem) {
  .shell__topbar {
    flex-wrap: wrap;
    row-gap: 0;
    block-size: auto;
    min-block-size: var(--shell-topbar);
    padding-block: var(--space-1) var(--space-2);
  }

  .shell__where {
    order: 1;
    flex-basis: 100%;
  }

  .shell__actions {
    margin-inline-start: auto;
  }
}

/* Focus the shell moved to `<main>` after a pointer navigation: the landmark is
   focused so the change is announced, but a ring round the whole page answers a
   question nobody asked. Keyboard navigation and the skip link keep the ring. */
.shell__main[data-route-focus]:focus-visible {
  outline: none;
}

.shell__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* The topbar's icon-only controls are circles at the small control size, not
   buttons that happen to hold a glyph. `.btn` gives them the 34px box and the
   superellipse corner every other button wears, so both have to be undone:
   `min-block-size` as well as `block-size`, because `.btn`'s own min-height
   would otherwise win, and `corner-shape: round`, because a squircle at a 999px
   radius is not a circle. */
.shell__icon-btn {
  inline-size: var(--control-sm);
  block-size: var(--control-sm);
  min-block-size: var(--control-sm);
  min-inline-size: var(--control-sm);
  padding: 0;
  border-radius: var(--r-pill);
  corner-shape: round;
}

/* The burger is the prototype's `#menu`, which is the same `.ico` as the other
   topbar controls, so it takes the same 30px circle. Its own rule above still
   decides WHETHER it shows. */
.shell__burger {
  inline-size: var(--control-sm);
  block-size: var(--control-sm);
  min-block-size: var(--control-sm);
  min-inline-size: var(--control-sm);
  padding: 0;
  border-radius: var(--r-pill);
  corner-shape: round;
}

/*
 * The org tree's expander, and the spacer a leaf row uses in its place.
 *
 * Both are exactly the same width, and that is the whole point: the generic .btn padding
 * made this 48px against a 28px spacer, so a leaf sat one indent level LEFT of its own
 * parent and the tree read inside-out. Measured on the rendered page, not guessed.
 *
 * 1.75rem keeps the hit target at 28px, above WCAG 2.5.8's 24px floor for a secondary
 * control.
 */
.tree-toggle,
.tree-spacer {
  inline-size: 1.75rem;
  min-inline-size: 1.75rem;
  block-size: 1.75rem;
  padding: 0;
  flex: 0 0 auto;
}

.tree-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/*
 * The faculty lens. Sits in the topbar beside the appearance and locale switches, because
 * like them it changes what the reader sees everywhere at once and has to stay visible
 * while they move between screens — a lens the reader cannot see is a lens they forget
 * they set, and then every list is inexplicably short.
 *
 * Bounded rather than sized: a Faculty name is short, but the select carries a whole
 * indented tree and an unbounded one would push the account menu off a narrow topbar.
 */
/*
 * Positioned, so the visually-hidden label inside resolves against THIS box and not the
 * initial containing block. The project's own component rules record why that matters: an
 * absolutely positioned hidden span with no positioned ancestor lands outside the viewport
 * and inflates document.documentElement.scrollWidth, which reads as a page-wide overflow
 * while everything visible sits inside it.
 */
.shell__scope {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* One width, not the widest option's. A select sizes itself to its longest option, and
   the first option is "the whole institution" in the reader's language, so a tenant whose
   unit names are shorter than that saw the lens change width with the language. */
.shell__scope select {
  inline-size: min(14rem, 28vw);
  min-inline-size: 0;
  padding-block: var(--space-1);
}

/* A branch manager's read-only lens. A branch name is free text with no upper bound, and a
   nowrap pill without one widens the topbar past a narrow screen — so it takes the same
   bound the select above takes, and ellipsises. */
.shell__scope-branch {
  max-inline-size: min(14rem, 28vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ⚠ HIDDEN ONLY WHILE IT IS DOING NOTHING, and the previous rule got that wrong in a
   way no screenshot shows. It hid the lens unconditionally below 60rem, on the stated
   grounds that "the lens is reachable from the structure screen" — it is not, and never
   was: `FacultyScopePicker` holds the only `setUnit` call in the app and renders in
   exactly one place, the topbar.

   The unit is persisted, so the state that produced was: a reader narrows to one faculty
   on a wide screen, returns on a phone, and every list in the workspace is silently short
   with no control anywhere to widen it and nothing on screen saying why. A filter that
   cannot be seen or cleared is worse than no filter.

   So the width still decides whether an IDLE lens takes up room, and an ACTIVE one is
   never hidden. `data-active` comes from the picker. */
@media (max-width: 60rem) {
  .shell__actions .shell__scope:not([data-active]) {
    display: none;
  }
}

/* Only on small screens; the grid needs no burger when both columns fit. */
.shell__burger {
  display: none;
}

/* THE RAIL TOGGLE (owner, 2026-09-29): a round glass button on the rail's edge that folds the
   sidebar away and brings it back - a real `.mat`, so it blurs and bends what is behind it like
   every other pane, with the showcase circle button's optics: a convex lens over a thin bezel.
   It is not inside any other glass (it is fixed on the page), so it may sample the backdrop. The
   chevron points the way the rail will move: left while it is open, right once it is folded. */

/* ON THE RAIL'S RIGHT EDGE, in the gutter between the rail and the page, level with the foot of
   the top bar - where the owner put it. Fixed, so it takes no grid cell in `.shell` and stays put
   while the page scrolls under the sticky rail. When the rail folds it follows it to the window's
   edge. */
.shell__railtoggle {
  position: fixed;
  z-index: calc(var(--z-sidebar) + 1);
  inset-block-start: calc(var(--shell-gutter) + var(--shell-topbar) - var(--control-sm) / 2);
  inset-inline-start: calc(
    var(--shell-gutter) + var(--shell-sidebar) + var(--shell-gutter) / 2 - var(--control-sm) / 2
  );
  display: inline-grid;
  place-items: center;
  flex: none;
  inline-size: var(--control-sm);
  block-size: var(--control-sm);
  padding: 0;
  border: 0;
  border-radius: var(--r-circle);
  /* A circle, not the material's squircle: at superellipse(4) a 50% radius is a rounded square. */
  corner-shape: round;
  color: var(--text);
  cursor: pointer;
  transition:
    background-color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out),
    inset-inline-start var(--dur-base) var(--ease-out);
}
/* `.shell` and `.mat--interactive` are in the selector for weight alone: the floating-pane rule
   above reaches every outermost glass surface, this one included, and would give a 30px button
   the 70px shadow of a card. */
[data-family="glass"] .shell .shell__railtoggle.mat.mat--interactive {
  --glass-profile: convex;
  /* A plain length, never a `var()` or a `calc()`: the refraction driver reads these with
     parseFloat, and an unresolved custom property parses as NaN and switches the lens off. */
  --glass-bezel: 8px;
  --glass-refract: 60px;
  --glass-thickness: 50px;
  --glass-shadow-2-y: var(--space-1);
  --glass-shadow-2-blur: var(--space-3);
  --glass-shadow-2-spread: 0px;
}
.shell[data-rail="closed"] .shell__railtoggle {
  inset-inline-start: var(--space-1);
}
.shell__railtoggle:active {
  transform: scale(0.94);
}
.shell__railtoggle svg {
  transform: rotate(180deg);
  transition: transform var(--dur-base) var(--ease-out);
}
.shell[data-rail="closed"] .shell__railtoggle svg {
  transform: rotate(0deg);
}

/* Folded: the rail's column goes to nothing and the page takes the width. The rail leaves the
   tab order and the accessibility tree with it (`visibility`), for the same reason the drawer
   does below. DESKTOP ONLY - under the drawer breakpoint the burger owns the rail, and a
   two-column grid there would squeeze the page. */
@media not all and (max-width: 60rem) {
  .shell {
    transition: grid-template-columns var(--dur-base) var(--ease-out);
  }
  .shell[data-rail="closed"] {
    grid-template-columns: 0 minmax(0, 1fr);
    column-gap: 0;
  }
  .shell[data-rail="closed"] .shell__sidebar {
    visibility: hidden;
    opacity: 0;
  }
}
@media (max-width: 60rem) {
  .shell__railtoggle {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .shell,
  .shell__railtoggle,
  .shell__railtoggle svg {
    transition: none;
  }
}

.shell__scrim {
  display: none;
}

.shell__main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 var(--space-1) var(--space-9);
  /* No max-width. The topbar above it has none, so capping only the column left
     the two of them ending at different places on a wide screen. A reading
     measure belongs on the prose block that needs one, not on the whole column. */
  width: 100%;
}

/* The landmark takes focus on every route change so a screen reader announces the new
   page (see `Shell`). It is not a control - nothing in it is operated by focusing it - so
   it draws no ring: the global focus-visible outline put a thick blue frame round the
   whole content area after every navigation (QA as a student, 2026-10-01). Every control
   inside keeps its own ring. */
.shell__main:focus {
  outline: none;
}

/* THE PAGE'S OWN BLOCKS KEEP A GAP BETWEEN THEM (owner, 2026-10-01).
   A screen lays its cards, tables, notes and filter bar straight into this column, which
   is ordinary block flow with no gap of its own - so two surfaces met edge to edge unless
   the first happened to carry a bottom margin. Measured across the workspace: a table
   flush on the card under it (advances, approval rules, expenses, award rules), finance's
   cards stacked with no air (overview, controls), the profile's and security's panels
   touching, and a note sitting on the payments filter bar.

   A top margin on the second of any two, in block flow, so it collapses with a bottom
   margin already there - the filter bar's 16px stays 16px rather than becoming 32. */
/* ⚠ NOT A DIALOG. A `<dialog class="modal mat">` renders inside `<main>`, so after any page
   panel it matched this rule and took a 16px top margin - which replaced the top layer's
   `margin: auto`, so every such dialog sat 16px under the top of the window instead of in the
   middle of it (measured 2026-10-04: the 717px "New student" sheet at top 16 in a 900px
   window, where centred is 91). */
.shell__main > :is(.mat, .mat-inset, .table-scroll, .alert, .empty-state, .filter-bar)
  + :is(.mat, .mat-inset, .table-scroll, .alert, .empty-state, .filter-bar):not(dialog) {
  margin-block-start: var(--space-4);
}

/* The live lesson page holds its card, its action row and four panel sections in one
   column, because a `.row` and a plain `.stack` are not in the rule above and met their
   neighbours edge to edge (owner, 2026-10-22). Same gap as the rule above. */
.live-detail {
  gap: var(--space-4);
}

/* ⚠ THE TOP BAR CASTS ONLY liqui's NEAR SHADOW, NOT ITS FULL ELEVATION. The bar is sticky
   and sits 24px above the page's first row, and liqui's elevated shadow is 0 24px 60px -
   so it fell squarely on that row. Measured 2026-10-04 on /students in dark mode: the
   "New student" button's fill rendered at rgb(8 112 218) instead of its #0A84FF, which took
   its dark label from 5.04:1 to 3.52:1, below AA; with the bar's shadow off the fill was
   exact again. A floating panel's long shadow belongs on the ground, and the bar's ground
   is the content. The near layer still lifts it off the page. */
[data-family="glass"] .shell__topbar {
  --lq-elevation: var(--lq-shadow-near);
}

/* --- the account menu ------------------------------------------------------ */

.accountmenu {
  position: relative;
}

.accountmenu__button {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  cursor: pointer;
}

.accountmenu__panel {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + var(--space-2));
  z-index: var(--z-dropdown);
  min-width: 14rem;
  /* Eleven items with the administration group. On a short window the menu scrolls
     inside itself rather than running off the bottom of the screen. */
  max-block-size: calc(100dvh - 5rem);
  overflow-y: auto;
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow:
    0 var(--solid-shadow-1-y) var(--solid-shadow-1-blur) rgb(var(--shadow-rgb) / var(--solid-shadow-1-alpha)),
    0 calc(var(--solid-shadow-2-y) * 2) calc(var(--solid-shadow-2-blur) * 2)
      rgb(var(--shadow-rgb) / calc(var(--solid-shadow-2-alpha) * 1.5));
}

.accountmenu__who {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-2) var(--space-3);
  min-width: 0;
}

.accountmenu__who span,
.accountmenu__who strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The fold over the administration items. Built like the side menu's group heads -
   label, count, chevron - so it reads as the same kind of thing, at item size. */
.accountmenu__group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  inline-size: 100%;
  min-height: 2.25rem;
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
}

.accountmenu__group:hover {
  background: var(--surface-2);
  color: var(--text);
}

.accountmenu__group[aria-expanded="true"] .navgroup__chevron {
  transform: rotate(180deg);
}

.accountmenu__items {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

/* WARNING: NEUTRAL, NOT RED (owner, 2026-10-15, design review #23). Signing out destroys nothing,
   and the danger role is for what does: it is the plain ghost button now, by intent. */
.accountmenu__signout {
  justify-content: flex-start;
}

/* A tutor's settings finder (2026-10-13): the account menu's own popup surface, hung from
   the top bar's edge rather than from its button, so a phone gives it the bar's width.
   Layout only - the surface, the rows and the field are the classes they already were. */
.finder__panel {
  inline-size: min(22rem, calc(100vw - var(--space-6)));
}

@media (max-width: 40rem) {
  .finder__word {
    display: none;
  }
}

/* The language list inside the account menu (audit TUT-30). Shown only below 60rem, where
   the topbar's own language button leaves the bar - see the small-screen block. */
.accountmenu__locale {
  display: none;
  flex-direction: column;
  gap: var(--space-1);
}

.accountmenu__heading {
  padding: var(--space-2) var(--space-3) 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.accountmenu__locale-item {
  inline-size: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: var(--text-sm);
  text-align: start;
}

/* --- small screens ---------------------------------------------------------
   The learner app is mobile-first, and the workspace is regularly opened on a phone by
   a teacher standing in a corridor. Below the breakpoint the sidebar becomes an
   off-canvas drawer rather than a horizontally scrolling strip: a strip of forty items
   is not a menu, it is a haystack.
   -------------------------------------------------------------------------- */

@media (max-width: 60rem) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  /* ⚠ `visibility`, NOT THE TRANSFORM ALONE. A transform moves the drawer off screen and
     changes nothing else about it: a closed drawer built only from `translateX` keeps the
     brand link, the filter box, every section head and the auto-opened section's items in
     the tab order and in the accessibility tree. Tabbing out of the topbar walked through
     the whole menu 102% off screen with the focus ring nowhere to be seen.

     `visibility` is the property that removes a subtree from both, and it is the one to
     use here rather than `display` because it animates: it interpolates as a step, so
     hidden -> visible flips at the start of the transition and visible -> hidden flips at
     the end, which is exactly the drawer's slide in each direction. It is therefore in the
     transition list at the same duration as the transform — omit it and the drawer would
     vanish before it had finished sliding out. */
  .shell__sidebar {
    position: fixed;
    /* The gutter, not the corner. Flush to 0 the drawer lost the 12px frame every
       other floating surface keeps, and `inset-block: 0` also overrode the height
       the base rule computes, leaving it 24px long at the foot. The longhand
       leaves `inset-block-end` alone so that height still applies. */
    inset-block-start: var(--shell-gutter);
    inset-inline-start: var(--shell-gutter);
    width: min(var(--shell-sidebar), 80vw);
    z-index: var(--z-drawer);
    transform: translateX(calc(-100% - var(--space-6)));
    visibility: hidden;
    transition:
      transform var(--dur-base) var(--ease-out),
      visibility var(--dur-base) var(--ease-out);
  }

  /* Logical-property aware: under a right-to-left document the drawer comes from the
     other side, and `translateX` would send it off the wrong edge. */
  [dir="rtl"] .shell__sidebar {
    transform: translateX(calc(100% + var(--space-6)));
  }

  .shell[data-drawer="open"] .shell__sidebar {
    transform: none;
    visibility: visible;
  }

  /* ⚠ A DRAWER OVER THE PAGE IS READ OVER THE PAGE, so its pane cannot be clear glass. As a
     rail beside the content the sidebar samples the scene; slid over the content it sampled
     the page's own text, and with the tint at zero that text read straight through the menu
     items. The tint is the surface colour here - the tokens keep their values, this surface
     simply asks for a thicker pane - and reduce-transparency still takes it fully opaque. */
  [data-family="glass"] .shell__sidebar {
    /* Kept under the liqui material (2026-10-03), deliberately: a drawer slides over the
       page's own TEXT, which the rail beside the content never does, and at 82% the words
       behind still showed. liqui has no drawer to copy; this is the guard for that case. */
    background-color: color-mix(
      in oklab,
      var(--surface-1) calc((0.9 + 0.1 * var(--a11y-reduce-transparency)) * 100%),
      transparent
    );
  }

  .shell__scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: var(--z-scrim);
    border: 0;
    padding: 0;
    /* The same ink AND the same strength the dialog backdrop uses. At 55 the wash
       was the only thing the drawer's own blur had left to average, so the glass
       read as paint - the note on `.modal::backdrop` records the same finding.
       The prototype's drawer carries no dim at all; this keeps one, because
       tapping it is how the drawer closes on a phone. */
    background: var(--scrim);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-base) var(--ease-out);
  }

  .shell[data-drawer="open"] .shell__scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .shell__burger {
    display: inline-flex;
  }

  .shell__topbar {
    padding-inline: var(--space-3);
  }

  .shell__main {
    padding: var(--space-4) var(--space-3);
  }

  /* The language button does not fit beside the bell, the appearance toggle and the
     account menu on a phone, so it leaves the bar there - and the language moves into
     the account menu instead, so it is still one tap away (audit TUT-30). */
  .shell__actions .locale-menu {
    display: none;
  }

  .accountmenu__locale {
    display: flex;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shell__sidebar,
  .shell__scrim,
  .navgroup__chevron {
    transition: none;
  }
}

/* A light/dark switch is not animated (design review #25): for the one frame the mode changes
   in, `ThemeProvider` sets this, so the rail's labels - which animate their colour for hover -
   take the new mode with everything else instead of 0.3s behind it. */
:root[data-mode-switching] *,
:root[data-mode-switching] *::before,
:root[data-mode-switching] *::after {
  transition: none !important;
}

/* --- odds and ends -------------------------------------------------------- */

/* 44px, not 34. At 34 over a 15px body the largest thing on the page was 2.3x
   the body size, which reads as bold body text rather than as display type - and
   it is the one place the prototype is loudest.

   `--text-display` rather than a flat 44: it clamps down to 34 on a narrow
   screen, which is the same step the prototype makes at its own 56rem
   breakpoint, and a flat 44 would put a long Azerbaijani route name over the
   edge of a 320px phone. Line height and `text-wrap: balance` already come from
   `h1..h4`, where `--leading-tight` is the prototype's 1.04 exactly. */
.page-title {
  font-size: var(--text-display);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-display);
  margin-bottom: var(--space-2);
}

/* 17px on a 56ch measure - the prototype's `.hero p`. It was falling through to
   the 15px body size across the full width of the container. */
.page-lede {
  color: var(--text-secondary);
  font-size: var(--text-md);
  max-width: var(--measure-lede);
  margin: 0 0 var(--space-6);
}

/* The language menu button. One control naming the language in use; its menu lists the
   three by their own names. The panel is `.menu__panel`, the opaque popup surface, and
   never a `.mat`: it opens inside chrome that already is the material. */
.locale-menu {
  position: relative;
  display: inline-flex;
}

.locale-menu__button {
  gap: var(--space-1);
  padding-inline: var(--space-2);
}

/* A floor, not the code's own width. AZ, EN and RU measured 16.6, 16.7 and 17.2px (2.4ch),
   so the button changed width with the language it names - in the landing header and
   footer and in the shell's topbar alike. 3ch holds the widest of the three. */
.locale-menu__code {
  min-inline-size: 3ch;
  text-align: center;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.locale-menu__chevron {
  transition: transform var(--dur-fast) var(--ease-out);
}

.locale-menu__button[aria-expanded="true"] .locale-menu__chevron {
  transform: rotate(180deg);
}

.locale-menu__panel {
  inset-inline-end: 0;
  top: calc(100% + var(--space-1));
  min-width: 11rem;
}

.locale-menu__panel[data-placement="above"] {
  top: auto;
  bottom: calc(100% + var(--space-1));
}

.locale-menu__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* The check keeps its space when hidden, so the three names stay on one left edge
   whichever of them is chosen. */
.locale-menu__check {
  flex: none;
  visibility: hidden;
}

.locale-menu__item[aria-checked="true"] {
  color: var(--brand-strong);
  font-weight: var(--weight-strong);
}

.locale-menu__item[aria-checked="true"] .locale-menu__check {
  visibility: visible;
}

/* A language's flag, left of its name, in the console's two language lists (`LocaleFlag`). One size for
   all three. The hairline is what keeps the white of a stripe from dissolving into a light
   menu; an outline rather than a border, so it costs no layout and sits on the flag's edge. */
.locale-flag {
  flex: none;
  inline-size: 18px;
  block-size: 12px;
  border-radius: var(--r-xs);
  object-fit: cover;
  outline: 1px solid var(--border);
  outline-offset: -1px;
}

.accountmenu__locale-item .locale-flag {
  margin-inline-end: var(--space-2);
}

@media (prefers-reduced-motion: reduce) {
  .locale-menu__chevron {
    transition: none;
  }
}

/* An empty state inside a table or a panel is a line of text in that panel. One
   on the page GROUND is the whole screen, and the material draws it as a surface
   there (see the ground-surface rules in `material.css`) rather than leaving a
   sentence floating on the scene with nothing under it.

   The min-height is the other half of that: a centred sentence pinned under the
   header with the rest of the viewport empty reads as a page that failed to
   load, not as a considered zero-state. */
.empty-state {
  padding: var(--space-8) var(--space-4);
  text-align: center;
  color: var(--text-secondary);
}

.empty-state:not(.mat *):not(.mat-inset *) {
  display: grid;
  place-content: center;
  min-block-size: 16rem;
}

/* An icon over the centred sentence sits on the sentence's axis (corporate test, 2026-11-11).
   `text-align` centres the lines but not an SVG, which as a grid or flex item keeps to the
   start of its track: the book on the empty courses page stood left of its text. */
.empty-state > svg {
  margin-inline: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* =============================================================================
   Academy — list, dialog and grid surfaces.

   Same rule as the rest of this file: tokens only. No literal colour, radius,
   blur, shadow or duration appears below.
   ========================================================================== */

/* --- page furniture -------------------------------------------------------- */

/* The prototype's `.hero` is `padding: var(--s7) 0 var(--s6)`. Those 32px above
   the title are the page's opening breath; without them a 44px display heading
   starts 12px under the topbar and the screen reads as clipped. It sits here
   rather than on `.shell__main` so a route that does not open with a page header
   keeps its own top edge. */
.page-head {
  padding-block-start: var(--space-7);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}

.page-head .page-lede {
  margin-bottom: 0;
}

/* No visible title. The 32px were breathing room for a 44px heading that is no longer
   drawn, so the actions sit at the end of a shorter row, and a header left with nothing
   to show takes no room at all. */
.page-head--quiet {
  justify-content: flex-end;
  padding-block-start: var(--space-4);
}

.page-head--quiet:not(:has(> .row)) {
  padding-block-start: 0;
  margin-bottom: 0;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: var(--space-3);
  border-radius: var(--r-md);
  margin-bottom: var(--space-4);
}

/* A note above the filters is its own block, not the bar's lid. `.alert` carries no margin of
   its own - it sits in forms and dialogs that space their children - so the three console
   screens that put a note straight above their filters (requests, sign-ins, search) had the
   two touching. The gap is the one the bar already keeps below itself. */
.alert + .filter-bar {
  margin-block-start: var(--space-4);
}

.filter-bar .field {
  width: auto;
  min-width: 10rem;
}

/* A filter that shares the row's leftover width instead of claiming 10rem of its own,
   so a bar with many filters stays on one line where it fits and still wraps where it
   does not. Declared after `.filter-bar .field` so it wins at equal specificity. */
.filter-bar .filter-bar__fill {
  flex: 1 1 8rem;
  min-width: 0;
}

/* Takes a triple share of the leftover width: a select whose longest option is long,
   so a selected long option is not cut off while short fields sit half empty. */
.filter-bar .filter-bar__fill--wide {
  flex-grow: 3;
}

/* As wide as its widest option and no wider - a select of three short words. */
.filter-bar .filter-bar__hug {
  flex: 0 0 auto;
  min-width: 0;
}

/* Filters and buttons on one row (owner, 2026-11-10): the pickers share what the buttons leave
   instead of holding their width, and the bar still wraps where the row is too narrow. */
.filter-bar--one-line .field {
  min-width: 0;
}

.filter-bar--one-line > .field,
.filter-bar--one-line > .combo {
  flex: 1 1 8rem;
  min-width: 0;
}

/* One question's points on the exam paper: a few digits. */
.paper-points {
  inline-size: 5rem;
  flex: 0 0 auto;
}

/* An independent teacher's paper row, which a drag or its two buttons re-place (test builder,
   2026-11-12). The row runs to a second line before its words are squeezed out: on a phone the
   handle and the words keep the first line and the controls go under them. The states are the
   question maker's card's own: faded while it is carried, marked where it would land. */
.paper-entry {
  border-radius: var(--r-sm);
  transition: opacity var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}

.paper-entry[data-dragging] {
  opacity: var(--opacity-muted);
}

.paper-entry[data-over] {
  background: var(--brand-subtle);
}

/* The row the check before a print points at takes focus from a script, which `:focus-visible`
   does not always follow after a click; it is marked instead, and the ring is the app's own. */
.paper-entry[data-located] {
  outline: var(--focus-ring-width) solid var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
}

/* The controls are one group: beside the words where there is room, under them whole where
   there is not. The tighter gap is what lets all five share that one line at 320px. */
.paper-entry__row {
  flex-wrap: wrap;
  gap: var(--space-2);
}

.paper-entry__row > .grow {
  flex-basis: 10rem;
  overflow-wrap: anywhere;
}

.paper-entry__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  min-inline-size: 0;
  max-inline-size: 100%;
}

.paper-entry__grip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-inline-size: var(--target-min);
  min-block-size: var(--target-min);
  color: var(--text-secondary);
  cursor: grab;
  touch-action: none;
}

/* One finding of the check before a print: its words, and the way to its question beside them
   or, in a narrow dialog, under them. */
.print-check__item > .grow {
  flex-basis: 10rem;
}

.print-check__name {
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .paper-entry {
    transition: none;
  }
}

/* One exam in the merged-results order (`/results/merge`). Its title asks for a readable line of
   its own before it shares one: in a wrapping row a bare `.grow` gave way to the three buttons
   first, and at 320px the title stood three letters a line beside them (measured, 2026-11-12).
   With a basis the buttons go under the title on a phone, and a wide screen keeps one line. */
.merge-order__title {
  flex: 1 1 12rem;
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

/* The editor's cell in the answer-key table (results page, `?view=key`). The pickers of a matching
   or a statement key size to nothing of their own, so the column took 210px of a 950px table and
   every chosen answer read "Azərba..." (measured, 2026-11-12). The floor applies only where the
   table is a table: at 64rem and under each cell is a full-width block and needs none. */
@media not all and (max-width: 64rem) {
  .key-cell {
    min-inline-size: 18rem;
  }
}

/* Two dates as one control: from, a dash, to. No caption above either, so the pair is
   exactly as tall as every other control in the bar. */
.date-range {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  /* Still one control wherever it fits. On a phone the pair was wider than the screen and
     held the page at 472px (tutor device test, row 24): it may now shrink to its line, and
     the second date drops under the first rather than past the edge. */
  flex: 0 1 auto;
  flex-wrap: wrap;
  min-inline-size: 0;
}

.filter-bar .date-range .field {
  min-width: 0;
}

/* A captioned date in a filter bar ("Tarixdən" on Canlı dərs) is a `.form-field`, a flex
   item that kept `min-width: auto` and so the width of its caption, box and calendar button:
   246px on a 244px line at 280px and a 125% text size (tutor device test, row 47). It may now
   take the line's width; the box inside it still fits. */
.filter-bar > .form-field {
  min-inline-size: 0;
  max-inline-size: 100%;
}

/* An open "i" panel has to paint over what follows. A glass surface is its own stacking
   context (`isolation: isolate`), so a panel inside it was measured UNDER the table
   right after the filter bar. The surface holding an open panel is lifted for as long
   as the panel is open;
   `.mat` is already positioned - and may be sticky - so it only takes the z-index. */
.mat:has(.info-tip__panel) {
  z-index: var(--z-dropdown);
}

:is(.mat-inset, .table-scroll, .empty-state):has(.info-tip__panel) {
  position: relative;
  z-index: var(--z-dropdown);
}

/* A heading with an "i" button beside it. Tighter than `.row`, because the button
   belongs to the heading rather than standing next to it as a separate control. */
.info-heading {
  gap: var(--space-1);
}

.info-tip {
  position: relative;
  display: inline-flex;
  /* Only matters when a badge stands beside the "i" (D2); the panel is out of flow. */
  align-items: center;
  gap: var(--space-1);
}

/* 28px square: past the 24px target minimum, small enough to sit on a label line. The
   states come from `.btn .btn--ghost`; only the box is restated here. */
.info-tip__button {
  inline-size: 1.75rem;
  block-size: 1.75rem;
  min-height: 0;
  padding: 0;
  color: var(--text-secondary);
}

.info-tip__button[aria-expanded="true"] {
  color: var(--text);
}

/* A note about a limit or a refusal (D2, D7): the "i" wears the feedback role's text step,
   which the theme already measured against the surfaces it lands on. */
.info-tip__button--warning,
.info-tip__button--warning[aria-expanded="true"] {
  color: var(--warning-strong);
}

.info-tip__button--danger,
.info-tip__button--danger[aria-expanded="true"] {
  color: var(--danger-strong);
}

/* Positioned, so the visually hidden label inside resolves against this box and the
   attention ring below has something to sit on. */
.info-tip__badge {
  position: relative;
  font-variant-numeric: tabular-nums;
}

/* ATTENTION: A RING THAT GROWS AND FADES, NOT A BLINK. Opacity on the text itself would dip
   its contrast twice a second; the ring is a separate layer, so the figure and the "i" stay
   at full strength. Timed by the motion tokens, so `--motion-scale: 0` stops it, and only
   drawn at all when the reader has not asked for reduced motion. */
.attention-pulse {
  position: relative;
}

.attention-pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid currentColor;
  border-radius: var(--r-pill);
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .attention-pulse::after {
    animation: attention-pulse calc(var(--dur-slow) * 4) var(--ease-out) infinite;
  }
}

@keyframes attention-pulse {
  0% {
    opacity: 0.6;
    scale: 1;
  }
  70%,
  100% {
    opacity: 0;
    scale: 1.35;
  }
}

/* The same opaque popup surface as `.menu__panel`, never glass: it opens inside panels
   that already are the material. Capped so a long sentence wraps rather than running
   past a narrow screen. */
.info-tip__panel {
  position: absolute;
  top: calc(100% + var(--space-1));
  inset-inline-start: 0;
  z-index: var(--z-dropdown);
  inline-size: max-content;
  max-inline-size: min(28rem, calc(100vw - 2rem));
  /* Set by InfoTip on opening, to pull the panel back inside the viewport. */
  translate: var(--info-tip-shift, 0px) 0;
  padding: var(--space-3);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: normal;
  line-height: 1.5;
  white-space: normal;
  box-shadow:
    0 var(--solid-shadow-1-y) var(--solid-shadow-1-blur) rgb(var(--shadow-rgb) / var(--solid-shadow-1-alpha)),
    0 calc(var(--solid-shadow-2-y) * 2) calc(var(--solid-shadow-2-blur) * 2)
      rgb(var(--shadow-rgb) / calc(var(--solid-shadow-2-alpha) * 1.5));
}

/* The page's own buttons on the filters' row. `auto` pushes them to the far end of
   whichever line they land on, so when the bar wraps on a narrow screen they still
   end the row rather than trailing the last filter. */
.filter-bar__actions {
  display: flex;
  align-items: center;
  /* ⚠ WRAPS, AND MAY SHRINK. Without these two lines the actions kept one line whatever the
     width: measured 2026-10-04 at 390px, the students page's two buttons made the box 398px
     wide and the whole page scrolled sideways by 59px - the "New student" button could only
     be reached by dragging the page. */
  flex-wrap: wrap;
  justify-content: flex-end;
  min-inline-size: 0;
  max-inline-size: 100%;
  gap: var(--space-2);
  margin-inline-start: auto;
}

/* The page's own controls and its daily filters on one line: a search box, two
   pickers and the two buttons. Wraps rather than overflowing, and the search box is
   the one thing allowed to grow. */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
}

/* A pill that holds a glyph and a control. The border and the background belong to
   the wrapper; the control inside draws neither, so the two read as one object. Every
   value here is the token the plain field already used - this is shape, not colour. */
.toolbar__control {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding-inline: var(--space-3);
  min-height: var(--control-md);
  border: 1px solid var(--control-border);
  border-radius: var(--r-pill);
  background: var(--surface-1);
  color: var(--text-tertiary);
  /* A flex item keeps `min-width: auto`, and the picker inside it is as wide as its longest
     option, so at a 125% text size the role pill ran 2px past a 320px screen and 42px past
     a 280px one (tutor device test, row 47). It may now shrink to the row; the field inside
     already may. */
  min-inline-size: 0;
  max-inline-size: 100%;
}

/* A pill's list is never narrower than its words (owner, 2026-11-16). The list takes the width of
   the field inside the pill, and in a "Kim yazıb: Hamısı" pill that field is a few characters
   wide: the options were cut to "Keçməy..." under a sideways scrollbar. Still never past the
   window's edge. */
.toolbar__control .combo__list {
  min-inline-size: max-content;
  max-inline-size: calc(100vw - var(--space-4) * 2);
  overflow-x: hidden;
}

/* The wrapper carries the ring for the field inside it (the field's own is
   suppressed below), so it is a FIELD indicator and takes the field's token. */
.toolbar__control:focus-within {
  border-color: var(--field-focus-ring);
}

/* WARNING: AND THE RING ITSELF (design review #1, 2026-10-15). The field inside drops its own
   outline below, and the border change above was all that was left: measured on
   İstifadəçilər, the three filters took keyboard focus with no visible change at all, while
   every other list draws the 2px ring. The pill draws the same ring the global rule gives
   every other field, from the same tokens, whenever the control inside it has keyboard
   focus. WCAG 2.4.7. */
.toolbar__control:has(:is(input, select):focus-visible) {
  outline: var(--focus-ring-width) solid var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
}

.toolbar__control .field {
  width: auto;
  min-width: 0;
  padding-inline: 0;
  border: 0;
  background: transparent;
  /* The glass family gives every field an inset highlight; inside the pill that drew a
     second rounded box within the first (owner, 2026-10-07). The pill is the one edge. */
  box-shadow: none;
  color: var(--text);
}

/* AND ITS OWN GLASS (owner, 2026-10-19). The glass family also gives every field a
   backdrop filter and a rounded corner, so inside the pill the field still drew a blurred
   12px box that began after the icon: the icon sat on one plane and the words on another.
   Glass cannot sample glass, and the pill is the one surface here. */
[data-family="glass"] .toolbar__control .field {
  backdrop-filter: none;
  border-radius: 0;
}

/* The wrapper already carries the ring, so the control inside must not draw a second. */
.toolbar__control .field:focus-visible {
  outline: none;
  box-shadow: none;
}

.toolbar__control--search {
  flex: 1 1 12rem;
  max-inline-size: 18rem;
}

.toolbar__control--search .field {
  flex: 1;
}

/* The same pill on the buttons beside them, so one row reads as one set of controls. */
.btn--pill {
  border-radius: var(--r-pill);
}

/* --- the filter card ------------------------------------------------------
   One rounded card holding the row of controls and the panel it opens, which is
   how the owner drew it. Every colour is a token that was already here; what is
   new is the framing.
   -------------------------------------------------------------------------- */

.people-filters {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  margin-bottom: var(--space-4);
}

/* The row starts at the left edge of the card and the two page buttons ride at its
   right, so the card reads as one line of controls rather than as two groups. */
.people-filters .toolbar {
  justify-content: flex-start;
}

/* The panel the disclosure opens: its own card inside the first one. */
.people-filters__panel {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
}

/* Its header is a header that happens to close the panel - not a button pretending
   to be one, which is what the ghost style made it look like. */
.people-filters__panel-head {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: var(--weight-medium);
  cursor: pointer;
}

.people-filters__panel-head > :last-child {
  margin-inline-start: auto;
  color: var(--text-tertiary);
}

/* A filled dot, which no stroke-only glyph can be. */
.toolbar__dot {
  inline-size: 0.75em;
  block-size: 0.75em;
  border-radius: var(--r-pill);
  background: currentColor;
  flex: none;
}

/* The picker's own arrow is turned off so the chevron sits where it was drawn, with
   space at the pill's right edge. */
.toolbar__control select.field {
  appearance: none;
  padding-inline-end: var(--space-1);

  /* ⚠ THE OPEN LIST TAKES THE SELECT'S OWN BACKGROUND, and `transparent` falls back to
     white in Chromium - which drew the options as near-white text on white, unreadable.
     The pill behind it is already `--surface-1`, so naming that colour here changes
     nothing on screen and gives the popup a surface of its own to draw on. */
  background-color: var(--surface-1);
}

/* The rows of the open list, which are drawn by the platform and inherit nothing else. */
.toolbar__control select.field option {
  background-color: var(--surface-1);
  color: var(--text);
}

.toolbar__chevron {
  color: var(--text-tertiary);
  flex: none;
}

/* ⚠ ONE ARROW, NOT TWO. On a mouse the picker in the pill is the searchable combobox, which
   draws its own chevron - and this one sat beside it, so the pill read "Teacher v v". The
   pill's own is for the native select a touch screen keeps, whose arrow is turned off
   above; where the combobox is present, its chevron is the one that stays, because the
   filter's reset is placed against it. */
.toolbar__control:has(.combo) .toolbar__chevron {
  display: none;
}

/* The pill already pads its edge, so the combobox's chevron moves to the combobox's own
   edge - where the pill's chevron was drawn - and the reset and the text keep their
   distances from it. */
.toolbar__control .combo__chevron {
  inset-inline-end: 0;
}

.toolbar__control .combo__clear {
  inset-inline-end: calc(1em + var(--space-1));
}

.toolbar__control .combo__field {
  padding-inline-end: calc(1em + var(--space-2));
}

.toolbar__control .combo--clearable .combo__field {
  padding-inline-end: calc(1em + var(--space-2) + var(--control-xs));
}

/* --- an exam's results: the toolbar over the roster, and its rows -----------
   "Çox qarışıqdır" (owner, 2026-11-14): the filters were a framed box of captioned fields in
   three bands, and one row of the roster stood about 240px tall. The toolbar is two lines on
   the page ground, made of the `.toolbar__control` pill and the `.chip` row above at the small
   control height; a row is the name over one quiet line. Every value is a token already here.
   -------------------------------------------------------------------------- */

.results-toolbar {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-block-end: var(--space-4);
}

.results-toolbar__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  min-inline-size: 0;
}

/* The small control height, which still clears the 24px target. */
.results-toolbar .toolbar__control {
  min-block-size: var(--control-sm);
  font-size: var(--text-sm);
}

/* The control fills its pill's height, so the pill and not a strip inside it is the target. */
.results-toolbar .toolbar__control .field,
.results-toolbar .toolbar__control > :is(.combo, .select-clear) {
  min-block-size: 0;
  align-self: stretch;
}

/* A picker in a pill is as wide as what it shows, not the twenty characters an input keeps
   (narrow-width defence 1). Where `field-sizing` is not known the cap keeps the old width. */
.results-toolbar .toolbar__control :is(.combo__field, select.field) {
  field-sizing: content;
  min-inline-size: 4ch;
  max-inline-size: 14rem;
}

/* The room for a picker's own reset is kept only while the reset is there. The pill is as wide
   as its choice, so it moves with the choice anyway, and a held gap made every unset picker look
   half empty. The touch path's native select likewise; its reset sits at the select's own end. */
.results-toolbar .combo--clearable:not(:has(.combo__clear)) .combo__field {
  padding-inline-end: calc(1em + var(--space-2));
}

.results-toolbar .select-clear select.select-clear__field {
  padding-inline-end: var(--space-1);
}

.results-toolbar .select-clear:has(.select-clear__button) select.select-clear__field {
  padding-inline-end: calc(var(--control-xs) + var(--space-1));
}

.results-toolbar .toolbar__control .select-clear__button {
  inset-inline-end: 0;
}

/* The picker's own name inside its pill: "Nəticə:" before the choice, quieter than it. */
.results-toolbar__name {
  flex: none;
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
}

/* The order's direction, inside the order's pill: one target-sized button at its end. */
.results-toolbar__direction.icon-btn {
  inline-size: var(--control-xs);
  block-size: var(--control-xs);
  margin-inline-end: calc(-1 * var(--space-2));
}

/* A picker and the "i" that explains it wrap as one. */
.results-toolbar__pair {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-inline-size: 0;
  max-inline-size: 100%;
}

.results-toolbar__status {
  gap: var(--space-1);
}

.results-toolbar__status > .chip {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--control-sm);
}

/* A status nobody is in: the same chip, quieter, still a control with every state. The text
   stays on `--text-tertiary`, which is chosen to clear 4.5:1 on the worst surface. */
.results-toolbar__status > .chip[data-empty]:not([aria-pressed="true"]):not(:hover) {
  color: var(--text-tertiary);
  border-color: var(--border-subtle);
}

/* How much of the cohort is shown, at the far end of the pickers' line. */
.results-toolbar__summary {
  margin-block: 0;
  margin-inline-start: auto;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* The rarely used half, under the two lines. Its fields keep the width the bar gave them. */
.results-toolbar__more {
  padding-block-start: var(--space-2);
}

.results-toolbar__more .field {
  inline-size: auto;
  min-inline-size: 10rem;
}

/* The same small height as the two lines above it. */
.results-toolbar__more :is(.field, .datefield__open) {
  min-block-size: var(--control-sm);
}

/* Two percentages of up to three digits: side by side even on a phone. */
.results-toolbar__more input[type="number"].field {
  inline-size: 8rem;
  min-inline-size: 0;
}

/* A note above the rows - the roster's refusal, the ceiling, a copied code - keeps air under it. */
.results-toolbar ~ .alert + .results-roster {
  margin-block-start: var(--space-3);
}

.results-roster > .alert {
  margin-block: 0 var(--space-3);
}

.results-roster__scrolls {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-block: 0 var(--space-2);
}

/* A row is two lines of text; the cell's own padding is the space-scale step below, which also
   keeps eleven figure columns from pushing the last ones further off a laptop's screen. */
.results-roster .table :is(th, td) {
  padding-inline: var(--space-2);
}

.results-roster .table td {
  padding-block: var(--space-2);
}

/* The name's cell. A floor under it, so a normal name is never broken a letter a line beside
   eleven figure columns; no ceiling but the name's own. */
.result-who {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-inline-size: 20rem;
}

.result-who__line {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-inline-size: 0;
}

/* One line, cut only when it is longer than a name is. The whole name is the element's text,
   for a screen reader, and its tooltip, for a pointer. */
.result-who__name {
  min-inline-size: 0;
  max-inline-size: 20rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: var(--weight-strong);
  color: var(--text);
}

/* The result code: a quiet mono chip at the line's end, with its copy button inside. Positioned,
   because the caption in it is visually hidden and this table scrolls sideways (narrow-width
   defence 5): with no positioned ancestor it would resolve against the page. */
.result-who__code {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-inline-start: auto;
}

.result-who__code .icon-btn {
  inline-size: var(--control-xs);
  block-size: var(--control-xs);
}

/* The quiet line. It contains its own width, so a long address never widens the column: the
   column is as wide as the name's line, and the address takes what is left and ends in an
   ellipsis there. */
.result-who__meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-inline-size: 0;
  overflow: hidden;
  contain: inline-size;
  font-size: var(--text-xs);
  font-weight: var(--weight-body);
  color: var(--text-secondary);
  white-space: nowrap;
}

.result-who__meta > * {
  flex: none;
}

.result-who__sep {
  color: var(--text-tertiary);
}

.result-who__meta > .result-who__mail {
  flex: 0 1 auto;
  min-inline-size: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-who__flag {
  font-weight: var(--weight-body);
}

/* "14 / 15 · 93,33%" and the verdict beside it; the verdict goes under only when the column is
   narrower than both. */
.result-score {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-1) var(--space-2);
}

.result-status {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
}

/* A phone: each attempt is a card (`DataTable stackOnNarrow`). The person, the status, the result
   and the erase button take whole lines; the figures share a grid under them, a caption over
   each, instead of eleven lines one under another. */
@media (max-width: 40rem) {
  .results-toolbar__search {
    max-inline-size: none;
  }

  .results-roster .meetings-list .table tr {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 5rem), 1fr));
    gap: 0 var(--space-3);
  }

  .results-roster .meetings-list .table td:first-child,
  .results-roster .meetings-list .table td:has(> .result-status),
  .results-roster .meetings-list .table td:has(> .result-score),
  .results-roster .meetings-list .table td:has(> .btn) {
    grid-column: 1 / -1;
  }

  /* The status and the result read as one line each, the caption before the value. */
  .results-roster .meetings-list .table td:is(:has(> .result-status), :has(> .result-score)) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1) var(--space-2);
  }

  .results-roster .meetings-list .table td > .section-scores {
    flex-basis: 100%;
  }

  /* A figure's cell keeps its value on one line, but its caption wraps: "Başlanğıcdan təhvilə" on
     one line ran 23px out of a third of the card and made the whole list scroll sideways. */
  .results-roster .meetings-list .table td > .journal-cell__label {
    white-space: normal;
  }

  .results-roster .result-who {
    min-inline-size: 0;
  }

  /* The card has the height the row did not: the code drops under a long name, and the address
     takes a line of its own before it is cut. */
  .results-roster :is(.result-who__line, .result-who__meta) {
    flex-wrap: wrap;
  }

  .results-roster .result-score {
    justify-content: flex-start;
  }
}

/* The disclosure's own header: an icon, its name, and the chevron that closes it. */
.filter-bar__title {
  flex-basis: 100%;
  justify-content: flex-start;
  padding-inline: 0;
}

/* --- a filter bar that says what each control is ---------------------------
   Eight controls in one band with no captions read as clutter: the chips kept
   their group name in `aria-label` alone, so a sighted reader saw five nameless
   pills beside three more, and two date boxes read as "mm/dd/yyyy" twice.
   -------------------------------------------------------------------------- */

.filter-bar--grouped {
  align-items: flex-end;
  row-gap: var(--space-4);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-inline-size: 0;
}

.filter-group__label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
}

/* A row of controls that carries no caption of its own - the disclosure and the
   clear action, which sit on the same baseline as the labelled groups. */
.filter-group__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

/* The rarely-used half takes its own line rather than wedging between groups. */
.filter-bar__more {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3);
}

/* Two facts in one cell, the second quieter: the address under the name it
   identifies, the branch under the units. Five columns became two this way, which
   is what stopped the table scrolling sideways. */
.cell-person {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  /* A long name or address breaks instead of setting the column's width: one long e-mail
     made the people table 979px in 720px (tutor device re-test 2026-10-29). */
  overflow-wrap: anywhere;
}

.cell-person__name {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* --- tables ---------------------------------------------------------------
   Wide content scrolls inside its own box; the page body never scrolls sideways.
   -------------------------------------------------------------------------- */

/* A LIST LIVES IN A PANEL. Every list in the prototype sits inside a glass card;
   in the product the rows were laid straight onto the scene, so a table was the
   one region of a page with no surface under it. The material draws it as one
   when it stands on the page ground and leaves it plain when it is already
   inside a panel - the same `:not(.mat *)` guard every other ground surface
   uses, so a table can never end up as glass inside glass. */
.table-scroll {
  overflow-x: auto;
  border-radius: var(--r-md);
}

.table-scroll:not(.mat *):not(.mat-inset *) {
  padding: var(--space-5);
}

/* THE EDGE CUE (composition rule 7). `TableScroll` wraps the scroller in this frame and
   marks which edge has more content behind it; the frame shades that edge. It is drawn
   here rather than on the scroller because on the page ground the scroller is glass, and
   the material owns its pseudo-elements, background and shadow. The shade fades in and
   out with the scroll position, so a table that fits draws nothing at all. */
.table-frame {
  position: relative;
}

.table-frame::before,
.table-frame::after {
  content: "";
  position: absolute;
  inset-block: 0;
  inline-size: var(--space-8);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
  z-index: 1;
}

.table-frame::before {
  inset-inline-start: 0;
  border-start-start-radius: var(--r-md);
  border-end-start-radius: var(--r-md);
  background: linear-gradient(to right, var(--scrim), var(--scrim) 20%, transparent);
}

.table-frame::after {
  inset-inline-end: 0;
  border-start-end-radius: var(--r-md);
  border-end-end-radius: var(--r-md);
  background: linear-gradient(to left, var(--scrim), var(--scrim) 20%, transparent);
}

.table-frame[data-more-start]::before,
.table-frame[data-more-end]::after {
  opacity: 1;
}

@media print {
  .table-frame::before,
  .table-frame::after {
    display: none;
  }
}

.table .numeric {
  text-align: end;
  font-variant-numeric: tabular-nums;
}

/* A second line under a cell's own value — the guardian under a payer, what an invoice
   is for under its payer. A sub-line rather than another column on purpose: `.table-scroll`
   scrolls sideways with no edge cue, so every column added is one a sighted reader can
   lose. Truncated because the text behind it can be long (an invoice description is
   capped at 1000 server-side) and an untruncated line would open the column up. `ch`
   with `min()` so it stays responsive rather than pinned. */
.table .cell-sub {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  max-inline-size: min(32ch, 100%);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Except the address under a person's name. A `nowrap` line counts at its full length toward
   the column's minimum - the `100%` cap cannot apply while the column is still being sized -
   so one long e-mail made the people table 939px in 716px (tutor device re-test 2026-10-29).
   The address wraps instead, and is shown whole. */
.table .cell-person > .cell-sub {
  white-space: normal;
}

/* THE TEACHER'S PACKAGES FIT THEIR CARD (audit 2026-11-14, finding 36). `.numeric` keeps a figure
   on one line, and on this table it kept the four limits' headings on one line as well - "Sual
   hazırlayıcı ilə suallar (ay)" alone is 196px - so at a 1280px window the table was wider than its
   card and scrolled sideways: measured 942px in 932px in Azerbaijani, 1036px in English and 1179px in
   Russian. The headings wrap, balanced, and the figures under them stay whole: 932px in all three. */
.teacher-packages .table th.numeric {
  white-space: normal;
  text-wrap: balance;
}

.table__state {
  text-align: center;
  color: var(--text-secondary);
  padding: var(--space-6) var(--space-4);
}

/* `DataTable`'s loading and empty sentence, a block under the table (tutor device test
   2026-10-29, row 29): as wide as the scroller's box, pinned to its start so a sideways
   scroll of the bare headings cannot carry it off, and wrapping wherever it must. */
.table-scroll > .table__state {
  margin: 0;
  position: sticky;
  inset-inline-start: 0;
  overflow-wrap: anywhere;
}

.table__row--clickable {
  cursor: pointer;
}

.table__row--clickable:hover {
  background: var(--surface-2);
}

.table__row--clickable:focus-visible {
  outline: var(--focus-ring-width) solid var(--brand);
  outline-offset: calc(var(--focus-ring-offset) * -1);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  flex-wrap: wrap;
}

/* --- dialogs --------------------------------------------------------------- */

/* The dialog is a `.mat` - the class is on the element, so the material, its rim,
   its shadow and its reduce-transparency behaviour are the theme's rather than
   this file's. What stays here is the geometry, and the offset that dragging
   writes: `<dialog>` is centred by the top layer, so a translate composes with
   that instead of re-doing it. */
/* THINNER GLASS, NOT THICKER. `data-level="2"` was raising the dialog's tint to
   0.68 - by far the densest surface in the product - when the prototype's sheet
   is 0.10 in the dark and 0.42 in the light. It can be that transparent because
   the scrim beneath it is already doing the separating. */
.modal {
  /* ⚠ FIXED, BECAUSE DRAGGING IT GREW THE PAGE. A modal `<dialog>` computes
     `position: absolute` from the UA sheet even while it is `:modal`, and an absolutely
     positioned box that is translated downward adds its new bottom edge to the DOCUMENT'S
     scrollable area. Measured on the meetings dialog: with `--modal-y: 300px` the document
     went from 698px to 907px tall and the page gained 209px of scroll - exactly the 300
     minus the 91px of room under the dialog - and `--modal-x: 300px` widened it from 774
     to 900 and raised a horizontal scrollbar. The same drag with this line present leaves
     the document at 698. The centring is the UA's `inset: 0; margin: auto`, which fixed
     positioning keeps; what it loses is the page growth. */
  position: fixed;
  --glass-tint-alpha: var(--glass-tint-alpha-sheet);
  /* And not an elevation step either. The ladder multiplies the tint, and the
     `data-level="2"` this element carries would double the sheet's 0.10 to 0.20. */
  --glass-tint-step: 1;
  /* ⚠ liqui's DIALOG (owner, 2026-10-03), the material approved in the glass prototype.
     The values liqui gives its largest panels (`sections/signup.tsx`): a 28px radius, and a
     lens of refraction 140 over a 28px bezel. The blur, the saturation and the specular arc
     are the theme knobs' (5.9, 170%, 0.7) - the dialog no longer carries optics of its own,
     and in the default frost tier there is no lens and no arc at all.

     This undoes three earlier decisions, which the owner made in turn and has now replaced
     with "make it exactly like the prototype": no specular line on the dialog (2026-09-29),
     square corners (2026-10-01, on trial), and the thick-glass slab with drawn bevels
     (2026-10-01, already taken back on 2026-10-03). */
  --glass-thickness: 110px;
  --glass-bezel: 28px;
  --glass-refract: 140px;
  border-radius: var(--r-xl);
  color: var(--text);
  padding: 0;
  /* 48rem is 768px at a 16px root, and it replaced the prototype's 440: on a desktop
     window a 440px sheet reads as a phone dialog that wandered onto a monitor, which is
     what the owner asked to end (2026-09-27). The two-column dialogs keep their own
     `.modal--wide` above it, so the two sizes still say something different.

     `min()` is what keeps this honest on a small screen: below 768 + gutters the sheet is
     the viewport minus its margins, exactly as it was, so nothing about the phone layout
     moves. The gutter is reserved on BOTH sides: the prototype's scrim centred the sheet
     inside `padding: var(--s6)`, so 24px stands on each edge, not 12. */
  width: min(48rem, calc(100vw - var(--space-6) * 2));
  max-height: calc(100dvh - var(--space-6) * 2);
  translate: var(--modal-x, 0) var(--modal-y, 0);
  /* ROUNDED BY A CLIP, NOT ONLY BY THE RADIUS. In dark glass the sheet showed square
     corners outside its own 28px rim: the dialog is a transformed top-layer box whose
     backdrop sample runs through the refraction lens, and Chromium painted that sample
     to the rectangle instead of the rounded box. A clip on the same radius removes the
     corners whatever the backdrop does. The cost is the outer drop shadow, which the
     scrim behind a modal already does the job of. */
  /* No clip with square corners: it existed to round the backdrop sample, and it also cut
     away every outer shadow - which the thick-glass slab below needs. */
  clip-path: none;
  /* ⚠ A CIRCULAR CORNER, ON PURPOSE, AND IT IS WHAT MAKES THE CLIP ABOVE HONEST. Every other surface
     is drawn with `corner-shape: superellipse(4)`, whose corner lies almost on the box corner - 0.04r
     from it along the diagonal against a circle's 0.29r. The clip is a CIRCLE, so on a squircle sheet
     it sliced a wedge off each corner and took the rim with it, and what the owner approved as this
     dialog's rounded look was that slice. Making the sheet itself circular keeps the look and puts the
     element, its hairline, the specular line, the lens and the clip on one curve. The driver reads
     this value and builds its maps on the same curve. */
  corner-shape: round;
}


/* ⚠ THE 82% FILL IS GONE (owner, 2026-10-03), and it is worth knowing what it was for. It
   was added on 2026-10-01 because, with the sheet's tint at zero, a dialog opened over
   another dialog let the first one's title read through the second one's fields - measured
   still legible at 55%. The dialog now carries liqui's tint (about 25% to 7% white in light,
   32% to 20% of a dark tone in dark) under liqui's FROST blur by default - 11.8px, twice
   what the sheet had when that was measured - which is what turns the page behind into a
   soft field of colour. If a stacked dialog ever reads through again, the lever is
   `--lq-tier` on the inner `.modal`, not a return to the paper-white fill. */

/* --- the dialog's edge and depth --------------------------------------------------------
   liqui's, from material.css: the one-pixel catch-light rim and, because the dialog carries
   `data-level="2"`, liqui's elevated shadow. Nothing here overrides `box-shadow` any more -
   an override in this layer is what kept the drawn slab bevels on top of the material. The
   light-mode block that tuned those bevels went with them. */

@media (forced-colors: active) {
  [data-family="glass"] .modal {
    box-shadow: none;
  }
}

/* THE ANSWER TO A CLICK ON THE BACKDROP, and the whole of it: two swings and a settle,
   240ms, which is inside the 100-300ms this system allows itself. It is `transform` and
   not `translate`, because `translate` is where the drag offset lives - animating the
   other property leaves a dragged dialog where the reader put it.

   Nothing here closes the dialog: 99 of the 128 dialogs in this app hold a field, and a
   stray click must not throw away what is in one. `Modal.tsx` carries that decision. */
@keyframes modal-nudge {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-6px);
  }
  45% {
    transform: translateX(5px);
  }
  70% {
    transform: translateX(-3px);
  }
  90% {
    transform: translateX(1px);
  }
}

.modal[data-nudge] {
  animation: modal-nudge var(--dur-base) var(--ease-in-out);
}

@media (prefers-reduced-motion: reduce) {
  /* The duration is already zero through `--motion-scale`; this says so outright, because
     a nudge is movement across the visual field and that is the one thing this query is
     for. The focus return in `Modal.tsx` is what carries the message here. */
  .modal[data-nudge] {
    animation: none;
  }
}

.modal--wide {
  width: min(56rem, calc(100vw - var(--space-6) * 2));
}

/* THE WHOLE WINDOW (owner, 2026-11-12: "bizdə pdf modalda açılır, tam pəncərədə açılsın"). The
   crop tool's sheet, and any later one whose work is a page: edge to edge, the dynamic viewport
   where the browser knows it (a phone's bars come and go) and the plain one where it does not.
   - STILL THE DIALOG: the top layer, the focus trap, Escape, the scrim behind it. Only its size
     changes, and with the size what has no meaning at it - the margin round the sheet, the
     rounded corners, the drag (`Modal.tsx` does not start one), and the outer shadow, which
     would fall outside the window. The rim and the material stay: it is still the outermost
     floating surface, and nothing inside it blurs.
   - THE BODY TAKES WHAT THE HEAD AND THE FOOT LEAVE, and lays its content out as a column, so
     a part inside it can take the rest in turn (the crop tool's desk).
   - THE SAFE AREA IS THE SHEET'S OWN PADDING, on the physical sides the device names: a notch
     is on the left of the glass, whichever way the text runs.
   Named with its element, so it outranks the sizes other sheets are given further down - the PDF
   reader's `.modal:has(.pdf-reader)`, whose classes the crop tool wears, among them. */
dialog.modal.modal--full {
  inset: 0;
  margin: 0;
  inline-size: 100vw;
  inline-size: 100dvw;
  block-size: 100vh;
  block-size: 100dvh;
  max-inline-size: none;
  max-block-size: none;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px)
    env(safe-area-inset-left, 0px);
  border-radius: 0;
  translate: none;
  --lq-elevation: 0 0 0 0 transparent;
}

[data-family="traditional"] dialog.modal.modal--full {
  box-shadow: none;
}

dialog.modal.modal--full[open] > .modal__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  max-height: none;
}

.modal--full .modal__head {
  cursor: auto;
  touch-action: auto;
}

/* ⚠ THE SHEET ITSELF NEVER SCROLLS; ONLY ITS BODY DOES (owner, 2026-10-03: "no scroll may
   appear when a dialog opens, and the dialog may not leave the page"). The body has always
   carried its own scroll and a 70dvh ceiling, but the sheet is capped at the window minus
   its margins too, and on a short window the two caps disagreed: measured at 1024x600, the
   "New student" sheet was 552px tall with a head, a 420px body and a foot that needed
   about 580, so the sheet grew a scrollbar of its own around the body's - two nested
   scrollbars, and a head and actions that scrolled away. As a column, the head and the foot
   keep their size and the body gives up the difference, so the actions stay on screen and
   there is one scroll, the body's.

   On `[open]` only: a closed dialog is `display: none` from the UA sheet, and a `display`
   on `.modal` alone would show every closed dialog in the app. */
.modal[open] {
  display: flex;
  flex-direction: column;
}

.modal[open] > .modal__head,
.modal[open] > .modal__foot {
  flex: none;
}

.modal[open] > .modal__body {
  flex: 0 1 auto;
  min-height: 0;
}

/* THE PAGE BEHIND AN OPEN DIALOG DOES NOT SCROLL (owner, 2026-10-03). Measured before this:
   with the dialog open, the mouse wheel over the scrim still scrolled the list behind it -
   124px at 1440x900, 470px at 1024x600 - and the page kept its scrollbar beside the sheet.
   `dialog:modal` matches only a dialog opened with `showModal()`, so a non-modal dialog
   never locks anything, and a stacked second dialog keeps the lock until the last one
   closes. The scroll position is kept: hiding the overflow does not move the page.

   THE GAP KEEPS THE PAGE STILL. On a system with a classic scrollbar, removing it would
   widen the page by its width and everything behind the scrim would jump sideways as the
   dialog appears. `Modal.tsx` measures that width just before the dialog opens and this
   puts it back as padding, so nothing behind the dialog moves. With overlay scrollbars the
   gap is zero and nothing changes. */
html:has(dialog:modal) {
  overflow: hidden;
  padding-inline-end: var(--scroll-lock-gap, 0px);
}

/* A CONFIRMATION IS A QUESTION, AND WAS BUILT LIKE A DOCUMENT.
   The plain sheet is 440px of two-column form with 24px gutters, a 22px heading on its
   own band and a footer on another - about 160px of furniture around one sentence, which
   read as three stacked boxes asking one thing. This is the same sheet with the furniture
   taken down to what a question needs: narrower than a form because there is no form,
   one block instead of three, and the actions directly under the words they answer.

   Everything here is the shared sheet's own tokens one step down. No new colour, no new
   radius, nothing this variant invents. */
.modal--compact {
  width: min(24rem, calc(100vw - var(--space-6) * 2));
}

.modal--compact .modal__head {
  padding: var(--space-5) var(--space-5) 0;
}

/* 18px, not 22px. A question's title is a lead-in to the sentence under it, not a heading
   over a document - and at 22px above a 15px line it was the loudest thing in the dialog
   while carrying the least. */
.modal--compact .modal__title {
  font-size: var(--text-lg);
}

.modal--compact .modal__body {
  padding: var(--space-2) var(--space-5) var(--space-4);
}

.modal--compact .modal__foot {
  padding: 0 var(--space-5) var(--space-5);
}

/* A DIM, NOT A SECOND MATERIAL, and not an opaque one either. At 55 percent over a
   dark ground the composite behind the dialog measured pure black, so the dialog's
   own blur was averaging nothing and the glass read as paint. This leaves the page
   visible enough for the material above it to have something to bend. */
.modal::backdrop {
  background: var(--scrim);
  /* The showcase blurs what is behind its scrim by 8px and the owner asked for 4 (2026-09-29), so the page under a dialog is a soft
     field of colour for the glass to bend rather than legible text competing with the sheet. */
  backdrop-filter: blur(4px);
}

/* liqui's scrim in the glass family, WITH A BLUR (owner, 2026-10-03: "when a dialog opens,
   the page behind it must blur"). liqui's own scrim is a plain dim; this one also blurs the
   page by the owner's 4px, so everything around the sheet - not only what sits under it -
   reads as pushed back. The sheet then frosts that already-softened page once more, which
   is the intended look. The blur goes to nothing as transparency is reduced, like every
   other backdrop-filter in the product. */
[data-family="glass"] .modal::backdrop {
  background: var(--lq-scrim);
  backdrop-filter: blur(calc(var(--lq-scrim-blur) * (1 - var(--a11y-reduce-transparency))));
}

/* A DIALOG UNDER ANOTHER DIALOG STOPS SAMPLING (live walk, 2026-11-21). Glass cannot sample
   glass: the bank's question editor opened over its block editor was four blurs deep - two
   sheets and two scrims, each a backdrop-filter over the one below. `Modal.tsx` marks every
   dialog with another open above it `data-covered`; here its sheet drops the sample, the lens
   and the specular line exactly as a nested `.mat` does in material.css, and takes the tint a
   surface without blur needs, and its scrim keeps its dim and drops its blur. The dialog on top
   then frosts one plain surface, as a single dialog frosts the page. Nothing here is a new
   value: the properties are the nested rule's own. */
[data-family="glass"] .modal[data-covered] {
  backdrop-filter: none;
  --glass-lens: ;
  --glass-specular-image: none;
  --glass-nested-mult: 3;
  --lq-tier: 1;
  --lq-wash-on: 1;
}

.modal[data-covered]::backdrop,
[data-family="glass"] .modal[data-covered]::backdrop {
  backdrop-filter: none;
}

/* NO PAGE BLUR BELOW ONE DEVICE PIXEL PER CSS PIXEL (teacher audit 2026-11-14, finding 33).
   With the browser zoomed out (or any device pixel ratio under 1) Chromium captures only
   the top-left (ratio x size) part of what is behind a backdrop-filter and fills the rest
   by its mirror edge mode, so a full-viewport scrim showed the page's own sidebar and
   heading mirrored at the right and bottom edges, in both themes. Measured in headless
   Chromium 151: the copies appear at ratio 0.5 and 0.9 and not at 1, 1.25, 1.5 or 2. Below
   1 the scrim keeps its dim and drops only the blur; at 1 and above nothing changes. */
@media not all and (min-resolution: 1dppx) {
  .modal::backdrop,
  [data-family="glass"] .modal::backdrop {
    backdrop-filter: none;
  }
}

/* The head is the grab area. `touch-action: none` so a drag on a touch screen moves
   the dialog rather than scrolling the page behind it. */
.modal__head {
  cursor: grab;
  touch-action: none;
}

/* A dialog whose title is for screen readers only: its i sits by the close button. */
.modal__head .info-heading:has(.visually-hidden) {
  margin-inline-start: auto;
}

/* Pickers in the head, between the title and the close button (the teacher's card and topic). */
.modal__head > .info-heading:has(.modal__card-picks) {
  flex: 1 1 auto;
  min-inline-size: 0;
}

.modal__head > .info-heading:has(.modal__card-picks) .modal__title {
  white-space: nowrap;
}

/* The exam's tabs on the title's line (the independent teacher's, owner 2026-11-16): the tabs
   first at the start, the title at the end beside the close button; on a narrow window the title
   wraps under the tabs. The strip keeps its own sideways scroll. */
.modal__head > .info-heading:has(.modal__head-tabs) {
  flex: 1 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-inline-size: 0;
}

/* NEVER A SCROLLBAR HERE (owner, 2026-11-16, "heç vaxt scroll yaranmasın"). The strip asks for
   its full width first, so when the title does not fit beside it the title takes the next line; on
   a window narrower than the four tabs themselves the tabs wrap onto a second line rather than
   scroll sideways. */
.modal__head-tabs {
  order: -1;
  flex: 1 1 max-content;
  min-inline-size: 0;
  margin-inline-end: var(--space-4);
}

.modal__head-tabs .tabs {
  flex-wrap: wrap;
  overflow: visible;
  border-block-end: 0;
  margin-block-end: 0;
}

.modal__card-picks {
  display: flex;
  flex: 1 1 auto;
  justify-content: flex-end;
  gap: var(--space-3);
  min-inline-size: 0;
  margin-inline-start: var(--space-3);
}

.modal__card-picks > .combo,
.modal__card-picks > .field {
  flex: 0 1 11rem;
  min-inline-size: 0;
}

.modal__card-picks .field {
  inline-size: 100%;
  min-inline-size: 0;
}

@media (max-width: 40rem) {
  .modal__head > .info-heading:has(.modal__card-picks) {
    flex-wrap: wrap;
  }

  .modal__card-picks {
    flex-basis: 100%;
    margin-inline-start: 0;
  }
}

.modal[data-dragging] {
  user-select: none;
}

.modal[data-dragging] .modal__head {
  cursor: grabbing;
}

/* ⚠ 32px OF GUTTER, BECAUSE THE SHEET GREW AND THIS DID NOT. A 24px gutter was right
   for a 440px dialog; on the 768px one it took its place on, the content sat against the
   edge and the sheet read as having no padding at all - which is exactly how the owner
   described the course dialogs (2026-09-27). Measured before this change: every dialog
   body in the course area computed `12px 24px 16px 24px` while its sheet was 726px wide.

   `--space-7` is 32px and `--space-6` is 24; the narrow-screen query below puts 24 back,
   because on a phone the sheet IS the viewport and 64px of gutter is width the fields
   need more than the margin does. `.modal--compact` keeps its own 20px: a question in a
   24rem sheet was never the problem. */
.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-7) var(--space-7) var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

/* 22px - the prototype's sheet heading. The h2 it sits on already carries
   `--tracking-tight`, which is 0.002em from the prototype's -0.018em. The leading
   is the body's, as it is in the prototype. */
.modal__title {
  font-size: var(--text-xl);
  line-height: var(--leading-body);
  /* A title is often a name, and one long name used to push the close button out past the
     sheet's edge at 375px and clip the title itself at 320 (device test 2026-10-29, row 34).
     The title takes what the head has left and breaks inside a word when it must. */
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

/* The title's row, when an "i" stands beside it, may shrink like the title does; the close
   button never does, so it stays inside the sheet at every width. */
.modal__head > .info-heading {
  min-inline-size: 0;
}

.modal__head > .btn {
  flex-shrink: 0;
}

.modal__body {
  padding: var(--space-4) var(--space-7) var(--space-6);
  overflow-y: auto;
  max-height: 70dvh;
}

.modal__foot {
  display: flex;
  /* Three actions do not fit a phone's sheet on one line; they wrap rather than push the
     first one out past the sheet's edge. */
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: 0 var(--space-7) var(--space-7);
  border-top: 1px solid var(--border-subtle);
}

/* The slot `ModalActions` fills (Modal.tsx). Until a part of the dialog puts its actions
   there, it is not drawn at all: no padding, no rule, so a dialog without actions is the
   dialog it was. */
.modal__foot:empty {
  display: none;
}

/* Why the primary action did not go ahead, said beside it. It takes the free space at the
   start of the row, so the buttons stay where the hand already is. */
.modal__foot-note {
  margin-inline-end: auto;
  align-self: center;
}

/* A REQUIRED FIELD SAYS SO BEFORE IT IS LEFT EMPTY, NOT AFTER. Opt-in per form rather than
   global: the star is explained by a legend line, and a form that carries no legend should
   not grow unexplained stars. Keyed on the control's own `required`, so the mark and what
   assistive technology is told cannot drift apart. The star is hidden from the accessibility
   tree (`/ ""`): the control already announces "required", and a reader hearing "star" as
   well learns nothing. */
.dialog-form--marks-required .form-field:has(:is(.field, .combo__native):required) .label::after {
  content: " *" / "";
  color: var(--danger-text);
}

/* The phone keeps the old gutter: there the sheet is the window minus its margins, so
   every pixel of padding comes straight out of the field beside it. 30rem is the scale
   this file already uses for that boundary. */
@media (max-width: 30rem) {
  .modal__head {
    padding: var(--space-6) var(--space-6) var(--space-2);
  }

  .modal__body {
    padding: var(--space-3) var(--space-6) var(--space-4);
  }

  .modal__foot {
    padding: 0 var(--space-6) var(--space-6);
  }
}

/* THE DIVIDERS ARE A SCROLL CUE, SO THEY SHOW ONLY WHEN THERE IS A SCROLL.
   The prototype's sheet has no rules under its title or above its actions, and a
   dialog that fits needs none - two hairlines across a short form read as three
   stacked boxes. But this body can be taller than the viewport, and a hidden
   overflow needs a visible cue. So the head and the foot take their lines from a
   scroll timeline on the body: with no scroll range the timeline is inactive and
   the animation applies nothing, which leaves the transparent default; once the
   body overflows, both lines are drawn for the whole range.

   Behind @supports, so a browser without scroll timelines keeps both lines always,
   which is the safe direction to fail in. */
@supports (animation-timeline: scroll()) and (timeline-scope: --a) {
  .modal {
    timeline-scope: --modal-scroll;
  }
  .modal__body {
    scroll-timeline: --modal-scroll block;
  }
  .modal__head,
  .modal__foot {
    border-color: transparent;
    animation: modal-scroll-cue linear both;
    animation-timeline: --modal-scroll;
  }
  /* THE ACTIONS STEP OFF THE LINE WHEN THE LINE IS DRAWN (owner, 2026-10-07: the buttons sat
     on the rule). The foot has no top padding because a dialog that fits has no rule above
     its actions; once the body scrolls and the rule appears, the buttons were touching it.
     The same timeline gives the foot its breathing room, so a short dialog is unchanged. */
  .modal__foot {
    animation-name: modal-scroll-cue-foot;
  }
  @keyframes modal-scroll-cue {
    from,
    to {
      border-color: var(--border-subtle);
    }
  }
  @keyframes modal-scroll-cue-foot {
    from,
    to {
      border-color: var(--border-subtle);
      padding-block-start: var(--space-4);
    }
  }
}

/* Without scroll timelines the rule is always drawn, so the gap above the actions is too. */
@supports not ((animation-timeline: scroll()) and (timeline-scope: --a)) {
  .modal__foot {
    padding-block-start: var(--space-4);
  }
}

/* --- definition lists ------------------------------------------------------ */

/* `minmax(0, 1fr)`, not `1fr`: the value column kept its longest word's width, and at 280px
   with 125% text an answer ran 2px past the screen (tutor device re-test 2026-10-29). */
.kv {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-2) var(--space-4);
  margin: 0;
}

.kv dt {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.kv dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* --- a payer's own invoices (/invoices in a guardian's menu) ------------------
   One card per invoice rather than a table: a parent reads this on a phone, and a
   table's amounts scrolled off a 390px screen with no cue. The figures wrap into as
   many columns as fit, and the balance leads. The cards repeat on the page ground, so
   they are `.mat-inset` with the border role for an edge, as the landing page's are. */

.my-invoices {
  max-inline-size: 48rem;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.my-invoice {
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-inline-size: 0;
}

[data-family="glass"] .my-invoice {
  border-color: var(--border);
}

.my-invoice__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.my-invoice__about {
  margin: 0;
  overflow-wrap: anywhere;
}

.my-invoice__figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(8rem, 100%), 1fr));
  gap: var(--space-3) var(--space-4);
  margin: 0;
}

.my-invoice__figure {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-inline-size: 0;
}

.my-invoice__figure dt {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.my-invoice__figure dd {
  margin: 0;
}

.my-invoice__amount {
  font-variant-numeric: tabular-nums;
}

.my-invoice__figure--lead dd {
  font-size: var(--text-lg);
  font-weight: var(--weight-strong);
}

/* --- a learner's own groups (/my-groups, owner 2026-10-24) --------------------
   The invoice cards' composition, applied to the other list a learner reads on a phone:
   one card per group, the name leading, the facts wrapping into as many columns as fit.
   The cards repeat on the page ground, so they are `.mat-inset` with the border role for
   an edge; the join box after them is the page's one `.mat`. Every value is a token. */

.my-groups {
  max-inline-size: 48rem;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-inline-size: 0;
}

.my-groups__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.my-group {
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-inline-size: 0;
}

[data-family="glass"] .my-group {
  border-color: var(--border);
}

.my-group__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.my-group__name {
  font-size: var(--text-xl);
  overflow-wrap: anywhere;
  min-inline-size: 0;
}

.my-group__about {
  margin: 0;
}

.my-group__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr));
  gap: var(--space-3) var(--space-4);
  margin: 0;
}

.my-group__fact {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-inline-size: 0;
}

.my-group__fact dt {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.my-group__fact dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.my-group__lesson {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
}

.my-group__time {
  font-variant-numeric: tabular-nums;
}

.my-group__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  padding-block-start: var(--space-2);
  border-block-start: 1px solid var(--border-subtle);
}

/* The zero-state spans the column like the join box under it, as the journal's does: the
   shared `.empty` measure would leave it a narrow tile above a wider card. */
.my-groups > .empty-state {
  max-inline-size: none;
  margin-inline: 0;
}

/* One invoice, opened (audit PAR-03). Lines, corrections and payments are rows rather than
   a five-column table, so nothing scrolls off a phone: the arithmetic sits under the
   description and the amount keeps the end of the row. */
.my-invoice-doc__number {
  margin: 0;
  font-size: var(--text-lg);
  overflow-wrap: anywhere;
}

.my-invoice-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.my-invoice-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  padding-block: var(--space-2);
  border-block-end: 1px solid var(--border-subtle);
  min-inline-size: 0;
}

.my-invoice-row:last-child {
  border-block-end: none;
}

.my-invoice-row__main {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-inline-size: 0;
}

.my-invoice-row > .mono {
  flex-shrink: 0;
  white-space: nowrap;
}

/* A learner's certificate, opened (audit STU-11): one centred sheet that prints as itself.
   The title is display size and the recipient's name the second thing the eye meets; the
   facts and the verification code close the page. Long names and codes wrap rather than
   widen the sheet. */
.certificate-doc {
  max-inline-size: 48rem;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  text-align: center;
  padding-block: var(--space-8);
  overflow-wrap: anywhere;
}

.certificate-doc p {
  margin: 0;
}

.certificate-doc__org {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.certificate-doc__title {
  margin: 0;
  font-size: var(--text-display);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-display);
}

.certificate-doc__name {
  font-size: var(--text-xl);
  font-weight: var(--weight-strong);
}

.certificate-doc__for {
  font-size: var(--text-lg);
}

.certificate-doc__body {
  max-inline-size: 60ch;
  color: var(--text-secondary);
  white-space: pre-line;
}

.certificate-doc__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(10rem, 100%), 1fr));
  gap: var(--space-3) var(--space-6);
  inline-size: 100%;
  margin: var(--space-4) 0 0;
  padding-block-start: var(--space-4);
  border-block-start: 1px solid var(--border-subtle);
}

.certificate-doc__facts dt {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.certificate-doc__facts dd {
  margin: 0;
}

.certificate-doc__signature {
  font-style: italic;
}

.certificate-doc__verify {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  inline-size: 100%;
  min-inline-size: 0;
}

.certificate-doc__code {
  max-inline-size: 100%;
  overflow-wrap: anywhere;
}

.fieldset {
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* --- catalogue dialogs (subjects, rooms) -----------------------------------
   Grouped by what the reader decides, not by what the API accepts: what the thing
   is called, what it is, who owns it, and whether it is in use.
   Sections are divided by a hairline, never boxed - a bordered fieldset inside a
   glass sheet reads as a second dialog. */

.dialog-form__identity {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 8.5rem);
  gap: var(--space-3);
  align-items: start;
}

/* The server stores the code in capitals, so the box shows it the way it will be kept. */
.dialog-form__code .field {
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.dialog-form__code .field::placeholder {
  text-transform: none;
}

.dialog-form__section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-block-start: var(--space-4);
  border-block-start: 1px solid var(--border-subtle);
}

.dialog-form__section-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.dialog-form__section-head p {
  margin: 0;
}

/* THE OVERVIEW: a grid of cards grouped under a quiet heading, used where a list of rows
   is really a list of objects somebody is looking for one of - the question banks (a card
   per teacher's subject, grouped by branch) and the courses (a card per course, grouped by
   subject). The card is the object, so it carries the weight a table row cannot. */
.overview {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.overview__total {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  font-size: var(--text-sm);
}

.overview__total strong {
  font-size: var(--text-xl);
  font-weight: var(--weight-strong);
  font-variant-numeric: tabular-nums;
}

.overview__group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-inline-size: 0;
}

/* The branch a set of banks belongs to. Quiet: it groups the cards, it is not one of them. */
.overview__group-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.overview__group-title .info-tip__button {
  inline-size: 1.5rem;
  block-size: 1.5rem;
  margin-block: calc(-1 * var(--space-1));
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr));
  gap: var(--space-3);
}

/* A whole card is one control, so it is a button and not a div with a click on it. */
.overview-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-block-size: 8.5rem;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  text-align: start;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

[data-family="glass"] .overview-card {
  border-color: var(--border);
}

.overview-card:hover {
  border-color: var(--border-strong);
}

.overview-card:active {
  transform: translateY(1px);
}

.overview-card:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring);
  outline-offset: 2px;
}

.overview-card__head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: var(--space-2);
}

/* The subject leads: a reader looking for "who teaches mathematics" scans this column. */
.overview-card__title {
  font-size: var(--text-base);
  font-weight: var(--weight-strong);
  line-height: var(--leading-tight);
  overflow-wrap: anywhere;
}

.overview-card__subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

/* The count anchors the bottom of the card, as a counted thing does on the dashboard. */
.overview-card__figure {
  margin-block-start: auto;
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

.overview-card__figure strong {
  font-size: var(--text-2xl);
  font-weight: var(--weight-strong);
  line-height: 1;
  letter-spacing: var(--tracking-tight);
  font-variant-numeric: tabular-nums;
}

.overview-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
}

/* A card whose title is a link rather than the whole card being one button: a course
   carries actions of its own, and a button inside a button is invalid. */
a.overview-card__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
}

a.overview-card__title:hover {
  text-decoration: underline;
}

/* A whole card that is a link (the marking queue's exams): the link's hover underline would
   run under every word on the card, and the border already answers the hover. */
a.overview-card:hover {
  text-decoration: none;
}

.overview-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-block-start: var(--space-1);
  padding-block-start: var(--space-2);
  border-block-start: 1px solid var(--border-subtle);
}

/* The figure line carries a second, quieter number beside the lead one. */
.overview-card__figure .tiny:last-child {
  margin-inline-start: auto;
}

/* Which bank the list below is showing, and the way back out of it. */
.bank-open {
  align-items: center;
  gap: var(--space-3);
  margin-block-end: var(--space-3);
}

/* What is wrong with an imported spreadsheet, by the row number the spreadsheet shows. */
.sheet-errors {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  max-block-size: 14rem;
  overflow-y: auto;
}

.sheet-errors li {
  display: grid;
  grid-template-columns: 6rem 9rem minmax(0, 1fr);
  gap: var(--space-2);
  align-items: baseline;
}

@media (max-width: 720px) {
  .sheet-errors li {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
}

/* The same strip where the chips are statements rather than controls - what a course
   covers. Quieter than the filtering kind, so a reader does not try to press one. */
.topic-strip--static {
  margin-block: var(--space-1) 0;
}

.topic-strip--static .chip {
  cursor: default;
  background: var(--surface-sunken);
  color: var(--text-secondary);
}

/* Inside one opened card - a question bank, a subject's courses: what it is, what it holds,
   and the way back. The heading carries the teacher and the subject, which is why nothing
   below it repeats either. */
.open-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  border-radius: var(--r-md);
  margin-block-end: var(--space-4);
}

.open-head__back {
  gap: var(--space-1);
}

/* A head whose way back stands above it (the workspace monitors): the name leads, then whatever
   follows it - the proctor's pause and the figure, or the figure alone - each in a column of its
   own width, so no empty column leaves a gap. The narrow rule below stacks it in one column. */
.open-head--lead {
  grid-template-columns: minmax(0, 1fr);
  grid-auto-columns: auto;
  grid-auto-flow: column;
}

/* The one chevron this repository has points right, and back is the other way. */
.open-head__back-icon {
  transform: scaleX(-1);
}

.open-head__name {
  min-inline-size: 0;
}

.open-head__title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: var(--weight-strong);
  line-height: var(--leading-tight);
  overflow-wrap: anywhere;
}

.open-head__sub {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

/* Three figures at most, and only the ones that are true of what is open. */
/* One hand-marked question in the marking panel (audit CRS-03): its own mark and feedback,
   separated from the next by a rule rather than by another surface. */
.paper-mark {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-block-start: var(--space-3);
  border-block-start: 1px solid var(--border-subtle);
}

/* The teacher's jump to the question being marked: a button as wide as its words. */
.paper-mark__jump {
  align-self: flex-start;
}

/* The slim marking panel (owner, 2026-11-14): a quiet title with the "how it adds up" sentence
   behind its "i", compact question blocks, and the save at the end. */
.paper-marking {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-block-end: var(--space-4);
}

.paper-marking__title {
  margin: 0;
  font-size: var(--text-md);
  font-weight: var(--weight-strong);
}

/* The mark beside the feedback on a wide screen: the mark is a number, so its column is narrow;
   criteria marking keeps its own block above the feedback. Stacked at 720px and below. */
.paper-mark__inputs {
  display: grid;
  grid-template-columns: minmax(0, 12rem) minmax(0, 1fr);
  gap: var(--space-3) var(--space-4);
  align-items: start;
}

.paper-mark__inputs--criteria {
  grid-template-columns: minmax(0, 1fr);
}

.paper-mark__inputs .field {
  inline-size: 100%;
  min-inline-size: 0;
}

@media (max-width: 720px) {
  .paper-mark__inputs {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* A question card on the attempt paper, slim: tighter padding and gaps, the position and the
   kind as one quiet line, and the options as compact chips rather than tall cards. Scoped to
   this page; the learner's review and the player keep their own sizes. */
.review-q--slim {
  padding: var(--space-3) var(--space-4);
  gap: var(--space-2);
}

.paper-q__meta {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.review-q--slim .answer-choices {
  gap: var(--space-2);
}

.review-q--slim .answer-choice {
  padding: var(--space-1) var(--space-3);
  gap: var(--space-2);
  min-block-size: var(--control-sm);
  align-items: center;
}

/* The row of letter-only options keeps chips this size too. Four classes, so it outweighs the row's
   own rule further down without naming the row (every rule that names it carries its two classes). */
.review-q.review-q--slim .answer-choices > .answer-choice {
  min-inline-size: var(--control-sm);
  min-block-size: var(--control-sm);
}

/* The page's last row: printing, in one slim line. */
.paper-print {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--r-md);
  /* Its own distance from the last question card, which otherwise touched it. */
  margin-block-start: var(--space-4);
}

/* The jump to a question's card is a target of its own, not a word in a sentence: 24px high
   rather than its 17px of text (WCAG 2.5.8). */
.paper-mark > .link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-block-size: var(--target-min);
}

.paper-mark__answer {
  margin: 0;
  padding: var(--space-3);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.paper-mark textarea {
  inline-size: 100%;
  min-inline-size: 0;
}

.open-head__figures {
  display: flex;
  /* Three figures do not fit 320px side by side: they wrap rather than squeeze a score to
     one glyph a line (tutor device test 2026-10-29, row 44). */
  flex-wrap: wrap;
  gap: var(--space-5);
  margin: 0;
}

.open-head__figures dt {
  margin: 0;
}

.open-head__figures dd {
  margin: 0;
  font-size: var(--text-xl);
  font-weight: var(--weight-strong);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  /* «3 / 7» is one figure; it broke into «3», «/», «7» on a phone (row 44). */
  white-space: nowrap;
}

@media (max-width: 720px) {
  .open-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .open-head--lead {
    grid-auto-flow: row;
  }

  .open-head__back {
    justify-self: start;
  }
}

/* One attempt's paper: the slim head (owner, 2026-11-14). The way back sits above the surface
   as a small link; inside, one row holds who sat (left) and the score that leads (right), and a
   hairline-topped row of small facts closes it. No standing sentences, no nested surface, no
   three equal display figures. Every value comes from the existing scale. */
.paper-head__back {
  margin-block-end: var(--space-2);
}

.paper-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  border-radius: var(--r-md);
  margin-block-end: var(--space-4);
}

.paper-head__main {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3) var(--space-5);
}

.paper-head__who {
  flex: 1 1 16rem;
  min-inline-size: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.paper-head__name {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: var(--weight-strong);
  line-height: var(--leading-tight);
  overflow-wrap: anywhere;
}

/* One line of chips: where they came from, the attempt, the status, the address. */
.paper-head__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.paper-head__email {
  overflow-wrap: anywhere;
  min-inline-size: 0;
}

/* The one figure that leads: the score, the maximum quieter beside it, the percentage under it. */
.paper-head__score {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-1);
  margin: 0;
}

.paper-head__score dd {
  margin: 0;
}

.paper-head__score-value {
  font-size: var(--text-2xl);
  font-weight: var(--weight-strong);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.paper-head__score-max {
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
}

.paper-head__score-percent {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* The facts row: a label over a value, small and equal, divided from the row above by a rule
   rather than by another surface. */
.paper-head__facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
  margin: 0;
  padding-block-start: var(--space-3);
  border-block-start: 1px solid var(--border-subtle);
}

.paper-head__fact {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-inline-size: 0;
}

/* Every label one target tall, so a label carrying an "i" (the time) does not push its value
   below its neighbours'. */
.paper-head__fact dt {
  display: flex;
  align-items: center;
  min-block-size: var(--target-min);
  margin: 0;
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.paper-head__fact dd {
  margin: 0;
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .paper-head__score {
    align-items: flex-start;
  }

  .paper-head__facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* The topics inside an open card. A strip, because there are a handful of them and the
   counts are what show a teacher where the gaps are. */
.topic-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-block-end: var(--space-4);
}

.chip__count {
  margin-inline-start: var(--space-2);
  font-variant-numeric: tabular-nums;
  opacity: 0.75;
}

/* Two controls of equal weight side by side. */
/* An exam's "assign to" line: two labelled pickers and the button that adds the row, the
   button sitting on the fields' baseline rather than centred against label and field. */
.exam-assign {
  flex-wrap: wrap;
  align-items: flex-end;
}
.exam-assign > .form-field {
  flex: 1 1 12rem;
  min-inline-size: 0;
}

.dialog-form__pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  align-items: start;
}

/* The first section needs no rule above it: the dialog head already separates it. */
.dialog-form__section--first {
  padding-block-start: 0;
  border-block-start: 0;
}

/* A wide dialog's two columns. Each column stacks its own sections; the gap between
   the columns does the separating a hairline does between stacked sections. */
.dialog-form__columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4) var(--space-8);
  align-items: start;
}

.dialog-form__column {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Stacked, the second column's first section is no longer first on the sheet, so its
   rule comes back. */
@media (max-width: 48rem) {
  .dialog-form__columns {
    grid-template-columns: minmax(0, 1fr);
  }

  .dialog-form__column > .dialog-form__section--first {
    padding-block-start: var(--space-4);
    border-block-start: 1px solid var(--border-subtle);
  }
}

/* A single sentence explaining the pair above it. */
.dialog-form__note {
  margin: 0;
}

/* What an edit cannot change, named as text rather than hidden. */
.dialog-form__fixed {
  margin: 0;
  font-weight: var(--weight-medium);
}

/* Notes that explain a row of narrow controls, set once under the row. */
.dialog-form__notes {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin: 0;
  padding-inline-start: var(--space-4);
}

.dialog-form__section-title {
  margin: 0;
  font-size: var(--text-base);
  font-weight: var(--weight-strong);
  line-height: var(--leading-body);
}

/* One row per language, the name to the left of its box. Three stacked label-over-input
   pairs were what pushed this dialog into a scroll. */
.dialog-form__locales {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--space-2) var(--space-3);
  align-items: center;
}

.dialog-form__locale {
  display: contents;
}

.dialog-form__locale-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.dialog-form__locale-code {
  display: inline-grid;
  place-items: center;
  min-inline-size: 2.25em;
  padding-inline: var(--space-1);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
  font-variant-numeric: tabular-nums;
}

.dialog-form__toggle {
  align-items: flex-start;
  font-size: var(--text-base);
}

.dialog-form__toggle input {
  margin-block-start: var(--space-1);
}

.dialog-form__toggle-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

/* One condition row: the fact name, its three bounds and a remove button. As a flex row the
   four inputs kept their intrinsic width and pushed the button out of a half-width column. */
.dialog-form__clause {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)) auto;
  gap: var(--space-2);
  align-items: center;
}

.dialog-form__clause .field {
  inline-size: 100%;
  min-inline-size: 0;
}

/* Narrow screens: the code drops under the name, and each language label sits above
   its box again, because a label column would leave the box too narrow to type in. */
/* A note that changes what happens on save, set apart from the plain explanations. */
.dialog-form__warn {
  color: var(--warning);
  font-weight: var(--weight-medium);
}

/* Pairs stay side by side on a phone: two short controls fit in half a sheet each, and
   stacking every pair doubled the height of a dialog that already had to scroll there.
   Only a very narrow screen gets one per row. */
@media (max-width: 22rem) {
  .dialog-form__pair {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Except a pair holding a date and time. Half a phone's sheet is narrower than the control's
   own "gg.aa.iiii ss:dd" and its calendar button, so the placeholder was cut off at 375px
   (device test 2026-10-29, row 37). That pair stacks wherever the other pairs keep the
   phone's gutter. */
@media (max-width: 30rem) {
  .dialog-form__pair:has(input[type="datetime-local"]),
  .dialog-form__pair:has(.datefield) {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 30rem) {
  .dialog-form__identity,
  .dialog-form__locales {
    grid-template-columns: minmax(0, 1fr);
  }

  .dialog-form__locales {
    gap: var(--space-1);
  }
}

/* --- constraint findings ---------------------------------------------------
   `NotEvaluable` gets its own colour on purpose. Three of the nine constraints
   have no data model behind them, and an administrator who reads "not checked"
   as "passed" will publish a broken timetable.
   -------------------------------------------------------------------------- */

.findings {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.finding {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--r-sm);
  border-inline-start: var(--space-1) solid var(--border);
  background: var(--surface-2);
  font-size: var(--text-sm);
}

.finding__name {
  flex: 1 1 auto;
}

.finding__verdict {
  font-weight: var(--weight-medium);
}

.finding--satisfied {
  border-inline-start-color: var(--success);
}

.finding--violated {
  border-inline-start-color: var(--danger);
  background: var(--danger-subtle);
}

.finding--notevaluable {
  border-inline-start-color: var(--warning);
  background: var(--warning-subtle);
}

/* --- the week grid ---------------------------------------------------------
   A cell can legitimately hold more than one entry: two placements in the same
   slot do not clash when their parities are disjoint (Odd vs Even).
   -------------------------------------------------------------------------- */

.timetable {
  table-layout: fixed;
  min-width: 56rem;
}

.timetable__cell {
  vertical-align: top;
  padding: var(--space-2);
  min-width: 9rem;
}

/* The row header carries two facts — which lesson number, and when it runs — and
   inline they collided: period 1 at 08:30 rendered as "108:30-09:15". Stacked, the
   number leads and the clock times sit under it as the supporting detail they are. */
.tt-period {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  align-items: flex-end;
}

.tt-period__no {
  font-weight: var(--weight-medium);
}

.tt-entry {
  border: 1px solid var(--brand-border);
  background: var(--brand-subtle);
  border-radius: var(--r-sm);
  padding: var(--space-2);
  margin-bottom: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.tt-entry__main {
  font-weight: var(--weight-medium);
  font-size: var(--text-sm);
}

.tt-entry__meta {
  line-height: var(--leading-tight);
}

/* A RESTING STATE, because hover is not a thing a phone has.
   This was `opacity: 0` until hovered, so on any touch device the only control
   that adds a timetable entry was invisible until a tap happened to land on it —
   and `prefers-reduced-motion` zeroing the transition did not help, because the
   resting opacity was still zero. Hover now raises emphasis rather than creating
   the control. */
.tt-add {
  width: 100%;
  opacity: 0.55;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.timetable__cell:hover .tt-add,
.tt-add:hover,
.tt-add:focus-visible {
  opacity: 1;
}

/* A pointer that can hover gets the quieter resting state; a touch device keeps
   the control at full strength, since it has no way to reveal it. */
@media (hover: none) {
  .tt-add {
    opacity: 1;
  }
}

/* --- one-shot credential ---------------------------------------------------
   The join code is disclosed by exactly one response and never again, so it is
   rendered large enough to read aloud and copy in one go.
   -------------------------------------------------------------------------- */

.join-code {
  font-size: var(--text-xl);
  letter-spacing: var(--tracking-label);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--r-md);
  background: var(--surface-3);
  border: 1px dashed var(--border-strong);
  user-select: all;
}

/* The register's own line: the group, the day and the lesson on the left, the tally and the
   bulk action on the right. Wraps under itself on a narrow screen rather than squeezing. */
.register-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3);
  margin-block: var(--space-2) var(--space-3);
}

.register-head__context {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-inline-size: 0;
}

.register-head__context p {
  margin: 0;
}

.register-head__tally {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

/* An "i" beside a filter caption. 24px keeps the target size; the negative block margin lets
   it overhang the caption line instead of making that one caption taller than its
   neighbours, so every caption in the bar still starts on the same line. */
.filter-group .info-heading .info-tip__button {
  inline-size: 1.5rem;
  block-size: 1.5rem;
  margin-block: calc(-1 * var(--space-1));
}

/* The same on a form field's label line and a dialog section's title. The button overhangs the line instead of
   heightening it, so a labelled control with an "i" lines up with its neighbour without one. */
:is(.form-field, .dialog-form__section) > .info-heading .info-tip__button {
  inline-size: 1.5rem;
  block-size: 1.5rem;
  margin-block: -0.75rem;
}

.register-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* The day's log sits apart from the register it records, with room to read as a second
   section rather than a continuation of the table above. */
.register-log {
  margin-block-start: var(--space-6);
}

.mark-row {
  flex-wrap: wrap;
  gap: var(--space-1);
}

/* The register's legend: what a dash and a circled minus mean, one line each. */
.register-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.register-legend li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* The chosen attendance status wears its own tone - the badge pair, measured - and keeps it
   under the pointer and with focus. Weight is the second carrier, so the choice does not
   rest on colour alone. This layer outranks the component hover, which is the point. */
.mark-status[aria-pressed="true"] {
  --btn-bg: var(--brand-subtle);
  --btn-fg: var(--brand-strong);
  font-weight: var(--weight-strong);
}
.mark-status[aria-pressed="true"][data-tone="success"] {
  --btn-bg: var(--success-subtle);
  --btn-fg: var(--success-strong);
}
.mark-status[aria-pressed="true"][data-tone="danger"] {
  --btn-bg: var(--danger-subtle);
  --btn-fg: var(--danger-strong);
}
.mark-status[aria-pressed="true"][data-tone="warning"] {
  --btn-bg: var(--warning-subtle);
  --btn-fg: var(--warning-strong);
}
.mark-status[aria-pressed="true"][data-tone="info"] {
  --btn-bg: var(--info-subtle);
  --btn-fg: var(--info-strong);
}

.btn.tiny {
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
}

/* =============================================================================
   Teaching — the exam player, review, and the shared tab/score furniture.
   Tokens only, as everywhere else in this file.
   ========================================================================== */

/* --- exam eligibility: the compute row -------------------------------------
   A learner, two dates and the button on one `.row`. In the exam dialog at about 440px the
   row could not wrap, so the two date fields - an input at `width: 100%` contributes almost
   nothing to its item's minimum - were squeezed to a few pixels beside the picker (exam test,
   2026-10-23). The row now wraps, and each field keeps a floor it cannot shrink below, so a
   narrow dialog puts them on their own lines instead. At full width nothing moves. */
.elig-compute {
  flex-wrap: wrap;
  /* Every control has a label above it, so the row lines up on the fields' bottom edge and the
     button sits beside the last date rather than centred against label and field (owner queue
     2026-10-25, item 9). */
  align-items: flex-end;
}

/* The compute button keeps its own width; the fields share the rest. */
.elig-compute > .btn {
  flex: none;
}

.elig-compute > .combo,
.elig-compute > .form-field {
  min-inline-size: min(9rem, 100%);
}

/* --- the exam dialog's results tab: the count, two links and a note ---------
   On one `.row` that could not wrap, so at 320 and 375px the count broke in two («4 / cəhd»)
   and the monitor button and the note ran past the card (tutor device test 2026-10-29,
   row 28). The row wraps, the count stays whole, and the note breaks where it must. */
.results-tab-head {
  flex-wrap: wrap;
}

.results-tab-head > .stat__value {
  white-space: nowrap;
}

.results-tab-head > .tiny {
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

/* --- the exam player -------------------------------------------------------
   Deliberately outside the shell: a hard clock and an irreversible hand-in do
   not want a sidebar of things to click away to.
   -------------------------------------------------------------------------- */

.player {
  min-height: 100dvh;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: var(--container-lg);
  margin-inline: auto;
}

.player__bar {
  position: sticky;
  top: var(--space-2);
  z-index: var(--z-topbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--r-lg);
}

.player__title {
  display: flex;
  flex-direction: column;
}

.player__clock {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.player__time {
  font-size: var(--text-2xl);
  font-variant-numeric: tabular-nums;
  line-height: var(--leading-tight);
}

/* The last minute. Colour is the only change — the digits never jump size. */
.player__time--low {
  color: var(--danger);
}

.player__note {
  margin: 0;
}

.player__body {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-4);
  align-items: start;
}

.player__rail {
  /* Rows of numbers, as many columns as the exam needs (owner, 2026-11-09): one long column
     made 40 questions scroll beside the card. `--rail-cols` comes from the question count. */
  display: grid;
  grid-template-columns: repeat(var(--rail-cols, 1), max-content);
  justify-items: center;
  /* The current question wears an outline outside its box; the gap leaves room for it,
     or the ring sat on top of the next pip and of the "0 / 1" count beside it. */
  gap: calc(var(--space-2) + var(--focus-ring-width) + var(--focus-ring-offset));
  align-items: center;
  align-content: start;
  position: sticky;
  top: 6rem;
  /* NEVER TALLER THAN THE SCREEN (candidate audit B8): 45 pips were 1637 px tall and pinned, so
     pips 22-45 and the count showed only at the end of the page. It scrolls in its own height,
     with room on every side for the current pip's ring and the corner badges. */
  max-block-size: calc(100dvh - 7rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: calc(var(--space-2) + var(--focus-ring-width) + var(--focus-ring-offset));
}

/* In a rail of capped height a flex item would shrink to fit: the pips went to 24x18, under the
   24 px target. They keep their size, and the rail scrolls instead. */
.player__rail > * {
  flex-shrink: 0;
}

/* «Şagird kimi bax»: the band across the top of a staff preview. An info alert with its way
   out at the far end; on a narrow screen the button drops under the words rather than
   squeezing them. */
.player__preview {
  flex-wrap: wrap;
}

.player__preview > div {
  flex: 1 1 16rem;
  min-inline-size: 0;
}

.player__preview p {
  margin: 0;
}

/* The page a learner meets when the paper cannot open: one panel, not an empty screen. */
.player__refusal {
  inline-size: 100%;
  max-inline-size: var(--measure-lede);
  margin-block-start: var(--space-8);
  margin-inline: auto;
}

/* An empty state owns its viewport: the preview's empty paper sits in the middle of the
   screen, not as a small block under a thousand pixels of nothing. `.player` is already a
   full-height column. */
.player--empty {
  justify-content: center;
}

.player--empty .player__refusal {
  margin-block-start: 0;
}

.player__pip {
  width: var(--space-6);
  height: var(--space-6);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  cursor: pointer;
}

.player__pip--answered {
  background: var(--success-subtle);
  border-color: var(--success);
  color: var(--text);
}

.player__pip--current {
  outline: var(--focus-ring-width) solid var(--brand);
  outline-offset: var(--focus-ring-offset);
}

/* A FLAGGED QUESTION (owner queue 2026-10-25, item 17): the flag's own shape on the pip's
   corner, filled so it reads at this size, on the page's plane so the pip's edge does not cut
   through it. The shape is the mark; the answered tint underneath is unchanged.

   CENTRED ON THE CORNER, WITH ITS OWN EDGE. It sat a third outside and two thirds inside, so
   it read as a bite out of the pip's border. Now its centre is the pip's corner - the insets
   are minus half its size - and it wears the pip's own border, so it reads as a badge. Half
   of it outside is less than the gap the rail and the reminder leave between pips. */
.player__pip {
  position: relative;
}

.player__pip-flag {
  position: absolute;
  inset-block-start: calc(var(--space-3) / -2);
  inset-inline-end: calc(var(--space-3) / -2);
  inline-size: var(--space-3);
  block-size: var(--space-3);
  box-sizing: border-box;
  padding: 1px;
  border: 1px solid var(--border);
  border-radius: var(--r-circle);
  background: var(--surface-1);
  /* A flag is red wherever it shows (owner, 2026-11-09). */
  color: var(--danger);
  fill: currentColor;
  pointer-events: none;
}

/* AN ANSWER NOT YET ON THE SERVER (audit B1): the same corner badge on the other corner, so a
   flagged question that is also unsent wears both, in the danger ink the save marker uses. */
.player__pip-unsent {
  inset-inline-end: auto;
  inset-inline-start: calc(var(--space-3) / -2);
  color: var(--danger);
  fill: none;
}

/* The flag toggle on a question: a ghost button that keeps its pressed fill under the pointer,
   as the timetable's view switch does. */
.player__flag[aria-pressed="true"] {
  --btn-bg: var(--danger-subtle);
  --btn-fg: var(--danger-text);
}

/* The question's head in the player: the kind, the points, the flag and «Sualda xəta var»
   (item 18). Four things do not fit one line on a phone, and unwrapped they would widen the
   card past the viewport, so they wrap, as the review card's head does. */
.player__qhead {
  flex-wrap: wrap;
  min-inline-size: 0;
}

/* The points, the flag and the report stay on one row at every width (owner, 2026-11-09). The
   report's words give way first, with an ellipsis, so the row can never widen the card. */
.player__qtools {
  flex-wrap: nowrap;
  min-inline-size: 0;
}

.player__qtools > .tiny,
.player__qtools > .player__flag {
  flex: none;
  white-space: nowrap;
}

.player__qtools > .player__report {
  flex: 0 1 auto;
  min-inline-size: 0;
}

.player__report-label {
  min-inline-size: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@media (max-width: 40rem) {
  /* The row of three on top, the question's kind under it, then the question. */
  .player__qhead {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .player__qhead > .badge {
    align-self: flex-start;
  }

  .player__qtools {
    inline-size: 100%;
    justify-content: space-between;
    gap: var(--space-1);
  }
}

/* The hand-in reminder's numbers: the rail's pips, wrapped in a row, with room between them
   for the corner flag and the focus ring. */
.player__jumps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--space-2) + var(--focus-ring-width) + var(--focus-ring-offset));
}

/* The list headings sit under the dialog's title, not beside it: the small-heading size, so
   the title (18px in a compact dialog) leads and these read as the labels of two lists. */
.player__reminder-group > .label {
  margin: 0;
  font-size: var(--text-sm);
}

.player__question {
  padding: var(--space-5);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}

.player__text {
  font-size: var(--text-lg);
  line-height: var(--leading-body);
  margin: 0;
  /* The author's own line breaks (owner, 2026-10-25): a question written on several lines in
     the bank is shown on several lines, not run together into one. A long URL is one token
     that would otherwise set the card's width at 320 px. */
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* A question's picture in the player, the review and the marked paper (re-audit H-4): shown
   whole rather than cropped - a diagram cut to a square is a different question - and never
   wider than the card it sits in. Nor taller than half the window (walk 2026-11-14, #19): a
   1280 x 800 drawing filled a laptop's screen and pushed a True/False question's two options out
   of sight. Still whole, and pressing it opens it enlarged. */
.question-image {
  display: block;
  max-inline-size: 100%;
  max-block-size: 50dvh;
  block-size: auto;
  border-radius: var(--r-md);
}

/* THE PICTURE IS ALSO THE BUTTON THAT OPENS IT ENLARGED (`QuestionImage`): a diagram drawn
   303px wide on a phone may be unreadable. No chrome of its own - the picture is the target -
   so the button keeps the picture's radius for the global focus ring to follow. */
.question-image-zoom {
  display: block;
  max-inline-size: 100%;
  padding: 0;
  border: none;
  background: none;
  border-radius: var(--r-md);
  cursor: zoom-in;
}

/* An option's picture, beside the option's words: bounded in height, still whole. */
.question-image-zoom--compact {
  display: inline-block;
  vertical-align: middle;
  margin-inline-start: var(--space-2);
}

.question-image--compact {
  max-block-size: 6rem;
  inline-size: auto;
  object-fit: contain;
}

/* Enlarged in the dialog: the whole picture, within the body's own height cap. */
.question-image--zoomed {
  display: block;
  max-inline-size: 100%;
  max-block-size: 60dvh;
  margin-inline: auto;
  object-fit: contain;
}

/* The bank's and the paper builder's "this question has a picture". */
.question-picture-marker {
  display: inline-flex;
  vertical-align: middle;
  margin-inline-start: var(--space-2);
}

/* The editor's picture field: the picture, its name, and replace and remove beside it. */
.picture-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-inline-size: 0;
}

.picture-field__set {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-3);
  min-inline-size: 0;
}

.picture-field__set .question-image-zoom--compact {
  margin-inline-start: 0;
}

.picture-field__meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-inline-size: 0;
}

.picture-field__name {
  overflow-wrap: anywhere;
}

/* An option row wraps, so the option's picture, once it has one, takes a line under its text
   and the remove-option button stays beside the text it removes. */
.question-option-row {
  flex-wrap: wrap;
}

.question-option-row > .picture-field--block {
  order: 1;
  flex-basis: 100%;
}

.player__foot {
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-3);
}

/* The foot holds only the save state now, so it keeps one line while that is empty and the
   word appearing moves nothing. */
.player__foot .save-state {
  min-block-size: 1lh;
}

/* A long question brings the page scrollbar and a short one takes it away, which moved the
   arrows sideways from one question to the next. The gutter stays reserved during a sitting. */
:root:has(.player__question) {
  scrollbar-gutter: stable;
}

.save-state--saved {
  color: var(--success);
}

.save-state--error {
  color: var(--danger);
}

.save-state--saving {
  color: var(--text-tertiary);
}

/* A recording's speed choice: as wide as its longest choice, as the filter bar's selects are,
   never stretched across the card by `.field`'s full width. */
.rec-speed .field {
  width: auto;
}

@media (max-width: 48rem) {
  /* `minmax(0, 1fr)`, not `1fr`: an `auto` minimum let the paper's widest line size the one
     column, and at 280px with 125% text the rail ran 18px past the screen (tutor device
     re-test 2026-10-29). */
  .player__body {
    grid-template-columns: minmax(0, 1fr);
  }

  .player__rail {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    position: static;
  }
}

/* --- the player on a phone (owner-approved, 2026-10-22) ---------------------
   Measured before this block: the sticky bar was 281 px of 568 at 320x568, 172 of
   844 at 390x844 and 85 of 390 in phone landscape, and the next button sat below
   the fold on every question at 320. Two conditions make a screen a phone here:
   narrower than 40rem (`--bp-sm`, 640px), or shorter than 30rem (480px), which
   is what catches a phone held sideways and leaves a tablet as it was.

   The full title and the dock exist in the markup at every width and are shown
   only here; wider screens keep the bar's two-line title and the card's arrows. */
.player__heading,
.player__dock {
  display: none;
}

/* The bar and, on a phone, the dock under it. Wider screens lay the bar out as if this were not here. */
.player__top {
  display: contents;
}

@media (max-width: 40rem), (max-height: 30rem) {
  /* Focus moved by Tab or by the arrows must land clear of both bars (WCAG 2.4.11).
     Each is at most a comfortable target plus its padding tall. */
  :root:has(.player__dock) {
    scroll-padding-block-start: calc(var(--target-comfortable) * 2 + var(--space-2) * 6);
  }

  .player {
    padding: var(--space-2) var(--space-3);
    gap: var(--space-2);
  }

  /* One sticky block, so the dock sits under the bar whatever height the bar comes to. */
  .player__top {
    position: sticky;
    inset-block-start: var(--space-1);
    z-index: var(--z-topbar);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
  }

  /* One row: the title takes what is left and ends in an ellipsis; the clock and Submit
     keep their own width. */
  .player__bar {
    top: var(--space-1);
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
  }

  .player__title {
    flex: 1 1 auto;
    min-inline-size: 0;
  }

  .player__title strong {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .player__position {
    display: none;
  }

  .player__clock {
    position: relative;
    flex: none;
  }

  .player__time {
    font-size: var(--text-xl);
  }

  /* Still read out beside the time; only its line on screen is given back. */
  .player__clock-label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .player__submit {
    flex: none;
  }

  /* THE QUESTION FIRST (candidate audit B4, 2026-11-01). Above the question sat the full title
     again (62 px at 320), the note (50 px) and the rail (204 px for 45 questions): at 320x568 the
     question began at y=583, below the screen. The page's heading and the note stay for screen
     readers; on screen the full title and the note are in the question list's sheet, opened from
     the dock, which replaces the rail here. */
  .player__heading,
  .player__note {
    display: block;
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .player__rail {
    display: none;
  }

  .player__arrows {
    display: none;
  }

  /* Previous, where we are, next: under the bar, in the sticky block above. */
  .player__dock {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--r-lg);
  }

  /* The position, which opens the question list, gives way first: at 280 px with 125% text
     "Sual 16 / 45" and its chevron were 10 px wider than the room between the arrows. It may
     shrink and wrap; the arrows keep their size. */
  .player__dock > .btn[aria-haspopup] {
    flex: 0 1 auto;
    min-inline-size: 0;
    white-space: normal;
    text-align: center;
  }

  .player__dock > .btn:not([aria-haspopup]) {
    flex: none;
  }
}

/* 22rem and under (the responsive test of 2026-11-09). With a section to finish the bar held two
   buttons that do not shrink, and Submit left the screen at 320 px and under: the title takes its
   own line and the buttons wrap. The report label wraps instead of being cut. */
@media (max-width: 22rem) {
  .player__bar:has(> .btn--secondary) {
    flex-wrap: wrap;
  }

  .player__bar:has(> .btn--secondary) :is(.player__title, .player__run-compact) {
    flex-basis: 100%;
  }

  .player__bar:has(> .btn--secondary) > .btn {
    flex: 1 1 auto;
    min-inline-size: 0;
    white-space: normal;
  }

  .player__qtools {
    flex-wrap: wrap;
  }

  .player__report-label {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}

/* A thumb, not a cursor: the player's primary controls reach the comfortable target and
   the question pips 32px (`--space-7`). A mouse keeps the dense desktop sizes. */
@media (pointer: coarse) {
  .player__submit,
  .player__dock .btn,
  .player__arrows .btn,
  .answer-order__item .btn {
    min-block-size: var(--target-comfortable);
    min-inline-size: var(--target-comfortable);
  }

  /* The rest of the bar, the flag and the report, and the player's own dialogs' buttons - the
     hand-in first (phone walk 2026-11-22, finding 5): 30 to 34 px tall under a thumb before. Only
     the height; their labels already make them wide enough. */
  .player__bar .btn,
  .player__run-pinned .btn,
  .player__flag,
  .player__report,
  .listening-unlock,
  .player .modal__foot .btn {
    min-block-size: var(--target-comfortable);
  }

  .player__pip {
    width: var(--space-7);
    height: var(--space-7);
  }
}

/* --- answer inputs --------------------------------------------------------- */

.answer-choices {
  border: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  /* A fieldset's minimum is its min-content: one unbreakable token in an option (a 62-character
     URL) widened it to 464 px and the whole player scrolled sideways (candidate audit B3). */
  min-inline-size: 0;
}

.answer-choice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  cursor: pointer;
}

.answer-choice:hover {
  background: var(--surface-2);
}

.answer-choice:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-subtle);
}

/* Options that are nothing but their letters (owner, 2026-11-13): side by side in one row that
   wraps, each the same card it is when stacked. A note above them keeps a line of its own, and a
   card is at least a comfortable target wide, since a letter alone would make it a sliver.

   WARNING: TWO CLASSES ON PURPOSE. The maker's preview is a list, `.answer-choices.plain`, and `.plain`
     is a column declared further down this file: a single-class row lost to it by source order and
     the preview stayed stacked (browser walk, 2026-11-13). Named with its block, the row outweighs
     `.plain` wherever either stands, and `.plain` is untouched for everybody else. */
.answer-choices.answer-choices--row {
  flex-direction: row;
  flex-wrap: wrap;
}

.answer-choices.answer-choices--row > p {
  flex-basis: 100%;
  margin: 0;
}

.answer-choices.answer-choices--row > .answer-choice {
  align-items: center;
  min-inline-size: var(--target-comfortable);
  min-block-size: var(--target-comfortable);
}

/* The option's words wrap anywhere, so a long word or a URL breaks inside the card. */
.answer-choice > span {
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

/* On the attempt paper an option carries the key's badge after its words. In one unwrapping
   row the two set the row's minimum, and at 320px with 125% type that pushed the page 10px
   sideways (tutor device test 2026-10-29, row 44). They wrap together, at the row's own gap,
   so a wide screen reads as it did. */
.paper-choice__body {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-1) var(--space-3);
  min-inline-size: 0;
}

.paper-choice__body > span:first-child {
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

.answer-pair {
  display: grid;
  /* `minmax(0, 1fr)`: an `auto` minimum let a long word, or the widest option in the select,
     size the column past the card (candidate audit B3). */
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-3);
  align-items: center;
}

.answer-pair__left {
  padding: var(--space-2) var(--space-3);
  background: var(--surface-2);
  border-radius: var(--r-sm);
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

/* A select is as wide as its longest option unless told otherwise. */
.answer-pair > .field,
.answer-pair select {
  inline-size: 100%;
  min-inline-size: 0;
  max-inline-size: 100%;
}

/* On a phone the item and its choice share a column, the item above, so neither is squeezed to
   a few letters a line. */
@media (max-width: 30rem) {
  .answer-pair {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-1);
  }
}

.answer-order {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  counter-reset: order;
}

.answer-order__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  counter-increment: order;
}

/* The item's words wrap anywhere; the move buttons keep their size beside them. */
.answer-order__item > .grow {
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

.answer-order__item > .btn {
  flex: none;
}

.answer-order__item::before {
  content: counter(order);
  font-variant-numeric: tabular-nums;
  color: var(--text-tertiary);
  font-size: var(--text-sm);
  min-width: var(--space-4);
}

/* --- review ----------------------------------------------------------------
   Three verdicts, not two: `isCorrect: null` means nobody has marked it yet and
   must never look like a cross.
   -------------------------------------------------------------------------- */

.score-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  border-radius: var(--r-lg);
  margin-bottom: var(--space-5);
}

.score-card__figure {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
}

.score-card__score {
  font-size: var(--text-2xl);
  font-variant-numeric: tabular-nums;
}

/* A marked piece of homework, at the top of its dialog: the mark, then what the teacher
   wrote, kept in the line breaks they typed. */
.hw-result__mark {
  white-space: nowrap;
}

.hw-result__feedback {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* An invitation's addressee is one unbreakable token; let it wrap rather than widen the table. */
.invite-address {
  overflow-wrap: anywhere;
}

/* The status badge keeps its own width above the date line, rather than the column's. */
.invite-state {
  align-items: flex-start;
}

/* The portfolio's share link (re-audit S-1, audit STU-18): one unbreakable address beside two
   buttons widened the page past 375px. The buttons wrap under the address on a phone and the
   address breaks anywhere; on a wide screen the row reads as it did. */
.share-row {
  flex-wrap: wrap;
}

.share-row > code {
  flex: 1 1 12rem;
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

/* An exam share link that no longer opens (revoked or expired) keeps its address on screen so
   the teacher can tell which one it was, struck through rather than dimmed: the text keeps
   its contrast, and the row's state badge says why. */
.share-row--spent > code {
  text-decoration-line: line-through;
}

/* Who a homework reaches and has not handed it in, above the submissions table (QA tutor#17).
   Names are plain badges in a wrapping row: read, not pressed. */
.hw-missing__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.score-card__pct {
  font-size: var(--text-lg);
  color: var(--text-secondary);
}

.review-q {
  padding: var(--space-4);
  border-radius: var(--r-md);
  border-inline-start: var(--space-1) solid var(--border);
  background: var(--surface-1);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* The card's head carries the kind, the verdict, the points and the report button; on a
   phone those do not fit one line, and unwrapped they widened the bare review page past the
   viewport. They wrap instead. */
.review-q > header,
.review-q > header .row {
  flex-wrap: wrap;
  min-inline-size: 0;
}

.review-q--correct {
  border-inline-start-color: var(--success);
}

.review-q--wrong {
  border-inline-start-color: var(--danger);
}

.review-q--pending {
  border-inline-start-color: var(--warning);
}

.review-q__text,
.paper-q__text {
  margin: 0;
  font-weight: var(--weight-medium);
  /* Kept as written, like the player's (owner, 2026-10-25). */
  white-space: pre-line;
}

/* A long URL in a question is one unbreakable token; at 320 px it widened the review card. */
.review-q__text {
  overflow-wrap: anywhere;
}

.paper-q__text {
  font-weight: inherit;
}

/* --- sitting an exam by link (/sit/:token) ---------------------------------
   The anonymous card is the auth card; only two narrow-width defences are new.
   An e-mail, a long surname or an organisation's name is one unbreakable token,
   and `break-word` alone would not shrink the card's min-content at 320px.
   -------------------------------------------------------------------------- */

.sit-card {
  overflow-wrap: anywhere;
}

.sit-card .field {
  inline-size: 100%;
  min-inline-size: 0;
}

.sit-card .kv dd {
  min-inline-size: 0;
}

/* THE TEACHER'S CODE-ENTRY PAGE NEVER SCROLLS THE DOCUMENT (owner, 2026-11-09). The page is exactly
   one dynamic viewport tall, padding included, and the card can be no taller than what is left of
   it; what cannot fit scrolls inside the card, behind a cue. `sitLayout.tsx` picks the layout and
   sets the class; only the two height tiers below are media queries, and they only tighten. */
.auth-page.sit-page {
  block-size: 100dvh;
  min-block-size: 0;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
}

.auth-card.sit-card--fit {
  max-block-size: 100%;
  min-block-size: 0;
}

/* Every state of the page that is not the form: the card's body scrolls, its footer does not. */
.sit-card__scroll {
  flex: 1 1 auto;
}

.sit-card--fit > .auth-card__footer {
  flex: none;
}

/* The area a card scrolls in. The inset and its negative margin keep a field's focus ring inside
   the clip without moving the fields off the card's own edge. */
.sit-scrollbox {
  position: relative;
  display: flex;
  flex-direction: column;
  min-block-size: 0;
  min-inline-size: 0;
}

.sit-scrollbox__area {
  flex: 1 1 auto;
  min-block-size: 0;
  overflow-y: auto;
  padding: var(--space-1);
  margin: calc(var(--space-1) * -1);
}

.sit-scrollbox__content {
  display: flex;
  flex-direction: column;
  gap: var(--sit-gap, var(--space-3));
}

/* The cue: the last lines fade and an arrow says there is more. `--text` only as an opaque mask. */
.sit-scrollbox[data-more] > .sit-scrollbox__area {
  -webkit-mask-image: linear-gradient(to bottom, var(--text) calc(100% - var(--space-7)), transparent);
  mask-image: linear-gradient(to bottom, var(--text) calc(100% - var(--space-7)), transparent);
}

.sit-scrollbox__more {
  display: none;
  position: absolute;
  inset-block-end: 0;
  inset-inline: 0;
  justify-content: center;
  color: var(--text-secondary);
  pointer-events: none;
}

.sit-scrollbox[data-more] > .sit-scrollbox__more {
  display: flex;
}

/* The two layouts share these. The form's fields scroll; its buttons never do. */
.sit-entry__about {
  grid-area: about;
  min-inline-size: 0;
}

.sit-entry__form {
  grid-area: form;
  min-block-size: 0;
  min-inline-size: 0;
  gap: var(--sit-gap);
}

.sit-entry__fields {
  flex: 1 1 auto;
}

.sit-entry__actions {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.sit-entry__privacy {
  margin: 0;
}

.sit-entry__buttons {
  display: flex;
  gap: var(--space-2);
}

.sit-entry__buttons > .btn--primary {
  flex: 1 1 auto;
}

.sit-step {
  display: flex;
  flex-direction: column;
  gap: var(--sit-gap);
  min-inline-size: 0;
}

/* `display: flex` above outranks the browser's own rule for the attribute. */
.sit-step[hidden] {
  display: none;
}

/* A pair by the room the card has, not the window's: side by side in a column and on a wide step. */
.sit-step__pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(10rem, 100%), 1fr));
  gap: var(--sit-gap);
}

.sit-step__pair > .form-field,
.sit-step__code,
.sit-step__bot {
  min-inline-size: 0;
}

/* Nothing to show until a site key is known. */
.sit-step__bot:empty {
  display: none;
}

/* Two columns: the exam, its privacy link and the language on the left; the form on the right. */
.auth-card.sit-card--columns {
  --sit-gap: var(--space-4);
  display: grid;
  max-width: 56rem;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas:
    "about form"
    "foot form";
  gap: var(--space-4) var(--space-7);
}

.sit-card--columns > .sit-entry__about {
  align-self: start;
  max-block-size: 100%;
}

.sit-card--columns .sit-entry__privacy {
  margin-block-start: var(--space-4);
}

.sit-card--columns > .auth-card__footer {
  grid-area: foot;
  margin-top: 0;
  padding-top: var(--space-3);
}

/* Two steps: the step line and the language on one row, the exam under them, then the step. */
.auth-card.sit-card--steps {
  --sit-gap: var(--space-3);
  display: grid;
  max-width: 36rem;
  padding: var(--space-4);
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto minmax(0, 1fr);
  grid-template-areas:
    "step foot"
    "about about"
    "form form";
  gap: var(--space-2) var(--space-3);
}

/* Positioned, so the spoken name of the step resolves against this box and not the page. */
.sit-entry__step {
  grid-area: step;
  position: relative;
  align-self: center;
  margin: 0;
}

.sit-card--steps > .auth-card__footer {
  grid-area: foot;
  margin: 0;
  padding: 0;
  border: 0;
  justify-content: flex-end;
}

.sit-line__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  margin: 0;
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
}

.sit-line__facts {
  margin: var(--space-1) 0 0;
}

/* Not forty of anything, but a short phone's step needs every line it can get. */
@media (max-height: 40rem) {
  .auth-page.sit-page {
    padding: var(--space-2);
  }

  .auth-card.sit-card--steps {
    --sit-gap: var(--space-2);
    max-width: 44rem;
    padding: var(--space-3);
  }

  .sit-card--steps .sit-step__consent .checkbox-row {
    font-size: var(--text-xs);
  }
}

/* A phone on its side: the step line, the exam and the language share one row, the facts stay on
   one line and give up their tail first, and the code and the bot check stand side by side. */
@media (max-height: 30rem) {
  .auth-page.sit-page {
    padding: var(--space-1);
  }

  .auth-card.sit-card--steps {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
      "step about foot"
      "form form form";
    max-width: none;
  }

  .sit-line__title {
    -webkit-line-clamp: 1;
    line-clamp: 1;
    font-size: var(--text-md);
  }

  .sit-line__facts {
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sit-card--steps .sit-step--code {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .sit-card--steps .sit-step__code {
    flex: 1 1 12rem;
  }

  /* The widget does not draw narrower than this. */
  .sit-card--steps .sit-step__bot {
    flex: 0 0 18.75rem;
    max-inline-size: 100%;
    order: 1;
  }

  .sit-card--steps .sit-step__consent {
    flex: 1 1 100%;
    order: 2;
  }

  .sit-card--steps .sit-entry__actions {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
  }

  .sit-card--steps .sit-entry__privacy {
    flex: 1 1 auto;
    min-inline-size: 0;
  }

  .sit-card--steps .sit-entry__buttons {
    flex: 0 1 auto;
    margin-inline-start: auto;
  }
}

/* --- tabs ------------------------------------------------------------------ */

.tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-4);
  overflow-x: auto;
}

.tab {
  padding: var(--space-2) var(--space-4);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.tab--active {
  color: var(--text);
  border-bottom-color: var(--brand);
  font-weight: var(--weight-medium);
}

/* A tab strip with the screen's own buttons at its far end. The rule moves from the
   strip to the row so it runs under the buttons too, and the row aligns to its bottom
   edge: the active tab's underline is the tab's own border, so the tabs have to sit on
   the rule for the two lines to meet. A tab and a button are the same height, so
   centring them lines up their middles AND keeps the tabs on the rule; bottom-aligning
   with padding under the button measured it 8px higher than the tab labels. */
.tabs-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-4);
}

.tabs-row > .tabs,
.tabs-row > .table-frame {
  flex: 1 1 auto;
  min-inline-size: 0;
}

/* A strip that wears the edge cue sits in the row inside its frame (flow test F-19, re-audit
   S-1), so the row's rule replaces the strip's own there too. */
.tabs-row > .tabs,
.tabs-row > .table-frame > .tabs {
  border-bottom: none;
  margin-bottom: 0;
}

.tabs-row__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-inline-start: auto;
}

.plain {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* --- the institution's own profile and its org-level ladder -----------------
   The ladder is a list whose ORDER IS THE CONTAINMENT ORDER, so it is an `<ol>`
   and the ordinal is rendered rather than implied — a reader has to be able to
   say "Faculty is level 1" out loud, and a bare stack of cards does not let
   them.

   `.mat-inset` per rung, never `.mat`: these are repeated siblings on the page
   ground, which is the case CLAUDE.md names as the way to get glass wrong. Each
   `.mat` is a backdrop-filter plus a noise layer plus a sheen layer, and a
   university's four rungs would pay for all three four times over for no floating
   surface at all.

   The three name boxes are a grid rather than a `.row`, because a `.row` is a
   flex line that does not wrap: at 320px three inputs and a select would push the
   page into a horizontal scroll. `minmax(0, 1fr)` is the load-bearing half — a
   grid item keeps `min-width: auto`, so an `<input>`'s intrinsic ~20-character
   width would size the track and overflow anyway.
   -------------------------------------------------------------------------- */

.inst-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(12rem, 100%), 1fr));
  gap: var(--space-3);
  margin: 0;
}

.inst-facts dd {
  margin: 0;
}

.ladder {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.ladder__rung {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* On the page ground there is no glass behind an inset to draw its edge, so it
   needs the border the material would otherwise have supplied. */
[data-family='glass'] .ladder__rung {
  border-color: var(--border);
}

.ladder__ordinal {
  font-size: var(--text-lg);
  color: var(--text-tertiary);
}

.ladder__fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr));
  gap: var(--space-3);
}

.ladder__fields .field {
  inline-size: 100%;
  min-inline-size: 0;
}

/* A tutor's week as a calendar: seven day columns, the clock down the side, every lesson a
   block at its real time.

   ⚠ THE HEIGHT IS A TOKEN TIMES THE HOURS ON SCREEN (`--ttc-hours`, set from the data), so
     a tutor who teaches four hours gets four hours of grid and one who teaches twelve gets
     twelve, at the same scale.

   ⚠ THE BLOCKS ARE PLACED BY PERCENTAGE, which is why each day column is positioned and the
     hour lines inside it are absolute. A grid of discrete rows would round a 15:46 start to
     the nearest row and move the lesson without saying so.

   ⚠ IT SCROLLS SIDEWAYS INSIDE `.table-scroll`, which already draws the edge cue this
     product uses for a region that scrolls: seven columns do not fit a phone, and a hidden
     overflow that says nothing loses the columns for sighted readers. */
.ttc {
  /* ⚠ ONE HOUR IS 80px, NOT 40. At 40 an hour-long lesson was a box one line and a half
     tall holding a subject, a group, its times and two buttons; the times and the buttons
     were what got cut, on every one-hour and ninety-minute card. 80 holds the three lines a
     block has - title, detail, times - with the actions in its top corner. */
  --ttc-hour: calc(var(--space-8) * 2);
  display: grid;
  grid-template-columns: auto repeat(7, minmax(8rem, 1fr));
  gap: var(--space-1);
  min-inline-size: 100%;
}

.ttc__corner,
.ttc__head {
  padding-block-end: var(--space-2);
  border-block-end: 1px solid var(--border-subtle);
}

.ttc__corner {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  align-self: end;
}

.ttc__head {
  display: flex;
  flex-direction: column;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
}

.ttc__dayname {
  color: var(--text);
}

.ttc__hours,
.ttc__day {
  position: relative;
  block-size: calc(var(--ttc-hour) * var(--ttc-hours));
}

.ttc__hours {
  display: flex;
  flex-direction: column;
  padding-inline-end: var(--space-2);
}

.ttc__hour {
  flex: 1 1 0;
  white-space: nowrap;
  /* Sat against the line it names rather than centred in the band below it. */
  transform: translateY(-0.5em);
}

.ttc__line {
  position: absolute;
  inset-inline: 0;
  inset-block-start: calc((100% / var(--ttc-hours)) * var(--ttc-line, 0));
  border-block-start: 1px solid var(--border-subtle);
}

.ttc__none {
  position: absolute;
  inset-inline: 0;
  inset-block-start: 45%;
  text-align: center;
}

.ttc__lesson {
  position: absolute;
  inset-inline: 0;
  inset-block-start: var(--ttc-top);
  block-size: var(--ttc-height);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--r-md);
  background: var(--surface-2);
  /* ds-allow-hardcode: the bar that marks a block, at the width every other emphasis rule
     in this file uses. There is no border-width token to name it with. */
  border-inline-start: 2px solid var(--brand); /* ds-allow-hardcode */
}

/* ⚠ THE KIND IS CARRIED BY THE BAR AND BY THE WORD ON THE BLOCK, never by the bar alone:
   the meta line names it ("Fərdi dərs"), so the colour is a second carrier. */
.ttc__lesson[data-kind='booking'] {
  border-inline-start-color: var(--success);
}

.ttc__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text);
}

/* Today's column: its heading in the brand's text colour and its band faintly tinted, so
   the eye has a first place to land in a week of seven equal columns. The heading also
   says "Bu gün" in words. */
.ttc__head--today .ttc__dayname {
  color: var(--brand-text);
  font-weight: var(--weight-strong);
}

.ttc__day--today {
  background: var(--brand-subtle);
  border-radius: var(--r-md);
}

/* A block that opens its lesson. A button wearing the block's look: the browser's own
   border, font and alignment are put back to the block's. */
.ttc__lesson--open {
  font: inherit;
  text-align: start;
  color: inherit;
  border: 0;
  /* ds-allow-hardcode: the same 2px bar as `.ttc__lesson` above. */
  border-inline-start: 2px solid var(--brand); /* ds-allow-hardcode */
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}

.ttc__lesson--open[data-kind='booking'] {
  border-inline-start-color: var(--success);
}

.ttc__lesson--open:hover {
  background: var(--surface-3);
}

/* What a learner's block says after its times, one line each and wrapping rather than
   cut: the teacher's name used to sit beside the subject and lose its second half. */
.ttc__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

/* One line each, so the times and the actions below them keep their place. What a short
   block cannot show it shows on hover or when anything in it has focus: the block grows
   over its neighbours rather than cutting the sentence. */
.ttc__title,
.ttc__meta {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ttc__lesson:is(:hover, :focus-within) {
  z-index: 1;
  block-size: auto;
  min-block-size: var(--ttc-height);
  overflow: visible;
}

.ttc__lesson:is(:hover, :focus-within) :is(.ttc__title, .ttc__meta) {
  white-space: normal;
}

.ttc__time {
  white-space: nowrap;
}

/* Edit and delete in the block's top corner, over the end of the title line, which leaves
   room for them. 24px targets, the WCAG 2.5.8 minimum, so two fit beside a narrow title. */
.ttc__actions {
  position: absolute;
  inset-block-start: var(--space-1);
  inset-inline-end: var(--space-1);
  flex-wrap: nowrap;
  gap: 0;
}

.ttc__actions .btn.tiny {
  min-block-size: var(--space-6);
  min-inline-size: var(--space-6);
  padding: var(--space-1);
}

.ttc__lesson:has(.ttc__actions) .ttc__title {
  padding-inline-end: var(--space-9);
}

/* The view switch is a pair of toggles. The pressed one keeps its selected look under the
   pointer too: the ghost hover would otherwise swap it back to a plain chip while hovered. */
.ttc__views .btn[aria-pressed="true"] {
  --btn-bg: var(--brand-subtle);
  --btn-fg: var(--brand-strong);
}

/* The week as text: a panel per day, padded like every other panel, with the day's date
   beside its name because a one-to-one lesson belongs to one date. */
.ttc-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.ttc-list__day {
  padding: var(--space-4) var(--space-5);
}

[data-family="glass"] .ttc-list__day {
  border-color: var(--border);
}

.ttc-list__head {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin: 0 0 var(--space-2);
  font-size: var(--text-base);
  font-weight: var(--weight-strong);
}

.ttc-list__lessons {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.ttc-list__lesson {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  padding-block: var(--space-2);
  padding-inline-start: var(--space-3);
  border-block-start: 1px solid var(--border-subtle);
  /* ds-allow-hardcode: the same 2px bar that marks a block on the week grid. */
  border-inline-start: 2px solid var(--brand); /* ds-allow-hardcode */
}

.ttc-list__lesson:first-child {
  border-block-start: 0;
}

.ttc-list__lesson[data-kind='booking'] {
  border-inline-start-color: var(--success);
}

.ttc-list__what {
  display: flex;
  flex-direction: column;
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

.ttc-list__actions {
  gap: var(--space-1);
}

.ttc__bar {
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* The unified lesson schedule (`pages/schedule/`, owner 2026-10-08): a tutor's week of
   lessons, exams, homework deadlines, meetings and open slots, as seven day columns of cards
   or as the same days stacked.

   ⚠ THE DAYS ARE `.mat-inset` ON THE PAGE GROUND, with the border role for an edge under
     glass, as the landing page's repeated cards are. Seven sibling `.mat` panels would be the
     wall of glass the house rules forbid; the cards inside a day are plain surfaces.

   ⚠ THE KIND IS SAID IN WORDS ON EVERY CARD ("Dərs", "İmtahan", "Açıq vaxt"), so the bar
     colour is a second carrier and never the only one. An open slot is drawn dashed: it is
     time offered, not time taken.

   ⚠ FOUR COLUMNS AT 850px AND ONE DAY PER ROW AT 520px, as the prototype folds the week on
     a phone. The cards wrap their text rather than cut it. */
/* The page's blocks sit in one column with the workspace's gap between them: the head, the
   week bar, the filters, a notice, the panels, the week and the line under it. The column owns
   the gap, so a block's own outer margin (the filter bar's) is dropped rather than doubled. */
.sch {
  gap: var(--space-4);
  min-inline-size: 0;
}

/* ⚠ NOT A DIALOG: a `<dialog>` rendered here is centred by its own `margin: auto`. */
.sch > :not(dialog) {
  margin-block: 0;
}

.sch-head {
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3);
}

.sch-head__title {
  margin: 0;
}

/* The toolbar is one panel: the week line on top, the labelled filters, then the open-time
   switches. The first and last take a whole line each. */
.sch-toolbar__week,
.sch-toolbar__open {
  flex-basis: 100%;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.sch-toolbar__open {
  gap: var(--space-4);
}

/* WARNING: THE WEEK LINE IS TWO LINES ON A PHONE (device test row 40): the week and its
   arrows, then "Bu gün" and the two views. As one cluster the arrows, the range and "Bu gün" needed 313px
   of 296 at 320, ran past the panel, and squeezed the range into three lines; at 125% text the
   page scrolled sideways. Here the cluster's box steps aside (`display: contents`), so its
   four controls wrap with the views as one line of items, and the range's basis is exactly
   the room the two arrows leave - which is what puts "Bu gün" at the start of the next line.
   The arrows are the 34px square of an icon-only control there. The range keeps one line at
   375px; at 320, or with larger text, it breaks after its dash, centred between them. */
@media (max-width: 32.5rem) {
  .sch-toolbar__nav {
    display: contents;
  }

  .sch-toolbar__step {
    inline-size: var(--control-md);
    padding-inline: 0;
  }

  .sch-toolbar__range {
    flex: 1 0 calc(100% - 2 * (var(--control-md) + var(--space-2)));
    min-inline-size: 0;
    text-align: center;
  }
}

/* A searchable filter fills its labelled group, as on the journal: otherwise the field kept
   its own width and its chevron sat outside it at the group's edge. */
.sch .filter-group .combo__field {
  inline-size: 100%;
}

/* WARNING: A NATIVE SELECT MAY SHRINK WITH ITS GROUP (design review #11). `.filter-bar .field` gives
   every bare filter a 10rem floor; at 390px two groups share about 150px each, so the subject
   select kept its 160px and ran 19px under the next one with no gutter. The select already
   fills its wrapper (`.select-clear__field`, `.combo`), so dropping the floor changes nothing
   where the group is wider - narrow-width defence #2. */
.sch .filter-group .field {
  min-inline-size: 0;
}

/* The week is one board split by hairlines (the prototype's grid), not seven panels. Each day
   draws the line on its start and top edge only where another day sits beside or above it,
   so the board's own edge is never doubled. */
.sch-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.sch-day {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-inline-size: 0;
  min-block-size: calc(var(--space-9) * 4);
  padding: var(--space-3);
}

.sch-day:not(:nth-child(7n + 1)) {
  border-inline-start: 1px solid var(--border-subtle);
}

[data-family="glass"] :is(.sch-week, .sch-detail, .sch-panel) {
  border-color: var(--border);
}

.sch-day--today {
  background: var(--brand-subtle);
}

.sch-day__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin: 0 0 var(--space-1);
  padding-block-end: var(--space-2);
  border-block-end: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
}

/* WARNING: `-strong`, NOT `-text` (design review #5, 2026-10-15). The day sits on `--brand-subtle`,
   and text on an accent's own subtle fill is exactly the pair `--brand-strong` is locked for;
   `--brand-text` is locked against the plain surfaces, and on the tint it measured 4.49:1. */
.sch-day--today .sch-day__head {
  color: var(--brand-strong);
  font-weight: var(--weight-strong);
}

.sch-day__num {
  font-size: var(--text-lg);
  color: var(--text);
}

.sch-day--today .sch-day__num {
  color: var(--brand-text);
}

.sch-day__none {
  margin: 0;
}

.sch-event {
  font: inherit;
  color: inherit;
  text-align: start;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  inline-size: 100%;
  min-inline-size: 0;
  padding: var(--space-2);
  border: 1px solid var(--border-subtle);
  /* ds-allow-hardcode: the same 2px bar that marks a block on the tutor's old week. */
  border-inline-start: 2px solid var(--brand); /* ds-allow-hardcode */
  border-radius: var(--r-md);
  background: var(--surface-2);
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}

.sch-event:hover {
  background: var(--surface-3);
}

.sch-event[aria-pressed="true"] {
  border-color: var(--brand-border);
  background: var(--brand-subtle);
}

.sch-event__kind {
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
}

.sch-event__title {
  font-size: var(--text-sm);
}

/* A status wraps inside its card rather than running past the card's edge in a narrow day. */
:is(.sch-event, .sch-row) > .badge {
  max-inline-size: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* A plain status (Planned, Cancelled) on a card: the neutral badge's fill is the card's own
   surface, so it read as stray indented text. One step up the surface scale makes it a pill. */
.sch-event > .badge:not([class*="badge--"]) {
  background: var(--surface-3);
}

/* The tutor's exam label (group 1b, H3): a pill sized to its words, at the start of a card, a
   list line or the details header, that wraps rather than running past a narrow day. It may
   hold sixty characters and a badge does not wrap by default. The card's own step up the
   surface scale (above) everywhere it appears: on the details panel and a list line the neutral
   fill is that surface too, and the label read as loose text. */
.sch-label {
  align-self: flex-start;
  max-inline-size: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  background: var(--surface-3);
}

:is(.sch-event, .sch-row)[data-kind="IndividualLesson"] {
  border-inline-start-color: var(--success);
}

:is(.sch-event, .sch-row)[data-kind="Exam"] {
  border-inline-start-color: var(--warning);
}

:is(.sch-event, .sch-row)[data-kind="HomeworkDue"] {
  border-inline-start-color: var(--info);
}

:is(.sch-event, .sch-row)[data-kind="Meeting"] {
  border-inline-start-color: var(--text-tertiary);
}

.sch-event[data-kind="OpenSlot"] {
  border-style: dashed;
  border-color: var(--border-strong);
  background: transparent;
}

.sch-row[data-kind="OpenSlot"] {
  border-inline-start-style: dashed;
  border-inline-start-color: var(--border-strong);
}

.sch-event[data-kind="OpenSlot"][aria-pressed="true"] {
  border-color: var(--brand-border);
  background: var(--brand-subtle);
}

/* The list: the old week's list panels, with each line a button that opens its event. */
.sch-list__day--today {
  border-color: var(--brand-border);
}

.sch-row {
  font: inherit;
  color: inherit;
  text-align: start;
  inline-size: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  padding-block: var(--space-2);
  padding-inline: var(--space-3);
  border: 0;
  border-block-start: 1px solid var(--border-subtle);
  /* ds-allow-hardcode: the same 2px bar as `.sch-event`. */
  border-inline-start: 2px solid var(--brand); /* ds-allow-hardcode */
  background: transparent;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}

.ttc-list__lessons > li:first-child > .sch-row {
  border-block-start: 0;
}

.sch-row:hover {
  background: var(--surface-2);
}

.sch-row[aria-pressed="true"] {
  background: var(--brand-subtle);
}

.sch-row__time {
  white-space: nowrap;
}

.sch-row__what {
  display: flex;
  flex-direction: column;
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

.sch-under {
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* The rules and the requests, and the selected event below the week. */
.sch-panel {
  min-inline-size: 0;
}

.sch-rules {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.sch-linked {
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--r-md);
  background: var(--surface-2);
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

.sch-detail {
  padding: var(--space-5);
  min-inline-size: 0;
}

.sch-detail__title {
  margin: 0;
  overflow-wrap: anywhere;
}

.sch-detail__sub {
  margin: 0;
  font-size: var(--text-base);
}

.sch-detail__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-5);
}

.sch-detail__note {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.sch-toggle[aria-pressed="true"] {
  --btn-bg: var(--brand-subtle);
  --btn-fg: var(--brand-strong);
}

.sch-form__hint {
  margin: 0;
}

/* The exam-overlap warning in a dialog's foot (round 2) takes the whole first line, so its two
   answers sit under it at their own height instead of stretching beside a two-line note. */
.sch-overlap {
  flex-basis: 100%;
}

/* The private note on the journal sheet, set off from the rows above it like the foot. */
.journal-private {
  padding: var(--space-4) var(--space-5);
  border-block-start: 1px solid var(--border);
}

@media (max-width: 53.125rem) {
  .sch-week {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .sch-day:not(:nth-child(7n + 1)) {
    border-inline-start: 0;
  }

  .sch-day:not(:nth-child(4n + 1)) {
    border-inline-start: 1px solid var(--border-subtle);
  }

  .sch-day:nth-child(n + 5) {
    border-block-start: 1px solid var(--border-subtle);
  }

  .sch-detail__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .sch-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .sch-row > .badge {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 32.5rem) {
  .sch-week {
    grid-template-columns: minmax(0, 1fr);
  }

  .sch-day {
    min-block-size: 0;
  }

  .sch-day:not(:nth-child(4n + 1)) {
    border-inline-start: 0;
  }

  .sch-day:nth-child(n + 2) {
    border-block-start: 1px solid var(--border-subtle);
  }

  /* A list line is one column on a phone (device test row 25). The time kept its column at
     its unbroken width - an open slot's window, "22.10.2026 09:00 · 31.10.2026 23:00-dək
     açıqdır", is 310px - so the page widened to 397px at 320 and the status beside it was
     squeezed to 16px. The time, the event and the status now stand one under another, the
     time wrapping and the status at its own width. */
  .sch-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .sch-row__time {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .sch-row > .badge {
    grid-column: 1;
  }
}

/* A finger, not a pointer: every card and line is a comfortable target. */
@media (pointer: coarse) {
  :is(.sch-event, .sch-row) {
    min-block-size: var(--target-comfortable);
  }
}

/* A learner's submitted work, read by the teacher marking it.

   Bounded and scrollable rather than unbounded: the server caps the field at
   20 000 characters, and a dialog that grows to hold all of them pushes the mark
   field it exists to serve off the screen. `pre-wrap` keeps the learner's own
   line breaks, which in a piece of written work carry meaning. */
.submission-text {
  margin: 0;
  max-block-size: 14rem;
  overflow-y: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: var(--space-3);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}

/* Attached files. A list, because that is what it is — and the name has to be
   allowed to wrap: a file somebody uploaded can be called anything, and one long
   unbroken name would otherwise set the row's min-content width and push the
   dialog into a horizontal scroll. `anywhere` rather than `break-word`, which
   does not shrink min-content. */
.attachments {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.attachments__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-inline-size: 0;
}

.attachments__item .grow {
  min-inline-size: 0;
  text-align: start;
  overflow-wrap: anywhere;
}

/* --- printing a document ----------------------------------------------------

   The one place this app produces something that leaves the screen. `InvoiceDetail`
   says in its own header that after `send` "the customer holds a copy", and until
   this existed nothing made one: no PDF route in the whole API, and
   `POST /invoices/{id}/send` is a state transition that takes the gapless number
   and delivers nothing.

   ⚠ THE DOCUMENT IS THE SCREEN, PRINTED. Not a second component: two renderers of
     one invoice are two chances to disagree about money, and the one nobody looks
     at is the one that drifts. So print removes the chrome and the controls, and
     adds only the two parties — which the screen omits legitimately, because a
     reader who navigated here already knows both and a sheet of paper does not.
   -------------------------------------------------------------------------- */

.print-only {
  display: none;
}

@media print {
  /* The material is glass and tint. On paper it is wasted ink around content that
     has to be black on white to be legible and photocopyable. */
  :root {
    --shadow-1: none;
    --shadow-2: none;
    --shadow-3: none;
  }

  /* "print removes the chrome and the controls" - a checkbox is a control, and the
     exam paper's numbered rail is navigation. Both would print as furniture around a
     document somebody is handing to a parent. */
  .shell__sidebar,
  .shell__topbar,
  .page-head .row,
  .pagination,
  .filter-bar,
  .checkbox-row,
  .player__rail,
  .btn {
    display: none !important;
  }

  .print-only {
    display: block;
  }

  /* The masthead is a flex row on paper — biller on the left, invoice number and
     billed party on the right. It stays a `.print-only` element, so its `display`
     belongs here and nowhere else; setting it in the base layer let it beat
     `.print-only { display: none }` on source order and leak onto the screen. */
  .invoice-masthead {
    display: flex;
  }

  /* `.player__body` is a two-column grid whose first column is the rail hidden above.
     Left as a grid it would squeeze the paper into the `auto` track the rail vacated. */
  .shell,
  .shell__body,
  .shell__main,
  .player__body {
    display: block;
    margin: 0;
    padding: 0;
    background: none;
  }

  .mat,
  .mat-inset {
    background: none;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    padding-inline: 0;
  }

  /* A row split across a page break is a line item whose money is on the next
     sheet. `table-header-group` repeats the headings on every page, which is what
     makes the second sheet readable at all. */
  tr,
  .invoice-masthead {
    break-inside: avoid;
  }

  thead {
    display: table-header-group;
  }

  /* The scroller is a screen affordance; on paper it would clip the columns it
     exists to reveal. */
  .table-scroll {
    overflow: visible;
  }

  a[href]::after {
    content: '';
  }
}

.invoice-masthead {
  /* `display` is set only under `@media print` — see the note there. On screen the
     element is `.print-only` and stays hidden; these properties describe how it sits
     once print reveals it. */
  justify-content: space-between;
  gap: var(--space-4);
  margin-block-end: var(--space-4);
}

.invoice-masthead p {
  margin: 0;
}

.invoice-masthead__from,
.invoice-masthead__to {
  font-weight: var(--weight-strong);
}

.invoice-masthead__number {
  margin: 0 0 var(--space-2);
  font-size: var(--text-lg);
}

/* -----------------------------------------------------------------------------
 * Identity
 * -------------------------------------------------------------------------- */

/* A multi-select that reads as one. `GET /users` takes repeatable members
   (?Roles=Teacher&Roles=Admin), so the control has to express "several", and a
   native multi-select does that badly enough that people miss it entirely. */
.chip-filter {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.chip {
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

/* A chip in a choice row carries a name - a group, a learner - and a long one ran out of
   the dialog on one unbroken line, at 1440px as well as on a phone (device test 2026-10-29,
   rows 32-33). It is never wider than its row and wraps inside itself when it has to; a
   short chip is as wide as its label, exactly as before. */
.chip-filter > .chip {
  max-inline-size: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

/* A filter chip is how a reader knows what a list is filtered BY, so it is one of
   the worst places in the product for unreadable text. Same fix as the badge:
   the fill is `-subtle`, the text is `-strong`.

   Keyed on `[aria-pressed]` rather than a class, so the state a screen reader is
   told and the state the eye sees cannot drift apart. `.chip--on` is kept as an
   alias for the sites that have not been converted yet. */
.chip[aria-pressed="true"],
.chip--on {
  background: var(--brand-subtle);
  border-color: var(--brand-border);
  color: var(--brand-strong);
  font-weight: var(--weight-strong);
}

/* WARNING: TWO SELECTED CHIPS TAKE THE PRESSED STEP (owner, 2026-10-15, design review #5): the
   parent's child switcher and the learner's XP filter. Both open their page at the left edge
   of the content, inside the rail's drop shadow, and the shadow over the fill took
   `--brand-strong` to 4.14-4.17:1. A chip marked `aria-pressed="true"` is a pressed toggle,
   so its text takes `--brand-active`, the brand's pressed step. Every other selected chip is
   unchanged. */
.chip--contrast:is([aria-pressed="true"], .chip--on) {
  color: var(--brand-active);
}

/* The per-person action menu. Five actions, four of them consequential — a row of
   five buttons would make the destructive ones as easy to hit as the safe ones. */
.menu {
  position: relative;
  display: inline-block;
}

.menu__panel {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: var(--z-dropdown);
  min-width: 12rem;
  display: flex;
  flex-direction: column;
  padding: var(--space-1);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow:
    0 var(--solid-shadow-1-y) var(--solid-shadow-1-blur) rgb(var(--shadow-rgb) / var(--solid-shadow-1-alpha)),
    0 calc(var(--solid-shadow-2-y) * 2) calc(var(--solid-shadow-2-blur) * 2)
      rgb(var(--shadow-rgb) / calc(var(--solid-shadow-2-alpha) * 1.5));
}

/* A PANEL INSIDE A SCROLLER MUST NOT BE LAID OUT INSIDE IT.
   `.table-scroll` sets `overflow-x: auto`, and the two axes cannot disagree about
   being visible - so `overflow-y` computes to `auto` too, and the table scrolls
   vertically whether anybody asked for it or not. An absolutely positioned
   descendant still contributes to its scroll container's scrollable area, so the
   panel hanging below a row was simply new scrollable height, every time it opened.

   Clip is what this stylesheet reaches for elsewhere (see `.lp`) and it is wrong
   here: this panel is MEANT to paint outside the scroller, and clip would hide it.
   Fixed takes it out of every ancestor's layout instead, so it contributes to no
   scroll area at all.

   The base class stays absolute on purpose - `.locale-menu__panel` composes it and
   positions against its own parent - so this is opt-in, and the geometry arrives in
   custom properties rather than `inset`, the way `Modal` carries its drag offset.

   `--menu-avail` is the measured room on whichever side it opened toward. Without
   it a panel near the bottom of the window would overhang the VIEWPORT and grow the
   page's own scrollbar, which is the same bug one level up.

   Across, the same (tutor device test 2026-10-29, row 26): it hangs from the trigger's
   right edge or its left, whichever has more room (`anchoredMenuAt`), and
   `--menu-avail-inline` is that room. Hanging from the right only, a trigger at a stacked
   card's left put the panel's left edge at -114px on a phone. The floor gives way to the
   room, so 12rem never pushes it off screen either. */
.menu__panel--anchored {
  position: fixed;
  right: var(--menu-right, auto);
  left: var(--menu-left, auto);
  top: var(--menu-top, auto);
  bottom: var(--menu-bottom, auto);
  max-block-size: var(--menu-avail);
  min-width: min(12rem, var(--menu-avail-inline, 12rem));
  max-width: var(--menu-avail-inline, none);
  overflow-y: auto;
}

.menu__item {
  padding: var(--space-2) var(--space-3);
  border: none;
  background: transparent;
  color: var(--text);
  text-align: start;
  font-size: var(--text-sm);
  border-radius: var(--r-sm);
  cursor: pointer;
}

.menu__item:hover {
  background: var(--surface-sunken);
}

.menu__item--danger {
  color: var(--danger);
}

.avatar--lg {
  width: var(--avatar-2xl);
  height: var(--avatar-2xl);
  font-size: var(--text-lg);
  overflow: hidden;
}

.avatar--lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The account button's own picture (audit STU-16): the initials' circle, filled. */
.avatar--photo {
  overflow: hidden;
}

.avatar--photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The owner's background picture on the profile: the picture at the screen's proportions
   beside its controls, and one column on a phone. A sunken well, not a pane: it sits inside
   the organisation section's glass, and glass cannot sample glass. */
.org-ground {
  display: grid;
  grid-template-columns: minmax(0, 16rem) minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
}

.org-ground__preview {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  background: var(--surface-sunken);
  padding: var(--space-3);
  text-align: center;
}

.org-ground__preview:has(img) {
  padding: 0;
}

.org-ground__preview img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

@media (max-width: 30rem) {
  .org-ground {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* The MFA QR. A white plate under it regardless of theme: scanners read dark-on-light,
   and a dark-mode inversion is the classic reason a valid code will not scan. */
.qr {
  width: fit-content;
  padding: var(--space-3);
  background: var(--surface-1);
  border-radius: var(--r-md);
  border: 1px solid var(--border-subtle);
}

/* ⚠ A LITERAL, AND IT HAS TO BE ONE. 200px is not a design decision the theme gets
   a say in — it is the size at which a phone camera reliably resolves the modules
   of this QR at arm's length. Tying it to `--seed-density` or a rem scale would
   mean a reader who enlarges their text gets a code their authenticator can still
   scan, and a reader who compacts the UI gets one it cannot. The white plate
   behind it is fixed for the same reason: scanners read dark-on-light. */
.qr svg {
  display: block;
  width: 200px;
  height: 200px;
}

/* Rendered legal text. Measure is capped because terms of service are read, not scanned. */
.prose {
  max-width: 68ch;
  line-height: var(--leading-body);
}

.prose > * + * {
  margin-top: var(--space-3);
}

.prose h2,
.prose h3,
.prose h4 {
  margin-top: var(--space-5);
  line-height: var(--leading-tight);
}

.prose ul,
.prose ol {
  padding-inline-start: var(--space-5);
}

.prose li + li {
  margin-top: var(--space-1);
}

/* A table in a legal text (GFM pipe tables, `lib/markdown.tsx`). Its cells are sentences, so each
   column keeps a readable width and the table scrolls sideways inside `TableScroll`, with the edge
   cue, rather than squeezing a phrase to a word per line on a phone; rows align at the top. */
.prose .table :is(th, td) {
  min-inline-size: 16ch;
  vertical-align: top;
}

.prose blockquote {
  margin-inline-start: 0;
  padding-inline-start: var(--space-4);
  border-inline-start: var(--rule-accent) solid var(--border-strong);
  color: var(--text-secondary);
}

.code-block {
  padding: var(--space-3);
  background: var(--surface-sunken);
  border-radius: var(--r-md);
  overflow-x: auto;
}

.row--end {
  justify-content: flex-end;
}

/* Fields of different heights side by side - one with a hint under it, one without - line
   up on their labels rather than on their middles, which sheared the inputs apart. */
.row--top {
  align-items: flex-start;
  flex-wrap: wrap;
}

/* A row that runs to the next line instead of past the sheet's edge on a phone: a pair of
   actions under a count, a line of presets, labels with a picker and its button (device
   test 2026-10-29, rows 34-36). Centred like `.row`, and where everything fits on one line
   it is laid out exactly as `.row` lays it out. */
.row--wrap {
  flex-wrap: wrap;
}
.row--wrap > * {
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

/* A link that is the whole of its line - "Etirazlarım", "Başqa kodu yoxla", a page's way back -
   and the protocol's file input are targets of their own, not words in a sentence: 16-17px of
   text measured (M3 responsive measure, 2026-11-02). Inline-flex with a floor gives the 24px of
   WCAG 2.5.8 and adds hit area, no ink. */
.link-target {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--target-min);
}
input[type='file'].field {
  min-block-size: var(--target-min);
}

/* In a dialog on a phone a definition list's label column is capped at a third of the line and the
   gap between the columns narrows, so its widest label wraps rather than leaving the values one
   character wide: a commission's decision number read one character per line at 320px (M3
   responsive measure, 2026-11-02). Values stay beside their labels (owner, 2026-11-02). */
@media (max-width: 30rem) {
  .modal .kv {
    grid-template-columns: fit-content(33%) minmax(0, 1fr);
    column-gap: var(--space-2);
  }
}

/* A badge in a definition list's value wraps where the line is shorter than it, rather than being
   cut by the candidate site's clip: "Окончательный результат" at 320px (M3 measure, 2026-11-02). */
.ec-site .kv dd > .badge {
  white-space: normal;
}

/* On a phone a picker in a wrapping row takes the line rather than shrinking to a sliver:
   three pickers side by side left 65px each and cut "Azərbaycanca" to "Azər" (tutor device
   re-test 2026-10-29). Wider screens keep the row exactly as above. */
@media (max-width: 30rem) {
  .row--wrap > .form-field,
  .row--wrap > .combo {
    flex: 1 1 9rem;
  }
}

/* -----------------------------------------------------------------------------
 * Comms
 * -------------------------------------------------------------------------- */

/* The bell. Shell chrome, so it anchors its own panel rather than the header. */
.bell {
  position: relative;
}

.bell__button {
  position: relative;
  border: none;
  background: transparent;
  /* A button does not inherit its colour - the UA gives it `buttontext`, which is black
     in either scheme, so the outline icon (stroke `currentColor`) vanished on the dark
     theme and left only the red count. The other top-bar icons read `--text`. */
  color: var(--text);
  cursor: pointer;
  font-size: var(--text-base);
  padding: var(--space-2);
  border-radius: var(--r-sm);
}

.bell__button:hover {
  background: var(--surface-sunken);
}

.bell__badge {
  position: absolute;
  top: 0;
  inset-inline-end: 0;
  min-width: 1.1rem;
  padding: 0 var(--space-1);
  background: var(--danger);
  color: var(--text-on-danger);
  border-radius: var(--r-pill);
  font-size: 0.65rem;
  line-height: 1.1rem;
  text-align: center;
}

.bell__panel {
  position: absolute;
  inset-inline-end: 0;
  top: 100%;
  z-index: var(--z-dropdown);
  width: min(24rem, calc(100vw - 2rem));
  max-height: 70vh;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow:
    0 var(--solid-shadow-1-y) var(--solid-shadow-1-blur) rgb(var(--shadow-rgb) / var(--solid-shadow-1-alpha)),
    0 calc(var(--solid-shadow-2-y) * 2) calc(var(--solid-shadow-2-blur) * 2)
      rgb(var(--shadow-rgb) / calc(var(--solid-shadow-2-alpha) * 1.5));
}

.bell__list {
  gap: 0;
}

/* The panel's title and its two actions wrap rather than run past the panel's edge: at 320px
   the header needed 319px of a 294px line, "Hamısını sil" ended 24px outside the panel and
   "Hamısını oxunmuş et" was squeezed (device test row 30). The actions take the next line
   when they do not fit beside the title, and each other's when they do not fit side by side. */
.bell__head,
.bell__actions {
  flex-wrap: wrap;
}

/* On a phone the bell is not the last thing in the bar, so a panel anchored to its right
   edge and wider than the room to its left ran off the left of the screen (QA, 390px).
   There the panel takes the whole bar as its anchor instead: `.bell` stops being the
   positioned ancestor, the sticky top bar becomes it, and the panel spans the bar's
   width directly beneath it. */
@media (max-width: 40rem) {
  .bell {
    position: static;
  }

  .bell__panel {
    inset-inline: 0;
    top: calc(100% + var(--space-2));
    width: auto;
  }
}

/* A learner's announcement on a phone: the date goes under the title instead of beside it
   (device test row 48). Beside it, the date column took a third of a 320px card and a long
   title ran to six lines of heading. */
@media (max-width: 40rem) {
  .ann-feed__head {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
  }
}

.notification {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  width: 100%;
  padding: var(--space-3);
  border: none;
  border-top: 1px solid var(--border-subtle);
  background: transparent;
  text-align: start;
  cursor: pointer;
  color: var(--text);
}

.notification:hover {
  background: var(--surface-sunken);
}

.notification--unread {
  background: var(--brand-subtle);
  box-shadow: inset var(--rule-accent) 0 0 0 var(--brand);
}

.notification__title {
  font-weight: var(--weight-medium);
}

/* Unread leads: a heavier title and the "Yeni" word in the head row, on top of the tint
   and the edge rule. The tint alone was too faint to tell read from unread (QA). */
.notification--unread .notification__title {
  font-weight: var(--weight-strong);
}

/* The unread word is a solid brand pill: a `-subtle` badge disappears into the row's
   own `-subtle` tint. `--text-on-brand` is the role measured against `--brand`. */
.notification__new {
  background: var(--brand);
  color: var(--text-on-brand);
}

/* The category and the unread word sit on one line at their own width. As direct
   children of the column-flex row they stretched across the whole card. */
.notification__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

/* A row header is a `th`, so it took the header's rule - darker than the cells' and
   left in place on the last row where the cells drop theirs - and the separators
   looked broken under the first column. A row header is part of its row. */
.table tbody th[scope="row"] {
  border-bottom: 1px solid var(--border-subtle);
}

.table tbody tr:last-child th[scope="row"] {
  border-bottom: 0;
}

/* An unresolved key is a bug to report, not a sentence. It is marked as such rather than
   typeset like prose, so a reader and a tester both notice. */
.notification__missing {
  font-family: var(--seed-font-mono);
  font-size: 0.75em;
  color: var(--danger);
  text-decoration: underline dotted;
}

/* Inbox: list beside thread, stacking on narrow screens. */
.messenger {
  display: grid;
  grid-template-columns: minmax(14rem, 22rem) 1fr;
  gap: var(--space-4);
  min-height: 24rem;
}

/* 50rem, not 800px — the same width at the default root size, and a better one at
   any other. A px media query ignores the reader's font size entirely, so somebody
   browsing at 20px gets the two-pane layout held together past the point their own
   text has outgrown it. In rem the breakpoint scales with them.

   ⚠ IT IS ALSO OFF THE `--bp-*` SCALE, deliberately and not happily. This is a
     decision about how much room the DETAIL pane has, which is a property of the
     component and not of the viewport — the shell's rail is subtracted from it and
     the token scale knows nothing about that. A container query is the right
     answer and the reason this is not one yet is only that it changes behaviour;
     see docs/NEXT-PROMPT.md. */
@media (max-width: 50rem) {
  .messenger {
    grid-template-columns: 1fr;
  }
}

/* Both panes are `.mat`: two surfaces side by side on the page ground, neither
   inside the other, so rule 1 is not in play and each draws the full material.
   The list's edge and radius come from that, which is why the hand-rolled border
   that used to be here is gone — it painted a second, flatter edge over the rim. */
.messenger__list {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* The pane is a surface even with nothing chosen yet, and it holds the height so
   "pick a conversation" sits in a panel rather than floating on the scene. */
.messenger__thread {
  display: flex;
  flex-direction: column;
}

.thread-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  background: transparent;
  cursor: pointer;
  text-align: start;
  color: var(--text);
}

.thread-row:hover {
  background: var(--surface-sunken);
}

.thread-row--on {
  background: var(--brand-subtle);
}

.thread-row__title {
  flex: 1;
  font-weight: var(--weight-medium);
}

.messenger__thread,
.thread {
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: var(--space-3);
}

.thread__scroll {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-height: 26rem;
  overflow-y: auto;
  padding: var(--space-2);
}

.bubble {
  position: relative;
  align-self: flex-start;
  max-width: 80%;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--r-lg);
  /* Theirs on the plain surface, mine in the brand tint with its edge. The two used to be
     `--surface-sunken` and `--brand-subtle`, which over the glass pane flattened to the
     same pale blue - the only cue left was the side of the pane (QA). */
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.bubble--mine {
  align-self: flex-end;
  background: var(--brand-subtle);
  border-color: var(--brand-border);
}

/* A withdrawn message keeps its row — a gap would hide that something was taken back. */
.bubble--withdrawn {
  background: transparent;
  border: 1px dashed var(--border);
}

.bubble__text {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.thread__compose {
  align-items: flex-end;
}

.thread__compose textarea {
  flex: 1;
}

/* Email templates: list of six mails beside the editor. */
.two-pane {
  display: grid;
  grid-template-columns: minmax(14rem, 20rem) 1fr;
  gap: var(--space-4);
}

/* 56.25rem, not 900px. Same reasoning as `.messenger` above: the same width at a
   16px root, and one that follows the reader at any other. Off the `--bp-*` scale
   for the same reason too — it is a statement about the detail pane, not the
   viewport. */
@media (max-width: 56.25rem) {
  .two-pane {
    grid-template-columns: 1fr;
  }
}

/* No scroller of its own. It held six cards in a 70vh box with overflow, so the page
   showed two scrollbars on one screen, and because a scroll container clips both axes a
   row of locale chips too wide for the column was cut off mid-word with a sideways bar
   under it. The page scrolls; the list does not. */
.two-pane__list {
  align-content: start;
}

.email-tpl__locales {
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* The variables a mail is given, and the editor's three buttons. Both were one line that
   never broke: four chips made the page 815px wide on a phone, and at 320px the end-aligned
   buttons pushed "Önbaxış" off the left edge (tutor device test, row 23). */
.email-tpl__vars,
.email-tpl__actions {
  flex-wrap: wrap;
}

/* A chip is `nowrap`, and "Neçə saat etibarlıdır {hours}" alone is wider than a phone's
   panel at a large text size. Here it may break, inside its own pill. */
.email-tpl__vars .chip {
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: start;
  max-inline-size: 100%;
}

/* The detail pane before anything is picked: a panel that holds the space, not one
   line of text floating at the top of an empty column. */
.two-pane__empty {
  min-block-size: 16rem;
  display: grid;
  place-items: center;
  text-align: center;
}

/* Tenant-authored HTML, rendered inert: `sandbox=""` with no allow-scripts. */
/* The rendered mail, as the person receiving it will see it.
   ⚠ WHITE ON PURPOSE AND NOT FROM A TOKEN. A mail client paints white behind a message and
     the shipped layout writes near-black text on that assumption, so theming this surface
     would render the preview unreadable in dark mode - which is exactly what it did. It is
     somebody else's document shown as it will be delivered, not a surface of ours. */
.mail-preview {
  width: 100%;
  min-height: 22rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: #fff;
  color-scheme: light;
  /* Lifted off the ground so it reads as a sheet rather than a hole in the page. */
  box-shadow:
    0 var(--solid-shadow-2-y) var(--solid-shadow-2-blur)
      rgb(var(--shadow-rgb) / var(--solid-shadow-2-alpha));
}

.link {
  border: none;
  background: none;
  padding: 0;
  color: var(--brand);
  cursor: pointer;
  text-align: start;
  text-decoration: underline;
}

/* A row's title in a table is a `.link` button as tall as its text, 15px on the announcements
   list (row 45). A button centres its own text, so the floor adds hit area and no ink. Only
   in a table: inline in a sentence it would open up the line. */
.table .link {
  min-block-size: var(--target-min);
}

/* WARNING: LINK TEXT ON GLASS, IN THE THREE PLACES IT MEASURED UNDER AA (owner, 2026-10-15 and
   2026-10-17, design review #3). The contrast lock prices the brand's text roles against the
   opaque surfaces; a glass pane lower on the page lets the backdrop's cyan wash through, and
   `--brand` on it measured 3.7-4.3:1. The owner kept the glass, so the links are darkened
   instead, with no token value changed. Measured on the glass at every spot (10th-percentile
   glyph pixel, light): `--brand-text` reached 4.07, `--brand-strong` 4.27, `--text` 15.5 - so in
   the light these links take `--text`, the strongest text role, and keep their underline,
   which is what says "link". The spots: the help centre's article titles and the announcement
   titles (`.link--text`, all roles), and the learner home's small links.

   In the dark all three take `--brand-text`, the role locked for a link on a surface: with
   `--brand` the learner home's measured 3.72 on its insets and a stacked announcement title
   4.03 at 390; with `--brand-text` the lowest of the three spots is 5.69. */
:is(.link--text, .learner-home .link.tiny) {
  color: var(--brand-text);
}

:root[data-mode="light"] :is(.link--text, .learner-home .link.tiny) {
  color: var(--text);
}

/* -----------------------------------------------------------------------------
 * Engagement
 * -------------------------------------------------------------------------- */

/* `min(18rem, 100%)`: a column never wider than the screen. A bare 18rem is 360px at a 125%
   text size, so on a 320px phone every card - the "Kodla qoşul" box first - ran 64px past
   the edge (tutor device test, row 47). Wide screens are unchanged. */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr));
  gap: var(--space-4);
  align-items: start;
}

/* The learner's day, leading their home screen: one panel, the next lesson first and
   largest, then what is due, the newest mark and the unread messages as quieter insets
   inside it. One material for the lot - the cards are insets, so glass never samples
   glass, and the page carries no extra wall of sibling panes. */
.home-today {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
}

@media (min-width: 64rem) {
  .home-today {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    align-items: start;
  }
}

.home-today__title {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  margin: 0;
}

.home-today__when {
  font-size: var(--text-lg);
  margin: 0;
}

.home-today__after {
  padding-block-start: var(--space-2);
  border-block-start: 1px solid var(--border-subtle);
}

.home-today__cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr));
  gap: var(--space-3);
  align-items: stretch;
}

.home-card {
  min-inline-size: 0;
}

.home-card__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-strong);
  color: var(--text-secondary);
  margin: 0;
}

.home-card li {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.home-card__line {
  overflow-wrap: anywhere;
}

.home-card__figure {
  font-size: var(--text-xl);
  font-weight: var(--weight-strong);
}

.home-card .link {
  margin-block-start: auto;
}

/* The bar is driven entirely by xpIntoLevel / xpForNextLevel off the wire — the level
   formula is server-owned precisely so no client divides by its own constant. */
.xp-bar {
  height: 0.6rem;
  border-radius: var(--r-pill);
  background: var(--surface-sunken);
  overflow: hidden;
}

.xp-bar__fill {
  height: 100%;
  background: var(--brand);
  transition: width var(--dur-slow) var(--ease-out);
}

/* Sized from the icon token rather than from a font size, now that the glyph is
   an SVG on `currentColor` instead of a platform emoji. `color` is what makes it
   take the tier's own accent below. */
.badge-chip {
  display: inline-grid;
  place-items: center;
  width: var(--control-sm);
  height: var(--control-sm);
  border-radius: var(--r-pill);
  background: var(--surface-sunken);
  color: var(--text-secondary);
  font-size: var(--icon-md);
}

/* Tier rises with how hard the achievement is, not with what it pays — so it is what the
   catalogue is coloured by. */
/* Tier reads on TWO channels, not one.
   Hue alone said nothing to a colour-blind or greyscale reader, and two of the
   five rings did not even clear 3:1 against the surface behind them. The ring
   now thickens with the tier as well as changing colour, so the ladder survives
   with no colour vision at all, and t1/t4 use the roles that are actually
   readable. */
.badge-chip--t1, .badge-card--t1 { box-shadow: inset 0 0 0 1px var(--border-strong); }
.badge-chip--t2, .badge-card--t2 { box-shadow: inset 0 0 0 2px var(--info); }
.badge-chip--t3, .badge-card--t3 { box-shadow: inset 0 0 0 3px var(--success); }
.badge-chip--t4, .badge-card--t4 { box-shadow: inset 0 0 0 4px var(--warning-strong); }
.badge-chip--t5, .badge-card--t5 { box-shadow: inset 0 0 0 5px var(--brand); }

/* The icon inside takes the tier's own colour too, so the whole chip reads as
   one object rather than a grey glyph in a coloured hoop. */
.badge-chip--t2 { color: var(--info-strong); }
.badge-chip--t3 { color: var(--success-strong); }
.badge-chip--t4 { color: var(--warning-strong); }
.badge-chip--t5 { color: var(--brand-strong); }

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: var(--space-3);
}

.badge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-3);
  border-radius: var(--r-md);
  background: var(--bg-elevated);
  text-align: center;
}

.badge-card__icon {
  display: inline-flex;
  font-size: var(--icon-xl);
  color: var(--text-secondary);
}

/* An unearned badge still shows what it is — a blank tile teaches nothing. */
.badge-card--locked {
  opacity: 0.45;
  filter: grayscale(1);
  box-shadow: inset 0 0 0 1px var(--border-subtle);
}

.lb-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}

/* `isYou` is the only thing on a leaderboard row that identifies anybody, so it is the
   only thing worth highlighting. */
.lb-row--you,
tr.lb-row--you {
  background: var(--brand-subtle);
  font-weight: var(--weight-medium);
}

.plan-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  border-inline-start: var(--rule-accent) solid var(--brand-border);
  background: var(--surface-sunken);
  border-radius: var(--r-sm);
}

.success { color: var(--success); }
.danger { color: var(--danger); }

/* -----------------------------------------------------------------------------
 * Content
 * -------------------------------------------------------------------------- */

/* The cover is a fileId with a colour behind it; the colour is the fallback tile. */
.course-swatch {
  display: inline-block;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: var(--r-sm);
  background: var(--brand-subtle);
  flex: none;
}

.lesson-row {
  padding: var(--space-1) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.lesson-row:last-child {
  border-bottom: none;
}

/* The title on one line and its controls at the end of it; the thread, when it is open,
   below both rather than squeezed between them. */
.lesson-row__line {
  gap: var(--space-2);
}

.lesson-thread {
  margin-block: var(--space-2) var(--space-3);
}

/* A stored file shown inside the platform (`components/FileViewer.tsx`, owner 2026-10-20).
   The media never outgrows the dialog body, which already carries the 70dvh ceiling and the
   one scroll; a document gets a fixed tall frame because an iframe has no size of its own. */
.file-viewer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.file-viewer__media {
  display: block;
  max-inline-size: 100%;
  max-block-size: 60dvh;
  border-radius: var(--r-md);
}

.file-viewer__audio {
  inline-size: 100%;
}

.file-viewer__document {
  inline-size: 100%;
  block-size: 60dvh;
  border: 0;
  border-radius: var(--r-md);
}

/* Without permission to keep the file, nothing in the viewer can be selected or dragged. */
.file-viewer--protected,
.file-viewer--protected * {
  user-select: none;
  -webkit-user-drag: none;
}

/* --- the PDF reader -------------------------------------------------------------------
   A PDF is drawn page by page by `PdfReader` (owner, 2026-10-25), and a document wants the
   height a form does not: the sheet takes the whole window less its margins, its body stops
   scrolling, and the pages scroll inside their own area under a toolbar that stays put.
   Scoped with `:has()` so every other dialog, and every other file the viewer shows, is
   exactly as it was. A browser without `:has()` keeps the ordinary sheet, which scrolls. */
.modal:has(.pdf-reader) {
  block-size: calc(100dvh - var(--space-6) * 2);
}

.modal:has(.pdf-reader) > .modal__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  max-height: none;
  overflow: hidden;
}

.file-viewer:has(.pdf-reader) {
  flex: 1 1 auto;
  min-height: 0;
  align-items: stretch;
}

.pdf-reader {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: var(--space-2);
}

.pdf-reader--failed {
  align-items: flex-start;
  justify-content: center;
}

.pdf-reader__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.pdf-reader__count {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.pdf-reader__zoom {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.pdf-reader__step {
  padding-inline: var(--space-3);
}

/* The percentage is the button that returns to "fit"; its width does not jump as it changes. */
.pdf-reader__fit {
  min-inline-size: var(--control-lg);
  font-variant-numeric: tabular-nums;
}

/* The desk the pages lie on: an inset plane, not glass - it sits inside the sheet, and glass
   cannot sample glass. The pages are centred while they fit and scroll sideways once a zoom
   makes them wider, which is why it is margins and not flex centring: a centred flex item
   wider than its box overflows to the left as well, where no scroll can reach it. */
.pdf-reader__pages {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: var(--space-3);
  border-radius: var(--r-md);
  background: var(--surface-sunken);
}

/* Inside the clipped body an outside ring would be cut off; drawn inside the edge instead. */
.pdf-reader__pages:focus-visible {
  outline-offset: calc(var(--focus-ring-width) * -1);
}

.pdf-reader__page {
  margin-inline: auto;
  background: var(--surface-1);
  box-shadow: 0 var(--solid-shadow-1-y) var(--solid-shadow-1-blur)
    rgb(var(--shadow-rgb) / var(--solid-shadow-1-alpha));
}

.pdf-reader__page + .pdf-reader__page {
  margin-block-start: var(--space-3);
}

.pdf-reader__page canvas {
  display: block;
  inline-size: 100%;
  block-size: 100%;
}

/* ON A PHONE THE PAGE IS THE POINT. A4 at the width of a 390px screen is already small
   print, so every pixel of gutter is taken back: the sheet stands a small margin off the
   screen's edges instead of the dialog's usual one, the body's side padding shrinks, and
   the zoom steps grow to a comfortable thumb target. */
@media (max-width: 30rem) {
  .modal:has(.pdf-reader) {
    width: calc(100vw - var(--space-2) * 2);
    max-height: calc(100dvh - var(--space-2) * 2);
    block-size: calc(100dvh - var(--space-2) * 2);
  }

  .modal:has(.pdf-reader) > .modal__body {
    padding-inline: var(--space-2);
  }

  .pdf-reader__pages {
    padding: var(--space-2);
  }

  .pdf-reader__page + .pdf-reader__page {
    margin-block-start: var(--space-2);
  }

  .pdf-reader__bar .btn {
    min-block-size: var(--control-lg);
  }
}

/* One material in a learner's own library: what it is on the left, what to do with it on
   the right. A row rather than a card, because a learner scans a topic's worth at once. */
.material-row {
  gap: var(--space-3);
  align-items: center;
}

.material-row__what {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-inline-size: 0;
}

.material-row__name {
  display: flex;
  flex-direction: column;
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .material-row {
    flex-direction: column;
    align-items: stretch;
  }
}

/* --------------------------------------------------------------------------
   A learner inside a course (audit STU-01): the list's lead card, the course home's
   outline, and one lesson. Composition only - every value is a token.
   -------------------------------------------------------------------------- */

/* The course to carry on with. The one primary action on the screen lives here. */
.learner-lead {
  gap: var(--space-3);
}

/* Every action row on these screens wraps: at 375px "Continue" and "Add to favourites"
   side by side are wider than the card, and an action cut off at the rim is lost. */
.learner-lead .row,
.course-outline__module .row,
.lesson .row,
.lesson-crumbs {
  flex-wrap: wrap;
}

.learner-lead__title {
  margin: 0;
  font-size: var(--text-2xl);
  font-weight: var(--weight-strong);
  line-height: var(--leading-tight);
  overflow-wrap: anywhere;
}

.course-progress {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-inline-size: 0;
}

.course-outline__module {
  gap: var(--space-2);
}

[data-family="glass"] .course-outline__module {
  border-color: var(--border);
}

.course-outline__module-title {
  margin: 0;
  font-size: var(--text-base);
  font-weight: var(--weight-strong);
  line-height: var(--leading-tight);
  overflow-wrap: anywhere;
}

.course-outline__lessons {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

/* A whole lesson row is one link, tall enough to hit with a thumb. */
.course-outline__lesson {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-2);
  min-block-size: 2.75rem;
  padding: var(--space-2);
  border-radius: var(--r-sm);
  color: var(--text);
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease-out);
}

.course-outline__lesson:hover {
  background: var(--surface-2);
}

.course-outline__lesson:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring);
  outline-offset: 2px;
}

.course-outline__lesson-title {
  flex: 1 1 12rem;
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

.course-outline__lesson-meta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

/* Done is said in words too (visually hidden in the row); the colour is the second cue. */
.course-outline__state {
  display: inline-flex;
  color: var(--text-tertiary);
}

.course-outline__state--done {
  color: var(--success-text);
}

.course-outline__quiz {
  gap: var(--space-2);
  padding-block-start: var(--space-3);
  border-block-start: 1px solid var(--border-subtle);
}

.course-outline__quiz-title {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  overflow-wrap: anywhere;
}

.lesson-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  margin-block-end: var(--space-2);
  overflow-wrap: anywhere;
}

/* A teacher writes plain text; single line breaks are theirs to keep. */
.lesson-body {
  max-inline-size: 65ch;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.lesson-url {
  overflow-wrap: anywhere;
}

.lesson-done {
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-block-start: var(--space-3);
  border-block-start: 1px solid var(--border-subtle);
}

/* The course home ends on its reviews, set apart from the outline above them. */
.course-reviews {
  margin-block-start: var(--space-6);
}

.lesson-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2);
  margin-block: var(--space-4);
}

/* --------------------------------------------------------------------------
   Reviews and comments
   -------------------------------------------------------------------------- */

/* Five glyphs on one baseline. The filled ones carry the score; the hollow ones carry
   the scale, which is what makes 3 read as 3 out of 5 rather than as three stars. */
.stars {
  display: inline-flex;
  gap: 0.1em;
  /* The accent, not the warning amber a star usually gets: a rating is not a warning,
     and picking a token by how it looks is how a theme stops meaning anything. */
  color: var(--brand);
  line-height: 1;
}

.rating-picker {
  border: none;
  margin: 0;
  padding: 0;
  gap: var(--space-3);
  align-items: center;
}

.rating-picker legend {
  float: inline-start;
  margin-inline-end: var(--space-3);
}

.rating-picker__option {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.review-form,
.review {
  gap: var(--space-2);
}

.review p,
.comment p {
  margin: 0;
  overflow-wrap: anywhere;
}

.comment-thread {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.comment {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding-block: var(--space-1);
}

/* A reply is one level deep and never more, so the indent is a constant rather than a
   depth multiplier. The rule down its inside edge is what says "under", at a width that
   survives a narrow screen. */
.comment--reply {
  margin-inline-start: var(--space-4);
  padding-inline-start: var(--space-3);
  border-inline-start: 2px solid var(--border-subtle);
}

/* The row that stays so its replies keep a parent. It is quiet, and it says what it is -
   an empty bubble would read as a rendering fault. */
.comment__tombstone {
  font-style: italic;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: var(--space-3);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.stat__value {
  font-size: var(--text-lg);
  font-weight: var(--weight-strong);
}

/* The independent teacher's exam list (owner, 2026-11-14): one compact row per exam at every
   width - the title leads with its facts in one quiet line under it, the state as badges, the
   menu at the end. Rows are divided by a rule, not boxed one by one. */
.exam-list {
  margin-block-start: var(--space-3);
}

.exam-list__items {
  list-style: none;
  margin: 0;
  padding: 0;
  border-radius: var(--r-md);
  background: var(--surface-1);
  overflow: hidden;
}

.exam-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-4);
}

.exam-row + .exam-row {
  border-block-start: 1px solid var(--border-subtle);
}

.exam-row:hover {
  background: var(--surface-2);
}

/* The title and its facts are one button: the whole left part opens the exam. */
.exam-row__open {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  min-inline-size: 0;
  min-block-size: var(--target-comfortable);
  justify-content: center;
  padding: var(--space-1) 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.exam-row__title {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--weight-strong);
  overflow-wrap: anywhere;
}

.exam-row__meta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.exam-row__state {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-1) var(--space-2);
}

/* A phone: the state drops under the title, the menu stays at the end of the first line. */
@media (max-width: 720px) {
  .exam-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .exam-row__state {
    grid-column: 1;
    grid-row: 2;
    justify-content: flex-start;
  }
}

/* The results statistics card (owner, 2026-11-14). A `dd` keeps the browser's own inline
   indent unless told otherwise; on this card that pushed every value 40px right of its label. */
.results-stats {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-block: var(--space-4);
}

.results-stats dl,
.results-stats dd {
  margin: 0;
}

.results-stats__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
}

.results-stats__title {
  margin: 0;
  font-size: var(--text-md);
  font-weight: var(--weight-strong);
}

.results-stats__files {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* The lead (the mean, the band, the three values) and a quiet side column. */
.results-stats__main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 14rem);
  gap: var(--space-4) var(--space-6);
  align-items: start;
}

.results-stats__lead {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-inline-size: 0;
}

.results-stats .stat dt {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

/* The mean and, beside it on its baseline, the average in points (the page's summary, folded in). */
.results-stats__mean-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-1) var(--space-4);
}

.results-stats__mean-note {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  padding-block-end: var(--space-1);
}

/* Under the band: passed, failed, awaiting marking (a filter), and the pass mark. */
.results-stats__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  padding-block-start: var(--space-2);
}

.results-stats__mean .stat__value {
  font-size: var(--text-3xl);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* The band on the 0-100% scale: the track, the lowest-to-highest band, the median tick and the
   mean dot. Positions come from the figures as custom properties. */
.results-stats__bar {
  position: relative;
  block-size: var(--space-2);
  border-radius: var(--r-pill);
  background: var(--surface-2);
}

.results-stats__bar-band {
  position: absolute;
  inset-block: 0;
  inset-inline-start: var(--range-from);
  inline-size: calc(var(--range-to) - var(--range-from));
  border-radius: var(--r-pill);
  background: var(--brand-subtle);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.results-stats__bar-median {
  position: absolute;
  inset-block: calc(var(--space-1) * -1);
  inset-inline-start: var(--range-median);
  inline-size: calc(var(--space-1) / 2);
  transform: translateX(-50%);
  background: var(--text-secondary);
}

.results-stats__bar-mean {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: var(--range-mean);
  inline-size: var(--space-3);
  block-size: var(--space-3);
  border-radius: var(--r-pill);
  transform: translate(-50%, -50%);
  background: var(--brand);
  box-shadow: 0 0 0 calc(var(--space-1) / 2) var(--surface-1);
}

/* Lowest, median, highest: three small figures under the band, the outer two at its ends. */
.results-stats__range {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
}

.results-stats__range .stat:nth-child(2) {
  align-items: center;
}

.results-stats__range .stat:last-child {
  align-items: flex-end;
}

.results-stats__range .stat__value,
.results-stats__side .stat__value {
  font-size: var(--text-md);
  font-variant-numeric: tabular-nums;
}

.results-stats__side {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-inline-start: var(--space-4);
  border-inline-start: 1px solid var(--border-subtle);
}

@media (max-width: 720px) {
  .results-stats__main {
    grid-template-columns: minmax(0, 1fr);
  }

  .results-stats__side {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-3) var(--space-6);
    padding-inline-start: 0;
    padding-block-start: var(--space-3);
    border-inline-start: none;
    border-block-start: 1px solid var(--border-subtle);
  }
}

/* --- the independent teacher's results page (owner, 2026-11-16, from his picture) -----------
   The head on the page ground: the way back as a link, the title large with one quiet line of
   facts, the live monitor beside it. Then one card of figures, and one card holding the tab strip
   with the two files at its end, the list and the count that ends it. Every other workspace keeps
   the `.open-head` / `.results-stats` page above. Every value is a token already here. */

/* The teacher's way back on a page of its own: first, top left, a little room under it. */
.page-back {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-block-end: var(--space-3);
}

.page-back__actions {
  margin-inline-start: auto;
}

.results-back {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: var(--space-2);
}

/* The teacher's marking queue: each sitter is a button of one width (owner, 2026-11-17). */
.marking-sitter {
  inline-size: 14rem;
  max-inline-size: 100%;
  justify-content: flex-start;
}

.marking-sitter__name {
  min-inline-size: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.results-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  margin-block-end: var(--space-4);
}

.results-head__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3) var(--space-4);
  inline-size: 100%;
}

.results-head__name {
  display: flex;
  flex: 1 1 16rem;
  flex-direction: column;
  gap: var(--space-1);
  min-inline-size: 0;
}

.results-head__title {
  margin: 0;
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  overflow-wrap: anywhere;
}

.results-head__meta {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.results-head__row > .btn {
  flex: none;
}

.results-head__row--actions {
  align-items: center;
}

/* Under the buttons now, in the head's column: its 16rem basis was a height there and left an
   empty band above the figures (owner, 2026-11-16). */
.results-head__name {
  flex: none;
  inline-size: 100%;
}

/* The card of figures: rows of figures divided by hairlines, the label small over the value. A
   `dd` keeps the browser's own inline indent unless told otherwise. */
.results-figures {
  gap: var(--space-5);
  margin-block-end: var(--space-4);
}

.results-figures dl,
.results-figures dd {
  margin: 0;
}

.results-figures__row {
  display: flex;
}

.results-figures__row > .stat {
  flex: 1 1 0;
  min-inline-size: 0;
  padding-inline: var(--space-4);
}

.results-figures__row > .stat:first-child {
  padding-inline-start: 0;
}

.results-figures__row > .stat + .stat {
  border-inline-start: 1px solid var(--border-subtle);
}

.results-figures .stat dt {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.results-figures .stat__value {
  /* A caption that wraps onto a second line never lifts its neighbours' values out of line. */
  margin-block-start: auto;
  font-size: var(--text-xl);
  line-height: var(--leading-tight);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.results-figures__row--lead .stat__value {
  font-size: var(--text-2xl);
}

.results-figures__note {
  margin: 0;
}

/* Passed, failed, awaiting marking: a dot and the words, the words always there. */
.results-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-5);
  padding-block-start: var(--space-4);
  border-block-start: 1px solid var(--border-subtle);
}

.results-legend__item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.results-legend__dot {
  flex: none;
  inline-size: var(--space-2);
  block-size: var(--space-2);
  border-radius: var(--r-pill);
}

.results-legend__dot--pass {
  background: var(--success);
}

.results-legend__dot--fail {
  background: var(--danger);
}

.results-legend__dot--wait {
  background: var(--warning);
}

/* Awaiting marking is a control, the list's filter: the same line, with a pill that shows on
   hover and stays while the filter is on. Its margin gives back its padding, so the words stand
   in line with the other two. */
.results-legend__toggle {
  min-block-size: var(--control-xs);
  margin: calc(-1 * var(--space-1)) calc(-1 * var(--space-2));
  padding: var(--space-1) var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: transparent;
  font: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
  transition:
    background var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}

.results-legend__toggle:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.results-legend__toggle:active {
  background: var(--surface-2);
}

.results-legend__toggle[aria-pressed="true"] {
  border-color: var(--brand);
  background: var(--brand-subtle);
  color: var(--text);
}

/* The second card: the strip, the files at its end, then the open view and its count. */
.results-card {
  gap: var(--space-4);
}

/* The teacher's search fills the card's width, a row of its own (owner, 2026-11-16, "tam tutsun"). */
.results-card .results-toolbar,
.results-card .results-toolbar__row {
  inline-size: 100%;
}

.results-card .results-toolbar__search {
  flex: 1 1 100%;
  max-inline-size: none;
}

.results-card > .tabs-row {
  margin-block-end: 0;
}

.results-card > .results-toolbar {
  margin-block-end: 0;
}

/* =============================================================================
   The independent teacher's question analysis (owner, 2026-11-17, from his mockup): a strip
   of figures, then the questions as a list beside one question in full. Inside the results
   card, which is `.mat-inset`: nothing here blurs.
   ========================================================================== */

.qa {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.qa-strip,
.qa-pane {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-inline-size: 0;
  padding: var(--space-4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
}

.qa-strip dl,
.qa-strip dd,
.qa-detail dl,
.qa-detail dd {
  margin: 0;
}

.qa-strip__figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(8rem, 100%), 1fr));
  gap: var(--space-3) 0;
}

/* A rule between figures, as the results figures have. */
.qa-strip__figures > .stat,
.qa-detail__figures > .stat {
  padding-inline: var(--space-4);
  border-inline-start: 1px solid var(--border-subtle);
}

.qa-strip__figures > .stat:first-child,
.qa-detail__figures > .stat:first-child {
  padding-inline-start: 0;
  border-inline-start: 0;
}

/* On a phone the figures sit two to a line, and a rule at the start of a line would be a stray. */
@media (max-width: 40rem) {
  .qa-strip__figures,
  .qa-detail__figures {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
  }

  .qa-strip__figures > .stat,
  .qa-detail__figures > .stat {
    padding-inline: 0;
    border-inline-start: 0;
  }
}

.qa-strip .stat dt,
.qa-detail .stat dt {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.qa-strip .stat__value,
.qa-detail .stat__value {
  font-size: var(--text-2xl);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.qa-strip__basis > p {
  margin: 0;
}

/* The list, then the question: the question leads, so it has the wider column. */
.qa-split {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: var(--space-4);
  align-items: start;
}

@media (max-width: 56rem) {
  .qa-split {
    grid-template-columns: minmax(0, 1fr);
  }
}

.qa-list .chip-filter {
  gap: var(--space-2);
}

.qa-list .chip-filter > .chip {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--control-sm);
}

.qa-list__sort {
  align-self: flex-start;
  min-block-size: var(--control-sm);
  font-size: var(--text-sm);
}

.qa-list__sort .field {
  min-block-size: 0;
  align-self: stretch;
}

.qa-list__sort select.field,
.qa-list__sort .combo__field {
  field-sizing: content;
  min-inline-size: 4ch;
  max-inline-size: 16rem;
}

.qa-list__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  padding-block-start: var(--space-2);
}

.qa-list__head > .label {
  margin: 0;
}

.qa-list__items {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* One question in the list: its number, its words on one line, the figure under them, the
   advice at the end. A button, so every state is the control's own. */
.qa-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  inline-size: 100%;
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition:
    background var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}

.qa-item:hover {
  background: var(--surface-2);
  border-color: var(--border);
}

.qa-item:active {
  background: var(--surface-3);
}

.qa-item:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
}

/* The question on the right. Said by `aria-current` too, never by the colour alone. */
.qa-item[aria-current="true"] {
  background: var(--brand-subtle);
  border-color: var(--brand);
  box-shadow: inset var(--space-1) 0 0 var(--brand);
}

.qa-item__no {
  padding-inline-end: var(--space-3);
  border-inline-end: 1px solid var(--border-subtle);
  font-size: var(--text-lg);
  font-weight: var(--weight-strong);
}

.qa-item__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-inline-size: 0;
}

.qa-item__prompt {
  overflow: hidden;
  font-weight: var(--weight-strong);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qa-item > .badge {
  white-space: nowrap;
}

@media (max-width: 30rem) {
  .qa-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .qa-item > .badge {
    grid-column: 2;
    justify-self: start;
  }
}

.qa-detail__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  padding-block-end: var(--space-3);
  border-block-end: 1px solid var(--border-subtle);
}

.qa-detail__title {
  flex: 1 1 16rem;
  min-inline-size: 0;
  margin: 0;
  font-size: var(--text-xl);
  font-weight: var(--weight-strong);
  overflow-wrap: anywhere;
}

.qa-detail__badges {
  flex-wrap: wrap;
  gap: var(--space-2);
}

.qa-detail__figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(6rem, 100%), 1fr));
  gap: var(--space-3) 0;
}

.qa-fig--right .stat__value {
  color: var(--success-text);
}

.qa-fig--wrong .stat__value {
  color: var(--warning-text);
}

/* Right, wrong, blank: every paper between them, so this one bar is divided. */
.qa-split-bar {
  display: flex;
  overflow: hidden;
  block-size: var(--control-xs);
  border-radius: var(--r-pill);
  background: var(--surface-2);
}

.qa-split-bar__part {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-basis: 0;
  min-inline-size: 0;
  overflow: hidden;
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.qa-split-bar__part--right {
  background: var(--success);
  color: var(--text-on-success);
}

.qa-split-bar__part--wrong {
  background: var(--warning);
  color: var(--text-on-warning);
}

.qa-split-bar__part--blank {
  background: var(--surface-3);
  color: var(--text);
}

.qa-detail__shares {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  margin: 0;
  color: var(--text-secondary);
}

.qa-detail__shares > span + span {
  padding-inline-start: var(--space-4);
  border-inline-start: 1px solid var(--border-subtle);
}

.qa-detail__subtitle {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: var(--weight-strong);
}

/* One option a line: its words, its bar against the papers, its count, its badge. The columns
   are the list's, so every bar starts and ends where the others do. */
.qa-options {
  display: grid;
  grid-template-columns: minmax(3rem, max-content) minmax(4rem, 1fr) auto minmax(0, max-content);
  gap: var(--space-2) var(--space-4);
}

.qa-option {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  align-items: center;
}

.qa-option__label {
  min-inline-size: 0;
  max-inline-size: 16rem;
  font-weight: var(--weight-strong);
  overflow-wrap: anywhere;
}

.qa-option__bar {
  display: block;
}

.qa-option__bar > .meter__fill {
  display: block;
}

.qa-option--key .meter__fill {
  background: var(--success);
}

.qa-option--top .meter__fill {
  background: var(--warning);
}

.qa-option--blank .meter__fill {
  background: var(--text-tertiary);
}

.qa-option__count {
  font-size: var(--text-sm);
  white-space: nowrap;
}

.qa-option__badge .badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  white-space: nowrap;
}

@media (max-width: 40rem) {
  .qa-options {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .qa-option {
    row-gap: var(--space-1);
  }

  .qa-option__bar {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .qa-option__badge:empty {
    display: none;
  }
}

.qa-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--brand-border);
  border-radius: var(--r-md);
  background: var(--brand-subtle);
}

.qa-note__title {
  padding-inline-end: var(--space-4);
  border-inline-end: 1px solid var(--border);
}

.qa-note__text {
  flex: 1 1 14rem;
  margin: 0;
}

.qa-detail__actions {
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* NEVER A SIDEWAYS SCROLL IN THE STRIP, at any width (owner, 2026-11-16): with a fourth tab
   (the absentees) the strip used to scroll and the two files stood one above the other. The tabs
   wrap onto a second line, and the files keep one line at the strip's end. */
.results-card__strip {
  flex-wrap: wrap;
  row-gap: var(--space-2);
}

.results-card__strip .table-frame,
.results-card__strip .tabs {
  overflow: visible;
}

.results-card__strip .tabs {
  flex-wrap: wrap;
}

.results-card__files {
  flex: none;
  flex-wrap: nowrap;
  margin-inline-start: auto;
}

/* A plane inside this card draws nothing of its own (glass cannot sample glass): an edge says
   where it is, as `.exam-card` does inside the dialog. */
.results-card .mat-inset {
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
}

/* The list's column names, small, upper case and quiet, as his picture has them. */
.results-card .results-roster .table th {
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

/* The scrollbar above a wide table (the teacher's): only its bar shows, a hair of content inside. */
.results-roster__mirror {
  overflow-x: auto;
  overflow-y: hidden;
}

.results-roster__mirror > div {
  block-size: 1px;
}

.results-card__empty {
  padding-block: var(--space-8);
}

.results-card__empty > p {
  margin: 0;
}

.results-card__empty > svg {
  inline-size: var(--space-8);
  block-size: var(--space-8);
  color: var(--text-tertiary);
}

.results-card__count {
  margin: 0;
  padding-block-start: var(--space-3);
  border-block-start: 1px solid var(--border-subtle);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* A phone: the five figures stand three and two, the files above the strip so its rule stays
   under the tabs. */
@media (max-width: 40rem) {
  .results-figures__row > .stat {
    padding-inline: var(--space-3);
  }

  .results-figures__row:not(.results-figures__row--lead) {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: var(--space-4);
  }

  .results-figures__row:not(.results-figures__row--lead) > .stat:nth-child(3n + 1) {
    padding-inline-start: 0;
    border-inline-start: none;
  }

  .results-card__strip {
    flex-wrap: wrap;
  }

  /* Never a sideways scroll in the strip (owner, 2026-11-16, as on the exam's own strip): the
     tabs wrap onto a second line. */
  .results-card__strip .tabs {
    flex-wrap: wrap;
    overflow: visible;
  }

  .results-card__files {
    order: -1;
    inline-size: 100%;
    justify-content: flex-end;
  }
}

/* ===========================================================================
   Platform — §39's operator console, and the tenant-side half of it.
   =========================================================================== */

.stat__label {
  color: var(--text-secondary);
}

/* A guardian's front door: the next lesson and what is due, above the child's tabs.
   Two pressable tiles on the page ground, so `.mat-inset` with the edge the material
   would otherwise have supplied (see the `.lp-*` block). Buttons, so the native button
   look is reset to the tile's. */
.child-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  gap: var(--space-3);
}

.child-summary__tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  inline-size: 100%;
  min-inline-size: 0;
  font: inherit;
  color: inherit;
  text-align: start;
  /* The balance tile is a link to the invoices, not a button. */
  text-decoration: none;
  cursor: pointer;
  /* ONE EDGE FOR ALL THREE (corporate test, 2026-11-11). The two button tiles kept the
     browser's own button border, recoloured to `--border` under glass, on top of the rim the
     page-ground material already draws; the balance tile, a link, had the rim alone. So
     "Növbəti dərs" and "Ən yaxın son tarix" read heavier than the tile beside them. The
     button border goes, and all three are the material's edge and nothing else. */
  border: 0;
}

.child-summary__value {
  font-family: var(--seed-font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-strong);
  overflow-wrap: anywhere;
}

/* Text a person typed — a task, an answer, a teacher's remark — keeps its own lines. */
.prewrap {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Counted things on a dashboard. `DashboardTile` is {key, value} and nothing
   else, so the tile has room for exactly a number and a label. */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(11.25rem, 100%), 1fr));
  gap: var(--space-3);
  margin-block-end: var(--space-4);
}

/* `column-reverse` so the label sits above and the figure anchors the bottom
   corner, which is the proportion the prototype gives a counted thing: a quiet
   caption, air, then the number reading as the object itself.

   Reversing the visual order and not the DOM order is deliberate. The DOM keeps
   value-then-label, so a screen reader still announces "12, Şagirdlər" rather
   than a label with no subject; neither child is focusable, so no focus order
   is reversed by it. */
.tile {
  display: flex;
  flex-direction: column-reverse;
  justify-content: space-between;
  gap: var(--space-2);
  min-block-size: 6.5rem;
}

/* A counted thing's label is medium, not regular - it is a label, and the figure
   below it is what carries the weight. */
.tile > .tiny {
  font-weight: var(--weight-medium);
}

.tile__value {
  font-size: var(--text-2xl);
  font-weight: var(--weight-strong);
  line-height: 1;
  letter-spacing: var(--tracking-tight);
  font-variant-numeric: tabular-nums;
}

/* A tile that goes somewhere.

   It is an `<a>`, so it is keyboard-reachable and announced as a link without
   help; what it needs is to LOOK like one. Not with an underline — the global
   `a:hover` rule draws one, and under a card that means a line beneath a number,
   which reads as a mistake rather than as an affordance. It lifts instead.

   `.mat--interactive` alongside carries the rest: the pointer cursor, the glass
   tint on hover and the press that collapses the lift. That rule is in
   `material.css` and is the same gesture every other pressable surface makes, so
   this file adds the lift and borrows the feel rather than inventing a second one.

   The edge comes from the material, not from here: a tile on the page ground is
   the outermost surface, so it draws the full glass rim like every other card. */
.tile--link {
  color: inherit;
  text-decoration: none;
  transition:
    transform var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}

.tile--link:hover,
.tile--link:focus-visible {
  text-decoration: none;
}

.tile--link:hover {
  transform: translateY(-2px) scale(1.01);
}

.tile--link:hover .tile__value {
  color: var(--brand-strong);
}

/* No `:focus-visible` ring here on purpose. `components.css` gives every `<a>`
   one ring, from `--focus-ring` at the width and offset the theme sets, and its
   own comment is "one ring, defined once, never removed". A rule here could only
   remove it or disagree with it. */

/* The lift is decoration and says nothing the border and the colour do not, so
   it goes entirely rather than being slowed down. */
@media (prefers-reduced-motion: reduce) {
  .tile--link {
    transition: none;
  }
  .tile--link:hover {
    transform: none;
  }
}

/* --- the first-run checklist ------------------------------------------------
   The ordered sequence a tenant with nothing has to walk, shown on the landing
   screen until it has both a teaching group and a learner.

   ⚠ INSIDE THE LAYER, WHICH IS WHY IT SITS HERE RATHER THAN AT THE END OF THE
     FILE. `@layer eduai.app` closes on the next line, and everything after it is
     unlayered and outranks every rule in here. A block appended to the bottom
     would quietly win arguments it should lose.
   -------------------------------------------------------------------------- */

.firstrun {
  margin-block-end: var(--space-4);
}

.firstrun__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* `minmax(0, 1fr)` on the middle track, not `1fr`: a grid item keeps
   `min-width: auto`, so one long unbroken word in a note would widen its own
   column and push the control off the panel. */
.firstrun__step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--space-3);
}

/* The number, or the tick. A fixed circle so the two never shift the column, and
   `tabular-nums` so 9 and 1 are the same width. */
.firstrun__mark {
  display: grid;
  place-items: center;
  flex: none;
  inline-size: var(--space-6);
  block-size: var(--space-6);
  border-radius: var(--r-circle);
  border: 1px solid var(--border);
  color: var(--text-tertiary);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.firstrun__step--done .firstrun__mark {
  border-color: var(--success-border);
  color: var(--success-text);
}

/* A STEP STILL OUTSTANDING IS SAID IN THE DANGER ROLE, because an admin asked to be told
   the moment they sign in and the quiet grey number was read past. `--danger-text` is the
   role's 4.5:1 step, so the number and the label are both legible on every surface; the
   ring keeps the `-border` veil the done state uses, so the two marks stay the same object
   in two colours rather than two different shapes.

   ⚠ THE CONTROL IS NOT PAINTED. "Keçin" navigates - it destroys nothing - and danger is
     the destructive role. A red button here would make the role mean two things, which is
     the one thing the token contract forbids. The row carries the colour; the button keeps
     its own meaning. */
.firstrun__step--todo .firstrun__mark {
  border-color: var(--danger-border);
  color: var(--danger-text);
}

.firstrun__step--todo .firstrun__body strong {
  color: var(--danger-text);
}

/* One thing leads: the step the reader is actually on carries the only filled
   mark on the panel, and its control is the only primary one. */
.firstrun__step--next .firstrun__mark {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--text-on-brand);
}

/* Done is quiet, not struck through — the row still names a screen the reader may
   want to go back to, and a line through a link reads as "removed". */
.firstrun__step--done .firstrun__body strong {
  color: var(--text-secondary);
  font-weight: var(--weight-body);
}

/* Aligned to the step's first line rather than centred on the whole row, so a
   note that wraps to two lines does not drag the control down the panel. */
.firstrun__step > .btn {
  align-self: start;
}

@media (max-width: 30rem) {
  /* Three columns of a wrapped sentence is not a list any more. The control
     drops under the text it belongs to and keeps its full target size. */
  .firstrun__step {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .firstrun__step > .btn {
    grid-column: 2;
    justify-self: start;
  }
}

/* --- the searchable select -------------------------------------------------
   Why a select becomes this at all is in `components/ComboSelect.tsx`: a native dropdown
   has no search, and the lists in this product run to hundreds of names. Short ones stay
   native - the threshold is counted in `lib/options.ts`.
   -------------------------------------------------------------------------- */

.combo {
  position: relative;
  display: flex;
  align-items: center;
  min-inline-size: 0;
}

.combo__field {
  inline-size: 100%;
  min-inline-size: 0;
  /* A choice longer than the field ends in an ellipsis rather than being cut mid-letter. */
  text-overflow: ellipsis;
  /* Room for the chevron, so a long label never runs under it. */
  padding-inline-end: var(--space-7);
}

/* An open list keeps showing the chosen value until the reader types (`ComboSelect`): the label
   is the empty box's placeholder, drawn as the value rather than as a hint. */
.combo__field[data-showing-choice]::placeholder {
  color: var(--text);
  opacity: 1;
}

.combo__chevron {
  position: absolute;
  inset-inline-end: var(--space-3);
  color: var(--text-tertiary);
  pointer-events: none;
}

/* A short list keeps the platform's select and loses only its arrow, so it wears the same
   chevron as the searchable one beside it. The list that opens is still the platform's. */
/* A list of one has no query box (`ComboSelect`, 2026-11-14): the field is pressed like a select,
   not typed into, so it shows neither a text caret nor the text cursor. */
.combo--plain .combo__field {
  caret-color: transparent;
  cursor: default;
}

.combo--native > select.field {
  appearance: none;
  inline-size: 100%;
  min-inline-size: 0;
  padding-inline-end: var(--space-7);
}

/* A filter's own reset, inside the field and just before its chevron. Why it exists and
   when it shows is in `components/Select.tsx`. The states are `.icon-btn`'s; only the box
   is restated, down to the 24px target minimum so it fits inside a 34px field.

   The room is kept whether or not the button shows, so a long label is never drawn under
   it and choosing a filter does not widen the field and shove the rest of the row. */
.combo--clearable .combo__field {
  padding-inline-end: calc(var(--space-7) + var(--control-xs));
}

.combo__clear,
.select-clear__button {
  position: absolute;
  inset-inline-end: calc(var(--space-3) + 1em + var(--space-1));
  inline-size: var(--control-xs);
  block-size: var(--control-xs);
  color: var(--text-tertiary);
}

/* The touch path: a native select, which draws its own arrow at the same edge. */
.select-clear {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-inline-size: 0;
}

.select-clear__field {
  inline-size: 100%;
}

/* THE PLATFORM DRAWS A NATIVE SELECT'S OPEN LIST, AND IT FOLLOWS THE OPERATING SYSTEM, NOT THE
   APP. `color-scheme: light dark` hands the popup the OS scheme, so a dark app on a light OS
   opened a white list with the field's pale ink on it - unreadable. The console keeps native
   selects everywhere now, so every option names its own surface and ink. */
select.field option {
  background-color: var(--bg-elevated);
  color: var(--text);
}

.select-clear select.select-clear__field {
  /* The wrapper holds the select's place in the row now, so the select fills it rather than
     sizing itself from its longest option past the wrapper's edge. */
  inline-size: 100%;
  padding-inline-end: calc(var(--space-7) + var(--control-xs));
}

/* THE SELECT UNDERNEATH IS NOT DISPLAY:NONE. It still holds the value and still submits,
   and `display: none` would take it out of the form's own picture in some browsers; this
   hides it from the eye while leaving it a real control. It is out of the accessibility
   tree through `aria-hidden` and out of the tab order through `tabindex`, both set in
   `Field.tsx`. */
.combo__native {
  position: absolute;
  /* ⚠ PINNED TO THE START OF ITS CONTAINING BLOCK, not left at its static position. The select
     is a sibling of `.combo`, not inside it, so nothing positioned holds it: inside a dialog it
     resolved against the sheet, sat at its place deep in the scrolled body, and stretched the
     SHEET's own scroll area to twice its height - the learner dialog scrolled on into an empty
     pane below its footer (owner, 2026-09-30). At the origin it can never overflow anything. */
  inset-block-start: 0;
  inset-inline-start: 0;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip-path: inset(50%);
  overflow: hidden;
}

.combo__list {
  position: fixed;
  inset: auto;
  margin: 0;
  right: auto;
  min-width: 0;
  padding: var(--space-1);
  border: 1px solid var(--border);
  overflow-y: auto;
  /* Its own ink: a popover is in the top layer and still inherits from a glass ancestor. */
  color: var(--text);
}

.combo__list:not(:popover-open) {
  display: none;
}

.combo__option {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--r-sm);
  font-size: var(--text-sm);
  cursor: pointer;
}

/* ACTIVE IS THE KEYBOARD'S, CHOSEN IS THE VALUE'S, and they are different marks because
   they answer different questions: where the arrow keys are, and what the field holds. */
.combo__option--active {
  background: var(--surface-2);
}

.combo__option--chosen {
  color: var(--brand-strong);
  font-weight: var(--weight-strong);
}

.combo__option--active.combo__option--chosen {
  background: var(--brand-subtle);
}

.combo__option[aria-disabled='true'] {
  opacity: var(--opacity-disabled);
  cursor: not-allowed;
}

.combo__empty {
  padding: var(--space-2) var(--space-3);
  margin: 0;
}

/* --- the date field and its calendar ---------------------------------------
   Why this exists at all is in `components/DateField.tsx`: the browser's own picker
   draws itself in the browser's locale and its own chrome, and no attribute or token
   reaches any of it. Everything below is composed from the same tokens as every other
   control, which is the whole point of replacing it.
   -------------------------------------------------------------------------- */

.datefield {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  min-inline-size: 0;
}

/* The field keeps the room; the button is beside it rather than inside, so the text can
   never run under an icon that sits on top of it. */
.datefield > .field {
  flex: 1 1 auto;
  min-inline-size: 0;
}

.datefield__open {
  flex: none;
  padding-inline: var(--space-2);
}

/* IN THE TOP LAYER, WHICH IS WHY NONE OF THIS IS `absolute`. `[popover]` starts centred
   in the viewport with a UA border and margin; the component sets `top`/`bottom` and the
   inline start from the field's own rect, and these three lines clear what the UA would
   otherwise impose. See `DateField.tsx` for what the ordinary child position looked like:
   translucent, and half behind the card below it. */
.datefield__popover {
  position: fixed;
  inset: auto;
  margin: 0;
  right: auto;
  min-width: 0;
  padding: var(--space-3);
  border: 1px solid var(--border);
  overflow: auto;
  /* ⚠ ITS OWN INK, BECAUSE THE TOP LAYER STILL INHERITS FROM THE DOM. A popover is
     painted above everything but it is still this field's child, and the field sits on a
     glass surface that sets white text. Measured in light mode before this line: the panel
     was white on white - the month name was in the markup and invisible on screen. */
  color: var(--text);
}

.datefield__popover:not(:popover-open) {
  display: none;
}

.calendar {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.calendar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.calendar__page {
  padding-inline: var(--space-2);
}

.calendar__month {
  font-weight: var(--weight-strong);
  text-align: center;
  flex: 1 1 auto;
}

.calendar__grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.calendar__week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--space-1);
}

.calendar__weekday {
  display: grid;
  place-items: center;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-transform: lowercase;
}

/* 2.25rem is the target size floor (WCAG 2.5.8 asks 24px; this is 36) and the reason the
   cell is a square rather than text with padding: a month of unequal boxes reads as a
   table that failed to lay out. */
.calendar__day {
  display: grid;
  place-items: center;
  inline-size: 2.25rem;
  block-size: 2.25rem;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: none;
  color: var(--text);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition:
    background-color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}

.calendar__day:hover:not(:disabled) {
  background: var(--surface-2);
}

.calendar__day:active:not(:disabled) {
  background: var(--surface-3);
}

.calendar__day:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* The days either side of the month are shown rather than blanked, because a reader
   scanning for "next Monday" on the 30th needs to see it - and dimmed, because they are
   not what this page is about. */
.calendar__day--outside {
  color: var(--text-tertiary);
}

/* Today is stated with a ring, not a fill: a fill would compete with the chosen day, and
   on the day you choose today they would be the same mark saying two different things. */
.calendar__day--today {
  border-color: var(--brand-border);
}

.calendar__day--chosen {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--text-on-brand);
  font-weight: var(--weight-strong);
}

.calendar__day--chosen:hover:not(:disabled) {
  background: var(--brand-hover);
}

.calendar__day:disabled {
  opacity: var(--opacity-disabled);
  cursor: not-allowed;
}

.calendar__foot {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
}

.section-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-strong);
  /* Body leading, not display leading. The prototype's panel heading inherits the
     body's 1.45 - 29px at 20 - and `h1..h4` would set it at 1.04, 8px shorter,
     which pulls the list under it up against the title. */
  line-height: var(--leading-body);
  margin-block: var(--space-3) var(--space-2);
}

/* A section heading that opens a second list on the same page: the gap above it is what
   tells the reader the first list has ended. */
.section-title--spaced {
  margin-block: var(--space-8) var(--space-3);
}

.stack--tight {
  gap: var(--space-1);
}

/* `-strong`, not the accent itself. `--info` on `--info-subtle` is the exact
   pairing `theme/system/components.css` documents as unreadable four lines above
   its own fix — measured 3.58:1 in light mode against the 4.5 this text size
   needs. `--info-strong` is the role that exists for it, and the compiler picks
   whichever step of the ramp clears 4.5 against the flattened fill. */
.badge--accent {
  background: var(--info-subtle);
  color: var(--info-strong);
}

.field-error {
  color: var(--danger);
}

/* ===========================================================================
   The console's home dashboard (`pages/platform/Stats.tsx`).

   A row of KPI tiles, then a grid of widgets. Every tile and widget is a `.mat-inset` on the
   page ground rather than a `.mat` (CLAUDE.md §3: a wall of glass cards doubled the repaint
   cost on the landing page), so under glass each draws the edge the material would have.

   ⚠ CONTAINER QUERIES, NOT MEDIA QUERIES. The content area is the window minus a sidebar
     that can be open, folded or a drawer, so the window's width says little about how wide
     the dashboard actually is. `.dash` is the container and the grid answers to it.
   =========================================================================== */

.dash {
  container: dash / inline-size;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Five tiles in two kinds (`data-group`): three rolling-24-hour figures and two totals.
   Phone: the first alone, then two pairs. Middling: three, then two. Wide: one row of five.
   Never 4 + 1, which strands a tile on a row of its own. */
.dash__kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.kpi[data-group="activity"]:first-child {
  grid-column: 1 / -1;
}

@container dash (min-width: 34rem) {
  .dash__kpis {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .kpi[data-group="activity"],
  .kpi[data-group="activity"]:first-child {
    grid-column: span 2;
  }

  .kpi[data-group="totals"] {
    grid-column: span 3;
  }
}

@container dash (min-width: 64rem) {
  .dash__kpis {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .kpi[data-group="activity"],
  .kpi[data-group="activity"]:first-child,
  .kpi[data-group="totals"] {
    grid-column: auto;
  }
}

.dash__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
}

@container dash (min-width: 52rem) {
  .dash__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dash-card--wide {
    grid-column: span 2;
  }

  .dash-card--full {
    grid-column: 1 / -1;
  }
}

[data-family="glass"] .dash-card,
[data-family="glass"] .kpi {
  border-color: var(--border);
}

/* --- a KPI tile -------------------------------------------------------------
   Icon chip, label, figure, and a line of context under it. The tone colours the chip only;
   the figure stays in body text so five tones never become five competing headlines. */
.kpi {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "icon label"
    "value value"
    "hint hint";
  align-items: center;
  column-gap: var(--space-2);
  row-gap: var(--space-1);
  padding: var(--space-4);
  min-inline-size: 0;
}

.kpi__icon {
  grid-area: icon;
  display: grid;
  place-items: center;
  inline-size: var(--space-7);
  block-size: var(--space-7);
  border-radius: var(--r-md);
  font-size: var(--text-md);
  background: var(--brand-subtle);
  color: var(--brand-strong);
}

.kpi__label {
  grid-area: label;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 1.25;
}

.kpi__value {
  grid-area: value;
  margin-block-start: var(--space-2);
  font-size: var(--text-2xl);
  font-weight: var(--weight-strong);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.kpi__hint {
  grid-area: hint;
  color: var(--text-tertiary);
  font-size: var(--text-xs);
}

.kpi[data-tone="success"] .kpi__icon { background: var(--success-subtle); color: var(--success-strong); }
.kpi[data-tone="warning"] .kpi__icon { background: var(--warning-subtle); color: var(--warning-strong); }
.kpi[data-tone="danger"] .kpi__icon { background: var(--danger-subtle); color: var(--danger-strong); }
.kpi[data-tone="info"] .kpi__icon { background: var(--info-subtle); color: var(--info-strong); }

/* --- a widget ------------------------------------------------------------- */
.dash-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-5);
  min-inline-size: 0;
}

/* Title on the left, the widget's own controls (a date range) on the right, and the
   controls drop under the title when the card is too narrow for both. */
.dash-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3);
}

.dash-card__titles {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-inline-size: 0;
}

.dash-card__title {
  margin: 0;
  font-size: var(--text-md);
  font-weight: var(--weight-strong);
}

.dash-card__note {
  margin: 0;
  color: var(--text-tertiary);
  font-size: var(--text-xs);
}

.dash-range {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.dash-range > * {
  flex: 1 1 8rem;
  min-inline-size: 0;
}

/* The figures a chart is summarised by, above it. */
.dash-figures {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
  margin: 0;
}

.dash-figures dt {
  color: var(--text-tertiary);
  font-size: var(--text-xs);
}

.dash-figures dd {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: var(--weight-strong);
}

/* The single day's five figures as small outlined tiles. Flex rather than the shared
   `.stat-grid`, so a row that wraps stretches its last tile instead of stranding it. */
.dash-day {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.dash-day .stat {
  flex: 1 1 8rem;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
}

.dash-day .stat__value {
  font-size: var(--text-xl);
}

/* --- the trend -------------------------------------------------------------
   Bars rather than a path: the series is zero-filled and daily, so every point is real and
   a gap would be a lie. A faint baseline grid gives the bars something to stand on. */
.trend {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.trend__bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  block-size: 10rem;
  padding-block-start: var(--space-2);
  border-block-end: 1px solid var(--border);
  background-image: linear-gradient(to top, var(--border-subtle) 1px, transparent 1px);
  background-size: 100% 25%;
}

.trend__bar {
  flex: 1 1 0;
  min-inline-size: 1px;
  background: var(--brand);
  border-radius: var(--r-xs) var(--r-xs) 0 0;
  transition: background var(--dur-fast) var(--ease-out);
}

/* A zero-count day still draws, or a run of quiet days reads as missing data - but faintly,
   so it does not pass for a small number. */
.trend__bar[data-zero] {
  background: var(--border-strong);
}

.trend__bar:hover {
  background: var(--brand-hover);
}

.trend__axis {
  display: flex;
  justify-content: space-between;
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

/* --- roles ------------------------------------------------------------------ */
.rolebars {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.rolebars__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  row-gap: var(--space-1);
  font-size: var(--text-sm);
}

.rolebars__count {
  font-variant-numeric: tabular-nums;
}

.rolebars__track {
  grid-column: 1 / -1;
  block-size: var(--meter-track);
  border-radius: var(--r-pill);
  background: var(--surface-3);
  overflow: hidden;
}

.rolebars__fill {
  display: block;
  block-size: 100%;
  border-radius: inherit;
  background: var(--brand);
}

/* --- status breakdown ------------------------------------------------------- */
.statusbar {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.statusbar__head {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
}

.statusbar__label {
  font-weight: var(--weight-medium);
}

.statusbar__track {
  display: flex;
  gap: 2px;
  block-size: var(--space-2);
  border-radius: var(--r-pill);
  background: var(--surface-3);
  overflow: hidden;
}

.statusbar__segment {
  flex-basis: 0;
  min-inline-size: 4px;
}

.statusbar__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  font-size: var(--text-xs);
}

.statusbar__legend li {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.statusbar__dot {
  inline-size: var(--space-2);
  block-size: var(--space-2);
  border-radius: var(--r-circle);
}

:is(.statusbar__segment, .statusbar__dot) { background: var(--text-tertiary); }
:is(.statusbar__segment, .statusbar__dot)[data-tone="success"] { background: var(--success); }
:is(.statusbar__segment, .statusbar__dot)[data-tone="warning"] { background: var(--warning); }
:is(.statusbar__segment, .statusbar__dot)[data-tone="danger"] { background: var(--danger); }

@media (prefers-reduced-motion: reduce) {
  .trend__bar {
    transition: none;
  }
}

/* Seven rows of twenty-four. Always 168 cells — never conditional on the data,
   because the server always sends all of them.

   ⚠ THE COLUMNS SHRINK, THE PAGE DOES NOT SCROLL SIDEWAYS. A 0.65rem floor per hour made
     the grid wider than a phone, so the heatmap scrolled inside its card. `minmax(0, 1fr)`
     lets 24 square cells fit any card, down to about 9px each on a 375px screen. */
.heatmap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.heatmap__row {
  display: grid;
  grid-template-columns: 2.5rem repeat(24, minmax(0, 1fr));
  gap: 2px;
  align-items: center;
}

.heatmap__hours {
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.heatmap__legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  color: var(--text-tertiary);
  font-size: var(--text-xs);
}

.heatmap__legend .heatmap__cell {
  inline-size: 0.75rem;
}

.heatmap__legend > span:first-child {
  margin-inline-end: var(--space-1);
}

.heatmap__legend > span:last-child {
  margin-inline-start: var(--space-1);
}


.heatmap__label {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  white-space: nowrap;
}

.heatmap__cell {
  aspect-ratio: 1;
  border-radius: var(--r-xs);
  /* The cell's WEIGHT is its opacity, set inline from the count. The colour is
     fixed here so a quiet hour is a faint version of the same hue rather than a
     different one. */
  background: var(--brand);
}

/* --- the console's charts (owner, 2026-11-14) -------------------------------------------------
   `consoleCharts.tsx`. A value axis, a plot and a date axis on one grid, so the axes stay attached
   to the plot whatever its width; every label is positioned from its own value, and the date axis
   prints only the labels that fit (measured in the component). */
.cchart {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-inline-size: 0;
}

.cchart__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
}

.cchart__legend li,
.cchart__tip-row {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.cchart__key {
  inline-size: var(--space-2);
  block-size: var(--space-2);
  border-radius: var(--r-xs);
  background: var(--brand);
  flex: none;
}

.cchart__frame {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: 10rem auto;
  column-gap: var(--space-2);
}

.cchart__yaxis {
  position: relative;
  min-inline-size: 2ch;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  text-align: end;
}

.cchart__yaxis > span {
  position: absolute;
  inset-inline-end: 0;
  transform: translateY(50%);
  line-height: 1;
  white-space: nowrap;
}

/* The widest tick sets the axis width: an invisible copy of it stays in the flow. */
.cchart__yaxis > .cchart__ysizer {
  position: static;
  display: block;
  block-size: 0;
  overflow: hidden;
  visibility: hidden;
  transform: none;
}

.cchart__plot {
  position: relative;
  min-inline-size: 0;
  border-block-end: 1px solid var(--border);
}

.cchart__grid {
  position: absolute;
  inset-inline: 0;
  border-block-start: 1px solid var(--border-subtle);
}

.cchart__cols {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: stretch;
}

.cchart__col {
  display: flex;
  flex: 1 1 0;
  flex-direction: column-reverse;
  gap: 2px;
  min-inline-size: 0;
  border-radius: var(--r-xs) var(--r-xs) 0 0;
}

.cchart__col[data-active] {
  background: color-mix(in oklab, var(--text) 6%, transparent);
}

.cchart__seg {
  flex: none;
  min-block-size: 2px;
  background: var(--brand);
}

/* Only the top of the stack is rounded, and only at the top. */
.cchart__seg:last-child {
  border-radius: var(--r-xs) var(--r-xs) 0 0;
}

/* A quiet day still draws, faintly, so a run of zeroes does not read as missing data. */
.cchart__zero {
  block-size: 2px;
  background: var(--border-strong);
}

:is(.cchart__seg, .cchart__key, .cbars__fill)[data-tone="success"] { background: var(--success); }
:is(.cchart__seg, .cchart__key, .cbars__fill)[data-tone="warning"] { background: var(--warning); }
:is(.cchart__seg, .cchart__key, .cbars__fill)[data-tone="danger"] { background: var(--danger); }
:is(.cchart__seg, .cchart__key, .cbars__fill)[data-tone="info"] { background: var(--info); }
:is(.cchart__seg, .cchart__key, .cbars__fill)[data-tone="muted"] { background: var(--text-tertiary); }

.cchart__xaxis {
  position: relative;
  block-size: 1.5em;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.cchart__xaxis > span {
  position: absolute;
  inset-block-start: var(--space-1);
  transform: translateX(-50%);
  white-space: nowrap;
}

/* The first and last labels hang inward from their column, so neither leaves the card. */
.cchart__xaxis > span[data-edge="start"] {
  transform: translateX(-0.5ch);
}

.cchart__xaxis > span[data-edge="end"] {
  transform: translateX(calc(-100% + 0.5ch));
}

.cchart__tip {
  position: absolute;
  inset-block-start: 0;
  z-index: 2;
  display: grid;
  gap: 2px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-1);
  transform: translateX(-50%);
  pointer-events: none;
  white-space: nowrap;
}

.cchart__tip[data-edge="start"] {
  transform: translateX(0);
}

.cchart__tip[data-edge="end"] {
  transform: translateX(-100%);
}

.cchart__tip-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  column-gap: var(--space-2);
}

.cchart__tip-total {
  padding-block-start: 2px;
  border-block-start: 1px solid var(--border-subtle);
}

/* Named bars: name, bar, number on one line; a long name is cut, never the number. */
.cbars {
  display: grid;
  gap: var(--space-2);
}

.cbars__row {
  display: grid;
  grid-template-columns: minmax(4rem, 9rem) minmax(3rem, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
}

.cbars__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cbars__track {
  block-size: var(--space-2);
  border-radius: var(--r-pill);
  background: var(--surface-3);
  overflow: hidden;
}

.cbars__fill {
  display: block;
  block-size: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.cbars__value {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* --- Statistika (owner, 2026-11-14) -----------------------------------------------------------
   The period on top, the queues that need someone, the headline numbers, the charts. Every card is
   a link: a pointer, a lift on hover and a ring on focus say so. */
.cdash__bar {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
}

.cdash__lede {
  margin: 0;
}

.cdash__heading {
  margin: 0 0 var(--space-2);
  font-size: var(--text-md);
  font-weight: var(--weight-strong);
}

.cdash__queues {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(11rem, 100%), 1fr));
  gap: var(--space-2);
}

.cdash__queue {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}

.cdash__queue-count {
  min-inline-size: 2ch;
  font-size: var(--text-lg);
  font-weight: var(--weight-strong);
  color: var(--text-tertiary);
}

.cdash__queue-label {
  line-height: 1.25;
  /* "Quraşdırılmamış təşkilat" is one long word; it breaks rather than runs out of its box. */
  overflow-wrap: anywhere;
}

/* A queue holding something takes the warning edge; an empty one stays quiet. */
.cdash__queue[data-lit] {
  border-color: color-mix(in oklab, var(--warning) 55%, transparent);
  background: color-mix(in oklab, var(--warning) 8%, transparent);
  color: var(--text);
}

.cdash__queue[data-lit] .cdash__queue-count {
  color: var(--warning-strong);
}

.cdash__queue:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

/* Seven tiles: five for the period, two "now". One row when it fits; otherwise four and three,
   then pairs with the last tile across - never six and one stranded. */
.cdash__kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.cdash__kpis > :last-child {
  grid-column: 1 / -1;
}

@container dash (min-width: 40rem) {
  .cdash__kpis {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .cdash__kpis > * {
    grid-column: span 3;
  }

  .cdash__kpis > :nth-child(n + 5) {
    grid-column: span 4;
  }

  .cdash__kpis > :last-child {
    grid-column: span 4;
  }
}

@container dash (min-width: 72rem) {
  .cdash__kpis {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .cdash__kpis > *,
  .cdash__kpis > :nth-child(n + 5),
  .cdash__kpis > :last-child {
    grid-column: auto;
  }
}

.cdash__link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.cdash__link:hover {
  border-color: var(--border-strong);
  background: color-mix(in oklab, var(--surface-2) 60%, transparent);
  transform: translateY(-1px);
}

.cdash__link:focus-visible,
.cdash__queue:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.cdash__go {
  display: inline-grid;
  place-items: center;
  color: var(--text-tertiary);
  transition: color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.cdash__link:hover .cdash__go {
  color: var(--brand);
  transform: translateX(2px);
}

@media (prefers-reduced-motion: reduce) {
  .cdash__link,
  .cdash__link:hover,
  .cdash__go,
  .cdash__link:hover .cdash__go {
    transition: none;
    transform: none;
  }
}

/* Giriş limitləri: a slider and a box for each figure; a changed row is marked until saved. */
.limits-value {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

.limits-slider {
  inline-size: min(10rem, 100%);
  accent-color: var(--brand);
}

.limits-table td:last-child {
  white-space: nowrap;
}

.limits-table tr[data-changed] > td:first-child {
  box-shadow: inset 3px 0 0 var(--warning);
}

/* Export (owner, 2026-11-14): a table's CSV button, and a chart's PNG button in its top corner. */
.export-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.cchart,
.cbars-wrap {
  position: relative;
}

.chart-dl {
  position: absolute;
  inset-block-start: 0;
  inset-inline-end: 0;
  z-index: 1;
  opacity: 0.55;
}

.chart-dl:hover,
.chart-dl:focus-visible {
  opacity: 1;
}

.chart-dl-row {
  display: flex;
  justify-content: flex-end;
}

.chart-dl-row .chart-dl {
  position: static;
}

/* The console's menu search, past the menu's own lines: tabs, sections and settings by their text. */
.console-search {
  display: grid;
  gap: 2px;
  margin-block-start: var(--space-3);
  padding-block-start: var(--space-2);
  border-block-start: 1px solid var(--border-subtle);
}

/* "Nothing found" is not true while the search lists sections or settings. */
.shell[data-origin="apex"] .shell__nav:has(.console-search) .shell__noresults {
  display: none;
}

.console-search__heading {
  margin: var(--space-2) var(--space-2) var(--space-1);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.console-search__hit {
  display: grid;
  gap: 1px;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--r-sm);
  color: inherit;
  text-decoration: none;
}

.console-search__hit:hover,
.console-search__hit:focus-visible {
  background: color-mix(in oklab, var(--text) 7%, transparent);
}

.console-search__title {
  font-size: var(--text-sm);
}

.console-search__sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Qlobal ayarlar (owner, 2026-11-14: "better visuals. i cant find a thing or read a thing"): one
   inset card per area, a row per setting - words on the left, the control on the right - and a
   save bar that follows the reader once anything has changed. */
/* Each area is the console's own fold (`.sub-card.sub-fold`, as on a subscriber's page); this only
   spaces the cards and lets the rows run to the card's edges. */
.gset {
  margin-block-end: var(--space-3);
}

/* The review before a save: what changes, from what, to what. */
.review-table td {
  vertical-align: top;
}

.review-table__from {
  color: var(--text-tertiary);
  text-decoration: line-through;
  text-decoration-color: color-mix(in oklab, var(--text-tertiary) 50%, transparent);
}

.review-table__to {
  font-weight: var(--weight-strong);
}

.gset__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(12rem, auto);
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-2);
  border-block-start: 1px solid var(--border-subtle);
}

.gset__row[data-changed] {
  box-shadow: inset 3px 0 0 var(--warning);
  background: color-mix(in oklab, var(--warning) 5%, transparent);
}

.gset__text-col {
  display: grid;
  gap: 2px;
  min-inline-size: 0;
}

.gset__desc {
  margin: 0;
  max-inline-size: 60rem;
}

.gset__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  margin: 0;
}

.gset__control {
  display: flex;
  justify-content: flex-end;
}

.gset__basis summary {
  cursor: pointer;
  inline-size: fit-content;
}

.gset__basis[open] > span {
  display: block;
  margin-block-start: var(--space-1);
  max-inline-size: 60rem;
}

.gset__value,
.gset__switch {
  align-items: center;
  gap: var(--space-2);
}

.gset__number {
  inline-size: 7rem;
}

.gset__text {
  inline-size: min(18rem, 100%);
}

.gset__savebar {
  position: sticky;
  inset-block-end: var(--space-3);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-block-start: var(--space-3);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--r-md);
}

@container (max-width: 40rem) {
  .gset__row {
    grid-template-columns: minmax(0, 1fr);
  }

  .gset__control {
    justify-content: flex-start;
  }
}

/* Şaklı ünvan adları: the name with its open-in-a-new-tab button; the live check's badge and figures. */
.held-label,
.held-check {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

/* Funksiyalar: the catalogue's description under each feature's name. */
.feature-desc {
  display: block;
  max-inline-size: 28rem;
  margin-block-start: 2px;
  font-weight: normal;
}

/* --- background jobs (owner, 2026-11-14: "so unreadable") -------------------------------------
   `jobsKit.tsx`: a verdict in words first, then what the count means, then the detail. */
.jobs {
  display: grid;
  gap: var(--space-3);
}

.jobs__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.jobs-verdict {
  margin: 0;
  padding-inline-start: var(--space-3);
  border-inline-start: 3px solid var(--success);
}

.jobs-verdict[data-tone="warning"] {
  border-inline-start-color: var(--warning);
}

.jobs-verdict[data-tone="danger"] {
  border-inline-start-color: var(--danger);
}

.jobs-explain {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
}

.jobs-explain p {
  margin: 0;
}

.jobs-trace {
  max-block-size: 20rem;
  margin: 0;
  padding: var(--space-3);
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* A live sample of the draft, drawn from the six tokens the editor holds
   rather than from the server's stylesheet — which does not exist until the
   draft is saved. */
.theme-preview {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  border: 1px solid var(--border);
  /* Colours, radius and fonts come from the draft, inline — this rule only
     provides the shape they are painted onto. */
  border-radius: var(--r-md);
  background: var(--surface-1);
  color: var(--text);
}

.theme-preview__button {
  align-self: flex-start;
  padding: var(--space-2) var(--space-4);
  border: 0;
  border-radius: inherit;
  background: var(--brand);
  color: var(--text-on-brand);
  font-family: inherit;
  font-weight: var(--weight-medium);
}

/* An internal note is invisible to the person who filed the ticket. It is
   tinted so a support agent can see at a glance which half of the thread the
   reporter is reading. */
.ticket--internal {
  border-inline-start: 3px solid var(--warning);
  background: var(--warning-subtle);
}

/* Images on a support ticket. Square thumbnails in a row that wraps, so a tall
   screenshot cannot stretch the thread; the whole image is one click away in its
   own tab. A file name shown where no preview exists can be called anything, so it
   wraps anywhere rather than setting the dialog's min-content width. */
.ticket-images {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.ticket-images__item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  inline-size: calc(var(--space-9) * 2);
  block-size: calc(var(--space-9) * 2);
  min-inline-size: 0;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  background: var(--surface-2);
}

.ticket-images__link {
  display: block;
  inline-size: 100%;
  block-size: 100%;
}

.ticket-images__thumb {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

.ticket-images__name {
  padding: var(--space-1);
  text-align: center;
  overflow-wrap: anywhere;
}

.ticket-images__remove {
  position: absolute;
  inset-block-start: var(--space-1);
  inset-inline-end: var(--space-1);
  background: var(--surface-1);
}

/*
 * ⚠ MACHINE TEXT IS NEVER CASE-TRANSFORMED. `.table th` uppercases, and a row header
 *   holding a code identifier goes through it too — which in Azerbaijani is not a
 *   cosmetic change: the document is `lang="az"`, so CSS applies the Turkish casing rule
 *   and every dotless `i` becomes `İ`. `AiInference` rendered as `AİINFERENCE`,
 *   `LiveSessions` as `LİVESESSİONS`, `CustomDomains` as `CUSTOMDOMAİNS` — feature codes
 *   an operator is meant to match against the registry, silently misspelt.
 *
 *   `.mono` is this codebase's marker for text the machine chose rather than a translator,
 *   so it opts out wholesale rather than one selector at a time.
 */
/*
 * `.mono.mono` rather than `.mono`, and not `!important`: the rule it has to beat is
 * `.table th`, which is (0,1,1) — one class, one element — so a bare `.mono` at (0,1,0)
 * loses on specificity no matter where it sits in the cascade. Doubling the class makes
 * it (0,2,0), which wins, and keeps the escape hatch open for anything that genuinely
 * needs to override it later.
 */
.mono.mono {
  text-transform: none;
}

/*
 * One token to its reader: a document number (INV-2026-000002) or a mark (8 / 10). In a
 * narrow table column the browser broke the first at each hyphen and the second at each
 * space, and on a phone a tutor read an invoice number as three lines of fragments
 * (tutor#26) and a parent read a mark stacked digit over slash over digit. The column
 * grows by the token's width instead; those tables already scroll sideways behind an
 * edge fade.
 */
.nowrap {
  white-space: nowrap;
}

/* ===========================================================================
   Live - the guest link. The room's own placement is `pages/live/room/room.css`.
   =========================================================================== */

/*
 * The one-time guest URL. It exists in exactly one response and never again, so it wraps
 * rather than truncating — an ellipsis here would hide the half of the token that makes
 * the link work, and there is no second chance to read it.
 */
.guest-url {
  display: block;
  padding: var(--space-3);
  border-radius: var(--r-sm);
  background: var(--surface-sunken);
  font-size: var(--text-xs);
  overflow-wrap: anywhere;
  user-select: all;
}

/* ===========================================================================
   Finance — money, which has one typographic requirement above all others.
   =========================================================================== */

/*
 * Amounts are read by comparing them down a column, so the digits must line up: tabular
 * figures, right-aligned, monospace. A proportional 1 is narrower than a 0 and turns a
 * column of totals into a ragged edge that has to be read rather than scanned.
 */
.numeric {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

/* The totals block under an invoice's lines. Two columns, the figures aligned with the
   line totals above them so the arithmetic can be followed by eye. */
.totals {
  margin-inline-start: auto;
  min-width: 18rem;
}

.totals dd {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/*
 * Overdue is DERIVED CLIENT-SIDE — there is no overdue status, no due-date filter and no
 * ageing endpoint anywhere in this API. Coloured rather than badged in the list so a
 * scan down the due-date column finds it without a second element per row.
 */
.overdue {
  color: var(--danger);
  font-weight: var(--weight-medium);
}

/* ===========================================================================
   The public landing page — apex origin, anonymous only.

   Every value here reads a token. The two things worth knowing before editing:

   1. EXACTLY THREE SURFACES ARE `.mat`: the sticky header, the hero card and
      the closing panel. Every card repeated in a grid — features, roles, steps,
      plans, FAQ rows — is `.mat-inset`, which never blurs. That is a measured
      decision, not a stylistic one, and `src/pages/public/Landing.tsx` carries
      the numbers: one `.mat` per card is 27 backdrop-filters plus 27 blended
      noise layers over a 4,500px page, and it cost up to 46ms per scroll
      repaint against 21ms this way.

      `.mat-inset` is documented as the plane you use INSIDE a material, and
      here it is used on the page ground instead. That is the sanctioned
      exception rather than an oversight — see CLAUDE.md §3 — and it is what the
      border override near the bottom of this block pays for: on the ground
      there is no glass behind it to supply an edge, so it takes the `--border`
      role instead of the glass hairline.

   2. THE PAGE GROUND IS WHAT MAKES THE GLASS FAMILY WORK. A flat `--bg` behind
      a frosted card gives it nothing to refract, so the material reads as a
      slightly grey rectangle. `.lp-hero__glow` and `.lp-section--tint` exist to
      put something behind it — both built with `color-mix` from the brand role,
      so they move with a tenant's seed and cost nothing in the traditional
      family, where they are simply a very quiet wash.
   =========================================================================== */

.lp {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;

  /* ⚠ PAGE-LOCAL GEOMETRY, NOT THEME TOKENS, AND DELIBERATELY NOT IN `tokens.css`.
     The theme is frozen and these three are not part of it: a perspective
     distance, a tilt angle and a per-column lift describe one illustration on
     one page, nothing else in this product has a 3D plane in it, and promoting
     them to the token contract would oblige every future theme to carry an
     answer for a question only this figure asks. They are DECLARATIONS, which
     is also why `lint_hardcodes.py` does not flag the `px` and the `deg` — a
     custom property defines a value rather than bypassing one, and defining the
     three here is what keeps them in one place instead of typed into four
     transforms. See the hero-visual block below for why none of this is allowed
     anywhere near a `.mat`. */
  /* Measured on the render at 1440px, where the five columns are about 100px each:
     at 1600px / -13deg / 10px the columns came out 98.9 → 111.3px across the week,
     which is a 12% gain and reads as a rendering artefact rather than as depth. These
     three are the same figure re-measured at 23%, which is the point where a sighted
     reader sees a plane standing in space and still no block is skewed enough to look
     broken. Anything past about -20deg and the far column's blocks start to read as
     the wrong shape. */
  --lp-depth: 1100px;
  --lp-tilt: -16deg;
  --lp-lift: 14px;
  /* ⚠ `clip`, NOT `hidden`, AND THE DIFFERENCE IS THE STICKY HEADER.
     `.lp-section--tint::before` full-bleeds with `margin-inline: calc(50% - 50vw)`, and
     `50vw` counts the classic scrollbar while the containing block does not — so on any
     browser with a non-overlay scrollbar the band overhangs both edges by half a
     scrollbar and the page grows a horizontal scrollbar of its own. An absolutely
     positioned descendant still contributes to scrollable overflow; `z-index: -1` hides
     it, it does not shrink it. `overflow: hidden` would fix that and silently turn the
     nearest ancestor into a scroll container, which is what stops `position: sticky`
     working; `clip` fixes it and leaves the other axis genuinely visible. */
  overflow-x: clip;
}

/* The first tab stop. Off-screen until focused, then it lands where it says. */
.lp__skip,
.shell__skip {
  /* Fixed, not absolute: nothing above it is positioned, so `absolute` resolved against
     the document and the "hidden" offset was an absolute page coordinate. Tab to it after
     any scroll and focus went somewhere off-screen. */
  position: fixed;
  left: var(--space-4);
  top: calc(var(--space-8) * -1);
  z-index: var(--z-skip);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--r-md);
  background: var(--brand);
  color: var(--text-on-brand);
  font-size: var(--text-sm);
  transition: top var(--dur-fast) var(--ease-out);
}

/* `:focus` as well as `:focus-visible` — a focus moved programmatically or by the browser's
   own restoration is still a focus, and a focused control the reader cannot see is worse
   than one they can. */
.lp__skip:focus,
.lp__skip:focus-visible,
.shell__skip:focus,
.shell__skip:focus-visible {
  top: var(--space-4);
  text-decoration: none;
}

.lp__main {
  flex: 1;
}

/* --- the header ------------------------------------------------------------
   A floating bar rather than a full-bleed one: `.mat` carries `--radius-lg`, and
   squaring it off here would be this file writing a radius, which the contract
   forbids. Inset on all sides it also reads as what it is — a control surface
   over the page rather than a band welded to the top of it.
   -------------------------------------------------------------------------- */

.lp-header {
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  padding: var(--space-3) var(--space-4);
}

.lp-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  max-width: var(--container-xl);
  margin-inline: auto;
  padding: var(--space-2) var(--space-3);
  /* Floating chrome, the landing page's counterpart to the shell's topbar, so it
     restates the chrome radius the way the topbar and the sidebar do now that the
     material's own radius is the card one. */
  border-radius: var(--r-lg);
}

.lp-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text);
  text-decoration: none;
  flex: none;
}

.lp-brand:hover {
  text-decoration: none;
}

/* The product mark (`BrandMark`): the Æ ligature on a tile, drawn inline from the theme
   so it follows light, dark and a tenant palette. `scripts/make-favicon.mjs` writes the
   same geometry into the favicon and `public/brand/`. */
.brand-mark {
  display: block;
  flex: none;
}

.brand-mark__tile {
  fill: var(--brand);
}

/* White in every mode, as the mark was chosen. `--text-on-brand` turns navy in dark mode,
   which is right for text but made the logo a different logo; the Æ strokes are graphic
   and clear the 3:1 non-text threshold on both brand blues. */
.brand-mark__glyph {
  fill: none;
  stroke: rgb(var(--light-rgb));
  stroke-width: 5.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lp-mark {
  width: var(--space-7);
  height: var(--space-7);
}

/* In the shell the product mark takes the initial's box, but draws its own tile. */
.shell__mark--product {
  background: none;
  border-radius: 0;
}

.lp-brandname {
  font-family: var(--seed-font-display);
  font-weight: var(--weight-strong);
  font-size: var(--text-lg);
}

.lp-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-inline: auto;
}

.lp-nav__link {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--r-md);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}

.lp-nav__link:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

[data-family="glass"] .lp-nav__link:hover {
  background: var(--surface-2);
}

.lp-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: none;
}

/* --- widths that do not follow the language --------------------------------
   Switching az / en / ru resized every label-sized control on this page and moved
   the nav with them. Measured at 1440px, az / en / ru:
     Register 91.2 / 79.8 / 108.1px      Sign in 76.2 / 72.5 / 61.4px
     "Features" 75.5 / 73.7 / 108.0px    the nav's left edge 451 / 471 / 434px
     hero call to action 180.1 / 192.6 / 219.0px

   Each floor is the widest of the three labels in `ch` of the control's own font,
   rounded up with at least half a character to spare for another platform's
   metrics, plus the control's own inline padding (these boxes are border-box). A
   floor and never a width: a longer translation still grows the control rather
   than being cut. When one of these labels changes, re-measure and move its number.
   -------------------------------------------------------------------------- */
.lp-nav__link {
  text-align: center;
}

/* 11.7ch, 10.1ch, 5.7ch and 7.6ch at their widest - "Возможности", "Who it is for",
   "Планы", "Вопросы". */
.lp-nav__link--features {
  min-inline-size: calc(13ch + 2 * var(--space-3));
}

.lp-nav__link--roles {
  min-inline-size: calc(11ch + 2 * var(--space-3));
}

.lp-nav__link--plans {
  min-inline-size: calc(7ch + 2 * var(--space-3));
}

/* The FAQ anchor shares the fifth slot with the contact anchor rather than taking a
   sixth: six labels plus the wordmark plus four action controls overflowed between
   64rem - where the nav is still shown - and about 80rem. `Landing.tsx` renders the
   contact one when a channel is configured and this one when none is, so both floors
   stay and only one is used at a time. */
.lp-nav__link--faq {
  min-inline-size: calc(9ch + 2 * var(--space-3));
}

/* 8.6ch and 8.4ch at their widest - "Продукт" is short in all three, and
   "Контакты" is the long one of the pair. Measured the same way as the four
   above: the widest of az / en / ru in the control's own `ch`, rounded up with
   half a character to spare, plus the control's own inline padding. */
.lp-nav__link--tour {
  min-inline-size: calc(10ch + 2 * var(--space-3));
}

.lp-nav__link--contact {
  min-inline-size: calc(10ch + 2 * var(--space-3));
}

/* 8.3ch "Daxil ol" on the ghost button's narrower padding; 10.5ch "Регистрация". */
.lp-cta--signin {
  min-inline-size: calc(9ch + 2 * var(--space-2));
}

.lp-cta--register {
  min-inline-size: calc(12ch + 2 * var(--space-4));
}

/* `.lp-btn--lg` sets 15px type, so its `ch` is its own: 21.5ch "Создайте своё
   заведение" and 22.4ch "Посмотреть возможности". The hero and the closing panel share
   the first. On a phone both are full width already, which is wider than either floor. */
.lp-cta--start {
  min-inline-size: calc(22ch + 2 * var(--space-5));
}

.lp-cta--explore {
  min-inline-size: calc(23ch + 2 * var(--space-5));
}

/* --- the hero -------------------------------------------------------------- */

.lp-hero {
  position: relative;
  overflow: hidden;
  padding: var(--space-8) var(--space-4);
}

/*
 * Two washes behind the fold. This is the only decoration on the page and it is pure
 * `color-mix` off the semantic roles: a tenant that reseeds the theme reseeds this, and
 * the traditional family gets the same shape at the same strength rather than a special
 * case. `pointer-events: none` because it sits over nothing and must catch nothing.
 */
.lp-hero__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 55% at 15% 0%, color-mix(in oklab, var(--brand) 18%, transparent), transparent 70%),
    radial-gradient(45% 45% at 90% 25%, color-mix(in oklab, var(--info) 14%, transparent), transparent 70%);
}

.lp-hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: var(--space-8);
  max-width: var(--container-xl);
  margin-inline: auto;
}

.lp-hero__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
}

.lp-badge {
  margin: 0;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--r-pill);
  background: var(--brand-subtle);
  color: var(--brand-strong);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

/* ⚠ `--text-display-lg`, NOT `--text-3xl`, AND THE DIFFERENCE IS A GATE RATHER
   THAN A PREFERENCE. `.claude/rules/components.md` requires the largest heading
   on a screen to be at least 2.5x the body size, and `taste_audit.mjs` reports a
   HIGH finding when it is not: `--text-3xl` is 2.125x, which is bold body text
   wearing an h1. `--text-display-lg` is the token the scale already carries for
   exactly this — a clamp from `--text-3xl` up to 3.5x — so the hero grows on a
   desktop and lands back on the old size on a phone, where the 64rem query below
   no longer needs to shrink it by hand. */
.lp-hero__title {
  margin: 0;
  font-size: var(--text-display-lg);
  line-height: var(--leading-tight);
  max-width: 18ch;
}

.lp-hero__sub {
  margin: 0;
  max-width: 46ch;
  font-size: var(--text-lg);
  color: var(--text-secondary);
}

.lp-hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* The two calls to action are the only controls on the page that need to be bigger
   than the app's own buttons. `.btn` owns everything else about them. */
.lp-btn--lg {
  min-height: var(--space-7);
  padding-inline: var(--space-5);
  font-size: var(--text-base);
}

.lp-hero__note {
  margin: 0;
}

/* --- the hero visual -------------------------------------------------------
   An abstraction of the timetable, drawn from tokens. It carries no figure and no
   percentage on purpose: an invented number in a mockup is still an invented number,
   and its caption names it an illustration for the same reason.
   -------------------------------------------------------------------------- */

.lp-mock {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: center;
}

.lp-mock__card {
  width: 100%;
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.lp-mock__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.lp-mock__title {
  font-family: var(--seed-font-display);
  font-weight: var(--weight-strong);
  font-size: var(--text-lg);
}

.lp-mock__grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-2);
}

.lp-mock__col {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-2);
}

.lp-mock__block {
  display: block;
  border-radius: var(--r-xs);
  background: color-mix(in oklab, var(--text) 12%, transparent);
}

/* 0 is a free period — it holds its place in the rhythm and paints nothing.
   4 is the hour the solver placed, which is the one thing this picture is about. */
.lp-mock__block[data-span="0"] { height: var(--space-4); background: transparent; }
.lp-mock__block[data-span="1"] { height: var(--space-3); }
.lp-mock__block[data-span="2"] { height: var(--space-4); }
.lp-mock__block[data-span="3"] { height: var(--space-5); }
.lp-mock__block[data-span="4"] { height: var(--space-4); background: var(--brand); }

.lp-mock__caption {
  margin: 0;
}

/* --- the proof band --------------------------------------------------------
   Three facts about the software, replacing four counters that had no data source.
   -------------------------------------------------------------------------- */

.lp-proof {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr));
  gap: var(--space-5);
  max-width: var(--container-xl);
  margin-inline: auto;
  padding: var(--space-6) var(--space-4);
}

.lp-proof__item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding-inline-start: var(--space-4);
  border-inline-start: var(--rule-accent) solid var(--brand-border);
}

.lp-proof__value {
  font-family: var(--seed-font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-strong);
  line-height: var(--leading-tight);
  font-variant-numeric: tabular-nums;
}

.lp-proof__label {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
}

.lp-proof__note {
  margin: 0;
}

/* --- sections -------------------------------------------------------------- */

.lp-section {
  position: relative;
  max-width: var(--container-xl);
  margin-inline: auto;
  padding: var(--space-8) var(--space-4);
  /* ⚠ WITHOUT THIS EVERY IN-PAGE ANCHOR LANDS UNDER THE STICKY HEADER. The bar is
     `.lp-header` padding plus the inner bar's own height, and it is the full stop of
     WCAG 2.2's 2.4.11 Focus Not Obscured as well as a plain visual bug: following
     "Plans" put the word "Plans" behind the chrome. The value is the header's two
     paddings plus a control's height plus a gap, all from the same tokens the bar is
     built from, so it tracks a density change instead of being a number to maintain. */
  scroll-margin-block-start: calc(var(--space-3) * 2 + var(--space-2) * 2 + var(--space-8));
}

/*
 * The alternating band. Full-bleed while the content stays in the container, done with
 * an inset pseudo-element rather than a wrapper so the markup keeps one element per
 * section. It is a GROUND, so it is painted behind everything and catches nothing.
 */
.lp-section--tint::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: var(--z-behind);
  margin-inline: calc(50% - 50vw);
  background: color-mix(in oklab, var(--brand) 6%, transparent);
}

.lp-section__head {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: 42rem;
  margin-block-end: var(--space-6);
}

.lp-section__title {
  margin: 0;
  font-size: var(--text-2xl);
}

.lp-section__lede {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-lg);
}

/* --- card grids ------------------------------------------------------------ */

.lp-grid {
  display: grid;
  gap: var(--space-4);
}

/*
 * The minimums are chosen so the counts come out square at the container's 78rem: nine
 * features land 3x3 and four roles land 2x2, rather than 4+4+1 and 3+1. `auto-fit` still
 * does the collapsing on the way down — this only decides where it stops on the way up.
 */
/* ⚠ `min(<floor>, 100%)` AND NOT THE BARE FLOOR, because `minmax()`'s minimum is a
   HARD floor: once the container is narrower than it, `auto-fit` still lays a track of
   exactly that width and the track simply hangs out of the grid. Measured on the render
   at 375px: the `--2` grid was 351px wide and its cards were 448px, so the right-hand
   97px of every card in "who it is for" was clipped by `.lp`'s `overflow-x: clip` -
   silently, with no scrollbar to show it. `min(28rem, 100%)` makes the floor collapse to
   the container once there is no room for it, which is the whole fix and costs nothing
   at any width where the floor DID fit. */
.lp-grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr)); }
.lp-grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(28rem, 100%), 1fr)); }

.lp-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
}

.lp-card__icon {
  display: grid;
  place-items: center;
  width: var(--space-7);
  height: var(--space-7);
  margin-block-end: var(--space-1);
  border-radius: var(--r-md);
  background: var(--brand-subtle);
  color: var(--brand-strong);
  flex: none;
}

.lp-card__title {
  margin: 0;
  font-size: var(--text-lg);
}

.lp-card__body {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

/* --- the three steps ------------------------------------------------------- */

.lp-steps {
  display: grid;
  /* `min()` for the reason given on `.lp-grid--*`: a bare floor overflows below it. */
  grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr));
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.lp-step {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
}

.lp-step__num {
  display: grid;
  place-items: center;
  width: var(--space-7);
  height: var(--space-7);
  margin-block-end: var(--space-1);
  border-radius: var(--r-pill);
  background: var(--brand);
  color: var(--text-on-brand);
  font-family: var(--seed-font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-strong);
  flex: none;
}

/* --- plans -----------------------------------------------------------------
   No price appears here and none may be added: nothing in the backend holds one.
   -------------------------------------------------------------------------- */

.lp-plan {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
}

/* Not a `.mat-inset` inside a `.mat-inset`: two flat tints stacked read as one smudge,
   and a rule says the same thing with nothing to composite. */
.lp-plan__fits {
  margin-block-start: auto;
  padding-block-start: var(--space-3);
  border-block-start: 1px solid var(--border-subtle);
}

.lp-plan__fits ul {
  margin: var(--space-2) 0 0;
  padding-inline-start: var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.lp-plan__cta {
  width: 100%;
}

.lp-plans__note {
  max-width: 46rem;
  margin: var(--space-5) 0 0;
  font-size: var(--text-sm);
}

/* --- the FAQ ---------------------------------------------------------------
   Native `details`: keyboard reachable, announced, and findable by the browser's
   own find-in-page without one line of script or one ARIA attribute of ours.
   -------------------------------------------------------------------------- */

.lp-faq {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 52rem;
}

.lp-faq__item {
  padding: var(--space-4) var(--space-5);
}

/*
 * `.mat-inset` is designed to sit INSIDE a material, where the glass behind it supplies
 * the depth. These sit on the page ground instead, so they need the one thing the
 * material would have given them: an edge that survives on a light background. The border
 * role rather than the glass hairline, because it has to hold in both families.
 */
[data-family="glass"] .lp-card,
[data-family="glass"] .lp-step,
[data-family="glass"] .lp-plan,
[data-family="glass"] .lp-faq__item {
  border-color: var(--border);
}

.lp-faq__q {
  cursor: pointer;
  font-family: var(--seed-font-display);
  font-weight: var(--weight-medium);
  font-size: var(--text-lg);
}

.lp-faq__q::marker {
  color: var(--text-tertiary);
}

.lp-faq__a {
  margin: var(--space-3) 0 0;
  color: var(--text-secondary);
}

/* --- the closing call to action -------------------------------------------- */

.lp-closing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-8) var(--space-5);
  text-align: center;
}

.lp-closing .lp-section__lede {
  max-width: var(--container-sm);
}

/* --- the footer ------------------------------------------------------------ */

.lp-footer {
  border-block-start: 1px solid var(--border-subtle);
  padding: var(--space-7) var(--space-4) var(--space-5);
}

.lp-footer__cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr));
  gap: var(--space-5);
  max-width: var(--container-xl);
  margin-inline: auto;
}

.lp-footer__col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--text-sm);
}

.lp-footer__col a {
  color: var(--text-secondary);
}

.lp-footer__col a:hover {
  color: var(--text);
}

.lp-footer__col p {
  margin: 0;
}

.lp-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  max-width: var(--container-xl);
  margin: var(--space-6) auto 0;
  padding-block-start: var(--space-4);
  border-block-start: 1px solid var(--border-subtle);
}

.lp-footer__bottom p {
  margin: 0;
}

/* --- motion: the one reveal primitive --------------------------------------
   Every section below the hero carries `.lp-reveal`, and this is the whole of
   the mechanism: a scroll-driven `view()` timeline, which needs no observer, no
   state and no JavaScript, and which the compositor runs off the main thread.

   ⚠ THE ANIMATION IS DECLARED ONLY INSIDE BOTH GUARDS, AND THAT IS WHY NOTHING
     HERE CAN HIDE CONTENT. `.lp-reveal` on its own paints nothing, sets nothing
     and animates nothing — a visitor whose browser has no `view()` timeline, or
     who asked for reduced motion, reads a completely ordinary page. The usual
     way this gets written is the other way round (hide in the base rule, reveal
     inside an `@supports`), and that ships a blank page to everybody the query
     misses.

   ⚠ `--motion-scale` CANNOT CARRY THIS ONE. It zeroes a DURATION, and a
     scroll-driven animation has no duration — its progress IS the scroll
     position. So reduced motion is handled by the media query here rather than
     by the token, and this is the one place in this stylesheet where that is
     true.

   The stagger is the range END moving with `--lp-i`, not a delay: `animation-delay`
   means nothing on a scroll timeline. Item 0 finishes at 22% of its cover range
   and item 5 at 42%, so a row resolves across as it rises.
   -------------------------------------------------------------------------- */

@keyframes lp-rise {
  from {
    opacity: 0;
    transform: translateY(var(--space-5));
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .lp-reveal {
      animation: lp-rise linear both;
      animation-timeline: view();
      animation-range: entry 6% cover calc(22% + var(--lp-i, 0) * 4%);
    }
  }
}

/* The hero wash, drifting. `--dur-indicator` is the one duration that does NOT
   scale with `--motion-scale` (tokens.css), so the period is a multiple of it
   rather than of `--dur-slow`, which would resolve to 0s under reduced motion
   and leave an infinite loop of zero length spinning. The media query is what
   actually turns this off. A transform and nothing else, so it stays on the
   compositor and never invalidates layout. */
@media (prefers-reduced-motion: no-preference) {
  .lp-hero__glow {
    animation: lp-drift calc(var(--dur-indicator) * 20) var(--ease-in-out) infinite alternate;
  }
}

@keyframes lp-drift {
  to {
    transform: translate3d(var(--space-4), calc(var(--space-3) * -1), 0) scale(1.07);
  }
}

/* --- the hero visual, in depth ---------------------------------------------
   ⚠ NO GLASS IS TRANSFORMED HERE, AND THAT IS THE WHOLE DESIGN OF IT. A
     `backdrop-filter` samples what is painted behind it in the element's own
     space, so rotating a `.mat` in 3D is the most reliable way there is to lose
     the blur — and 2026-09-29 already cost this project a production release
     that shipped with no blur on it at all. `.lp-mock__card` keeps its glass and
     only supplies the perspective; what tilts is `.lp-mock__grid` and its
     columns, which sit INSIDE a `.mat` and are therefore excluded from the glass
     rules by `:not(.mat *)` — flat bordered planes with nothing to resample.

   It flattens on hover AND on focus-within, so a keyboard reader tabbing into
   the figure gets the same square-on view a pointer does.
   -------------------------------------------------------------------------- */

.lp-mock__card {
  perspective: var(--lp-depth);
}

.lp-mock__grid {
  transform-style: preserve-3d;
  transform: rotateY(var(--lp-tilt)) rotateX(calc(var(--lp-tilt) * -0.4));
  transition: transform var(--dur-slow) var(--ease-spring);
}

.lp-mock:hover .lp-mock__grid,
.lp-mock:focus-within .lp-mock__grid {
  transform: none;
}

/* Each column stands a little further forward than the last, so the week recedes
   instead of being one flat plane rotated. `--lp-i` is the column index, written
   inline by `Landing.tsx` the way `ClockTimetable` writes `--ttc-hours`. */
.lp-mock__col {
  transform: translateZ(calc(var(--lp-lift) * var(--lp-i, 0)));
  transition: transform var(--dur-slow) var(--ease-spring);
}

.lp-mock:hover .lp-mock__col,
.lp-mock:focus-within .lp-mock__col {
  transform: none;
}

/* --- the product tour ------------------------------------------------------
   Four of the product's own screens, each drawn from the shape primitives below
   rather than screenshotted. There is no screenshot in this brand and no image
   pipeline on this page; there is also nothing to screenshot honestly before a
   tenant has data in it.

   ⚠ NOT ONE NUMBER APPEARS IN ANY OF THE FOUR. A mock grade book with marks in
     it, or an invoice carrying a total, is invented data wearing a screenshot —
     the same thing `Proof` refuses two sections above. Every panel is bars, rows
     and pills; the only words are the product's own screen titles, and the
     caption under the stage names the whole thing an illustration.
   -------------------------------------------------------------------------- */

.lp-tour {
  display: grid;
  grid-template-columns: minmax(0, 17rem) minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
}

.lp-tour__tabs {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* A real `<button>` in a real tablist: the arrow keys, Home and End come from the
   roving-tabindex handler in `Landing.tsx`, and everything else comes free. */
.lp-tour__tab {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: none;
  color: var(--text-secondary);
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}

.lp-tour__tab:hover {
  background: var(--surface-2);
  color: var(--text);
}

.lp-tour__tab:active {
  background: var(--surface-3);
}

.lp-tour__tab[aria-selected="true"] {
  background: var(--brand-subtle);
  border-color: var(--brand-border);
  color: var(--brand-strong);
}

.lp-tour__tabname {
  font-family: var(--seed-font-display);
  font-weight: var(--weight-medium);
  font-size: var(--text-base);
}

.lp-tour__tabnote {
  font-size: var(--text-sm);
  color: inherit;
  opacity: 0.85;
}

.lp-tour__stage {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  /* A floor, not a height: the four panels differ by a row or two, and without
     one the whole section jumps every time a tab changes. The tallest panel
     decides the number; a longer one still grows the stage. */
  min-block-size: 24rem;
}

.lp-tour__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-block-end: var(--space-3);
  border-block-end: 1px solid var(--border-subtle);
}

.lp-tour__screen {
  font-family: var(--seed-font-display);
  font-weight: var(--weight-strong);
  font-size: var(--text-lg);
}

/* The panel swap. `--dur-enter` is the system's entrance duration and goes to 0s
   under reduced motion, which lands the panel on its final frame immediately —
   so unlike `.lp-reveal` this one needs no media query of its own. */
/* ⚠ IT GROWS INTO THE STAGE'S FLOOR RATHER THAN SITTING AT THE TOP OF IT. The floor
   exists so the section does not jump by a row and a half every time a tab changes; a
   panel that does not fill it leaves that difference as dead space under its own
   caption, which reads as a panel that failed to load rather than as a considered
   layout (`.claude/rules/components.md`, rule 3). The shapes below distribute into
   whatever is left over, so all four panels end at the same line. */
.lp-tour__panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  animation: lp-panel var(--dur-enter) var(--ease-out) both;
}

.lp-tour__panel > .lp-sk,
.lp-tour__panel > .lp-sk__week {
  flex: 1;
}

/* The rows spread down the panel; the week's columns stretch to its full height. */
.lp-tour__panel > .lp-sk {
  justify-content: space-between;
}

.lp-tour__panel > .lp-sk__week > .lp-mock__col {
  justify-content: space-between;
}

@keyframes lp-panel {
  from {
    opacity: 0;
    transform: translateY(calc(var(--space-2) * -1));
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.lp-tour__caption {
  margin: 0;
}

/* --- the shape primitives the tour is drawn from ---------------------------
   Six shapes, shared by all four panels. The neutral fill is a `color-mix` off
   `--text`, so it tracks light, dark and a reseeded tenant palette — exactly
   what `.lp-mock__block` already does above.
   -------------------------------------------------------------------------- */

.lp-sk {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.lp-sk__line {
  display: block;
  block-size: var(--space-2);
  border-radius: var(--r-pill);
  background: color-mix(in oklab, var(--text) 12%, transparent);
}

.lp-sk__line[data-w="s"] { inline-size: 22%; }
.lp-sk__line[data-w="m"] { inline-size: 46%; }
.lp-sk__line[data-w="l"] { inline-size: 70%; }
.lp-sk__line[data-w="f"] { inline-size: 100%; }

/* The one coloured shape per panel — the thing that screen is actually about. */
.lp-sk__line[data-tone="brand"] { background: var(--brand); }

.lp-sk__row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--r-sm);
  background: var(--surface-sunken);
}

.lp-sk__rowbody {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
  /* A flex item keeps `min-width: auto`, so without this a full-width line in
     here sets the row's min-content width and the stage stops shrinking
     (`.claude/rules/components.md`, cause 2). */
  min-inline-size: 0;
}

.lp-sk__dot {
  inline-size: var(--space-6);
  block-size: var(--space-6);
  border-radius: var(--r-pill);
  background: var(--brand-subtle);
  flex: none;
}

.lp-sk__chip {
  inline-size: var(--space-8);
  block-size: var(--space-4);
  border-radius: var(--r-pill);
  flex: none;
  background: color-mix(in oklab, var(--text) 10%, transparent);
}

/* ⚠ THE TONES ARE DECORATION AND CARRY NOTHING. These are the one place on this
   page where the feedback roles appear, and they appear as unlabelled shapes
   inside an illustration — so they say "this screen has statuses in it", never
   "this invoice is overdue". Information conveyed by colour alone would be a
   WCAG 1.4.1 failure; there is no information here to convey. */
.lp-sk__chip[data-tone="ok"] { background: color-mix(in oklab, var(--success) 35%, transparent); }
.lp-sk__chip[data-tone="warn"] { background: color-mix(in oklab, var(--warning) 35%, transparent); }
.lp-sk__chip[data-tone="brand"] { background: var(--brand-subtle); }

/* ⚠ THE THREAD NEEDS ITS OWN ALIGNMENT AND THAT IS NOT A DETAIL. `.lp-sk` is a flex
   COLUMN, so its cross axis is horizontal and its default `align-items: stretch` pulls
   every bubble to the full width of the stage - at which point `max-inline-size` caps
   them all at the same 72%, the two sides stop being two sides, and the panel reads as
   three grey bars rather than as a conversation. `flex-start` here and `align-self` on
   the sender's own bubbles is what gives each one its content width back. */
.lp-sk--thread {
  align-items: flex-start;
}

.lp-sk__bubble {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  /* A floor as well as a ceiling: at `flex-start` a bubble holding one short line
     shrinks to that line, and a conversation of differently sized stubs reads as broken
     layout rather than as turns of different lengths. */
  min-inline-size: 42%;
  max-inline-size: 72%;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--r-md);
  background: var(--surface-sunken);
}

.lp-sk__bubble[data-side="mine"] {
  align-self: flex-end;
  background: var(--brand-subtle);
}

/* The timetable panel reuses the hero illustration's own grid and blocks, so the
   one screen this product is known for is drawn once and shown twice. */
.lp-sk__week {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-2);
}

/* --- the modules, as a bento ----------------------------------------------
   Six tiles on a six-column grid with `--lp-span` written per tile, so one tile
   leads the block instead of six equal squares reading as a placeholder
   (`.claude/rules/components.md`: "One thing leads").

   Every screen named inside a tile is a real menu item, and the names are read
   out of `nav-strings.ts` — which is generated from the navigation vocabulary —
   rather than retyped here, so a renamed screen cannot leave a stale promise on
   the one page a stranger reads first.
   -------------------------------------------------------------------------- */

.lp-bento {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-4);
}

.lp-bento__tile {
  grid-column: span var(--lp-span, 2);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
}

.lp-bento__screens {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  /* It is a `<ul>` because a list of screen names IS a list to a screen reader, and the
     UA stylesheet pays for that with a disc marker and a 40px indent on every pill. */
  margin: 0;
  padding: 0;
  list-style: none;
  margin-block-start: auto;
  padding-block-start: var(--space-3);
  border-block-start: 1px solid var(--border-subtle);
}

/* Not a `.mat-inset` inside an inset: two flat tints stacked read as one smudge,
   the same reason `.lp-plan__fits` is a rule rather than a second plane. */
.lp-bento__screen {
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-pill);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  white-space: nowrap;
}

/* --- today, and with this ---------------------------------------------------
   Three columns on a wide screen, one stack on a phone. The left column is what
   an institution does today and is drawn quietly; the right is this product and
   takes the accent rule, so the eye reads each row in the right direction.

   ⚠ NO COMPETITOR IS NAMED AND NONE MAY BE. The left column is a spreadsheet, a
     paper register and a group chat, because that is what these institutions
     actually use — naming a rival product would put a claim about SOMEBODY
     ELSE'S software on a page whose rule is that it only says what this one can
     honour.
   -------------------------------------------------------------------------- */

.lp-compare {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-inline-size: 64rem;
}

.lp-compare__head,
.lp-compare__row {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-4);
  align-items: baseline;
}

.lp-compare__head {
  padding: 0 var(--space-4) var(--space-2);
}

.lp-compare__row {
  padding: var(--space-4);
  border-radius: var(--r-md);
}

/* Zebra rather than a rule per row: six identical hairlines read as a table
   nobody reads, and these are six rows whose whole job is to be compared across.
   `nth-child(odd)` and not a class, so inserting a row cannot get it wrong. */
.lp-compare__row:nth-child(odd) {
  background: color-mix(in oklab, var(--text) 4%, transparent);
}

.lp-compare__topic {
  font-weight: var(--weight-medium);
  font-size: var(--text-base);
}

/* Hidden while the column heads are doing this job, shown when the row stacks and
   they are not. `display: none` and not `.sr-only`: the head above says the same
   words to a screen reader already, and a reader who hears both hears every row
   twice. */
.lp-compare__tag {
  display: none;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.lp-compare__before,
.lp-compare__after {
  margin: 0;
  font-size: var(--text-sm);
}

.lp-compare__before {
  color: var(--text-tertiary);
}

.lp-compare__after {
  padding-inline-start: var(--space-4);
  border-inline-start: var(--rule-accent) solid var(--brand-border);
  color: var(--text);
}

/* --- what is guaranteed ----------------------------------------------------
   A list rather than a fourth card grid: there are three card grids on this page
   already and a fourth one reads as the same section coming round again.
   -------------------------------------------------------------------------- */

.lp-trust {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr));
  gap: var(--space-5);
}

.lp-trust__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-2) var(--space-3);
  align-items: start;
}

.lp-trust__icon {
  display: grid;
  place-items: center;
  inline-size: var(--space-7);
  block-size: var(--space-7);
  border-radius: var(--r-md);
  background: var(--brand-subtle);
  color: var(--brand-strong);
  grid-row: span 2;
}

.lp-trust__title {
  margin: 0;
  font-size: var(--text-base);
}

.lp-trust__body {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* --- the closing panel, which is also where somebody gets in touch ---------
   ⚠ STILL EXACTLY THREE `.mat` SURFACES ON THIS PAGE. The contact block is
     folded into the closing panel rather than given a fourth one, and that is
     also the better page: a closing call to action followed by a separate
     contact section is the same ask made twice, and the second one always reads
     as the page having forgotten it already asked.
   -------------------------------------------------------------------------- */

.lp-closing__channels {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
}

.lp-channel {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}

.lp-channel:hover {
  background: var(--surface-2);
  border-color: var(--brand-border);
  text-decoration: none;
}

/* The channel's own value — an address, a number — is the part somebody reads off
   the screen and types into a phone, so it may not be truncated. One unbreakable
   token sets an element's min-content width (`.claude/rules/components.md`, cause
   3), and `anywhere` is what shrinks min-content too; `break-word` does not. */
.lp-channel__label {
  overflow-wrap: anywhere;
}

.lp-closing__reply {
  margin: 0;
  max-inline-size: var(--container-sm);
}

/* --- the social row --------------------------------------------------------
   The footer's third column and the closing panel share it.
   -------------------------------------------------------------------------- */

.lp-social {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* `--space-7` square, which clears WCAG 2.5.8's 24px floor at every density this
   theme ships; the `@media (pointer: coarse)` block later in this file raises
   every control again on a touch device. */
.lp-social__link {
  display: grid;
  place-items: center;
  inline-size: var(--space-7);
  block-size: var(--space-7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  color: var(--text-secondary);
  transition: background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}

.lp-social__link:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* --- /terms and /privacy ---------------------------------------------------
   The landing chrome around one column of Markdown, on a narrower measure:
   legal prose is read, not scanned.
   -------------------------------------------------------------------------- */

.lp-doc {
  max-width: var(--container-md);
  margin-inline: auto;
  padding: var(--space-6) var(--space-4) var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.lp-doc__title {
  margin: 0;
  font-size: var(--text-2xl);
}

/* --- responsive ------------------------------------------------------------
   This page is opened on a phone more than any other in the product.
   -------------------------------------------------------------------------- */

@media (max-width: 64rem) {
  .lp-nav {
    display: none;
  }

  .lp-hero__inner {
    grid-template-columns: minmax(0, 1fr);
  }

  /* The size is the clamp's job now (see the note on `--text-display-lg`); the
     measure is not, and 18ch in one column leaves a column of air beside it. */
  .lp-hero__title {
    max-width: none;
  }

  /* The tabs go above the stage and WRAP rather than scroll sideways. A hidden
     horizontal overflow needs a visible cue to be honest about itself
     (`.claude/rules/components.md`, rule 7) — four labels that wrap need none,
     so this is the cheaper correct answer rather than an edge fade. */
  .lp-tour {
    grid-template-columns: minmax(0, 1fr);
  }

  .lp-tour__tabs {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .lp-tour__tab {
    flex: 1 1 14rem;
  }

  /* Two columns, and the lead tile still leads — it spans both. Six equal
     halves would lose the one decision this grid is making. */
  .lp-bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lp-bento__tile {
    grid-column: span 1;
  }

  .lp-bento__tile--lead {
    grid-column: span 2;
  }

  /* The three-column comparison becomes a stack, so the column heads have
     nothing left to head and each cell carries its own tag instead. */
  .lp-compare__head {
    display: none;
  }

  .lp-compare__head,
  .lp-compare__row {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-2);
  }

  .lp-compare__tag {
    display: block;
  }
}

@media (max-width: 40rem) {
  .lp-header,
  .lp-hero,
  .lp-section,
  .lp-proof,
  .lp-footer {
    padding-inline: var(--space-3);
  }

  .lp-hero {
    padding-block: var(--space-6);
  }

  .lp-section {
    padding-block: var(--space-7);
  }

  /* The illustration is the first thing to go: on a phone it costs a screen and a
     half of scrolling before the reader has been told what this is. The TOUR is
     not dropped with it — by then the reader has read the pitch and chose to
     scroll, which is a different question from what greets them. */
  .lp-mock {
    display: none;
  }

  .lp-tour__stage {
    padding: var(--space-4);
    /* A phone has no room for the desktop floor, and the panels are shorter here
       anyway now that the rows have stacked. */
    min-block-size: 18rem;
  }

  .lp-bento {
    grid-template-columns: minmax(0, 1fr);
  }

  .lp-bento__tile,
  .lp-bento__tile--lead {
    grid-column: span 1;
  }

  /* Full width, one per line: a row of pills each holding an address wraps into
     something unreadable at this size. */
  .lp-closing__channels {
    flex-direction: column;
    align-items: stretch;
  }

  .lp-channel {
    justify-content: center;
  }

  .lp-header__inner {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  /* ⚠ THE WIDTH FLOORS COME OFF HERE, AND THAT IS NOT GIVING UP ON THEM. They exist so
     that switching az / en / ru does not resize the desktop bar and move the nav with it
     (see the block where they are set). Below 40rem there is no nav, the bar has already
     wrapped onto two lines, and nothing is left for a resize to disturb - while the
     floors themselves are what overflows: measured at 320px, the four controls wanted
     359px against 296px of room, so the register button was clipped by `.lp`'s
     `overflow-x: clip` with no scrollbar to show it. The row may wrap again rather than
     be cut. */
  .lp-header__actions {
    /* ⚠ `flex: 1 1 100%` AND NOT JUST `flex-wrap`. The actions row is itself a flex ITEM
       of `.lp-header__inner` carrying `flex: none`, so it sizes to max-content and never
       narrows - which means `flex-wrap` on it has nothing to wrap against and the row
       stayed 303px wide inside 284px of room. Taking the whole line is what gives it a
       width to wrap within, and it already sat on its own line here. */
    flex: 1 1 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .lp-cta--signin,
  .lp-cta--register {
    min-inline-size: 0;
  }

  .lp-hero__ctas,
  .lp-hero__ctas .btn {
    width: 100%;
  }
}


/* ===========================================================================
   THE STATES THE CHROME WAS MISSING

   Every control here had a resting and a hover state and nothing else. In 2,742
   lines of application chrome there was not one `:active` rule and not one
   `:disabled` rule — so no control in the product gave press feedback, and a
   disabled row, chip or menu item was pixel-identical to an enabled one.

   Collected in one block on purpose rather than scattered back through their own
   rules: they are one decision, they read the same three tokens, and the next
   person to add an interactive class should be able to find the list they have
   just joined.

   Selected state is keyed on ARIA wherever the markup has it, so what a screen
   reader is told and what the eye sees cannot drift apart.
   ======================================================================== */

/* --- pressed ------------------------------------------------------------
   ⚠ NOT `.chip-filter` (owner, 2026-11-12). It is the WRAPPER round a row of chips, never a
   control of its own, and `:active` reaches every ancestor of the chip being pressed - so
   listing it here turned the whole full-width group into a grey slab on every press, hiding the
   chips' own edges. The chip inside keeps its press through `.chip:active`. */
.menu__item:active,
.chip:active,
.thread-row:active,
.tab:active,
.bell__button:active,
.shell__icon-btn:active,
.table__row--clickable:active,
.lp-nav__link:active {
  background: var(--surface-3);
}

.accountmenu__button:active,
.tt-add:active {
  transform: scale(0.96);
}

/* --- disabled ------------------------------------------------------------
   `[aria-disabled]` as well as `:disabled`, because a control that must stay
   focusable so a screen reader can find it and be told why is MARKED, not
   removed from the tab order.                                                */
.menu__item:disabled,
.menu__item[aria-disabled="true"],
.chip:disabled,
.chip[aria-disabled="true"],
.thread-row:disabled,
.tab:disabled,
.tab[aria-disabled="true"],
.bell__button:disabled,
.shell__icon-btn:disabled,
.accountmenu__button:disabled {
  opacity: var(--opacity-disabled);
  cursor: not-allowed;
  background: transparent;
  transform: none;
}

/* --- in flight -----------------------------------------------------------
   NOT the same as disabled, and the difference matters: disabled says "you may
   not", in-flight says "not yet". Rendering a save as disabled while it is
   succeeding tells a screen reader the control is unavailable and leaves the
   reader with no signal that anything is happening at all.                    */
[aria-busy="true"] {
  cursor: progress;
}

/* --- destructive ---------------------------------------------------------
   A destructive menu item is the one control in the chrome where the pressed
   state has to be unmistakable.                                               */
.menu__item--danger:hover {
  background: var(--danger-subtle);
  color: var(--danger-strong);
}
.menu__item--danger:active {
  background: color-mix(in oklab, var(--danger) 24%, transparent);
  color: var(--danger-strong);
}

/* --- selected, from ARIA -------------------------------------------------
   `.thread-row--on` is kept as an alias until every call site carries
   `aria-selected`; the ARIA form is what new markup should use.               */
.thread-row[aria-selected="true"],
.thread-row--on {
  background: var(--brand-subtle);
  box-shadow: inset var(--rule-accent) 0 0 0 var(--brand);
}

/* --- focus ---------------------------------------------------------------
   `--focus-ring` rather than `--brand`: the brand is a FILL, chosen to carry a
   label. A ring has a different obligation — 3:1 against whatever surface it
   lands on — and the compiler picks a step that clears it against the worst of
   them.                                                                       */
.table__row--clickable:focus-visible {
  outline-color: var(--focus-ring);
}

/* --- target size ---------------------------------------------------------
   WCAG 2.5.8 asks for 24x24 and both of these already clear it, but at roughly
   32x32 they are under the 44px a thumb wants. The padding grows only where the
   pointer is coarse, so a mouse-driven desktop keeps its dense toolbar.        */
@media (pointer: coarse) {
  .bell__button,
  .shell__icon-btn,
  .shell__burger,
  .accountmenu__button {
    min-width: var(--target-comfortable);
    min-height: var(--target-comfortable);
  }

  /* A tutor's compact account menu, its finder and its hubs' closed sections are rows a
     thumb picks from (2026-10-13). Keyed on the shell's kind, so every other kind's menu
     keeps the density it has. */
  [data-kind="Tutor"] .accountmenu__panel .nav-item,
  [data-kind="Tutor"] .accountmenu__signout,
  [data-kind="Tutor"] summary.nav-item {
    min-block-size: var(--target-comfortable);
  }
}

/* --- booking a lesson -----------------------------------------------------
   `/booking` lays three panels down the page. The stack is what keeps them
   apart: placed straight into the page they had no gap, and the lessons
   panel's edge sat on the last row of free hours above it.                    */
.booking {
  gap: var(--space-4);
}

.booking-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* One booked lesson. It WRAPS rather than scrolls: at 390px the date, the
   teacher, the badge and the cancel button do not fit on one line, and a row
   that kept them on one pushed "Dərsi ləğv et" past the screen's edge. The
   facts lead; the status and the action follow, on the next line when needed. */
.booking-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  padding-block: var(--space-3);
  border-block-end: 1px solid var(--border-subtle);
}

.booking-row:last-child {
  border-block-end: 0;
}

.booking-row__main {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1 1 14rem;
  min-inline-size: 0;
}

/* Proportional figures that never break: the monospace version split the year
   across two lines on a phone. */
.booking-row__when {
  color: var(--text);
  font-weight: var(--weight-medium);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.booking-row__note {
  overflow-wrap: anywhere;
}

.booking-row__aside {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

/* --- meetings on a phone ----------------------------------------------------
   Six columns do not fit 390px, and the one that fell off was the one with the
   buttons: Edit, Cancel and Withdraw sat past the edge behind a sideways scroll.
   Under 40rem each meeting is a card - its cells one under another, the column
   headings dropped because every cell already says what it is.               */
@media (max-width: 40rem) {
  .meetings-list .table thead {
    display: none;
  }

  .meetings-list .table,
  .meetings-list .table tbody,
  .meetings-list .table tr,
  .meetings-list .table td {
    display: block;
  }

  .meetings-list .table tr {
    padding-block: var(--space-3);
    border-block-end: 1px solid var(--border-subtle);
  }

  .meetings-list .table tbody tr:last-child {
    border-block-end: 0;
  }

  .meetings-list .table td {
    padding: var(--space-1) 0;
    border-bottom: 0;
  }

  .meetings-list .table td:empty {
    display: none;
  }

  .meetings-list .table td .row {
    flex-wrap: wrap;
  }

  /* A card reads down one edge. A figure's end alignment is for comparing a column of them;
     in a card it sent the eye to the far side for "Müddət" or "Maksimum bal" and back for
     the next field (device test row 46). */
  .meetings-list .table td.numeric {
    text-align: start;
  }
}

/* The same cards up to 64rem for a list too wide for a tablet (`stackOnNarrow="tablet"`,
   tutor device test 2026-10-29, row 27): at 768 and 1024px the exams table was 883px in a
   705px card and the homework table 915px in 720, so the row menu, the homework buttons and
   the start date sat past the edge, and titles broke a word a line. The captions the cards
   need show at the same width (`TABLET_QUERY`), beside `.journal-cell__label`. */
@media (max-width: 64rem) {
  .meetings-list--tablet .table thead {
    display: none;
  }

  .meetings-list--tablet .table,
  .meetings-list--tablet .table tbody,
  .meetings-list--tablet .table tr,
  .meetings-list--tablet .table td {
    display: block;
  }

  .meetings-list--tablet .table tr {
    padding-block: var(--space-3);
    border-block-end: 1px solid var(--border-subtle);
  }

  .meetings-list--tablet .table tbody tr:last-child {
    border-block-end: 0;
  }

  .meetings-list--tablet .table td {
    padding: var(--space-1) 0;
    border-bottom: 0;
  }

  .meetings-list--tablet .table td:empty {
    display: none;
  }

  .meetings-list--tablet .table td .row {
    flex-wrap: wrap;
  }

  /* As on a phone: a card reads down one edge, so a figure is not sent to the far side. */
  .meetings-list--tablet .table td.numeric {
    text-align: start;
  }
}
}

/* --- the organisation's settings ---------------------------------------------
   One panel of rows rather than a card per setting: the name and what it does on the
   left, the control on the right, a divider between. Wraps under the text on a phone. */
.settings-list {
  gap: 0;
  margin-block-end: var(--space-4);
}
.settings-list__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-5);
  padding-block: var(--space-4);
}
.settings-list__row + .settings-list__row {
  border-block-start: 1px solid var(--border);
}
.settings-list__text {
  flex: 1 1 20rem;
  min-inline-size: 0;
}
.settings-list__control {
  flex: 0 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.settings-list__value {
  flex-wrap: nowrap;
}
.settings-list__number {
  inline-size: 6rem;
}
.settings-list__unit {
  inline-size: 8rem;
}

/* --- the finance overview ----------------------------------------------------
   The owed figure leads: the one number a reader opens this page for, at display size.
   The window's figures sit in a two-column list that hugs its content, amounts aligned
   right in proportional tabular figures rather than a typewriter face. */
.finance-search {
  inline-size: min(28rem, 100%);
}
.finance-lead {
  font-size: var(--text-3xl);
  text-align: start;
}
.finance-overview .kv {
  grid-template-columns: auto auto;
  justify-content: start;
}

/* The home page's four everyday actions: buttons with room between them, wrapping on a
   phone, rather than the tight chip row they borrowed. */
.quick-actions {
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* The daily-question panel under the rules table: its own surface, so it stands clear of
   the table above instead of running into its edge. */
.award-daily {
  margin-block-start: var(--space-5);
}

/* --- back to the list -------------------------------------------------------
   A ghost button at the start of its line, not a full-width row: a flex column stretches
   its children, and a link left to it became a target the width of the page. Pulled back
   by its own padding so the chevron sits on the content edge, under nothing and beside
   nothing. The states are the ghost button's. */
.back-link {
  align-self: flex-start;
  gap: var(--space-1);
  padding-inline-start: var(--space-1);
  margin-inline-start: calc(-1 * var(--space-1));
}

/* --- the lesson journal ------------------------------------------------------
   A tutor's one record of a lesson (`/lesson-journal`), laid out as the owner's reference
   lays it out: the filters, then one sheet holding a row per learner, the exam beneath
   them and the save line at its foot. The sheet is ONE `.mat-inset` on the page ground,
   like the filter bar above it; nothing inside it draws a surface of its own - the rows
   are rules, not cards, so there is no glass inside glass and no wall of siblings. */
.journal > .filter-bar {
  margin-bottom: 0;
}

/* The lesson's group or learner picker fills its filter group. `.filter-bar .field` sets a
   bare filter's width to auto, which left this searchable input narrower than its own
   combobox box, so the chevron was drawn outside the field. */
.journal .filter-group .combo__field {
  inline-size: 100%;
}

/* The "pick a group" state spans the page like the filter bar above it and the sheet that
   replaces it (owner, 2026-10-07). The shared `.empty` measure made it a narrow tile
   floating in the middle of the row, which read as a stray card rather than the place
   the sheet will open. */
.journal > .empty-state {
  max-inline-size: none;
  margin-inline: 0;
}

/* The journal's leave dialog has three actions - stay, discard, save - and the compact
   sheet's 24rem put the third on a line of its own (owner, 2026-10-07). Wide enough for the
   three in one row; a phone still wraps them, which the footer already allows. */
.modal--compact:has(.journal-leave) {
  width: min(36rem, calc(100vw - var(--space-6) * 2));
}

.journal-sheet {
  display: flex;
  flex-direction: column;
  min-inline-size: 0;
}

.journal-sheet__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
}

.journal-sheet__context {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-inline-size: 0;
}

.journal-sheet__context > *,
.journal-sheet__head > .section-title {
  margin: 0;
}

.journal-sheet__state {
  margin: 0;
  padding: var(--space-4) var(--space-5);
}

.journal-rows {
  padding-inline: var(--space-5);
}

/* Name, attendance, homework, score, note - the reference's proportions. `minmax(0, …)`
   so an input's intrinsic width cannot widen its own track. */
.journal-grid {
  display: grid;
  grid-template-columns:
    minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.7fr) minmax(0, 1.15fr);
  gap: var(--space-3);
  align-items: center;
}

.journal-grid--exam {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}

.journal-grid--labels {
  padding-block: var(--space-2);
  border-block-end: 1px solid var(--border);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
}

.journal-row {
  padding-block: var(--space-3);
  border-block-end: 1px solid var(--border-subtle);
}

.journal-row:last-child {
  border-block-end: 0;
}

.journal-row__who {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-inline-size: 0;
}

.journal-row__name {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

.journal-cell {
  min-inline-size: 0;
}

/* Each control's caption, for the stacked layout only: on a wide screen the column labels
   above the rows already say it. */
.journal-cell__label {
  display: none;
}

/* A list stacked up to 64rem (`.meetings-list--tablet`, row 27) needs them up to there. */
@media (max-width: 64rem) {
  .meetings-list--tablet .journal-cell__label {
    display: block;
  }
}

.journal-exam {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-block-start: 1px solid var(--border);
}

.journal-exam > p,
.journal-exam .section-title {
  margin: 0;
}

.journal-exam .journal-rows {
  padding-inline: 0;
}

.journal-exam__fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr));
  gap: var(--space-3);
}

.journal-sheet__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-block-start: 1px solid var(--border);
}

.journal-footnote {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3);
  padding-inline: var(--space-1);
}

.journal-history {
  list-style: none;
  margin: 0;
  padding: 0;
}

.journal-history__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-block-start: 1px solid var(--border-subtle);
}

.journal-history__what {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

.journal-history__tally {
  flex-wrap: wrap;
}

/* The reference's 720px: a row stops being a line of five and stacks two to a line, the
   learner across the top and the note across the bottom, each control under its caption. */
@media (max-width: 720px) {
  .journal-grid,
  .journal-grid--exam {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .journal-grid--labels {
    display: none;
  }

  .journal-row__who,
  .journal-grid--exam > .journal-row__name,
  .journal-row:not(.journal-grid--exam) > .journal-cell:last-child {
    grid-column: 1 / -1;
  }

  .journal-cell__label {
    display: block;
  }
}

@media (max-width: 30rem) {
  .journal-rows,
  .journal-sheet__head,
  .journal-sheet__foot,
  .journal-exam,
  .journal-history__row {
    padding-inline: var(--space-4);
  }

  .journal-sheet__head .btn,
  .journal-sheet__foot .btn {
    inline-size: 100%;
  }
}

/* ---------------------------------------------------------------------------
   Foreign-language exams (2026-10-24): texts, recordings, gaps, essays and timed
   sections. Existing parts only, and every value is a token.
   ------------------------------------------------------------------------ */

/* A marking criterion in the editor: its name, its points, and remove. */
.rubric-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 6rem auto;
  gap: var(--space-2);
  align-items: center;
}

.rubric-row > .field {
  inline-size: 100%;
  min-inline-size: 0;
}

/* One gap's accepted answers in the editor. */
.gap-key {
  margin: 0;
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  min-inline-size: 0;
}

.gap-key[data-invalid] {
  border-color: var(--danger);
}

/* A recording a teacher listens to in full, with the browser's own controls. */
.stimulus-audio__preview {
  inline-size: 100%;
}

/* The text or the recording above its questions: a plane inside the question card, which is
   already the glass surface, so it is `.mat-inset` and never blurs. */
.stimulus-pane {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--r-md);
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

/* HIDDEN MEANS HIDDEN (candidate audit B2, 2026-11-01). The `display: flex` above outranks the
   browser's own `[hidden] { display: none }`, so every passage and every recording on the paper
   showed on every question, play limit and all, and stayed in the accessibility tree. The panes
   stay mounted - a recording plays on while its questions are left - and only the question's own
   is shown. */
.stimulus-pane[hidden] {
  display: none;
}

.stimulus-pane__passage {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: var(--leading-relaxed);
  max-block-size: 50vh;
  overflow: auto;
}

/* Gap fill in the player: the text, with an answer box where each gap is. Kept on the lines
   it was written on, as every other question's text is (item 16). */
.gap-text {
  margin: 0;
  font-size: var(--text-lg);
  line-height: calc(var(--leading-relaxed) * 1.4);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.gap-text .gap-input {
  display: inline-block;
  inline-size: 12ch;
  max-inline-size: 100%;
  margin-inline: var(--space-1);
  vertical-align: baseline;
}

/* The essay's word count and its limits, under the box. */
.word-count {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

/* --- pictures on an essay answer (build contract 2026-11-22) ------------------------------
   The player's strip under the text box, the marker's gallery and the review's. Every tile is a
   plain bordered box on whatever surface it sits on - never a `.mat`: a strip of them inside the
   player's card would be glass sampling glass. Thumbnails keep the whole picture (`contain`), as
   the question's own picture does: a photographed solution cut to a square loses its working. */
.answer-images {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-inline-size: 0;
  padding: var(--space-3);
  /* `--border-strong`, as the join code's dashed box: plain `--border` all but vanished on light
     glass (design review #8). */
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
}

.answer-images[data-dragging] {
  border-style: solid;
  border-color: var(--brand);
}

.answer-images__actions {
  gap: var(--space-2);
}

.answer-images__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
  gap: var(--space-2);
}

.answer-images__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2);
  min-inline-size: 0;
  padding: var(--space-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
  /* The plane is `.mat-inset`'s (design review #8): an opaque `--surface-1` was a new, brighter
     surface inside the glass card. */
}

/* On glass the inset has no fill behind it to draw its edge, so the edge is drawn, as the repo rule
   gives an inset one. `--border-strong` by measurement at 1440 (border pixel against the glass
   beside it): light 1.51:1 where `--border` measured 1.11:1 and `--border-subtle` 1.00:1; dark
   2.71:1 against 1.87:1 and 1.41:1. A refused tile keeps its danger edge. */
[data-family="glass"] .answer-images__item:not([data-state="failed"]) {
  border-color: var(--border-strong);
}

.answer-images__item[data-state="failed"] {
  border-color: var(--danger-border);
}

.answer-images__thumb {
  display: grid;
  place-items: center;
  inline-size: 4rem;
  block-size: 4rem;
  border-radius: var(--r-xs);
  background: var(--surface-sunken);
  overflow: hidden;
}

.answer-images__thumb img {
  max-inline-size: 100%;
  max-block-size: 100%;
  object-fit: contain;
}

/* A sent picture opens, read-only, so the handwriting can be checked before the hand-in (design
   review #7): the thumbnail is a button, drawn as the box it was. */
button.answer-images__thumb {
  padding: 0;
  border: 0;
  color: inherit;
  cursor: zoom-in;
}

.answer-images__meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

.answer-images__tools {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

/* A tile with a labelled tool ("Yenidən", "Yenidən yüklə") and a sentence: beside the words the
   buttons took the third column's whole width and left the words one syllable wide. They take a row
   of their own under the thumbnail and the words, so the tile keeps the width every tile has. */
.answer-images__item[data-wide] .answer-images__tools {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.answer-images__camera video,
.answer-images__camera img {
  display: block;
  inline-size: 100%;
  block-size: auto;
  max-block-size: 60dvh;
  object-fit: contain;
  border-radius: var(--r-md);
  background: var(--surface-sunken);
}

.answer-images__camera video[hidden] {
  /* HIDDEN MEANS HIDDEN, as for `.stimulus-pane[hidden]`: the `display: block` above outranks the
     browser's own `[hidden]`, so the live feed stayed drawn above the frozen still and pushed it
     below the fold on a phone, and left an empty box when the camera failed (design review #1). */
  display: none;
}

.answer-images__qr {
  margin-inline: auto;
}

/* The marker's gallery: a row of thumbnail buttons that open the zoomed view. */
.answer-gallery {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-inline-size: 0;
}

.answer-gallery__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.answer-gallery__thumb {
  display: grid;
  place-items: center;
  inline-size: 7rem;
  block-size: 7rem;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
  background: var(--surface-sunken);
  overflow: hidden;
  cursor: zoom-in;
}

.answer-gallery__thumb img {
  max-inline-size: 100%;
  max-block-size: 100%;
  object-fit: contain;
}

/* The first picture, read in place beside the mark (design review #2): the zoomed view's frame at
   the column's width, with no tools. */
.answer-gallery__lead {
  max-block-size: 70dvh;
}

/* A state tile is as wide as its words and its acts need, from a thumbnail's width up: at a fixed
   7rem "Yenidən yüklə" and "Yenidən göstər" did not fit their own tile (design review #12). */
.answer-gallery__state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  inline-size: fit-content;
  min-inline-size: 7rem;
  max-inline-size: min(14rem, 100%);
  min-block-size: 7rem;
  padding: var(--space-2);
  border: 1px dashed var(--border);
  border-radius: var(--r-sm);
  overflow-wrap: anywhere;
}

/* The zoomed picture and its drawing, turned together for the view. The stage is the positioned
   ancestor of the marks and notes, which sit at their stored fractions of the picture. */
.answer-zoom {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-inline-size: 0;
}

/* ONE SCROLLER (design review #3). The dialog's body is a column and the picture's frame is the one
   part of it that gives up height, so a zoomed picture scrolls inside its frame and the body itself
   does not scroll around it. The frame keeps a floor, so on a very short window it is still a
   picture and the body scrolls as before. */
.modal__body:has(> .answer-zoom) {
  display: flex;
  flex-direction: column;
}

.modal__body > .answer-zoom {
  flex: 1 1 auto;
  min-block-size: 0;
}

/* THE FRAME TAKES THE SPACE THE TOOLS LEAVE (re-walk N3). The dialog is as tall as the window
   allows, as the plan dialog's tabs are, and its body gives the frame every pixel its rows do not
   use; "Sığdır" then fits the whole picture inside that frame, its height as well as its width. */
.modal[open]:has(> .modal__body > .answer-zoom) {
  block-size: calc(100dvh - var(--space-6) * 2);
}

.modal[open]:has(> .modal__body > .answer-zoom) > .modal__body {
  flex: 1 1 auto;
  max-height: none;
}

.answer-zoom__view {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-block-size: min(12rem, 30dvh);
}

/* The view's five controls stay on one row on a phone (re-walk, design #9): the marking tools may
   wrap, the view does not. */
.answer-zoom__tools--view {
  flex-wrap: nowrap;
}

.answer-zoom__tools--view > [role="status"] {
  white-space: nowrap;
}

.answer-zoom__cue {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-block-size: 0;
}

.answer-zoom__cue > .answer-zoom__frame {
  flex: 1 1 auto;
  min-block-size: 0;
}

/* The edge cue up and down, as `.table-frame` draws it sideways: the side with more of the picture
   behind it is shaded, and nothing is drawn when the picture fits. */
.answer-zoom__cue::before,
.answer-zoom__cue::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  block-size: var(--space-8);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
  z-index: 1;
}

.answer-zoom__cue::before {
  inset-block-start: 0;
  border-start-start-radius: var(--r-md);
  border-start-end-radius: var(--r-md);
  background: linear-gradient(to bottom, var(--scrim), var(--scrim) 20%, transparent);
}

.answer-zoom__cue::after {
  inset-block-end: 0;
  border-end-start-radius: var(--r-md);
  border-end-end-radius: var(--r-md);
  background: linear-gradient(to top, var(--scrim), var(--scrim) 20%, transparent);
}

.answer-zoom__cue[data-more-top]::before,
.answer-zoom__cue[data-more-bottom]::after {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .answer-zoom__cue::before,
  .answer-zoom__cue::after {
    transition: none;
  }
}

.answer-zoom__frame {
  display: grid;
  place-items: center;
  overflow: auto;
  max-block-size: 70dvh;
  border-radius: var(--r-md);
  background: var(--surface-sunken);
}

/* Zoomed past the fit: from the start corner, so every part of the picture can be scrolled to (a
   centred item larger than its scroller overflows on the side the scroller cannot reach). */
.answer-zoom__frame[data-zoomed] {
  place-items: start;
}

.answer-zoom__stage {
  position: relative;
  display: inline-block;
  line-height: 0;
  transition: transform var(--dur-base) var(--ease-in-out);
}

.answer-zoom__stage[data-turn="1"] { transform: rotate(90deg); }
.answer-zoom__stage[data-turn="2"] { transform: rotate(180deg); }
.answer-zoom__stage[data-turn="3"] { transform: rotate(270deg); }

@media (prefers-reduced-motion: reduce) {
  .answer-zoom__stage { transition: none; }
}

.answer-zoom__stage img {
  display: block;
  max-inline-size: min(100%, 56rem);
  max-block-size: 64dvh;
  object-fit: contain;
}

.answer-zoom__ink {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
}

/* A touch draws only while a drawing tool is chosen; otherwise it pans and pinches the picture. */
.answer-zoom__ink[data-tool] {
  cursor: crosshair;
  touch-action: none;
}

.answer-zoom__ink path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.answer-zoom__ink path[data-width="thin"] { stroke-width: calc(var(--space-1) / 2); }
.answer-zoom__ink path[data-width="medium"] { stroke-width: var(--space-1); }
.answer-zoom__ink path[data-width="thick"] { stroke-width: var(--space-2); }
.answer-zoom__ink path[data-tool="highlighter"] { stroke-width: var(--space-4); opacity: var(--opacity-muted); }

.answer-zoom__ink [data-color="danger"] { stroke: var(--danger); color: var(--danger-text); }
.answer-zoom__ink [data-color="warning"] { stroke: var(--warning); color: var(--warning-text); }
.answer-zoom__ink [data-color="success"] { stroke: var(--success); color: var(--success-text); }
.answer-zoom__ink [data-color="info"] { stroke: var(--info); color: var(--info-text); }

.answer-zoom__pin {
  position: absolute;
  transform: translate(-50%, -50%);
  line-height: var(--leading-snug);
  pointer-events: none;
}

.answer-zoom__pin[data-color="danger"], .answer-zoom__swatch[data-color="danger"] { color: var(--danger-text); }
.answer-zoom__pin[data-color="warning"], .answer-zoom__swatch[data-color="warning"] { color: var(--warning-text); }
.answer-zoom__pin[data-color="success"], .answer-zoom__swatch[data-color="success"] { color: var(--success-text); }
.answer-zoom__pin[data-color="info"], .answer-zoom__swatch[data-color="info"] { color: var(--info-text); }

/* The colour chip's own colour, a filled dot beside its name (design review #10). */
.answer-zoom__swatch {
  display: inline-flex;
}

.answer-zoom__swatch svg {
  fill: currentColor;
}

.answer-zoom__pin--text {
  transform: translate(0, -50%);
  max-inline-size: 16rem;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--r-xs);
  background: var(--surface-1);
  border: 1px solid currentColor;
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.answer-zoom__pin[data-pickable] {
  pointer-events: auto;
  cursor: pointer;
}

/* A note on a phone's width (walk D8): the same box, as a button that opens and closes its words.
   Collapsed it is the note tool's icon alone, so the handwriting under it stays readable; the words
   stay in the button, `.visually-hidden`, for a screen reader (the button is their positioned
   ancestor). */
.answer-zoom__note {
  display: inline-flex;
  align-items: flex-start;
  gap: var(--space-1);
  font-family: inherit;
  text-align: start;
}

.answer-zoom__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

/* The listening player: plays left, the one button, the progress, the volume. */
.audio-player {
  /* The positioned ancestor its visually hidden status line resolves against. */
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.audio-player__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

/* The plays-left badge is a sentence in Russian ("Осталось прослушиваний: 2 / 2"): a badge does not
   wrap, and at 280 px with 125% text it ran 36 px past the screen (measured 2026-11-01). Here it
   may wrap inside the row. */
.audio-player__controls > .badge {
  max-inline-size: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.audio-player__volume {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.audio-player__volume input[type='range'] {
  inline-size: 8rem;
  /* The slider's own box was 16 px tall, under the 24 px target (measured, 2026-11-01); the
     track is drawn as before, centred in a box the pointer can find. */
  min-block-size: var(--target-min);
  margin: 0;
  accent-color: var(--brand);
}

/* A scheduled recording's phase: its name and countdown on one row, the recording's progress and the
   volume under it. The countdown is the player clock's own figures. */
.listening-phase {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* The figure that leads once the run has started (design review, findings 2 and 3): the clock's own
   figures, in the same place in every phase, with their label beside them. */
.listening-phase__clock {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
}

/* LOADING IS NOT DISABLED (design review, finding 7; composition rule 8). While the file comes down,
   or Start is in flight, the button keeps its full strength; its label (or the spinner) says why it
   cannot be pressed yet. A held run - paused, closed, another recording going - keeps the dimming. */
.btn.listening-start--waiting[aria-disabled="true"] {
  opacity: 1;
  cursor: progress;
}

/* While the file comes, the spinner stands where the play icon was (second review, N5), drawn in
   the button's own ink as the busy button's indicator is: the ring's brand segment would vanish on
   the primary fill. */
.listening-start--waiting .spinner {
  flex: none;
  border-color: currentColor;
  border-block-start-color: transparent;
}

/* The Done alert's icon in its own column, so a second line aligns with the first (design finding 9). */
.listening-done {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}

.listening-done > svg {
  flex: none;
}

/* THE PANE'S PARAGRAPHS TAKE NO MARGIN OF THEIR OWN (design review, finding 6): the column's gap
   spaces them, as `.stimulus-pane__passage` already does. Each kept its 12px margins inside a
   12px gap, 36px between one-line paragraphs. */
.stimulus-pane p,
.audio-player p {
  margin: 0;
}

/* THE RUN, PINNED UNDER THE BARS BELOW 75rem (design review, finding 1). The block's pane is beside
   the questions, in view, only from 75rem; below that it scrolls away with them, so the phase and
   the time left stay here - a floating surface in the sticky top, as the dock is. */
.player__run-pinned {
  display: none;
}

@media (max-width: 74.98rem) {
  .player__run-pinned {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin: 0;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--r-lg);
  }

  /* The words take the room, so the time and the volume (or «Səsi aç») stand together at the end. */
  .player__run-pinned-what {
    flex: 1 1 auto;
    min-inline-size: 0;
    overflow-wrap: anywhere;
  }

  .player__run-pinned-time {
    flex: none;
    font-size: var(--text-lg);
    font-variant-numeric: tabular-nums;
  }

  /* The card's own "elsewhere" line says the same thing: the pinned one is enough here. */
  .player__question .player__run-elsewhere {
    display: none;
  }

  /* Between the phone and 75rem the bar is sticky on its own and the top stack is not a box; with the
     run's line in it, the stack becomes the sticky box, as it is on a phone. */
  .player__top:has(.player__run-pinned) {
    position: sticky;
    inset-block-start: var(--space-1);
    z-index: var(--z-topbar);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
  }

  /* Focus moved by Tab must land clear of the bars and the line under them (WCAG 2.4.11). */
  :root:has(.player__run-pinned) {
    scroll-padding-block-start: calc(var(--target-comfortable) * 3 + var(--space-2) * 8);
  }

  /* A passage on a block's screen runs at its full height: the questions follow it on the same
     scroll, and a box scrolling inside the page shows no cue on a phone (design finding 11). */
  .player__question--block .stimulus-pane__passage {
    max-block-size: none;
    overflow: visible;
  }

  /* The volume with the run's line, once the card has scrolled away (phone walk 2026-11-22,
     finding 4): the card's own slider, a little shorter. */
  .player__run-pinned .player__run-volume {
    flex: none;
  }

  .player__run-pinned .player__run-volume input[type='range'] {
    inline-size: 6rem;
  }
}

/* THE TOP AS ONE SURFACE WHILE A RUN GOES (phone walk 2026-11-22, findings 3 and 8; the owner's
   decision of the same day for every width where the run's line is pinned). Measured before: on a
   phone the bar, the dock and the run's line were three glass bars, the stack ending at 185 px of
   a 360x740 screen; on a tablet the bar and the line were two; the page showed in the gaps between
   them and above the first. During a run the top is one `.mat` that sticks flush to the screen's
   top, and the bar, the dock and the run's line are its rows - not materials of their own: glass
   cannot sample glass. On a phone the run's line stands in the bar's first row (below). */
@media (max-width: 74.98rem), (max-height: 30rem) {
  .player__top.player__top--run {
    position: sticky;
    inset-block-start: 0;
    z-index: var(--z-topbar);
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: var(--space-2) var(--space-4);
    border-start-start-radius: 0;
    border-start-end-radius: 0;
    border-end-start-radius: var(--r-lg);
    border-end-end-radius: var(--r-lg);
  }

  .player__top--run > :is(.player__bar, .player__dock, .player__run-pinned) {
    position: static;
    padding: 0;
    border-radius: 0;
  }

  /* The run's own row leads with its figure, at the size the phone's clock has (design re-review,
     2026-11-22): first in the row, before the phase. */
  .player__top--run > .player__run-pinned > .player__run-pinned-time {
    font-size: var(--text-xl);
  }
}

@media (max-width: 40rem), (max-height: 30rem) {
  .player__top.player__top--run {
    padding: var(--space-1) var(--space-3);
  }

  /* THE PHASE, ITS FIGURE AND THE VOLUME IN THE HEIGHT OF THE BAR'S BUTTONS (design review
     2026-11-22, findings 1 and 2). The figure keeps the pinned line's large size and spans both
     lines at the start, so the phase and the volume stand between it and the exam's own clock -
     side by side the two figures read as one; the phase name takes what is left and gives way
     first. With «Səsi aç» the button stands beside the figure on one line instead, so the row
     keeps its height and nothing is pressed against the screen's top. */
  .player__run-compact {
    flex: 1 1 auto;
    min-inline-size: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "time what"
      "time ctrl";
    align-items: center;
    column-gap: var(--space-2);
  }

  .player__run-compact--unlock {
    grid-template-areas: "time ctrl";
  }

  /* A section to finish puts a second button in the bar: the first row is then the run's line
     (or the title) alone, the clock and the buttons under it, as at 22rem without a run. Both
     contents wrap alike, so scrolling the figure in and out still moves nothing. */
  .player__top--run .player__bar:has(> .btn--secondary) {
    flex-wrap: wrap;
    row-gap: var(--space-1);
  }

  .player__top--run .player__bar:has(> .btn--secondary) > :is(.player__title, .player__run-compact) {
    flex-basis: 100%;
  }

  /* Three rows of buttons then: focus moved by Tab lands clear of them (WCAG 2.4.11). */
  :root:has(.player__top--run .player__bar > .btn--secondary) {
    scroll-padding-block-start: calc(var(--target-comfortable) * 3 + var(--space-2) * 6);
  }

  .player__run-compact-what {
    grid-area: what;
    display: flex;
    align-items: center;
    gap: var(--space-1);
    min-inline-size: 0;
  }

  .player__run-compact-what > svg {
    flex: none;
  }

  .player__run-compact-label {
    min-inline-size: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .player__run-compact > .player__run-pinned-time {
    grid-area: time;
    font-size: var(--text-lg);
    line-height: var(--leading-tight);
    font-variant-numeric: tabular-nums;
  }

  .player__run-compact > :is(.player__run-volume, .listening-unlock) {
    grid-area: ctrl;
    min-inline-size: 0;
  }

  .player__run-compact .player__run-volume input[type='range'] {
    flex: 1 1 auto;
    inline-size: 100%;
    min-inline-size: 0;
  }

  /* The button's label may wrap rather than push the figure off the row (a long translation). */
  .player__run-compact .listening-unlock {
    justify-self: start;
    max-inline-size: 100%;
    white-space: normal;
  }
}

/* 22rem and under (320 px, or 360 px with 125% text): the slider was 24 to 29 px wide beside its
   word. The word is still its name for a screen reader; on screen the slider takes its room. And
   with a section to finish the bar takes three rows (193 px at 320, 198 px at 360 with 125% text),
   so the focus clears four rows' height (WCAG 2.4.11). */
@media (max-width: 22rem) {
  /* «Səsi aç» on one line beside the figure (design re-review): it wrapped to two at 320 px and at
     360 px with 125% text. The label keeps to one line and the button's inline padding tightens. */
  .player__run-compact .listening-unlock {
    white-space: nowrap;
    padding-inline: var(--space-1);
  }

  .player__run-compact .player__run-volume > label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  :root:has(.player__top--run .player__bar > .btn--secondary) {
    scroll-padding-block-start: calc(var(--target-comfortable) * 4 + var(--space-2) * 6);
  }
}

/* The preview's label is a sentence: a badge does not wrap, so this one may (as the plays-left one). */
.listening-preview {
  max-inline-size: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  margin: 0;
}

.player__run-elsewhere {
  margin: 0;
}

/* The run's timeline: the section strip's badges in one row that wraps, read left to right. */
.listening-steps {
  flex-direction: row;
  justify-content: flex-start;
}

/* ONE SCREEN PER BLOCK (owner decision D8, 2026-11-21): the recording or the passage, then every
   question on it. Each question is a group of the card's own rows; its save-state foot already
   draws the rule that sets it apart from the next, so none is added here. */
.player__items {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-inline-size: 0;
}

.player__item {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-inline-size: 0;
}

/* On a wide screen the recording or the passage stands beside its questions and stays in view while
   they scroll, as the rail does. Below this width it is on top, which is the phone's layout too. */
@media (min-width: 75rem) {
  .player__question--block {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    align-items: start;
  }

  /* Everything that is not the pane or the questions spans the card. */
  .player__question--block > :not(.stimulus-pane):not(.player__items) {
    grid-column: 1 / -1;
  }

  .player__question--block > .stimulus-pane:not([hidden]) {
    grid-column: 1;
    position: sticky;
    top: 6rem;
    max-block-size: calc(100vh - 8rem);
    overflow: auto;
  }

  .player__question--block > .player__items {
    grid-column: 2;
  }
}

/* The section strip under the player's bar. */
.player__section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
}

/* Each section's part of a total, beside the total. */
.section-scores {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
}

/* One timed section in the exam's settings: its place, title, skill, minutes and moves. */
.section-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 10rem) 5rem auto;
  gap: var(--space-2);
  align-items: center;
}

.section-row > .field {
  inline-size: 100%;
  min-inline-size: 0;
}

@media (max-width: 40rem) {
  .section-row {
    grid-template-columns: auto minmax(0, 1fr);
  }
}

/* --- the exam dialog's pinned actions (owner queue 2026-10-25, item 3) -----------------
   A tabbed dialog whose tabs each own their actions: each tab portals its buttons into one
   slot in `.modal__foot`, so they sit outside the scrolling body and never scroll away. The
   slot adds no box of its own, and a tab with no actions leaves no empty strip behind. */
.modal__foot-slot {
  display: contents;
}

.modal__foot:has(> .modal__foot-slot:empty) {
  display: none;
}

/* The one action that sits apart from the others: a destructive act, at the start. */
.modal__foot-start {
  margin-inline-end: auto;
}

/* An exam's state at the top of its settings: the badges and the acts that change it. */
.exam-state {
  flex-wrap: wrap;
  align-items: center;
}

/* The share-link block's one heading line (owner queue 2026-10-25, item 8): the title and its
   "i", the month's use, the state chip and "Link yarat", wrapping on a phone rather than
   pushing the button past the sheet's edge. */
.exam-share-head {
  flex-wrap: wrap;
  align-items: center;
}

.exam-share-head__action {
  margin-inline-start: auto;
}

/* The exam's Settings: fields side by side that share a row (owner queue review, 2026-10-25).
   At 390px the "Bitir" date ran past the sheet's edge and a label that wrapped to two lines
   lowered its box below its neighbours. A grid whose tracks may shrink to nothing and whose
   items sit on the row's bottom edge: each field takes the track's width, the tracks wrap to
   their own line when one would be narrower than 10rem, and a two-line label lifts its own
   label, not its box. */
.exam-settings-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(10rem, 100%), 1fr));
  gap: var(--space-3);
  align-items: end;
}

.exam-settings-row > .form-field {
  min-inline-size: 0;
}

.exam-settings-row .field,
.exam-settings-row .datefield {
  inline-size: 100%;
  min-inline-size: 0;
}

/* The teacher's Link and code tab as cards (owner, 2026-11-16): the link and the common code side
   by side, one column on a narrow window; the class binding and the personal codes across both. */
.codes-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr));
  gap: var(--space-4);
  align-items: start;
}

.codes-cards > * {
  min-inline-size: 0;
}

.codes-cards__wide {
  grid-column: 1 / -1;
}

/* The short link, read as text and wrapped anywhere so a phone never cuts the code off its end. */
.codes-short-link {
  margin: 0;
  overflow-wrap: anywhere;
  user-select: all;
}

/* The switch's tone (owner, 2026-11-16): red while the code works and pressing it would stop it,
   green once it is off and pressing it would open it. Outlined, as its two neighbours are. */
.codes-icon-btn--off {
  --btn-fg: var(--danger-text);
  color: var(--danger-text);
  border-color: var(--danger-border);
}

.codes-icon-btn--on {
  --btn-fg: var(--success-text);
  color: var(--success-text);
  border-color: var(--success-border);
}

/* The common code's three acts as square icon buttons side by side; still a 44px target. */
.codes-icon-btn {
  justify-content: center;
  min-inline-size: var(--control-lg, 2.75rem);
  padding-inline: var(--space-3);
}

/* The independent teacher's question paper in two columns (owner, 2026-11-16, from his redesign):
   the paper, then the bank beside it, divided by a hairline; one column below 56rem. */
.paper-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
}

.paper-main,
.paper-side {
  min-inline-size: 0;
}

/* The paper dialog's foot, thinner than a dialog's usual one (owner, 2026-11-16, "biraz da incəlt"):
   the two columns above it get the height back. */
.modal:has(.paper-layout) > .modal__foot {
  align-items: center;
  padding-block: var(--space-3);
}

/* EACH COLUMN SCROLLS ON ITS OWN on a wide window (owner, 2026-11-16, "pəncərənin scrollu ayrı
   olsun"): the dialog's body stops scrolling and hands its height to the two columns, so the paper
   stays where it is while the bank is paged through, and the other way round. On a phone the two
   are one column and the body scrolls as it did. */
@media not (max-width: 56rem) {
  .modal__body:has(> .paper-layout) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .paper-layout {
    flex: 1 1 auto;
    min-block-size: 0;
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
  }

  .paper-main,
  .paper-side {
    min-block-size: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .paper-main {
    grid-row: 1;
    grid-column: 1;
    padding-inline-end: var(--space-2);
  }

  .paper-side {
    grid-row: 1;
    grid-column: 2;
  }
}

.paper-side {
  padding-inline-start: var(--space-5);
  border-inline-start: 1px solid var(--border-subtle);
}

@media (max-width: 56rem) {
  .paper-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .paper-side {
    padding-inline-start: 0;
    padding-block-start: var(--space-5);
    border-inline-start: 0;
    border-block-start: 1px solid var(--border-subtle);
  }
}

.paper-bank__title {
  margin: 0;
  font-size: var(--text-xl);
  font-weight: var(--weight-strong);
}

/* Net marking on: one line with its way to Settings at the end. */
.paper-net {
  flex-direction: row;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--info);
  border-radius: var(--r-md);
  background: var(--info-subtle);
}

.paper-net > svg {
  flex: none;
  color: var(--info);
}

.paper-net__link {
  margin-inline-start: auto;
}

/* The list's two column names over the rows: the question, and the points at the end. */
.paper-cols {
  flex-direction: row;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-inline: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.paper-list > li {
  padding-block: var(--space-3);
  border-block-end: 1px solid var(--border-subtle);
}

.paper-list > li:first-child {
  border-block-start: 1px solid var(--border-subtle);
}

.paper-entry__number {
  flex: none;
  min-inline-size: 2ch;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.paper-entry__words {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-inline-size: 0;
}

.paper-tools {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-block-start: var(--space-3);
  border-block-start: 1px solid var(--border-subtle);
}

.paper-tools__label {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.paper-tools__row {
  flex-direction: row;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
}

/* An open "Mətn və ya audio" panel takes the whole line under the tools. */
.paper-tools__row > :not(.row) {
  flex-basis: 100%;
}

/* The foot's saved or unsaved line, at the start; a tick when everything is saved. */
.paper-foot-state {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.paper-foot-state[data-saved] > svg {
  color: var(--success);
}

/* The bank as the paper's column. */
.paper-bank__search {
  position: relative;
  display: block;
}

.paper-bank__search > svg {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: var(--space-3);
  translate: 0 -50%;
  color: var(--text-tertiary);
  pointer-events: none;
}

.paper-bank__search > .field {
  inline-size: 100%;
  min-inline-size: 0;
  padding-inline-start: calc(var(--space-3) * 2 + 1em);
}

.paper-bank__bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2);
  align-items: center;
}

.paper-bank__more {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(9rem, 100%), 1fr));
  gap: var(--space-2);
}

.paper-bank__more > .field {
  inline-size: 100%;
  min-inline-size: 0;
}

.paper-bank__row {
  flex-direction: row;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-block: var(--space-2);
  border-block-end: 1px solid var(--border-subtle);
}

.paper-bank__words {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: var(--space-1);
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

.paper-bank__text {
  font-weight: var(--weight-medium);
}

.paper-bank__add {
  flex: none;
}

/* The independent teacher's exam settings as cards (owner, 2026-11-16, from his redesign of the
   tab): two columns, the wider one first; one column below 52rem. Each card is a `.mat-inset`, a
   plane inside the dialog's material that never blurs (glass cannot sample glass). */
.exam-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
}

@media (max-width: 52rem) {
  .exam-settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.exam-settings-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-inline-size: 0;
}

/* Inside the dialog's material an inset plane draws nothing, so the card is a border, as the
   share-link cards are. */
.exam-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
}

/* Minutes, pass mark and attempts on one line in the card, as the redesign has them. */
.exam-card .exam-settings-row {
  grid-template-columns: repeat(auto-fit, minmax(min(7rem, 100%), 1fr));
}

.exam-card__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  font-size: var(--text-lg);
  font-weight: var(--weight-strong);
}

.exam-card__title > svg {
  flex: none;
  color: var(--text-secondary);
}

.exam-card__rule {
  margin: 0;
  border: 0;
  border-block-start: 1px solid var(--border-subtle);
}

/* No sections yet: said in the middle of the card, under a page glyph. */
.exam-card__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding-block: var(--space-4);
  text-align: center;
}

.exam-card__empty > svg {
  inline-size: var(--space-8);
  block-size: var(--space-8);
  color: var(--text-tertiary);
}

.exam-card__empty > p {
  margin: 0;
}

/* A setting that is on or off: glyph, name over hint, switch at the end. */
.setting-switch {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
}

.setting-switch:not(:has(> .setting-switch__icon)) {
  grid-template-columns: minmax(0, 1fr) auto;
}

.setting-switch__icon {
  color: var(--text-secondary);
}

.setting-switch__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-inline-size: 0;
}

.setting-switch__label {
  font-weight: var(--weight-medium);
  cursor: pointer;
}

/* The exam's share links as a list of cards (owner queue review, 2026-10-25): the state, a
   one-line address with Copy, the actions; the note on its own line, wrapping between words;
   the dates and the seats as one line of small text. On the page ground of the block, so a
   border rather than a second material. */
.share-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.share-link {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.share-link__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.share-link__head > .share-row {
  flex: 1 1 14rem;
  min-inline-size: 0;
  flex-wrap: nowrap;
}

.share-link__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-inline-start: auto;
}

.share-link__note {
  margin: 0;
  overflow-wrap: break-word;
  word-break: normal;
}

.share-link__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  margin: 0;
}

/* The address on one line, cut with an ellipsis; the whole of it is in the title and Copy. */
.share-row--compact > code {
  flex: 1 1 8rem;
  min-inline-size: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow-wrap: normal;
}

/* A row's "more" trigger reads as a control (owner queue review, 2026-10-25). Three 2px dots on
   a borderless ghost button were too faint to find: the standard icon button, with an edge and
   the dots in full text colour. Focus keeps the system's one ring. */
.row-menu__trigger {
  border: 1px solid var(--border-strong);
  color: var(--text);
}


/* The monitor's «Başqa cihaz · indicə» note and «Cihazı aç» under it, under a person's name.
   `contain: inline-size` takes both out of the column's width: the cell is exactly as wide as it
   is without them, and they wrap inside it, so the table does not move when they come or go.
   Positioned, so the note's spoken sentence (`.visually-hidden`) resolves against it inside the
   sideways-scrolling table. */
.device-chip {
  position: relative;
  contain: inline-size;
  align-items: start;
}

.device-chip > :is(.badge, .btn) {
  max-inline-size: 100%;
  white-space: normal;
}

/* The device screen (owner item 19): a two-line title is balanced, never one word on its own. */
.device-empty .empty__title {
  text-wrap: balance;
}

/* An empty state's buttons wrap under each other rather than run past a narrow screen: «Yenidən
   yoxla» and «İmtahanlarım» side by side were 30 px wider than 280 px (candidate audit B12). */
.empty > .row {
  flex-wrap: wrap;
  justify-content: center;
  max-inline-size: 100%;
  min-inline-size: 0;
}

/* The answer to «Yenidən yoxla» is a live region that is in the page before anything is said in
   it; while it is empty it takes no row, no gap and no margin in the centred block. */
.device-answer:empty {
  position: absolute;
  margin: 0;
}

/* An item still waiting for what it needs keeps its place and says so. */
.menu__item[aria-busy="true"] {
  cursor: progress;
  color: var(--text-secondary);
}

/* The learner picker keeps its width whatever it holds (owner queue review, 2026-10-25): with
   no learner its widest option was a dash, the select shrank, and the dates beside it moved. */
.elig-compute > .elig-compute__learner {
  flex: 1 1 14rem;
  min-inline-size: min(14rem, 100%);
}

.elig-compute__learner .field,
.elig-compute__learner .combo {
  inline-size: 100%;
}

/* A daily-challenge question keeps its author's line breaks too (owner, 2026-10-25). */
.player__lines {
  white-space: pre-line;
}

/* ===========================================================================
   The exam centre, `exam.{apex}` (modules/exam-centre.md, M1).

   The candidate site is the landing page's public face reused - `.lp-header`, `.lp-section`,
   `.lp-grid`, `.lp-card.mat-inset` on the page ground, `.lp-footer` - and the staff panel is the
   ordinary shell. What is here is layout only: no colour, radius, shadow or duration is defined,
   every value is a token the contract already has.
   =========================================================================== */

/* The landing's nav hides below 64rem because its anchors repeat the page; the centre's two
   links are the way to "My exams", so they stay and the bar wraps instead of overflowing. */
.ec-header,
.ec-header__actions {
  flex-wrap: wrap;
}

.ec-header__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  margin-inline: auto;
}

/* Where the reader is, said by more than colour: the current link takes the hover fill too. */
.ec-header__nav .lp-nav__link[aria-current="page"] {
  background: var(--surface-2);
  color: var(--text);
}

/* A long first name must not push the bar wider than a phone. */
.ec-header__account {
  max-inline-size: min(16rem, calc(100vw - var(--space-8)));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Display type is a different size, not a bolder body. */
.ec-display {
  font-size: var(--text-display);
  line-height: var(--leading-tight);
  overflow-wrap: anywhere;
}

/* The sign-in card sits between the header and the footer here, not alone in the viewport. */
.ec-site .auth-page {
  min-height: auto;
  padding-block: var(--space-6);
}

/* THE CATALOGUE'S FILTERS NEVER CUT THEIR TEXT (owner, 2026-11-01: "no clipped text on any
   device"). Only this bar: every other filter bar keeps `.filter-bar .field`'s 10rem.

   The selects here are native on every pointer (`PlainSelects` in `Catalogue.tsx`), so each is
   as wide as its longest option. The subject and the topic then grow into the row's leftover
   width, never past the row, and drop onto a row of their own when they do not fit beside the
   price. Where even a whole row is too narrow - a long subject on a phone - the name wraps
   inside the field instead of ending in an ellipsis: that takes `appearance: none` (measured,
   Chromium draws a native select's text on one line under its own appearance), so the platform
   arrow goes and the chevron every other picker wears is drawn in its place. */
.ec-catalogue .filter-bar > .form-field:has(select[data-grow]) {
  flex: 1 1 auto;
  min-inline-size: min(10rem, 100%);
  max-inline-size: 100%;
}

.ec-catalogue .filter-bar select.select-clear__field {
  appearance: none;
  block-size: auto;
  /* One line still centres in the 34px control height; two or more get room above and below. */
  padding-block: var(--space-1);
  white-space: normal;
  overflow-wrap: anywhere;
}

/* `chevron-down` from `Icon.tsx` (1em, stroke 2), at `.combo__chevron`'s place and ink. The mask
   carries only the shape; the colour is the token. */
.ec-catalogue .filter-bar .select-clear::after {
  content: '';
  position: absolute;
  inset-inline-end: var(--space-3);
  inline-size: 1em;
  block-size: 1em;
  background-color: var(--text-tertiary);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  pointer-events: none;
}

@media (forced-colors: active) {
  .ec-catalogue .filter-bar .select-clear::after {
    background-color: CanvasText;
  }
}

/* Cards in a row end level, with the action on the last line of each. */
.ec-cards__item {
  display: flex;
  min-inline-size: 0;
}

.ec-card {
  inline-size: 100%;
  min-inline-size: 0;
}

.ec-card__action {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  margin-block-start: auto;
}

.ec-card__action.row {
  flex-direction: row;
  flex-wrap: wrap;
}

.ec-prose {
  margin: 0;
  max-inline-size: var(--measure-lede);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.ec-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin: 0;
  padding-inline-start: var(--space-5);
}

.ec-narrow,
.ec-mfa {
  inline-size: 100%;
  max-inline-size: var(--measure-lede);
}

/* An address or an e-mail is one unbreakable token; it may break anywhere rather than widen. */
.ec-break {
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

/* ===========================================================================
   The candidate cabinet (owner's prototype, approved 2026-11-01).

   Layout only, as the rest of this section: every colour, radius, size and duration is a token
   the contract already has. One `.mat` leads each tab - the startable exam, the result hero, the
   account form - and everything repeated beside or under it is `.mat-inset` on the page ground,
   which takes the border role for its edge (glass cannot sample glass).

   NARROW WIDTHS (components.md, "Narrow-width defences"): every grid track is `minmax(0, ...)`,
   every grid and flex child that holds text has `min-inline-size: 0`, an unbreakable code breaks
   anywhere, and the one visually hidden span sits in a positioned ancestor.
   =========================================================================== */

.ec-cabinet {
  gap: var(--space-5);
}

.ec-cabinet__head {
  margin-block-end: 0;
}

.ec-eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  font-weight: var(--weight-strong);
}

.ec-tab {
  gap: var(--space-6);
  min-inline-size: 0;
}

/* The primary action of a screen meets the comfortable target, not only the minimum. */
.ec-cta {
  min-block-size: var(--target-comfortable);
}

/* Two cards side by side, one under the other below the tablet width. */
.ec-two {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
}

.ec-two > * {
  min-inline-size: 0;
}

.ec-section-head {
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3);
}

/* The lead exam: the material, a display-size title, and the one primary action. */
.ec-lead {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  border-radius: var(--r-lg);
}

.ec-lead__title {
  margin: 0;
  font-size: var(--text-2xl);
  line-height: var(--leading-tight);
  overflow-wrap: anywhere;
}

.ec-card .row,
.ec-lead .row {
  flex-wrap: wrap;
  min-inline-size: 0;
}

/* --- the countdown -------------------------------------------------------- */

.ec-countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
}

.ec-countdown__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  min-inline-size: 0;
  padding: var(--space-3) var(--space-1);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}

.ec-countdown__num {
  font-size: var(--text-2xl);
  line-height: var(--leading-tight);
  font-variant-numeric: tabular-nums;
}

.ec-countdown__lab {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.ec-countdown__done {
  margin: 0;
  font-weight: var(--weight-medium);
}

/* --- the progress chart --------------------------------------------------- */

.ec-progress__stat {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-3);
  margin: 0;
}

.ec-progress__big {
  font-size: var(--text-2xl);
  line-height: var(--leading-tight);
  font-variant-numeric: tabular-nums;
}

.ec-progress__table summary {
  cursor: pointer;
  font-size: var(--text-sm);
  min-block-size: var(--target-min);
}

.ec-progress__table table {
  inline-size: 100%;
  margin-block-start: var(--space-2);
  font-size: var(--text-sm);
}

.ec-chart {
  display: block;
  inline-size: 100%;
  block-size: auto;
}

.ec-chart__grid line {
  stroke: var(--border);
  stroke-width: 1;
}

.ec-chart__axis text {
  fill: var(--text-secondary);
  font-size: var(--text-xs);
}

.ec-chart__area {
  fill: var(--brand-subtle);
  stroke: none;
}

.ec-chart__line {
  fill: none;
  stroke: var(--brand);
  stroke-width: 2.25;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.ec-chart__pt {
  fill: var(--surface-1);
  stroke: var(--brand);
  stroke-width: 2;
}

.ec-chart__pt--last {
  fill: var(--brand);
}

.ec-chart__pass {
  stroke: var(--text-secondary);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

/* The line draws itself in, only for a reader who has not asked for less motion. */
@media (prefers-reduced-motion: no-preference) {
  .ec-chart__line {
    stroke-dasharray: 1;
    animation: ec-chart-draw var(--dur-slow) var(--ease-out) both;
  }
}

@keyframes ec-chart-draw {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}

/* --- the past exams ------------------------------------------------------- */

.ec-past {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: var(--space-2);
  border-radius: var(--r-lg);
}

[data-family="glass"] .ec-past,
[data-family="glass"] .ec-state,
[data-family="glass"] .ec-danger {
  border-color: var(--border);
}

.ec-past > li + li {
  border-block-start: 1px solid var(--border-subtle);
}

.ec-past__row {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr) auto auto;
  gap: var(--space-3) var(--space-4);
  align-items: center;
  padding: var(--space-4);
}

.ec-past__date {
  display: flex;
  flex-direction: column;
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.ec-past__date b {
  color: var(--text);
  font-size: var(--text-md);
}

.ec-past__main {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-inline-size: 0;
}

.ec-past__main p {
  margin: 0;
}

.ec-past__title {
  margin: 0;
  font-size: var(--text-base);
  font-weight: var(--weight-strong);
  overflow-wrap: anywhere;
}

.ec-past__score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-1);
  text-align: end;
}

.ec-past__act {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
}

/* The tab ends on purpose: a dashed line round the way to the catalogue. */
.ec-page-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
}

.ec-page-end p {
  margin: 0;
  min-inline-size: 0;
}

/* --- the result ----------------------------------------------------------- */

.ec-picker {
  gap: var(--space-2);
}

.ec-picker > .chip {
  min-block-size: var(--target-min);
}

.ec-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 20rem);
  gap: var(--space-6);
  border-radius: var(--r-lg);
  margin-block-end: var(--space-5);
}

.ec-hero p {
  margin: 0;
}

.ec-hero__score {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
}

.ec-hero__num {
  font-size: var(--text-display);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.ec-hero__of {
  font-size: var(--text-2xl);
  color: var(--text-secondary);
}

.ec-hero__verdict {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.ec-hero__side {
  align-content: start;
  min-inline-size: 0;
}

.ec-meter__track {
  position: relative;
  block-size: var(--space-2);
  border-radius: var(--r-pill);
  background: var(--surface-2);
}

.ec-meter__fill {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  border-radius: inherit;
  background: var(--brand);
}

.ec-meter__pass {
  position: absolute;
  inset-block: calc(var(--space-1) * -1.5);
  inline-size: 2px;
  margin-inline-start: -1px;
  border-radius: var(--r-pill);
  background: var(--text);
}

.ec-code-text {
  font-size: var(--text-md);
  letter-spacing: var(--tracking-label);
}

.ec-state {
  border-radius: var(--r-lg);
  padding: var(--space-7);
}

.ec-state p {
  margin: 0;
}

/* --- the start dialog and the account's notes ------------------------------ */

.ec-rules {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: 0;
  font-size: var(--text-sm);
}

.ec-rules li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-3);
  align-items: start;
}

.ec-rules__icon {
  margin-block-start: 2px;
  color: var(--brand-text);
}

/* Six boxes, one digit each, never wider than their row on the narrowest phone. */
.ec-code {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-2);
  max-inline-size: 22rem;
}

.ec-code__box {
  inline-size: 100%;
  min-inline-size: 0;
  min-block-size: var(--control-xl);
  padding-inline: 0;
  text-align: center;
  font-size: var(--text-xl);
  font-variant-numeric: tabular-nums;
}

/* --- the requests ---------------------------------------------------------- */

.ec-thread {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: 0;
}

.ec-msg {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  max-inline-size: min(62ch, 100%);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--r-md);
  background: var(--surface-2);
  font-size: var(--text-sm);
}

.ec-msg--centre {
  align-self: flex-end;
  background: var(--brand-subtle);
}

.ec-msg__who {
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
  color: var(--text-secondary);
}

/* --- the header's name menu and the account -------------------------------- */

.ec-namemenu__button {
  gap: var(--space-2);
  max-inline-size: min(16rem, calc(100vw - var(--space-8)));
  padding-inline: var(--space-1) var(--space-2);
}

.ec-namemenu__name {
  min-inline-size: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ec-namemenu__chevron {
  flex: none;
  transition: transform var(--dur-base) var(--ease-out);
}

.ec-namemenu__button[aria-expanded="true"] .ec-namemenu__chevron {
  transform: rotate(180deg);
}

.ec-namemenu .accountmenu__panel {
  max-inline-size: min(20rem, calc(100vw - var(--space-6)));
}

.ec-back {
  padding-inline-start: var(--space-2);
}

.ec-account > p {
  margin: 0;
}

.ec-danger {
  border-radius: var(--r-lg);
}

@media (max-width: 54rem) {
  .ec-two,
  .ec-hero {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 40rem) {
  /* One column on a phone: the date, the exam, then its score and state on one line, then the
     actions. A score column beside the title squeezed a long title into three words a line. */
  .ec-past__row {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-2);
  }

  .ec-past__date {
    flex-direction: row;
    gap: var(--space-2);
    align-items: baseline;
  }

  .ec-past__score {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    text-align: start;
  }

  .ec-past__act {
    justify-content: flex-start;
  }

  .ec-lead__title {
    font-size: var(--text-xl);
  }

  .ec-hero__num {
    font-size: var(--text-3xl);
  }

  .ec-state {
    padding: var(--space-5);
  }

  .ec-namemenu__name {
    display: none;
  }
}

/* --- the candidate site's header and footer (audit A1-A3, 2026-11-01) ---------------------

   A1, WCAG 2.4.11 FOCUS NOT OBSCURED. The floating header is sticky, and below the tablet width
   it wrapped to three rows (173px at 320px, 30% of a phone screen) over every focused control
   scrolled up to the top. Below 64rem it is two tidy rows that scroll away with the page: the
   brand and the actions, then the two links. (At 48rem it was sticky, and at 768-820px with 1.25x
   text it wrapped to 130px under an 88px scroll padding: measured, so the line moved.) Above it, where it is one row and stays put, the
   page keeps a scroll padding of the bar's own height (its two paddings, a control and a gap,
   from the same tokens it is built from), so focus and in-page links stop below it. */
html:has(.ec-site) {
  scroll-padding-block-start: calc(var(--space-3) * 2 + var(--space-2) * 2 + var(--space-8) + var(--space-2));
}

@media (max-width: 63.99rem) {
  html:has(.ec-site) {
    scroll-padding-block-start: auto;
  }

  .ec-site .lp-header {
    position: static;
  }

  .ec-header {
    row-gap: var(--space-2);
  }

  .ec-header__nav {
    order: 3;
    flex-basis: 100%;
    margin-inline: 0;
  }

  /* The landing's own small-screen rule gives the actions a row of their own (`flex-basis:
     100%`); here they share the first row with the brand, at the far end. */
  .ec-header__actions {
    flex: 1 1 auto;
    justify-content: flex-end;
    min-inline-size: 0;
    margin-inline-start: auto;
  }
}

/* A2: the centre's name may wrap or shrink rather than run past a 320px screen at 1.25x text. */
.ec-site .lp-brand {
  flex: 0 1 auto;
  min-inline-size: 0;
}

.ec-site .lp-brandname {
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

/* A3: the footer's links are targets of their own, not words in a sentence: at least 24px. */
.ec-site .lp-footer a {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--target-min);
}

/* Below 27.5rem the mark stands for the centre, as in the owner's prototype, and the header is
   two rows - the mark with the actions, then the links. The name stays in the link's accessible
   name, in a box that takes no room; the link is its positioned ancestor. */
@media (max-width: 27.5rem) {
  .ec-site .lp-brand {
    position: relative;
  }

  .ec-site .lp-brandname {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* The candidate's name and a long e-mail are read in full in the name menu, never cut with an
   ellipsis: they wrap anywhere inside the panel, which is never wider than the screen. */
.ec-namemenu .accountmenu__who span,
.ec-namemenu .accountmenu__who strong {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}

/* =============================================================================
   The question maker (phase 1, 2026-11-07) and the formulas it writes.

   Built from what the bank already wears: `.mat-inset` planes, `.chip` toggles for the
   letters, the PDF reader's own bar and desk for the crop tool. Tokens only.
   ========================================================================== */

/* A formula typeset by KaTeX. A display formula takes its own line and, when it is wider than
   its column, scrolls inside it rather than widening the page (narrow-width defence 3). */
.math-text__display {
  display: block;
  max-inline-size: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

/* Until KaTeX arrives, the formula's source in the text's own size. */
.math-text__source {
  font-size: inherit;
  overflow-wrap: anywhere;
}

/* The formula panel: two wrapped rows of keys under the text it writes into. */
.formula-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.formula-panel__keys {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.formula-panel__key {
  min-inline-size: var(--target-min);
  min-block-size: var(--target-min);
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

/* The symbols search (2026-11-12): the field's own box, no wider than a name is long, and never
   wider than the panel it stands in (narrow-width defence 1). */
.formula-panel__search {
  inline-size: 100%;
  min-inline-size: 0;
  max-inline-size: 26rem;
}

/* The independent teacher's formatted question text (2026-11-10), in the editor and wherever it is
   read: one set of rules, so the field shows what the sitter sees. A paragraph is a line like a
   plain text's line; lists indent as `.prose` lists do; a table's cells wrap rather than widen the
   column (narrow-width defence 3). Colours are the theme's text tones, fonts its own families; the
   classic face is the platform's serif, the theme having none of its own. */
.rich-text p {
  margin: 0;
}

.rich-text ul,
.rich-text ol {
  margin-block: var(--space-1);
  padding-inline-start: var(--space-5);
}

.rich-text li + li {
  margin-top: var(--space-1);
}

.rich-text table {
  border-collapse: collapse;
  max-inline-size: 100%;
  margin-block: var(--space-2);
}

.rich-text td {
  border: 1px solid var(--border-strong);
  padding: var(--space-1) var(--space-2);
  vertical-align: top;
  min-inline-size: 3ch;
  overflow-wrap: anywhere;
}

.rich-text [data-color="red"] {
  color: var(--danger-text);
}

.rich-text [data-color="orange"] {
  color: var(--warning-text);
}

.rich-text [data-color="green"] {
  color: var(--success-text);
}

.rich-text [data-color="blue"] {
  color: var(--info-text);
}

.rich-text [data-color="grey"] {
  color: var(--text-secondary);
}

.rich-text [data-font="sans"] {
  font-family: var(--seed-font-body);
}

.rich-text [data-font="serif"] {
  font-family: serif;
}

.rich-text [data-font="mono"] {
  font-family: var(--seed-font-mono);
}

/* Text formatting (owner, 2026-11-12): the five names the server keeps, each given its look here
   and, in the paper's units, in `print/paper.css` - the two places every rich text is drawn from.

   A size is a step of the theme's own type scale taken against the text it stands in (`em`), so the
   same question keeps its proportions in the bank's row, the player and on paper, whatever size
   each of them sets a question in: the body step is 1, and the others are the scale's neighbours
   over it (0.75, 0.8125, 1.0625, 1.25, 1.375 and 1.75 over 0.9375). The editor never puts one size
   inside another, so a step is always taken against the body. */
.rich-text [data-size="xs"] {
  font-size: 0.8em;
}

.rich-text [data-size="sm"] {
  font-size: 0.867em;
}

.rich-text [data-size="md"] {
  font-size: 1em;
}

.rich-text [data-size="lg"] {
  font-size: 1.133em;
}

.rich-text [data-size="xl"] {
  font-size: 1.333em;
}

.rich-text [data-size="2xl"] {
  font-size: 1.467em;
}

.rich-text [data-size="3xl"] {
  font-size: 1.867em;
}

/* A highlight is the theme's own status tint behind the words, the pair every badge already wears;
   the grey one is the theme's third surface. It follows its words across a line break. */
.rich-text [data-bg] {
  border-radius: var(--r-xs);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.rich-text [data-bg="yellow"] {
  background-color: var(--warning-subtle);
}

.rich-text [data-bg="red"] {
  background-color: var(--danger-subtle);
}

.rich-text [data-bg="green"] {
  background-color: var(--success-subtle);
}

.rich-text [data-bg="blue"] {
  background-color: var(--info-subtle);
}

.rich-text [data-bg="grey"] {
  background-color: var(--surface-3);
}

/* A paragraph's alignment is the logical keyword it is stored as, so it follows the text's
   direction; its indent is the list's own step, once per level; its line spacing the number itself. */
.rich-text p[data-align="start"] {
  text-align: start;
}

.rich-text p[data-align="center"] {
  text-align: center;
}

.rich-text p[data-align="end"] {
  text-align: end;
}

.rich-text p[data-align="justify"] {
  text-align: justify;
}

.rich-text p[data-indent="1"] {
  padding-inline-start: var(--space-5);
}

.rich-text p[data-indent="2"] {
  padding-inline-start: calc(var(--space-5) * 2);
}

.rich-text p[data-indent="3"] {
  padding-inline-start: calc(var(--space-5) * 3);
}

.rich-text p[data-indent="4"] {
  padding-inline-start: calc(var(--space-5) * 4);
}

.rich-text p[data-line="1"] {
  line-height: 1;
}

.rich-text p[data-line="1.15"] {
  line-height: 1.15;
}

.rich-text p[data-line="1.5"] {
  line-height: 1.5;
}

.rich-text p[data-line="2"] {
  line-height: 2;
}

/* The formatting field: the textarea's own box, three lines tall at rest, growing with its text. */
.rich-field__area {
  min-block-size: calc(var(--control-md) * 2);
  overflow-wrap: anywhere;
  cursor: text;
}

/* The teacher's text editor as one box (owner's mockup, 2026-11-17): two rows of keys over the text,
   a quiet foot under it, one edge round all three, and the field's focus ring on the whole box. */
.rich-editor {
  display: flex;
  flex-direction: column;
  min-inline-size: 0;
  border: 1px solid var(--control-border);
  border-radius: var(--r-md);
  background: var(--surface-1);
  transition:
    border-color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
}

.rich-editor:focus-within {
  border-color: var(--field-focus-ring);
  box-shadow: 0 0 0 var(--focus-glow-spread) color-mix(in oklab, var(--field-focus-ring) 22%, transparent);
}

.rich-editor--invalid {
  border-color: var(--danger);
}

.rich-editor__bar {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-block-end: 1px solid var(--border-subtle);
}

/* A row wraps group by group on a narrow card; a hairline stands between groups, as in the mockup. */
.rich-editor__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.rich-editor__group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  min-inline-size: 0;
}

.rich-editor__group + .rich-editor__group {
  padding-inline-start: var(--space-2);
  border-inline-start: 1px solid var(--border-subtle);
}

.rich-editor__group--end {
  margin-inline-start: auto;
}

/* A key: an outlined square for a glyph, wider with a word and a chevron; pressed is the brand fill. */
.rich-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-inline-size: var(--control-sm);
  min-block-size: var(--control-sm);
  padding: 0 var(--space-2);
  border: 1px solid var(--control-border);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: var(--text-sm);
  line-height: 1;
  cursor: pointer;
  transition:
    background var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}

.rich-key:hover:not(:disabled):not([aria-disabled="true"]) {
  background: var(--surface-2);
}

.rich-key:active:not(:disabled):not([aria-disabled="true"]) {
  background: var(--surface-3);
}

.rich-key:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
}

.rich-key[aria-pressed="true"],
.rich-key[aria-expanded="true"] {
  border-color: var(--brand);
  background: var(--brand-subtle);
}

.rich-key[aria-pressed="true"]:not(.rich-key--menu) {
  background: var(--brand);
  color: var(--text-on-brand);
}

.rich-key:disabled,
.rich-key[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

.rich-key__chevron {
  color: var(--text-secondary);
}

/* The colour keys: the letter (or the marker) over a bar in the colour now on the words. */
.rich-editor__ink {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-weight: var(--weight-strong);
}

.rich-editor__ink-bar {
  display: block;
  inline-size: 1rem;
  block-size: 3px;
  border-radius: var(--r-pill);
  background: currentColor;
}

.rich-editor__ink-bar--bg {
  background: var(--border);
}

.rich-editor__ink-bar--bg[data-bg] {
  padding: 0;
}

/* The size, font and spacing pickers: as wide as their words, the keys' height. */
.rich-editor__select {
  inline-size: auto;
  min-inline-size: 0;
  max-inline-size: 100%;
  min-block-size: var(--control-sm);
  padding-block: 0;
}

.rich-editor__select.field,
.rich-editor .combo__field {
  field-sizing: content;
  min-inline-size: 6ch;
  max-inline-size: 12rem;
}

/* On a desktop the pickers are drawn as comboboxes, which take no class of the caller's: the keys'
   height is given to them here. */
.rich-editor .combo__field {
  min-block-size: var(--control-sm);
  padding-block: 0;
  border-radius: var(--r-sm);
}

.rich-editor__area {
  min-block-size: calc(var(--control-md) * 3);
  max-block-size: 70vh;
  padding: var(--space-3);
  overflow: auto;
  resize: vertical;
  outline: none;
  font-size: var(--text-base);
}

/* What goes in an empty field, in the quiet ink, never read as its value. */
.rich-editor__area:empty::before {
  content: attr(data-placeholder);
  color: var(--text-tertiary);
  pointer-events: none;
}

.rich-editor__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-block-start: 1px solid var(--border-subtle);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.rich-editor__help {
  margin: 0;
}

/* A key's menu: the teacher's glass under the key (the in-place panel where popovers are not). */
.rich-menu-box {
  position: relative;
  display: inline-flex;
}

.rich-menu {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-inline-size: 12rem;
  max-inline-size: min(20rem, calc(100vw - var(--space-4) * 2));
  padding: var(--space-3);
  color: var(--text);
}

.rich-menu--inline {
  inset-inline-start: 0;
  inset-inline-end: auto;
  top: calc(100% + var(--space-1));
}

.rich-menu--inline.rich-menu--end {
  inset-inline-start: auto;
  inset-inline-end: 0;
}

.rich-menu__title {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: var(--weight-strong);
}

.rich-menu__swatches {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-block: var(--space-2);
  border-block-end: 1px solid var(--border-subtle);
}

.rich-menu__swatch {
  display: inline-grid;
  place-items: center;
  inline-size: var(--control-xs);
  block-size: var(--control-xs);
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--r-circle);
  background: none;
  cursor: pointer;
}

.rich-menu__swatch:hover {
  border-color: var(--border);
}

.rich-menu__swatch:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
}

.rich-menu__swatch[aria-pressed="true"] {
  border-color: var(--text);
}

.rich-menu__dot {
  display: block;
  inline-size: calc(var(--control-xs) - var(--space-2));
  block-size: calc(var(--control-xs) - var(--space-2));
  border-radius: var(--r-circle);
}

.rich-menu__dot--ink {
  background: currentColor;
}

.rich-menu__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  inline-size: 100%;
  min-block-size: var(--control-sm);
  padding: 0 var(--space-2);
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--text-secondary);
  font: inherit;
  font-size: var(--text-sm);
  text-align: start;
  cursor: pointer;
}

.rich-menu__item:hover,
.rich-menu__item:focus-visible {
  background: color-mix(in oklab, var(--text) 10%, transparent);
  color: var(--text);
}

.rich-menu__item:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.rich-menu__item[aria-pressed="true"] {
  color: var(--text);
  font-weight: var(--weight-strong);
}

.rich-menu__note {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.rich-menu__note--warning {
  color: var(--warning-text);
}

/* A formula in the formatting field (formula dialog, 2026-11-12): one typeset piece that opens the
   dialog. It reads as pressable by its pointer and its hover plane, and takes the focus ring when a
   keyboard reaches it; a display formula keeps its own line, as it does where the text is read. */
.rich-formula {
  display: inline-block;
  max-inline-size: 100%;
  padding-inline: var(--space-1);
  border-radius: var(--r-sm);
  cursor: pointer;
  overflow-wrap: anywhere;
  vertical-align: baseline;
  user-select: all;
}

.rich-formula[data-display="true"] {
  display: block;
  overflow-x: auto;
  overflow-y: hidden;
}

.rich-formula:hover {
  background: var(--surface-2);
}

.rich-formula:active {
  background: var(--surface-3);
}

.rich-formula:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
}

/* An option with its formulas typeset (2026-11-12): the input's own box on an editable element.
   The words keep every space as typed (so nothing is turned into another character on the way to
   the form), wrap inside the box instead of scrolling out of it, and sit centred in the control's
   height as an input's do: the padding is what is left of that height over one line, less the two
   border edges, and a tall formula simply makes the box taller.

   It keeps a width of its own, as the input it stands for did: in a row that wraps (an option with
   its picture, drawing and remove keys) that is what sends the keys to the next line on a phone,
   instead of leaving the words a column a few letters wide. Never wider than the row itself. */
.formula-field {
  min-inline-size: min(100%, 11rem);
  padding-block: max(0px, calc((var(--control-md) - 1lh) / 2 - 1px));
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  cursor: text;
}

/* The formula dialog's source: the field's own box, set in the mono face so a brace is a brace. */
.formula-dialog__source {
  resize: vertical;
  overflow-wrap: anywhere;
}

/* What the sitter will see: an inset line under the field, as an answer is shown on a paper. */
.formula-preview {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  overflow-wrap: anywhere;
}

.formula-preview__text {
  margin: 0;
}

/* Thin edges on the crop tool only (owner, 2026-11-08): the page being cut is the work, so the
   sheet gives it the room its usual 32px gutters would take. */
.modal:has(.crop-tool) .modal__head {
  padding: var(--space-3) var(--space-4) var(--space-2);
}

/* The head keeps its height while cuts go up. For that time the sheet has no cross (a run in
   flight is not left), and the cross was what made the head a control tall: without it the head
   lost 2px and the page under it moved by as much, at the press and again at the end. */
.modal:has(.crop-tool) .modal__head > .info-heading {
  min-block-size: var(--control-md);
}

/* The white-space switch and the zoom, in the head between the title and the cross (owner,
   2026-11-14: "bunu da pəncərənin bu hissəsinə yığ"), where a settings popover used to open from
   the bar. Always in sight, at the size they had in the popover, right-aligned before the cross.
   The title's row wraps rather than overflows: where the controls do not fit beside the title
   they take the head's next line, and on a narrow sheet they always do, as a second row of the
   head starting under the title, the cross staying on the title's line. */
.modal__head > .info-heading:has(.crop-tool__view) {
  flex: 1 1 auto;
  flex-wrap: wrap;
  row-gap: var(--space-1);
}

.modal__head > .info-heading:has(.crop-tool__view) .modal__title {
  white-space: nowrap;
}

.crop-tool__view {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-1) var(--space-4);
  min-inline-size: 0;
  margin-inline-start: var(--space-3);
  font-size: var(--text-sm);
}

.crop-tool__view > .row {
  min-inline-size: 0;
}

/* On a narrow sheet the controls are the head's second row, the whole head wide: the title's row
   gives up its box (`display: contents`, a plain div with no role to lose), so the title, its "i",
   the controls and the cross are the head's own items, and the controls are ordered after the
   cross on the screen while staying before it for the keyboard. A row the sheet is still too
   narrow for wraps inside itself (measured 2026-11-14: the zoom row is 339px in English at 375). */
@media (max-width: 48rem) {
  .modal:has(.crop-tool__view) .modal__head {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: var(--space-1);
  }

  .modal:has(.crop-tool__view) .modal__head > .info-heading {
    display: contents;
  }

  .modal:has(.crop-tool__view) .modal__head > .btn {
    margin-inline-start: auto;
  }

  .crop-tool__view {
    order: 1;
    flex-basis: 100%;
    justify-content: flex-start;
    margin-inline-start: 0;
  }

  .crop-tool__view > .row {
    flex-wrap: wrap;
  }
}

/* A phone's thumb target, as the reader's bar gives its own buttons below 30rem. */
@media (max-width: 30rem) {
  .crop-tool__view .btn {
    min-block-size: var(--control-lg);
  }
}

.modal:has(.crop-tool) .modal__body {
  padding: var(--space-2) var(--space-3);
  max-height: none;
}

.crop-tool .pdf-reader__pages {
  padding: var(--space-1);
}

.modal:has(.crop-tool) .modal__foot {
  padding: var(--space-2) var(--space-3) var(--space-3);
}

/* On a narrow sheet the foot is two rows, always: the count on its own, the two buttons under it.
   Left to wrap as it would, it was one row with nothing collected and two once the button said
   how many it would cut ("3 sualı kəs və əlavə et"), and one again while it said "loading" - and
   in the whole window the desk takes what the foot leaves, so the page changed size with every
   one of those (measured at 320 x 640, 2026-11-12: 302px tall, then 288, then 302). The count
   and "N added" share their row without wrapping, so that row is one line in every language. */
@media (max-width: 40rem) {
  .modal:has(.crop-tool) .modal__foot > .modal__foot-note {
    flex: 1 0 100%;
    flex-wrap: nowrap;
    min-inline-size: 0;
  }

  .modal:has(.crop-tool) .modal__foot > .modal__foot-note > * {
    min-inline-size: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* The crop tool: the reader's desk, with a pointer layer over the page. */
.crop-tool__page {
  position: relative;
  max-inline-size: 100%;
  touch-action: none;
  cursor: crosshair;
  user-select: none;
}

/* The whole page in the window (owner, 2026-11-08): the height is the sheet less its head, bar,
   foot and margins, and the width follows from the page's own shape. The pointer maps through
   the canvas's drawn box, so a cut still lands on the same pixels at any size. */
.crop-tool__page {
  inline-size: fit-content;
}

.crop-tool__canvas {
  display: block;
  max-inline-size: 100%;
  max-block-size: max(18rem, calc(100dvh - 15rem));
  block-size: auto;
}

.crop-tool__piece {
  inline-size: fit-content;
  max-inline-size: 100%;
}

.crop-tool__canvas--erase {
  touch-action: none;
  cursor: cell;
}

/* The rectangle being drawn: the brand's edge over a faint brand wash, and the question under it
   stays readable. Not `--brand-subtle`, which a preset may set opaque (#0A2540 in solid dark): the
   wash is mixed from the brand itself, as the landing page's own tint is. */
.crop-tool__selection {
  position: absolute;
  border: var(--focus-ring-width) solid var(--brand);
  background: color-mix(in oklab, var(--brand) 12%, transparent);
  pointer-events: none;
}

/* Several rectangles on one page (owner, 2026-11-11): the picked one solid with a handle on
   each corner, the others dashed, so which one a press or a key acts on is not said by colour
   alone. Each collected cut wears its label (`.crop-tool__tag`). */
.crop-tool__selection--idle {
  border-style: dashed;
}

.crop-tool__handle {
  position: absolute;
  inline-size: var(--space-3);
  block-size: var(--space-3);
  border: var(--focus-ring-width) solid var(--brand);
  background: var(--surface-1);
  translate: -50% -50%;
}

/* The head of the page view (owner, 2026-11-12): the file, the page, and the page view's tools.
   The reader's own wrapping bar, and nothing in it comes or goes while rectangles are drawn, so
   drawing never moves the page under the pointer. On a phone it is rows of whole controls: the
   file's name is the one thing that gives way. Positioned, because the hidden page line and the
   select's hidden twin need a positioned ancestor. */
.crop-tool__head {
  position: relative;
}

.crop-tool__files {
  flex: 1 1 14rem;
  min-inline-size: 0;
}

.crop-tool__files > .combo {
  flex: 1 1 auto;
}

.crop-tool__files > .btn {
  flex: none;
}

/* The page number: room for three figures and the chevron, and no wider. */
.crop-tool__pager > .combo {
  flex: none;
  inline-size: calc(var(--control-lg) * 2);
}

.crop-tool__tools {
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-inline-start: auto;
}

/* A collected cut's label: "Sual N", its letter, "Düzəlt" and "Sil". Physical sides, as the
   rectangles themselves: a page's pixels do not turn with the text.

   INSIDE ITS OWN BOX, at the top-left inner corner (review, 2026-11-12). Above the box it lay on
   the question before it, which is where the next rectangle is drawn, and a press on a label draws
   nothing; at the page's top it fell back onto its own cut. Inside, it covers its own box alone.

   ONE ROW, NEVER WRAPPED (second round, the same day). Wrapped within a narrow box it was 50 to
   67px tall on a box 30px tall at 320px, and hung onto the cuts under it. Which form it takes is
   `tagForm`'s answer, in `data-form`: the whole row where the box holds it; the number and the
   letter alone on an idle box that does not; the whole row again, past the box's right edge, once
   that box is picked - and only then is it moved, to stay on the page: `tagPlacement`, in
   `--crop-tag-shift` and `--crop-tag-lift` (nought otherwise). The box lets a press through to
   the page; its label takes its own.

   IT KEEPS TO WHAT IS SEEN OF ITS BOX (third round). The page scrolls in the desk now, and a box
   taller than the desk had its label at a top that was out of sight. `position: sticky` holds
   the label at the desk's edge for as long as its box reaches it, and inside the box always -
   the browser's own work, so a scroll runs no script for a label, in sight or out of it.

   OUTSIDE ITS BOX WHERE THE PAGE HAS ROOM (walk finding 19, 2026-11-14): inside, it lay on the
   first line of the question it named. `tagSpot` picks a tab on the box's top edge, at either
   end, or a place beside the box in the page's margin - never on another box or label, never off
   the page - and only where none fits the inner corner as before (`data-place`). The label rides
   a rail (`.crop-tool__tag-rail`) that starts at its spot (`--crop-tag-rise`, up from the inner
   corner) and ends at the box's foot, so it is sticky along the box wherever it stands. */
.crop-tool__tag-rail {
  position: absolute;
  top: var(--crop-tag-rise, 0px);
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
}

.crop-tool__tag {
  position: sticky;
  top: 0;
  left: 0;
  translate: var(--crop-tag-shift, 0px) var(--crop-tag-lift, 0px);
  z-index: var(--z-raised);
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--space-1);
  inline-size: max-content;
  padding: 0 var(--space-1);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  box-shadow: 0 var(--solid-shadow-1-y) var(--solid-shadow-1-blur)
    rgb(var(--shadow-rgb) / var(--solid-shadow-1-alpha));
  pointer-events: auto;
  cursor: auto;
}

/* Small, since it lies on the cut it names: its two actions are the 24px target and no taller
   (WCAG 2.5.8), as the number beside them is, and the row is those 24px and its own edge. Close
   set too, so the whole row - number, letter in words, two actions - fits a box that spans a
   page's text, and does not wrap onto a second row of the cut. */
.crop-tool__tag .btn {
  min-block-size: var(--target-min);
  padding-block: 0;
  padding-inline: var(--space-1);
}

.crop-tool__tag .chip {
  padding-inline: var(--space-2);
}

/* The letter, in words or alone, and "edited": one piece each, never broken. */
.crop-tool__tag-note {
  flex: none;
  white-space: nowrap;
}

/* The compact form stays inside a box narrower than itself for as long as its number can give
   way: the number shortens to an ellipsis, down to the 24px a target must keep. */
.crop-tool__tag[data-form="compact"] {
  max-inline-size: 100%;
}

.crop-tool__tag[data-form="compact"] .chip {
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The picked box's row, which may run past its box, lies over the idle labels beside it. */
.crop-tool__tag:not([data-form="compact"]) {
  z-index: calc(var(--z-raised) + 1);
}

/* The picked box's corner handles show over its label, which now shares the corner. */
.crop-tool__handle {
  z-index: calc(var(--z-raised) + 2);
}

/* The small panel beside the active rectangle: its letters and "OK". Placed by `panelAnchor`,
   whose answer arrives in two custom properties, the way the dialog carries its drag offset. The
   hint panel's surface again. */
.crop-tool__panel {
  position: absolute;
  top: var(--crop-panel-y, 0);
  left: var(--crop-panel-x, 0);
  z-index: var(--z-dropdown);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  inline-size: max-content;
  /* Never wider than the page it sits on, nor than the window when the page is zoomed past it:
     on a phone the letters keep one row and "OK" takes the next. */
  max-inline-size: min(100%, calc(100vw - var(--space-7)));
  padding: var(--space-2);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  box-shadow:
    0 var(--solid-shadow-1-y) var(--solid-shadow-1-blur) rgb(var(--shadow-rgb) / var(--solid-shadow-1-alpha)),
    0 calc(var(--solid-shadow-2-y) * 2) calc(var(--solid-shadow-2-blur) * 2)
      rgb(var(--shadow-rgb) / calc(var(--solid-shadow-2-alpha) * 1.5));
  cursor: auto;
}

/* On a narrow sheet the panel is as wide as the page at most, and five letters at the row's usual
   gap are wider than a phone's page: the fifth stood half outside the panel (seen at 320px,
   2026-11-12). There the panel's own edge and the letters' gaps are a step tighter, which is the
   room five letters need on a 320px screen, and on a narrower page still they take a second row. */
@media (max-width: 40rem) {
  .crop-tool__panel {
    padding-inline: var(--space-1);
  }

  .crop-tool__panel > .row {
    flex-wrap: wrap;
    gap: var(--space-1);
  }
}

/* The page stays whole in the window where the head takes more than its one row, by giving up
   what the head took (measured in Chromium, 2026-11-12):
   - a tablet under a finger: the finger's toggle and its larger controls make the head two rows
     (76px against 34px at 768 x 1024), so one control height and a gap;
   - a narrow sheet: the head is rows of whole controls (196px at 320 x 640 with the toggle) and
     the foot is two (97px against 55px), the sheet's own margins 32px less - four control heights. */
@media (max-width: 60rem) and (any-pointer: coarse) {
  .crop-tool__page .crop-tool__canvas {
    max-block-size: max(18rem, calc(100dvh - 15rem - var(--control-lg) - var(--space-2)));
  }
}

@media (max-width: 40rem) {
  .crop-tool__page .crop-tool__canvas {
    max-block-size: max(18rem, calc(100dvh - 15rem - var(--control-lg) * 4));
  }
}

/* IN THE WHOLE WINDOW THE PAGE FITS THE DESK ITSELF, not a guess at it. The rules above take the
   window's height less what the sheet's head, bars and foot were measured to be; here the desk
   is what is left of the window, whatever those come to, so it is asked directly: the desk is a
   size container (its size is the column's to give, never its content's) and the page is as
   tall as the desk's own room, with the same floor as before. This is the WHOLE PAGE view, and
   the cut being edited; the page's default view is a width (below).
   Where a browser has no container units the rules above still stand. */
@supports (container-type: size) {
  .modal--full .crop-tool__desk {
    container-type: size;
  }

  .modal--full .crop-tool__canvas:not([data-view="width"]),
  .modal--full .crop-tool__page .crop-tool__canvas:not([data-view="width"]) {
    max-block-size: max(18rem, 100cqb);
  }
}

/* A finger set to scroll: the page pans under it and nothing is drawn. */
.crop-tool__page[data-mode="scroll"] {
  touch-action: auto;
  cursor: auto;
}

/* THE PAGE AT A WIDTH (owner, 2026-11-12: "PDF çox kiçik açılır"), which is how it opens. Whole
   in the window it was 418px wide at 1366 x 768, its 10pt print 7px tall. The width is
   `readableWidth`'s - the desk's own, between two readable bounds - times the zoom step, and it
   arrives in `--crop-page-width`; the page is as tall as that makes it, and the desk, which is
   what the window leaves, scrolls inside itself: down always, sideways only where the page is
   wider than the desk (a phone). The canvas is drawn once and scaled here; a zoom changes this
   one width and draws nothing again. */
.crop-tool__page[data-view="width"] {
  max-inline-size: none;
}

.crop-tool__canvas[data-view="width"] {
  inline-size: var(--crop-page-width);
  max-inline-size: none;
  max-block-size: none;
}

.crop-tool__handle--nw { top: 0; left: 0; }
.crop-tool__handle--ne { top: 0; left: 100%; }
.crop-tool__handle--sw { top: 100%; left: 0; }
.crop-tool__handle--se { top: 100%; left: 100%; }

/* A letter is a target of its own: 24px at least (WCAG 2.5.8). */
.qm-card__letters .chip,
.qm-card__option .chip,
.crop-tool .chip,
.crop-tool__view .chip {
  min-inline-size: var(--target-min);
  min-block-size: var(--target-min);
}

/* An answer letter is a control the reader presses, so its unpressed edge is the structural one
   every field, secondary button and switch draws: `--control-border`, contrast-locked at 3:1 on
   the worst surface (WCAG 1.4.11). `.chip`'s own `--border` is a separator's, and nearly vanished
   on light glass. The pressed letter keeps the chip's pressed look. */
.qm-card__letters .chip:not([aria-pressed="true"]),
.qm-card__option .chip:not([aria-pressed="true"]),
.crop-tool .chip:not([aria-pressed="true"]),
.crop-tool__view .chip:not([aria-pressed="true"]) {
  border-color: var(--control-border);
}

.qm-intake__name {
  flex-wrap: nowrap;
  min-inline-size: 0;
}

/* The question maker's planes take the bank card's edge (`.overview-card`): a transparent border
   the states colour, and the border role under glass, where the ground has no glass to draw one. */
.qm-intake,
.qm-card,
.qm-block,
.qm-end,
.qm-draft {
  border: 1px solid transparent;
}

/* A block's questions in its editor (listening blocks, design review 2026-11-21): an inset plane in
   the dialog with an edge of its own, which the dark glass otherwise drew too faint to see; and each
   question's words take the body size and break anywhere, so a long one wraps on a phone. */
.block-questions {
  border: 1px solid var(--border-subtle);
}

[data-family="glass"] .block-questions {
  border-color: var(--border);
}

.block-questions__text {
  font: inherit;
  text-align: start;
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

/* On a phone the kind sits above the question, which then has the whole line to wrap in. */
@media (max-width: 720px) {
  .block-questions__row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* A block's head (listening blocks, 2026-11-21): the material a run of cards is asked about. */
.qm-block {
  border-radius: var(--r-md);
}

/* The intake: an inset plane that says so when files are dragged over it. */
.qm-intake {
  margin-block-end: var(--space-4);
  border-radius: var(--r-md);
  transition: border-color var(--dur-fast) var(--ease-out);
}

.qm-intake[data-over] {
  border-color: var(--brand-border);
}

.qm-intake__drop {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
}

.qm-intake__source {
  min-inline-size: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* CUTS THAT WAIT, SAID ON THE CROP BUTTON (owner, 2026-11-12). A button is one line and one
   height, so its label cannot wrap: the count is the number alone, and the words where the row of
   buttons is wide enough to hold the longest of them. The row is the container, not the intake:
   containment on the intake would become the containing block of its hint's panel. Where a
   browser knows no container queries the number alone stays. Where even that is too much for
   the row - the Russian label on a 320px phone - the label gives way with an ellipsis and the
   count stays whole; the button's name, read out, is the whole sentence throughout. */
.qm-intake__label {
  min-inline-size: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qm-intake__waiting {
  flex: none;
}

.qm-intake__waiting [data-form="words"] {
  display: none;
}

@supports (container-type: inline-size) {
  .qm-intake > .row--wrap {
    container: qm-intake-row / inline-size;
  }

  @container qm-intake-row (min-width: 30rem) {
    .qm-intake__waiting [data-form="words"] {
      display: inline;
    }

    .qm-intake__waiting [data-form="count"] {
      display: none;
    }
  }
}

.qm-draft {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.qm-draft .open-head__name {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.qm-draft .open-head__name .field {
  inline-size: 100%;
  min-inline-size: 0;
}

.qm-draft__status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin: 0;
  min-block-size: var(--target-min);
}

/* Idle, the status line says nothing and takes no height; it stays in the tree, being a live region. */
.qm-draft__status:empty {
  min-block-size: 0;
}

.qm-defaults__points.field {
  min-width: 0;
  inline-size: 6rem;
}

/* One card per question: an inset plane on the page ground, a long list of siblings. */
.qm-cards {
  margin-block-end: var(--space-4);
}

.qm-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  border-radius: var(--r-md);
  transition: border-color var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
}

.qm-card[data-selected] {
  border-color: var(--brand-border);
}

.qm-card[data-invalid] {
  border-color: var(--danger-border);
}

.qm-card[data-dragging] {
  opacity: var(--opacity-muted);
}

.qm-card[data-over] {
  border-color: var(--brand);
}

.qm-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.qm-card__head .field {
  inline-size: auto;
  min-inline-size: 0;
  max-inline-size: 100%;
}

.qm-card__grip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-inline-size: var(--target-min);
  min-block-size: var(--target-min);
  color: var(--text-secondary);
  cursor: grab;
  touch-action: none;
}

.qm-card__n {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: var(--weight-strong);
}

.qm-card__tools {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-inline-start: auto;
}

/* The picture on the left, everything said about it on the right; one column on a phone. */
.qm-card__body {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: var(--space-4);
  align-items: start;
}

.qm-card__picture,
.qm-card__main {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-inline-size: 0;
}

/* Every card's picture in one frame, dropped or cut: the same bounds whatever its pixel size. */
.qm-card__picture .question-image--compact {
  max-inline-size: min(100%, 24rem);
  max-block-size: 16rem;
}

/* A card with no picture keeps no empty column: "add a picture" sits above the words. */
.qm-card__body[data-bare] {
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-2);
}

.qm-card__main textarea,
.qm-card__option .field {
  inline-size: 100%;
  min-inline-size: 0;
}

.qm-card__letters {
  flex-wrap: wrap;
}

.qm-card__filing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
  gap: var(--space-3);
  align-items: start;
}

.qm-card__filing .field {
  inline-size: 100%;
  min-inline-size: 0;
}

.qm-end {
  align-items: center;
  border-radius: var(--r-md);
}

.qm-end p {
  margin: 0;
}

/* The walked preview (test builder, 2026-11-12). The question lies on a desk that scrolls sideways
   once a larger size makes its sheet wider than the dialog; `.table-frame` around it shades the
   edge with more behind it. The sheet is scaled whole, and made wider by the same share, so the
   question keeps its own line breaks and a picture grows with its words. */
.qm-preview__desk {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border-radius: var(--r-md);
}

/* The desk's own edge clips an outside ring; drawn inside it instead, as the PDF reader's is. */
.qm-preview__desk:focus-visible {
  outline-offset: calc(var(--focus-ring-width) * -1);
}

.qm-preview__sheet {
  inline-size: calc(100% * var(--qm-preview-zoom, 1));
  zoom: var(--qm-preview-zoom, 1);
}

/* On the ground there is no glass behind these planes to draw their edge (`frontend/CLAUDE.md`). */
[data-family="glass"] .qm-card,
[data-family="glass"] .qm-block,
[data-family="glass"] .qm-intake,
[data-family="glass"] .qm-end,
[data-family="glass"] .qm-draft {
  border-color: var(--border);
}

[data-family="glass"] .qm-card[data-selected],
[data-family="glass"] .qm-intake[data-over] {
  border-color: var(--brand-border);
}

[data-family="glass"] .qm-card[data-invalid] {
  border-color: var(--danger-border);
}

@media (max-width: 720px) {
  .qm-card__body {
    grid-template-columns: minmax(0, 1fr);
  }

  .qm-draft {
    grid-template-columns: minmax(0, 1fr);
  }

  /* On a phone a source's name takes its own line, its two actions under it. */
  .qm-intake__item {
    flex-wrap: wrap;
  }

  .qm-intake__name {
    flex: 1 1 100%;
  }

  /* On a phone the draft's switcher takes its own line, at full width, and is read whole. */
  .qm-draft .row > .field,
  .qm-draft .row > .combo {
    flex: 1 1 100%;
    min-inline-size: 0;
    max-inline-size: 100%;
  }

  .qm-card__tools {
    margin-inline-start: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .qm-card,
  .qm-intake {
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   The print page: the settings beside the paper they make (print sets, 2026-11-09).
   The paper's own look is `src/print/paper.css`; this is only where it sits.
   -------------------------------------------------------------------------- */

.print-bench {
  display: grid;
  grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
}

.print-bench__settings {
  position: sticky;
  inset-block-start: var(--space-4);
  max-block-size: calc(100dvh - 2 * var(--space-4));
  overflow-y: auto;
}

.print-bench__paper {
  min-inline-size: 0;
}

@media (max-width: 62rem) {
  .print-bench {
    grid-template-columns: minmax(0, 1fr);
  }

  .print-bench__settings {
    position: static;
    max-block-size: none;
  }
}

/* The answer sheets (independent teacher test maker, part 4, 2026-11-10): the print bench above, its
   paper, and the rows of letter chips the key and the review share. Tokens only; the sheet itself is
   `print/AnswerSheetPaper.tsx`, black on white like every paper. */

.as-preview svg {
  display: block;
  inline-size: 100%;
  block-size: auto;
}

.as-rows {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: var(--space-1) var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.as-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  min-inline-size: 0;
  padding: var(--space-1);
  border-radius: var(--r-sm);
}

/* A row the reader could not decide: a fill, an edge and a word, never the colour alone. */
.as-row[data-attention] {
  background: var(--warning-subtle);
  box-shadow: inset 0 0 0 1px var(--warning-border);
}

.as-row__no {
  inline-size: 3ch;
  text-align: end;
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-strong);
  color: var(--text-secondary);
}

.as-row__flag {
  color: var(--warning-text);
}

.as-swatch {
  display: inline-block;
  inline-size: 0.9em;
  block-size: 0.9em;
  border-radius: var(--r-circle);
  vertical-align: -0.1em;
}

.as-camera video {
  display: block;
  inline-size: 100%;
  block-size: auto;
  border-radius: var(--r-md);
  background: var(--surface-sunken);
}

.as-queue {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.as-queue__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  inline-size: 100%;
  min-block-size: 2.75rem;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text);
  text-align: start;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}

.as-queue__item:hover {
  border-color: var(--border-strong);
}

.as-queue__item:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.as-queue__item[aria-current] {
  border-color: var(--brand-border);
  background: var(--brand-subtle);
}

.as-queue__label {
  min-inline-size: 0;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.as-review {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
}

@media (max-width: 48rem) {
  .as-review {
    grid-template-columns: minmax(0, 1fr);
  }
}

.as-review__heading {
  margin: 0;
  font-size: var(--text-md);
}

/* The page as it was straightened, and what was read drawn over it in the sheet's own millimetres. */
.as-picture {
  position: relative;
  overflow: hidden;
}

.as-picture img,
.as-record {
  display: block;
  inline-size: 100%;
  block-size: auto;
}

.as-overlay {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  pointer-events: none;
}

.as-overlay__read {
  fill: none;
  stroke: var(--success);
  stroke-width: 0.7;
}

.as-overlay__unclear {
  fill: var(--warning-subtle);
  fill-opacity: 0.45;
  stroke: var(--warning);
  stroke-width: 0.7;
}

/* --- the students' access codes as slips (/students/codes/print) -------------
   One slip per student, to print and cut apart. The dashed edge is the cut line and
   the only ink a slip adds; the code itself is the join code's own large setting.
   A slip never splits across a sheet, and what is not for paper - the students with
   no code yet, the count - stays on the screen.
   -------------------------------------------------------------------------- */
.code-slips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.code-slip {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-inline-size: 0;
  padding: var(--space-4);
  border: 1px dashed var(--border-strong);
  overflow-wrap: anywhere;
  break-inside: avoid;
}

.code-slip__code {
  align-self: flex-start;
  max-inline-size: 100%;
}

@media print {
  .code-slips__pending {
    display: none;
  }

  /* Three across on A4, whatever the window was when the page was sent to print. */
  .code-slips {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* A row's tick box on the student list. The label is the target: 24 px square around a native box
   that is about half that, so the box is hit without aiming. */
.row-pick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-inline-size: var(--target-min);
  min-block-size: var(--target-min);
  cursor: pointer;
}

/* The independent teacher's "Hesabım / Paketim" (owner, 2026-11-14): the owner's reference design,
   measured from its markup and rebuilt on this theme's tokens and glass. The package held leads in
   one card with its four usage tiles; the three packages follow as cards and end the page.

   The reference switches its columns on the WINDOW (640 / 768 / 1024px) with no sidebar beside it.
   Here a sidebar takes part of the window, so the same switches are made on the width the content
   actually has: the reference's own content widths at those breakpoints (34rem, 43rem, 57rem). */

/* A kept tab panel adds no box of its own: its cards stay children of the screen's stack. */
.it-panel:not([hidden]) {
  display: contents;
}

/* The Paket tab is taller than a window and Profil is not, so the window scrollbar came and went
   with the tab and the whole page slid sideways by its width. Its place is kept on this page. */
:root:has(.it-tabs) {
  /* The gutter is kept only on an element that scrolls, and the root's own overflow is visible. */
  overflow-y: auto;
  scrollbar-gutter: stable;
}

/* The tab strip as one pill: the open tab is a raised segment inside it. This page only. */
.it-tabs .table-frame {
  display: inline-flex;
  max-inline-size: 100%;
}

.it-tabs .tabs {
  gap: var(--space-1);
  margin: 0 0 var(--space-6);
  padding: var(--space-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
  background: var(--surface-1);
}

.it-tabs .tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-bottom: 0;
  border-radius: var(--r-xs);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.it-tabs .tab:hover:not(.tab--active) {
  color: var(--text);
}

.it-tabs .tab--active {
  background: var(--surface-3);
  color: var(--text);
  box-shadow: 0 var(--solid-shadow-1-y) var(--solid-shadow-1-blur) rgb(var(--shadow-rgb) / var(--solid-shadow-1-alpha));
}

.it-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.it-tab > svg {
  inline-size: var(--icon-sm);
  block-size: var(--icon-sm);
}

/* --- the package held ---------------------------------------------------- */

.it-current {
  container: it-current / inline-size;
  padding: var(--space-6);
}

@media (min-width: 48rem) {
  .it-current {
    padding: var(--space-7);
  }
}

.it-current__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.it-current__who {
  min-inline-size: 0;
}

.it-current__eyebrow {
  margin: 0;
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-secondary);
}

.it-current__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-block-start: var(--space-2);
}

.it-current__name {
  margin: 0;
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.it-current__ends {
  margin: var(--space-4) 0 0;
}

.it-current__dates {
  margin: var(--space-1) 0 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.it-usage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
  margin: var(--space-7) 0 0;
  padding: 0;
  list-style: none;
}

@container it-current (min-width: 34rem) {
  .it-usage {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container it-current (min-width: 57rem) {
  /* One row for all of them: four tiles as the reference, five once storage is counted. */
  .it-usage {
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  }
}

.it-usage__tile {
  display: flex;
  flex-direction: column;
  padding: var(--space-5);
  border-radius: var(--r-sm);
  min-inline-size: 0;
}

/* The reference draws each tile with a thin outline. A glass inset keeps no fill (owner,
   2026-10-18) and its edge follows the theme's edge strength, which can be zero, so the outline
   here is the theme's own border: still no fill, the material shows through. */
.it-usage__tile {
  border-color: var(--border);
}

.it-usage__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.it-usage__icon {
  display: inline-grid;
  place-items: center;
  inline-size: calc(var(--space-7) + var(--space-1));
  block-size: calc(var(--space-7) + var(--space-1));
  border-radius: var(--r-xs);
  background: var(--brand-subtle);
  color: var(--brand-text);
}

.it-usage__icon > svg {
  inline-size: var(--icon-sm);
  block-size: var(--icon-sm);
}

.it-usage__percent {
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

.it-usage__percent--warn {
  color: var(--warning-text);
}

.it-usage__percent--full,
.it-usage__full {
  color: var(--danger-text);
}

.it-usage__name {
  margin: var(--space-4) 0 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.it-usage__figure {
  margin: var(--space-1) 0 0;
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.it-usage__figure > strong {
  font-weight: inherit;
}

.it-usage__figure > span {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
}

.it-usage__tile .meter {
  margin-block-start: var(--space-3);
}

/* The theme's `.meter__fill` sizes a block; this one is a span, so it says so. The bar keeps the
   brand colour until the limit is reached, as in the reference: only the figure turns amber. */
.it-usage__fill {
  display: block;
}

.it-usage__fill--full {
  background: var(--danger);
}

.it-usage__full {
  margin: var(--space-2) 0 0;
  font-size: var(--text-xs);
}

/* --- the packages ---------------------------------------------------------- */

.it-plans {
  container: it-plans / inline-size;
  margin-block-start: var(--space-9);
}

.it-plans__head {
  text-align: center;
}

.it-plans__title {
  margin: 0;
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  line-height: 1.2;
}

.it-plans__word {
  color: var(--brand-text);
}

.it-plans__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
  margin: var(--space-8) 0 0;
  padding: 0;
  list-style: none;
}

/* 43rem, not the reference's 45: this page's margins are wider, and at a 768px window the reference
   already shows three across. */
@container it-plans (min-width: 43rem) {
  .it-plans__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.it-plan {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: calc(var(--space-6) + var(--space-1));
  min-inline-size: 0;
  transition: translate var(--dur-base) var(--ease-out);
}

.it-plan:hover {
  translate: 0 calc(var(--space-1) * -1);
}

@media (prefers-reduced-motion: reduce) {
  .it-plan {
    transition: none;
  }

  .it-plan:hover {
    translate: none;
  }
}

/* The lead package: a brand ring and its flag, sitting on the card's top edge. */
.it-plan--lead {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.it-plan__flag {
  position: absolute;
  inset-block-start: calc(var(--space-3) * -1);
  inset-inline-start: 50%;
  translate: -50% 0;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--r-pill);
  background: var(--brand);
  color: var(--text-on-brand);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  white-space: nowrap;
  max-inline-size: calc(100% - var(--space-6));
  overflow: hidden;
  text-overflow: ellipsis;
}

.it-plan__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.it-plan__name {
  margin: 0;
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  overflow-wrap: anywhere;
}

.it-plan__price {
  margin: var(--space-6) 0 0;
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.it-plan__price > span {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
}

.it-plan__limits {
  display: grid;
  align-content: start;
  flex: 1;
  gap: var(--space-3);
  margin: var(--space-6) 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-sm);
}

.it-plan__limits li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.it-plan__limits li > span > span {
  color: var(--text-secondary);
}

.it-plan__check {
  flex: none;
  inline-size: var(--icon-sm);
  block-size: var(--icon-sm);
  color: var(--brand-text);
}

.it-plan__foot {
  margin-block-start: var(--space-7);
}

.it-plan__action {
  inline-size: 100%;
}

/* --- the teacher's Profil tab (owner, 2026-11-15) ------------------------------------------
   The owner's reference rebuilt on this theme: a lead card with the picture, the name and the
   role, then the personal details as a three-column grid that ends on the save button. The
   columns switch on the card's own width, as the Paket tab's do. */

/* As the reference at every width it has: the picture and the words side by side, always; the
   button on their row once the card is wide enough (a 640px window there), under them before. */
.it-hero {
  container: it-hero / inline-size;
  padding: var(--space-6);
}

.it-hero__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-5);
}

.it-hero__actions {
  grid-column: 1 / -1;
}

@container it-hero (min-width: 30rem) {
  .it-hero__row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: var(--space-6);
  }

  .it-hero__actions {
    grid-column: auto;
  }
}

@media (min-width: 48rem) {
  .it-hero {
    padding: var(--space-7);
  }
}

.it-hero__avatar {
  position: relative;
  flex: none;
}

.it-hero__picture {
  display: grid;
  place-items: center;
  /* 80px on a phone, as the reference; the full 96px once the button joins the row. */
  inline-size: calc(var(--space-9) + var(--space-6));
  block-size: calc(var(--space-9) + var(--space-6));
  overflow: hidden;
  border: 1px solid var(--brand-border);
  border-radius: var(--r-md);
  background: var(--brand-subtle);
  color: var(--brand-text);
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
}

.it-hero__picture img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

/* The picture's own way in: the same file chooser as the button, sitting on its corner. */
.it-hero__camera {
  position: absolute;
  inset-block-end: calc(var(--space-2) * -1);
  inset-inline-end: calc(var(--space-2) * -1);
  display: grid;
  place-items: center;
  inline-size: var(--space-7);
  block-size: var(--space-7);
  border: 0;
  border-radius: var(--r-sm);
  background: var(--brand);
  color: var(--text-on-brand);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}

.it-hero__camera:hover {
  background: var(--brand-hover);
}

.it-hero__camera:active {
  background: var(--brand-active);
}

.it-hero__camera:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.it-hero__camera > svg {
  inline-size: var(--icon-sm);
  block-size: var(--icon-sm);
}

@container it-hero (min-width: 30rem) {
  .it-hero__name {
    font-size: var(--text-2xl);
  }

  .it-hero__picture {
    inline-size: var(--avatar-2xl);
    block-size: var(--avatar-2xl);
  }
}

.it-hero__who {
  display: grid;
  gap: var(--space-1);
  min-inline-size: 0;
}

.it-hero__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

.it-hero__name {
  margin: 0;
  /* Smaller on a phone, as the reference sets it there; full size once the button joins the row. */
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.it-hero__role {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--brand-border);
  border-radius: var(--r-pill);
  background: var(--brand-subtle);
  color: var(--brand-text);
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
}

.it-hero__role > svg {
  inline-size: var(--icon-xs);
  block-size: var(--icon-xs);
}

.it-hero__lead {
  margin: var(--space-1) 0 0;
  color: var(--text-secondary);
}

.it-hero__formats {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.it-hero__progress {
  margin-block-start: var(--space-2);
  max-inline-size: 16rem;
}

.it-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.it-hero__actions .btn {
  white-space: nowrap;
}

.it-hero__actions .btn > svg,
.it-details__foot .btn > svg {
  inline-size: var(--icon-sm);
  block-size: var(--icon-sm);
}

/* --- the details card -------------------------------------------------------- */

.it-details {
  container: it-details / inline-size;
  margin-block-start: var(--space-6);
  padding: var(--space-6);
}

@media (min-width: 48rem) {
  .it-details {
    padding: var(--space-7);
  }
}

.it-details__head {
  padding-block-end: var(--space-6);
  border-block-end: 1px solid var(--border-subtle);
}

.it-details__heading {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.it-details__icon {
  display: inline-grid;
  flex: none;
  place-items: center;
  inline-size: calc(var(--space-7) + var(--space-1));
  block-size: calc(var(--space-7) + var(--space-1));
  border-radius: var(--r-xs);
  background: var(--brand-subtle);
  color: var(--brand-text);
}

.it-details__icon > svg {
  inline-size: var(--icon-sm);
  block-size: var(--icon-sm);
}

.it-details__title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
}

.it-details__lead {
  margin: var(--space-2) 0 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.it-details__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6) var(--space-5);
  margin-block-start: var(--space-6);
}

/* The reference's own switches, as card widths: two across at a 768px window (a 656px card
   inside; 38rem here so a 1024px window beside the menu, 637px inside, is two and not one), three at 1024px (895px inside). */
@container it-details (min-width: 38rem) {
  .it-details__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container it-details (min-width: 55rem) {
  .it-details__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* The reference's labels: small capitals above each field, on this card only. */
.it-details .form-field > .it-label-row .label,
.it-details .form-field > .label {
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-secondary);
}

.it-details .form-field,
.it-details .form-field .field {
  min-inline-size: 0;
}

.it-details .form-field .field {
  inline-size: 100%;
}

.it-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.it-required::after {
  content: ' *';
  color: var(--danger-text);
}

/* A field with a glyph inside it: the glyph sits in the padding, the text clears it. */
.it-input {
  position: relative;
  display: block;
}

.it-input__icon,
.it-input__trail {
  position: absolute;
  /* Above the field, which is a layer of its own on the page ground and hid it (2026-11-16). */
  z-index: 1;
  inset-block-start: 50%;
  translate: 0 -50%;
  inline-size: var(--icon-sm);
  block-size: var(--icon-sm);
  color: var(--text-tertiary);
  pointer-events: none;
}

.it-input__icon {
  inset-inline-start: var(--space-3);
}

.it-input__trail {
  inset-inline-end: var(--space-3);
}

.it-input--lead .field {
  padding-inline-start: calc(var(--space-3) * 2 + var(--icon-sm));
}

.it-input--trail .field {
  padding-inline-end: calc(var(--space-3) * 2 + var(--icon-sm));
}

.it-details__email {
  margin-block-start: var(--space-6);
}

.it-details__email .badge > svg {
  inline-size: var(--icon-xs);
  block-size: var(--icon-xs);
}

.it-details__note {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin: var(--space-2) 0 0;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.it-details__note > svg {
  flex: none;
  inline-size: var(--icon-xs);
  block-size: var(--icon-xs);
  margin-block-start: 0.2em;
}

.it-details__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-block-start: var(--space-6);
  padding-block-start: var(--space-5);
  border-block-start: 1px solid var(--border-subtle);
}

/* --- the teacher's Təhlükəsizlik tab (owner, 2026-11-15) -----------------------------------
   The owner's reference: the password card with its space counter and the two fields side by
   side, then the two-step card with its state as a dotted pill. The deletion stays the
   disclosure line it already was. */

.it-sec {
  container: it-sec / inline-size;
  padding: var(--space-6);
}

@media (min-width: 48rem) {
  .it-sec {
    padding: var(--space-7);
  }
}

/* The reference's air between the cards, and before the deletion line under them. */
.it-sec + .it-sec,
.it-sec + details {
  margin-block-start: var(--space-6);
}

.it-sec__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
}

.it-sec__title {
  margin: 0;
  /* One step smaller on a phone, as the profile's name, so a two-word title keeps one line. */
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
}

@container it-sec (min-width: 30rem) {
  .it-sec__title {
    font-size: var(--text-xl);
  }
}

.it-sec__counter {
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xs);
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.it-sec__counter--over {
  color: var(--danger-text);
}

.it-sec__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
  margin-block-start: var(--space-5);
}

/* Two across from the reference's 768px window (a 656px card inside) up. */
@container it-sec (min-width: 38rem) {
  .it-sec__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.it-sec__grid .form-field,
.it-sec__grid .field {
  min-inline-size: 0;
}

.it-sec__grid .form-field > .label {
  font-size: var(--text-sm);
  font-weight: var(--weight-strong);
  color: var(--text);
}

.it-sec__new {
  display: grid;
  gap: var(--space-2);
  min-inline-size: 0;
}

.it-sec__meter {
  margin-block-start: var(--space-1);
}

.it-sec__rule {
  margin: var(--space-5) 0 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.it-sec__foot {
  display: flex;
  justify-content: flex-end;
  margin-block-start: var(--space-5);
}

.it-sec__foot .btn > svg,
.it-sec .btn > svg {
  inline-size: var(--icon-sm);
  block-size: var(--icon-sm);
}

/* The two-step card's head: the state pill goes under the title when both do not fit, so the
   title keeps its line. */
.it-sec > .row--between {
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
}

/* The two-step card's state: a pill with a dot, amber while off, green once on. Not the colour
   alone: the word is in the pill. */
.it-sec__state {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
}

.it-sec__dot {
  inline-size: var(--space-2);
  block-size: var(--space-2);
  border-radius: var(--r-pill);
  background: var(--warning);
}

.it-sec__state--on .it-sec__dot {
  background: var(--success);
}

.it-sec__lead {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* The console's Audit page: the window it reads, with the four quick windows beside it. */
.audit-window {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--space-2) var(--space-3);
  margin-block: var(--space-3);
}

.audit-window__quick {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.audit-window__note {
  flex-basis: 100%;
  margin: 0;
}

/* Tənzimləmələr → Giriş limitləri (owner, 2026-11-13): plain for now; wide enough for six digits. */
.limits-input {
  inline-size: 9rem;
}

/* The console's log lists (owner, 2026-11-13): one line per entry - a coloured edge for how it
   ended, the exact time with "ago", what happened, chips for the details, a magnifier for the rest. */
.log-list {
  display: grid;
  padding: var(--space-1) var(--space-2);
}

.log-line {
  --log-tone: var(--text-tertiary);
  display: grid;
  grid-template-columns: 10.5rem minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3);
  border-block-end: 1px solid var(--border-subtle);
  border-inline-start: 3px solid color-mix(in oklab, var(--log-tone) 70%, transparent);
  border-radius: var(--r-xs);
}

.log-line:last-child {
  border-block-end: 0;
}

.log-line:hover {
  background: color-mix(in oklab, var(--log-tone) 6%, transparent);
}

.log-line--success { --log-tone: var(--success); }
.log-line--warning { --log-tone: var(--warning); }
.log-line--danger { --log-tone: var(--danger); }
.log-line--info { --log-tone: var(--brand); }
.log-line--muted { --log-tone: var(--text-tertiary); }

.log-line__at {
  display: grid;
  gap: 2px;
}

.log-line__body {
  display: grid;
  gap: var(--space-1);
  min-inline-size: 0;
}

.log-line__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-inline-size: 0;
  font-weight: 600;
}

.log-line__text,
.log-line__meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-mark {
  display: inline-grid;
  place-items: center;
  flex: none;
  inline-size: 20px;
  block-size: 20px;
  border-radius: 50%;
  color: var(--log-tone);
  background: color-mix(in oklab, var(--log-tone) 16%, transparent);
}

.log-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.log-chip {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-1);
  max-inline-size: 22rem;
  padding: 1px var(--space-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-pill);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-chip__label {
  color: var(--text-tertiary);
}

.log-line__status {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  justify-content: end;
}

.log-empty {
  padding: var(--space-4);
}

/* A list with columns of its own (Hərəkət's who-did-it and subscriber): every line shares the
   list's tracks through subgrid, so the columns stay aligned whatever each line's badge measures. */
.log-list--cols {
  container-type: inline-size;
  grid-template-columns: 10.5rem minmax(14rem, 1fr) repeat(var(--log-cols), minmax(8rem, 13rem)) auto auto;
}

.log-list--cols > .log-line {
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
}

/* On a wide list the cells are columns of the line itself. */
.log-line__cols {
  display: contents;
}

.log-head {
  padding-block: var(--space-1);
  border-inline-start-color: transparent;
}

.log-head:hover {
  background: none;
}

.log-line__cell {
  min-inline-size: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The heading names the column on a wide list; a narrow one has no heading row. */
.log-line__cell-label {
  display: none;
  margin-inline-end: var(--space-1);
}

/* Too narrow for columns: the cells fold under the entry as labelled values. */
@container (max-width: 56rem) {
  .log-list--cols > .log-line {
    grid-template-columns: 10.5rem minmax(0, 1fr) auto auto;
  }

  .log-head {
    display: none;
  }

  .log-line__at {
    grid-area: 1 / 1 / span 2 / 2;
  }

  .log-line__body {
    grid-area: 1 / 2;
  }

  .log-line__status {
    grid-area: 1 / 3 / span 2 / 4;
  }

  .log-line__open {
    grid-area: 1 / 4 / span 2 / 5;
  }

  .log-line__cols {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-4);
    grid-area: 2 / 2;
    min-inline-size: 0;
  }

  .log-line__cell-label {
    display: inline;
  }
}

@container (max-width: 34rem) {
  .log-list--cols > .log-line {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .log-line__at,
  .log-line__body,
  .log-line__status,
  .log-line__open,
  .log-line__cols {
    grid-area: auto;
  }

  .log-line__at,
  .log-line__status,
  .log-line__cols {
    grid-column: 1 / -1;
  }
}

/* A heading between two log blocks (Sistem's "İndiki vəziyyət") sat flush on the list below it. */
.aud-heading.log-heading {
  margin: var(--space-5) 0 var(--space-2);
}

.log-detail {
  display: grid;
  gap: var(--space-2);
  margin: 0;
}

.log-detail__row {
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr);
  gap: var(--space-3);
}

.log-detail__row dd {
  margin: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 40rem) {
  .log-line {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .log-line__at {
    grid-column: 1 / -1;
    grid-auto-flow: column;
    justify-content: start;
    gap: var(--space-2);
  }

  .log-line__status {
    grid-column: 1 / -1;
    justify-content: start;
  }

  .log-detail__row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* İmtahanlar is read again every fifteen seconds while on screen. */
.log-live {
  inline-size: 8px;
  block-size: 8px;
  border-radius: var(--r-pill);
  background: var(--success);
}

/* --- console spacing and hover (owner, 2026-11-14 review: "check for margin ... mouseover bg") ----- */

/* A Statistika card's title is its link (the card holds buttons, so it cannot be one); it reads as a
   title, and the card around it carries the pointer and the lift. */
.cdash__title-link {
  color: inherit;
  text-decoration: none;
}

.cdash__title-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cdash__title-link:focus-visible {
  outline: none;
  border-radius: var(--r-xs);
  box-shadow: var(--focus-ring);
}

/* A row of tools (export, open all) above the block it acts on, and a save row under a table. */
.log-tools,
.gset-tools {
  margin-block-end: var(--space-3);
}

.limits-actions {
  margin-block-start: var(--space-4);
}

/* Console tables light the row under the pointer, as the subscribers' table does. */
:is(.held-table, .del-table, .limits-table, .review-table) tbody tr {
  transition: background-color var(--dur-fast) var(--ease-out);
}

:is(.held-table, .del-table, .limits-table) tbody tr:hover {
  background: var(--surface-2);
}

/* Giriş limitləri on a narrow card: the description column may shrink; the range stays one line. */
.limits-table td:first-child {
  min-inline-size: 12rem;
}

@media (prefers-reduced-motion: reduce) {
  :is(.held-table, .del-table, .limits-table, .review-table) tbody tr {
    transition: none;
  }
}

/* Permanent deletion on a subscriber's or a person's page (owner, 2026-11-14): set apart by a
   danger-tinted edge, so it never reads as one more settings card. */
.del-zone {
  border-color: color-mix(in oklch, var(--danger) 45%, var(--border));
}

/* A support request's triage row: status, priority and the owner at EduAI, then Save at the end
   of the row - the choices are a draft until it is pressed (owner, 2026-11-14). */
.ticket-triage {
  align-items: flex-end;
}

.ticket-triage__save {
  margin-inline-start: auto;
}

/* --- the independent teacher's İmtahanlar (owner, 2026-11-15) -------------------------------
   The owner's reference on this theme: four counts lead, then one card with the state buttons,
   the search, the table and its pager. On a narrow card the table's three fact columns fold into
   a line under each title, so nothing scrolls sideways. */

.it-exams {
  container: it-exams / inline-size;
  display: grid;
  gap: var(--space-4);
}

/* THE TOP (owner, 2026-11-16): the counts in their row, and the search with "Yeni imtahan" in the
   second row under them, at every width. */
.it-exams__top {
  display: grid;
  gap: var(--space-3);
  min-inline-size: 0;
}

@container it-exams (min-width: 40rem) {
  .it-exams__top {
    gap: var(--space-4);
  }
}

.it-exams__tools {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-inline-size: 0;
}

.it-exams__new {
  flex: none;
}

.it-exams__new > svg {
  inline-size: var(--icon-sm);
  block-size: var(--icon-sm);
}

/* The counts: two across on a phone, four from a tablet up. */
.it-exams__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

@container it-exams (min-width: 40rem) {
  .it-exams__stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-4);
  }
}

/* A count card is a button: it shows only those exams. The pressed one carries a brand edge
   inside its own outline, so focus (outside) and pressed (inside) never hide each other. */
.it-stat {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  inline-size: 100%;
  block-size: 100%;
  padding: var(--space-4) var(--space-5);
  min-inline-size: 0;
  font: inherit;
  text-align: start;
}

.it-stat:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.it-stat[aria-pressed='true'] {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.it-stat[aria-pressed='true']:focus-visible {
  outline-offset: 2px;
}

.it-stat__icon {
  display: inline-grid;
  flex: none;
  place-items: center;
  inline-size: var(--space-8);
  block-size: var(--space-8);
  border-radius: var(--r-sm);
  background: var(--brand-subtle);
  color: var(--brand-text);
}

.it-stat__icon > svg {
  inline-size: var(--icon-md);
  block-size: var(--icon-md);
}

.it-stat--success .it-stat__icon {
  background: var(--success-subtle);
  color: var(--success-text);
}

.it-stat--warning .it-stat__icon {
  background: var(--warning-subtle);
  color: var(--warning-text);
}

.it-stat--neutral .it-stat__icon {
  background: var(--surface-2);
  color: var(--text-secondary);
}

.it-stat__text {
  display: grid;
  gap: var(--space-1);
  min-inline-size: 0;
}

.it-stat__label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.it-stat__value {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

/* THE TEACHER'S ROW MENU (owner, 2026-11-16, after a reference): the theme's glass material
   instead of the opaque popup, 14rem wide, roomy rows, and a hairline above the last group.
   It is portalled to the page, so it floats on its own and samples no glass of its own kind. */
/* Not the opaque .menu__panel: the material draws the fill, the rim and (as a floating surface) the
   shadow; this keeps only what the panel's layout needs. */
.it-menu {
  --lq-elevation: var(--lq-shadow);
  z-index: var(--z-dropdown);
  display: flex;
  flex-direction: column;
  /* As small as it reads (owner, 2026-11-16: "kartı kiçilt"), and never a scrollbar inside. */
  min-width: min(11rem, var(--menu-avail-inline, 11rem));
  gap: 0;
  padding: var(--space-1);
  border: 0;
  border-radius: var(--r-md);
  scrollbar-width: none;
  animation: it-menu-in var(--dur-fast) var(--ease-out);
}

/* The results' "Yüklə" drawn exactly as the account menu is (owner, 2026-11-17, "göndərdiyimin
   eynisi"): the same inner room, the same row height, corner and quiet ink as its entries. */
.it-menu--account {
  min-inline-size: 14rem;
  gap: var(--space-1);
  padding: var(--space-2);
}

.it-menu.it-menu--account .menu__item {
  display: flex;
  align-items: center;
  min-block-size: var(--control-md);
  padding: 0 var(--space-3);
  border-radius: var(--r-sm);
  color: var(--text-secondary);
}

.it-menu.it-menu--account .menu__item:hover,
.it-menu.it-menu--account .menu__item:focus-visible {
  color: var(--text);
}

.it-menu::-webkit-scrollbar {
  display: none;
}

/* Tight rows: 13px text, a 4px pad above and below, still well over the 24px target. */
.it-menu .menu__item {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--r-sm);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.it-menu .menu__item:hover,
.it-menu .menu__item:focus-visible {
  background: color-mix(in oklab, var(--text) 10%, transparent);
}

.it-menu .menu__item:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

/* The same look on a drawn select's list (the teacher's results choice, owner 2026-11-16, "bununla
   eyni dizaynda olsun"): the combobox's rows sized as the menu's, the keyboard's row marked as the
   menu's hover is. */
.it-menu.combo__list {
  border: 0;
}

/* ITS BLUR COMES BACK. The list's element sits inside the dialog's glass, so the theme's nested rule
   (`.mat .mat`) takes its backdrop filter away and turns it into the clear tier. But it is a popover
   in the top layer, painted over the dialog, not inside it: there is no glass under it of its own
   kind to sample, only the dialog's finished picture, as the row menu has the page's. So it gets the
   floating glass back - the same chain and tier the row menu computes. */
/* THE INDEPENDENT TEACHER'S POPUPS ARE ONE GLASS (owner, 2026-11-17: every menu, list and picker
   that opens over the page, the same as the row menu). `mat it-glass` on any popup panel: the
   material's own fill and shadow come back from under the panel's opaque popup look, with no edge.
   Every such panel is in the top layer, so its blur comes back too (the rule below).
   `it-glass--anchored` places a lifted topbar panel against its trigger from the variables
   `useTopLayerPanel` writes (`src/lib/topLayerGlass.ts`). */
.it-glass--anchored {
  position: fixed;
  inset: auto;
  inset-block-start: calc(var(--tl-top, 4rem) + var(--space-2));
  inset-inline-end: var(--tl-end, var(--space-4));
  margin: 0;
}

.it-glass--anchored.it-glass--start {
  inset-inline-end: auto;
  inset-inline-start: var(--tl-start, var(--space-4));
}

.it-glass--anchored[data-placement="above"] {
  inset-block-start: auto;
  inset-block-end: calc(var(--tl-bottom, 4rem) + var(--space-2));
}

/* The bell's panel had no padding of its own, so the popover's default would add one. */
.bell__panel.it-glass--anchored {
  padding: 0;
}

/* ⚠ IN THE APP LAYER, ON PURPOSE. This part of the file is unlayered, and there `revert-layer` hands
   back the app layer's own opaque popup fill (`.menu__panel`, `.bell__panel`, ...). Declared in the
   app layer, it skips those and lands on the material's glass fill and shadow. */
@layer eduai.app {
  .mat.it-glass {
    --lq-elevation: var(--lq-shadow);
    border-color: transparent;
    color: var(--text);
    background: revert-layer;
    box-shadow: revert-layer;
  }
}

/* The "i" panel as glass in the teacher's workspace (owner, 2026-11-16): the material's own fill and
   shadow come back from under the opaque popup's (`revert-layer` hands them to the material layer),
   floating as a menu does. */
.info-tip__panel.it-tip {
  --lq-elevation: var(--lq-shadow);
  border: 0;
  background: revert-layer;
  box-shadow: revert-layer;
}

[data-family="glass"] .mat .mat.it-glass,
[data-family="glass"] .mat .it-toast--layer .it-toast__card.mat,
[data-family="glass"] .mat .info-tip__panel.mat.it-tip,
[data-family="glass"] .mat .combo__list.mat.it-menu {
  backdrop-filter:
    blur(calc(max(var(--glass-blur) * var(--lq-blur-scale, 1), var(--lq-blur-floor, 0px)) * (1 - var(--a11y-reduce-transparency) * 0.999)))
    saturate(var(--glass-saturate))
    brightness(var(--glass-brightness))
    contrast(var(--glass-contrast));
  --glass-nested-mult: 0;
  --lq-tier: 0.5125;
  --lq-wash-on: 0;
}

/* Shut is shut: the menu's own `display: flex` comes later than the list's `display: none`, and a
   closed list was left on the field as an empty bar. */
.it-menu.combo__list:not(:popover-open) {
  display: none;
}

.it-menu .combo__option {
  padding: var(--space-1) var(--space-3);
  line-height: 1.5;
}

.it-menu .combo__option--active,
.it-menu .combo__option--active.combo__option--chosen {
  background: color-mix(in oklab, var(--text) 10%, transparent);
}

.it-menu__sep {
  block-size: 1px;
  margin: calc(var(--space-1) / 2) calc(var(--space-1) * -1);
  background: color-mix(in oklab, var(--text) 15%, transparent);
}

@keyframes it-menu-in {
  from {
    opacity: 0;
    transform: translateY(calc(var(--space-1) * -1)) scale(0.98);
  }
}

@media (prefers-reduced-motion: reduce) {
  .it-menu {
    animation: none;
  }
}

/* THE FLOATING NOTICE (owner, 2026-11-16): a menu act's result comes down from the top, under the
   bar, over the page - the cards and the table do not move - and its X closes it. */
.it-toast {
  position: fixed;
  z-index: var(--z-toast);
  inset-block-start: calc(var(--shell-gutter, var(--space-3)) + var(--shell-topbar, var(--space-10)) + var(--space-3));
  inset-inline: var(--space-4);
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}

.it-toast__card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  inline-size: min(28rem, 100%);
  padding: var(--space-2);
  pointer-events: auto;
  animation: it-toast-in var(--dur-base) var(--ease-out);
}

.it-toast__body {
  flex: 1 1 auto;
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

.it-toast__body .alert {
  margin: 0;
}

/* The same notice as a top-layer popover (`FloatingNotice`), so it floats over a dialog too: the
   popover's own box is taken off, and it is pinned to the top only. */
.it-toast--layer {
  inset-block-end: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  overflow: visible;
  inline-size: auto;
  block-size: auto;
  color: var(--text);
}

.it-toast--layer:not(:popover-open) {
  display: none;
}

.it-toast--layer:popover-open {
  display: flex;
}

/* Centred on the notice's height, not pinned to its top (owner, 2026-11-16). */
.it-toast__close {
  flex: none;
  align-self: center;
}

@keyframes it-toast-in {
  from {
    opacity: 0;
    transform: translateY(calc(var(--space-4) * -1));
  }
}

/* A success that closes itself goes back the way it came (owner, 2026-11-19); the X closes at once. */
.it-toast__card[data-leaving] {
  animation: it-toast-out var(--dur-exit) var(--ease-in-out) forwards;
}

@keyframes it-toast-out {
  to {
    opacity: 0;
    transform: translateY(calc(var(--space-4) * -1));
  }
}

@media (prefers-reduced-motion: reduce) {
  .it-toast__card,
  .it-toast__card[data-leaving] {
    animation: none;
  }
}

/* --- the board ------------------------------------------------------------------ */

.it-exams__board {
  container: it-board / inline-size;
  display: grid;
  gap: var(--space-4);
  padding: var(--space-4);
  min-inline-size: 0;
}

@media (min-width: 48rem) {
  .it-exams__board {
    padding: var(--space-5);
  }
}

.it-exams__search {
  flex: 1 1 auto;
  min-inline-size: 0;
}

.it-exams__search .field {
  inline-size: 100%;
}

.it-exams__none {
  margin: 0;
  padding: var(--space-6) 0;
  text-align: center;
  color: var(--text-secondary);
}

/* The table: a tinted head, a hairline between rows. */
.it-exams__table {
  inline-size: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-sm);
}

.it-exams__table th {
  padding: var(--space-3);
  background: var(--surface-2);
  color: var(--text-secondary);
  font-weight: var(--weight-medium);
  text-align: start;
  white-space: nowrap;
}

.it-exams__table th:first-child {
  border-start-start-radius: var(--r-xs);
  border-end-start-radius: var(--r-xs);
}

.it-exams__table th:last-child {
  border-start-end-radius: var(--r-xs);
  border-end-end-radius: var(--r-xs);
}

.it-exams__table td {
  padding: var(--space-2) var(--space-3);
  border-block-end: 1px solid var(--border-subtle);
  vertical-align: middle;
  white-space: nowrap;
}

.it-exams__table tbody tr:last-child td {
  border-block-end: 0;
}

.it-exams__table tbody tr:hover td {
  background: var(--surface-1);
}

.it-exams__actions-head,
.it-exams__actions {
  text-align: end;
}

/* The cell stays a table cell; its two buttons line up inside it. */
.it-exams__actions-in {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.it-exam__name {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-inline-size: 0;
}

.it-exam__icon {
  display: inline-grid;
  flex: none;
  place-items: center;
  inline-size: var(--space-7);
  block-size: var(--space-7);
  border-radius: var(--r-xs);
  background: var(--brand-subtle);
  color: var(--brand-text);
}

.it-exam__icon > svg {
  inline-size: var(--icon-sm);
  block-size: var(--icon-sm);
}

.it-exam__words {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  min-inline-size: 0;
  white-space: normal;
}

/* The exam's title is a button of one width, whatever the title (owner, 2026-11-17). Its states
   are the secondary button's own. */
.it-exam__open {
  /* One width for every row; on a narrow window that one width is smaller, so the table does not
     grow sideways for it. */
  inline-size: clamp(9rem, 18vw, 14rem);
  max-inline-size: 100%;
  justify-content: flex-start;
  font-weight: var(--weight-strong);
}

.it-exam__open-text {
  min-inline-size: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The facts line under a title: only where the columns that hold them are folded away. */
.it-exam__meta {
  display: none;
  flex-basis: 100%;
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.it-exam__narrow-state {
  display: none;
  flex-basis: 100%;
}

/* The state pill: a dot in the state's colour and the word, never the colour alone. */
/* One size for every state (owner, 2026-11-16): wide enough for the longest Azerbaijani and English
   word (Dayandırılıb, Scheduled), the dot and word centred in it. */
.it-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-inline-size: 7rem;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
}

.it-state__dot {
  inline-size: var(--space-2);
  block-size: var(--space-2);
  border-radius: var(--r-pill);
  background: var(--text-tertiary);
}

.it-state--Active {
  border-color: var(--success-border);
  background: var(--success-subtle);
  color: var(--success-text);
}

.it-state--Active .it-state__dot {
  background: var(--success);
}

.it-state--Draft,
.it-state--Paused {
  border-color: var(--warning-border);
  background: var(--warning-subtle);
  color: var(--warning-text);
}

.it-state--Draft .it-state__dot,
.it-state--Paused .it-state__dot {
  background: var(--warning);
}

.it-state--Scheduled {
  border-color: var(--brand-border);
  background: var(--brand-subtle);
  color: var(--brand-text);
}

.it-state--Scheduled .it-state__dot {
  background: var(--brand);
}

/* A quiet square button for one icon: the row's eye and the pager's arrows. */
.it-icon-btn {
  display: inline-grid;
  place-items: center;
  inline-size: var(--space-7);
  block-size: var(--space-7);
  padding: 0;
  border: 0;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.it-icon-btn:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}

.it-icon-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.it-icon-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.it-icon-btn > svg {
  inline-size: var(--icon-md);
  block-size: var(--icon-md);
}

.it-exams__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
}

.it-pager {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.it-pager__page {
  min-inline-size: var(--space-7);
  min-block-size: var(--space-7);
  padding: 0 var(--space-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--text-secondary);
  font-weight: var(--weight-strong);
  cursor: pointer;
}

.it-pager__page:hover {
  background: var(--surface-2);
  color: var(--text);
}

.it-pager__page:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.it-pager__page[aria-current='page'] {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--text-on-brand);
}

/* A narrow card: the three fact columns fold into the line under each title. */
@container it-board (max-width: 40rem) {
  .it-exams__wide {
    display: none;
  }

  .it-exam__meta,
  .it-exam__narrow-state {
    display: block;
  }

  .it-exam__icon {
    display: none;
  }

  .it-exams__table td {
    padding-inline: var(--space-2);
  }

}

/* The row menu's trigger sits beside the eye as its equal on the teacher's board: the same quiet
   square, no ring of its own. Everywhere else it keeps its ring. */
.it-exams__actions .row-menu__trigger {
  inline-size: var(--space-7);
  block-size: var(--space-7);
  border-color: transparent;
  border-radius: var(--r-xs);
  color: var(--text-secondary);
}

.it-exams__actions .row-menu__trigger:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* THE TEACHER'S TABLES AS CARDS, LAID OUT (owner, 2026-11-17, "responsivliyin hamısını düzəlt").
   Stacked, a row read as one field a line, each figure pushed to the far edge: a class of four
   fields took a screen and the eye ran from side to side. In the teacher's workspace a stacked row
   is a grid: the first field (the name) and anything without a caption of its own (a checkbox, the
   row's buttons, its menu) take the whole line; the captioned fields share the line, as many as fit,
   each read from the start edge. The results roster keeps its own card (rules above). */
@media (max-width: 64rem) {
  .shell[data-kind="IndependentTeacher"] .meetings-list--tablet:not(.results-roster .meetings-list--tablet) .table tr {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 9rem), 1fr));
    gap: var(--space-1) var(--space-4);
    align-items: start;
  }

  .shell[data-kind="IndependentTeacher"] .meetings-list--tablet:not(.results-roster .meetings-list--tablet) .table td:is(:first-child, :not(:has(> .journal-cell__label))) {
    grid-column: 1 / -1;
  }

  .shell[data-kind="IndependentTeacher"] .meetings-list--tablet:not(.results-roster .meetings-list--tablet) .table td > .journal-cell__label {
    display: block;
    white-space: normal;
  }
}

@media (max-width: 40rem) {
  .shell[data-kind="IndependentTeacher"] .meetings-list:not(.meetings-list--tablet):not(.results-roster .meetings-list) .table tr {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 8rem), 1fr));
    gap: var(--space-1) var(--space-4);
    align-items: start;
  }

  .shell[data-kind="IndependentTeacher"] .meetings-list:not(.meetings-list--tablet):not(.results-roster .meetings-list) .table td:is(:first-child, :not(:has(> .journal-cell__label))) {
    grid-column: 1 / -1;
  }

  .shell[data-kind="IndependentTeacher"] .meetings-list:not(.meetings-list--tablet):not(.results-roster .meetings-list) .table td > .journal-cell__label {
    display: block;
    white-space: normal;
  }
}

/* The marking page's two orders swap in place: the browser must not move the page to keep a row of
   the hidden order in view (scroll anchoring), or the tabs slide under the pointer (owner, 2026-11-17). */
.marking-panels {
  overflow-anchor: none;
}
