/* Ilmove Campus
   Layout: aubergine rail on the left for staff, a plain header for students and applicants;
   content on a pale lilac-grey ground; gold is kept for the main action on a screen and for "today".
   The attendance glyphs (shape + colour) are the one memorable element; everything else stays quiet. */

@font-face {
  font-family: "Atkinson Next";
  font-style: normal; font-display: swap; font-weight: 200 800;
  src: url("../fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2") format("woff2-variations"), url("../fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Next";
  font-style: normal; font-display: swap; font-weight: 200 800;
  src: url("../fonts/atkinson-hyperlegible-next-latin-ext-wght-normal.woff2") format("woff2-variations"), url("../fonts/atkinson-hyperlegible-next-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --rail: #2a1f3d; --rail-ink: #ede7f6; --rail-muted: #a99bc2; --rail-hover: #382b4f; --rail-active: #463862; --rail-line: #3d3155;
  --gold: #c98a12; --gold-hover: #b57b0e; --gold-ink: #1e1a26; --gold-soft: #f7ead0;
  --ground: #f5f4f8; --surface: #ffffff; --surface-2: #faf9fc; --tint: #efecf5;
  --ink: #1e1a26; --muted: #625b70; --faint: #8a8397; --line: #ddd8e5; --line-strong: #c6bfd3;
  --present: #2f7d4f; --late: #b7791f; --absent: #b4372e; --excused: #4f6d8f;
  --good: #2f7d4f; --good-bg: #e5f1e9; --warn: #8f5b0b; --warn-bg: #fbefd8; --bad: #a3312a; --bad-bg: #f8e3e1; --info: #3f5f84; --info-bg: #e4ebf3; --muted-bg: #eeecf2;
  --focus: #7a5bb8; --shadow: 0 1px 2px rgba(42, 31, 61, .06), 0 4px 16px rgba(42, 31, 61, .07); --overlay: rgba(30, 22, 42, .45);
  --font: "Atkinson Next", "Atkinson Hyperlegible Next Variable", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-ctl: 6px; --r-panel: 10px;
  --rail-w: 236px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --rail: #150f1f; --rail-ink: #ece6f5; --rail-muted: #9b8fb3; --rail-hover: #241b33; --rail-active: #33284a; --rail-line: #2a2139;
    --gold: #e0a43a; --gold-hover: #eab456; --gold-ink: #1a1522; --gold-soft: #3a2e17;
    --ground: #17131f; --surface: #211b2b; --surface-2: #1d1826; --tint: #2a2337;
    --ink: #efeaf7; --muted: #aaa1bb; --faint: #8a8199; --line: #372f45; --line-strong: #4a4058;
    --present: #5cbb84; --late: #e2ab4c; --absent: #ec7a70; --excused: #8eaad0;
    --good: #6cc792; --good-bg: #1b3326; --warn: #e8b55e; --warn-bg: #3a2c12; --bad: #f08a80; --bad-bg: #3d1d1b; --info: #9ab9dd; --info-bg: #1d2a3a; --muted-bg: #2b2537;
    --focus: #b49be6; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .35); --overlay: rgba(5, 3, 9, .65);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --rail: #150f1f; --rail-ink: #ece6f5; --rail-muted: #9b8fb3; --rail-hover: #241b33; --rail-active: #33284a; --rail-line: #2a2139;
  --gold: #e0a43a; --gold-hover: #eab456; --gold-ink: #1a1522; --gold-soft: #3a2e17;
  --ground: #17131f; --surface: #211b2b; --surface-2: #1d1826; --tint: #2a2337;
  --ink: #efeaf7; --muted: #aaa1bb; --faint: #8a8199; --line: #372f45; --line-strong: #4a4058;
  --present: #5cbb84; --late: #e2ab4c; --absent: #ec7a70; --excused: #8eaad0;
  --good: #6cc792; --good-bg: #1b3326; --warn: #e8b55e; --warn-bg: #3a2c12; --bad: #f08a80; --bad-bg: #3d1d1b; --info: #9ab9dd; --info-bg: #1d2a3a; --muted-bg: #2b2537;
  --focus: #b49be6; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .35); --overlay: rgba(5, 3, 9, .65);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
#app { min-height: 100%; }
img { max-width: 100%; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; text-wrap: balance; font-weight: 700; }
h1 { font-size: 1.75rem; letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.0625rem; }
p { margin: 0; }
a { color: inherit; }
.num, td.num, .tab-nums { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .8125rem; }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.stack { display: flex; flex-direction: column; gap: var(--gap, 12px); }
.row { display: flex; align-items: center; gap: var(--gap, 10px); flex-wrap: wrap; }
.row.nowrap-row { flex-wrap: nowrap; }
.spread { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- buttons ---------- */
.btn { --b: var(--line-strong); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 7px 14px; border-radius: var(--r-ctl); border: 1px solid var(--b); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: .9375rem; line-height: 1.2; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--tint); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn.primary:hover { background: var(--gold-hover); border-color: var(--gold-hover); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--ink); padding-inline: 10px; }
.btn.quiet:hover { background: var(--tint); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn.danger:hover { background: var(--bad-bg); }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: .875rem; }
.btn.block { width: 100%; }
.btn svg { flex: none; }
.linkish { background: none; border: 0; padding: 0; color: var(--info); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .field > .label { font-weight: 600; font-size: .875rem; }
.field .help { font-size: .8125rem; color: var(--muted); }
.field .err { font-size: .8125rem; color: var(--bad); font-weight: 600; }
.req { color: var(--bad); margin-left: 2px; }
.input, select.input, textarea.input { width: 100%; min-height: 40px; padding: 8px 11px; border-radius: var(--r-ctl); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-size: .9375rem; }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:hover { border-color: var(--muted); }
.input:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
.input[aria-invalid="true"] { border-color: var(--bad); }
.input.compact { min-height: 34px; padding: 5px 9px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.checks { display: grid; gap: 6px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 7px 10px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: .9375rem; }
.check:hover { border-color: var(--line-strong); }
.check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--rail); flex: none; }
:root[data-theme="dark"] .check input { accent-color: var(--gold); }
.check.on { border-color: var(--focus); background: color-mix(in srgb, var(--focus) 7%, var(--surface)); }
.check .check-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.toggle { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; padding: 10px 0; }
.toggle .check-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.toggle input { appearance: none; width: 40px; height: 24px; border-radius: 12px; background: var(--line-strong); position: relative; flex: none; cursor: pointer; transition: background .15s; margin: 0; }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.toggle input:checked { background: var(--present); }
.toggle input:checked::after { transform: translateX(16px); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 7px 13px; font: inherit; font-size: .875rem; font-weight: 600; color: var(--muted); cursor: pointer; min-height: 36px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg.seg-wrap { flex-wrap: wrap; max-width: 100%; align-self: flex-start; }
.seg button[aria-pressed="true"] { background: var(--rail); color: var(--rail-ink); }
:root[data-theme="dark"] .seg button[aria-pressed="true"] { background: var(--rail-active); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button[aria-pressed="true"] { background: var(--rail-active); } }

/* ---------- panels, tables ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); }
.panel-pad { padding: 18px 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head h2, .panel-head h3 { font-size: 1rem; }
.panel-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; position: relative; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.tbl th { text-align: left; font-weight: 600; font-size: .8125rem; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); position: sticky; top: 0; }
.tbl th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.tbl th button:focus-visible { outline: 2px solid var(--focus); }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr.clickable:hover { background: var(--tint); }
.tbl td.num, .tbl th.num { text-align: right; }
.tbl .sub { display: block; font-size: .8125rem; color: var(--muted); }
.dl { display: grid; grid-template-columns: minmax(140px, 38%) minmax(0, 1fr); gap: 8px 16px; font-size: .9375rem; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.dl dd.empty { color: var(--faint); padding: 0; display: block; text-align: left; }   /* not the large empty-state box */
@media (max-width: 520px) { .dl { grid-template-columns: minmax(0, 1fr); gap: 2px; } .dl dd { margin-bottom: 8px; } }

/* ---------- pills, avatars ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: .8125rem; font-weight: 600; white-space: nowrap; background: var(--muted-bg); color: var(--muted); line-height: 1.5; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill.plain::before { display: none; }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.gold { background: var(--gold-soft); color: var(--warn); }
.avatar { --s: 36px; width: var(--s); height: var(--s); border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; font-size: calc(var(--s) * .38); color: var(--rail); background: color-mix(in srgb, var(--rail) 12%, var(--surface)); overflow: hidden; letter-spacing: .02em; }
:root[data-theme="dark"] .avatar { color: var(--rail-ink); background: var(--rail-active); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar { color: var(--rail-ink); background: var(--rail-active); } }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { --s: 64px; }
.avatar.xl { --s: 88px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who .who-text { min-width: 0; display: flex; flex-direction: column; }
.who .who-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .who-sub { font-size: .8125rem; color: var(--muted); white-space: nowrap; }

/* ---------- attendance glyphs: the signature element ---------- */
.glyph { width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: -3px; }
.glyph.P { color: var(--present); }
.glyph.L { color: var(--late); }
.glyph.A { color: var(--absent); }
.glyph.X { color: var(--excused); }
.glyph.none { color: var(--line-strong); }
.strip { display: inline-flex; gap: 3px; align-items: center; flex-wrap: wrap; }
.strip .glyph { width: 13px; height: 13px; }
.pct { font-variant-numeric: tabular-nums; font-weight: 700; }
.pct.good { color: var(--good); }
.pct.ok { color: var(--ink); }
.pct.low { color: var(--bad); }
.pct.none { color: var(--faint); font-weight: 400; }
.meter { height: 6px; background: var(--muted-bg); border-radius: 3px; overflow: hidden; min-width: 60px; }
.meter > span { display: block; height: 100%; background: var(--present); border-radius: 3px; }
.meter.low > span { background: var(--absent); }
.meter.ok > span { background: var(--late); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8125rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }

/* The register sheet: students down, sessions across, like the paper register it replaces. */
.sheet { border-collapse: separate; border-spacing: 0; font-size: .875rem; }
.sheet th, .sheet td { border-bottom: 1px solid var(--line); padding: 0; }
.sheet thead th { font-weight: 600; font-size: .75rem; color: var(--muted); padding: 8px 2px; text-align: center; vertical-align: bottom; background: var(--surface); position: sticky; top: 0; z-index: 1; }
.sheet thead th.today { color: var(--warn); }
.sheet thead th .d { display: block; font-size: .9375rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.sheet thead th.today .d { color: var(--gold-ink); background: var(--gold); border-radius: 4px; padding: 0 3px; }
.sheet td.cell { width: 30px; min-width: 30px; height: 34px; text-align: center; border-left: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.sheet td.cell .glyph { width: 15px; height: 15px; }
.sheet tr.week-start td.cell, .sheet th.week-start { border-left: 2px solid var(--line-strong); }
.sheet th.name, .sheet td.name { position: sticky; left: 0; background: var(--surface); text-align: left; padding: 6px 14px 6px 4px; min-width: 210px; z-index: 2; }
.sheet td.name { font-weight: 600; }
.sheet td.name .sub { display: block; font-weight: 400; font-size: .75rem; color: var(--muted); }
.sheet td.sum { padding: 0 10px; text-align: right; white-space: nowrap; }
.sheet tbody tr:hover td { background: var(--tint); }

/* Marking a register */
.reg-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.reg-row:last-child { border-bottom: 0; }
.reg-row.focus { background: var(--tint); }
.reg-row .reg-extra { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.marks { display: inline-flex; gap: 6px; }
.mark-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; min-width: 44px; padding: 6px 11px; border-radius: var(--r-ctl); border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); font: inherit; font-weight: 600; font-size: .875rem; cursor: pointer; }
.mark-btn:hover { border-color: var(--muted); }
.mark-btn .glyph { width: 15px; height: 15px; }
.mark-btn[aria-pressed="true"].P { background: var(--good-bg); border-color: var(--present); color: var(--present); }
.mark-btn[aria-pressed="true"].L { background: var(--warn-bg); border-color: var(--late); color: var(--warn); }
.mark-btn[aria-pressed="true"].A { background: var(--bad-bg); border-color: var(--absent); color: var(--bad); }
.mark-btn[aria-pressed="true"].X { background: var(--info-bg); border-color: var(--excused); color: var(--info); }
@media (max-width: 640px) { .mark-btn .mark-word { display: none; } .reg-row { grid-template-columns: minmax(0, 1fr); } }
.reg-tally { display: flex; gap: 16px; flex-wrap: wrap; font-size: .9375rem; }
.reg-tally span { display: inline-flex; gap: 6px; align-items: center; font-variant-numeric: tabular-nums; }
.kbd { font-family: inherit; font-size: .75rem; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--muted); background: var(--surface-2); }

/* ---------- staff shell ---------- */
.shell { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; background: linear-gradient(90deg, var(--rail) var(--rail-w), var(--ground) var(--rail-w)); }
.rail { background: var(--rail); color: var(--rail-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; padding-bottom: env(safe-area-inset-bottom, 0px); }
.rail-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; padding-left: max(18px, env(safe-area-inset-left, 0px)); text-decoration: none; color: inherit; }
.rail-mark { width: 34px; height: 34px; border-radius: 8px; background: var(--gold); color: var(--gold-ink); display: grid; place-items: center; font-weight: 800; font-size: 1rem; flex: none; overflow: hidden; }
.rail-mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.rail-brand .t { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.rail-brand .t strong { font-size: .9375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-brand .t span { font-size: .75rem; color: var(--rail-muted); }
.rail nav { display: flex; flex-direction: column; padding: 4px 10px 16px; padding-left: max(10px, env(safe-area-inset-left, 0px)); gap: 1px; }
.rail .nav-group { font-size: .75rem; color: var(--rail-muted); padding: 16px 10px 6px; font-weight: 600; }
.rail a.nav { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 7px; color: var(--rail-ink); text-decoration: none; font-size: .9375rem; font-weight: 500; }
.rail a.nav svg { width: 18px; height: 18px; opacity: .8; flex: none; }
.rail a.nav:hover { background: var(--rail-hover); }
.rail a.nav[aria-current="page"] { background: var(--rail-active); font-weight: 700; }
.rail a.nav[aria-current="page"] svg { opacity: 1; color: var(--gold); }
.rail a.nav .count { margin-left: auto; font-size: .75rem; font-weight: 700; background: var(--gold); color: var(--gold-ink); border-radius: 999px; padding: 0 7px; font-variant-numeric: tabular-nums; }
.rail a.nav .soon { margin-left: auto; font-size: .6875rem; font-weight: 600; color: var(--rail-muted); border: 1px solid var(--rail-line); border-radius: 999px; padding: 0 7px; }
.dl dd .sub { display: block; color: var(--muted); font-size: .8125rem; }
.step-mark { flex: none; width: 28px; height: 28px; border-radius: 999px; display: inline-grid; place-items: center; font-weight: 700; font-size: .8125rem; border: 1.5px solid var(--line-strong); color: var(--muted); background: var(--surface); }
.step-mark.done { border-color: var(--good); background: var(--good-bg); color: var(--good); }
/* the campus lock, at the top of the menu */
.campus-lock { position: relative; padding: 0 10px 8px; padding-left: max(10px, env(safe-area-inset-left, 0px)); }
.campus-btn { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--rail-line); color: var(--rail-ink); cursor: pointer; }
.campus-btn:hover:not(.static) { background: var(--rail-hover); }
.campus-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.campus-btn.static { cursor: default; }
.campus-btn .t { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.campus-btn .t strong { font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.campus-btn .t > span { font-size: .75rem; color: var(--rail-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.campus-icon { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; flex: none; color: var(--rail-muted); background: var(--rail-hover); }
.campus-caret { flex: none; opacity: .7; }
.campus-lock.locked .campus-btn { background: var(--rail-active); border-color: color-mix(in srgb, var(--gold) 45%, var(--rail-line)); }
.campus-lock.locked .campus-icon { background: var(--gold); color: var(--gold-ink); }
.campus-menu { margin-top: 4px; padding: 4px; border-radius: 8px; background: var(--rail-hover); border: 1px solid var(--rail-line); }
.campus-menu button { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: .875rem; color: var(--rail-ink); }
.campus-menu button:hover, .campus-menu button:focus-visible { background: var(--rail-active); }
.campus-menu button[aria-checked="true"] { font-weight: 700; }
.campus-menu button svg { color: var(--gold); flex: none; }
.campus-gap { width: 16px; flex: none; }
.campus-menu .note { margin: 0; padding: 6px 10px 6px; font-size: .75rem; line-height: 1.4; color: var(--rail-muted); }
/* the part of the college (version 9.1): the whole college, higher education or further education */
.sector-switch { padding: 0 10px 10px; padding-left: max(10px, env(safe-area-inset-left, 0px)); }
.sector-seg { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 3px; padding: 3px; border-radius: 8px; border: 1px solid var(--rail-line); }
.sector-seg button { all: unset; box-sizing: border-box; text-align: center; padding: 6px 0; border-radius: 6px; font-size: .8125rem; font-weight: 600; letter-spacing: .01em; color: var(--rail-muted); cursor: pointer; }
.sector-seg button:hover:not([aria-pressed="true"]) { background: var(--rail-hover); color: var(--rail-ink); }
.sector-seg button:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.sector-seg button[aria-pressed="true"] { background: var(--gold); color: var(--gold-ink); }
.sector-seg button:disabled { cursor: progress; }
.sector-cap { margin: 5px 2px 0; font-size: .75rem; color: var(--rail-muted); }
.sector-fixed { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; background: var(--rail-active); border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--rail-line)); font-size: .75rem; color: var(--rail-muted); }
.sector-fixed strong { color: var(--rail-ink); font-weight: 700; }
.sector-fixed svg { color: var(--gold); flex: none; }
.campus-chip { display: none; }
@media (max-width: 960px) {
  /* one chip for the campus lock and the part of the college (version 9.5, after the acceptance checks): it shrinks
     before anything else in the top bar, the campus name giving way with "…" while the part stays whole, so the
     person's own menu is always on screen */
  .campus-chip { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; flex: 0 1 auto; min-width: 0; max-width: min(56vw, 340px); padding: 5px 10px; border-radius: 999px; background: var(--rail); color: var(--rail-ink); font-size: .8125rem; font-weight: 600; cursor: pointer; }
  .campus-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .campus-chip .chip-part { flex: none; overflow: visible; }
  .campus-chip .chip-part.after { padding-left: 7px; border-left: 1px solid color-mix(in srgb, var(--rail-ink) 28%, transparent); }
  .campus-chip svg { color: var(--gold); flex: none; }
  .campus-chip:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
}
/* (version 9.5, after the acceptance checks) a platform owner with no college: the Colleges page with a bar of its own */
.platform-home { min-height: 100vh; min-height: 100dvh; background: var(--ground); }
.platform-home .content { margin: 0 auto; }
.topbar.platform-bar { background: var(--rail); color: var(--rail-ink); border-bottom-color: var(--rail-line); backdrop-filter: none; }
.topbar.platform-bar .user-btn:hover { background: var(--rail-hover); }
.topbar.platform-bar .user-btn .t span { color: var(--rail-muted); }
.platform-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.platform-brand .mark { width: 34px; height: 34px; border-radius: 8px; background: var(--gold); color: var(--gold-ink); display: grid; place-items: center; flex: none; }
.platform-brand .t { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.platform-brand .t strong { font-size: .9375rem; white-space: nowrap; }
.platform-brand .t span { font-size: .75rem; color: var(--rail-muted); }
@media (max-width: 960px) { .platform-bar .user-btn .t { display: none; } }
.rail-foot { margin-top: auto; padding: 12px 18px 18px; border-top: 1px solid var(--rail-line); font-size: .75rem; color: var(--rail-muted); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 28px; padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px)); background: color-mix(in srgb, var(--ground) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.menu-btn { display: none; }
.search { position: relative; flex: 1 1 auto; max-width: 560px; }
.search .input { padding-left: 38px; background: var(--surface); }
.search > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 17px; height: 17px; pointer-events: none; }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: var(--shadow); max-height: 420px; overflow-y: auto; z-index: 30; padding: 6px; }
.search-results button { all: unset; box-sizing: border-box; display: flex; width: 100%; padding: 8px 10px; border-radius: 6px; cursor: pointer; gap: 10px; align-items: center; }
.search-results button[aria-selected="true"], .search-results button:hover { background: var(--tint); }
.user-btn { display: flex; align-items: center; gap: 10px; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.user-btn:hover { background: var(--tint); }
.user-btn .avatar { --s: 32px; }
.user-btn .t { display: flex; flex-direction: column; text-align: left; line-height: 1.2; }
.user-btn .t span { font-size: .75rem; color: var(--muted); }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: var(--shadow); min-width: 220px; padding: 6px; z-index: 40; }
.menu button, .menu a { all: unset; box-sizing: border-box; display: flex; gap: 10px; align-items: center; width: 100%; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: .9375rem; }
.menu button:hover, .menu a:hover, .menu button:focus-visible { background: var(--tint); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.content { padding: 26px 28px 60px; padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px)); max-width: 1320px; width: 100%; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head .lead { color: var(--muted); margin-top: 6px; max-width: 70ch; }
.crumbs { font-size: .875rem; color: var(--muted); margin-bottom: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.scrim { display: none; }
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); background: var(--ground); }
  .rail { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 60; transform: translateX(-100%); transition: transform .2s ease; }
  .shell.nav-open .rail { transform: none; }
  .shell.nav-open .scrim { display: block; position: fixed; inset: 0; background: var(--overlay); z-index: 55; }
  .menu-btn { display: inline-flex; }
  .topbar, .content { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .user-btn .t { display: none; }
}
/* the top bar on a phone (version 9.5, after the acceptance checks): the search box and the lock chip give way, the menu
   button and the person's own menu never do, so nothing is pushed off the screen */
@media (max-width: 960px) {
  .topbar > * { min-width: 0; }
  .topbar > .menu-btn, .topbar > div:has(> .user-btn) { flex: none; }
  .topbar > .search { flex: 1 1 40px; min-width: 40px; }
  .topbar > .search .input { width: 100%; min-width: 0; padding-right: 4px; }
  .topbar > .search + .grow { flex: 0 1 0; }
  /* typing a search: the chip steps aside so the box has the room */
  .topbar:has(.search:focus-within) .campus-chip { display: none; }
}
@media (max-width: 520px) {
  .topbar { gap: 8px; }
  .topbar .user-btn { padding: 4px 2px; gap: 4px; }
  /* a narrow search box shows its magnifier only, and its words once it is in use */
  .topbar > .search .input:not(:focus)::placeholder { color: transparent; }
}
@media (prefers-reduced-motion: reduce) { .rail { transition: none; } * { scroll-behavior: auto !important; } }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button, .tabs a { all: unset; cursor: pointer; padding: 10px 14px; font-weight: 600; font-size: .9375rem; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; }
.tabs button:hover, .tabs a:hover { color: var(--ink); }
.tabs [aria-selected="true"] { color: var(--ink); border-bottom-color: var(--rail); }
:root[data-theme="dark"] .tabs [aria-selected="true"] { border-bottom-color: var(--gold); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tabs [aria-selected="true"] { border-bottom-color: var(--gold); } }
.tabs button:focus-visible, .tabs a:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
/* (version 9.5) a tab bar longer than the page fades out at the side with more tabs (ui/kit.js, Tabs) */
.tabs[data-more="r"] { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent); }
.tabs[data-more="l"] { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 56px), transparent); }
.tabs[data-more="lr"] { -webkit-mask-image: linear-gradient(to right, transparent, #000 56px, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(to right, transparent, #000 56px, #000 calc(100% - 56px), transparent); }
.tabs .count { font-size: .75rem; background: var(--muted-bg); color: var(--muted); padding: 0 7px; border-radius: 999px; font-variant-numeric: tabular-nums; }

/* ---------- dialogs, toasts ---------- */
.overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: max(5vh, 16px) 16px 16px; overflow-y: auto; }
.dialog { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); width: 100%; max-width: var(--w, 560px); display: flex; flex-direction: column; max-height: calc(100dvh - 10vh); }
.dialog-head { padding: 18px 22px 0; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.dialog-body { padding: 16px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.dialog-foot { padding: 14px 22px 18px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--line); }
.drawer-overlay { align-items: stretch; justify-content: flex-end; padding: 0; }
.drawer-overlay > .dialog { max-width: var(--w, 620px); max-height: none; height: 100%; border-radius: 0; }
.toasts { position: fixed; bottom: max(18px, env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(560px, calc(100% - 32px)); pointer-events: none; }
.toast { background: var(--ink); color: var(--surface); padding: 11px 16px; border-radius: 8px; box-shadow: var(--shadow); font-size: .9375rem; pointer-events: auto; display: flex; gap: 12px; align-items: center; animation: toast-in .18s ease-out; }
.toast.bad { background: var(--bad); color: #fff; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* ---------- notices ---------- */
.notice { display: flex; gap: 12px; padding: 12px 16px; border-radius: var(--r-panel); background: var(--info-bg); color: var(--ink); font-size: .9375rem; align-items: flex-start; }
.notice svg { flex: none; color: var(--info); margin-top: 2px; }
.notice.warn { background: var(--warn-bg); } .notice.warn svg { color: var(--warn); }
.notice.bad { background: var(--bad-bg); } .notice.bad svg { color: var(--bad); }
.notice.good { background: var(--good-bg); } .notice.good svg { color: var(--good); }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; gap: 10px; align-items: center; }
.empty strong { color: var(--ink); font-size: 1rem; }
.spinner { width: 20px; height: 20px; border: 2.5px solid var(--line); border-top-color: var(--rail); border-radius: 50%; animation: spin .7s linear infinite; }
:root[data-theme="dark"] .spinner { border-top-color: var(--gold); }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 40px; color: var(--muted); }

/* the HESA Portal, filling the space under the top bar */
.content.wide { max-width: none; }
.hp-wrap { margin: -26px -28px -60px; margin-left: calc(-1 * max(28px, env(safe-area-inset-left, 0px))); margin-right: calc(-1 * max(28px, env(safe-area-inset-right, 0px))); }
.hp-frame { display: block; width: 100%; height: calc(100vh - 64px); border: 0; background: var(--ground); }
@media (max-width: 960px) { .hp-wrap { margin-left: calc(-1 * max(16px, env(safe-area-inset-left, 0px))); margin-right: calc(-1 * max(16px, env(safe-area-inset-right, 0px))); } }
/* college services */
.announce { display: grid; gap: 10px; }
.announce-item { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--rail); border-radius: var(--r-panel); padding: 12px 16px; }
.announce-item.important { border-left-color: var(--warn); background: var(--warn-bg); }
.announce-item h2 { font-size: 1rem; margin: 0; }
.announce-item p { margin: 4px 0 0; white-space: pre-line; }
.announce-meta { display: block; margin-top: 6px; font-size: .75rem; color: var(--muted); }
/* forms in a grid of cells divided by lines (the outer edges are the panel's own) */
.svc-forms { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); overflow: hidden; }
.svc-form { display: flex; flex-direction: column; gap: 4px; padding: 14px 18px; margin: -1px 0 0 -1px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--surface); color: inherit; text-decoration: none; }
.svc-form:hover { background: var(--tint); }
.svc-form strong { font-size: .9375rem; }
.svc-intro { font-size: .875rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.svc-meta { font-size: .75rem; color: var(--muted); margin-top: auto; }
.svc-list { display: flex; flex-direction: column; }
.svc-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 280px); gap: 14px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.svc-row:last-child { border-bottom: 0; }
.svc-row:hover { background: var(--tint); }
.svc-row-main { min-width: 0; }
.svc-row-main .sub { display: block; font-size: .8125rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc-row-state { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; align-items: center; }
.svc-row-state .svc-progress { grid-column: 1 / -1; }
.svc-progress { height: 6px; border-radius: 3px; background: var(--tint); overflow: hidden; }
.svc-progress span { display: block; height: 100%; background: var(--rail); border-radius: 3px; }
.svc-row.overdue .svc-progress span { background: var(--warn); }
.svc-late { color: var(--warn); font-weight: 600; }
.svc-ref { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.svc-contact { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.svc-campus { display: flex; gap: 8px; align-items: flex-start; }
.svc-campus svg { flex: none; margin-top: 2px; color: var(--muted); }
.svc-sent { display: flex; gap: 14px; align-items: flex-start; }
.svc-sent > svg { flex: none; color: var(--good); }
.svc-heading h2 { font-size: 1rem; margin: 6px 0 0; }
.svc-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.svc-steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: 0 0 14px; position: relative; }
.svc-steps li:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 26px; bottom: 2px; width: 2px; background: var(--line); }
.svc-steps li.done:not(:last-child)::before { background: var(--rail); }
.svc-steps .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: .8125rem; font-weight: 700; border: 2px solid var(--line-strong); color: var(--muted); background: var(--surface); }
.svc-steps li.done .dot { border-color: var(--rail); background: var(--rail); color: var(--rail-ink); }
.svc-steps li.now .dot { border-color: var(--rail); color: var(--rail); }
.svc-timeline { display: flex; flex-direction: column; gap: 12px; }
.svc-event p { margin: 2px 0 0; white-space: pre-line; }
.svc-event.note { border-left: 3px solid var(--line-strong); padding-left: 10px; }
.svc-q { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.svc-dl-head { grid-column: 1 / -1; font-weight: 700; margin-top: 8px; }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.qr-card { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.qr-card > svg { width: 140px; height: 140px; }
.qr-card .nowrap-row { flex-wrap: wrap; width: 100%; }
.qr-card .nowrap-row .input { flex: 1 1 100%; min-width: 0; }
.qr-poster { display: none; }
@media print {
  body.print-qr * { visibility: hidden !important; }
  body.print-qr .qr-poster, body.print-qr .qr-poster * { visibility: visible !important; }
  body.print-qr .qr-poster { display: flex; flex-direction: column; align-items: center; justify-content: center; position: fixed; inset: 0; background: #fff; color: #000; text-align: center; gap: 12px; }
  body.print-qr .qr-poster svg { width: 9cm; height: 9cm; }
  body.print-qr .qr-poster h1 { font-size: 26pt; margin: 0; }
}
@media (max-width: 640px) { .svc-row { grid-template-columns: minmax(0, 1fr); } }
/* the top view: a college's campuses sit under it */
.tbl.overview tr.campus-row td { background: var(--surface-2); font-size: .875rem; padding-top: 7px; padding-bottom: 7px; }
.tbl.overview tr.campus-row .campus-name { padding-left: 16px; color: var(--muted); }
/* ---------- dashboard ---------- */
.attention { display: flex; flex-direction: column; }
.attention a { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 20px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--line); }
.attention a:last-child { border-bottom: 0; }
.attention a:hover { background: var(--tint); }
.attention .n { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; line-height: 1; }
.attention .n.zero { color: var(--faint); font-weight: 600; }
.attention .t strong { display: block; }
.attention .t span { font-size: .875rem; color: var(--muted); }
.figure { display: flex; flex-direction: column; gap: 2px; }
.figure .v { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; letter-spacing: -0.01em; }
.figure .l { color: var(--muted); font-size: .875rem; }
@media (max-width: 640px) {
  .figures { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .figures > .panel-pad { padding: 12px; }
  .figures .figure .v, .figures .v { font-size: 1.375rem; }
  .figures .l { font-size: .75rem; line-height: 1.35; }
  .demo-bar .demo-what { display: none; }
}
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px 44px; gap: 12px; align-items: center; font-size: .9375rem; }
.bar-row .track { height: 8px; background: var(--muted-bg); border-radius: 4px; overflow: hidden; }
.bar-row .track span { display: block; height: 100%; background: var(--rail); border-radius: 4px; }
:root[data-theme="dark"] .bar-row .track span { background: var(--rail-muted); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bar-row .track span { background: var(--rail-muted); } }
@media (max-width: 520px) { .bar-row { grid-template-columns: minmax(0, 1fr) 70px 40px; } }
.session { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.session:last-child { border-bottom: 0; }
.session .time { font-variant-numeric: tabular-nums; font-weight: 700; line-height: 1.25; }
.session .time span { display: block; font-weight: 400; color: var(--muted); font-size: .8125rem; }
.session.now { background: color-mix(in srgb, var(--gold) 9%, var(--surface)); box-shadow: inset 3px 0 0 var(--gold); }
@media (max-width: 520px) { .session { grid-template-columns: 60px minmax(0, 1fr); } .session > :last-child { grid-column: 1 / -1; } }

/* ---------- timetable week grid ---------- */
.week { display: grid; grid-template-columns: 56px repeat(var(--days, 5), minmax(130px, 1fr)); min-width: 760px; position: relative; }
.week .wk-head { position: sticky; top: 0; background: var(--surface); z-index: 3; padding: 10px 8px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: .875rem; text-align: left; }
.week .wk-head span { display: block; font-weight: 400; color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.week .wk-head.today { color: var(--warn); }
.week .wk-head.today span { color: var(--warn); }
.week .wk-col { position: relative; border-left: 1px solid var(--line); }
.week .wk-col.today { background: color-mix(in srgb, var(--gold) 5%, transparent); }
.week .wk-hours { position: relative; }
.week .wk-hour { position: absolute; right: 8px; font-size: .75rem; color: var(--faint); transform: translateY(-50%); font-variant-numeric: tabular-nums; }
.week .wk-line { position: absolute; left: 0; right: 0; border-top: 1px dashed color-mix(in srgb, var(--line) 80%, transparent); }
.week .blk { position: absolute; left: 4px; right: 4px; border-radius: 6px; padding: 6px 8px; font-size: .8125rem; line-height: 1.3; overflow: hidden; cursor: pointer; border: 1px solid; text-align: left; font: inherit; font-size: .8125rem; display: flex; flex-direction: column; gap: 1px; }
.week .blk strong { font-size: .8125rem; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.week .blk.tight { padding: 5px 5px; font-size: .75rem; }
.week .blk.tight strong { font-size: .75rem; -webkit-line-clamp: 4; hyphens: auto; overflow-wrap: break-word; }
.week .blk span { color: inherit; opacity: .85; }
.week .blk:hover { filter: brightness(.97); box-shadow: var(--shadow); }
.week .now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--gold); z-index: 2; }
.week .now-line::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.c0 { background: #ece7f6; border-color: #cfc4e6; color: #3b2a63; } .c1 { background: #e3eef0; border-color: #bed7dc; color: #1f4b54; } .c2 { background: #f6ebdc; border-color: #e6cfaa; color: #6b4410; } .c3 { background: #e7efe3; border-color: #c4d8ba; color: #2c4f22; } .c4 { background: #f5e4e8; border-color: #e3c0c9; color: #6b2236; } .c5 { background: #e4e9f4; border-color: #c1cde6; color: #26396a; }
:root[data-theme="dark"] .c0 { background: #30264a; border-color: #4a3b6d; color: #ddd1f7; } :root[data-theme="dark"] .c1 { background: #1f3539; border-color: #2f5158; color: #c5e6eb; } :root[data-theme="dark"] .c2 { background: #3b2d18; border-color: #5c4522; color: #f1d8b0; } :root[data-theme="dark"] .c3 { background: #233320; border-color: #39522f; color: #cde6c2; } :root[data-theme="dark"] .c4 { background: #3a2129; border-color: #5a3240; color: #f1cbd5; } :root[data-theme="dark"] .c5 { background: #212b40; border-color: #33425f; color: #cbd7f2; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .c0 { background: #30264a; border-color: #4a3b6d; color: #ddd1f7; } :root:not([data-theme="light"]) .c1 { background: #1f3539; border-color: #2f5158; color: #c5e6eb; } :root:not([data-theme="light"]) .c2 { background: #3b2d18; border-color: #5c4522; color: #f1d8b0; } :root:not([data-theme="light"]) .c3 { background: #233320; border-color: #39522f; color: #cde6c2; } :root:not([data-theme="light"]) .c4 { background: #3a2129; border-color: #5a3240; color: #f1cbd5; } :root:not([data-theme="light"]) .c5 { background: #212b40; border-color: #33425f; color: #cbd7f2; } }

/* ---------- record header ---------- */
.record-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.record-head .who-text h1 { font-size: 1.625rem; }
.record-head .facts { display: flex; gap: 6px 14px; flex-wrap: wrap; color: var(--muted); font-size: .9375rem; margin-top: 6px; align-items: center; }
.record-head .actions { margin-left: auto; }
.alerts { display: flex; flex-direction: column; gap: 8px; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 12px; padding-bottom: 14px; position: relative; }
.timeline li::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); margin-top: 6px; margin-left: 2px; }
.timeline li::after { content: ""; position: absolute; left: 6px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline li.done::before { background: var(--present); }
.timeline li.now::before { background: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.timeline .when { font-size: .8125rem; color: var(--muted); }

/* ---------- letters ---------- */
.letter-page { background: #fff; color: #1c1a1f; width: 100%; max-width: 794px; margin: 0 auto; padding: 56px 64px; box-shadow: var(--shadow); border: 1px solid var(--line); font-size: 14.5px; line-height: 1.55; font-family: var(--font); }
.letter-page .lh { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; border-bottom: 2px solid #2a1f3d; padding-bottom: 16px; margin-bottom: 28px; }
.letter-page .lh img { max-height: 64px; max-width: 200px; }
.letter-page .lh .org { font-size: 20px; font-weight: 800; color: #2a1f3d; }
.letter-page .lh .addr { font-size: 12.5px; color: #555; text-align: right; white-space: pre-line; }
.letter-page .meta { display: flex; justify-content: space-between; font-size: 13px; color: #444; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.letter-page .to { white-space: pre-line; margin-bottom: 20px; }
.letter-page .subj { font-weight: 800; margin-bottom: 16px; }
.letter-page .body { white-space: pre-line; }
.letter-page .sig { margin-top: 36px; }
.letter-page .sig img { max-height: 56px; display: block; margin: 8px 0; }
.letter-page .foot { margin-top: 48px; border-top: 1px solid #ddd; padding-top: 10px; font-size: 11.5px; color: #666; }
.letter-page .ph { background: #fff3cd; color: #7a5200; border-radius: 3px; padding: 0 2px; }
@media (max-width: 640px) { .letter-page { padding: 28px 22px; } }

/* ---------- portal (students and applicants) ---------- */
.portal { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.portal-head { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; }
.portal-head-in { max-width: 1080px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 10px max(20px, env(safe-area-inset-right, 0px)) 10px max(20px, env(safe-area-inset-left, 0px)); }
.portal-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; font-weight: 800; }
.portal-brand .rail-mark { width: 32px; height: 32px; }
.portal-tabs { display: flex; gap: 2px; margin-left: 12px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.portal-tabs::-webkit-scrollbar { display: none; }
/* a portal with many sections keeps the college's initial and the person's picture, so every section fits */
@media (max-width: 1440px) { .portal-head.many .portal-brand span:last-child, .portal-head.many .user-btn .t { display: none; } }
/* and with every section switched on, the section names go without their icons below wide screens */
@media (max-width: 1440px) { .portal-head.crowded .portal-tabs a svg { display: none; } .portal-head.crowded .portal-tabs a { padding: 8px 10px; } }
.portal-tabs a { text-decoration: none; color: var(--muted); font-weight: 600; padding: 8px 11px; border-radius: 7px; display: inline-flex; gap: 7px; align-items: center; font-size: .9375rem; white-space: nowrap; }
.portal-brand span:last-child { white-space: nowrap; }
.user-btn .t strong { white-space: nowrap; }
@media (max-width: 1120px) { .portal .user-btn .t { display: none; } }
@media (max-width: 900px) { .portal-head .portal-brand span:last-child { display: none; } }
.portal-tabs a:hover { background: var(--tint); color: var(--ink); }
.portal-tabs a[aria-current="page"] { color: var(--ink); background: var(--tint); }
.portal-tabs a svg { width: 18px; height: 18px; }
.portal-main { max-width: 1080px; width: 100%; margin: 0 auto; padding: 24px max(20px, env(safe-area-inset-right, 0px)) 96px max(20px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 18px; }
.bottom-tabs { display: none; }
@media (max-width: 760px) {
  .portal-tabs { display: none; }
  .bottom-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); z-index: 30; padding: 4px max(6px, env(safe-area-inset-right, 0px)) calc(4px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px)); }
  .bottom-tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; font-size: .6875rem; font-weight: 600; color: var(--muted); text-decoration: none; border-radius: 8px; }
  .bottom-tabs a svg { width: 22px; height: 22px; }
  .bottom-tabs a[aria-current="page"] { color: var(--ink); }
  .bottom-tabs a[aria-current="page"] svg { color: var(--gold); }
  .portal-main { padding-top: 18px; }
}
.hello { display: flex; flex-direction: column; gap: 4px; }
.hello h1 { font-size: 1.625rem; }
.big-pct { display: flex; align-items: baseline; gap: 10px; }
.big-pct .pct { font-size: 2.75rem; line-height: 1; letter-spacing: -0.02em; }
.course-card { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; }
.course-card h3 { font-size: 1.0625rem; }
.course-card .facts { display: flex; gap: 6px 16px; flex-wrap: wrap; color: var(--muted); font-size: .875rem; }
.intake-list { display: flex; flex-direction: column; gap: 8px; }
.intake { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-ctl); flex-wrap: wrap; }

/* stepper */
.steps { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.steps button { all: unset; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 8px; border-radius: 999px; font-size: .875rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.steps button .dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 700; background: var(--muted-bg); color: var(--muted); font-variant-numeric: tabular-nums; }
.steps button.done .dot { background: var(--good-bg); color: var(--good); }
.steps button[aria-current="step"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.steps button[aria-current="step"] .dot { background: var(--rail); color: var(--rail-ink); }
.steps button:focus-visible { outline: 2px solid var(--focus); }
/* the same steps as a progress line (list items, not buttons) */
ol.steps { list-style: none; margin: 0; padding: 0 0 2px; }
.steps li.step { display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 8px; border-radius: 999px; font-size: .875rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.steps li.step .dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 700; background: var(--muted-bg); color: var(--muted); font-variant-numeric: tabular-nums; }
.steps li.step.done .dot { background: var(--good-bg); color: var(--good); }
.steps li.step[aria-current="step"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.steps li.step[aria-current="step"] .dot { background: var(--rail); color: var(--rail-ink); }
.progress-line { height: 4px; background: var(--muted-bg); border-radius: 2px; overflow: hidden; }
.progress-line span { display: block; height: 100%; background: var(--gold); transition: width .2s; }

/* auth */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-side { background: var(--rail); color: var(--rail-ink); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; position: relative; overflow: hidden; }
.auth-side h1 { font-size: 2.25rem; max-width: 16ch; }
.auth-side p { color: var(--rail-muted); max-width: 46ch; font-size: 1.0625rem; }
.auth-side .reg-art { display: grid; grid-template-columns: repeat(12, 22px); gap: 8px; opacity: .9; }
.auth-side .reg-art .glyph { width: 18px; height: 18px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px max(20px, env(safe-area-inset-right, 0px)) 32px max(20px, env(safe-area-inset-left, 0px)); }
.auth-card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 860px) { .auth { grid-template-columns: minmax(0, 1fr); } .auth-side { padding: 28px max(20px, env(safe-area-inset-right, 0px)) 28px max(20px, env(safe-area-inset-left, 0px)); } .auth-side .reg-art { display: none; } .auth-side h1 { font-size: 1.625rem; } }

/* demo picker */
.demo-bar { background: var(--rail); color: var(--rail-ink); font-size: .8125rem; display: flex; gap: 10px; align-items: center; justify-content: center; padding: 6px max(16px, env(safe-area-inset-right, 0px)) 6px max(16px, env(safe-area-inset-left, 0px)); flex-wrap: wrap; position: relative; z-index: 25; }
.demo-bar button { background: transparent; color: var(--rail-ink); border: 1px solid var(--rail-line); border-radius: 5px; font: inherit; padding: 2px 9px; cursor: pointer; }
.demo-bar button:hover { background: var(--rail-hover); }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.person-card { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--r-panel); background: var(--surface); border: 1px solid var(--line); }
.person-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.person-card:focus-visible { outline: 2px solid var(--focus); }
.person-card .does { font-size: .875rem; color: var(--muted); }

/* the college's own look: its logo on a white plate (so any logo reads on the menu colour and in dark mode) */
.logo-plate { display: inline-flex; align-items: center; justify-content: center; background: #fff; border-radius: 8px; padding: 5px 8px; flex: none; max-width: 100%; }
.logo-plate img { display: block; max-height: 34px; max-width: 168px; width: auto; height: auto; object-fit: contain; }
.logo-bare img { display: block; max-height: 34px; max-width: 168px; }
.rail-brand.has-logo { flex-direction: column; align-items: flex-start; gap: 8px; }
.rail-brand.has-logo .logo-plate { padding: 7px 10px; }
.rail-brand.has-logo .logo-plate img { max-height: 40px; max-width: 176px; }
.portal-brand .logo-plate { padding: 3px 6px; border: 1px solid var(--line); }
.portal-brand .logo-plate img { max-height: 28px; max-width: 140px; }
.logo-stage { display: grid; place-items: center; min-height: 120px; border: 1px dashed var(--line-strong); border-radius: var(--r-panel); background: #fff; padding: 16px; margin-bottom: 12px; }
.logo-stage img { max-height: 96px; max-width: 100%; object-fit: contain; }
.colour-pick { width: 56px; height: 40px; padding: 2px; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); background: var(--surface); cursor: pointer; }
.menu-preview { margin-top: 14px; background: var(--rail); color: var(--rail-ink); border-radius: var(--r-panel); padding: 12px; display: grid; gap: 3px; max-width: 260px; }
.menu-preview .mp-brand { display: flex; align-items: center; gap: 10px; padding: 2px 4px 10px; font-size: .875rem; }
.menu-preview .mp-item { padding: 6px 10px; border-radius: 6px; font-size: .875rem; }
.menu-preview .mp-item.active { background: var(--rail-active); font-weight: 700; }
.menu-preview .mp-group { color: var(--rail-muted); font-size: .75rem; font-weight: 600; padding: 8px 10px 2px; }
.letter-page .lh { border-bottom-color: var(--rail); }
.letter-page .lh .org { color: var(--rail); }

/* register codes a college adds: the code itself, coloured by how it counts */
.code-chip { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 4px; font-size: .6875rem; font-weight: 800; line-height: 1; border: 1.5px solid currentColor; vertical-align: -3px; color: var(--muted); }
.code-chip.present { color: var(--present); } .code-chip.late { color: var(--late); } .code-chip.absent { color: var(--absent); } .code-chip.authorised { color: var(--excused); } .code-chip.not_expected { color: var(--faint); border-style: dashed; }
.mark-btn[aria-pressed="true"].N { background: var(--muted-bg); border-color: var(--line-strong); color: var(--ink); }

/* lists inside panels, pickers and search results */
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.plain-list li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.plain-list li:last-child { border-bottom: 0; }
.plain-list .sub { display: block; color: var(--muted); font-size: .8125rem; }
.pick-list { display: grid; gap: 6px; max-height: 360px; overflow-y: auto; margin-top: 8px; }
.code-search { position: relative; }
.code-hits { list-style: none; margin: 4px 0 0; padding: 4px; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); background: var(--surface); max-height: 240px; overflow-y: auto; box-shadow: var(--shadow); }
.code-hits button { all: unset; box-sizing: border-box; width: 100%; display: flex; justify-content: space-between; gap: 12px; padding: 7px 9px; border-radius: 5px; cursor: pointer; font-size: .9rem; }
.code-hits button:hover, .code-hits button:focus-visible { background: var(--tint); }
.journey-hesa + .journey-hesa { border-top: 1px solid var(--line); }
.journey-hesa h3 { margin: 0 0 10px; font-size: 1rem; }

/* marks sheet */
.marks-grid td { vertical-align: middle; }
.marks-grid .mark-in { width: 68px; text-align: right; font-variant-numeric: tabular-nums; display: inline-block; }
.marks-grid .mark-in.bad { border-color: var(--bad); background: var(--bad-bg); }
.marks-grid .earlier { display: block; font-size: .75rem; color: var(--muted); margin-bottom: 2px; }

/* documents on a record: a typed badge (PDF or picture), the name, and what can be done with it */
.doc-list { list-style: none; margin: 0; padding: 0 18px 6px; }
.doc-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.doc-list li:last-child { border-bottom: 0; }
.doc-list .sub { display: block; color: var(--muted); font-size: .8125rem; overflow-wrap: anywhere; }
.doc-list.removed { padding: 0; }
.doc-list.removed li { opacity: .75; }
.doc-badge { flex: none; width: 38px; height: 46px; border-radius: 4px 12px 4px 4px; display: grid; place-items: end center; padding-bottom: 6px; font-size: .625rem; font-weight: 800; letter-spacing: .04em; border: 1.5px solid var(--line-strong); color: var(--muted); background: var(--surface-2); }
.doc-badge.pdf { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); color: var(--bad); }
.doc-badge.img { border-color: color-mix(in srgb, var(--info) 45%, var(--line)); color: var(--info); }
.doc-view { background: var(--tint); border-radius: var(--r-ctl); padding: 10px; display: grid; place-items: center; max-height: 64vh; overflow: auto; }
.doc-view img { max-height: 60vh; object-fit: contain; box-shadow: var(--shadow); background: #fff; }
.terms-box { white-space: pre-line; max-height: 260px; overflow-y: auto; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface-2); font-size: .9rem; line-height: 1.55; }
.sub-head { font-size: .875rem; font-weight: 700; margin: 14px 0 8px; color: var(--ink); }
.sub-head:first-child { margin-top: 0; }
/* what registry needs before a student is made active */
.ready-list { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 8px; }
.ready-list li { display: flex; gap: 12px; align-items: flex-start; }
.ready-list li .step-mark { width: 24px; height: 24px; }
.ready-list li .sub { display: block; color: var(--muted); font-size: .8125rem; }
/* report rows: one person over several years, and bars that filter the list */
.tbl tr.group-cont td { border-top-color: transparent; }
.tbl tr.group-start td { border-top: 1px solid var(--line-strong); }
.linkish-row { background: none; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%; border-radius: var(--r-ctl); padding: 3px 6px; margin: 0 -6px; width: calc(100% + 12px); }
.linkish-row:hover { background: var(--tint); }
.linkish-row[aria-pressed="true"] { background: var(--gold-soft); }
.linkish-row:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

/* the export builder: fields on the left, the chosen columns and filters on the right */
.export-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .export-grid { grid-template-columns: minmax(0, 1fr); } }
.field-groups { display: grid; }
.field-groups details { border-top: 1px solid var(--line); padding: 10px 18px; }
.field-groups details:first-child { border-top: 0; }
.field-groups summary { cursor: pointer; padding: 4px 0; list-style-position: outside; }
.field-groups summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.dialog .field-groups details { padding: 10px 2px; }
.field-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; margin-top: 6px; }
.field-checks .check { font-size: .875rem; padding: 6px 9px; }
.chosen-list { list-style: none; margin: 0; padding: 0; counter-reset: col; display: grid; gap: 4px; max-height: 420px; overflow-y: auto; }
.chosen-list li { counter-increment: col; display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 0; border-bottom: 1px solid var(--line); }
.chosen-list li::before { content: counter(col); width: 26px; flex: none; text-align: right; padding-right: 8px; color: var(--faint); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.chosen-list .sub { display: block; color: var(--muted); font-size: .75rem; }
.tbl.compact th, .tbl.compact td { padding-top: 6px; padding-bottom: 6px; white-space: nowrap; }

/* print: letters and lists only */
/* ---- student photo, cases, plans and ILR (studentfile.js, casework.js) ---- */
.photo-slot { position: relative; flex: none; }
.photo-edit { position: absolute; right: -2px; bottom: -2px; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--ground); background: var(--surface); color: var(--ink); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); padding: 0; }
.photo-edit:hover { background: var(--tint); }
.photo-edit:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.photo-pick { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; align-items: start; }
.photo-frame { width: 150px; aspect-ratio: 3 / 4; border-radius: var(--r-ctl); background: var(--tint); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 520px) { .photo-pick { grid-template-columns: 1fr; } }
.checks.cols-2 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.check .sub { display: block; color: var(--muted); font-size: .8125rem; }
.sub-block { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 4px; }
.case-head .facts { display: flex; gap: 6px 14px; flex-wrap: wrap; color: var(--muted); font-size: .9rem; align-items: center; }
.case-details { white-space: pre-line; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 10px 14px; font-size: .9375rem; }
.case-actions { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.case-outcome { white-space: pre-line; margin: 0; padding-left: 12px; border-left: 3px solid var(--good); }
.note-body { white-space: pre-line; display: block; }
/* ---- grade schemes (grades.js) ---- */
.scheme-list { display: grid; }
.scheme { padding: 14px 20px; border-top: 1px solid var(--line); }
.bands { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.band { display: inline-flex; gap: 8px; align-items: baseline; padding: 4px 10px; border-radius: 999px; background: var(--good-bg); color: var(--good); font-size: .8125rem; }
.band strong { color: var(--ink); font-weight: 650; }
.band span { font-variant-numeric: tabular-nums; }
.band.fail { background: var(--muted-bg); color: var(--muted); }
.band-rows { display: grid; gap: 6px; margin-bottom: 10px; }
.band-row { display: grid; grid-template-columns: minmax(0, 1.3fr) 90px 72px minmax(0, 2fr) auto; gap: 8px; align-items: center; }
.band-row.head { font-size: .8125rem; font-weight: 600; color: var(--muted); }
.band-rows.no-hesa .band-row { grid-template-columns: minmax(0, 1.3fr) 90px 72px auto; }   /* a further education college: no HESA result */
.check-inline { display: inline-flex; gap: 6px; align-items: center; font-size: .875rem; }
@media (max-width: 640px) { .band-row { grid-template-columns: 1fr 80px; } .band-row.head { display: none; } }
.class-hint { border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 10px 12px; background: var(--surface-2); }
.case-list { list-style: none; margin: 0; padding: 4px 20px 12px; }
.case-list li { border-bottom: 1px solid var(--line); }
.case-list li:last-child { border-bottom: 0; }
.case-list .linkish-row { display: flex; gap: 12px; align-items: center; padding: 10px 6px; }
.case-list .sub { display: block; color: var(--muted); font-size: .8125rem; }

/* ---- student ID cards (idcards.js): bank-card size, measured in millimetres so the print is true to size ---- */
.idc { width: 85.6mm; height: 54mm; border-radius: 3.2mm; overflow: hidden; background: #fff; color: #17121f; position: relative; display: flex; flex-direction: column;
  box-shadow: 0 0 0 .25mm rgba(23, 18, 31, .18); font-family: var(--font); -webkit-print-color-adjust: exact; print-color-adjust: exact; break-inside: avoid; }
.idc-band { background: var(--band); color: #fff; height: 11mm; flex: none; display: flex; align-items: center; gap: 2.4mm; padding: 0 3.4mm; }
.idc-logo { height: 7.4mm; max-width: 22mm; background: #fff; border-radius: 1.2mm; padding: .8mm 1.2mm; display: grid; place-items: center; flex: none; }
.idc-logo img { max-height: 5.8mm; max-width: 19.6mm; object-fit: contain; display: block; }
.idc-college { font-size: 2.9mm; font-weight: 700; line-height: 1.1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idc-heading { margin-left: auto; font-size: 3.2mm; font-weight: 300; letter-spacing: .02em; flex: none; opacity: .95; }
.idc-body { flex: 1; display: flex; gap: 3mm; padding: 2.6mm 3.4mm 0; min-height: 0; }
.idc-photo { width: 21mm; height: 28mm; flex: none; border-radius: 1.2mm; background: #ece8f2; overflow: hidden; display: grid; place-items: center; border: .25mm solid rgba(23, 18, 31, .12); }
.idc-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.idc-photo span { font-size: 7mm; font-weight: 700; color: #8a8397; }
.idc-text { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: .5mm; }
.idc-name { font-size: 4mm; line-height: 1.12; font-weight: 800; overflow-wrap: anywhere; max-height: 9mm; overflow: hidden; }
.idc-no { font-size: 3.3mm; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.idc-line { font-size: 2.6mm; line-height: 1.2; color: #4d4659; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.idc-valid { font-size: 2.5mm; color: #4d4659; margin-top: auto; padding-bottom: .6mm; }
.idc-qr-wrap { width: 16mm; flex: none; align-self: flex-end; padding-bottom: 2.6mm; }
.idc-qr { width: 16mm; height: 16mm; display: block; }
.idc-code { height: 8.6mm; flex: none; padding: 1mm 3.4mm 1.8mm; }
.idc-bars { width: 100%; height: 100%; display: block; }
.idc-back-band { background: var(--band); height: 4mm; flex: none; }
.idc-back-body { flex: 1; padding: 3.2mm 4mm 3mm; display: flex; flex-direction: column; gap: 2mm; font-size: 2.6mm; line-height: 1.35; color: #4d4659; }
.idc-back-body p { margin: 0; }
.idc-back-text { color: #17121f; font-size: 2.8mm; }
.idc-back-college strong { color: #17121f; }
.idc-sign { margin-top: auto; border-bottom: .25mm solid #8a8397; height: 6mm; display: flex; align-items: flex-end; }
.idc-sign span { font-size: 2.2mm; color: #8a8397; transform: translateY(3mm); }
.idc-gap { width: 85.6mm; height: 54mm; }
.idc-preview { display: flex; flex-wrap: wrap; gap: 14px; padding: 18px; background: var(--tint); border-radius: var(--r-panel); }
.id-print { display: grid; gap: 18px; justify-content: start; }
.id-sheet { display: grid; grid-template-columns: repeat(2, 85.6mm); grid-auto-rows: 54mm; column-gap: 8mm; row-gap: 2.5mm; padding: 14px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r-ctl); width: max-content; }
.id-print.cards { grid-template-columns: repeat(auto-fill, 85.6mm); }
@media (max-width: 760px) { .id-sheet { grid-template-columns: 85.6mm; } }

@media print {
  body { background: #fff; }
  .rail, .topbar, .demo-bar, .portal-head, .bottom-tabs, .no-print, .toasts { display: none !important; }
  .shell { display: block; }
  .content, .portal-main { padding: 0; max-width: none; }
  .letter-page { box-shadow: none; border: 0; padding: 0; max-width: none; }
  .letter-page .ph { background: none; }
  .shell, .main, .content { background: #fff !important; }
  .id-print { display: block; }
  .id-sheet { padding: 0; border: 0; border-radius: 0; background: none; grid-template-columns: repeat(2, 85.6mm); justify-content: center; width: auto; break-after: page; }
  .id-sheet:last-child { break-after: auto; }
  .id-one { break-after: page; }
  .id-one:last-child { break-after: auto; }
  .id-one .idc { box-shadow: none; border-radius: 0; }
}

/* ---- sending emails (messages.js) ---- */
.send-progress { display: grid; gap: 6px; }
.send-progress .bar { height: 8px; border-radius: 4px; background: var(--tint); overflow: hidden; }
.send-progress .bar span { display: block; height: 100%; background: var(--present); transition: width .3s; }
@media (prefers-reduced-motion: reduce) { .send-progress .bar span { transition: none; } }

/* ---- bulk upload (bulk.js): the kinds on the left, the chosen one's three steps on the right ---- */
.bulk { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; margin-top: 20px; }
.bulk-kinds { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 14px; }
.bulk-kind-select { display: none; }
.bulk-group h2 { font-size: .8125rem; font-weight: 700; color: var(--muted); margin: 0 0 4px 12px; }
.bulk-group button { all: unset; box-sizing: border-box; display: block; width: 100%; padding: 7px 12px; border-radius: 7px; border-left: 3px solid transparent; font-size: .9375rem; line-height: 1.35; cursor: pointer; color: var(--ink); }
.bulk-group button:hover { background: var(--tint); }
.bulk-group button[aria-current="true"] { background: var(--surface); border-left-color: var(--rail); font-weight: 700; box-shadow: 0 0 0 1px var(--line); }
.bulk-group button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.bulk-intro h2 { font-size: 1.25rem; margin: 0 0 4px; }
.bulk-intro p { margin: 0 0 4px; max-width: 70ch; }
.bulk-intro .form-grid { margin-top: 14px; }
.bulk-stages { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.bulk-stage { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 16px; padding: 18px 20px 20px; border-top: 1px solid var(--line); }
.bulk-stage h3 { font-size: 1rem; margin: 3px 0 0; }
.bulk-how { margin: 0; padding-left: 1.1em; color: var(--muted); font-size: .9063rem; display: grid; gap: 4px; max-width: 78ch; }
.bulk-how li::marker { color: var(--line-strong); }
.bulk-drop { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1.5px dashed var(--line-strong); border-radius: var(--r-panel); background: var(--surface-2); cursor: pointer; max-width: 640px; }
.bulk-drop:hover { background: var(--tint); }
.bulk-drop:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.bulk-drop.has-file { border-style: solid; border-color: var(--good); background: var(--good-bg); }
.bulk-drop > svg { flex: none; color: var(--muted); }
.bulk-drop:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.bulk-tally { display: flex; gap: 28px; flex-wrap: wrap; }
.bulk-tally div { display: flex; flex-direction: column; }
.bulk-tally strong { font-size: 1.75rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.bulk-tally span { font-size: .8125rem; color: var(--muted); }
.bulk-problems { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-ctl); }
.bulk-file { max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulk-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 10px; max-width: 720px; }
.bulk-thumbs figure { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.bulk-thumbs img, .bulk-thumbs figure > span { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: var(--tint); display: grid; place-items: center; color: var(--muted); }
.bulk-thumbs figcaption { font-size: .75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulk-thumbs figure.bad img, .bulk-thumbs figure.bad > span { border-color: var(--bad); }
@media (max-width: 960px) {
  .bulk { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .bulk-kinds { position: static; }
  .bulk-kind-select { display: block; }
  .bulk-group { display: none; }
}
@media (max-width: 520px) { .bulk-stage { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 16px; } .bulk-tally { gap: 18px; } }
.bulk-stage .tbl td:not(.nowrap), .bulk-problems .tbl td { white-space: normal; }

/* ---------- staff and rights: the rights tree (version 8.3) ----------
   Each area of the menu is a block; its main right sits on a trunk and the rights that need it hang from it as
   branches. The trunk turns aubergine while the main right is on, so a branch with nothing to hang from is easy to
   see. Special category data is marked in the "bad" colour with a lock, high-risk data in amber, private in blue. */
.super-line { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r-panel); background: var(--gold-soft); color: var(--ink); }
.super-line > svg { color: var(--gold); flex: none; margin-top: 2px; }
.super-line p { font-size: .9375rem; max-width: 90ch; }
.tree { display: flex; flex-direction: column; gap: 22px; }
.tree-sec { font-size: .875rem; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.tree-sec::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.tree-area { padding: 12px 0 14px; border-bottom: 1px solid var(--line); }
.tree-area:last-child { border-bottom: 0; }
.tree-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.tree-head h4 { font-size: 1rem; font-weight: 700; }
.tree-head .btn-row { gap: 2px; flex-wrap: nowrap; }
.tree-count { font-size: .8125rem; color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; padding-top: 2px; }
.tree-count.on { color: var(--ink); font-weight: 700; }
.tree-body { display: flex; flex-direction: column; gap: 2px; }
.tree-trunk { position: relative; }
.tree-deps { position: relative; margin-left: 19px; padding-left: 18px; border-left: 2px solid var(--line); }
.tree-trunk.on > .tree-deps { border-left-color: var(--rail); }
:root[data-theme="dark"] .tree-trunk.on > .tree-deps { border-left-color: var(--rail-muted); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tree-trunk.on > .tree-deps { border-left-color: var(--rail-muted); } }
.tree-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 4px 12px; align-items: start; padding: 8px 10px; border-radius: var(--r-ctl); }
label.tree-row { cursor: pointer; }
.tree-row:hover { background: var(--surface-2); }
.tree-row input[type="checkbox"] { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--rail); }
:root[data-theme="dark"] .tree-row input[type="checkbox"] { accent-color: var(--gold); }
.tree-deps > .tree-row { position: relative; }
.tree-deps > .tree-row::before { content: ""; position: absolute; left: -18px; top: 17px; width: 14px; height: 2px; background: var(--line); }
.tree-trunk.on > .tree-deps > .tree-row::before { background: var(--rail); }
.tree-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tree-label { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-weight: 600; font-size: .9375rem; }
.tree-row.main > .tree-text .tree-label { font-weight: 700; }
.tree-help { font-size: .8125rem; color: var(--muted); max-width: 70ch; }
.tree-ctl { align-self: center; }
.tree-ctl .seg button { min-height: 30px; padding: 4px 10px; font-size: .8125rem; }
.tree-mark { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
.tree-mark.on { background: var(--rail); border-color: var(--rail); color: var(--rail-ink); }
:root[data-theme="dark"] .tree-mark.on { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.tree-chg { font-size: .75rem; font-weight: 700; }
.tree-chg.add { color: var(--good); }
.tree-chg.remove { color: var(--bad); }
.priv { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; line-height: 1.5; }
.priv.bad { background: var(--bad-bg); color: var(--bad); }
.priv.warn { background: var(--warn-bg); color: var(--warn); }
.priv.info { background: var(--info-bg); color: var(--info); }
@media (max-width: 640px) {
  .tree-row { grid-template-columns: 22px minmax(0, 1fr); }
  .tree-ctl { grid-column: 2; }
  .tree-head { flex-wrap: wrap; }
}
.person-top { display: flex; gap: 12px; align-items: flex-start; }
.acct, .uses { border: 1px solid var(--line); border-radius: var(--r-panel); padding: 14px 16px; background: var(--surface-2); }
.acct h3, .uses h3 { font-size: .9375rem; margin-bottom: 10px; }
.uses h3 { margin-bottom: 4px; }
.acct-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.acct-actions p { margin-top: 6px; }
@media (max-width: 640px) { .acct-actions { grid-template-columns: minmax(0, 1fr); } }
.private-line { display: flex; gap: 6px; align-items: flex-start; margin-top: 6px; }
.private-line svg { color: var(--bad); flex: none; margin-top: 2px; }
.access-intro { display: flex; flex-direction: column; gap: 10px; }
.access-intro > p { max-width: 80ch; }
.figure .v.small-v { font-size: 1.375rem; padding-top: 6px; }
.access-list { display: flex; flex-direction: column; }
.access-row { display: grid; grid-template-columns: minmax(220px, 38%) minmax(0, 1fr); gap: 8px 20px; padding: 14px 20px; border-top: 1px solid var(--line); }
.access-row:first-child { border-top: 0; }
.access-right { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.access-right .small { flex-basis: 100%; }
.access-people { display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; }
.who-chip { display: inline-flex; flex-direction: column; padding: 5px 10px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--surface); font-size: .875rem; font-weight: 600; line-height: 1.3; }
.who-chip .small { font-weight: 400; }
@media (max-width: 720px) { .access-row { grid-template-columns: minmax(0, 1fr); } }

/* ---- awards, transcripts and certificates (awards.js) ----
   Printed on white whatever the screen's theme: the college's colour (darkened until it reads well on white) is the
   only accent. Transcripts and letters print on A4 portrait, certificates on A4 landscape, each on its own named page. */
:root { --doc-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
        --doc-sans: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", "Nimbus Sans", sans-serif; }
.aw-journey { display: grid; gap: 14px; padding: 16px 20px 20px; }
.aw-dates { margin: 0; }
.aw-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.aw-award { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-left: 3px solid var(--rail); border-radius: 8px; background: var(--surface-2); }
.aw-what { display: grid; gap: 3px; min-width: 0; }
.aw-cert { font-size: .875rem; color: var(--muted); }
.aw-cert.missing { color: var(--warn); }
.aw-actions { flex-shrink: 0; justify-content: flex-end; }
.aw-none { margin: 0; color: var(--muted); font-size: .9375rem; }
.aw-notes { margin-bottom: 16px; }
.aw-paper { display: flex; justify-content: center; padding: 4px 0 40px; overflow-x: auto; }
@media (max-width: 760px) { .aw-award { flex-direction: column; } .aw-actions { justify-content: flex-start; } }

.doc { position: relative; background: #fff; color: #1b1722; width: 210mm; max-width: 100%; box-sizing: border-box; padding: 16mm 15mm; font-family: var(--doc-sans);
  font-size: 9.5pt; line-height: 1.45; box-shadow: var(--shadow); border: 1px solid var(--line); font-variant-numeric: tabular-nums; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.doc-stamp { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; font-family: var(--doc-serif); font-size: 64pt;
  color: rgba(163, 49, 42, .16); transform: rotate(-24deg); z-index: 1; letter-spacing: .04em; }
.doc-stamp.soft { color: rgba(30, 26, 38, .07); font-size: 52pt; }
.doc-head { display: flex; justify-content: space-between; gap: 10mm; align-items: flex-end; border-bottom: 1.5pt solid var(--accent); padding-bottom: 4.5mm; margin-bottom: 7mm; }
.doc-org img { max-height: 16mm; max-width: 62mm; display: block; }
.doc-org span { font-family: var(--doc-serif); font-size: 17pt; color: var(--accent); line-height: 1.15; }
.doc-addr { font-size: 8pt; color: #5b5468; text-align: right; white-space: pre-line; line-height: 1.4; }
.doc-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8mm; margin-bottom: 4mm; }
.doc-title h2 { font-family: var(--doc-serif); font-weight: 600; font-size: 21pt; margin: 0; letter-spacing: -.005em; color: #1b1722; }
.doc-title span { font-size: 8.5pt; color: #5b5468; }
.doc-faint { color: #7b7488; font-size: .92em; }
.doc-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3.2mm 6mm; margin: 0; padding: 4mm 0; border-top: .5pt solid #d9d4e0; border-bottom: .5pt solid #d9d4e0; }
.doc-facts .wide { grid-column: span 2; }
.doc-facts dt { font-size: 7.5pt; color: #6a6377; margin: 0 0 .6mm; }
.doc-facts dd { margin: 0; font-size: 9.8pt; overflow-wrap: anywhere; }
.doc-award { display: grid; gap: .8mm; margin: 5mm 0 1mm; padding: 3mm 4mm; border-left: 2.5pt solid var(--accent); background: color-mix(in srgb, var(--accent) 6%, #fff); break-inside: avoid; }
.doc-award > span:first-child { font-size: 7.5pt; color: #6a6377; }
.doc-award strong { font-size: 11pt; font-weight: 700; }
.doc-award > span:last-child { font-size: 8.5pt; color: #3f3a4a; }
.doc-year { margin-top: 6.5mm; }
.doc-year-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6mm; margin-bottom: 2mm; break-after: avoid; }
.doc-year-head h3 { font-family: var(--doc-serif); font-size: 13pt; font-weight: 600; margin: 0; }
.doc-year-head h3 span { font-family: var(--doc-sans); font-size: 9pt; font-weight: 400; color: #5b5468; margin-left: 2mm; }
.doc-year-head > span { font-size: 8.5pt; color: #5b5468; text-align: right; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 8.8pt; }
.doc-table th { text-align: left; font-size: 7.5pt; font-weight: 700; color: #4a4356; padding: 1.4mm 2mm; border-bottom: .75pt solid #1b1722; }
.doc-table td { padding: 1.5mm 2mm; border-bottom: .5pt solid #e3dfe8; vertical-align: top; }
.doc-table tr { break-inside: avoid; }
.doc-table .n { text-align: right; white-space: nowrap; }
.doc-table .c-code { width: 18mm; white-space: nowrap; color: #4a4356; }
.doc-table tr.sum td { font-weight: 700; border-top: .75pt solid #1b1722; border-bottom: 0; }
.doc-total { display: flex; justify-content: space-between; gap: 6mm; margin-top: 5mm; padding-top: 3mm; border-top: 1pt solid var(--accent); font-size: 9.5pt; break-inside: avoid; }
.doc-key { margin-top: 6mm; font-size: 8pt; color: #4f4a5b; break-inside: avoid; }
.doc-key h4 { font-size: 8.5pt; margin: 0 0 1.5mm; color: #1b1722; }
.doc-key p { margin: 0 0 1mm; }
.doc-foot { display: grid; gap: 7mm; margin-top: 11mm; break-inside: avoid; }
.doc-sigs { display: flex; gap: 12mm; flex-wrap: wrap; }
.doc-sig { display: flex; flex-direction: column; min-width: 50mm; font-size: 8pt; color: #5b5468; }
.doc-sig strong { font-size: 9.5pt; color: #1b1722; }
.doc-sig-line { height: 13mm; border-bottom: .75pt solid #1b1722; margin-bottom: 1.5mm; }
.doc-check { display: flex; gap: 4mm; align-items: center; padding-top: 4mm; border-top: .5pt solid #d9d4e0; }
.doc-qr { width: 22mm; height: 22mm; flex-shrink: 0; display: block; }
.doc-check > div { display: grid; gap: .6mm; font-size: 7.5pt; color: #5b5468; line-height: 1.35; }
.doc-check strong { font-size: 8.5pt; color: #1b1722; }
.doc-code { color: #1b1722; font-weight: 700; font-size: 8.8pt; letter-spacing: .05em; }
.doc-small { font-size: 7.5pt; color: #6a6377; margin: 5mm 0 0; }
.doc-unofficial-note { margin: 9mm 0 0; padding: 3mm 4mm; border: .75pt dashed #9a93a6; font-size: 8.5pt; color: #3f3a4a; }

.doc-letter { font-family: var(--doc-serif); font-size: 11pt; line-height: 1.6; }
.doc-letter .doc-head, .doc-letter .doc-foot, .doc-letter .doc-letter-meta { font-family: var(--doc-sans); }
.doc-letter p { margin: 0 0 3.6mm; }
.doc-letter-meta { display: flex; justify-content: space-between; gap: 6mm; font-size: 9pt; color: #5b5468; margin-bottom: 8mm; }
.doc-letter-title { font-family: var(--doc-serif); font-size: 16pt; font-weight: 600; margin: 6mm 0 4mm; }

/* the certificate: drawn in container units, so it is the same on screen (scaled) and on A4 landscape */
.doc-cert { width: 297mm; aspect-ratio: 297 / 210; padding: 0; container-type: inline-size; overflow: hidden; }
.cert-frame { position: absolute; inset: 3cqw; border: .22cqw solid var(--accent); outline: .07cqw solid var(--accent); outline-offset: -.75cqw;
  display: flex; flex-direction: column; align-items: center; text-align: center; padding: 4.2cqw 7cqw 3.2cqw; font-family: var(--doc-serif); color: #1b1722; }
.cert-top { display: flex; flex-direction: column; align-items: center; gap: 1cqw; }
.cert-main { margin: auto 0; display: flex; flex-direction: column; align-items: center; padding: 1.5cqw 0; }
.cert-top img { max-height: 6.5cqw; max-width: 26cqw; }
.cert-college { font-size: 2.25cqw; color: var(--accent); letter-spacing: .03em; }
.cert-lead { font-size: 1.5cqw; font-style: italic; color: #4a4356; margin: .45cqw 0; }
.cert-name { font-size: 4.3cqw; line-height: 1.15; margin: 1cqw 0 1.3cqw; padding: 0 3cqw .9cqw; min-width: 46cqw; border-bottom: .06cqw solid #cfc8d8; }
.cert-award { font-size: 2.9cqw; font-weight: 600; color: var(--accent); margin: .9cqw 0 .2cqw; line-height: 1.2; }
.cert-result { font-size: 1.85cqw; font-style: italic; margin: .2cqw 0; }
.cert-date { font-size: 1.45cqw; margin: 1cqw 0 0; color: #3f3a4a; }
.cert-foot { margin-top: auto; width: 100%; display: flex; justify-content: space-between; align-items: flex-end; gap: 3cqw; font-family: var(--doc-sans); text-align: left; }
.doc-cert .doc-sigs { gap: 3.5cqw; }
.doc-cert .doc-sig { min-width: 21cqw; font-size: .9cqw; }
.doc-cert .doc-sig strong { font-size: 1.15cqw; }
.doc-cert .doc-sig-line { height: 5cqw; border-bottom-width: .07cqw; margin-bottom: .6cqw; }
.cert-check { display: flex; align-items: center; gap: 1cqw; padding: 0; border: 0; }
.cert-check .doc-qr { width: 6.6cqw; height: 6.6cqw; }
.cert-check > div { display: grid; gap: .25cqw; font-size: .9cqw; color: #5b5468; }
.doc-cert .doc-stamp { font-size: 10cqw; }

/* the check page (open to everyone) */
.check-page { min-height: 100vh; min-height: 100dvh; display: flex; justify-content: center; align-items: flex-start; padding: max(6vh, 32px) 16px 48px; background: var(--ground); box-sizing: border-box; }
.check-card { width: min(580px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px; box-shadow: var(--shadow); box-sizing: border-box; }
.check-card h1 { font-family: var(--doc-serif); font-weight: 600; font-size: 1.85rem; margin: 0 0 8px; }
.check-lead { color: var(--muted); margin: 0 0 20px; }
.check-form label { display: block; font-weight: 700; margin-bottom: 6px; }
.check-row { display: flex; gap: 8px; }
.check-row .input { letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.check-result { margin-top: 20px; border-radius: 10px; padding: 16px 18px; border: 1px solid var(--line); }
.check-result.good { background: var(--good-bg); border-color: color-mix(in srgb, var(--good) 35%, var(--line)); }
.check-result.bad { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.check-result > strong { display: block; font-size: 1.0625rem; color: var(--ink); }
.check-result.good > strong { color: var(--good); }
.check-result.bad > strong { color: var(--bad); }
.check-result p { margin: 6px 0 12px; }
.check-result dl { display: grid; grid-template-columns: minmax(110px, 32%) minmax(0, 1fr); gap: 6px 14px; margin: 0; }
.check-result dl div { display: contents; }
.check-result dt { color: var(--muted); }
.check-result dd { margin: 0; overflow-wrap: anywhere; }
.check-small { font-size: .8125rem; color: var(--muted); margin: 18px 0 0; }
@media (max-width: 480px) { .check-row { flex-direction: column; } .check-card { padding: 20px; } }

@page doc { size: A4 portrait; margin: 14mm 15mm 16mm; }
@page cert { size: A4 landscape; margin: 0; }
@media print {
  .aw-paper { display: block; padding: 0; overflow: visible; }
  .doc { box-shadow: none; border: 0; max-width: none; }
  .doc-transcript, .doc-letter { page: doc; width: auto; padding: 0; }
  .doc-cert { page: cert; width: 297mm; height: 210mm; aspect-ratio: auto; }
  .doc-transcript .doc-stamp, .doc-letter .doc-stamp { position: fixed; }
}

/* documents on a phone screen: the same content, laid out to read without zooming (printing still uses A4) */
@media screen and (max-width: 640px) {
  .aw-paper { padding-bottom: 24px; }
  .doc:not(.doc-cert) { padding: 22px 16px 26px; }
  .doc-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .doc-addr { text-align: left; }
  .doc-title { flex-direction: column; gap: 4px; }
  .doc-title h2 { font-size: 17pt; }
  .doc-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc-facts .wide { grid-column: 1 / -1; }
  .doc-year { overflow-x: auto; }
  .doc-year .doc-table { min-width: 520px; }
  .doc-stamp.soft { font-size: 34pt; }
  .doc-total { flex-direction: column; gap: 2px; }
}

/* ---------------------------------------------------------------- UKVI sponsor duties (version 8.5) */
.uk-due td:first-child { width: 1%; }
.uk-run { display: block; font-variant-numeric: tabular-nums; white-space: nowrap; }
.uk-run strong { font-size: 1.0625rem; }
.uk-bar { display: block; height: 4px; border-radius: 2px; background: var(--muted-bg); margin-top: 5px; min-width: 72px; overflow: hidden; }
.uk-bar span { display: block; height: 100%; background: var(--good); }
.uk-bar span.warn { background: var(--warn); }
.uk-bar span.bad { background: var(--bad); }
.uk-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 960px) { .uk-cards { grid-template-columns: minmax(0, 1fr); } }
.uk-card { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--line-strong); border-radius: var(--r-panel); padding: 16px 18px 14px; display: flex; flex-direction: column; gap: 6px; }
.uk-card.green { border-top-color: var(--good); }
.uk-card.amber { border-top-color: var(--warn); }
.uk-card.red { border-top-color: var(--bad); }
.uk-card h3 { margin: 0; font-size: .9375rem; }
.uk-card p { margin: 0; }
.uk-rate { font-size: 2.6rem; font-weight: 700; line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.uk-rate span { font-size: 1.25rem; font-weight: 600; margin-left: 2px; }
.uk-rate .muted { font-size: 1rem; font-weight: 500; letter-spacing: 0; }
.uk-rule { font-size: .8125rem; color: var(--muted); }
.uk-miss { color: var(--bad); font-weight: 600; }
.uk-files th.c, .uk-files td.c { text-align: center; }
.uk-files th.c { font-size: .75rem; line-height: 1.25; white-space: normal; min-width: 64px; max-width: 86px; }
.uk-files td.c { padding-left: 6px; padding-right: 6px; }
/* on a narrow screen the lists scroll sideways rather than squeezing what happened into a sliver */
.uk-due td:nth-child(3) { min-width: 240px; }
.uk-due td:nth-child(2) { min-width: 170px; }
.uk-ok { color: var(--good); display: inline-flex; }
.uk-ok svg { width: 18px; height: 18px; }
.uk-gap { font-size: .75rem; font-weight: 600; color: var(--bad); background: var(--bad-bg); border-radius: 999px; padding: 2px 8px; }
tr.uk-cancelled td { color: var(--muted); }
tr.uk-cancelled td .who-name { text-decoration: line-through; }
.uk-sp + .uk-sp { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.uk-sp .row { margin-bottom: 8px; }
.uk-cas { font-variant-numeric: tabular-nums; letter-spacing: .02em; }

/* ---------------------------------------------------------------- charts (version 8.6, ui/charts.js)
   Aubergine for the figures, gold only for "now" (this week, this year), grey for "not known". Shades of the one hue
   for how a whole divides, so no colour has to be learned; values are written on the chart, not in a legend. */
:root {
  --ch-1: #5b3f8c; --ch-1-soft: #ebe5f5; --ch-axis: #8a8397; --ch-grid: #ebe8f0; --ch-ref: #2a1f3d;
  --ch-s1: #2f2050; --ch-s2: #7a5cb0; --ch-s3: #b5a2dc; --ch-s4: #55407f; --ch-s5: #d9cff0; --ch-none: #cdc8d6;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ch-1: #b49be6; --ch-1-soft: #2d2440; --ch-axis: #8a8199; --ch-grid: #2f283c; --ch-ref: #efeaf7;
    --ch-s1: #e4dbf6; --ch-s2: #a58ce0; --ch-s3: #6d539e; --ch-s4: #c9b8f0; --ch-s5: #4b3a6c; --ch-none: #4a4058;
  }
}
:root[data-theme="dark"] {
  --ch-1: #b49be6; --ch-1-soft: #2d2440; --ch-axis: #8a8199; --ch-grid: #2f283c; --ch-ref: #efeaf7;
  --ch-s1: #e4dbf6; --ch-s2: #a58ce0; --ch-s3: #6d539e; --ch-s4: #c9b8f0; --ch-s5: #4b3a6c; --ch-none: #4a4058;
}
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.chart-grid > .span-2 { grid-column: 1 / -1; }
@media (max-width: 980px) { .chart-grid { grid-template-columns: minmax(0, 1fr); } }
.chart-card { margin-bottom: 0; }
.chart-card { min-width: 0; }
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 14px 20px 0; flex-wrap: wrap; min-height: 46px; }
.chart-head h2 { font-size: 1rem; }
.chart-lead { padding: 6px 20px 0; color: var(--muted); font-size: .9375rem; max-width: calc(68ch + 40px); }
.chart-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; max-width: 100%; }
/* a long row of choices scrolls inside the card rather than pushing the page sideways */
.chart-tools .seg, .chart-controls .seg, .chart-choices .seg { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; }
.chart-tools .seg button, .chart-controls .seg button, .chart-choices .seg button { white-space: nowrap; flex: none; }
.chart-choices { margin-bottom: 14px; }
.chart-choices .seg button { padding: 5px 11px; min-height: 32px; font-size: .8125rem; }
.chart-tools .seg button { padding: 5px 11px; min-height: 32px; font-size: .8125rem; }
.chart-body { padding: 16px 20px 18px; }
.chart-note { padding: 0 20px 16px; margin-top: -4px; font-size: .8125rem; color: var(--muted); max-width: 90ch; }
.chart-empty { color: var(--muted); padding: 8px 0; }
.chart-table th[scope="row"] { font-weight: 600; text-align: left; }
.chart-controls { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.chart-controls .field { margin: 0; }
/* bars */
.cbars, .cbars-rows { display: flex; flex-direction: column; gap: 8px; }
.cbar { display: grid; grid-template-columns: minmax(96px, 34%) minmax(0, 1fr) minmax(64px, auto); gap: 12px; align-items: center; font: inherit; color: inherit;
  background: none; border: 0; padding: 2px 0; text-align: left; width: 100%; }
button.cbar { cursor: pointer; border-radius: 4px; }
button.cbar:hover .cbar-label { text-decoration: underline; }
button.cbar[aria-pressed="true"] .cbar-label { font-weight: 700; }
.cbar-label { font-size: .875rem; line-height: 1.3; overflow-wrap: anywhere; }
.cbar-label .sub { display: block; font-size: .75rem; color: var(--muted); }
.cbar-track { position: relative; height: 14px; background: var(--ch-1-soft); border-radius: 3px; }
.cbar-fill { position: absolute; inset: 0 auto 0 0; background: var(--ch-1); border-radius: 3px; }
.cbar.hi .cbar-fill { background: var(--gold); }
.cbar.few .cbar-fill { background: repeating-linear-gradient(135deg, var(--ch-1) 0 4px, var(--ch-s5) 4px 7px); }
.cbar.soft .cbar-fill { opacity: .45; }
.cbar-value .cbar-note { margin-left: 8px; font-weight: 400; color: var(--muted); }
.cbar-ref { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--ch-ref); border-radius: 1px; }
.cbar-value { font-size: .875rem; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.cbar-value.low { color: var(--bad); }
.cbar-value .share { margin-left: 8px; font-weight: 400; color: var(--muted); }
.cbar-key { display: flex; align-items: center; gap: 8px; font-size: .8125rem; color: var(--muted); margin-top: 4px; }
.cbar-key-mark { display: inline-block; width: 2px; height: 14px; background: var(--ch-ref); }
/* strip */
.cstrip-bar { display: flex; height: 22px; border-radius: 4px; overflow: hidden; gap: 2px; background: var(--surface); }
.cstrip-part { min-width: 3px; }
.s1 { background: var(--ch-s1); } .s2 { background: var(--ch-s2); } .s3 { background: var(--ch-s3); } .s4 { background: var(--ch-s4); } .s5 { background: var(--ch-s5); }
.s-none { background: var(--ch-none); }
.cstrip-key { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 18px; }
.cstrip-key li { display: flex; align-items: center; gap: 8px; font-size: .875rem; }
.cstrip-key .num { min-width: 2.5em; text-align: right; }
.cstrip-swatch { width: 10px; height: 10px; border-radius: 2px; flex: none; }
/* line and columns */
.cline, .ccols { width: 100%; min-height: 40px; }
.cline svg, .ccols svg { display: block; overflow: visible; font-family: var(--font); }
.cline .grid line, .ccols .grid line { stroke: var(--ch-grid); stroke-width: 1; }
.cline .grid text, .ccols .grid text, .cline .xlab, .ccols .xlab { fill: var(--ch-axis); font-size: 11px; font-variant-numeric: tabular-nums; }
.cline .ref line { stroke: var(--ch-ref); stroke-width: 1.25; stroke-dasharray: 5 4; opacity: .7; }
.cline .ref text { fill: var(--ink); font-size: 11px; font-weight: 600; }
.cline .area { fill: var(--ch-1-soft); opacity: .7; }
.cline .stroke { fill: none; stroke: var(--ch-1); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.cline .pt { fill: var(--surface); stroke: var(--ch-1); stroke-width: 2; }
.cline .pt.now { fill: var(--gold); stroke: var(--surface); stroke-width: 2; }
.cline .now-label { fill: var(--ink); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ccols .col { fill: var(--ch-1); }
.ccols .col.now { fill: var(--gold); }
.ccols .vlab { fill: var(--ink); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
/* big figures over charts */
.cfigs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: var(--r-panel); overflow: hidden; margin-bottom: 16px; }
.cfig { background: var(--surface); padding: 14px 18px; display: flex; flex-direction: column; gap: 2px; }
.cfig .v { font-size: 1.625rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.cfig .l { font-size: .8125rem; color: var(--muted); }
.cfig .s { font-size: .75rem; color: var(--faint); }
@media (max-width: 640px) {
  .chart-head { padding: 14px 14px 0; } .chart-lead { padding: 6px 14px 0; } .chart-body { padding: 12px 14px 14px; } .chart-note { padding: 0 14px 14px; }
  .cbar { grid-template-columns: minmax(80px, 38%) minmax(0, 1fr) auto; gap: 8px; }
  .cbar-value .share { display: none; }
  .cbar-value { white-space: normal; }
  .cbar-value .cbar-note { display: block; margin-left: 0; font-size: .75rem; }
}
.s-present { background: var(--present); } .s-late { background: var(--late); } .s-absent { background: var(--absent); } .s-excused { background: var(--excused); }

/* ---------------------------------------------------------------- the ILR return (version 9.0) */
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .9em; }
.figure .v.bad { color: var(--bad); }
.figure .v.good { color: var(--good); }
.ilr-rules tr.is-open td { background: var(--tint); box-shadow: inset 3px 0 0 var(--ink); }
.ilr-rules td.ilr-words, .ilr-items td.ilr-detail { white-space: normal; }
.ilr-rules .ilr-words { min-width: 24ch; }
.ilr-items .ilr-detail { min-width: 30ch; max-width: 64ch; font-size: .9375rem; line-height: 1.4; }
.ilr-items td { vertical-align: top; }
.ilr-coverage { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.ilr-cov { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--r-panel); background: var(--surface-2); border-left: 4px solid var(--line-strong); }
.ilr-cov strong { font-size: 1.5rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ilr-cov span { font-size: .8125rem; color: var(--muted); }
.ilr-cov.campus { border-left-color: var(--good); }
.ilr-cov.schema, .ilr-cov.file, .ilr-cov.derived { border-left-color: var(--accent, var(--line-strong)); }
.ilr-cov.dfe { border-left-color: var(--info, var(--line-strong)); }
.ilr-cov.needs-data, .ilr-cov.not-yet { border-left-color: var(--warn); }
.ilr-file-problem { display: block; margin-top: 4px; }
.ilr-held-back { display: block; margin-top: 6px; }
/* students enrolled on further education courses who are not in the return yet (version 9.1) */
.ilr-intake { display: flex; gap: 14px; align-items: center; padding: 14px 18px; border-radius: var(--r-panel); background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--info, var(--line-strong)); }
.ilr-intake > svg { flex: none; color: var(--info, var(--muted)); }
.ilr-intake .grow { display: flex; flex-direction: column; gap: 3px; }
@media (max-width: 640px) { .ilr-intake { flex-wrap: wrap; } .ilr-intake .btn { width: 100%; } }
.ilr-sub { font-size: .9375rem; margin: 18px 0 8px; }
.ilr-built { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 12px 0; }
.ilr-built dt { color: var(--muted); font-size: .875rem; }
.ilr-built dd { margin: 0; word-break: break-all; }

/* version 9.4: scheduled jobs (Settings), two-step sign-in, temporary access, the audit trail's filters, data protection */
.jobs-tbl td { vertical-align: top; }
.job-toggle .toggle { padding: 0; align-items: center; }
.job-toggle .check-text strong { font-weight: 500; font-size: .875rem; color: var(--muted); }
.job-runs > td { background: var(--surface-2); padding: 12px 14px 16px; }
.job-runs .table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-ctl); }
.twostep-steps { list-style: none; margin: 0 0 4px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; counter-reset: ts; font-size: .8125rem; color: var(--faint); font-weight: 600; }
.twostep-steps li { counter-increment: ts; display: flex; align-items: center; gap: 7px; }
.twostep-steps li::before { content: counter(ts); width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .6875rem; background: var(--muted-bg); color: var(--muted); }
.twostep-steps li.now { color: var(--ink); }
.twostep-steps li.now::before { background: var(--gold); color: var(--gold-ink); }
.twostep-steps li.done::before { content: "✓"; background: var(--good-bg); color: var(--good); }
.twostep-scan { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 18px; align-items: start; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface-2); }
.twostep-qr { width: 168px; height: 168px; border-radius: 6px; background: #fff; padding: 6px; box-sizing: border-box; border: 1px solid var(--line); }
.twostep-key { display: block; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .9375rem; letter-spacing: .06em; padding: 9px 12px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r-ctl); overflow-wrap: anywhere; user-select: all; }
@media (max-width: 560px) { .twostep-scan { grid-template-columns: minmax(0, 1fr); justify-items: center; } .twostep-scan .stack { width: 100%; } }
.twostep-state { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface-2); }
.twostep-badge { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--muted-bg); color: var(--muted); flex: none; }
.twostep-badge.on { background: var(--good-bg); color: var(--good); }
.audit-filters { display: grid; grid-template-columns: minmax(170px, 1.2fr) repeat(2, minmax(140px, .75fr)) minmax(190px, 1.1fr) minmax(190px, 1.2fr) auto; gap: 12px 14px; align-items: end; }
@media (max-width: 1100px) { .audit-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .audit-filters { grid-template-columns: minmax(0, 1fr); } }
.pick-wrap { position: relative; }
.pick-list { display: flex; flex-direction: column; margin-top: 6px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface); box-shadow: var(--shadow); max-height: 260px; overflow-y: auto; }
.pick-wrap .pick-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; }
.pick-list button { all: unset; cursor: pointer; display: flex; flex-direction: column; gap: 1px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.pick-list button:last-child { border-bottom: 0; }
.pick-list button:hover, .pick-list button:focus-visible { background: var(--tint); }
.pick-chip { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: baseline; padding: 6px 10px; border-radius: var(--r-ctl); background: var(--tint); }
.retention-source { font-style: italic; }
.h3 { font-size: .9375rem; margin: 0 0 8px; }

/* ---------------------------------------------------------------- finance (version 9.4, finance.js) */
.bad-text { color: var(--bad); }
.fin-picked { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface-2); }
.fin-found { display: grid; gap: 2px; margin-top: 6px; max-height: 240px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 4px 8px; }
.fin-sum { font-size: 1.25rem; font-variant-numeric: tabular-nums; padding-top: 6px; }
.fin-amount { width: 120px; text-align: right; font-variant-numeric: tabular-nums; }
.fin-code { display: block; padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-ctl); font-size: .8125rem; overflow-wrap: anywhere; }
.tbl tr.total-row td { border-top: 2px solid var(--line-strong); }
.fin-state { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface); margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.fin-state span { color: var(--muted); }
/* bursary schemes: the budget as one bar (given, then awarded but not given yet) */
.fin-schemes { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-bottom: 16px; }
.fin-scheme { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; margin: 0; }
.fin-scheme h3 { margin: 0; font-size: 1.0625rem; }
.fin-budget { display: flex; height: 8px; border-radius: 4px; background: var(--muted-bg); overflow: hidden; }
.fin-budget .used { background: var(--ch-1); }
.fin-budget .committed { background: color-mix(in srgb, var(--ch-1) 35%, transparent); }
.fin-budget-key { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px 12px; margin: 0; }
.fin-budget-key dt { font-size: .75rem; color: var(--muted); }
.fin-budget-key dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; font-size: .9375rem; }
/* bank statement lines */
.fin-preview { margin-bottom: 14px; max-height: 190px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-ctl); }
.fin-lines { display: grid; gap: 10px; margin-top: 12px; }
.fin-line { padding: 12px 16px; margin: 0; display: grid; gap: 10px; border-left: 3px solid var(--warn); }
.fin-line.matched { border-left-color: var(--good); }
.fin-line.not_fees { border-left-color: var(--line-strong); }
.fin-line-head { display: flex; gap: 14px; align-items: flex-start; }
.fin-line-head .sub { display: block; color: var(--muted); font-size: .8125rem; }
.fin-amt { font-size: 1.125rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fin-amt.out { color: var(--muted); }
.fin-paid { margin: 0; padding-left: 18px; font-size: .875rem; }
.fin-sugs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fin-sugs > li { display: flex; gap: 12px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface-2); }
.fin-why { margin: 3px 0 0; padding-left: 18px; font-size: .8125rem; color: var(--muted); }
.fin-part { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
/* instalments: a plan's steps, own dates and amounts */
.fin-steps { display: grid; gap: 6px; margin: 12px 0; }
.fin-step { display: grid; grid-template-columns: 70px minmax(0, 1fr) minmax(0, 1fr) 40px; gap: 8px; align-items: center; }
.fin-step.head { font-size: .8125rem; font-weight: 600; color: var(--muted); }
.fin-plan { padding: 12px 20px 16px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.fin-plan:first-child { border-top: 0; }
/* (version 9.5) a refund made at Stripe, under its card payment; the two-person rule's switch */
.tbl tr.fin-refund td { background: var(--surface-2); font-size: .8125rem; }
.tbl tr.fin-refund td:first-child { padding-left: 28px; }
.tbl.compact td.fin-result { white-space: normal; min-width: 260px; }
.fin-two { padding-bottom: 4px; }

/* the invoice, credit note and sponsor's statement (A4, printed on white like the transcripts) */
.doc-invoice { font-family: var(--doc-sans); font-size: 9.5pt; line-height: 1.5; }
.doc-invoice .doc-title h2 { font-family: var(--doc-serif); }
.inv-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10mm; margin: 2mm 0 7mm; }
.inv-to { display: flex; flex-direction: column; gap: .6mm; }
.inv-to strong { font-size: 11pt; }
.inv-cap { font-size: 7.5pt; color: #6a6377; text-transform: uppercase; letter-spacing: .06em; }
.inv-addr { white-space: pre-line; color: #3f3a4a; }
.inv-facts { margin: 0; display: grid; gap: 1.6mm; align-content: start; }
.inv-facts > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 4mm; border-bottom: .5pt solid #e3dfe8; padding-bottom: 1.2mm; }
.inv-facts dt { color: #6a6377; font-size: 8.5pt; }
.inv-facts dd { margin: 0; text-align: right; font-weight: 600; }
.inv-lines td, .inv-lines th { vertical-align: top; }
.inv-lines .nowrap { white-space: nowrap; }
.inv-totals { margin: 4mm 0 0 auto; width: 72mm; display: grid; gap: 1mm; }
.inv-totals > div { display: flex; justify-content: space-between; gap: 6mm; font-variant-numeric: tabular-nums; }
.inv-totals .inv-grand { border-top: 1.2pt solid var(--accent); padding-top: 2mm; margin-top: 1mm; font-size: 12pt; font-weight: 700; }
.inv-note { margin: 5mm 0 0; padding: 3mm 4mm; background: #f6f4f8; border-left: 2.5pt solid var(--accent); }
.inv-pay { margin-top: 8mm; padding: 4mm 5mm; border: .75pt solid #d9d4e0; border-radius: 2mm; break-inside: avoid; }
.inv-pay h3 { font-family: var(--doc-serif); font-size: 12pt; margin: 0 0 2.5mm; }
.inv-pay p { margin: 2mm 0 0; }
.inv-bank { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5mm 6mm; margin: 0; }
.inv-bank dt { font-size: 7.5pt; color: #6a6377; }
.inv-bank dd { margin: 0; font-weight: 600; font-size: 10pt; letter-spacing: .02em; }
.inv-age { margin-top: 6mm; }
.inv-age th, .inv-age td { text-align: right; }
@media print { .doc-invoice { page: doc; width: auto; padding: 0; } .doc-invoice .doc-stamp { position: fixed; } }
@media screen and (max-width: 640px) {
  .inv-top { grid-template-columns: minmax(0, 1fr); gap: 4mm; }
  .inv-totals { width: 100%; }
  .inv-bank { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc-invoice .inv-lines { min-width: 480px; }
  .doc-invoice { overflow-x: auto; }
  .fin-line-head { flex-direction: column; gap: 4px; }
  .fin-sugs > li { flex-direction: column; align-items: stretch; }
  .fin-step { grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1fr) 36px; }
}

/* Student Finance (SLC), version 9.4 (views/slc.js) */
.slc-top { align-items: start; }
.slc-steps { margin: 0 0 4px; padding-left: 20px; display: grid; gap: 6px; font-size: .9375rem; }
.slc-steps li::marker { color: var(--muted); font-weight: 700; }
.slc-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.slc-codes > div { display: flex; gap: 10px; align-items: flex-start; font-size: .875rem; line-height: 1.35; }
.slc-codes > div > span:last-child { display: flex; flex-direction: column; }
@media (max-width: 640px) { .slc-codes { grid-template-columns: minmax(0, 1fr); } }
.slc-code { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 6px; font-weight: 700; font-size: .875rem;
  font-variant-numeric: tabular-nums; background: var(--muted-bg); color: var(--ink); border: 1px solid var(--line-strong); flex: none; }
.slc-code.pay { background: var(--good-bg); color: var(--good); border-color: transparent; }
.tbl td.slc-wrap, .tbl .slc-wrap { white-space: normal; overflow-wrap: anywhere; }
.slc-lines td { vertical-align: top; }
.slc-lines td.slc-why { min-width: 22ch; max-width: 34ch; white-space: normal; }
.slc-lines td:nth-child(2) { min-width: 24ch; }
.slc-lines td:nth-child(4) { min-width: 18ch; }
.slc-fee { color: var(--warn); font-weight: 600; display: flex !important; gap: 4px; align-items: flex-start; margin-top: 4px; }
.slc-fee svg { flex: none; margin-top: 2px; }
.input.slc-pick { width: auto; min-width: 12ch; max-width: 34ch; }
.slc-lines .input.slc-pick { max-width: 19ch; min-width: 0; }
.slc-tally { margin: 2px 0 4px; }
.slc-tally .slc-late strong, .tbl .slc-late { color: var(--bad); }
.slc-expected td.slc-period { min-width: 15ch; white-space: normal; }
.slc-expected td.slc-period .num { font-weight: 600; margin-right: 4px; }
.tbl td.slc-differs { background: var(--warn-bg); }
.slc-year { display: grid; grid-template-columns: 4.5em 4.5em 8em auto; gap: 6px; align-items: center; margin: 2px 0; }
.slc-year .input { padding-top: 4px; padding-bottom: 4px; }
.slc-layout p { margin: 4px 0; white-space: normal; line-height: 1.7; }
.slc-layout .slc-ok, .slc-layout .slc-tbc { display: inline-block; margin-right: 10px; }
.slc-layout .slc-tbc { text-decoration: underline dotted var(--warn); text-underline-offset: 3px; color: var(--muted); }
.slc-ssn { font-size: 1.5rem; font-weight: 700; letter-spacing: .06em; margin: 0 0 8px; }
.slc-needs { color: var(--warn); font-weight: 600; white-space: normal; display: block; min-width: 20ch; }
.slc-fee { margin-bottom: 4px; }
.slc-confirm { margin-top: 6px; }
.slc-code.small { min-width: 20px; height: 20px; font-size: .75rem; padding: 0 4px; vertical-align: middle; }
.slc-seg-scroll { overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.slc-seg-scroll .seg button { white-space: nowrap; }

/* ---------------------------------------------------------------- exams and progression (version 9.4) */
.ex-pick { flex-shrink: 0; }   /* a list in a dialog keeps its height beside other fields (the dialog scrolls instead) */
ul.tight { margin: 6px 0 0; padding-left: 20px; }
ul.tight li { margin: 2px 0; }
ul.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ex-tt td:first-child { width: 1%; }
.mod-steps { margin: 4px 0 16px; flex-wrap: wrap; }
.mod-figs { margin-bottom: 4px; }
.mod-figs .figure { margin: 0; }
.mod-bands { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .875rem; padding: 4px 2px 0; }
.tbl tr.mod-flag td { background: var(--warn-bg); }
.board-tbl td { vertical-align: top; }
.board-tbl tr.done td { background: var(--surface-2); }
.board-mods { display: flex; flex-direction: column; gap: 4px; }
.board-mod { white-space: nowrap; }
.board-mod .pill { margin-left: 4px; padding: 0 7px; font-size: .75rem; }
.board-tbl select.input.compact { min-width: 150px; }
.board-nocomp { max-height: 320px; overflow: auto; }
.my-exam { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; align-items: start; }
.my-exam-when { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--r-ctl); background: var(--tint); }
.my-exam-when strong { font-size: 1.0625rem; }
.my-exam-when span { font-variant-numeric: tabular-nums; color: var(--muted); }
@media (max-width: 560px) { .my-exam { grid-template-columns: minmax(0, 1fr); } }
.my-feedback { margin-top: 8px; padding: 8px 10px; border-left: 3px solid var(--gold); background: var(--surface-2); border-radius: 0 6px 6px 0; font-size: .875rem; }
.my-feedback p { margin: 4px 0; white-space: pre-line; }
/* the room list and desk cards, printed on A4 */
.ex-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 22px 24px; margin-bottom: 18px; color: var(--ink); }
.ex-list-head { display: flex; justify-content: space-between; gap: 18px; border-bottom: 2px solid var(--ink); padding-bottom: 10px; margin-bottom: 10px; }
.ex-list-head h2 { margin: 2px 0 4px; font-size: 1.25rem; }
.ex-list-head p { margin: 0; color: var(--muted); }
.ex-list-college { font-size: .8125rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ex-list-room { text-align: right; display: flex; flex-direction: column; min-width: 120px; }
.ex-list-room strong { font-size: 1.5rem; line-height: 1.1; }
.ex-list-room span { font-size: .8125rem; color: var(--muted); }
.ex-list-inv { margin: 4px 0; font-size: .875rem; }
.ex-list-table { width: 100%; border-collapse: collapse; font-size: .875rem; margin-top: 10px; }
.ex-list-table th { text-align: left; font-size: .75rem; color: var(--muted); border-bottom: 1px solid var(--line-strong); padding: 6px 8px; }
.ex-list-table td { border-bottom: 1px solid var(--line); padding: 7px 8px; vertical-align: top; }
.ex-list-table td.ex-tick { width: 64px; }
.ex-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ex-card { border: 1px solid var(--line-strong); border-radius: 8px; padding: 14px 16px; background: var(--surface); color: var(--ink); display: flex; flex-direction: column; gap: 4px; min-height: 58mm; box-sizing: border-box; break-inside: avoid; }
.ex-card-top { display: flex; justify-content: space-between; gap: 8px; font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.ex-card-name { font-size: 1.375rem; font-weight: 800; margin-top: 6px; }
.ex-card-no { font-size: 1.0625rem; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.ex-card-exam { margin-top: auto; font-size: .875rem; }
.ex-card-when { font-size: .8125rem; color: var(--muted); }
@media (max-width: 640px) { .ex-cards { grid-template-columns: minmax(0, 1fr); } .ex-list { padding: 16px; } .ex-list-head { flex-direction: column; } .ex-list-room { text-align: left; } .ex-list-table { display: block; overflow-x: auto; } }
@page exam { size: A4 portrait; margin: 12mm; }
@media print {
  .ex-list { page: exam; border: 0; border-radius: 0; padding: 0; margin: 0; break-after: page; background: #fff; color: #000; }
  .ex-list:last-of-type { break-after: auto; }
  .ex-list-table th, .ex-list-table td { color: #000; }
  .ex-cards { page: exam; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6mm; }
  .ex-card { height: 62mm; border: .3mm solid #555; background: #fff; color: #000; }
}

/* ===== version 9.4: student support, safeguarding, letters with check codes, documents to sign ===== */
.letter-page .letter-check { margin-top: 28px; }
.letter-page .letter-check .doc-qr { width: 24mm; height: 24mm; }
.who-sub.reported { color: var(--warn); font-weight: 600; }
tr.row-late td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.sg-cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px 20px; }
/* the people found for a concern: the number and course wrap on a narrow screen (Group A fix) */
.sg-found .who-sub { white-space: normal; }
.sg-record li strong { font-weight: 650; }
.sign-pad { display: block; width: 100%; max-width: 600px; aspect-ratio: 10 / 3; height: auto; background: #fff; border: 1px dashed var(--line-strong);
  border-radius: var(--r-ctl); touch-action: none; cursor: crosshair; margin: 4px 0 6px; }
.sign-panel { max-width: 794px; margin: 18px auto 0; border-left: 3px solid var(--gold); }
.letter-page .signed-by { margin-top: 32px; padding-top: 10px; border-top: 1px solid #ddd; }
.letter-page .signed-by img { max-height: 70px; max-width: 260px; }
.sign-cert { margin-top: 18px; page-break-before: always; break-before: page; }
.cert-dl { display: grid; grid-template-columns: minmax(130px, 28%) minmax(0, 1fr); gap: 7px 16px; font-size: 13px; margin: 14px 0 0; }
.cert-dl dt { color: #666; }
.cert-dl dd { margin: 0; overflow-wrap: anywhere; }
.cert-dl .mono, .mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 12px; }
@media (max-width: 640px) {
  .letter-page { padding: 28px 20px; }
  .cert-dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .cert-dl dd { margin-bottom: 8px; }
  .sg-cats { grid-template-columns: minmax(0, 1fr); }
}
@media print { .sign-panel { display: none; } }
.timeline.panel-pad, .plain-list.panel-pad { padding: 16px 20px; }
.letter-page .letter-check > div { font-size: 11.5px; }
.letter-page .letter-check strong { font-size: 12.5px; }
.letter-page .letter-check .doc-code { font-size: 12.5px; }

/* ---------------------------------------------------------------- reports and automation (version 9.5) */
/* the to-do list on Home */
.todo { list-style: none; margin: 0; padding: 0; }
.todo li { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.todo li:last-child { border-bottom: 0; }
.todo-kind { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--info-bg); color: var(--info); }
.todo-kind.attendance { background: var(--warn-bg); color: var(--warn); }
.todo-kind.done { background: var(--good-bg); color: var(--good); }
.todo-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.todo-detail { font-size: .875rem; color: var(--muted); }
.todo-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.todo-btns { flex-wrap: nowrap; }
.todo.done { border-top: 1px solid var(--line); background: var(--surface-2); }
.todo.done li { padding: 8px 20px; grid-template-columns: 32px minmax(0, 1fr); }
@media (max-width: 640px) { .todo li { grid-template-columns: 32px minmax(0, 1fr); padding: 12px 14px; } .todo-btns { grid-column: 2; } }
/* the attendance process: stages */
.iv-stages { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-top: 16px; }
.iv-stage-card { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--r-panel);
  background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--line-strong); }
.iv-stage-card:hover { background: var(--tint); }
.iv-stage-card:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.iv-stage-card.on { box-shadow: inset 0 0 0 2px var(--focus); }
.iv-stage-card .v { font-size: 1.625rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.iv-stage-card .l { font-weight: 600; font-size: .875rem; }
.iv-stage-card .s { font-size: .75rem; color: var(--muted); }
.iv-stage-card.iv-s1 { border-top-color: var(--info); } .iv-stage-card.iv-s2 { border-top-color: var(--late); }
.iv-stage-card.iv-s3 { border-top-color: var(--absent); } .iv-stage-card.iv-s4 { border-top-color: var(--rail); }
.iv-stage { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: .875rem; }
.iv-stage .n { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .75rem; font-weight: 800; background: var(--muted-bg); color: var(--muted); flex: none; }
.iv-stage.iv-s1 .n { background: var(--info-bg); color: var(--info); } .iv-stage.iv-s2 .n { background: var(--warn-bg); color: var(--warn); }
.iv-stage.iv-s3 .n { background: var(--bad-bg); color: var(--bad); } .iv-stage.iv-s4 .n { background: var(--rail); color: var(--rail-ink); }
.iv-stage.paused, .iv-stage.closed { color: var(--muted); }
.iv-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.iv-steps li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-ctl); background: var(--surface-2); border: 1px solid var(--line); }
.iv-steps .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 800; background: var(--muted-bg); color: var(--muted); flex: none; }
.iv-steps .t { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-size: .875rem; }
.iv-steps .t span { color: var(--muted); font-size: .8125rem; }
.iv-steps li.done { border-color: color-mix(in srgb, var(--present) 40%, var(--line)); }
.iv-steps li.done .n { background: var(--present); color: #fff; }
.iv-steps li.next { border-style: dashed; border-color: var(--gold); }
.iv-steps li.next .n { background: var(--gold-soft); color: var(--warn); }
.iv-timeline li { padding-bottom: 16px; }
.iv-msg { margin-top: 4px; }
.iv-msg summary { cursor: pointer; color: var(--muted); }
.iv-msg p { white-space: pre-line; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 10px 12px; margin: 6px 0 0; max-width: 70ch; }
.iv-past { border-top: 1px solid var(--line); }
.iv-past summary { cursor: pointer; padding: 12px 20px; }
.iv-ukvi { text-decoration: none; }
.iv-list td { vertical-align: top; }
.iv-preview { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: var(--r-panel); background: var(--surface-2); border: 1px solid var(--line); min-height: 100%; }
.iv-preview p { white-space: pre-line; margin: 0; font-size: .9375rem; }
.iv-words { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 2px; }
.iv-words code { font-size: .8125rem; background: var(--muted-bg); padding: 0 4px; border-radius: 4px; }
.iv-wording { margin-top: 6px; }
/* admissions reminders */
.rm-parts { display: flex; flex-direction: column; margin-top: 8px; border-top: 1px solid var(--line); }
.rm-parts.off { opacity: .55; }
.rm-part { padding: 6px 0 10px; border-bottom: 1px solid var(--line); }
.rm-part:last-child { border-bottom: 0; }
.rm-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 4px 0 6px 52px; }
@media (max-width: 900px) { .rm-fields { grid-template-columns: minmax(0, 1fr); margin-left: 0; } }
/* the report builder */
.rb-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; align-items: start; margin-top: 16px; }
@media (max-width: 1100px) { .rb-grid { grid-template-columns: minmax(0, 1fr); } }
.rb-block { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.rb-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rb-line { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; }
.rb-line > .input { width: auto; min-width: 0; flex: 1 1 0; }
.rb-line > select.input:first-child { flex: 0 1 160px; }
.rb-line.rb-filter { flex-wrap: wrap; }
.rb-line.rb-filter > .rb-what { flex: 1 0 100%; }
.rb-build .seg { align-self: flex-start; }
.rb-what { font-weight: 600; font-size: .9375rem; min-width: 8ch; }
.rb-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.rb-chips li { display: inline-flex; align-items: center; gap: 2px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--tint); font-size: .875rem; font-weight: 600; }
.rb-x { all: unset; cursor: pointer; width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--muted); font-size: 1rem; line-height: 1; }
.rb-x:hover { background: var(--line); color: var(--ink); }
.rb-x:focus-visible { outline: 2px solid var(--focus); }
.rb-x[disabled] { opacity: .35; cursor: default; }
.rb-hint { display: flex; gap: 14px; align-items: flex-start; color: var(--muted); }
.rb-hint strong { color: var(--ink); }
.rb-hint p { margin: 4px 0 0; }
/* the recruitment funnel */
.funnel { margin-top: 24px; }
.section-title { font-size: 1.125rem; margin: 0 0 12px; }
.funnel-closed { margin: 12px 0 0; }
/* comparing two returns */
.cmp-table { max-height: 52vh; }
.cmp-table td { vertical-align: top; }
.cmp-val { max-width: 28ch; overflow-wrap: anywhere; }
.cmp-added td:first-child { box-shadow: inset 3px 0 0 var(--good); }
.cmp-removed td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.cmp-pick .field { min-width: 260px; flex: 1; }
.dlg-sub { font-size: .9375rem; margin: 4px 0 8px; }
.dlg-sub + .timeline { margin-bottom: 14px; }

/* ---------------------------------------------------------------- Home: one To do panel (version 9.5, todo.js) */
.todo-part + .todo-part { border-top: 1px solid var(--line); }

/* ---------------------------------------------------------------- GLA funding (version 9.5) */
.gla-months td:first-child { white-space: nowrap; }
.gla-months .gla-ahead { color: var(--muted); background: var(--surface-2); }
.gla-months tr.gla-total td { font-weight: 700; border-top: 1px solid var(--line-strong); }
.gla-months th, .gla-months td { padding-left: 7px; padding-right: 7px; font-size: .8125rem; }
.gla-months th:first-child, .gla-months td:first-child { padding-left: 14px; }
.gla-aims td.gla-aim { white-space: normal; min-width: 28ch; }
.gla-note { color: var(--muted); white-space: normal; }
.gla-aims .sub .pill { margin-top: 3px; }
.gla-why { white-space: normal; min-width: 24ch; }
.gla-bad { color: var(--bad); }
.gla-good { color: var(--good); display: flex; gap: 6px; align-items: center; }
.gla-claims { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .gla-claims { grid-template-columns: minmax(0, 1fr); } }
.gla-claim { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--line-strong); border-radius: var(--r-panel); padding: 16px 18px 14px; display: flex; flex-direction: column; gap: 8px; }
.gla-claim.meets { border-top-color: var(--good); }
.gla-claim.under { border-top-color: var(--warn); }
.gla-claim h3 { margin: 0; font-size: .9375rem; }
.gla-claim .gla-claim-total { margin: 0; font-size: 1.75rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.gla-claim .gla-claim-total span { font-size: 1rem; font-weight: 600; color: var(--muted); }
.gla-claim .dl { grid-template-columns: minmax(110px, 45%) minmax(0, 1fr); }
.gla-claim .btn { align-self: flex-start; }
.gla-cap { display: flex; gap: 16px; align-items: center; padding: 14px 18px; border-radius: var(--r-panel); background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--good); }
.gla-cap.over { border-left-color: var(--bad); }
.gla-cap .grow { display: flex; flex-direction: column; gap: 3px; }
.gla-bar { flex: none; width: 180px; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.gla-bar span { display: block; height: 100%; background: var(--good); }
.gla-cap.over .gla-bar span { background: var(--bad); }
@media (max-width: 640px) { .gla-cap { flex-wrap: wrap; } .gla-bar { width: 100%; } }
.gla-head { margin-bottom: 4px; }
.gla-checked { margin: 4px 0 0; }
.gla-h { font-size: .8125rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; }
.gla-h span { text-transform: none; letter-spacing: 0; margin-left: 6px; }
.gla-met { margin-top: 8px; }
.gla-met summary { cursor: pointer; color: var(--good); font-weight: 600; font-size: .9375rem; }
.gla-met[open] summary { margin-bottom: 8px; }
.gla-rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.gla-rules li { display: flex; gap: 8px; align-items: flex-start; font-size: .9375rem; line-height: 1.4; }
.gla-rules li > svg { flex: none; margin-top: 2px; }
.gla-rules li.ok > svg { color: var(--good); }
.gla-rules li.no > svg { color: var(--bad); }
.gla-rules li.no { font-weight: 600; }
.gla-rules li.open > svg { color: var(--warn); }
.gla-rules .src { display: block; font-size: .75rem; font-weight: 400; color: var(--muted); }
.gla-missing { margin: 10px 0; padding: 10px 14px; border-radius: var(--r-panel); background: var(--warn-bg); }
.gla-missing ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------------------------------------------------------------- learning and the Moodle link (version 9.5) */
.lrn-list { list-style: none; margin: 0; padding: 0; }
.lrn-item { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.lrn-item:last-child { border-bottom: 0; }
.lrn-item.off { opacity: .7; }
.lrn-item > .grow { display: flex; flex-direction: column; gap: 2px; }
.lrn-item a strong, .lrn-item .linkish strong { color: var(--ink); }
.lrn-item a { text-underline-offset: 2px; }
.lrn-ico { flex: none; display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; border-radius: 8px; background: var(--tint); color: var(--muted); }
.lrn-meta { display: block; overflow-wrap: anywhere; }
.lrn-item > .grow > .linkish, .lrn-item > .grow > a { align-self: flex-start; text-align: left; }
.lrn-intro { margin: 0; padding-bottom: 0; color: var(--muted); }
.lrn-module .panel-pad .lrn-list { border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface); }
.lrn-module .panel-pad .lrn-item { padding: 10px 14px; }
.lrn-h { font-size: .9375rem; margin: 2px 0 8px; color: var(--muted); font-weight: 700; }
.lrn-assess { align-items: flex-start; }
.lrn-assess > .btn, .lrn-assess > .pill, .lrn-assess > a.btn { margin-top: 2px; }
.lrn-moodle-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 14px; margin: -4px 0 14px; border-radius: var(--r-panel); background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--info); }
.lrn-moodle-line > svg { color: var(--info); flex: none; }
.lrn-moodle-line a { color: var(--info); }
.lrn-code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .8125rem; overflow-wrap: anywhere; word-break: break-all; }
.lrn-details { margin-top: 8px; border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 8px 12px; background: var(--surface-2); }
.lrn-details summary { cursor: pointer; font-weight: 600; font-size: .9375rem; }
.lrn-details p { margin: 8px 0 2px; color: var(--muted); }
.lrn-toggles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 18px; margin-top: 10px; }
@media (max-width: 900px) { .lrn-toggles { grid-template-columns: minmax(0, 1fr); } }
.lrn-scroll { max-height: 56vh; overflow: auto; }
.lrn-receipt .lrn-code { display: block; }
@media (max-width: 640px) {
  .lrn-item { padding: 10px 14px; }
  .lrn-assess > .btn, .lrn-assess > a.btn { width: 100%; }
}

/* ---------------------------------------------------------------- version 9.5.2: View as, passwords */
/* the bar on every page while a super admin views Campus as someone else: fixed at the top, everything else below it */
:root { --viewas-h: 0px; }
:root.viewas-on { --viewas-h: 44px; }
.viewas-on body { padding-top: var(--viewas-h); }
.viewas-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 90; height: var(--viewas-h); display: flex; align-items: center; gap: 10px;
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
  background: var(--gold); color: var(--gold-ink); font-size: .875rem; box-shadow: 0 1px 0 rgba(0, 0, 0, .12); }
.viewas-bar .grow { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewas-stop { flex: none; font: inherit; font-weight: 700; color: var(--gold-ink); background: rgba(255, 255, 255, .55); border: 1px solid rgba(30, 26, 38, .35);
  border-radius: var(--r-ctl); padding: 5px 12px; cursor: pointer; }
.viewas-stop:hover { background: rgba(255, 255, 255, .8); }
.viewas-stop:focus-visible { outline: 2px solid var(--gold-ink); outline-offset: 2px; }
:root[data-theme="dark"] .viewas-stop { background: rgba(26, 21, 34, .18); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .viewas-stop { background: rgba(26, 21, 34, .18); } }
.viewas-on .rail { top: var(--viewas-h); height: calc(100vh - var(--viewas-h)); height: calc(100dvh - var(--viewas-h)); }
.viewas-on .topbar, .viewas-on .portal-head { top: calc(env(safe-area-inset-top, 0px) + var(--viewas-h)); }
/* on a phone: two short lines (who; read only and the time), so nothing the person must know is cut off */
@media (max-width: 640px) {
  :root.viewas-on { --viewas-h: 56px; }
  .viewas-bar { font-size: .8125rem; line-height: 1.3; }
  .viewas-bar .grow { white-space: normal; display: flex; flex-direction: column; }
  .viewas-bar .grow strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .02em; }

/* (version 9.5.5) the HESA return's problems and warnings, each with the students it is about */
.issue-list { list-style: none; margin: 0; padding: 0; }
.issue-list li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 18px; border-top: 1px solid var(--line); font-size: .9375rem; line-height: 1.45; }
.issue-list li:first-child { border-top: 0; }
.issue-list li .pill { flex: none; margin-top: 1px; }
.issue-list li .sub { display: block; margin-top: 4px; font-size: .8125rem; color: var(--muted); }
@media (max-width: 640px) { .issue-list li { flex-direction: column; gap: 6px; padding: 12px 14px; } }

/* (version 9.6) the board's choice for each module not passed */
.board-reassess { display: grid; gap: 6px; margin-top: 8px; }
.board-reassess label { display: grid; gap: 2px; }
.board-reassess select { max-width: 100%; }

/* (version 9.6.1) NOMARQUE support: the same bar as View as, in the product's own deep blue, so it is never mistaken */
.support-bar { background: #1f3a8a; color: #fff; }
.support-bar .viewas-stop { color: #fff; background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .45); text-decoration: none; }
.support-bar .viewas-stop:hover { background: rgba(255, 255, 255, .26); }
.support-bar .viewas-stop:focus-visible { outline-color: #fff; }
:root[data-theme="dark"] .support-bar .viewas-stop { background: rgba(255, 255, 255, .14); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .support-bar .viewas-stop { background: rgba(255, 255, 255, .14); } }
