/*
 * Accredora design system.
 * One file, no build step. Logical properties only, so the same rules serve LTR and RTL.
 * Order: tokens, base, layout shell, page furniture, controls, data display, charts, overlays, utilities, print.
 */

/* ── Tokens ─────────────────────────────────────────────────────────────────────────────── */

/* The light colours belong to the page (:root) and to any part of a dark page that keeps them
   (data-theme="light": a document as it will be printed or sent, a school's logo). */
:root,
[data-theme="light"] {
  /* Navy — the brand's dark colour. Headings, the sidebar, the focus ring, the standard's mark. */
  --ink-950: #0b1f2e;
  --ink-900: #102b3f;
  --ink-800: #102b3f;

  /* Teal — the one accent. Links, primary actions, selected states; #006861 is its hover. */
  --ink-700: #006861;
  --ink-600: #007f78;
  --ink-200: #b7e8e2;
  --ink-100: #d6efec;
  --ink-50: #eef7f6;

  /* Mist — surfaces */
  --paper: #f3f7f7;
  --surface: #ffffff;
  --sunken: #e9f0f0;
  --line: #dce6e7;
  --line-strong: #c5d3d5;
  --control-border: #7f949c;

  /* Text */
  --text: #233f50;
  --text-2: #526775;
  --text-3: #5e7482;
  --on-dark: #ffffff;
  --on-dark-2: #c9d6dd;
  --on-dark-3: #8fa7b5;
  --line-on-dark: rgba(255, 255, 255, 0.14);

  /* The standard's mark: navy on light surfaces, mint on navy. Means "the minimum" and nothing else. */
  --mark: #102b3f;
  --mark-text: #102b3f;
  --mark-on-dark: #52d4c0;

  /* Status. Always shown with an icon and a label. */
  --good-700: #17694f;
  --good-100: #e3f3ec;
  --warn-700: #9a4f06;
  --warn-100: #fdf0dc;
  --crit-700: #b02a37;
  --crit-100: #fce8ea;
  --info-700: #006861;
  --info-100: #e4f3f1;
  --neutral-700: #526775;
  --neutral-100: #ebf0f0;

  /* Chart series, in fixed order (validated for colour-vision deficiency on a white surface).
     The brand teal is not a series colour: it reads too close to grey next to the others. */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-muted: #7f949c;
  --grid: #e3e9ea;

  /* The measure */
  --meter-ok: #007f78;
  --meter-ok-track: #d6efec;
  --meter-warn: #b26a00;
  --meter-warn-track: #fbebcb;
  --meter-crit: #d03b3b;
  --meter-crit-track: #f8d7d7;
  --meter-mark: var(--mark);

  --shadow-float: 0 10px 28px rgba(16, 43, 63, 0.16), 0 1px 3px rgba(16, 43, 63, 0.1);
  --ring: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink-900);

  /* Roles some colours play twice. The dark appearance gives each its own value. */
  --navy: #102b3f;                 /* the brand's navy as a surface: the sidebar, the hero panel */
  --link: var(--ink-600);          /* teal as text */
  --link-hover: var(--ink-700);
  --accent-hover: #006861;         /* teal under white text, under the pointer */
  --good-fill: #17694f;            /* green under white text */
  --good-fill-hover: #11553f;
  --good-200: #b9e0cf;             /* the edges of tinted status areas */
  --warn-200: #f1d9ae;
  --crit-200: #f3c6cb;
  --tip-bg: #102b3f;               /* chart tooltips */
  --tip-text: #ffffff;
  --tip-text-2: #c9d6dd;
  --scrim: rgba(7, 24, 41, 0.45);  /* behind the open menu on small screens */
}

/* Type, shapes and sizes: the same in every appearance */
:root {
  /* Manrope carries Latin and Cyrillic only; Arabic script falls through to IBM Plex Sans Arabic. */
  --font-ui: "Manrope", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
  --font-display: "Manrope", "IBM Plex Sans Arabic", system-ui, sans-serif;

  --radius-1: 8px;   /* controls */
  --radius-2: 12px;  /* panels */
  --radius-3: 16px;  /* the one hero panel */
  --radius-btn: 10px;

  --sidebar-w: 252px;
  --topbar-h: 56px;
  --content-max: 1240px;

  --lh: 1.5;
}

/* Arabic-script interfaces set everything, Latin included, in IBM Plex Sans Arabic so one page keeps one rhythm. */
:root:lang(ar),
:root:lang(fa),
:root:lang(ur),
:root:lang(he) {
  --font-ui: "IBM Plex Sans Arabic", "Manrope", system-ui, -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
  --font-display: "IBM Plex Sans Arabic", "Manrope", system-ui, sans-serif;
  --lh: 1.7;
}

/* ── Base ───────────────────────────────────────────────────────────────────────────────── */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.875rem;
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink-900);
}

:lang(ar) :is(h1, h2, h3, h4) {
  letter-spacing: 0;
  line-height: 1.45;
}

p {
  margin: 0;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--link-hover);
}

img,
svg {
  max-inline-size: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--radius-1);
}

::selection {
  background: var(--ink-100);
}

.icon {
  flex: none;
  vertical-align: -0.18em;
}

/* arrows and chevrons point the other way in right-to-left pages */
[dir="rtl"] .icon--flip {
  transform: scaleX(-1);
}

/* a tick or a cross after a figure checked against a minimum (the portfolio) */
.icon--good {
  color: var(--good-700);
  margin-inline-start: 3px;
}

.icon--critical {
  color: var(--crit-700);
  margin-inline-start: 3px;
}

.skip-link {
  position: absolute;
  inset-inline-start: 12px;
  inset-block-start: -60px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-1);
}

.skip-link:focus {
  inset-block-start: 12px;
}

/* the hidden attribute wins over the display of a class (.btn, .field) */
[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ── Workspace shell ────────────────────────────────────────────────────────────────────── */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-block-size: 100vh;
}

.sidebar {
  position: sticky;
  inset-block-start: 0;
  block-size: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--navy);
  color: var(--on-dark-2);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  block-size: var(--topbar-h);
  padding-inline: 18px;
  color: var(--on-dark);
  text-decoration: none;
  flex: none;
}

.sidebar__brand:hover {
  color: var(--on-dark);
}

.brand-logo {
  display: block;
  flex: none;
  max-inline-size: 100%;
  block-size: auto;
}

.nav {
  flex: 1;
  padding: 6px 10px 16px;
}

.nav__group {
  margin-block-start: 14px;
}

.nav__group:first-child {
  margin-block-start: 0;
}

.nav__heading {
  padding: 4px 10px;
  font-size: 0.75rem;
  color: var(--on-dark-3);
}

.nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1px;
}

.nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-block-size: 34px;
  padding: 6px 10px;
  border-radius: var(--radius-1);
  color: var(--on-dark-2);
  text-decoration: none;
  line-height: 1.3;
}

.nav__item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--on-dark);
}

.nav__item[aria-current="page"] {
  background: rgba(255, 255, 255, 0.13);
  color: var(--on-dark);
  font-weight: 500;
}

.nav__item:focus-visible {
  box-shadow: 0 0 0 2px var(--on-dark);
}

.nav__num {
  flex: none;
  inline-size: 16px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--on-dark-3);
}

.nav__item[aria-current="page"] .nav__num {
  color: var(--on-dark);
}

/* the accreditation selector at the top of the sidebar: one workspace a line (DESIGN.md §4m) */
.workspaces {
  margin: 0 10px 10px;
  padding-block-end: 10px;
  border-block-end: 1px solid rgba(255, 255, 255, 0.12);
}

.workspaces__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.workspaces__list > li,
.workspaces__list form {
  margin: 0;
  min-inline-size: 0;
}

.workspaces__item {
  display: flex;
  align-items: center;
  gap: 10px;
  inline-size: 100%;
  min-block-size: 36px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-1);
  background: transparent;
  color: var(--on-dark-2);
  font: inherit;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}

.workspaces__item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--on-dark);
}

.workspaces__item.is-current {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.13);
  color: var(--on-dark);
}

.workspaces__item.is-locked {
  color: var(--on-dark-3);
}

.workspaces__item:focus-visible {
  box-shadow: 0 0 0 2px var(--on-dark);
  outline: none;
}

.workspaces__name {
  flex: none;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.workspaces__state {
  flex: 0 1 auto;
  min-inline-size: 0;
  margin-inline-start: auto;
  font-size: 0.75rem;
  color: var(--on-dark-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: end;
}

.workspaces__item.is-current .workspaces__state {
  color: var(--on-dark-2);
}

/* the accreditation a permission row of the matrix belongs to */
.tag--framework {
  margin-inline-start: 6px;
  padding-block: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  vertical-align: 1px;
}

/* the workspaces an assistant, a run or a draft of Accredora Intelligence belongs to (<x-ai.tags>, <x-ai.workspace>) */
.ai-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ai-tags--inline {
  display: inline-flex;
  margin-inline-start: 4px;
  vertical-align: 1px;
}

.ai-tag {
  display: inline-block;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.7;
  color: var(--text-2);
  white-space: nowrap;
}

/* the workspace the page is of: filled, so it is told apart by more than its colour */
.ai-tag.is-here {
  border-color: var(--ink-200);
  background: var(--ink-100);
  color: var(--ink-700);
}

.ai-card .ai-tags {
  margin-block-start: -2px;
}

.rows__side > .ai-tags {
  justify-content: flex-end;
  max-inline-size: 220px;
}

@media print {
  .ai-tag.is-here {
    background: none;
  }
}

/* a count in brackets after a menu title: what waits for the person's action there */
.nav__count {
  margin-inline-start: 4px;
  font-weight: 600;
  white-space: nowrap;
}

.nav__badge {
  margin-inline-start: auto;
  min-inline-size: 20px;
  padding-inline: 6px;
  border-radius: 10px;
  background: var(--on-dark);
  color: var(--navy);
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  line-height: 20px;
}

/* something new behind the entry (What's new): a quiet mark, not a count */
.nav__dot {
  margin-inline-start: auto;
  inline-size: 8px;
  block-size: 8px;
  border-radius: 50%;
  background: var(--mark-on-dark);
  flex: none;
}

.sidebar__foot {
  flex: none;
  padding: 12px 18px 16px;
  border-block-start: 1px solid var(--line-on-dark);
  font-size: 0.8125rem;
  color: var(--on-dark-3);
}

.sidebar__foot a {
  color: var(--on-dark-2);
}

.app__main {
  display: flex;
  flex-direction: column;
  min-inline-size: 0;
}

.topbar {
  position: sticky;
  inset-block-start: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  block-size: var(--topbar-h);
  padding-inline: 24px;
  background: var(--surface);
  border-block-end: 1px solid var(--line);
}

.topbar__school {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-inline-size: 0;
}

.topbar__spacer {
  flex: 1;
}

.topbar > form {
  flex: none;
}

.topbar .topbar__menu-btn {
  display: none;
}

.content {
  flex: 1;
  inline-size: 100%;
  min-inline-size: 0;
  max-inline-size: var(--content-max);
  margin-inline: auto;
  padding: 8px 24px 64px;
}

/* scrollable blocks must not widen their container on narrow screens; position: relative keeps
   absolutely positioned descendants (screen-reader-only text) inside the scrolling box */
.table-wrap,
.matrix-wrap,
.journey,
.tabs {
  position: relative;
  min-inline-size: 0;
  max-inline-size: 100%;
}

.content--narrow {
  max-inline-size: 820px;
}

.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 9px 24px;
  background: var(--warn-100);
  color: var(--warn-700);
  border-block-end: 1px solid var(--warn-200);
  font-size: 0.8125rem;
}

.banner--info {
  background: var(--info-100);
  color: var(--info-700);
  border-block-end-color: var(--ink-200);
}

.banner--crit {
  background: var(--crit-100);
  color: var(--crit-700);
  border-block-end-color: var(--crit-200);
}

.banner a {
  color: inherit;
  font-weight: 600;
}

/* what closes a banner sits at its end */
.banner__end {
  margin-inline-start: auto;
}

.banner .btn--icon {
  color: inherit;
}

@media (max-width: 960px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    z-index: 60;
    inline-size: min(86vw, 300px);
    translate: -105% 0;
    transition: translate 0.2s ease;
  }

  [dir="rtl"] .sidebar {
    translate: 105% 0;
  }

  .sidebar[data-open="true"] {
    translate: 0 0;
    box-shadow: var(--shadow-float);
  }

  .topbar {
    padding-inline: 14px;
  }

  .topbar .topbar__menu-btn {
    display: inline-flex;
  }

  .content {
    padding-inline: 14px;
  }

  .banner {
    padding-inline: 14px;
  }
}

@media (max-width: 640px) {
  /* a phone-wide top bar keeps the menu, the year, the bell and the account */
  .topbar {
    gap: 8px;
  }

  .topbar__school {
    display: none;
  }

  .topbar .menu > summary span:not(.avatar) {
    display: none;
  }

  /* the year gives way first: the help link, the bell and the account always fit beside it */
  .topbar > form {
    flex: 0 1 150px;
    min-inline-size: 0;
  }

  .topbar .select--sm {
    inline-size: 100%;
    min-inline-size: 0;
  }
}

.scrim {
  display: none;
}

.sidebar[data-open="true"] + .scrim {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 55;
  background: var(--scrim);
}

/* ── Page furniture ─────────────────────────────────────────────────────────────────────── */

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  padding-block: 22px 16px;
}

.page-head__text {
  min-inline-size: 0;
  max-inline-size: 72ch;
}

.page-title {
  font-size: 1.625rem;
  overflow-wrap: anywhere;   /* a long unbroken name wraps instead of running off the page */
}

.page-sub {
  margin-block-start: 4px;
  color: var(--text-2);
}

.page-head__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding-block-start: 16px;
  margin-block-end: -12px;
  font-size: 0.8125rem;
  color: var(--text-3);
}

.crumbs a {
  color: var(--text-2);
  text-decoration: none;
}

.crumbs a:hover {
  text-decoration: underline;
}

/* tabs that do not fit on one line go on to the next: a tab is never cut off out of sight at the
   end of a line (a bar that scrolled sideways hid its scrollbar, and with it the last tab on a
   narrow window or a zoomed page) */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0 2px;
  border-block-end: 1px solid var(--line-strong);
}

.tab {
  flex: none;
  padding: 9px 12px;
  margin-block-end: -1px;
  border-block-end: 2px solid transparent;
  color: var(--text-2);
  text-decoration: none;
  white-space: nowrap;
}

.tab:hover {
  color: var(--ink-900);
  border-block-end-color: var(--line-strong);
}

.tab[aria-current="page"] {
  color: var(--ink-900);
  font-weight: 600;
  border-block-end-color: var(--ink-600);
}

.tab:focus-visible {
  box-shadow: inset 0 0 0 2px var(--ink-900);
}

/* on a phone the wrapped rows stay short */
@media (max-width: 640px) {
  .tab {
    padding: 7px 10px;
  }
}

.tab__count {
  margin-inline-start: 6px;
  padding-inline: 6px;
  border-radius: 9px;
  background: var(--sunken);
  font-size: 0.75rem;
  font-weight: 500;
}

/* things waiting there for someone: the number stands out from the tab's text */
.tab__count--waiting {
  background: var(--ink-900);
  color: var(--surface);
  font-weight: 600;
}

.section {
  margin-block-start: 28px;
}

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-block-end: 10px;
}

.section__title {
  font-size: 1.125rem;
}

.section__note {
  color: var(--text-2);
  max-inline-size: 72ch;
}

.section__head + .section__note {
  margin-block: -4px 12px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-2);
}

.panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 12px 16px;
  border-block-end: 1px solid var(--line);
}

.panel__title {
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0;
}

.panel__body {
  padding: 16px;
}

.panel__body--flush {
  padding: 0;
}

.panel__foot {
  padding: 12px 16px;
  border-block-start: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.panel--dark {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--on-dark-2);
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

@media (min-width: 900px) {
  .grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .grid--aside {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}

.stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-content: start;
}

.stack--lg {
  gap: 24px;
}

/* a list laid out as a stack: no bullets, no indent */
ul.stack,
ol.stack {
  list-style: none;
  margin: 0;
  padding: 0;
}

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

.cluster--between {
  justify-content: space-between;
}

.muted {
  color: var(--text-3);
}

.small {
  font-size: 0.8125rem;
}

.strong {
  font-weight: 600;
}

.nowrap {
  white-space: nowrap;
}

.prose {
  max-inline-size: 72ch;
  font-size: 0.9375rem;
}

/* text that takes the direction of its own content (dir="auto"): it starts on its own side */
.prose[dir="auto"] {
  margin-inline-end: auto;
}

.prose > * + * {
  margin-block-start: 0.75em;
}

.prose h2,
.prose h3 {
  margin-block-start: 1.6em;
}

.prose ul,
.prose ol {
  padding-inline-start: 1.25em;
}

.prose li + li {
  margin-block-start: 0.3em;
}

/* ── Buttons ────────────────────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-block-size: 36px;
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-btn);
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.btn:hover {
  background: var(--paper);
  border-color: var(--control-border);
  color: var(--text);
}

.btn--primary {
  background: var(--ink-600);
  border-color: var(--ink-600);
  color: var(--on-dark);
}

.btn--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--on-dark);
}

.btn--good {
  background: var(--good-fill);
  border-color: var(--good-fill);
  color: var(--on-dark);
}

.btn--good:hover {
  background: var(--good-fill-hover);
  border-color: var(--good-fill-hover);
  color: var(--on-dark);
}

.btn--danger {
  color: var(--crit-700);
}

.btn--danger:hover {
  background: var(--crit-100);
  border-color: var(--crit-700);
  color: var(--crit-700);
}

.btn--quiet {
  border-color: transparent;
  background: transparent;
  color: var(--text-2);
}

.btn--quiet:hover {
  background: var(--sunken);
  border-color: transparent;
}

.btn--quiet.btn--danger {
  color: var(--crit-700);
}

.btn--on-dark {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--on-dark);
}

.btn--on-dark:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--on-dark);
  color: var(--on-dark);
}

.btn--sm {
  min-block-size: 30px;
  padding: 3px 10px;
  font-size: 0.8125rem;
}

.btn--lg {
  min-block-size: 46px;
  padding: 10px 22px;
  font-size: 1rem;
}

.btn--icon {
  inline-size: 36px;
  padding: 0;
}

.btn--icon.btn--sm {
  inline-size: 30px;
}

.btn--block {
  inline-size: 100%;
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link-btn--danger {
  color: var(--crit-700);
}

/* ── Forms ──────────────────────────────────────────────────────────────────────────────── */

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px 20px;
}

@media (min-width: 720px) {
  .form-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .field {
    grid-column: span 3;
  }

  .field--full {
    grid-column: 1 / -1;
  }

  .field--third {
    grid-column: span 2;
  }
}

.form-section {
  grid-column: 1 / -1;
  margin-block-start: 8px;
  padding-block-start: 16px;
  border-block-start: 1px solid var(--line);
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0;
}

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

/* a part of a form shown under the switch it depends on: its first heading keeps its rule */
.form-grid--within > .form-section:first-child {
  margin-block-start: 8px;
  padding-block-start: 16px;
  border-block-start: 1px solid var(--line);
}

.field {
  display: grid;
  gap: 5px;
  align-content: start;
  min-inline-size: 0;
}

.label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
}

.label__req {
  color: var(--crit-700);
  margin-inline-start: 2px;
}

.label__opt {
  color: var(--text-3);
  font-weight: 400;
  margin-inline-start: 4px;
}

.hint {
  font-size: 0.8125rem;
  color: var(--text-3);
}

.error {
  font-size: 0.8125rem;
  color: var(--crit-700);
}

.input,
.select,
.textarea {
  inline-size: 100%;
  min-block-size: 38px;
  padding: 7px 10px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-1);
  background: var(--surface);
  line-height: 1.4;
}

.textarea {
  min-block-size: 92px;
  resize: vertical;
  line-height: var(--lh);
}

.select {
  appearance: none;
  padding-inline-end: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234b5b70' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

[dir="rtl"] .select {
  background-position: left 10px center;
}

.select[multiple] {
  background-image: none;
  padding-inline-end: 10px;
  min-block-size: 120px;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--text-2);
}

.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  border-color: var(--ink-600);
  box-shadow: 0 0 0 3px var(--ink-100);
}

.input[aria-invalid="true"],
.select[aria-invalid="true"],
.textarea[aria-invalid="true"] {
  border-color: var(--crit-700);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--control-border);
}

.input--sm,
.select--sm {
  min-block-size: 32px;
  padding-block: 4px;
  font-size: 0.8125rem;
}

.input[type="file"] {
  padding: 5px;
}

.input-group {
  display: flex;
}

.input-group__tag {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  min-inline-size: 44px;
  padding-inline: 8px;
  border: 1px solid var(--control-border);
  border-inline-end: 0;
  border-start-start-radius: var(--radius-1);
  border-end-start-radius: var(--radius-1);
  background: var(--sunken);
  color: var(--text-2);
  font-size: 0.75rem;
  font-weight: 600;
}

.input-group .input,
.input-group .textarea {
  border-start-start-radius: 0;
  border-end-start-radius: 0;
}

.tr-inputs {
  display: grid;
  gap: 6px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
}

.check input {
  flex: none;
  inline-size: 16px;
  block-size: 16px;
  margin-block-start: 0.2em;
  accent-color: var(--ink-600);
}

.checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 6px 16px;
}

/* a choice made knowingly: every option on view, each with a line on what it means */
.choices-set {
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 8px;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-1);
  background: var(--surface);
  cursor: pointer;
}

.choice:hover {
  border-color: var(--text-2);
}

.choice input {
  flex: none;
  inline-size: 16px;
  block-size: 16px;
  margin-block-start: 0.2em;
  accent-color: var(--ink-600);
}

.choice:has(input:checked) {
  border-color: var(--ink-600);
  background: var(--ink-50);
  box-shadow: inset 0 0 0 1px var(--ink-600);
}

.choice:has(input:focus-visible) {
  box-shadow: inset 0 0 0 1px var(--ink-600), 0 0 0 3px var(--ink-100);
}

/* a choice that cannot be made now: still on view, with its reason */
.choice:has(input:disabled) {
  cursor: not-allowed;
  background: var(--sunken);
  opacity: 0.7;
}

.choices-set[aria-invalid="true"] .choice {
  border-color: var(--crit-700);
}

.choice__text {
  display: grid;
  gap: 2px;
}

.choice__label {
  font-weight: 600;
  color: var(--text);
}

.choice__hint {
  font-size: 0.8125rem;
  color: var(--text-2);
}

/* a small picture of each appearance on the account page: its own colours, whatever the page's */
.theme-sample {
  --sample-page: #f3f7f7;
  --sample-surface: #ffffff;
  --sample-edge: #dce6e7;
  --sample-text: #233f50;
  --sample-muted: #c5d3d5;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  inline-size: 100%;
  max-inline-size: 184px;
  block-size: 76px;
  margin-block-end: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  overflow: hidden;
}

.theme-sample--dark {
  --sample-page: #0e1a22;
  --sample-surface: #14232e;
  --sample-edge: #243847;
  --sample-text: #dbe5eb;
  --sample-muted: #31495a;
}

.theme-sample__side {
  background: #102b3f;
}

.theme-sample__page {
  padding: 10px;
  background: var(--sample-page);
}

.theme-sample__panel {
  display: grid;
  gap: 6px;
  align-content: start;
  block-size: 100%;
  padding: 8px;
  border: 1px solid var(--sample-edge);
  border-radius: 4px;
  background: var(--sample-surface);
}

.theme-sample__text {
  block-size: 4px;
  inline-size: 78%;
  border-radius: 2px;
  background: var(--sample-text);
}

.theme-sample__text--short {
  inline-size: 52%;
  background: var(--sample-muted);
}

.theme-sample__action {
  inline-size: 28px;
  block-size: 8px;
  border-radius: 3px;
  background: #007f78;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-block-start: 22px;
  padding-block-start: 16px;
  border-block-start: 1px solid var(--line);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 10px;
  margin-block: 14px;
}

.filters .field {
  gap: 3px;
}

.filters .input,
.filters .select {
  min-inline-size: 150px;
}

.filters__search {
  flex: 1 1 220px;
  max-inline-size: 340px;
}

.file-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  font-size: 0.8125rem;
}

/* ── Tables ─────────────────────────────────────────────────────────────────────────────── */

.table-wrap {
  overflow-x: auto;
  border-block-start: 1px solid var(--line-strong);
}

.panel .table-wrap {
  border-block-start: 0;
}

.table {
  inline-size: 100%;
  border-collapse: collapse;
}

.table th {
  padding: 9px 12px;
  border-block-end: 1px solid var(--line-strong);
  text-align: start;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  vertical-align: bottom;
}

.table th a {
  color: inherit;
  text-decoration: none;
}

.table th a:hover {
  text-decoration: underline;
}

.table td {
  padding: 10px 12px;
  border-block-end: 1px solid var(--line);
  vertical-align: top;
}

.table tbody tr:hover > td {
  background: var(--ink-50);
}

.table .num {
  text-align: end;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* the figure stays on one line; a note under it may wrap */
.table .num .table__sub {
  white-space: normal;
}

.table .center {
  text-align: center;
}

.table .actions {
  text-align: end;
  white-space: nowrap;
}

.table .actions > * + * {
  margin-inline-start: 4px;
}

.table__main {
  font-weight: 500;
  color: var(--ink-900);
  text-decoration: none;
}

a.table__main:hover {
  text-decoration: underline;
}

.table__sub {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-3);
}

.table--dense th,
.table--dense td {
  padding: 6px 10px;
}

.table__group > td,
.table__group > th {
  background: var(--sunken);
  font-weight: 600;
  color: var(--ink-900);
  border-block-end-color: var(--line-strong);
}

.table__total > td,
.table__total > th {
  font-weight: 600;
  border-block-start: 1px solid var(--line-strong);
  background: var(--paper);
}

.table__grand > td,
.table__grand > th {
  font-weight: 600;
  border-block-start: 2px solid var(--ink-900);
  border-block-end: 0;
}

.table--report th {
  white-space: normal;
  text-align: center;
  border-inline-start: 1px solid var(--line);
}

.table--report th:first-child,
.table--report td:first-child {
  text-align: start;
  border-inline-start: 0;
}

.table--report td {
  border-inline-start: 1px solid var(--line);
}

.table--sticky th:first-child,
.table--sticky td:first-child {
  position: sticky;
  inset-inline-start: 0;
  background: var(--surface);
  z-index: 1;
}

.cell-flag {
  color: var(--crit-700);
  font-weight: 600;
}

.cell-ok {
  color: var(--good-700);
}

/* a cell of sentences (a message, a reason): wide enough to read in a table that scrolls on a phone */
.table .cell-text {
  min-inline-size: 16rem;
}

/* a definition list laid out as label / value rows */
.facts {
  display: grid;
  grid-template-columns: minmax(120px, 34%) minmax(0, 1fr);
  margin: 0;
}

.facts dt,
.facts dd {
  margin: 0;
  padding: 8px 0;
  border-block-end: 1px solid var(--line);
  overflow-wrap: anywhere;   /* a long unbroken value (an address, a code) wraps instead of widening the page */
}

.facts dt {
  color: var(--text-2);
  padding-inline-end: 16px;
}

.facts > :nth-last-child(-n + 2) {
  border-block-end: 0;
}

/* list of rows separated by rules: the default way to show records */
.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  border-block-start: 1px solid var(--line-strong);
}

.rows > li {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px 16px;
  padding: 12px 4px;
  border-block-end: 1px solid var(--line);
}

.panel .rows {
  border-block-start: 0;
}

.panel .rows > li {
  padding-inline: 16px;
}

.panel .rows > li:last-child {
  border-block-end: 0;
}

.rows__main {
  flex: 1 1 320px;
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

.rows__title {
  font-weight: 500;
  color: var(--ink-900);
}

a.rows__title {
  text-decoration: none;
}

a.rows__title:hover {
  text-decoration: underline;
}

.rows__meta {
  font-size: 0.8125rem;
  color: var(--text-3);
}

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

/* a committee meeting in a list: the day first, as on a calendar leaf, then what it is about */
.meeting__date {
  flex: none;
  display: grid;
  justify-items: center;
  align-content: start;
  inline-size: 72px;
  padding-inline-end: 12px;
  border-inline-end: 1px solid var(--line);
  color: var(--ink-900);
  text-align: center;
  text-decoration: none;
}

.meeting__day {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.meeting__month {
  font-size: 0.75rem;
  color: var(--text-3);
}

.rows > li.meeting .rows__main {
  flex-basis: 200px;
}

/* names one under the other, inside a fact */
.names {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ── Status, tags, alerts ───────────────────────────────────────────────────────────────── */

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--neutral-100);
  color: var(--neutral-700);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}

/* a status that is a sentence (what a service still needs, what a provider said): it wraps on a narrow screen */
.status--long {
  align-items: flex-start;
  max-inline-size: 100%;
  white-space: normal;
}

.status--long > .icon {
  flex: none;
  margin-block-start: 3px;
}

.status--info {
  background: var(--info-100);
  color: var(--info-700);
}

.status--good {
  background: var(--good-100);
  color: var(--good-700);
}

.status--warning {
  background: var(--warn-100);
  color: var(--warn-700);
}

.status--critical {
  background: var(--crit-100);
  color: var(--crit-700);
}

.tag {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  font-size: 0.8125rem;
  color: var(--text-2);
  white-space: nowrap;
}

/* a faculty qualification code: SA, PA, SP, IP, A */
.code {
  display: inline-block;
  min-inline-size: 30px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--ink-100);
  color: var(--ink-700);
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: center;
}

.code--a {
  background: var(--neutral-100);
  color: var(--neutral-700);
}

.code--none {
  background: transparent;
  border: 1px dashed var(--control-border);
  color: var(--text-3);
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-1);
  background: var(--info-100);
  color: var(--ink-900);
}

.alert .icon {
  margin-block-start: 3px;
  color: var(--info-700);
}

.alert--good {
  border-color: var(--good-200);
  background: var(--good-100);
}

.alert--good .icon {
  color: var(--good-700);
}

.alert--warning {
  border-color: var(--warn-200);
  background: var(--warn-100);
}

.alert--warning .icon {
  color: var(--warn-700);
}

.alert--critical {
  border-color: var(--crit-200);
  background: var(--crit-100);
}

.alert--critical .icon {
  color: var(--crit-700);
}

.alert__body {
  flex: 1;
  min-inline-size: 0;
}

.alert__title {
  font-weight: 600;
}

.alert ul {
  margin: 4px 0 0;
  padding-inline-start: 18px;
}

.flash {
  margin-block-start: 16px;
}

.flash__close {
  flex: none;
  padding: 2px;
  border: 0;
  background: none;
  color: var(--text-2);
  cursor: pointer;
  border-radius: 4px;
}

.empty {
  display: grid;
  gap: 6px;
  justify-items: start;
  padding: 28px 4px;
  border-block-start: 1px solid var(--line-strong);
  border-block-end: 1px solid var(--line);
}

.panel .empty {
  border: 0;
  padding: 24px 16px;
}

.empty__title {
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0;
}

.empty__text {
  color: var(--text-2);
  max-inline-size: 60ch;
}

.empty .btn {
  margin-block-start: 6px;
}

.avatar {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 32px;
  block-size: 32px;
  border-radius: 50%;
  background: var(--ink-100);
  color: var(--ink-700);
  font-size: 0.75rem;
  font-weight: 600;
}

.avatar--lg {
  inline-size: 56px;
  block-size: 56px;
  font-size: 1.125rem;
}

/* a photo fills its round frame (avatar, portrait); the initials stand in without one */
.avatar:has(.avatar__img) {
  background: var(--sunken);
}

.avatar__img,
.portrait__img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* a name with its avatar in a list */
.person {
  display: flex;
  align-items: center;
  gap: 10px;
  min-inline-size: 0;
}

.person__text {
  min-inline-size: 0;
}

/* the photo at the head of a faculty file */
.portrait {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  inline-size: 72px;
  block-size: 72px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ink-100);
  color: var(--ink-700);
  font: inherit;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
}

.portrait--xl {
  inline-size: 168px;
  block-size: 168px;
  font-size: 3rem;
}

.portrait--edit {
  cursor: pointer;
}

.portrait--edit:hover .portrait__img {
  filter: brightness(0.92);
}

.portrait--edit:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.portrait__badge {
  position: absolute;
  inset-block-end: -2px;
  inset-inline-end: -2px;
  display: grid;
  place-items: center;
  inline-size: 28px;
  block-size: 28px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-2);
  box-shadow: 0 0 0 1px var(--line-strong);
}

.portrait--edit:hover .portrait__badge {
  color: var(--link);
}

.page-head--portrait {
  justify-content: flex-start;
  align-items: center;
}

.page-head--portrait .page-head__text {
  flex: 1 1 16rem;
  max-inline-size: none; /* it fills the line, so the actions keep their place at the end as on every page */
}

.page-head--portrait .page-sub {
  max-inline-size: 72ch;
}

.page-head__portrait {
  flex: none;
}

/* the photo editor of a faculty file (faculty-photo.js) */
.photo-editor {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.photo-editor__stage {
  position: relative;
  inline-size: 216px;
  block-size: 216px;
  border-radius: var(--radius-1);
  background: var(--sunken);
  overflow: hidden;
}

.photo-editor__stage.is-dropping {
  box-shadow: inset 0 0 0 2px var(--ink-600);
}

.photo-editor__canvas {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  cursor: grab;
  touch-action: none;
}

.photo-editor__canvas:active {
  cursor: grabbing;
}

.photo-editor__canvas:focus-visible {
  outline: none;
  box-shadow: none;
}

/* the ring goes round the stage: drawn on the canvas it is lost against a dark photo */
.photo-editor__stage:has(> .photo-editor__canvas:focus-visible) {
  box-shadow: var(--ring);
}

.photo-editor__current {
  display: grid;
  place-items: center;
  inline-size: 100%;
  block-size: 100%;
}

.photo-editor__controls {
  display: grid;
  gap: 14px;
  align-content: start;
  min-inline-size: 0;
}

.photo-editor__controls > .field {
  grid-column: auto; /* not the form grid's span */
}

.photo-editor__tools {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.photo-editor__zoom {
  display: flex;
  align-items: center;
  gap: 8px;
  inline-size: 100%;
  color: var(--text-2);
}

.photo-editor__zoom input {
  flex: 1;
  min-inline-size: 0;
  accent-color: var(--ink-600);
}

@media (max-width: 560px) {
  .photo-editor {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
  }

  .photo-editor__controls {
    justify-self: stretch;
  }

  /* on a phone the dialog's start button takes a line of its own, Cancel and Save stay together */
  .dialog__foot-start {
    flex-basis: 100%;
    justify-content: flex-start;
  }
}

.dialog__foot-start {
  margin-inline-end: auto;
}

/* ── Figures ────────────────────────────────────────────────────────────────────────────── */

/* a row of plain figures separated by rules (not cards) */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border-block: 1px solid var(--line-strong);
}

.stat {
  display: grid;
  gap: 2px;
  align-content: start;
  padding: 14px 18px;
  border-inline-start: 1px solid var(--line);
}

.stat:first-child {
  border-inline-start: 0;
  padding-inline-start: 4px;
}

.stat__label {
  font-size: 0.8125rem;
  color: var(--text-2);
}

.stat__value {
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink-900);
}

.stat__note {
  font-size: 0.8125rem;
  color: var(--text-3);
}

.stat__note a {
  color: inherit;
}

/* a figure that leads to the list narrowed to it; the narrowing in force is underlined like a tab */
.stat--link {
  color: inherit;
  text-decoration: none;
}

.stat--link:hover .stat__label {
  color: var(--ink-900);
  text-decoration: underline;
}

.stat--link:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.stat--link[aria-current="true"] {
  box-shadow: inset 0 -2px 0 var(--ink-600);
}

.stat--link[aria-current="true"] .stat__label {
  color: var(--ink-900);
  font-weight: 600;
}

.stat--critical .stat__value,
.stat--critical .stat__label .icon {
  color: var(--crit-700);
}

/* the first figure of a second group: a stronger rule before it */
.stat--group {
  border-inline-start-color: var(--line-strong);
}

.stat-caption {
  margin-block: 6px 0;
}

@media (max-width: 640px) {
  .stat-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat {
    min-inline-size: 0;
    padding-inline: 10px;
    border-block-end: 1px solid var(--line);
  }

  .stat:nth-child(odd) {
    border-inline-start: 0;
    padding-inline-start: 4px;
  }
}

@media (max-width: 480px) {
  .stat-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .stat {
    border-inline-start: 0;
    padding-inline-start: 4px;
  }
}

/* after the rules above: a list's figures: short numbers, so three to a line on a phone rather than one */
@media (max-width: 640px) {
  .stat-row--figures {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stat-row--figures .stat,
  .stat-row--figures .stat:nth-child(odd) {
    border-inline-start: 1px solid var(--line);
    padding-inline: 10px;
  }

  .stat-row--figures .stat:nth-child(3n + 1) {
    border-inline-start: 0;
    padding-inline-start: 4px;
  }
}

/* ── The measure ────────────────────────────────────────────────────────────────────────── */

.meter {
  --value: 0;
  --mark: 0;
  --fill: var(--meter-ok);
  --track: var(--meter-ok-track);
  display: grid;
  gap: 6px;
}

.meter--warning {
  --fill: var(--meter-warn);
  --track: var(--meter-warn-track);
}

.meter--critical {
  --fill: var(--meter-crit);
  --track: var(--meter-crit-track);
}

.meter__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.meter__label {
  font-weight: 500;
  color: var(--ink-900);
}

.meter__value {
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--ink-900);
  white-space: nowrap;
}

.meter__scale {
  position: relative;
  padding-block: 9px 16px;
}

.meter__track {
  block-size: 10px;
  background: var(--track);
  border-radius: 2px;
  overflow: hidden;
}

.meter__fill {
  block-size: 100%;
  inline-size: calc(min(var(--value), 100) * 1%);
  background: var(--fill);
  border-start-end-radius: 4px;
  border-end-end-radius: 4px;
}

/* the standard: a navy line across the track with a notch on top (mint on dark panels) */
.meter__mark {
  position: absolute;
  inset-block-start: 3px;
  inset-inline-start: calc(var(--mark) * 1%);
  inline-size: 2px;
  block-size: 22px;
  margin-inline-start: -1px;
  background: var(--meter-mark);
}

.meter__mark::before {
  content: "";
  position: absolute;
  inset-block-start: -1px;
  inset-inline-start: -4px;
  border: 5px solid transparent;
  border-block-start-color: var(--meter-mark);
  border-block-end: 0;
}

.meter__ticks {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 6px;
  block-size: 7px;
  background-image:
    repeating-linear-gradient(to right, var(--control-border) 0 1px, transparent 1px 25%),
    repeating-linear-gradient(to right, var(--line-strong) 0 1px, transparent 1px 5%);
  background-size: 100% 7px, 100% 4px;
  background-repeat: no-repeat;
  border-inline-end: 1px solid var(--control-border);
}

[dir="rtl"] .meter__ticks {
  background-image:
    repeating-linear-gradient(to left, var(--control-border) 0 1px, transparent 1px 25%),
    repeating-linear-gradient(to left, var(--line-strong) 0 1px, transparent 1px 5%);
}

.meter__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
  font-size: 0.8125rem;
  color: var(--text-2);
}

.meter__min {
  color: var(--mark-text);
  font-weight: 500;
  white-space: nowrap;
}

.meter--compact {
  gap: 2px;
}

.meter--compact .meter__scale {
  padding-block: 5px 5px;
}

.meter--compact .meter__track {
  block-size: 6px;
}

.meter--compact .meter__mark {
  inset-block-start: 1px;
  block-size: 14px;
}

.meter--compact .meter__mark::before {
  display: none;
}

.meter--compact .meter__ticks {
  display: none;
}

.meter--on-dark {
  --meter-ok: #52d4c0;
  --meter-ok-track: #1f5257;
  --meter-warn: #f0a63a;
  --meter-warn-track: #4a3a1c;
  --meter-crit: #ff8a8a;
  --meter-crit-track: #5a2630;
  --meter-mark: var(--mark-on-dark);
}

.meter--on-dark .meter__label,
.meter--on-dark .meter__value {
  color: var(--on-dark);
}

.meter--on-dark .meter__foot {
  color: var(--on-dark-2);
}

.meter--on-dark .meter__min {
  color: var(--mark-on-dark);
}

.meter--on-dark .meter__ticks {
  --control-border: rgba(255, 255, 255, 0.45);
  --line-strong: rgba(255, 255, 255, 0.22);
}

.meter-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.meter-list--ruled > * + * {
  padding-block-start: 16px;
  border-block-start: 1px solid var(--line);
}

/* simple progress (completeness, plan usage): no threshold */
.progress {
  --value: 0;
  block-size: 6px;
  background: var(--meter-ok-track);
  border-radius: 2px;
  overflow: hidden;
}

.progress__bar {
  block-size: 100%;
  inline-size: calc(min(var(--value), 100) * 1%);
  background: var(--meter-ok);
  border-start-end-radius: 3px;
  border-end-end-radius: 3px;
}

.progress--warning {
  background: var(--meter-warn-track);
}

.progress--warning .progress__bar {
  background: var(--meter-warn);
}

.progress--critical {
  background: var(--meter-crit-track);
}

.progress--critical .progress__bar {
  background: var(--meter-crit);
}

/* ── Charts (server-rendered SVG) ───────────────────────────────────────────────────────── */

.chart {
  margin: 0;
}

.chart__title {
  font-weight: 600;
  color: var(--ink-900);
}

.chart__sub {
  font-size: 0.8125rem;
  color: var(--text-2);
}

.chart__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-block: 8px 4px;
  padding: 0;
  list-style: none;
  font-size: 0.8125rem;
  color: var(--text-2);
}

.chart__legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart__swatch {
  inline-size: 10px;
  block-size: 10px;
  border-radius: 2px;
  background: var(--series-1);
}

.chart__svg {
  display: block;
  inline-size: 100%;
  max-inline-size: 820px;
  block-size: auto;
  overflow: visible;
}

.chart__svg text {
  font-family: var(--font-ui);
  font-size: 11px;
  fill: var(--text-3);
}

.chart__svg .chart__value {
  fill: var(--text);
  font-weight: 600;
}

.chart__grid {
  stroke: var(--grid);
  stroke-width: 1;
}

.chart__axis {
  stroke: var(--line-strong);
  stroke-width: 1;
}

.chart__mark {
  transition: opacity 0.12s;
}

.chart__svg:hover .chart__mark {
  opacity: 0.55;
}

.chart__svg .chart__mark:hover,
.chart__svg .chart__mark:focus {
  opacity: 1;
  outline: none;
}

.s1 { fill: var(--series-1); background: var(--series-1); }
.s2 { fill: var(--series-2); background: var(--series-2); }
.s3 { fill: var(--series-3); background: var(--series-3); }
.s4 { fill: var(--series-4); background: var(--series-4); }
.s5 { fill: var(--series-5); background: var(--series-5); }
.s0 { fill: var(--series-muted); background: var(--series-muted); }

/* the stress test (x-chart.stress): the values that take a ratio below its minimum, and the saved and simulated values */
.chart__risk {
  fill: var(--crit-100);
}

.chart__swatch--risk {
  background: var(--crit-100);
  border: 1px solid var(--crit-200);
}

/* the fan chart (x-chart.fan): the band of a range, and the line of its middle */
.chart__band {
  fill: var(--series-1);
  fill-opacity: 0.16;
  stroke: none;
}

.chart__swatch--band {
  opacity: 0.3;
}

.chart__swatch--line {
  block-size: 2px;
  inline-size: 14px;
}

.chart__marker {
  stroke: var(--text-3);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}

.chart__marker--tried {
  stroke: var(--text);
  stroke-width: 1.5;
  stroke-dasharray: none;
}

.chart__svg .chart__marker-label,
.chart__svg .chart__axis-title {
  fill: var(--text-2);
  font-weight: 500;
}

.chart__table tr.is-current td {
  font-weight: 600;
}

.chart__table {
  margin-block-start: 6px;
  font-size: 0.8125rem;
}

.chart__table summary {
  color: var(--text-2);
  cursor: pointer;
  inline-size: fit-content;
}

/* the donut (x-chart.donut) and its legend side by side, one under the other on a phone */
.chart-donut__body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
}

.chart-donut__svg {
  flex: none;
  max-inline-size: 100%;
  block-size: auto;
}

.chart-donut__legend {
  display: grid;
  flex: 0 1 320px;
  min-inline-size: min(100%, 200px);
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.8125rem;
}

.chart-donut__legend li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.chart-donut__label {
  color: var(--text-2);
  overflow-wrap: anywhere;
}

.chart-donut__share {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chart-donut__total {
  padding-block-start: 6px;
  border-block-start: 1px solid var(--line);
}

/* assurance of learning: one box per round of measurement; a course taught in sections opens to them */
.aol-rounds {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 20px;
}

.aol-round {
  inline-size: 150px;
}

.aol-round--sections {
  inline-size: 220px;
}

.aol-sections {
  margin-block-start: 4px;
  font-size: 0.8125rem;
}

.aol-sections summary {
  color: var(--text-2);
  cursor: pointer;
  inline-size: fit-content;
}

.aol-sections__short {
  color: var(--crit-700);
  font-weight: 600;
}

.aol-sections__list {
  display: grid;
  gap: 8px;
  margin: 6px 0;
  padding-block: 2px;
  padding-inline: 10px 0;
  border-inline-start: 2px solid var(--line);
  list-style: none;
}

.aol-sections__list .meter__label {
  font-weight: 400;
}

.aol-sections__list .meter__value {
  font-size: 1rem;
}

.aol-sections__name {
  font-weight: 500;
  color: var(--ink-900);
}

/* assessment tasks: how far a round has got, the setup table and the assessor's score sheet */
.aol-progress {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  margin-block-end: 12px;
}

.aol-progress .progress {
  inline-size: 160px;
}

.aol-setup input[type="checkbox"] {
  inline-size: 16px;
  block-size: 16px;
  accent-color: var(--ink-600);
}

.aol-setup .select {
  min-inline-size: 220px;
}

.aol-setup .is-muted td {
  color: var(--text-3);
}

.input--narrow {
  inline-size: 17ch;
}

/* the counts above the score sheet: five narrow figures on one line where the page allows */
.aol-tally {
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
}

.aol-tally .stat {
  padding-inline: 14px;
}

.aol-sheet {
  counter-reset: student;
}

.aol-sheet td {
  vertical-align: middle;
}

.aol-sheet tbody tr {
  counter-increment: student;
}

.aol-sheet__n {
  inline-size: 3ch;
  color: var(--text-3);
  text-align: end;
  font-variant-numeric: tabular-nums;
}

.aol-sheet tbody .aol-sheet__n::before {
  content: counter(student);
}

.aol-sheet .input {
  min-inline-size: 12ch;
}

.aol-sheet .aol-sheet__score {
  inline-size: 9ch;
  min-inline-size: 9ch;
}

.aol-sheet__level[data-level="exceeds"],
.aol-sheet__level[data-level="meets"] {
  color: var(--good-700);
}

.aol-sheet__level[data-level="below"] {
  color: var(--crit-700);
}

/* the changes listed under an entry of an improvement's history (the list itself is .history) */
.history__changes {
  display: grid;
  gap: 2px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  color: var(--text-2);
  font-size: 0.875rem;
}

.history__field {
  color: var(--text-3);
}

.form-note {
  margin: 0;
  color: var(--text);
}

/* the ways to fill the score sheet besides typing: import a file, paste a list */
.aol-fill {
  display: grid;
  gap: 4px;
  margin-block-end: 14px;
}

.aol-fill__way > summary {
  inline-size: fit-content;
  padding-block: 4px;
  color: var(--ink-700);
  font-weight: 500;
  cursor: pointer;
}

.aol-fill__body {
  display: grid;
  gap: 8px;
  margin-block: 6px 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-2);
  background: var(--paper);
}

.aol-fill__body > p {
  margin: 0;
}

.aol-import__pick {
  align-items: center;
}

.aol-import__file {
  inline-size: min(100%, 340px);
  background: var(--surface);
}

.aol-import__status[data-tone="critical"] {
  color: var(--crit-700);
}

.aol-import__status[data-tone="good"] {
  color: var(--good-700);
}

.aol-import {
  display: grid;
  gap: 10px;
  padding-block-start: 12px;
  border-block-start: 1px solid var(--line);
}

.aol-import__name {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--ink-900);
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* two choices a row where there is room: where the list is (sheet, headings), then its columns */
.aol-import__choices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 10px 14px;
}

.aol-import__choices .field {
  grid-column: auto; /* not the form grid's span */
}

.aol-import__preview {
  background: var(--surface);
}

.aol-import p {
  margin: 0;
}

.facts--stacked {
  grid-template-columns: minmax(0, 1fr);
}

.facts--stacked dt {
  padding-block-end: 0;
  border-block-end: 0;
  font-size: 0.8125rem;
}

.facts--stacked dd {
  padding-block-start: 2px;
}

.prewrap {
  white-space: pre-line;
}

/* horizontal 100% stacked bar */
.stackbar {
  display: flex;
  gap: 2px;
  block-size: 16px;
}

.stackbar__seg {
  min-inline-size: 2px;
  block-size: 100%;
}

.stackbar__seg:first-child {
  border-start-start-radius: 3px;
  border-end-start-radius: 3px;
}

.stackbar__seg:last-child {
  border-start-end-radius: 3px;
  border-end-end-radius: 3px;
}

.tooltip {
  position: fixed;
  z-index: 90;
  max-inline-size: 260px;
  padding: 6px 10px;
  border-radius: var(--radius-1);
  background: var(--tip-bg);
  color: var(--tip-text);
  font-size: 0.8125rem;
  line-height: 1.4;
  pointer-events: none;
  box-shadow: var(--shadow-float);
}

.tooltip[hidden] {
  display: none;
}

.tooltip__value {
  font-weight: 600;
}

.tooltip__label {
  color: var(--tip-text-2);
}

/* ── Sequences: journey and history ─────────────────────────────────────────────────────── */

.journey {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(132px, 1fr);
  overflow-x: auto;
  padding-block-end: 4px;
}

.journey__step {
  position: relative;
  padding: 26px 12px 0 0;
  padding-inline: 0 12px;
  font-size: 0.8125rem;
}

.journey__step::before {
  content: "";
  position: absolute;
  inset-block-start: 8px;
  inset-inline: 0;
  block-size: 2px;
  background: var(--line-strong);
}

.journey__step::after {
  content: "";
  position: absolute;
  inset-block-start: 2px;
  inset-inline-start: 0;
  inline-size: 14px;
  block-size: 14px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--control-border);
}

.journey__step--done::before {
  background: var(--ink-600);
}

.journey__step--done::after {
  background: var(--ink-600);
  border-color: var(--ink-600);
}

.journey__step--current::after {
  border-color: var(--ink-600);
  box-shadow: 0 0 0 4px var(--ink-100);
}

.journey__title {
  font-weight: 600;
  color: var(--ink-900);
}

.journey__date {
  color: var(--text-3);
}

.history {
  list-style: none;
  margin: 0;
  padding: 0;
}

.history > li {
  position: relative;
  padding-block-end: 16px;
  padding-inline-start: 28px;
}

.history > li::before {
  content: "";
  position: absolute;
  inset-block: 20px 0;
  inset-inline-start: 8px;
  inline-size: 1px;
  background: var(--line-strong);
}

.history > li:last-child::before {
  display: none;
}

.history__dot {
  position: absolute;
  inset-block-start: 2px;
  inset-inline-start: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  inline-size: 18px;
  block-size: 18px;
  border-radius: 50%;
  background: var(--neutral-100);
  color: var(--neutral-700);
}

.history__dot--good {
  background: var(--good-100);
  color: var(--good-700);
}

.history__dot--warning {
  background: var(--warn-100);
  color: var(--warn-700);
}

.history__dot--critical {
  background: var(--crit-100);
  color: var(--crit-700);
}

.history__dot--info {
  background: var(--info-100);
  color: var(--info-700);
}

.history__what {
  font-weight: 500;
  color: var(--ink-900);
}

.history__meta {
  font-size: 0.8125rem;
  color: var(--text-3);
}

.history__comment {
  margin-block-start: 6px;
  padding: 8px 12px;
  border-inline-start: 2px solid var(--line-strong);
  background: var(--paper);
  color: var(--text);
  white-space: pre-line;
}

/* a conversation (a support request's, a CRM task's): entries under a rule, like the rest of the lists, the oldest first */
.thread {
  list-style: none;
  margin: 0;
  padding: 0;
  border-block-start: 1px solid var(--line-strong);
}

.thread__item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  padding: 16px 4px;
  border-block-end: 1px solid var(--line);
}

.thread__main {
  min-inline-size: 0;
}

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

.thread__who {
  font-weight: 600;
  color: var(--ink-900);
}

.thread__time {
  margin-inline-start: auto;
  font-size: 0.8125rem;
  color: var(--text-3);
  white-space: nowrap;
}

.thread__body {
  max-inline-size: 72ch;
  margin-block-start: 6px;
  overflow-wrap: anywhere;
}

.thread__files {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.8125rem;
}

.thread__files a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* the box to write in under a conversation */
.composer {
  margin-block-start: 18px;
  display: grid;
  gap: 14px;
}

/* steps of a workflow shown inline: 1 Chair review > 2 Committee approval */
.steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 4px;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.8125rem;
}

.steps__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 4px;
  padding-inline: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  color: var(--text-2);
  background: var(--surface);
}

.steps__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 18px;
  block-size: 18px;
  border-radius: 50%;
  background: var(--sunken);
  font-size: 0.75rem;
  font-weight: 600;
}

.steps__item--done {
  border-color: var(--good-200);
  color: var(--good-700);
}

.steps__item--done .steps__num {
  background: var(--good-100);
}

.steps__item--current {
  border-color: var(--ink-600);
  color: var(--ink-700);
  font-weight: 500;
}

.steps__item--current .steps__num {
  background: var(--ink-600);
  color: var(--on-dark);
}

/* ── Matrices (permission matrix, curriculum map) ───────────────────────────────────────── */

.matrix-wrap {
  overflow: auto;
  max-block-size: 72vh;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-2);
  background: var(--surface);
}

.matrix {
  border-collapse: separate;
  border-spacing: 0;
  inline-size: max-content;
  min-inline-size: 100%;
}

.matrix th,
.matrix td {
  padding: 7px 10px;
  border-block-end: 1px solid var(--line);
  border-inline-end: 1px solid var(--line);
  text-align: center;
  background: var(--surface);
}

.matrix thead th {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
  vertical-align: bottom;
  font-size: 0.8125rem;
  font-weight: 600;
  min-inline-size: 150px;
  max-inline-size: 190px;
  border-block-end: 1px solid var(--line-strong);
}

.matrix tbody th {
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
  text-align: start;
  font-weight: 400;
  min-inline-size: 260px;
  max-inline-size: 340px;
}

.matrix thead th:first-child {
  inset-inline-start: 0;
  z-index: 3;
  text-align: start;
}

.matrix__group th,
.matrix__group td {
  background: var(--sunken);
  font-weight: 600;
  color: var(--ink-900);
}

.matrix tbody tr:hover td,
.matrix tbody tr:hover th {
  background: var(--ink-50);
}

.matrix__group:hover th,
.matrix__group:hover td {
  background: var(--sunken) !important;
}

.matrix input[type="checkbox"] {
  inline-size: 16px;
  block-size: 16px;
  accent-color: var(--ink-600);
}

.matrix .select {
  min-block-size: 30px;
  padding-block: 2px;
  font-size: 0.8125rem;
  min-inline-size: 64px;
}

.matrix__key {
  display: block;
  font-size: 0.75rem;
  color: var(--text-3);
}

/* ── Overlays ───────────────────────────────────────────────────────────────────────────── */

.menu {
  position: relative;
}

.menu > summary {
  list-style: none;
  cursor: pointer;
}

.menu > summary::-webkit-details-marker {
  display: none;
}

.menu__list {
  position: absolute;
  inset-block-start: calc(100% + 6px);
  inset-inline-end: 0;
  z-index: 50;
  min-inline-size: 220px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow-float);
}

.menu__list--start {
  inset-inline: 0 auto;
}

.menu__item {
  display: flex;
  align-items: center;
  gap: 8px;
  inline-size: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: var(--radius-1);
  background: none;
  color: var(--text);
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}

.menu__item:hover {
  background: var(--sunken);
  color: var(--text);
}

.menu__item[aria-current="true"] {
  font-weight: 600;
}

.menu__sep {
  block-size: 1px;
  margin: 6px 0;
  background: var(--line);
}

.menu__head {
  padding: 6px 10px 8px;
  border-block-end: 1px solid var(--line);
  margin-block-end: 6px;
}

/* ── Accredora Intelligence shortcuts (components/ai/shortcuts): the assistants of a page's part of the file ── */
.ai-shortcuts__list {
  min-inline-size: 260px;
  max-inline-size: min(340px, calc(100vw - 32px));
}

.ai-shortcuts__item {
  align-items: flex-start;
}

.ai-shortcuts__item > .icon {
  flex: none;
  margin-block-start: 2px;
}

.ai-shortcuts__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-inline-size: 0;
}

.ai-shortcuts__kind {
  color: var(--text-3);
  font-size: 12px;
}
/* ── end of the Accredora Intelligence shortcuts ── */

.dialog {
  inline-size: min(560px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-2);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-float);
}

.dialog::backdrop {
  background: rgba(7, 24, 41, 0.45);
}

.dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-block-end: 1px solid var(--line);
}

.dialog__title {
  font-size: 1.0625rem;
}

.dialog__body {
  padding: 16px 18px;
}

.dialog__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-block-start: 1px solid var(--line);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-block-start: 14px;
  font-size: 0.8125rem;
  color: var(--text-2);
}

.pagination__pages {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.pagination__page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-inline-size: 32px;
  block-size: 32px;
  padding-inline: 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-1);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.pagination__page[aria-current="page"] {
  background: var(--ink-600);
  border-color: var(--ink-600);
  color: var(--on-dark);
  font-weight: 600;
}

.pagination__page[aria-disabled="true"] {
  opacity: 0.45;
}

/* ── Small helpers ──────────────────────────────────────────────────────────────────────── */

.hide {
  display: none !important;
}

/* spacing helpers always win over a component's own margin */
.mt-0 { margin-block-start: 0 !important; }
.mt-1 { margin-block-start: 8px !important; }
.mt-2 { margin-block-start: 16px !important; }
.mt-3 { margin-block-start: 24px !important; }
.mt-4 { margin-block-start: 40px !important; }
.mb-1 { margin-block-end: 8px !important; }
.mb-2 { margin-block-end: 16px !important; }
.grow { flex: 1; min-inline-size: 0; }
.end { margin-inline-start: auto; }
.text-end { text-align: end; }
.w-full { inline-size: 100%; }

.inline-form {
  display: inline;
}

.copy-box {
  display: flex;
  gap: 6px;
}

.copy-box .input {
  font-size: 0.8125rem;
}

/* ── Motion and print ───────────────────────────────────────────────────────────────────── */

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

/* the school's logo at the top of a printed page (DESIGN.md §4r): on paper only, where the text starts */
.print-logo {
  display: none;
}

@media print {
  body {
    background: #fff;
    font-size: 11pt;
  }

  .print-logo {
    display: block;
    margin-block-end: 6mm;
  }

  .print-logo img {
    display: block;
    inline-size: auto;
    block-size: auto;
    max-inline-size: 60mm;
    max-block-size: 20mm;
  }

  .sidebar,
  .topbar,
  .banner,
  .page-head__actions,
  .tabs,
  .filters,
  .form-actions,
  .pagination,
  .no-print,
  .flash {
    display: none !important;
  }

  .app {
    display: block;
  }

  .content {
    max-inline-size: none;
    padding: 0;
  }

  .table-wrap,
  .matrix-wrap {
    overflow: visible;
    max-block-size: none;
  }

  .panel {
    break-inside: avoid;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  .portrait__badge {
    display: none;
  }
}

/* ── System check (platform console) ────────────────────────────────────────────────────── */

/* a path, a host or a setting: in the operator's terms, always left to right */
.path {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}

/* what the server said, word for word */
.system-detail {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  color: var(--text-2);
  overflow-wrap: anywhere;
  text-align: start;
}

.system-detail--bad {
  color: var(--crit-700);
}

/* commands to run on the server, to copy as they are */
.commands {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink-900);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.6;
  white-space: pre;
  overflow-x: auto;
  direction: ltr;
  text-align: start;
}

/* ── Dark appearance ────────────────────────────────────────────────────────────────────────
   A person's own choice (My account → Appearance; users.theme), set on <html data-theme="dark">
   by the workspace and console layouts. Only the tokens change: navy-black planes, light text,
   teal and mint for what can be acted on and for the standard's mark, status colours lifted to
   read on dark. The sidebar and the hero panel keep the brand's navy. On screens only: a printed
   page is always the light one. */

@media screen {
  :root[data-theme="dark"] {
    color-scheme: dark;

    --ink-950: #f5f9fb;
    --ink-900: #edf3f6;
    --ink-800: #edf3f6;
    --ink-700: #62d0c3;
    --ink-600: #007f78;
    --ink-200: #22524f;
    --ink-100: #143f3d;
    --ink-50: #11292f;

    --paper: #0e1a22;
    --surface: #14232e;
    --sunken: #0b151c;
    --line: #243847;
    --line-strong: #31495a;
    --control-border: #6a8494;

    --text: #dbe5eb;
    --text-2: #a9b9c4;
    --text-3: #93a7b3;

    --mark: #52d4c0;
    --mark-text: #52d4c0;

    --good-700: #64d1a0;
    --good-100: #11352a;
    --good-200: #1f5843;
    --warn-700: #f0b55f;
    --warn-100: #372911;
    --warn-200: #5b4420;
    --crit-700: #ff9aa3;
    --crit-100: #41171f;
    --crit-200: #6c2c37;
    --info-700: #62d0c3;
    --info-100: #10332f;
    --neutral-700: #a9b9c4;
    --neutral-100: #1d2e39;

    --grid: #233746;

    --meter-ok: #52d4c0;
    --meter-ok-track: #1f5257;
    --meter-warn: #f0a63a;
    --meter-warn-track: #4a3a1c;
    --meter-crit: #ff8a8a;
    --meter-crit-track: #5a2630;

    --shadow-float: 0 12px 32px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.4);

    --link: #62d0c3;
    --link-hover: #8fe0d5;
    --tip-bg: #e4edf1;
    --tip-text: #0e1a22;
    --tip-text-2: #3f5666;
    --scrim: rgba(0, 0, 0, 0.6);
  }

  /* a backdrop does not take the page's colours in every browser */
  :root[data-theme="dark"] .dialog::backdrop {
    background: rgba(0, 0, 0, 0.6);
  }

  /* the brand's navy is barely lighter than the dark page: a hairline keeps its edge */
  :root[data-theme="dark"] .sidebar {
    border-inline-end: 1px solid rgba(255, 255, 255, 0.06);
  }

  :root[data-theme="dark"] .panel--dark {
    border-color: rgba(255, 255, 255, 0.08);
  }

  /* the list's chevron is a picture with its own colour: a lighter one on a dark field (7.96:1) */
  :root[data-theme="dark"] .select:not([multiple]) {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a9b9c4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  }

  /* a field with the focus: the dark teal edge would be fainter than the resting one */
  :root[data-theme="dark"] :is(.input, .select, .textarea):focus-visible {
    border-color: var(--link);
    box-shadow: 0 0 0 3px rgba(98, 208, 195, 0.28);
  }

  /* Chromium draws a near-white track beside a dark accent: the light teal keeps the slider dark */
  :root[data-theme="dark"] .photo-editor__zoom input {
    accent-color: var(--link);
  }
}

/* a part of a dark page that keeps the light colours */
[data-theme="light"]:not(:root) {
  color: var(--text);
  color-scheme: light;
}
