/* CCIS palette, taken from the college seal: gold #F0C102, white, and the
   black of its linework. The seal is only those colours, which constrains the
   theme in one important way — GOLD IS NOT A TEXT COLOUR ON LIGHT. Measured:
   gold on white is 1.70:1 and white on gold is 1.70:1, both far below the 4.5:1
   needed for body text. Gold on a dark ground is 10.74:1, and ink on gold is
   10.22:1, which is why gold appears here only as a FILL behind dark text, or
   as a foreground on dark. --brand is a deep bronze drawn from the same hue so
   links and active state read as the gold family while staying legible
   (7.42:1 on pure white, 6.91:1 on the softened --surface). Every value below
   was measured, not eyeballed.

   FR-61 (2026-11): the light theme was pure white (#ffffff) cards on a #faf7ee
   page, which the College Secretary found too bright to work in. Every light
   ground is now a NEUTRAL "dirty white" (palette D, picked by the Secretary from
   four renderings; a first warm-cream attempt looked yellow): the card surface
   #f7f7f5 is 0.929 relative luminance (was 1.000), the page #eeeeec 0.854 (was
   0.930), the borders and tints a step down with them so cards still separate and
   zebra, hover and the Submitted pill stay three different colours. Ink stays
   >= 7:1 on every body ground. A CEILING and a FLOOR on surface and page
   luminance, and a neutrality test, are asserted in contrast_check.py so a later
   edit cannot drift back to white or to cream. The status hues, the gold and the navy sidebar are
   unchanged. The reader's own choice (System / Light / Dark, a button in the top
   bar) selects between this block and the dark one below. */
:root {
    color-scheme: light;
    --bg: #eeeeec;
    --surface: #f7f7f5;
    --text: #222222;
    --muted: #4d4d4d;
    --border: #d3d3ce;
    /* A hovered table row. Its own token (it used to borrow --info-bg, which is
       also the Submitted pill's fill, so a hovered row swallowed that pill) and
       a cool tint, so it differs from the zebra stripe (--bg) by hue as well as
       lightness. Dark has its own cool tint too (#1f2a38). */
    --row-hover: #e6ebf3;
    --brand: #6b5200;
    /* The readable foreground for a --brand BACKGROUND. It has to be a
       token because --brand flips from deep bronze to gold in the dark
       theme: white reads on the bronze (7.42:1) but is 1.70:1 on gold,
       so a hard-coded #fff would be unreadable in one of the two. */
    --on-brand: #ffffff;
    /* Page watermark strength. Measured on the softened --bg: the seal's lightest
       tone at 5% moves body text 13.70:1 -> 13.82:1 and muted 7.28 -> 7.34 (its
       gold and linework darken the ground, which only helps), so it stays
       comfortably AA. Raise this and re-measure before shipping. */
    --watermark-opacity: .05;
    /* Colours a rendered document may use. Restated in the dark block: a
       document's red has to stay red in both themes, but #C00000 on a dark
       ground is muddy, so each theme gets a tone that actually reads. */
    --doc-red: #c00000;
    --doc-blue: #1a4f9c;
    /* Document text colours sit on --surface (and sometimes --bg), so each is held to 4.5:1
       on BOTH in contrast_check.py. #1a7f4b was 4.40:1 on the cream surface of the first attempt; this is
       6.09 on --surface and 5.63 on --bg. (red 6.04 / 5.58, blue 7.41 / 6.84.) */
    --doc-green: #176b40;
    --doc-mark: #fff3a3;
    --doc-mark-ink: #1a1a1a;
    /* The seal's gold. A background for dark text, never a text colour here. */
    --gold: #f0c102;
    --gold-strong: #d9ae00;
    --gold-ink: #1a1a1a;
    --gold-soft: #ececea;
    /* --ok was #1a7f4b, which measured 4.46:1 on --ok-bg -- under the 4.50:1
       minimum for small text, and it is the colour of the Approved status pill
       as well as every success message. #15703f is 5.10:1 on the softened --ok-bg
       and 5.72:1 on --surface. Found while measuring the new --warn below, not by
       inspection. */
    --ok: #15703f;
    --ok-bg: #e4ece6;
    --err: #b42318;
    --err-bg: #f3e1df;
    /* A third state, for an action that succeeded with a caveat the reader has
       to see -- "updated, but 3 faculty were kept because they had already
       uploaded". Red would read as failure; green would hide the caveat.
       5.76:1. */
    --warn: #8a5300;
    --warn-bg: #f2e8d6;
    /* The readable foreground for an --err BACKGROUND, for the same reason
       --on-brand exists: --err flips from a deep red to a light one between
       themes, so a hard-coded #fff is 6.57:1 here and 2.78:1 there — below
       the minimum for the small bold text it is used on. Measured both ways. */
    --on-err: #ffffff;

    /* Plain links. Nothing declared a colour for <a> before, so every link
       that is not styled as a button fell through to the browser default
       #0000EE. That is fine on white (9.40:1) and all but invisible on the
       dark surface, where it measures 1.76:1 against a 4.50:1 minimum --
       worse than the 2.78:1 that --on-err was added to fix. Same shape of
       solution: one token per theme. */
    --link: #0b5cab;
    --info: #6b5200;
    --info-bg: #ececea;
    /* Status colours: ONE set for every screen (FR-17..FR-20, FR-46). Gray
       Pending, gold Submitted, green Approved, orange Revised (returned for
       revision), red Overdue. Revised used to be red, the same as Overdue, so
       a returned document and a late one read alike; orange separates them and
       red now means Overdue alone. Each status has text on its -bg tint (4.5:1
       floor) and a -fill for chart segments, swatches and borders (3:1 floor
       against --surface). Every pair measured with docs/qa/suites/
       contrast_check.py, which also fails if Revised and Overdue fills match.
       Light (FR-61 grounds): pending 6.45 text / 7.88 fill; submitted 5.91 /
       3.64 (the text is bronze, the fill is gold: gold text on white is
       1.70:1); approved 5.10 / 5.72; revised 5.14 / 3.68; overdue 5.21 / 6.13.
       The solid Overdue chip is --on-err on --err, 6.57:1. */
    --st-pending: #4d4d4d;
    --st-pending-bg: #e1e1dd;
    --st-pending-fill: #4d4d4d;
    --st-submitted: #6b5200;
    --st-submitted-bg: #f1e6b8;
    --st-submitted-fill: #a57a00;
    --st-approved: var(--ok);
    --st-approved-bg: var(--ok-bg);
    --st-approved-fill: var(--ok);
    --st-revised: #9a3d00;
    --st-revised-bg: #f4dac0;
    --st-revised-fill: #d9570b;
    --st-overdue: var(--err);
    --st-overdue-bg: var(--err-bg);
    --st-overdue-fill: var(--err);
    /* Navy sidebar (the client's mockup). Scoped --side-* tokens: the content
       area, gold buttons and bronze accents keep their own. Measured with
       docs/qa/suites/contrast_check.py (light navy #0f2a4a; dark #0b1830):
       text on navy 12.90 / 15.76; labels and sub-links 7.29 / 8.90; text on
       the hover fill 9.82, labels on it 5.54; white on the active pill 4.63
       (so the active label is weight 600+); active pill against navy as a
       non-text mark 3.13 / 3.82; white on the badge red 4.70; badge against
       navy 3.08 / 3.76; focus ring white on navy 14.48 / 17.68 and on the
       pill 4.63. The dark theme reuses the set and only deepens --side-bg. */
    --side-bg: #0f2a4a;
    --side-text: #eef2fa;
    --side-muted: #a9b9d3;
    --side-hover-bg: #1b3d66;
    --side-active-bg: #3273d4;
    --side-active-text: #ffffff;
    --side-rule: #2b4f7d;
    --side-focus: #ffffff;
    --side-badge-bg: #de2a2a;
    --side-badge-text: #ffffff;
    /* Blue accent for the dashboard's charts and links-in-cards (later
       tasks). Light (FR-61, softened grounds): blue on its tint 4.92, on --surface 5.60,
       on --bg 5.17, on a hovered row 5.01. Was #2563c9, which left only 4.50 on the first
       attempt's --bg and 4.46 on its hovered row: no margin on the grounds text-sized blue
       can sit on. */
    --blue: #215fc4;
    --blue-bg: #e3e9f4;
    /* Primary ACTIONS (FR-17..FR-20 restyle): buttons and the selected filter
       tab are blue, as in the client's mockups. Gold stays for the Submitted
       status, the logo and small accents. Light, measured (FR-61 grounds):
       --on-primary on --primary 6.00:1, on --primary-hover 7.72:1; --primary
       on --surface 5.60:1; --primary-hover on --surface 7.19:1. */
    --primary: var(--blue);
    --primary-hover: #1d4fa6;
    --on-primary: #ffffff;
    --shadow: 0 1px 3px rgba(30, 30, 30, .10), 0 1px 2px rgba(30, 30, 30, .06);
    /* The scrim behind the create-form dialog (Round 4 Step 8). Non-text, so it
       is not part of the contrast table; the dark theme restates it. */
    --backdrop: rgba(26, 22, 6, .55);
    /* Sidebar width and the screen width below which it stops being a column.
       Kept as tokens so the layout and its breakpoint are stated once. */
    --sidebar-w: 256px;
    /* The top bar is out of flow, so its height has to be stated: the main
       column pads by it and the watermark insets by it. One token so the
       three cannot drift apart. The bar is given EXACTLY this height
       (.topbar { height }), so the value is a fact rather than a guess:
       3.75rem holds one row (36px avatar block + padding). */
    --topbar-h: 3.75rem;
}
/* Phone (<768px): the bar is two rows, Menu + logo + pill + bell + avatar over
   the search field, and is exactly this tall. Main's top padding, the
   watermark inset and scroll-padding all read the same token, so no content
   can sit under the fixed bar at any width. */
@media (max-width: 767px) {
    :root { --topbar-h: 6.25rem; }
    /* Everything that decides how many rows the bar has lives in this one
       block, so the whole phone layout (<768px) is a single range: the user's
       two text lines hide (the avatar link keeps its aria-label) and the pill
       is capped with an ellipsis, so row 1 (Menu, logo, pill, bell, avatar)
       never outgrows the width and the search never wraps to a third line.
       The .topbar prefix outranks the base rules declared further down. */
    .topbar .topbar-user-text { display: none; }
    .topbar .period-pill { max-width: 9rem; }
    /* The Secretary's select pill (FR-18) is capped the same way; it is NOT
       dropped under 480px like the read-only pill, because it is the only way
       to switch period on a phone (see the 479px block below). */
    .topbar .period-form { max-width: 9rem; }
}

/* FR-61: dark tokens are reachable two ways, and the two blocks below MUST hold
   the same declarations (contrast_check.py and suite_theme_toggle.sh assert it;
   CSS has no way to share one block between a media query and an attribute):
     1. the operating system prefers dark AND the reader has not chosen Light
        (:root:not([data-theme="light"])), which is the default "System" choice;
     2. the reader chose Dark (:root[data-theme="dark"]).
   data-theme is set on <html> by theme-init.js before first paint and by the
   toggle in app.js. Both blocks are SCREEN only, so a dark choice (or a dark
   OS) never prints dark: paper stays on the light tokens. Edit one, edit both. */
@media screen and (prefers-color-scheme: dark) {
    /* On a dark ground the constraint inverts: the seal's gold becomes the
       most legible accent available (10.74:1 on --bg), so --brand IS gold
       here. The neutrals are warmed slightly so white text does not read cold
       against it. */
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --row-hover: #1f2a38;
        --bg: #12151a;
        --surface: #1a1f26;
        --text: #e7e3d8;
        --muted: #a39c88;
        --border: #2e3440;
        --brand: #f0c102;
        --on-brand: #1a1a1a;
        /* Slightly stronger: gold on a dark ground reads fainter. At 6%
           body is 12.91:1 and muted 6.05:1 — still AA. */
        --watermark-opacity: .06;
        --doc-red: #ff8f85;
        --doc-blue: #8ab4f8;
        --doc-green: #6ecf95;
        --doc-mark: #5c4a00;
        --doc-mark-ink: #fdf3cf;
        --gold: #f0c102;
        --gold-strong: #ffd426;
        --gold-ink: #1a1a1a;
        --gold-soft: #2a2410;
        --ok: #4ec27e;
        --ok-bg: #12271b;
        --err: #f0776b;
        --err-bg: #2a1614;
        /* 8.41:1 on its own background. */
        --warn: #f0b429;
        --warn-bg: #2b2210;
        /* 6.26:1 on #f0776b, where white is 2.78:1. */
        --on-err: #1a1a1a;
        /* 7.86:1 on --surface, 8.61:1 on --bg. */
        --link: #8ab4f8;
        --backdrop: rgba(0, 0, 0, .65);
        --info: #f0c102;
        --info-bg: #2a2410;
        /* Status colours, dark theme (see the light block). Measured text on
           -bg / fill on --surface: pending 4.56 / 6.05; submitted 9.08 / 9.73;
           approved 7.01 / 7.37; revised 8.47 / 7.87; overdue 6.18 / 5.96. The
           solid Overdue chip is --on-err on --err, 6.26:1. Approved and
           Overdue follow --ok / --err, which already flip. */
        --st-pending: #a39c88;
        --st-pending-bg: #2e3440;
        --st-pending-fill: #a39c88;
        --st-submitted: #f0c102;
        --st-submitted-bg: #2a2410;
        --st-submitted-fill: #f0c102;
        --st-revised: #ffa466;
        --st-revised-bg: #2e1a0c;
        --st-revised-fill: #ff9a4d;
        /* Navy sidebar, dark theme: only the ground deepens (see the light
           block for every measured pair). --blue on its tint 5.93, on
           --surface 6.27. */
        --side-bg: #0b1830;
        --blue: #6ea0f0;
        --blue-bg: #15233d;
        /* Dark, measured: --on-primary on --primary 6.69:1, on
           --primary-hover (lighter) 8.39:1; --primary on --surface 6.27:1;
           --primary-hover on --surface 7.86:1. */
        --primary: var(--blue);
        --primary-hover: #8ab4f8;
        --on-primary: #0b1830;
    }
}

/* The reader chose Dark: the same tokens as the block above, whatever the OS
   prefers. Keep the two identical (see the note above them). */
@media screen {
    :root[data-theme="dark"] {
        color-scheme: dark;
        --row-hover: #1f2a38;
        --bg: #12151a;
        --surface: #1a1f26;
        --text: #e7e3d8;
        --muted: #a39c88;
        --border: #2e3440;
        --brand: #f0c102;
        --on-brand: #1a1a1a;
        --watermark-opacity: .06;
        --doc-red: #ff8f85;
        --doc-blue: #8ab4f8;
        --doc-green: #6ecf95;
        --doc-mark: #5c4a00;
        --doc-mark-ink: #fdf3cf;
        --gold: #f0c102;
        --gold-strong: #ffd426;
        --gold-ink: #1a1a1a;
        --gold-soft: #2a2410;
        --ok: #4ec27e;
        --ok-bg: #12271b;
        --err: #f0776b;
        --err-bg: #2a1614;
        --warn: #f0b429;
        --warn-bg: #2b2210;
        --on-err: #1a1a1a;
        --link: #8ab4f8;
        --backdrop: rgba(0, 0, 0, .65);
        --info: #f0c102;
        --info-bg: #2a2410;
        --st-pending: #a39c88;
        --st-pending-bg: #2e3440;
        --st-pending-fill: #a39c88;
        --st-submitted: #f0c102;
        --st-submitted-bg: #2a2410;
        --st-submitted-fill: #f0c102;
        --st-revised: #ffa466;
        --st-revised-bg: #2e1a0c;
        --st-revised-fill: #ff9a4d;
        --side-bg: #0b1830;
        --blue: #6ea0f0;
        --blue-bg: #15233d;
        --primary: var(--blue);
        --primary-hover: #8ab4f8;
        --on-primary: #0b1830;
    }
}

* { box-sizing: border-box; }

/* The whole scale hangs off this one number. Everything in the file is sized
   in rem, so raising the root raises type, padding, gaps and the top bar
   together and the proportions survive — which is why this is one declaration
   rather than ninety edited font-sizes. At the old 16px the densest screens
   ran to 12px table headings and 10px pills, which is under what anyone should
   have to read across a desk at a defence. 17px is the smallest step that
   fixes that without making the app feel like a large-print edition.

   A percentage, not a px value: it scales the browser's own font setting
   instead of overriding it, so a reader who has already chosen larger text
   keeps their choice. */
html { font-size: 106.25%; }
/* Anchor jumps and focus scrolling land clear of the fixed top bar. */
html { scroll-padding-top: calc(var(--topbar-h) + .5rem); }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

/* Only the links that nothing else colours. A type selector is weaker than any
   class, so .btn-sm, .sidenav-link and the rest keep their own colours; this
   catches the bare <a>s in prose -- "Version history", the revision-note page
   links, "See what needs revising". :visited comes along with it, because an
   author declaration beats the UA stylesheet whatever its specificity. */
a { color: var(--link); }
/* One keyboard focus ring for every control. Specificity (0,1,1) is lower than
   any per-control `.x:focus-visible` rule below, so those keep their own
   offsets; this only covers the controls that had no ring of their own. */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.wrap {
    /* 900px is the readable measure for a column of prose. Almost nothing here
       is prose: these screens are tables of 6 to 16 columns, and that cap made
       them scroll sideways inside their own box while a third of a 1920px
       screen sat empty beside them. Wide enough now for the widest table to
       land whole, still capped so a large monitor does not stretch a row into
       an unreadable line.

       Forms are unaffected: .form-card keeps its own 480px and centres itself,
       so the sign-in, profile and requirement screens look exactly as before. */
    max-width: 1240px;
    margin: 0 auto;
    padding: 3rem 1.25rem;
}

.hero { text-align: center; margin-bottom: 2.5rem; }

.badge {
    display: inline-block;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    color: var(--on-brand);
    background: var(--brand);
    padding: .3rem .6rem;
    border-radius: 999px;
    margin-bottom: 1rem;
}

.hero h1 { margin: 0 0 .35rem; font-size: 1.9rem; }
.hero .sub { margin: 0; color: var(--muted); font-size: .95rem; }

.cards {
    display: grid;
    /* auto-FILL, not auto-fit: auto-fit collapses the empty tracks in a
       partially-filled row, so a lone card left over on the last row (e.g. the
       4th KPI card at some widths) would stretch to the full grid width and
       read as a different, larger component. auto-fill keeps the empty tracks,
       so every card stays the same width as its neighbours above. */
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    /* Vertical rhythm so stacked sections (e.g. dashboard KPI grid + feature
       grid, or a card grid above a table) never butt directly against each
       other. Block-margin collapse keeps the gap a consistent 1.5rem. */
    margin-bottom: 1.5rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: var(--shadow);
}

.card h2 { margin: 0 0 .5rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.card .status { margin: 0 0 .35rem; font-size: 1.25rem; font-weight: 700; }
.card .detail { margin: 0; font-size: .85rem; color: var(--muted); word-break: break-word; }

.card.ok { border-left-color: var(--ok); }
.card.ok .status { color: var(--ok); }
.card.err { border-left-color: var(--err); background: var(--err-bg); }
.card.err .status { color: var(--err); }
/* Per-status cards (FR-17..FR-20): left border in the status fill, number in
   the status text colour. .card.err stays for genuine errors only. */
/* --card-tint / --card-ink colour the icon circle (.stat-icon-wrap, FR-18/FR-20). */
.card.st-pending   { border-left-color: var(--st-pending-fill);   --card-tint: var(--st-pending-bg);   --card-ink: var(--st-pending); }
.card.st-submitted { border-left-color: var(--st-submitted-fill); --card-tint: var(--st-submitted-bg); --card-ink: var(--st-submitted); }
.card.st-approved  { border-left-color: var(--st-approved-fill);  --card-tint: var(--st-approved-bg);  --card-ink: var(--st-approved); }
.card.st-revised   { border-left-color: var(--st-revised-fill);   --card-tint: var(--st-revised-bg);   --card-ink: var(--st-revised); }
.card.st-overdue   { border-left-color: var(--st-overdue-fill);   --card-tint: var(--st-overdue-bg);   --card-ink: var(--st-overdue); }
.card.st-pending .status   { color: var(--st-pending); }
.card.st-submitted .status { color: var(--st-submitted); }
.card.st-approved .status  { color: var(--st-approved); }
.card.st-revised .status   { color: var(--st-revised); }
.card.st-overdue .status   { color: var(--st-overdue); }

.foot { margin-top: 2.5rem; text-align: center; color: var(--muted); font-size: .85rem; }
.foot code { background: var(--border); padding: .1rem .35rem; border-radius: 4px; }

/* --- Shared app layout: fixed sidebar + content column ---
   The sidebar is a grid column rather than position:fixed so the content
   column's width is computed by the browser and never needs a matching
   margin-left kept in sync by hand. */
.app-shell { min-height: 100vh; }

/* Named areas rather than source order: the top bar has to come BEFORE the
   sidebar in the DOM (so the narrow-screen drawer opens under its own button)
   but must render BESIDE it, above the content column, at desktop. Areas let
   one DOM order serve both, and the narrow-screen override below is a single
   re-declaration instead of a reshuffle. */
.app-shell-auth {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    grid-template-areas:
        "sidebar topbar"
        "sidebar main";
    align-items: start;
    /* Both bars are position:fixed, so neither is in flow and the "topbar" row
       is empty. With the shell at min-height:100vh, the default align-content
       (stretch) then shares the leftover height between the two auto rows —
       which on any page shorter than the window silently pushed the content
       down by half the free space: about 150px of nothing above the page
       title on the faculty checklist. start keeps the spare height at the
       bottom, where it belongs. */
    align-content: start;
}
.app-shell-auth > .topbar { grid-area: topbar; }
.app-shell-auth > .sidebar { grid-area: sidebar; }
.app-shell-auth > .app-main { grid-area: main; }

/* Keyboard users would otherwise walk the whole nav on every page load. */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 10;
    background: var(--brand);
    color: var(--on-brand);
    padding: .6rem 1rem;
    border-radius: 0 0 8px 0;
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
}
.skip-link:focus { left: 0; }

.sidebar {
    /* Fixed, not sticky. Sticky depends on every ancestor staying free of
       `overflow`, and on the grid area being taller than the element — both
       are invisible conditions that a later, unrelated change can break
       without any error. The grid column below still reserves the width, so
       taking the sidebar out of flow does not let content slide under it. */
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    z-index: 30;
    align-self: start;
    /* Own scrollbar: the Secretary's menu plus the account block can outrun a
       short laptop viewport, and the page must not scroll to reach "Log out".
       min-height pins the other end: the grid is align-items:start, so without
       it the panel is only as tall as its own content and stops mid-page. The
       Secretary's longer menu hid that — the Faculty sidebar, being four items,
       ended below the account block with page background showing beneath it.
       min + max together make it exactly one viewport, scrolling inside. */
    min-height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    /* Without this, reaching the end of the sidebar's own scroll hands the
       gesture to the page, so a scroll aimed at the menu silently moves the
       content behind it — and the menu appears to drift on its own. */
    overscroll-behavior: contain;
    /* Navy in both themes (FR-38; the client's mockup). The 1px --border rule
       keeps the edge distinct from the dark surface beside it, and
       color-scheme makes the sidebar's own scrollbar dark. */
    background: var(--side-bg);
    color: var(--side-text);
    color-scheme: dark;
    border-right: 1px solid var(--border);
    /* No bottom padding: the sticky foot's bottom:0 is measured from the
       content box, so a padded bottom left a strip under the foot through which
       scrolled menu items showed. The foot carries the bottom spacing itself. */
    padding: 1.25rem 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* The global :focus-visible ring is --brand, which is invisible on navy. The
   selector is (0,2,0) against the global rule's (0,1,1), so it wins; the
   per-control .sidenav-group-toggle ring is restated below for the same
   reason. White on navy 14.48:1 (light) / 17.68:1 (dark), on the active pill
   4.63:1. */
.sidebar :focus-visible { outline: 2px solid var(--side-focus); outline-offset: 2px; }

.brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    text-decoration: none;
    color: var(--side-text);
}

/* "CCIS" over the system name. Built from $appName in header.php. */
.brand-text { display: flex; flex-direction: column; gap: .1rem; align-items: flex-start; min-width: 0; }
.brand-title { font-weight: 800; font-size: 1.15rem; line-height: 1.1; letter-spacing: .02em; color: var(--side-text); }
.brand-name { font-weight: 500; font-size: .8rem; line-height: 1.25; color: var(--side-muted); }

/* Fixed box so a tall, wide, or not-quite-square logo cannot shift the whole
   sidebar layout; object-fit keeps its aspect ratio inside that box. The seal
   has black linework, so it sits on a white rounded tile (white on black reads
   on navy; the bare seal would not). The tile is white in both themes. */
.brand-logo {
    width: 44px;
    height: 44px;
    flex: none;
    object-fit: contain;
    padding: 3px;
    background: #fff;
    border-radius: 10px;
}

.sidenav { display: flex; flex-direction: column; gap: .15rem; padding-bottom: .5rem; }

.sidenav-heading {
    margin: .9rem 0 .25rem;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--side-muted);
}
.sidenav-heading:first-child { margin-top: 0; }
/* Thin line under the heading-less top pair (Dashboard, Notifications). */
.sidenav-rule { border: 0; border-top: 1px solid var(--side-rule); margin: .6rem 0 0; }

.sidenav-link {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .65rem;
    border-radius: 8px;
    font-size: .875rem;
    font-weight: 600;
    color: var(--side-text);
    text-decoration: none;
}
/* Hover no longer switches the text to --brand (gold on navy was never
   measured and the old pairing is gone): the fill alone says "pointer here". */
.sidenav-link:hover { background: var(--side-hover-bg); }

/* Current page: colour alone would fail WCAG 1.4.1, so it also carries a solid
   fill and a white left bar. White on the pill is 4.63:1, which only passes
   for large or bold text, hence the weight. */
.sidenav-link.is-current {
    color: var(--side-active-text);
    background: var(--side-active-bg);
    font-weight: 700;
    box-shadow: inset 3px 0 0 var(--side-focus);
}

/* --- Status sub-navigation under Review (FR-38) ---
   A level below .sidenav-link rather than three more of them: the indent and
   the rule down the left edge are what say "these belong to the group above",
   which is the whole point of the client's request — four peers in the Review
   group would read as four unrelated screens. The links themselves are still
   .sidenav-link, so `.is-current` needs no second rule set here. */
.sidenav-sub {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    margin: .15rem 0 .15rem .65rem;
    padding-left: .6rem;
    border-left: 1px solid var(--side-rule);
}

.sidenav-sublink {
    padding-top: .35rem;
    padding-bottom: .35rem;
    font-size: .8rem;
}

/* Hide/show toggle for the status group. Deliberately no `display` here: the
   UA's list-item is what draws the native disclosure triangle, which is the
   non-colour open/closed cue (WCAG 1.4.1). */
.sidenav-group-toggle {
    padding: .35rem .65rem;
    border-radius: 8px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--side-muted);
    cursor: pointer;
}
/* Labels on the hover fill are 5.54:1; --side-text there is 9.82:1. */
.sidenav-group-toggle:hover { color: var(--side-text); background: var(--side-hover-bg); }
.sidenav-group-toggle:focus-visible { outline: 2px solid var(--side-focus); outline-offset: 1px; }
.sidenav-group[open] > .sidenav-group-toggle { color: var(--side-text); }
/* The open rule above is (0,3,0) and :hover is (0,2,0); the two now agree on
   colour, but the open-hover rule must still exist: it is the one that states
   the hover colour for the state the Secretary is in on /reviewer/status/*,
   where the group auto-opens, and it keeps working if either rule changes. */
.sidenav-group[open] > .sidenav-group-toggle:hover { color: var(--side-text); }

/* FR-4: the foot of the sidebar holds the page's ONE Log out control and
   nothing else (the account block moved to the top bar). margin-top:auto pins
   it to the bottom of the column; the --side-rule line separates it from the
   menu.

   Sticky to the bottom of the scrolling sidebar (the client's mockups pin it):
   a Secretary menu outruns a 900px-tall viewport, and a static foot sat below
   the fold until the sidebar was scrolled to its end. The opaque --side-bg
   stops scrolled menu items showing through it. At the end of the scroll the
   foot is in its natural place, below the menu, so it never covers the last
   item (.sidenav's padding-bottom keeps a gap above it as well). In the phone
   drawer the sidebar does not scroll internally, so sticky is inert and the
   foot is simply the end of the drawer. */
.sidebar-foot {
    position: sticky;
    bottom: 0;
    z-index: 1;
    margin-top: auto;
    padding: 1rem 0 1.25rem;
    background: var(--side-bg);
    border-top: 1px solid var(--side-rule);
}
/* A button dressed as a .sidenav-link: same size, weight, radius and hover
   fill, so it reads as the last item of the menu. --side-text on --side-bg is
   12.90 light / 15.76 dark; the focus ring is the sidebar's white one. */
.sidebar-logout {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    padding: .5rem .65rem;
    border: 0;
    border-radius: 8px;
    background: none;
    font: inherit;
    font-size: .875rem;
    font-weight: 600;
    color: var(--side-text);
    text-align: left;
    cursor: pointer;
}
.sidebar-logout:hover { background: var(--side-hover-bg); }

/* --- Top bar: persistent at every width ---
   Carries the two controls that must be reachable from any screen without
   opening a menu — the unread-notification indicator (FR-23) and logout
   (FR-4). The "Menu" button and the brand inside it are the narrow-screen
   half: both are hidden here and switched on only under `.js` below the
   sidebar breakpoint, where the sidebar has collapsed into a drawer. At
   desktop the sidebar shows the brand and there is no drawer to open, so the
   bar is just its right-hand actions. */
/* Pinned: the search, the unread count and Log out are wanted at any scroll
   position, and the bar is short enough that holding it costs little height.
   z-index keeps it over the content it scrolls past; the sidebar is a separate
   column so the two never overlap. */
.topbar {
    /* Fixed for the same reason, and because as a grid item its containing
       block was row 1 only — exactly its own height — so sticky had no room to
       travel and it scrolled away even before the rule above clobbered it. */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: .75rem;
    height: var(--topbar-h);
    padding: .55rem 1.25rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.topbar-brand { display: none; align-items: center; gap: .5rem; text-decoration: none; }
.topbar-brand .badge { margin-bottom: 0; }
.topbar-logo { width: 28px; height: 28px; object-fit: contain; }

/* The client's two-line title block (FR-38). --text and --muted on --surface
   are the page's own body pairs. The second line goes first when room runs
   short (under 1280px), the whole block under 1100px, where the search field
   and the right-hand controls need the width. */
.topbar-title {
    display: flex;
    flex-direction: column;
    flex: none;
    line-height: 1.2;
    color: var(--text);
}
.topbar-title-main { font-size: .95rem; font-weight: 700; white-space: nowrap; }
.topbar-subtitle { font-size: .75rem; color: var(--muted); white-space: nowrap; }
@media (max-width: 1279px) {
    .topbar-subtitle { display: none; }
}
@media (max-width: 1099px) {
    .topbar-title { display: none; }
}

/* --- Top-bar search (FR-37) ---
   The one element in the bar that may take the leftover width: flex-basis
   stops it collapsing to nothing between the brand and the icons, and the
   max-width stops it stretching the full width of a desktop, where a
   700px-wide input reads as a mistake rather than a search box. */
.topbar-search {
    display: flex;
    align-items: center;
    gap: .25rem;
    flex: 1 1 12rem;
    /* min-width:0 against the flex default of `auto`: without it the input's
       intrinsic minimum width wins over flex-shrink and the bar overflows
       instead of the field giving way. */
    min-width: 0;
    max-width: 22rem;
}

/* An <input> inherits neither the app's font nor its colours, and the UA
   default border is a different grey from every other control on the page. */
.topbar-search-input {
    flex: 1 1 auto;
    min-width: 0;
    padding: .4rem .65rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-size: .85rem;
}
.topbar-search-input::placeholder { color: var(--muted); }
.topbar-search-input:focus-visible {
    border-color: var(--brand);
    outline: 2px solid var(--brand);
    outline-offset: 1px;
}

/* Also a .topbar-action, so it is the same size and hover as the bell beside
   it; only the label differs, and that one is .sr-only because there is no
   room for a third piece of text in the bar. */
.topbar-search-btn { flex: none; }

/* FR-37 / FR-61: a floor for the field. The bar holds the title block, the search, the period
   pill, the bell, the theme button and the user block, and the search used to be the only thing
   that gave way, so it fell to 75px at 1280 (the placeholder read "Searc") and to 24px at
   768-900. From the tablet layout up the form now keeps 14rem, so the input keeps ~190px (the 145px of text the short
   placeholders need) and the right-hand group is what shrinks: the period label and the user's
   name already ellipsise, they just never had to because min-width:auto held the group at its
   natural width. Under 768px the search owns a full row and the group WRAPS rather than
   shrinks (see the 767px block above), so none of this applies there. */
@media (min-width: 768px) {
    .topbar-search { min-width: 14rem; }
    .topbar-actions { min-width: 0; }
}

/* Around 400px the bar also has to hold Menu + brand + period pill + bell +
   user avatar, so the field takes a row of its own instead of squeezing them
   off the edge. `order` moves it down visually without moving it in the DOM,
   so the tab order stays brand -> search -> pill -> bell -> user at every
   width. */
@media (max-width: 767px) {
    /* Exactly two rows (height is --topbar-h, set above): row 1 Menu, logo and
       the actions, row 2 the search. align-content is flex-start, NOT
       center: if a line ever overflowed, centring would push the first one
       (the Menu button) above the viewport. */
    .topbar { flex-wrap: wrap; align-content: flex-start; row-gap: .5rem; }

    .topbar-search {
        order: 3;
        flex-basis: 100%;
        max-width: none;
    }
}

/* margin-left:auto, not justify-content:space-between — the two controls stay
   pinned to the trailing edge whether or not the Menu button and brand before
   them are rendered at this width. */
.topbar-actions {
    display: flex;
    align-items: center;
    gap: .35rem;
    margin-left: auto;
}

/* One shared appearance for the bell (an <a>) and logout (a <button> inside a
   POST form): both must read as the same kind of control, and a <button>
   inherits neither font nor colour without being told to. */
.topbar-action {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .6rem;
    border: 1px solid transparent;
    border-radius: 8px;
    background: none;
    font: inherit;
    font-size: .85rem;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    cursor: pointer;
}
.topbar-action:hover { color: var(--brand); background: var(--info-bg); }

/* FR-18: the read-only active-period pill. A calendar icon and the label, and
   deliberately NO chevron (a chevron promises a switcher). --blue on --blue-bg
   is measured in contrast_check.py (both themes). The Secretary's is an <a> to
   Periods, the Faculty's a <span>; the label ellipsises rather than pushing
   the bell and the user block off a narrow bar. */
.period-pill {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-width: 0;
    padding: .35rem .75rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--blue-bg);
    color: var(--blue);
    font-size: .8rem;
    font-weight: 600;
    text-decoration: none;
}
.period-pill > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
a.period-pill:hover { border-color: var(--blue); }

/* FR-18 (2026-10-22): the SECRETARY's pill is a form holding a native <select>
   (the Faculty's stays the read-only .period-pill above). It looks like the pill:
   the calendar icon at the left, then the select with its background and border
   removed so the form's --blue-bg shows through, and the browser's own caret at
   the right (native, so it follows the theme and the keyboard behaviour is the
   platform's). Choosing a period submits the form through the existing
   [data-autosubmit] handler. The label ellipsises and the form is capped, so a
   long period name never pushes the bell and the user block off the bar; the
   phone caps are in the 767px and 479px blocks. Tokens only, both themes. */
.period-form {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-width: 0;
    max-width: 17rem;
    margin: 0;
    padding: .35rem .5rem .35rem .75rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--blue-bg);
    color: var(--blue);
    font-size: .8rem;
    font-weight: 600;
}
.period-form:hover { border-color: var(--blue); }
.period-form > svg { flex: none; }
.period-select {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font: inherit;
    text-overflow: ellipsis;
    cursor: pointer;
}
/* The open list is drawn by the platform from these two: without them it
   inherits the pill's blue on --blue-bg in a light list and, in the dark theme,
   dark text on a dark list. */
.period-select option { background: var(--surface); color: var(--text); }
/* The ring belongs around the whole pill, not around the borderless select
   inside it; where :has() is unsupported the global select ring still shows. */
@supports selector(:has(*)) {
    .period-select:focus-visible { outline: none; }
    .period-form:has(.period-select:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
}

/* FR-40: the signed-in user's block, a link to /profile. The avatar frame is
   the shared .avatar; the text lines hide under 1280px (the link keeps an
   aria-label and a title). */
.topbar-user {
    display: flex;
    align-items: center;
    gap: .55rem;
    min-width: 0;
    padding: .2rem .4rem;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
}
.topbar-user:hover { background: var(--info-bg); }
.topbar-user-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.topbar-user-name {
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text);
}
.topbar-user-role { font-size: .72rem; color: var(--muted); white-space: nowrap; }
/* (Under 768px the user text hides and the pill is capped: both rules live in
   the 767px block beside --topbar-h at the top of this file.) Under 1280px it
   hides too: with the theme button in the bar the name and role cost ~120px
   that the search field's floor needs; the link keeps its aria-label and gains
   a title. At 1280px and up the field keeps its floor by the period pill
   shrinking instead. */
@media (max-width: 1279px) {
    .topbar .topbar-user-text { display: none; }
}
/* Under 480px row 1 cannot hold the pill as well as Menu, logo, bell and
   avatar at 320px; the period is still named on the Periods screen and in
   every page it scopes. */
@media (max-width: 479px) {
    .period-pill { display: none; }
}
/* The Secretary's select (FR-18) is NOT dropped there: it is the only way to
   change period on a phone. Row 1 holds Menu, logo, this, the bell and the
   avatar, and the actions group wraps to a row of its own the moment its
   natural width does not fit, so the form's max-width is what keeps the bar to
   two rows: the width left after the other four (about 16rem), never more than
   9rem. Under 400px nothing readable fits (about 3rem is left at 320px), so it
   becomes a calendar button: the select is stretched, invisible, over the icon
   and keeps its label, its keyboard behaviour and its list. */
@media (max-width: 479px) {
    .topbar .period-form {
        max-width: clamp(3rem, calc(100vw - 16rem), 9rem);
        padding-left: .6rem;
    }
}
@media (max-width: 399px) {
    /* 44px square touch target; the select is 16px so iOS does not zoom the page
       when it opens. */
    .topbar .period-form {
        position: relative;
        justify-content: center;
        box-sizing: border-box;
        min-width: 44px;
        min-height: 44px;
        max-width: none;
        padding: .35rem;
    }
    .topbar .period-select {
        font-size: 16px;
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        opacity: 0;
    }
}

/* The icons are inline <svg> (no icon library, and the CSP forbids off-origin
   assets). Everything that paints them lives here rather than on presentation
   attributes, and currentColor means the hover and the dark theme need no
   second rule set. */
.topbar-icon {
    display: block;
    width: 20px;
    height: 20px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* --- FR-61: the theme button (System -> Light -> Dark) ---
   A .topbar-action, so it shares the bell's size, hover and the global
   :focus-visible ring. It is absent until theme-init.js (a script in <head>, so
   before first paint and before app.js) has marked <html> with .theme-ready: a
   button that does nothing is worse than none, and without script the OS
   preference still applies. Setting the hook that early means the button
   reserves its space from the first frame instead of shifting the bar ~40px when
   app.js arrives. All three icons are in the markup and exactly one is shown,
   chosen from the data-theme that theme-init.js has ALREADY set on <html>
   (monitor = System, i.e. no attribute; sun = Light; moon = Dark), so a Dark
   reader never sees the System icon first. These rules sit AFTER .topbar-icon and
   .topbar-action on purpose: same specificity, so source order is what lets
   display:none beat their display. .theme-control wraps button + live region so
   hiding one copy hides its announcer too. */
.theme-control { display: contents; }
.theme-toggle { display: none; justify-content: center; min-width: 2.35rem; min-height: 2.35rem; }
.theme-ready .theme-toggle { display: inline-flex; }
.theme-icon { display: none; }
:root:not([data-theme]) .theme-icon--system { display: block; }
:root[data-theme="light"] .theme-icon--light { display: block; }
:root[data-theme="dark"] .theme-icon--dark { display: block; }
/* The visible "Theme: ..." text is for the phone drawer only. */
.theme-toggle-label { display: none; }
/* Two copies exist for a signed-in page: the top bar's and the drawer foot's.
   From 768px the bar has room and the drawer is a column that does not need it;
   under 768px the bar's first row is full (measured: a 47px button pushed the
   Secretary's period pill onto a third row up to ~440px wide), so the drawer's
   copy is the one shown, as a full-width menu-style row. The drawer copy keeps
   a 44px-ish target (2.75rem is 46.75px at the 17px root). */
.theme-ready .sidebar .theme-toggle { display: none; }
.sidebar-theme { display: none; }
@media (max-width: 767px) {
    .theme-ready .topbar .theme-toggle { display: none; }
    /* Hide the announcer with the button: a role=status span left in the accessibility
       tree would announce every change twice (once per copy). */
    .theme-ready .topbar .theme-control { display: none; }
    .theme-ready .sidebar-theme { display: block; }
    .theme-ready .sidebar .theme-toggle {
        display: flex;
        justify-content: flex-start;
        gap: .5rem;
        width: 100%;
        min-height: 2.75rem;
        padding: .5rem .65rem;
        border: 0;
        border-radius: 8px;
        color: var(--side-text);
        font-size: .875rem;
    }
    .theme-ready .sidebar .theme-toggle:hover { color: var(--side-text); background: var(--side-hover-bg); }
    .sidebar .theme-toggle-label { display: inline; }
}
/* Signed out there is no top bar, so the same button sits in the page corner. */
.auth-theme { position: fixed; top: .75rem; right: .75rem; z-index: 20; }
.auth-theme .theme-toggle { background: var(--surface); border-color: var(--border); color: var(--text); }
.auth-theme .theme-toggle:hover { color: var(--brand); background: var(--info-bg); }

/* Unread count, pinned to the bell's upper-right. Positioned against
   .topbar-action, which is the relatively-positioned box. */
.topbar-badge {
    position: absolute;
    top: .1rem;
    left: 55%;
    min-width: 1.1rem;
    padding: 0 .25rem;
    border-radius: 999px;
    background: var(--err);
    /* --on-err, not #fff: --err flips to a light salmon in the dark theme and
       white on it measures 2.76:1. This badge was missed when --on-err was
       introduced for .nav-badge; same bug, same fix. 6.2:1 dark, 6.5:1 light. */
    color: var(--on-err);
    font-size: .65rem;
    font-weight: 700;
    line-height: 1.1rem;
    text-align: center;
}

/* --- Notifications dropdown (FR-22, FR-23) ---
   The bell opens a panel anchored under it. Everything is a token, so both
   themes follow; the text pairs it uses (--text / --muted / --brand / --link on
   --surface or --info-bg) are measured in contrast_check.py. The bell's open
   state (aria-expanded) and its current-page state (/notifications) share one
   look: --brand on --info-bg, the same as .topbar-action:hover. */
.notif-menu { position: relative; display: flex; align-items: center; }

.notif-bell[aria-expanded="true"],
.notif-bell.is-current {
    color: var(--brand);
    background: var(--info-bg);
}
.notif-bell:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Capped at 22rem and at the viewport (min()), right-aligned under the bell.
   `display: flex` is what the [hidden] guard just below exists for: an author
   `display` beats the UA's `[hidden] { display: none }`, so without the guard
   a "closed" panel would sit open on every page (the fourth time this trap has
   come up in this stylesheet). */
.notif-panel {
    position: absolute;
    top: calc(100% + .5rem);
    right: 0;
    z-index: 25;
    display: flex;
    flex-direction: column;
    width: 22rem;
    max-width: min(22rem, calc(100vw - 1rem));
    max-height: min(70vh, 32rem);
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    font-size: .85rem;
    font-weight: 400;
    text-align: left;
    white-space: normal;
}
.notif-panel[hidden] { display: none !important; }
/* The Mark-all form is shown by script only when something is unread; its own
   display (inline-form) would beat `hidden`, same trap. */
.notif-panel [data-notif-readall][hidden] { display: none !important; }

.notif-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .6rem .8rem;
    border-bottom: 1px solid var(--border);
}
.notif-panel-title { margin: 0; font-size: .95rem; font-weight: 700; color: var(--text); }
/* One line for the result of Mark all; --text on --info-bg is a measured pair.
   A refusal also gets a left rule so it is not told from success by words alone
   being small. `hidden` needs the guard: this rule sets a display of its own. */
.notif-panel-msg {
    display: block;
    margin: 0;
    padding: .5rem .8rem;
    background: var(--info-bg);
    color: var(--text);
    border-bottom: 1px solid var(--border);
}
.notif-panel-msg[hidden] { display: none !important; }
.notif-panel-msg.is-err { border-left: 4px solid var(--err); font-weight: 600; }
.notif-panel-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: .6rem; }
.notif-panel-status { margin: 0; padding: .4rem .3rem; color: var(--muted); }
.notif-panel-foot { padding: .6rem .8rem; border-top: 1px solid var(--border); text-align: center; font-weight: 600; }
.notif-panel-foot a { color: var(--link); }

/* The lifted rows are the notification page's own markup; here they only get
   tighter spacing and wrapping, so a long title or message cannot widen the
   panel. */
.notif-panel .notif-list { gap: .5rem; }
.notif-panel .notif-item { padding: .55rem .65rem; gap: .5rem; }
.notif-panel .notif-title { font-size: .85rem; flex-wrap: wrap; overflow-wrap: anywhere; }
.notif-panel .notif-message { font-size: .8rem; overflow-wrap: anywhere; }
.notif-panel .muted-note { margin: 0; padding: .4rem .3rem; color: var(--muted); }

/* Phone (<768px): the bar is two rows and the bell sits near its right edge, so
   a panel anchored to the bell would run off the left edge of a 320px screen.
   Anchor it to the (full-width, fixed) bar instead: right inset .5rem, width
   the viewport less 1rem, never more than 22rem. */
@media (max-width: 767px) {
    .notif-menu { position: static; }
    .notif-panel {
        top: calc(100% + .25rem);
        right: .5rem;
        width: calc(100vw - 1rem);
        max-width: 22rem;
    }
}

/* display:none by default: the drawer this opens only exists below the sidebar
   breakpoint, and only when app.js is running to re-open it. */
.nav-toggle {
    display: none;
    align-items: center;
    gap: .5rem;
    font: inherit;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text);
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .4rem .7rem;
    cursor: pointer;
}
.nav-toggle:hover { color: var(--brand); border-color: var(--brand); }

/* Three bars drawn from one element: a box plus two shadows, so the button
   needs no icon font and no extra markup. */
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
    display: block;
    width: 16px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before,
.nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -5px; }
.nav-toggle-bars::after { top: 5px; }

/* --- Signed-out brand bar (login screen) --- */
.auth-brandbar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    padding: 2.5rem 1.25rem 0;
}
/* The sign-in screen is the one place the seal is the subject rather than a
   marker, so it is shown at a size where the ring text is actually legible —
   below roughly 64px the wording in the seal turns to mush. */
.auth-logo { width: 132px; height: 132px; object-fit: contain; }
@media (max-width: 480px) {
    .auth-logo { width: 104px; height: 104px; }
}

/* Profile avatar. A fixed circular frame whose single child is what varies:
   .avatar-initials, or an <img class="avatar-img"> (FR-40) — the frame, its
   size and its place in .topbar-user do not move either way. Tokens only, so
   it keeps its contrast in the dark theme without a second rule set. */
.avatar {
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--info-bg);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.avatar-initials {
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .02em;
    line-height: 1;
}
.avatar-img { width: 100%; height: 100%; object-fit: cover; }

/* FR-40 profile-photo card. .avatar-lg is the same circular frame at the size
   the profile screen shows it, so the sidebar and the profile page cannot drift
   apart — only the dimensions and the initials' type size change. Tokens only:
   the dark theme follows without a second rule set. */
.avatar-lg {
    width: 96px;
    height: 96px;
}
.avatar-lg .avatar-initials {
    font-size: 2rem;
}
.photo-row {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}
.photo-actions {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    min-width: 0;
}
.photo-form {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    align-items: flex-start;
}
/* The file input is the control most likely to force a horizontal scrollbar on
   a phone: its rendered width is decided by the browser from the filename, not
   by the layout. Capping it is what keeps the card inside the viewport. */
.photo-form .file-field {
    max-width: 100%;
}

@media (max-width: 480px) {
    .photo-row {
        gap: 1rem;
    }
    .avatar-lg {
        width: 72px;
        height: 72px;
    }
    .avatar-lg .avatar-initials {
        font-size: 1.5rem;
    }
}

.role-pill {
    display: inline-block;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--brand);
    background: var(--ok-bg);
    padding: .15rem .5rem;
    border-radius: 999px;
}

.logout-link {
    font-size: .85rem;
    font-weight: 600;
    color: var(--brand);
    text-decoration: none;
}
.logout-link:hover { text-decoration: underline; }

/* Logout is a POST form (FR-4), so it needs the margin reset a bare <form>
   would otherwise contribute. It lives in .sidebar-foot; its button is styled
   by .sidebar-logout. */
.logout-form { margin: 0; }

/* --- Login --- */
.auth-card {
    max-width: 380px;
    margin: 3rem auto 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 2rem 1.75rem;
    box-shadow: var(--shadow);
    text-align: center;
}

/* The seal inside the sign-in card. Sized so the ring wording is still
   readable (it turns to mush below roughly 64px) without crowding the form. */
.auth-card-logo {
    display: block;
    width: 96px;
    height: 96px;
    margin: 0 auto .25rem;
    object-fit: contain;
}
@media (max-width: 480px) {
    .auth-card-logo { width: 76px; height: 76px; }
}

.auth-card h1 { margin: .75rem 0 .25rem; font-size: 1.4rem; }
.auth-card .sub { margin: 0 0 1.25rem; color: var(--muted); font-size: .85rem; }

.auth-form { text-align: left; }

.field { margin-bottom: 1rem; }
.field label,
.field-label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .3rem; }
.field input {
    width: 100%;
    padding: .55rem .7rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: .95rem;
}
.field input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

.field select {
    width: 100%;
    padding: .55rem .7rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: .95rem;
    font-family: inherit;
}
.field select:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

.field input:disabled,
.field select:disabled,
.form-card textarea:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.field-help { margin: .3rem 0 0; font-size: .85rem; color: var(--muted); }

/* User form (FR-26; design 1.5): the Employment type field applies to Faculty
   accounts only, and app.js adds .is-not-applicable to it while another role is
   chosen. Scoped under .js so that with scripting off nothing is hidden. It is a
   class with its own display rule, NOT [hidden] or disabled: [hidden] loses to
   any author display rule, and a disabled select would not POST its value. */
.js .field.is-not-applicable { display: none; }

/* --- Requirement audience control (FR-35): a radio group where two of the
   three options carry a payload panel underneath. All tokenised, so it follows
   the dark theme without a second rule set. `.is-hidden` is the collapse hook
   app.js toggles — a class, because the CSP forbids inline style attributes.
   Without JavaScript nothing carries the class and every panel stays open,
   which is the progressive-enhancement fallback the form is built for. --- */
.audience-field {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .9rem 1rem 1rem;
}
.audience-field legend {
    font-size: .85rem;
    font-weight: 600;
    padding: 0 .35rem;
}
.audience-field .radio-label,
.audience-field .checkbox-label {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: .92rem;
    font-weight: 400;
    margin: .5rem 0 0;
}
/* .field input is width:100% for text inputs; a radio/checkbox must not be. */
.audience-field input[type="radio"],
.audience-field input[type="checkbox"] { width: auto; flex-shrink: 0; }
.audience-field .field-help { margin: .15rem 0 0 1.55rem; }
/* R6-8 (C23): a <fieldset> defaults to min-inline-size: min-content, so the picker's nowrap labels widened the
   whole form past a 320px viewport (+28px) when "Specific people" was open. Allowing it to shrink lets the
   inner rows wrap or clip inside the field instead of pushing the page. */
.audience-field { min-width: 0; }

/* A standalone checkbox with its label beside it, outside .audience-field --
   the per-subject switch on the requirement form (2026-10-15).
   The same trap as the line above, and it bit: without the width reset the
   checkbox inherits .field input's width:100%, stretches the full width of the
   form card and shoves its own label onto the next line. It looked like a
   stray tick floating above the text. */
.check-field {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    font-weight: 500;
    font-size: .9rem;
    cursor: pointer;
}
.check-field input[type="checkbox"] {
    width: auto;
    flex-shrink: 0;
    /* Nudged down so the box aligns with the cap height of the first line
       rather than the line box, which sits it slightly high. */
    margin-top: .15rem;
}
/* Indented to the label's text, not the checkbox, so the hint reads as
   belonging to the setting rather than starting a new one. */
.check-field + .field-help { margin: .3rem 0 0 1.55rem; }

.audience-panel {
    margin: .5rem 0 .25rem 1.55rem;
    padding-left: .85rem;
    border-left: 2px solid var(--border);
}
.audience-panel.is-hidden { display: none; }

.checkbox-list {
    list-style: none;
    margin: .25rem 0 0;
    padding: 0;
    max-height: 15rem;
    overflow-y: auto;
}
.checkbox-list .muted-note { margin-left: .2rem; }

/* Primary action: blue, as in the client's mockups (it was the seal's gold).
   --on-primary on --primary is 6.00:1 light and 6.69:1 dark. */
.btn-primary {
    width: 100%;
    padding: .65rem 1rem;
    border: none;
    border-radius: 8px;
    background: var(--primary);
    color: var(--on-primary);
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
}
.btn-primary:hover { background: var(--primary-hover); }
/* A disabled primary (e.g. the requirement form's submit while it cannot be
   used) must look inert and must not darken on hover. */
.btn-primary:disabled,
.btn-primary[disabled] { opacity: .55; cursor: not-allowed; }
.btn-primary:disabled:hover,
.btn-primary[disabled]:hover { background: var(--primary); }
/* The global --brand ring is 1.3:1 (light) and 1.6:1 (dark) against blue. A
   --text ring sits across a 2px gap on the page ground, where it measures
   16.38:1 (light) and 14.27:1 (dark) on --bg; see contrast_check.py. */
.btn-primary:focus-visible,
.btn-primary-sm:focus-visible,
.filter-tabs .filter-tab.active:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 2px;
}

.alert { border-radius: 8px; padding: .6rem .8rem; font-size: .85rem; margin: 0 0 1rem; text-align: left; }
.alert-err { background: var(--err-bg); color: var(--err); }
.alert-ok { background: var(--ok-bg); color: var(--ok); }
.alert-warn { background: var(--warn-bg); color: var(--warn); }

/* FR-43 on the review screen: the faculty member's note about this upload,
   sitting above the document actions where the decision is made. The inner
   .upload-comment span is the same one the submission page uses. */
.upload-comment-note { margin: 0 0 .75rem; font-size: .9rem; }

/* --- Password show/hide (2026-10-15) ---------------------------------- */
/* The wrapper is injected by app.js around the input only -- not around the
   whole .field, which also holds the label, the help text and the error line.
   Anything positioned against .field shifts the moment a validation error
   appears underneath it. */
.password-wrap { position: relative; display: block; }

/* Room for the button, so a long password does not run underneath it. */
.password-wrap input { padding-right: 2.6rem; }

.password-toggle {
    position: absolute;
    top: 50%;
    right: .35rem;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--muted);
    cursor: pointer;
}
.password-toggle:hover { color: var(--text); }
/* Visible focus ring: this is a real control and keyboard users have to be
   able to see where they are. Offset inward so it is not clipped by the
   input's own border. */
.password-toggle:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: -2px;
    color: var(--text);
}

/* --- User guide (2026-10-14) ------------------------------------------ */
/* Prose, so it gets a reading measure rather than the full page width. 68ch
   is about 11 words a line, which is where long-form text stops being tiring
   to read. Everything else on this screen is a table or a grid and keeps the
   full width. */
.guide-section { max-width: 68ch; margin: 0 0 2rem; }
.guide-section h3 {
    margin: 1.25rem 0 .4rem;
    font-size: .95rem;
    color: var(--text);
}
.guide-section p { margin: 0 0 .75rem; }

.guide-toc {
    max-width: 68ch;
    margin: 0 0 2rem;
    padding: 1rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.guide-toc ol { margin: 0; padding-left: 1.25rem; }
.guide-toc li { margin: .2rem 0; font-size: .9rem; }

.guide-list, .guide-steps { margin: 0 0 .75rem; padding-left: 1.25rem; }
.guide-list li, .guide-steps li { margin: .35rem 0; }

/* A caveat the reader has to see before acting on the paragraph above it.
   Uses the warn token added with the requirement editor, so there is one
   "pay attention to this" colour in the system rather than two. */
.guide-note {
    margin: .75rem 0;
    padding: .6rem .8rem;
    border-left: 3px solid var(--warn);
    background: var(--warn-bg);
    color: var(--warn);
    border-radius: 0 8px 8px 0;
    font-size: .9rem;
}

/* Question and answer. <dl> rather than a list of bold paragraphs because the
   pairing is the meaning, and a screen reader announces it as such. */
.guide-faq { margin: 0 0 .75rem; }
.guide-faq dt { font-weight: 600; margin: .9rem 0 .2rem; }
.guide-faq dd { margin: 0 0 .2rem; color: var(--muted); }

.guide-foot {
    max-width: 68ch;
    margin: 2.5rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: .85rem;
    color: var(--muted);
}

/* Batch F: the per-subject file list on a checklist row. A grid rather than
   inline spans -- the checklist's action column is narrow and a long filename
   was wrapping underneath its own subject label, so the two read as separate
   entries. Subject takes its natural width, the name takes the rest and wraps
   inside its own cell. */
.subject-file-list { list-style: none; margin: .4rem 0 0; padding: 0; }
.subject-file-list li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: .1rem .5rem;
    align-items: baseline;
    font-size: .85rem;
    margin: 0 0 .35rem;
}
.subject-label { font-weight: 600; color: var(--muted); white-space: nowrap; }
/* Long document names break anywhere rather than forcing the row wider than
   the column that holds it. */
.subject-file-name { overflow-wrap: anywhere; }

/* The review screen's document set. Three aligned columns -- subject, name,
   actions -- so a reviewer reads down the subjects rather than across three
   wrapped lines per file. Replaces the inline list, which put the subject, the
   filename, a version badge and a Download button on one line and wrapped it
   into an unreadable block on any real filename. */
.doc-set-head { margin: .75rem 0 .5rem; font-size: .9rem; }
.doc-set { list-style: none; margin: 0 0 1rem; padding: 0; }
.doc-set-item {
    display: grid;
    grid-template-columns: minmax(5rem, auto) minmax(0, 1fr) auto;
    gap: .5rem .9rem;
    align-items: center;
    padding: .55rem .7rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    margin: 0 0 .4rem;
}
.doc-set-subject { font-weight: 600; font-size: .9rem; }
.doc-set-name { font-size: .88rem; overflow-wrap: anywhere; }
.doc-set-actions { display: flex; gap: .4rem; white-space: nowrap; }
/* Marks the one the frame below is showing, so "View" on that row does not
   look like it would do something different. */
.doc-set-flag {
    display: inline-block;
    margin-left: .4rem;
    padding: .05rem .4rem;
    border-radius: 999px;
    background: var(--brand);
    color: var(--on-brand);
    font-size: .7rem;
    font-weight: 600;
}

/* Narrow screens: the three columns become two rows rather than squeezing the
   buttons to nothing. */
@media (max-width: 640px) {
    .doc-set-item { grid-template-columns: minmax(0, 1fr); gap: .35rem; }
    .doc-set-actions { justify-content: flex-start; }
}

/* --- Role dashboards --- */
/* Left-aligned, like every other page in the system. This was the only screen
   that centred its heading, so arriving at it moved the reading edge, and the
   centred block sat over a left-aligned card grid. The period pill stays an
   inline-block so it still hugs its own text rather than spanning the page. */
/* FR-17: the welcome banner of both dashboards (the client's mockup), which
   holds the page's one <h1>. A light-blue --blue-bg panel; the text pairs
   (--text and --muted on --blue-bg) are measured in contrast_check.py. The text
   column has a 20rem basis, so on a phone the as-of line wraps UNDER it instead
   of squeezing it. The period is in the top bar's pill, not repeated here. */
.dash-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem 1.5rem;
    margin: 1rem 0 1.25rem;
    padding: 1.1rem 1.4rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--blue-bg);
}
.dash-banner-text { flex: 1 1 20rem; min-width: 0; }
.dash-banner h1 { margin: 0 0 .25rem; font-size: 1.5rem; color: var(--text); }
.dash-banner .sub { margin: 0; color: var(--muted); font-size: .9rem; }
.dash-banner-side { display: flex; flex-direction: column; gap: .15rem; }
@media (min-width: 768px) { .dash-banner-side { text-align: right; } }
.dash-period { margin: 0; color: var(--text); font-size: .85rem; font-weight: 600; overflow-wrap: anywhere; }
.dash-asof { margin: 0; color: var(--muted); font-size: .85rem; font-weight: 600; white-space: nowrap; }
/* FR-18: shown only while the dropdown has chosen a period that is not the
   active one; a full-width row of the banner. --text and --link on --blue-bg
   are both measured in contrast_check.py. */
.dash-viewing { flex: 1 1 100%; margin: 0; color: var(--text); font-size: .85rem; font-weight: 600; }
.dash-viewing a { color: var(--link); }

.card .status.muted { color: var(--muted); font-size: .85rem; font-weight: 600; }

/* --- Prominent dashboard call-to-action (e.g. "Open Monitoring Board") --- */
.dash-cta { margin: 0 0 1.5rem; }

/* --- 403 --- */
.error-card { max-width: 480px; margin: 3rem auto 0; text-align: center; }
.error-card .badge.err { background: var(--err); }
.error-card h1 { margin: .75rem 0 .5rem; }
.error-card .sub { color: var(--muted); }

/* --- Narrow screens: the sidebar stops being a column ---
   Two behaviours, deliberately layered so the menu is never unreachable:

   * No JavaScript — the sidebar simply stacks above the content as a normal
     block. Longer to scroll past, but every link works.
   * With JavaScript (app.js puts `.js` on <html> before paint) it collapses
     into a drawer behind the "Menu" button in the mobile header.

   The `.js` scoping is what makes that safe: the collapsed state is only ever
   applied when the script that can re-open it is actually running. */
@media (max-width: 899px) {
    .app-shell-auth {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "topbar"
            "sidebar"
            "main";
    }

    .sidebar {
        position: static;
        /* Stacked block / drawer here, not a full-height column: a viewport of
           min-height would push the page content off-screen below it. */
        min-height: 0;
        max-height: none;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    /* The two narrow-screen halves of the top bar. Scoped to `.js` because
       both only make sense once the drawer exists: without script the sidebar
       below is a plain stacked block that already shows the brand and needs
       no button to reveal it. */
    .js .nav-toggle { display: flex; }
    .js .topbar-brand { display: flex; }

    /* The drawer proper. `display` (not height/transform) so the closed state
       takes no space and its links leave the tab order. Opened it is an OVERLAY:
       fixed under the top bar (so the Menu button that closes it stays in view)
       and scrolling inside itself, because an in-flow drawer opened wherever the
       page happened to be scrolled, pushed the content down, and could not be
       reached from a short landscape screen. top/bottom (not a height) so it is
       exactly the space below the bar; the (0,3,0) selector beats the stacked
       `.app-shell-auth > .sidebar` rule at the foot of this file. */
    .js .sidebar { display: none; }
    .js .nav-open .sidebar {
        display: flex;
        position: fixed;
        top: var(--topbar-h);
        left: 0;
        bottom: 0;
        width: min(22rem, calc(100vw - 3rem));
        height: auto;
        /* The base rule's align-self:start would make a fixed box shrink to its
           content instead of filling top..bottom, so it overran the screen. */
        align-self: stretch;
        min-height: 0;
        max-height: none;
        border-right: 1px solid var(--side-rule);
        box-shadow: 4px 0 18px rgba(0, 0, 0, .35);
    }
    /* The tap-to-close area beside the drawer. Under the drawer (29 < 30) and
       over the page and the bell panel (25). Display, not `hidden`, for the
       usual reason: an author `display` beats the UA's hidden. */
    .js .nav-open .nav-backdrop {
        display: block;
        position: fixed;
        inset: var(--topbar-h) 0 0 0;
        z-index: 29;
        background: var(--backdrop);
    }
}
.nav-backdrop { display: none; }

/* A short screen (a phone on its side: the drawer is only ~270px tall under the
   two-row bar). The pinned foot and the brand block would leave a sliver for the
   links, so: the brand goes (the bar above already shows the logo) and the foot
   is tighter. Measured at 667x375 and 360x500 by phone_menu_chrome_check.js. */
@media (max-width: 899px) and (max-height: 520px) {
    .js .nav-open .sidebar { padding-top: .6rem; gap: .6rem; }
    .js .nav-open .sidebar .brand { display: none; }
    .js .nav-open .sidebar-foot { padding: .4rem 0 .5rem; }
}

/* Tighter gutters on a phone; the desktop rule is a comfortable 3rem. */
@media (max-width: 599px) {
    .wrap { padding: 1.75rem 1rem; }

    /* Around 400px the top bar has to fit Menu + brand + period pill + bell +
       the avatar (its two text lines hide, see .topbar-user-text). */
    .topbar { padding: .55rem .85rem; gap: .5rem; }
}

/* --- Card link (dashboard shortcuts into a feature area) --- */
.card-link { font-weight: 600; color: var(--brand); text-decoration: none; font-size: .85rem; }
.card-link:hover { text-decoration: underline; }

/* --- Admin list pages: heading row + "New ..." action --- */
.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 1rem 0 1.25rem;
}
.page-head h1 { margin: 0 0 .25rem; font-size: 1.5rem; }
/* FR-59: the per-person card's button row. It was a <p>; a <form> cannot live in one, so it is a div that keeps the
   paragraph's own vertical margin (the UA 1em), and the buttons keep their inline flow. */
.page-head-actions { margin: 1em 0; }
.page-head .sub { margin: 0; color: var(--muted); font-size: .9rem; }

/* --- Buttons --- */
.btn-inline { width: auto; display: inline-block; text-decoration: none; text-align: center; }

.btn-sm {
    display: inline-block;
    padding: .35rem .7rem;
    border-radius: 6px;
    font-size: .8rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: inherit;
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}
.btn-secondary:hover { background: var(--bg); }

.btn-danger {
    background: var(--err-bg);
    color: var(--err);
    border-color: var(--err-bg);
}
.btn-danger:hover { opacity: .85; }

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

.inline-form { display: inline; margin: 0; }

/* --- Upload form (faculty checklist Action column) ---
   A block-level flex row, and the line break it forces is now wanted. It used
   to be inline-flex so that Download and Details could sit beside it, which is
   what left those links wrapping to a different place in every row. They are
   wrapped in .action-links below and get a line of their own, so the cell
   reads the same way whatever state the requirement is in: what you can do to
   it, then where you can read about it. */
.upload-form {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
    margin: 0;
}

/* --- Compact file control (faculty checklist Action column, FR-7) ---
   A raw <input type="file"> renders as "Choose File / No file chosen": ~200px
   of vendor chrome inside a table cell, which is what made the Action column
   twice the width of a Download-only row and pushed the whole table into a
   horizontal scrollbar.

   Two states, layered on the `.js` hook app.js sets on <html>, because the
   native control is the only thing that echoes the chosen filename without
   script:

   * no JS  — the native input renders exactly as it always did. The label's
              text is clipped (not removed) so it still names the control.
   * `.js`  — the input shrinks to a focusable 1px box and the label becomes a
              fixed-width button whose text app.js swaps for the filename.

   Either way the form is a plain POST + CSRF + multipart submit; nothing here
   is required for it to work. */
.file-field { display: inline-block; vertical-align: middle; }

.file-field-input {
    font-size: .78rem;
    color: var(--text);
    max-width: 200px;
}

.file-field-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.js .file-field {
    position: relative;
    max-width: 7.5rem;
    padding: .35rem .7rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
}
.js .file-field:hover { background: var(--bg); }

/* The real focus ring: the input itself is invisible, so the ring has to be
   drawn on the box the user actually sees. */
.js .file-field:focus-within { outline: 2px solid var(--brand); outline-offset: 1px; }

/* Clipped, not display:none — a `required` control the browser cannot focus
   makes Chrome refuse the submit outright ("not focusable") instead of showing
   its validation bubble. */
.js .file-field-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.js .file-field-text {
    position: static;
    display: block;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    clip: auto;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* A file is staged but not yet sent — the row's Upload button is still the
   step that matters, so the cue is a colour change, not another control. */
.js .file-field.has-file { border-color: var(--brand); color: var(--brand); }

/* --- Data table --- */
.table-wrap {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

/* A step above the global bump, because the table IS the content on most of
   these screens — the surrounding chrome can afford to stay quieter than the
   data it frames. */
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td {
    /* Row height carries as much legibility as type size does: at the old
       padding a dense table read as a solid block and the eye lost its row. */
    padding: .8rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    /* Every cell gets a definite vertical alignment so a row with mixed
       content heights (e.g. a wrapped two-line Description next to a
       single-line Actions cell) still lines up on one shared baseline
       instead of each cell defaulting to `vertical-align: baseline`.
       .matrix-table th overrides this back to `bottom` further down, for its
       own multi-line column headers. */
    vertical-align: middle;
}
.table th:nth-child(2), .table td:nth-child(2) { white-space: normal; }
.table thead th {
    /* Uppercase and letter-spaced, which costs legibility at small sizes; it
       needs the extra step more than the body rows do. */
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    background: var(--bg);
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--row-hover); }
/* Zebra on long tables. Excluded: .table--paired (any table whose rows come in
   parent + note pairs, .has-note / .checklist-note-row: striping by row would
   stripe the pair apart; EVERY such view must carry the class, and
   suite_icons_and_cards greps that it does), .table--checklist (same, named
   for the original) and .matrix-table (its sticky first column is opaque
   --surface and would not stripe with the row). Hover is restated AFTER the
   stripe with the same :not() chain so it still beats it on specificity. */
.table:not(.table--paired):not(.table--checklist):not(.matrix-table) tbody tr:nth-child(even) { background: var(--bg); }
.table:not(.table--paired):not(.table--checklist):not(.matrix-table) tbody tr:hover { background: var(--row-hover); }
.table-empty { text-align: center; color: var(--muted); white-space: normal; }
/* The Actions cell used to be `display: flex`, which takes a <td> out of
   normal table-cell layout entirely: a flex cell aligns its box to the top
   of the row, ignoring `vertical-align`, while its sibling cells (plain text
   nodes) stay baseline/middle-aligned per normal cell rules — that mismatch
   is what made the action buttons sit visibly higher than the rest of the
   row. Keeping this a normal table cell means it inherits `vertical-align:
   middle` from `.table td` above, so it centers exactly like every other
   cell. Its children (links, <form class="inline-form">, the upload form)
   are already inline / inline-block / inline-flex, so they still sit
   side by side; the `> * + *` rule below replaces the old flexbox `gap` with
   ordinary margins since normal inline flow has no `gap` property. */
.table-actions {
    white-space: nowrap;
}
.table-actions > * {
    vertical-align: middle;
}
.table-actions > * + * {
    margin-left: .5rem;
}

/* --- Faculty checklist table (FR-6) ---
   This table carries more per row than any other in the system: a title, a
   type, a deadline, a status, a date, an upload control, a note field and
   three links. The rules below are what keep that inside the page width
   without a horizontal scrollbar and without any two rows reading
   differently.

   1. Requirement is the only prose column, so it is the only one allowed to
      wrap, and it takes the width the Document Type column used to hold —
      that column is gone, folded into a second line under the title. A nowrap
      title was reserving its full single-line width before the Action column
      had been measured at all, which is what produced three-line titles next
      to a two-word type.
   2. Deadline has to be put back to nowrap. It is now the second column, and
      `.table td:nth-child(2)` makes the second column of every table wrap —
      a rule written when Document Type was sitting there.
   3. One declared width for every Action cell, so a Pending row and an
      Approved row do not each size to their own content. */
@media (min-width: 641px) {
    .table--checklist th:first-child,
    .table--checklist td:first-child { white-space: normal; width: 34%; }

    .table--checklist th:nth-child(2),
    .table--checklist td:nth-child(2) { white-space: nowrap; }

    /* The Overdue badge on its own line under the date. On one nowrap line
       with it, "Oct 15, 2026 OVERDUE" is the widest unbreakable run in the
       table after the Action cell, and an auto-layout table reserves that
       width in every row — including the rows with no badge at all. Stacking
       it takes the column from about 195px down to about 120px, which is the
       width the Requirement column gets back. max-content so the pill is as
       wide as its own word and not as wide as the cell. */
    .table--checklist td:nth-child(2) .overdue {
        display: block;
        width: max-content;
        margin: .25rem 0 0;
    }

    .table--checklist .table-actions { width: 15.5rem; }
}

/* 4. And one shared rhythm inside the Action cell at every width: the upload
   form on its own line, then every link that only reads — View, Download,
   Details, in that order — on the next. Overriding .table-actions' nowrap and
   its `> * + *` left margin, both of which assume a single inline run of
   buttons. */
.table--checklist .table-actions { white-space: normal; }
.table--checklist .table-actions > * + * { margin-left: 0; }
.table--checklist .upload-form + .action-links { margin-top: .5rem; }

/* 5. And within the upload form, two lines rather than three: the picker and
   Upload together, the comment field beneath them. The comment is free text —
   fifteen characters of it is useless — so it is the one control that takes a
   line of its own, and `order` puts it last so it wraps there instead of
   splitting the two buttons. This was the tallest part of the cell: picker,
   comment and Upload each claimed a line, and with View / Download / Details
   under them a Pending row ran to five. */
.table--checklist .upload-form .file-field { flex: 1 1 auto; min-width: 0; }
.table--checklist .upload-form .upload-submit { flex: 0 0 auto; }
.table--checklist .upload-form .upload-note { order: 3; margin: 0; }

/* --- Secretary dashboard (FR-17..FR-20 figures; scoped, .cards untouched) ---
   Three headline measures, then one status panel whose four tiles replace the
   four old status cards (the old legend repeated the same numbers). Every
   colour is an existing token, so both themes are covered without new ones. */
.dash-measures {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.measure {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: var(--shadow);
}
.measure h2 { margin: 0 0 .35rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.measure-value {
    margin: 0 0 .6rem;
    font-size: 2.25rem;
    line-height: 1.1;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}
.measure--alert .measure-value { color: var(--err); }
.measure-detail { margin: .6rem 0 0; font-size: .85rem; color: var(--muted); }
.measure > .measure-value + .measure-detail { margin-top: 0; }
.meter {
    width: 100%;
    height: .55rem;
    display: block;
    border-radius: 999px;
    overflow: hidden;
    background: var(--border);
}
.meter rect.meter-fill--progress   { fill: var(--st-submitted-fill); }
.meter rect.meter-fill--compliance { fill: var(--st-approved-fill); }

.dash-status { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem; box-shadow: var(--shadow); }
.dash-status .section-title { margin-top: 0; }
/* Stacked dashboard panels share one rhythm. Scoped to the adjacency rather
   than given to .dash-status itself, so the single panel that shipped before
   these two keeps its existing spacing. */
.dash-status + .dash-status { margin-top: 1.5rem; }

/* --- "Needs attention": who is behind (FR-16/FR-17 refinement, 2026-10-14) --- */
.behind-list { list-style: none; margin: 1rem 0 .75rem; padding: 0; }
.behind-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: baseline;
    gap: .15rem .75rem;
    padding: .55rem .65rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
}
/* The same hover pair as .sidenav-link, already proven in both themes. */
.behind-row:hover { background: var(--info-bg); color: var(--brand); }
.behind-row:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.behind-name { font-weight: 600; }
.behind-detail { grid-column: 1; font-size: .82rem; color: var(--muted); }
/* A returned document is the most urgent case on this list: the faculty member
   is waiting on nothing but themselves, and the clock is running. */
.behind-returned { color: var(--st-revised); }
.behind-count {
    grid-row: 1 / span 2;
    grid-column: 2;
    align-self: center;
    min-width: 1.75rem;
    text-align: center;
    font-size: 1.15rem;
    font-weight: 700;
}

/* --- "By document type": what the college as a whole is behind on --- */
.doctype-list { list-style: none; margin: 1rem 0 .75rem; padding: 0; display: grid; gap: .7rem; }
.doctype-row {
    display: grid;
    grid-template-columns: minmax(7rem, 14rem) 1fr auto;
    align-items: center;
    gap: .75rem;
}
.doctype-name { font-size: .88rem; }
.doctype-meter { margin: 0; }
.doctype-figure { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.doctype-detail { margin-left: .4rem; font-weight: 400; font-size: .8rem; color: var(--muted); }

/* One column on a phone: three columns at 360px leaves the name two characters
   and the bar none. */
@media (max-width: 640px) {
    .doctype-row { grid-template-columns: 1fr auto; }
    .doctype-meter { grid-column: 1 / -1; }
}

/* --- Secretary dashboard stat cards (FR-18, FR-20; 2026-10-21 refresh) ---
   Six linked cards. Colour comes from the .card.st-* rules above (tokens, both
   themes); the icon takes --card-ink from .stat-icon-wrap. The
   grid's minimum is capped at the container width so a 375px screen gets one
   column with no horizontal scroll. */
.dash-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
/* Modifier grid (2026-10-21): the card count is known (five, on both
   dashboards), so the columns are set per width instead of auto-fill, which left
   an orphan card. All tracks are minmax(0, 1fr) so a long note never widens a
   column. */
.dash-cards--5 {
    grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 480px) {
    .dash-cards--5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .dash-cards--5 > :last-child { grid-column: 1 / -1; }
}
@media (min-width: 768px) {
    .dash-cards--5 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .dash-cards--5 > :last-child { grid-column: auto; }
}
@media (min-width: 1280px) {
    .dash-cards--5 {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}
.stat-card { display: block; color: var(--text); text-decoration: none; min-width: 0; }
.stat-card:hover { background: var(--gold-soft); }
.stat-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.stat-card .status { font-size: 2.25rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-head { display: flex; align-items: center; gap: .5rem; margin: 0 0 .5rem; color: var(--muted); }
.stat-head h2 { margin: 0; }
/* The icon sits in a tinted circle; tint and ink come from the card's status
   (--card-tint / --card-ink), with a neutral default for an unstatused card. */
.stat-icon-wrap {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--card-tint, var(--info-bg));
    color: var(--card-ink, var(--brand));
}
.stat-icon {
    flex: 0 0 auto;
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* --- Chart row (FR-17, FR-18; 2026-10-22 mockup round) ---
   One row of panels under the stat cards: stacked under 768px, two columns from
   768px (a third panel wraps below), three (1fr 1.2fr 1fr) from 1200px. Tracks
   are minmax(0, ..) so a long label never widens a column. Colour is on the
   classes (CSP: no inline style), tokens only, both themes. */
.dash-charts {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
@media (min-width: 768px) {
    .dash-charts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (min-width: 1200px) {
    .dash-charts {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr);
    }
}
/* The Faculty chart row has two panels (donut, bars), so it stays two equal
   columns at 1200px instead of the Secretary's three. Matched by content (no
   third panel) rather than a modifier class, so the row's markup is the same
   for both roles. Higher specificity than the 1200px rule above. (FR-17, FR-18) */
@media (min-width: 1200px) {
    .dash-charts:not(:has(.chart-panel:nth-child(3))) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
.chart-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
    min-width: 0;
    /* The three panels share a grid row and so one height (the tallest). A flex
       column lets the visual take the spare height and sit in the middle of it
       instead of leaving an empty block under the donut or the bars. */
    display: flex;
    flex-direction: column;
}
.chart-panel h2 { margin: 0 0 .75rem; font-size: 1rem; color: var(--text); }
/* R6-8 (C22): the Document Status panel's text alternative is a <table class="sr-only">. It is absolutely
   positioned, and with no positioned ancestor its containing block was the page, so its min-content width (a
   table cannot shrink below it) pushed the document +30px wide at 320px and +3px at 375px. The panel is its
   containing block now, and overflow: clip (not hidden: no scroll container, so the grid row heights are
   unchanged) keeps whatever is wider than the panel from reaching the page. Nothing inside a chart panel is
   focusable, so no focus ring can be cut off. */
.chart-panel { position: relative; overflow: clip; }
.chart-panel .donut-body,
.chart-panel .bars-body {
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
}
.chart-panel .bars-body { display: flex; }
.chart-panel .donut-body { align-content: center; }
/* A small muted line under a panel's heading (replaces a full-size paragraph). */
.chart-caption { margin: -.5rem 0 .5rem; font-size: .75rem; color: var(--muted); }

/* Submission Progress donut: the ring on a phone, the legend beside it from
   480px. The arc is --blue (green means Approved here) on a --st-pending-bg
   track; the percentage and the legend carry the same information in text. */
.donut-body {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem 1.25rem;
}
.donut {
    flex: none;
    width: 9.5rem;
    height: 9.5rem;
}
/* From 1200px the ring's panel is the narrow first of three columns; a smaller
   ring lets the legend sit beside it. Below that the ring keeps 9.5rem. */
@media (min-width: 1200px) {
    .donut { width: 8rem; height: 8rem; }
}
/* From 1400px the first column is about 307px inside its padding: a 9.5rem ring
   (152px) plus the 7rem legend and the gap (about 284px) still fits beside it,
   and the larger ring keeps the panel close in height to its neighbours. */
@media (min-width: 1400px) {
    .donut { width: 9.5rem; height: 9.5rem; }
}
.donut-track { stroke: var(--st-pending-bg); }
.donut-arc { stroke: var(--blue); }
.donut-pct {
    fill: var(--text);
    font-size: 7.5px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.donut-sub {
    fill: var(--muted);
    font-size: 3.4px;
}
.donut-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .5rem;
    font-size: .88rem;
    color: var(--text);
    min-width: 0;
    flex: 1 1 7rem;
}
.donut-legend li { display: flex; align-items: center; gap: .5rem; }
.donut-swatch {
    flex: none;
    width: .8rem;
    height: .8rem;
    border-radius: 50%;
}
.donut-swatch--uploaded { background: var(--blue); }
.donut-swatch--rest { background: var(--st-pending-bg); border: 1px solid var(--border); }
.donut-legend-total { padding-left: 1.3rem; color: var(--muted); }

/* FR-38 / FR-17..FR-20: icon() output. Same stroke as .stat-icon. */
.nav-icon {
    flex: none;
    width: 1.1rem;
    height: 1.1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
/* The per-page sprite. Deliberately NOT display:none -- a display:none SVG
   breaks <use> references into it in some browsers. */
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Document Status vertical bars (Task 4). The chart is server-drawn SVG: the
   geometry is in attributes, the colour is here. The four status bars take their
   --st-*-fill; Overdue is a SOLID --st-overdue-fill bar (as in the client's
   chart) kept in its own group and captioned "also counted above", so it never
   reads as a fifth status. Gridlines are decorative (--border); the numbers and
   labels are --text / --muted on the panel's --surface (contrast_check.py). The
   svg scales with its panel (height auto from the 320-unit-wide viewBox), so
   one unit is about 1px at a 340px panel (375px phone: tick/label 10.5 units
   -> about 11px, the 10-unit note about 10px) and about 0.85px at the narrowest
   (320px phone, ~270px panel: 8.5-9px). Text is never below 10 units. */
.bars { width: 100%; height: auto; max-height: 13rem; display: block; }
.bars-grid { stroke: var(--border); stroke-width: 1; }
.bars-divider { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 3; }
.bars-tick { fill: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.bar-pending   { fill: var(--st-pending-fill); }
.bar-submitted { fill: var(--st-submitted-fill); }
.bar-approved  { fill: var(--st-approved-fill); }
.bar-revised   { fill: var(--st-revised-fill); }
.bar-overdue   { fill: var(--st-overdue-fill); }
.bar-value { fill: var(--text); font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bar-label { fill: var(--text); font-size: 10.5px; }
.bar-flag-note { fill: var(--muted); font-size: 10px; }

/* Compliance Rate by Program: name | track + blue fill | percentage. The track is
   an svg with a rounded --blue-bg background (the same trick as .meter); the
   fill rect is --blue, so it needs no inline style. */
.program-bars { list-style: none; margin: .25rem 0 0; padding: 0; display: grid; gap: .55rem; align-content: center; flex: 1 1 auto; }
.program-bar-row {
    display: grid;
    grid-template-columns: minmax(4.5rem, 7rem) minmax(2rem, 1fr) 3rem;
    align-items: center;
    gap: .5rem;
}
.pb-name { font-size: .82rem; line-height: 1.25; overflow-wrap: anywhere; }
.pbar {
    width: 100%;
    height: .6rem;
    display: block;
    border-radius: 999px;
    overflow: hidden;
    background: var(--blue-bg);
}
.pbar-fill { fill: var(--blue); }
.pb-pct {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.pb-detail { font-size: .75rem; font-weight: 400; color: var(--muted); }

/* Document-count "Needs attention": one row per outstanding kind. */
.attn-list { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .25rem; }
.attn-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
    padding: .55rem .65rem;
    border-left: 4px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
}
.attn-row:hover { background: var(--info-bg); color: var(--brand); }
.attn-row:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.attn-row.st-pending   { border-left-color: var(--st-pending-fill); }
.attn-row.st-submitted { border-left-color: var(--st-submitted-fill); }
.attn-row.st-revised   { border-left-color: var(--st-revised-fill); }
.attn-row.st-overdue   { border-left-color: var(--st-overdue-fill); }
.attn-label { font-weight: 600; }
/* FR-18: marks a link that opens an ACTIVE-period screen while another period
   is being viewed. Muted text, not colour alone: the words say it. */
.link-scope { color: var(--muted); font-size: .78rem; font-weight: 600; }
.attn-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .5rem; min-width: 0; }
.attn-note { flex-basis: 100%; font-size: .78rem; color: var(--muted); }
/* --- Secretary dashboard layout (FR-17, FR-18; 2026-10-22 mockup round) ---
   The dashboard gets the wider 1400px measure so the five cards and the three
   chart panels fit the first screen at 1440px. Recent Submissions beside Needs
   Attention is stacked under 1200px and 2fr 1fr from 1200px; Faculty behind
   beside By document type is stacked, then two equal columns. Tracks are
   minmax(0, ..) so a long name never widens a column. */
.wrap:has(.dash-board) { max-width: 1400px; }
.dash-split,
.dash-lower {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
@media (min-width: 1200px) {
    .dash-split { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
}
@media (min-width: 1200px) {
    .dash-lower { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* The panels sit in a grid, which supplies the gap: drop the stacked-panel margin. */
.dash-split > .dash-status,
.dash-lower > .dash-status { margin-top: 0; min-width: 0; }
/* Panels in one row share the tallest one's height. Make each a flex column
   whose main list takes the spare height and spreads its rows evenly (equal
   rows, 1fr), with the footer note pinned under it, so the shorter panel looks
   filled on purpose instead of ending in a blank block (2026-10-22). */
.dash-split > .dash-status,
.dash-lower > .dash-status { display: flex; flex-direction: column; }
.attn-panel .attn-list,
.dash-lower .doctype-list { flex: 1 1 auto; grid-auto-rows: 1fr; align-content: stretch; }
.attn-panel .attn-list > li { display: flex; }
.attn-panel .attn-list .attn-row { flex: 1 1 auto; align-items: center; }
.dash-lower .doctype-row { align-items: center; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: 0 0 .75rem; }
.panel-head h2 { margin: 0; font-size: 1rem; color: var(--text); }
.panel-link { font-size: .85rem; font-weight: 600; color: var(--link); text-decoration: none; white-space: nowrap; }
.panel-link:hover { text-decoration: underline; }
/* The table must fit its panel (about 694px at 1440 in the 2fr column) with no
   sideways scroll: every cell wraps normally (the global .table nowrap is
   overridden), padding is tighter, and the program rides under the name. Only
   the status pill and the action button stay on one line, and they are short. */
.recent-table { table-layout: auto; }
.recent-table th,
.recent-table td { white-space: normal; padding: .7rem .6rem; }
/* Data may break anywhere (a long name); a column heading wraps only between words. */
.recent-table td { overflow-wrap: anywhere; }
.recent-table th { overflow-wrap: normal; }
.recent-table .recent-name { display: block; font-weight: 600; }
.recent-table .recent-sub { display: block; font-size: .78rem; color: var(--muted); }
.recent-table .btn-sm { white-space: nowrap; }
/* The panel is already the card: drop the table wrapper's own border, radius and shadow. */
.recent-panel .table-wrap { box-shadow: none; border: 0; border-radius: 0; background: none; }
.attn-badge {
    display: inline-block;
    margin-left: .4rem;
    padding: .05rem .5rem;
    border-radius: 999px;
    background: var(--err);
    color: var(--on-err);
    font-size: .72rem;
    font-weight: 700;
    vertical-align: middle;
}
.attn-panel .attn-list { margin-top: 0; }
/* The tip bar: a blue-tinted strip with the hint and the way to the board. */
.tip-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 1.25rem;
    margin: 1.5rem 0 0;
    padding: .75rem 1rem;
    background: var(--blue-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
}
.tip-text { margin: 0; flex: 1 1 20rem; font-size: .88rem; }
.tip-btn { display: inline-flex; align-items: center; gap: .45rem; flex: none; }
.tip-btn .nav-icon { width: 1rem; height: 1rem; }
.attn-count { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Zero requirements: an explanation and the action, not a wall of zeros. */
.dash-empty {
    margin-bottom: 1.5rem;
    padding: 2rem 1.5rem;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 10px;
}
.dash-empty h2 { margin: 0 0 .5rem; font-size: 1.15rem; }
.dash-empty p { margin: 0 0 1.1rem; max-width: 42rem; color: var(--muted); }

.action-links { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }

/* The title and its document type, stacked. The type is a label for the line
   above it, not a value anyone scans down the page, which is why it gave up
   its column. */
.checklist-title { display: block; font-weight: 600; line-height: 1.35; }
.checklist-subtitle {
    display: block;
    margin-top: .15rem;
    font-size: .78rem;
    color: var(--muted);
}

/* --- Faculty checklist: the reviewer's message on a returned requirement ---
   Its own row spanning the table, rather than a paragraph inside the Status
   cell. The message is prose: in that column it had about fifteen characters
   to a line and made Status the tallest cell in the row. The row above it
   carries .has-note, which drops the border between the two so they read as
   one item, and extends the hover highlight across both. */
.table--checklist tr.has-note > td { border-bottom: none; padding-bottom: .45rem; }
.checklist-note-row > td { padding-top: 0; }
.table--paired tr.has-note:hover,
.table--paired tr.has-note:hover + .checklist-note-row { background: var(--row-hover); }
.checklist-note {
    margin: 0;
    padding: .5rem .75rem;
    font-size: .85rem;
    line-height: 1.5;
    white-space: normal;
    background: var(--err-bg);
    border-left: 3px solid var(--err);
    border-radius: 0 6px 6px 0;
}
.checklist-note strong { color: var(--err); font-weight: 700; }
.checklist-note a { margin-left: .35rem; white-space: nowrap; }

/* --- Status pill --- */
.status-pill {
    display: inline-block;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .04em;
    padding: .15rem .5rem;
    border-radius: 999px;
}
.status-pill-active { color: var(--ok); background: var(--ok-bg); }
.status-pill-inactive { color: var(--muted); background: var(--border); }

/* --- Submission status pills (faculty checklist) --- */
.status-pill-pending { color: var(--st-pending); background: var(--st-pending-bg); }
.status-pill-submitted { color: var(--st-submitted); background: var(--st-submitted-bg); }
.status-pill-approved { color: var(--st-approved); background: var(--st-approved-bg); }
.status-pill-revised { color: var(--st-revised); background: var(--st-revised-bg); }
/* Non-colour cue (WCAG 1.4.1): a glyph per status, so the five are told apart
   without relying on hue. Decorative, hence generated content. */
.status-pill-pending::before   { content: "\25CB\00a0"; }  /* circle */
.status-pill-submitted::before { content: "\25D4\00a0"; }  /* quarter-filled circle */
.status-pill-approved::before  { content: "\2713\00a0"; }  /* check */
.status-pill-revised::before   { content: "\21A9\00a0"; }  /* return arrow */

/* --- Overdue marker (faculty checklist). A SOLID chip, unlike the tinted
   status pills: Overdue is a flag that crosses the four statuses, and it is
   the only red in the set. .chip-overdue is the name new screens use. --- */
.overdue,
.chip-overdue {
    display: inline-block;
    margin-left: .4rem;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--on-err);
    background: var(--st-overdue-fill);
    white-space: nowrap;
    padding: .05rem .4rem;
    border-radius: 999px;
}
.overdue::before,
.chip-overdue::before { content: "!\00a0"; }

.muted-note { color: var(--muted); font-size: .85rem; }

/* --- Create/edit forms (document types, etc.) --- */
.form-card {
    max-width: 480px;
    margin: 1rem auto 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 2rem 1.75rem;
    box-shadow: var(--shadow);
}
.form-card h1 { margin: .75rem 0 1.25rem; font-size: 1.3rem; }
/* The profile page stacks two form-cards, each headed by an h2 rather than the
   badge + h1 every single-card page uses. Without this the UA default renders
   those h2s LARGER than the h1 titles on every other form screen. */
.form-card h2 { margin: 0 0 1.25rem; font-size: 1.3rem; }
/* Keep the app's 1.5rem vertical rhythm between stacked cards; .form-card sets
   no bottom margin, so two in a row would otherwise sit 1rem apart. */
.form-card + .form-card { margin-top: 1.5rem; }

.form-card textarea {
    width: 100%;
    padding: .55rem .7rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: .95rem;
    font-family: inherit;
    resize: vertical;
}
.form-card textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

.field-err { margin: .3rem 0 0; font-size: .8rem; color: var(--err); }

.form-actions { display: flex; align-items: center; gap: .75rem; margin-top: 1.5rem; }

/* --- Reviewer queue: document-type filter --- */
.filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: .75rem;
    margin-bottom: 1rem;
}
.filter-form .field { margin-bottom: 0; min-width: 220px; }

/* --- Review detail page: submission metadata --- */
.review-meta {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.meta-list {
    display: grid;
    /* auto-FILL for the same reason as .cards: auto-fit collapses the empty
       tracks on a partially-filled last row, so a metadata list whose item
       count is not a multiple of the column count (the document-detail page
       has 8 items over 3 columns) would stretch its final entries to full
       width and read as a different kind of field. */
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: .9rem 1.5rem;
    margin: 0 0 1rem;
}
.meta-list div { margin: 0; }
.meta-list dt {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    margin: 0 0 .2rem;
}
.meta-list dd { margin: 0; font-size: .95rem; }

/* --- Review history --- */
.review-history { margin-bottom: 1.5rem; }
.review-history h2 { font-size: 1.05rem; margin: 0 0 .75rem; }

.history-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .75rem; }
.history-list li {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .75rem 1rem;
}
.history-meta { margin-left: .5rem; font-size: .8rem; color: var(--muted); }
.history-comment { margin: .5rem 0 0; font-size: .9rem; }

/* --- Decision form (review detail page) --- */
.decision-form-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow);
}

.decision-form .field { margin-bottom: 1.25rem; }
.decision-form .radio-label {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-weight: 400;
    font-size: .9rem;
    margin: .3rem 1.25rem .3rem 0;
}
.decision-form .radio-label input { width: auto; }
.decision-form textarea {
    width: 100%;
    padding: .55rem .7rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: .95rem;
    font-family: inherit;
    resize: vertical;
}
.decision-form textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

/* --- Admin monitoring board (FR-17..FR-20) --- */
.section-title { font-size: 1.05rem; margin: 2rem 0 .75rem; }

/* position: relative makes the wrapper the containing block for the sr-only
   "Not required" spans in .matrix-none cells (position: absolute). Without it
   they escape the wrapper's overflow clipping and stretch the page sideways. */
.matrix-wrap { margin-bottom: 2rem; position: relative; }

.matrix-table th { white-space: normal; vertical-align: bottom; min-width: 150px; }
.matrix-table th:first-child, .matrix-table td:first-child { text-align: left; min-width: 160px; }
.matrix-table td.matrix-cell { white-space: nowrap; text-align: center; }

.matrix-faculty-col {
    position: sticky;
    left: 0;
    background: var(--surface);
}
/* Task 12: the header band is --blue-bg (opaque in both themes), the same
   ground as the thead cells beside it, so the sticky corner cell hides what
   scrolls under it. */
.matrix-table thead .matrix-faculty-col { background: var(--blue-bg); }

.matrix-col-meta {
    display: block;
    font-size: .7rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--muted);
    margin-top: .15rem;
}

.matrix-cell-overdue { box-shadow: inset 0 0 0 2px var(--st-overdue-fill); border-radius: 4px; }

/* --- Nav count badge ---
   (The sidebar Notifications link and its position rule were removed in
   Task 10: the topbar bell opens a dropdown. That rule had once painted the
   link grey on navy; with no such element left there is nothing for it to do.) */

/* A count carried by a navigation item: unread notifications, and documents
   waiting in the review queue. Named for what it is rather than for the first
   screen that needed one — the same reasoning as .filter-tabs. */
/* `hidden` is only a UA `display: none`, and both badges set their own
   display, which beats it -- leaving a stale bubble on every page. Scoped to
   these two selectors rather than declared globally, the same reasoning as the
   .live-search guard. */
.nav-badge[hidden],
.topbar-badge[hidden] { display: none !important; }

.nav-badge {
    display: inline-block;
    margin-left: .3rem;
    font-size: .7rem;
    font-weight: 700;
    color: var(--on-err);
    background: var(--err);
    padding: .05rem .45rem;
    border-radius: 999px;
}

/* In the sidebar, with an icon in front, the badge pushes ITSELF to the right
   edge (the dashboard's "Needs attention" heading also uses .nav-badge, in a
   block, where auto would remove its gap -- hence the scope). */
.sidenav-link .nav-badge { margin-left: auto; }

/* In the sidebar the badge is red-on-navy with its own tokens: --err flips to
   salmon in the dark theme and was only ever measured against the light
   surface. White on the badge 4.70:1; the badge against navy is a 3:1
   non-text mark at 3.08 light / 3.76 dark. Scoped to .sidebar so the
   dashboard heading's badge and the top-bar badge are unchanged. */
.sidebar .nav-badge {
    background: var(--side-badge-bg);
    color: var(--side-badge-text);
}

/* A sidebar link whose label and count sit at opposite ends, so the numbers
   line up down the menu instead of trailing labels of different lengths. */
.nav-count-link {
    display: flex;
    align-items: center;
    /* flex-start, not space-between: with an icon first, space-between would
       strand the label in the middle. .nav-badge's margin-left:auto does the
       pushing instead. */
    justify-content: flex-start;
    gap: .5rem;
}

/* --- Notification center (FR-22, FR-23) --- */
.notif-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .75rem; }

.notif-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .85rem 1rem;
}

.notif-item.unread {
    border-left: 4px solid var(--brand);
    background: var(--info-bg);
}

.notif-body { flex: 1; min-width: 0; }

.notif-title {
    margin: 0 0 .25rem;
    font-size: .95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.notif-dot {
    display: inline-block;
    width: .5rem;
    height: .5rem;
    border-radius: 999px;
    background: var(--brand);
    flex-shrink: 0;
}

.notif-message { margin: 0 0 .3rem; font-size: .9rem; }

.notif-meta { margin: 0; font-size: .8rem; color: var(--muted); }
.notif-meta a { color: var(--brand); }

/* --- Filter tabs: one link per state, each carrying a query parameter ---
   Shared by the notification list (All / Unread) and the faculty checklist's
   status filter (FR-46). Named for what it is rather than for the first screen
   that happened to need it: a second, identical-looking row of chips defined
   separately is exactly how two filters on two screens come to look almost
   but not quite the same.

   Links rather than a <select>: every state is bookmarkable, the back button
   works, and there is no change event to hook — which matters, because the CSP
   forbids the inline handler a <select> would need.

   flex-wrap because the checklist has six of these and a phone has room for
   about three; white-space keeps a single tab from breaking mid-label when it
   does wrap. */
.filter-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
.filter-tab {
    font-size: .85rem;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    padding: .35rem .8rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    white-space: nowrap;
}
.filter-tab:hover { color: var(--brand); }
.filter-tab.active { color: var(--on-primary); background: var(--primary); border-color: var(--primary); }

/* Overdue is the one tab worth noticing before it is read, and the one whose
   count deliberately does not add into the others. The text colour carries
   that and the border is left alone: --err-bg is LIGHTER than --border in the
   light theme, so tinting the border there would have made this tab look
   fainter than its neighbours rather than more urgent. Tinted only while
   inactive — as the active tab it takes the same brand fill as the rest, so
   "which filter am I looking at" stays a single visual question. --err has a
   dark-theme value, so this reads in either theme (5.6:1 on the dark
   surface). */
.filter-tab-alert:not(.active) { color: var(--st-overdue); }
.filter-tab-alert:not(.active):hover { color: var(--st-overdue); border-color: var(--st-overdue-fill); }

/* Sits directly under the tabs, so it pulls up against their bottom margin. */
.filter-note { margin: -.55rem 0 1rem; }

/* "Print this list" on the faculty checklist (FR-46). It reuses the
   [data-print] hook in app.js, which only exists once scripting runs, so the
   button is hidden unless the .js hook is on <html>: a button that does
   nothing is worse than none. */
.checklist-print { display: none; margin: 0 0 1rem; }
.js .checklist-print { display: inline-block; }

/* --- Notification severity category tag (approval vs returned vs reminder).
   Text label + colour so the urgency cue is not colour-only. --- */
.notif-cat {
    display: inline-block;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    padding: .1rem .45rem;
    border-radius: 999px;
    white-space: nowrap;
}
.notif-cat-approved { color: var(--st-approved); background: var(--st-approved-bg); }
.notif-cat-action   { color: var(--st-revised); background: var(--st-revised-bg); }
.notif-cat-reminder { color: var(--st-submitted); background: var(--st-submitted-bg); }
.notif-cat-update   { color: var(--st-pending); background: var(--st-pending-bg); }

/* --- Responsive stacked table (narrow screens) — opt-in via .table--stack.
   Used by the faculty checklist so each requirement reads as a labelled card
   on a phone. Data tables that must stay tabular (e.g. the monitoring matrix)
   simply do not take this class. Pure CSS, no JS. --- */
@media (max-width: 640px) {
    .table--stack thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
    .table--stack,
    .table--stack tbody,
    .table--stack tr,
    .table--stack td { display: block; width: 100%; }
    .table--stack tr { border-bottom: 1px solid var(--border); padding: .35rem 0; }
    .table--stack tbody tr:last-child { border-bottom: none; }
    .table--stack td {
        border-bottom: none;
        white-space: normal;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: .35rem 1rem;
        padding: .3rem .9rem;
    }
    .table--stack td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: .7rem;
        text-transform: uppercase;
        letter-spacing: .04em;
        color: var(--muted);
        flex-shrink: 0;
    }
    /* The requirement title and its type are a stacked pair, not a label and
       a value to be pushed to opposite ends of the line by space-between. */
    .table--stack td .checklist-title,
    .table--stack td .checklist-subtitle { flex-basis: 100%; }
    /* Same reasoning for a secondary line under a cell's main value (the
       period list's "2026-2027 · 1st" subtitle): without a full-width basis,
       space-between spreads label / value / subtitle across one line instead
       of putting the subtitle underneath. */
    .table--stack td .muted-note { flex-basis: 100%; margin: .2rem 0 0; }
    /* Dashboard Recent Submissions: the program sits under the name, as the
       checklist's subtitle does under its title. */
    .recent-table td .recent-name,
    .recent-table td .recent-sub { flex-basis: 100%; }
    .table--stack td.table-actions { display: block; }
    .table--stack td.table-actions::before { display: block; margin-bottom: .35rem; }
    /* The note row is already a full-width colspan cell here (see the
       [colspan] rules below), so all it needs is to stay joined to the row it
       belongs to: no border between them, and no second lot of cell padding
       above it. */
    .table--stack tr.has-note { border-bottom: none; padding-bottom: 0; }
    .table--stack .checklist-note-row { padding-top: 0; }
    /* Full-width cells (the "no rows yet" placeholder) span every column, so
       they have no single column to be labelled with — without this they'd
       render an empty bold ::before box above the message. */
    .table--stack td[colspan] { display: block; }
    .table--stack td[colspan]::before { content: none; }
}

/* --- Audit log (FR-30, FR-31) --- */
.action-label {
    display: inline-block;
    font-size: .78rem;
    font-weight: 600;
    color: var(--brand);
    background: var(--info-bg);
    padding: .1rem .5rem;
    border-radius: 6px;
}

.ip-address {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: .85rem;
    color: var(--muted);
}

/* --- Reports page (FR-24, FR-25): CSV download links + print-only title.
   The title area is hidden on screen (the on-screen heading already shows
   it) and shown only in the print/PDF output, once the topbar's branding
   is hidden. --- */
.csv-links { margin: .5rem 0 2rem; }
/* Visible to screen readers only — used to disambiguate link text that repeats
   once per table row ("Details", "Download") so it is meaningful out of
   context. Same clip technique as the .table--stack sr-only thead. */
.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;
}

.print-only { display: none; }
/* A signature block is only meaningful on paper: on screen it would be a
   pair of ruled lines nobody can sign. Its own class rather than
   .print-only, which carries a heading's weight and margins. */
.print-signature { display: none; }
/* Round 5, the official report print format (FR-24, FR-25): every part of it is
   print-only. The roots are hidden here and shown, with the layout, by the
   "Round 5 report document" section at the end of the main print block. The
   comment row's selector carries the list table's classes so it outweighs the
   641px row-card rule `.table[data-report-list] tr { display: grid }`. */
.rpt-front, .rpt-notes, .rpt-signatures, .rpt-print-only { display: none; }
.rpt-tfoot { display: none; }
.table-card--report .table[data-report-list] tr.rpt-note-row { display: none; }
.table-card-title.rpt-screen-hide { display: none; }
/* The Returned table carries a hidden comment row after every record, so the
   record rows are the ODD children: the plain zebra (even rows) and the
   last-row rule (:last-child) would both miss them. Restate the stripe for
   every second record (4n+3), then hover after it, and drop the rule under the
   last VISIBLE record (the second-last child). Same chain of :not() as the
   plain zebra, so a paired or matrix table is still excluded. */
.table:has(.rpt-note-row):not(.table--paired):not(.table--checklist):not(.matrix-table) tbody tr:nth-child(4n+3) { background: var(--bg); }
.table:has(.rpt-note-row):not(.table--paired):not(.table--checklist):not(.matrix-table) tbody tr:hover { background: var(--row-hover); }
.table-card--report .table[data-report-list]:has(.rpt-note-row) tbody tr:nth-last-child(2) { border-bottom: none; }

/* --- Monitoring Chart (FR-55, FR-56, FR-57) ---
   Reuses the matrix's scroll wrapper (.matrix-wrap, position: relative), its sticky opaque name column and its
   zebra exclusion (.matrix-table); this region only adds the marks, the legend and the block chrome. Shape carries
   the meaning and colour only reinforces it: the star, square and circle are solid, the triangle and the neutral
   check are OUTLINES (a second, non-colour cue), and each colour is an existing status token, so both themes are
   already covered. The print rules are in the main print block, further down. */
.mchart-controls { display: flex; flex-direction: column; gap: .75rem; margin: 0 0 1rem; }
.mchart-controls .filter-form { align-items: flex-end; }
.mchart-controls .filter-tabs { margin: 0; }
.mchart-titleblock { display: none; }
.mchart-block {
    min-width: 0;
    margin: 0 0 1.5rem;
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}
.mchart-block .table-wrap { box-shadow: none; }
.mchart-block .matrix-wrap { margin-bottom: 0; }
.mchart-block-title { margin: 0 0 .25rem; font-size: 1.15rem; }
.mchart-period-note { margin: 0 0 .75rem; font-size: .8rem; }
.mchart-empty { margin: .5rem 0 0; }
.mchart-print-legend { display: none; }

.mchart-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem 1.25rem;
    font-size: .8rem;
    color: var(--text);
}
.mchart-legend-item { display: inline-flex; align-items: center; gap: .4rem; }

.mchart-sym {
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    fill: currentColor;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.mchart-sym--star { color: var(--st-approved-fill); }
.mchart-sym--square { color: var(--st-submitted); }
.mchart-sym--circle { color: var(--st-overdue-fill); }
.mchart-sym--triangle { color: var(--st-pending-fill); fill: none; }
.mchart-sym--approved-untimed { color: var(--st-approved-fill); fill: none; }

/* A requirement column is narrower than the matrix's 150px: a chart row holds one small mark per cell. The name
   column keeps its own min-width (9rem on a phone, the matrix's 160px above that). */
.mchart-table th { min-width: 7rem; }
/* WCAG 2.4.11 (Focus Not Obscured): the name column is sticky, so Chrome's focus scroll could park a cell link
   underneath it. The column is pinned to ONE width token (min and max), and the scroller reserves exactly that
   much as scroll-padding-left, so a focused link always lands beside the column, never under it. One token, so
   the column and the padding cannot drift. Print releases both (the print block below). Shared by the Monitoring
   Chart and My Timing, which use these classes. */
.mchart-block { --mchart-name-w: 9rem; }
.mchart-block .matrix-wrap { scroll-padding-left: var(--mchart-name-w); scroll-padding-right: 2rem; }
.mchart-table th:first-child { min-width: var(--mchart-name-w); }
.mchart-table .matrix-faculty-col { max-width: var(--mchart-name-w); overflow-wrap: break-word; }
@media (min-width: 481px) {
    .mchart-block { --mchart-name-w: 160px; }
}
.mchart-table td.mchart-cell { text-align: center; padding: .25rem; white-space: nowrap; }
.mchart-table .matrix-faculty-col a { color: var(--text); text-decoration: none; font-weight: 600; }
.mchart-table .matrix-faculty-col a:hover { color: var(--link); text-decoration: underline; }
.mchart-table .matrix-col-title { text-decoration: none; }
.mchart-table a.matrix-col-title:hover { color: var(--link); text-decoration: underline; }
.mchart-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    min-height: 2.75rem;
    border-radius: 6px;
}
.mchart-link:hover { background: var(--info-bg); }
@media (max-width: 480px) {
    .mchart-block { padding: .9rem; }
}
/* Windows high-contrast: keep the shapes (CanvasText), and keep the two outline marks as outlines. */
@media (forced-colors: active) {
    .mchart-sym { fill: CanvasText; stroke: CanvasText; }
    .mchart-sym--triangle, .mchart-sym--approved-untimed { fill: none; }
}
/* end Monitoring Chart */

@media print {
    /* Ink, and it would sit under the report table. */
    .has-brand-mark::before { display: none; }

    /* THE SIDEBAR. It is position:fixed, so it does not print in flow -- but
       .app-shell-auth is a grid whose first column RESERVES its width, and
       that column does print. The left third of every printed page came out
       blank, and the Reports page has carried a "Print / Save as PDF" button
       since FR-24 and printed like that the whole time. Hiding the element is
       not enough on its own; the grid has to collapse with it. Found while
       making the per-faculty card printable (B2), not by inspection. */
    .sidebar,
    .nav-toggle,
    .nav-backdrop,
    .tip-bar,
    .live-search,
    .auth-theme {
        display: none !important;
    }
    .app-shell-auth {
        display: block;
        grid-template-columns: none;
        grid-template-areas: none;
    }

    /* Anything only useful on screen: navigation, the period selector, and
       every button/CSV link — none of it belongs on a printed report. */
    .topbar,
    .subnav,
    .screen-only,
    .filter-form,
    .csv-links,
    .filter-tabs,
    .sort-form,
    .checklist-print,
    .bulk-bar,
    .col-select,
    button,
    .btn-sm,
    .btn-primary,
    .btn-primary-sm,
    .btn-secondary,
    .btn-danger,
    .btn-inline {
        display: none !important;
    }

    .print-only { display: block; margin: 0 0 1rem; font-weight: 700; }

    body { background: #fff; color: #000; }
    .wrap { max-width: none; margin: 0; padding: 0; }
    .page-head { margin: 0 0 1rem; }
    .page-head .sub, .muted-note, .detail, .checklist-subtitle, .foot { color: #000; }
    /* The Secretary pill prints as an outlined label, not as a block of tint. */
    .page-head .page-pill { background: none; border-color: #000; color: #000; }
    .app-shell.app-shell-auth { padding-top: 0; }

    .badge { background: #fff; color: #000; border: 1px solid #000; }

    .cards { display: block; }
    .card {
        display: inline-block;
        width: 30%;
        vertical-align: top;
        margin: 0 1.5% .5rem 0;
        border: 1px solid #000;
        box-shadow: none;
        background: #fff;
        break-inside: avoid;
    }
    .card.ok, .card.err { background: #fff; }
    .card h2, .card .status, .card .detail { color: #000; }
    /* .card.st-* .status (0,3,0, outside print) would otherwise win and print the
       dark theme's pale status tones on white paper. */
    .card.st-pending .status, .card.st-submitted .status, .card.st-approved .status,
    .card.st-revised .status, .card.st-overdue .status { color: #000; }
    .card .stat-icon-wrap { background: none; color: #000; }
    .table-card-title { color: #000; }
    .table-card-title .table-card-icon { stroke: currentColor; }
    .table-card-head { break-after: avoid; }

    .section-title { color: #000; break-after: avoid; }

    /* The three headline figures, printed the way the report cards already
       are -- same widths, same black rules, same break-inside guard. */
    .dash-measures { display: block; }
    .measure {
        display: inline-block;
        width: 30%;
        vertical-align: top;
        margin: 0 1.5% .5rem 0;
        border: 1px solid #000;
        box-shadow: none;
        background: #fff;
        break-inside: avoid;
    }
    .measure--alert { background: #fff; }
    .measure h2,
    .measure-value,
    .measure-detail,
    .doctype-detail { color: #000; }
    /* Decorative, and it would cost a block of colour per figure. The number
       beside it says the same thing -- which is why the bar is already
       aria-hidden on screen. */
    .meter { display: none; }
    .board-meter { display: none; }

    /* B2: what turns a printout into a statement somebody has certified. */
    .print-signature {
        display: block;
        margin-top: 2rem;
        break-inside: avoid;
        color: #000;
    }
    /* The guide prints: drop the contents list, which is a page of links
       that do nothing on paper, and let the prose use the full measure. */
    .doc-set-actions, .doc-set-flag { display: none; }
    .doc-set-item { border: 1px solid #000; background: #fff; break-inside: avoid; }

    .password-toggle { display: none; }
    .password-wrap input { padding-right: .7rem; }

    .guide-toc { display: none; }
    .guide-section, .guide-foot { max-width: none; }
    .guide-note {
        border: 1px solid #000;
        border-left-width: 3px;
        background: #fff;
        color: #000;
    }
    .guide-faq dd { color: #000; }

    .print-signature .sig-note { font-size: .8rem; margin: 0 0 2.5rem; }
    .print-signature .sig-line {
        display: inline-block;
        width: 17rem;
        margin: 0 2rem 0 0;
        border-top: 1px solid #000;
        padding-top: .25rem;
        font-size: .8rem;
    }

    .table-wrap { border: 1px solid #000; box-shadow: none; overflow: visible; background: #fff; }
    .table { font-size: .85rem; }
    .table th, .table td {
        border: 1px solid #000;
        color: #000;
        white-space: normal;
    }
    .table thead th { background: #fff; }
    .table tbody tr { break-inside: avoid; }
    .table tbody tr:hover { background: #fff; }
    /* Paper is white whatever the screen scheme: restate the zebra and hover
       selectors (same specificity, later wins) so a dark-scheme print cannot
       put black text on dark stripes. */
    .table tbody tr,
    .table:not(.table--paired):not(.table--checklist):not(.matrix-table) tbody tr:nth-child(even),
    .table:not(.table--paired):not(.table--checklist):not(.matrix-table) tbody tr:hover { background: #fff; }

    .status-pill { border: 1px solid #000; background: #fff !important; color: #000 !important; }
    /* The solid Overdue chip is white text on red; printers drop backgrounds,
       so without this it prints as invisible text. */
    .overdue, .chip-overdue { border: 1px solid #000; background: #fff !important; color: #000 !important; }

    .alert { border: 1px solid #000; background: #fff; color: #000; }

    /* The checklist's Action column (upload forms, View/Download, row menu)
       is controls, not content. The pill keeps its ::before glyph, so the
       Status column still reads in greyscale. */
    .table--checklist th:nth-child(5),
    .table--checklist td.table-actions { display: none; }
    /* Reports' Documents Submitted table: the Document column is View/Download
       controls. Scoped to that card's non-list table; the per-faculty and
       per-document-type tables have no actions column. */
    .table-card--report[aria-labelledby="documents"] .table:not([data-report-list]) th:last-child,
    .table-card--report td.table-actions { display: none; }
    /* The stacked and row-card captions are the muted token on screen. */
    .table-card.table-card--report .table[data-report-list] td::before { color: #000; }
    .table--stack td::before { color: #000; }
    /* The audit card's captions, role pills and action labels (print widths of
       about 720-740px fall in the row-card band, and the pills are pale in dark). */
    .table-card.table-card--audit .table td::before,
    .table-card.table-card--audit .action-label,
    .table-card.table-card--audit .role-pill { color: #000; }
    .table-card.table-card--audit .action-label,
    .table-card.table-card--audit .role-pill { background: none; border: 1px solid #000; }
    /* The archive's Open / Details, View and Download are controls, not content;
       its row-card captions are the muted token on screen. The extra class lifts the
       selector to (0,3,1): the 641-1279px screen rule `.table-card--archive-rows .table td
       { display: block }` is (0,2,1) and comes later, so at equal weight it would win and
       a printed page would keep a DOCUMENT caption and "Never submitted". The row-card
       separators are the border token on screen, so they print black. */
    .table-card.table-card--archive th:last-child,
    .table-card.table-card--archive td.table-actions { display: none; }
    .table-card.table-card--archive-rows .table td::before { color: #000; }
    .table-card.table-card--archive-rows .table tr { border-bottom-color: #000; }
    /* The Periods row-card captions and separators (Step 9b) are tokens on screen. The
       extra class lifts the ::before rule to (0,3,2) over the screen rule's (0,2,2), and
       the tr rule to (0,3,1) over (0,2,1). The Actions column does not print (Archive's
       reason: controls, not content), and (0,3,1) beats the 641-1279 screen
       `td { display: block }` at (0,2,1), so no empty ACTIONS caption survives either. */
    .table-card.table-card--periods .table td::before { color: #000; }
    .table-card.table-card--periods .table tr { border-bottom-color: #000; }
    .table-card.table-card--periods th:last-child,
    .table-card.table-card--periods td.table-actions { display: none; }
    /* Requirements (Step 10): the same three rules, for the same reasons. */
    .table-card.table-card--requirements th:last-child,
    .table-card.table-card--requirements td.table-actions { display: none; }
    .table-card.table-card--requirements .table td::before { color: #000; }
    .table-card.table-card--requirements .table tr { border-bottom-color: #000; }
    /* Users (Step 11): Actions, captions and separators as Requirements; the role pills
       are pale blue on screen (and paler in dark), so they print outlined black, as Audit's. */
    .table-card.table-card--users th:last-child,
    .table-card.table-card--users td.table-actions { display: none; }
    .table-card.table-card--users .table td::before { color: #000; }
    .table-card.table-card--users .table tr { border-bottom-color: #000; }
    .table-card.table-card--users .role-pill { color: #000; background: none; border: 1px solid #000; }
    /* Faculty Compliance and the faculty card (Step 12). Both tables print as tables
       (their row-card blocks are screen-only); the card's Action column is controls, not
       content. The figure cards' tinted left border and icon chip print black, at (0,3,0)
       so they beat the screen region's (0,2,0) rules, which come later in the file. */
    .table-card.table-card--standing th:last-child,
    .table-card.table-card--standing td.table-actions { display: none; }
    .dash-measures.compliance-figures .measure { border-left: 1px solid #000; }
    .dash-measures.compliance-figures .stat-icon-wrap { background: none; color: #000; }
    /* Detail screens (Step 13). The three tables print as tables (their row-card
       blocks are screen-only), without their Action columns, which are controls, not
       content. The heading icons print black. The requirement page's figures print
       through Step 12's .dash-measures.compliance-figures rules. */
    .table-card.table-card--audience th:last-child,
    .table-card.table-card--audience td.table-actions,
    .table-card.table-card--versions th:last-child,
    .table-card.table-card--versions td.table-actions,
    .table-card.table-card--released th:last-child,
    .table-card.table-card--released td.table-actions { display: none; }
    .detail-heading .detail-heading-icon { stroke: #000; }
    /* The compact report row cards, printed denser: four columns, tight gap,
       black rules. */
    .table-card.table-card--report .table[data-report-list] tr {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: .25rem .75rem;
        padding: .45rem .5rem;
        border-bottom-color: #000;
    }

    a { color: #000; text-decoration: none; }

    /* --- Round 5 report document (FR-24, FR-25, FR-16) ---
       The Reports (five lists) and the faculty statement print as an official
       document: letterhead, title block, executive summary, figures, numbered
       tables, notes and signatures, on A4 with a running footer. Everything is
       scoped to a page that carries a title block (:has(.rpt-titleblock)) so no
       other page's print output changes, and every colour is a literal because
       paper is white whatever the screen scheme. Found by prototyping on the real
       pages (not assumed): user text in a cell MUST be capped (max-width plus
       break-word), because one unbroken token wider than the page makes Chrome
       shrink the WHOLE page to fit; overflow-wrap: anywhere is for prose only (it
       splits words in a table); a table rule needs the prefix to beat the
       screen's row-card grid and the 4-column print rule above. */
    @page rpt {
        size: A4 portrait;
        margin: 14mm 14mm 18mm 14mm;
        @bottom-left {
            content: "CCIS Document Monitoring System \00B7  NwSSU \2014  For official use only";
            font: 7.5pt/1 system-ui, "Segoe UI", Roboto, Arial, sans-serif;
            color: #333;
            vertical-align: top;
            padding-top: 2.5mm;
            border-top: .5pt solid #333;
            width: 75%;
        }
        @bottom-right {
            content: "Page " counter(page) " of " counter(pages);
            font: 7.5pt/1 system-ui, "Segoe UI", Roboto, Arial, sans-serif;
            color: #333;
            vertical-align: top;
            text-align: right;
            padding-top: 2.5mm;
            border-top: .5pt solid #333;
            width: 25%;
        }
    }
    html:has(.rpt-titleblock) { page: rpt; font-size: 100%; color-scheme: light; }
    html:has(.rpt-titleblock) body {
        background: #fff; color: #111;
        font: 9.5pt/1.4 system-ui, "Segoe UI", Roboto, Arial, sans-serif;
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
    }
    html:has(.rpt-titleblock) .app-shell,
    html:has(.rpt-titleblock) .wrap { background: #fff; }
    html:has(.rpt-titleblock) .foot { display: none; }

    /* what a report page does not print */
    [data-page-content]:has(.rpt-titleblock) > .page-head,
    [data-page-content]:has(.rpt-titleblock) > .print-only,
    [data-page-content]:has(.rpt-titleblock) > .filter-panel,
    [data-page-content]:has(.rpt-titleblock) > .table-card-head,
    [data-page-content]:has(.rpt-titleblock) > .dash-cards,
    [data-page-content]:has(.rpt-titleblock) > .dash-measures,
    [data-page-content]:has(.rpt-titleblock) > .figure-composition,
    [data-page-content]:has(.rpt-titleblock) .filter-tabs,
    [data-page-content]:has(.rpt-titleblock) .table-card > .sub,
    [data-page-content]:has(.rpt-titleblock) .table-card-title .table-card-icon,
    [data-page-content]:has(.rpt-titleblock) .table-card .sr-only { display: none !important; }
    /* controls, not content: the View/Download column and the checklist Action column */
    [data-page-content]:has(.rpt-titleblock) .table-card--report[aria-labelledby="documents"] .table:not([data-report-list]) th:last-child,
    [data-page-content]:has(.rpt-titleblock) .table-card--standing .table th:last-child,
    [data-page-content]:has(.rpt-titleblock) .table-card--archive .table th:last-child,
    [data-page-content]:has(.rpt-titleblock) .table-card .table td.table-actions { display: none; }
    /* the two summary tables belong to the All report only */
    .rpt-front:has(.rpt-titleblock:not([data-rpt-kind="all"])) ~ .table-card--report[aria-labelledby="rep-faculty"],
    .rpt-front:has(.rpt-titleblock:not([data-rpt-kind="all"])) ~ .table-card--report[aria-labelledby="rep-doctype"] { display: none; }

    /* show the print-only blocks */
    .rpt-front, .rpt-notes, .rpt-signatures { display: block; }
    .rpt-print-only { display: inline; }
    /* the numbered heading of the Documents Submitted table: the screen h2 stays off paper, this names the list */
    [data-page-content]:has(.rpt-titleblock) .table-card-title#documents { display: none; }
    [data-page-content]:has(.rpt-titleblock) .rpt-subhead { display: block; margin: 0 0 1.5mm; font-size: 10.5pt; font-weight: 700; color: #0f2a4a; break-after: avoid; }
    [data-page-content]:has(.rpt-titleblock) .rpt-subhead::before { counter-increment: rptsec; content: counter(rptsec) ". "; }
    .rpt-front, .rpt-notes, .rpt-signatures, .rpt-kpis, .rpt-statusbar, .rpt-rate, .rpt-legend,
    [data-page-content]:has(.rpt-titleblock) .table thead th,
    [data-page-content]:has(.rpt-titleblock) .rpt-total td,
    [data-page-content]:has(.rpt-titleblock) .table tbody tr:nth-child(even) {
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
    }

    /* letterhead */
    .rpt-letterhead { padding: 0 0 2.2mm; border-bottom: 2pt solid #0f2a4a; color: #111; }
    .rpt-letterhead::after { content: ""; display: block; height: 1.5pt; margin: 1pt 0 0; background: #f0c102; }
    .rpt-lh-grid { display: grid; grid-template-columns: 20mm 1fr 20mm; align-items: center; gap: 2mm; }
    .rpt-seal { width: 18mm; height: 18mm; object-fit: contain; }
    .rpt-seal-r { justify-self: end; }
    .rpt-lh-text { text-align: center; }
    .rpt-lh-text p { margin: 0; line-height: 1.3; }
    .rpt-lh-rep, .rpt-lh-addr { font-size: 8.5pt; }
    .rpt-lh-univ { font-size: 12pt; font-weight: 700; color: #0f2a4a; letter-spacing: .02em; }
    .rpt-lh-college { font-size: 9.5pt; font-weight: 700; }

    /* title block */
    .rpt-titleblock { margin: 4mm 0 3mm; break-inside: avoid; }
    .rpt-title { margin: 0 0 2mm; text-align: center; font-size: 15pt; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #111; }
    .rpt-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 1mm 6mm; margin: 0; padding: 1.5mm 0; border-top: .5pt solid #000; border-bottom: .5pt solid #000; font-size: 8.5pt; }
    .rpt-meta-item { display: flex; gap: 2mm; margin: 0; min-width: 0; }
    .rpt-meta dt { flex: 0 0 25mm; font-weight: 700; margin: 0; color: #444; }
    .rpt-meta dd { margin: 0; min-width: 0; overflow-wrap: anywhere; color: #111; }

    /* executive summary and follow-up: prose, so it may break anywhere */
    .rpt-h { margin: 3.5mm 0 1.2mm; font-size: 10.5pt; font-weight: 700; color: #0f2a4a; break-after: avoid; }
    .rpt-summary p { margin: 0 0 1.2mm; overflow-wrap: anywhere; }
    .rpt-follow { margin: 0; padding-left: 5mm; }
    .rpt-follow li { margin: 0 0 1mm; overflow-wrap: anywhere; break-inside: avoid; }
    .rpt-follow-none { margin: 0; }

    /* figures strip and bars */
    .rpt-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; margin: 0 0 3mm; }
    .rpt-kpi { display: flex; flex-direction: column; justify-content: space-between; border: .75pt solid #000; margin-left: -.75pt; padding: 1.4mm 1.6mm; min-width: 0; break-inside: avoid; background: #fff; }
    .rpt-kpi:first-child { margin-left: 0; }
    .rpt-kpi-label { font-size: 7.5pt; line-height: 1.2; color: #444; }
    .rpt-kpi-val { font-size: 14pt; font-weight: 700; color: #111; line-height: 1.3; }
    .rpt-kpi--overdue { border-left: 2pt solid #b00020; }
    .rpt-kpi--overdue .rpt-kpi-val { color: #b00020; }
    .rpt-composition { margin: 0 0 3mm; break-inside: avoid; }
    .rpt-statusbar { display: block; width: 100%; height: auto; margin: 0 0 2mm; }
    .rpt-legend { width: 105mm; border-collapse: collapse; font-size: 8.5pt; margin: 0 0 1mm; }
    .rpt-legend th, .rpt-legend td { padding: .7mm 1.5mm; border: .5pt solid #000; text-align: left; vertical-align: middle; background: #fff; color: #111; }
    .rpt-legend th { background: #e6ebf2; font-weight: 700; }
    .rpt-legend .rpt-num { text-align: right; }
    .rpt-legend td:first-child { width: 11mm; }
    .rpt-swatch { display: block; width: 8mm; height: 4mm; }
    .rpt-rates { margin: 0 0 3mm; break-inside: avoid; }
    .rpt-rate { display: grid; grid-template-columns: 52mm 1fr 34mm; align-items: center; gap: 3mm; margin: 0 0 1.2mm; font-size: 8.5pt; }
    .rpt-rate-track { display: block; width: 100%; height: 3.4mm; }
    .rpt-rate-val { font-weight: 700; text-align: right; white-space: nowrap; }

    /* numbered sections and the ruled tables */
    [data-page-content]:has(.rpt-titleblock) { counter-reset: rptsec; }
    [data-page-content]:has(.rpt-titleblock) .table-card {
        border: 0; border-radius: 0; box-shadow: none; padding: 0; margin: 0 0 4mm; background: #fff;
    }
    [data-page-content]:has(.rpt-titleblock) .table-card-head { display: block; margin: 3mm 0 1.5mm; padding: 0; }
    [data-page-content]:has(.rpt-titleblock) .table-card-title {
        display: block; margin: 0; font-size: 10.5pt; font-weight: 700; color: #0f2a4a; break-after: avoid;
    }
    [data-page-content]:has(.rpt-titleblock) .table-card-title::before { counter-increment: rptsec; content: counter(rptsec) ". "; }
    [data-page-content]:has(.rpt-titleblock) .table-card-title.rpt-screen-hide { margin: 3mm 0 1.5mm; }
    [data-page-content]:has(.rpt-titleblock) .table-wrap { border: 0; padding: 0; overflow: visible; background: #fff; box-shadow: none; position: static; }
    [data-page-content]:has(.rpt-titleblock) .table-card .table,
    [data-page-content]:has(.rpt-titleblock) .table-card--report .table[data-report-list] {
        display: table; width: 100%; table-layout: auto; border-collapse: collapse; font-size: 8pt; line-height: 1.25; background: #fff;
    }
    [data-page-content]:has(.rpt-titleblock) .table-card .table thead,
    [data-page-content]:has(.rpt-titleblock) .table-card--report .table[data-report-list] thead {
        display: table-header-group; position: static; width: auto; height: auto; margin: 0; padding: 0; border: 0; overflow: visible; clip: auto; white-space: normal;
    }
    [data-page-content]:has(.rpt-titleblock) .table-card .table tbody,
    [data-page-content]:has(.rpt-titleblock) .table-card--report .table[data-report-list] tbody { display: table-row-group; }
    [data-page-content]:has(.rpt-titleblock) .table-card .table tfoot { display: table-row-group; }
    [data-page-content]:has(.rpt-titleblock) .table-card .table tr,
    [data-page-content]:has(.rpt-titleblock) .table-card--report .table[data-report-list] tr {
        display: table-row; padding: 0; border: 0; break-inside: avoid; grid-template-columns: none;
    }
    [data-page-content]:has(.rpt-titleblock) .table-card .table th,
    [data-page-content]:has(.rpt-titleblock) .table-card .table td,
    [data-page-content]:has(.rpt-titleblock) .table-card--report .table[data-report-list] td {
        display: table-cell; border: .5pt solid #000; padding: 1mm 1.4mm; color: #111; font-size: inherit; line-height: inherit;
        text-align: left; vertical-align: top; text-transform: none; letter-spacing: 0; white-space: normal; overflow-wrap: break-word; min-width: 0;
        background: transparent;
    }
    [data-page-content]:has(.rpt-titleblock) .table-card .table td::before { content: none; display: none; }
    [data-page-content]:has(.rpt-titleblock) .table-card .table thead th { background: #e6ebf2; font-weight: 700; font-size: 7.8pt; vertical-align: bottom; }
    /* counts and percentages read down a right-aligned column */
    [data-page-content]:has(.rpt-titleblock) .table-card .table .rpt-num,
    [data-page-content]:has(.rpt-titleblock) .table-card .table td[data-label="Total"],
    [data-page-content]:has(.rpt-titleblock) .table-card .table td[data-label="Pending"],
    [data-page-content]:has(.rpt-titleblock) .table-card .table td[data-label="Submitted"],
    [data-page-content]:has(.rpt-titleblock) .table-card .table td[data-label="Approved"],
    [data-page-content]:has(.rpt-titleblock) .table-card .table td[data-label="Revised"],
    [data-page-content]:has(.rpt-titleblock) .table-card .table td[data-label="Progress %"],
    [data-page-content]:has(.rpt-titleblock) .table-card .table td[data-label="Compliance %"],
    [data-page-content]:has(.rpt-titleblock) .table-card .table td[data-label="Completion %"],
    [data-page-content]:has(.rpt-titleblock) .table-card .table td[data-label="Days overdue"],
    [data-page-content]:has(.rpt-titleblock) .table-card .table td[data-label="Days to deadline"],
    [data-page-content]:has(.rpt-titleblock) .table-card .table td[data-label="Version"],
    [data-page-content]:has(.rpt-titleblock) .table-card--report[aria-labelledby="rep-faculty"] .table thead th:nth-child(n+3),
    [data-page-content]:has(.rpt-titleblock) .table-card--report[aria-labelledby="rep-doctype"] .table thead th:nth-child(n+2),
    [data-page-content]:has(.rpt-titleblock) .table-card .table[data-report-list="pending"] thead th:nth-child(8),
    [data-page-content]:has(.rpt-titleblock) .table-card .table[data-report-list="overdue"] thead th:nth-child(8),
    [data-page-content]:has(.rpt-titleblock) .table-card .table[data-report-list="approved"] thead th:nth-child(9),
    [data-page-content]:has(.rpt-titleblock) .table-card .table[data-report-list="returned"] thead th:nth-child(10) { text-align: right; white-space: nowrap; }
    [data-page-content]:has(.rpt-titleblock) .table-card .table td[data-label="Deadline"],
    [data-page-content]:has(.rpt-titleblock) .table-card .table td[data-label="Returned on"],
    [data-page-content]:has(.rpt-titleblock) .table-card .table td[data-label="Last updated"],
    [data-page-content]:has(.rpt-titleblock) .table-card .table td[data-label="Approved on"] { white-space: nowrap; }
    [data-page-content]:has(.rpt-titleblock) .table-card .table:not(.table--paired):not(.table--checklist):not(.matrix-table):not(:has(.rpt-note-row)) tbody tr:nth-child(even) { background: #f3f5f8; }
    [data-page-content]:has(.rpt-titleblock) .table-card .table .rpt-total td { background: #e6ebf2; font-weight: 700; }
    [data-page-content]:has(.rpt-titleblock) .table-card .table .rpt-total:last-child td { border-top: 1pt solid #000; }
    [data-page-content]:has(.rpt-titleblock) .table-card .table tr.rpt-total { break-inside: avoid; }
    [data-page-content]:has(.rpt-titleblock) .table-card--report[aria-labelledby="rep-faculty"],
    [data-page-content]:has(.rpt-titleblock) .table-card--report[aria-labelledby="rep-doctype"] { break-inside: avoid; }

    /* user-typed text must never widen a column */
    [data-page-content]:has(.rpt-titleblock) .table-card .table td[data-label="Faculty"] { max-width: 34mm; overflow-wrap: break-word; }
    [data-page-content]:has(.rpt-titleblock) .table-card .table td[data-label="Requirement"] { max-width: 50mm; overflow-wrap: break-word; }
    [data-page-content]:has(.rpt-titleblock) .table-card .table td[data-label="File"] { max-width: 50mm; overflow-wrap: break-word; }
    [data-page-content]:has(.rpt-titleblock) .table-card .table td[data-label="Document Type"],
    [data-page-content]:has(.rpt-titleblock) .table-card .table td[data-label="Program"] { max-width: 30mm; overflow-wrap: break-word; }

    /* Returned list: the reviewer's comment moves from a narrow ninth column to a full-width row under its record */
    [data-page-content]:has(.rpt-titleblock) .table:has(.rpt-note-row) th:nth-child(9),
    [data-page-content]:has(.rpt-titleblock) .table:has(.rpt-note-row) td[data-label="Reviewer's comment"] { display: none; }
    [data-page-content]:has(.rpt-titleblock) .table-card .table tr.rpt-note-row { display: table-row; break-before: avoid; }
    [data-page-content]:has(.rpt-titleblock) .table-card .table:has(.rpt-note-row) tr[data-report-row] { break-after: avoid; }
    [data-page-content]:has(.rpt-titleblock) .table-card .table tr.rpt-note-row td { display: table-cell; max-width: 175mm; border-top: 0; font-size: 7.8pt; overflow-wrap: break-word; }
    [data-page-content]:has(.rpt-titleblock) .table-card .table:has(.rpt-note-row) tbody tr:nth-child(4n+3),
    [data-page-content]:has(.rpt-titleblock) .table-card .table:has(.rpt-note-row) tbody tr:nth-child(4n+4) { background: #f3f5f8; }

    /* status as text, not a pill */
    [data-page-content]:has(.rpt-titleblock) .status-pill {
        display: inline; border: 0 !important; border-radius: 0; background: none !important; padding: 0; margin: 0;
        color: #111 !important; font-size: inherit; font-weight: 600; white-space: nowrap;
    }
    [data-page-content]:has(.rpt-titleblock) .chip-overdue {
        display: block; border: 0 !important; border-radius: 0; background: none !important; padding: 0; margin: 0;
        color: #b00020 !important; font-size: inherit; font-weight: 700; text-transform: uppercase; white-space: nowrap;
    }
    [data-page-content]:has(.rpt-titleblock) .chip-overdue::before { content: "! "; }
    [data-page-content]:has(.rpt-titleblock) .table-card .table td .status-pill + .chip-overdue { margin-left: 0; }

    /* the statement's paired table: a return comment prints as it is, kept with its record */
    [data-page-content]:has(.rpt-titleblock) .checklist-title { display: block; font-size: inherit; font-weight: 600; }
    [data-page-content]:has(.rpt-titleblock) .checklist-subtitle { display: block; font-size: inherit; color: #444; }
    [data-page-content]:has(.rpt-titleblock) .table--paired tr.has-note { break-after: avoid; }
    [data-page-content]:has(.rpt-titleblock) .table--paired .checklist-note-row { break-before: avoid; }
    [data-page-content]:has(.rpt-titleblock) .table--paired tr.has-note td { border-bottom: 0; }
    [data-page-content]:has(.rpt-titleblock) .table--paired .checklist-note-row td { border-top: 0; font-size: 7.8pt; max-width: 175mm; overflow-wrap: break-word; }
    [data-page-content]:has(.rpt-titleblock) .checklist-note a { display: none; }
    [data-page-content]:has(.rpt-titleblock) .checklist-note { margin: 0; padding: 0; border: 0; background: none; color: #111; font-size: 7.8pt; line-height: 1.3; overflow-wrap: anywhere; }

    /* notes */
    .rpt-notes { margin: 4mm 0 0; font-size: 8pt; line-height: 1.35; break-inside: avoid; break-after: avoid; color: #111; }
    .rpt-notes ol { margin: 0; padding-left: 5mm; }
    .rpt-notes li { margin: 0 0 1mm; overflow-wrap: anywhere; }
    .rpt-notes .rpt-h { font-size: 9pt; margin-top: 0; }

    /* signatures */
    [data-page-content]:has(.rpt-titleblock) .print-signature { margin-top: 0; }
    .rpt-signatures { margin: 6mm 0 0; min-height: 45mm; break-inside: avoid; color: #111; }
    .rpt-signatures .sig-note { margin: 0 0 4mm; font-size: 8pt; }
    .rpt-sig-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12mm; }
    .rpt-signatures--3 .rpt-sig-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8mm; }
    .rpt-sig p { margin: 0; font-size: 8.5pt; }
    .rpt-sig-h { font-weight: 700; margin-bottom: 0; }
    .rpt-sig-space { height: 14mm; border-bottom: .75pt solid #000; }
    .rpt-sig-name { margin-top: 1mm !important; font-weight: 700; min-height: 1.3em; overflow-wrap: anywhere; }
    .rpt-sig-role { color: #444; }
    .rpt-sig-date { margin-top: 3mm !important; }
    /* end Round 5 report document */

    /* --- Monitoring Chart print (FR-57) ---
       A4 LANDSCAPE with the column headings and the legend repeated on every page, and marks that survive a
       greyscale printer. The page is NAMED (@page mchart) and only a page that carries the chart table takes it: a
       bare @page { size: landscape } would turn every printed page of the application landscape (the Round 5
       lesson). Everything is a literal colour because paper is white whatever the screen scheme (the tokens flip
       in a dark scheme, a literal does not). The legend is a row of each table's thead, so it repeats with the
       headings and cannot drift from them. User text in a cell is CAPPED (max-width plus break-word): one unbroken
       token wider than the page makes Chrome shrink the WHOLE page to fit. The shapes stay distinct without
       colour: the star, square and circle are solid black, the triangle and the neutral check are outlines. */
    @page mchart {
        size: A4 landscape;
        margin: 10mm;
    }
    html:has(.mchart-table) { page: mchart; font-size: 100%; color-scheme: light; }
    html:has(.mchart-table) body {
        background: #fff; color: #111;
        font: 9pt/1.3 system-ui, "Segoe UI", Roboto, Arial, sans-serif;
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
    }
    html:has(.mchart-table) .app-shell,
    html:has(.mchart-table) .wrap { background: #fff; }
    html:has(.mchart-table) .foot,
    html:has(.mchart-table) [data-page-content] > .page-head { display: none; }
    .mchart-controls { display: none !important; }
    .mchart-titleblock { display: block; margin: 0 0 3mm; text-align: center; color: #111; }
    .mchart-title-college { margin: 0; font-size: 9pt; }
    .mchart-title { margin: 1mm 0; font-size: 14pt; font-weight: 700; color: #0f2a4a; }
    .mchart-title-sub { margin: 0; font-size: 9pt; }
    .mchart-legend--screen { display: none; }
    .mchart-print-legend { display: table-row; }
    .mchart-print-legend th { padding: 1.5mm 2mm; text-align: left; font-weight: 400; }
    .mchart-legend { gap: 1mm 5mm; font-size: 8pt; color: #111; }
    .mchart-block { margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: #fff; }
    .mchart-block + .mchart-block { break-before: page; }
    .mchart-block-title { margin: 0 0 2mm; font-size: 11pt; color: #0f2a4a; break-after: avoid; }
    .mchart-period-note { display: none; }
    .mchart-block .matrix-wrap { border: 0; padding: 0; overflow: visible; }
    .mchart-table { width: 100%; border-collapse: collapse; table-layout: auto; font-size: 8pt; }
    .mchart-table thead { display: table-header-group; }
    .mchart-table tr { break-inside: avoid; }
    .mchart-table th, .mchart-table td { background: #fff; color: #111; border: .5pt solid #888; padding: 1mm 1.5mm; }
    .mchart-table thead th { background: #e6ebf2; max-width: 30mm; overflow-wrap: break-word; min-width: 0; vertical-align: bottom; }
    .mchart-table thead .mchart-print-legend th { max-width: none; background: #fff; border-width: 0 0 .5pt; }
    .mchart-table .matrix-faculty-col { position: static; max-width: 38mm; overflow-wrap: break-word; min-width: 0; }
    .mchart-table th.matrix-faculty-col { min-width: 0; }
    .mchart-table .matrix-col-title { font-size: 7pt; color: #111; }
    .mchart-table .matrix-col-meta { font-size: 6.5pt; color: #333; }
    .mchart-table .matrix-none { color: #444; }
    .mchart-table td.mchart-cell { padding: .5mm; text-align: center; }
    .mchart-table a { color: inherit; text-decoration: none; }
    .mchart-table .mchart-link { min-width: 0; min-height: 0; }
    .mchart-sym { width: 4mm; height: 4mm; }
    .mchart-table .mchart-sym { color: #000; }
    .mchart-legend .mchart-sym { color: #000; }
    /* end Monitoring Chart print */
}

/* --- Dashboard deadline calendar (FR-39) ---
   A month grid on both dashboards marking the days that carry requirement
   deadlines. Deliberately NOT built on .table: that class is nowrap with
   ~.9rem horizontal padding per cell and picks up the .table--stack phone
   rules, all of which fight a fixed seven-column grid. Every cue below is a
   class, never an inline style — the CSP (default-src 'self', no
   'unsafe-inline') drops inline style attributes outright, and a calendar is
   exactly where per-cell inline colouring is tempting. */
.calendar-section { margin: 0 0 1.5rem; }

.calendar-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 1rem 1.1rem 1.1rem;
}

.calendar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin: 0 0 .75rem;
}

.calendar-month { margin: 0; font-size: 1rem; font-weight: 700; }

/* Month navigation: plain links, styled as controls. They are the whole
   no-JavaScript story for this component — each one is a GET of the same
   dashboard with a different ?month=YYYY-MM. */
.calendar-nav {
    font-size: .85rem;
    font-weight: 600;
    color: var(--brand);
    text-decoration: none;
    white-space: nowrap;
    padding: .3rem .55rem;
    border: 1px solid var(--border);
    border-radius: 8px;
}
.calendar-nav:hover { background: var(--bg); }
.calendar-nav:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

/* table-layout: fixed is what keeps seven columns inside a ~360px phone
   viewport. Left to size themselves, the columns take their width from the
   widest cell content (a two-digit date plus a count badge) and the table
   overflows sideways — the classic seven-column phone bug. Fixed layout
   divides the available width evenly instead, so the grid always fits and the
   cells simply get narrower. */
.calendar {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.calendar th {
    padding: .2rem 0 .45rem;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    text-align: center;
}

.cal-cell { padding: 2px; text-align: center; vertical-align: middle; }

/* The child combinator matters: it styles the cell's own box (the plain date,
   or the link that wraps a date with deadlines) without also hitting the
   .cal-day nested INSIDE that link. */
.cal-cell > .cal-day,
.cal-cell > .cal-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .1rem;
    min-height: 2.5rem;
    padding: .3rem .15rem;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: .85rem;
    color: var(--muted);
    text-decoration: none;
}

/* A day with deadlines is the only interactive cell, so it gets the filled
   treatment; overdue days (FR-20's language, same as the checklist's Overdue
   marker) swap to the error tokens. */
.cal-cell > .cal-link {
    color: var(--brand);
    background: var(--info-bg);
}
.cal-cell.has-overdue > .cal-link {
    color: var(--st-overdue);
    background: var(--st-overdue-bg);
}
.cal-cell > .cal-link:hover { border-color: currentColor; }
.cal-cell > .cal-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

.cal-link .cal-day { font-size: .9rem; font-weight: 700; }
.cal-link .cal-count { font-size: .65rem; font-weight: 700; line-height: 1; }

/* Today is marked by the BORDER, a deadline by the fill, so the two read as
   different things when they land on the same date — and the difference
   survives for anyone who cannot separate the two colours. */
.cal-cell.is-today > .cal-day,
.cal-cell.is-today > .cal-link {
    border: 2px dashed var(--brand);
    color: var(--brand);
    font-weight: 700;
}

.cal-legend {
    list-style: none;
    margin: .8rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: .3rem 1rem;
    font-size: .8rem;
    color: var(--muted);
}
.cal-legend-item { display: flex; align-items: center; gap: .4rem; }
.cal-swatch {
    width: .9rem;
    height: .9rem;
    flex-shrink: 0;
    border: 1px solid var(--border);
    border-radius: 4px;
}
.cal-swatch-today { border: 2px dashed var(--brand); background: transparent; }
.cal-swatch-deadline { background: var(--st-submitted-bg); border-color: var(--st-submitted-fill); }
.cal-swatch-overdue { background: var(--st-overdue-bg); border-color: var(--st-overdue-fill); }

/* The month's deadlines in words, under the grid: a 2.5rem cell only has room
   for a count, and on a phone that count is all the grid can show at all. */
.cal-list {
    list-style: none;
    display: grid;
    gap: .5rem;
    margin: .9rem 0 0;
    padding: .9rem 0 0;
    border-top: 1px solid var(--border);
}
.cal-list-item { display: flex; gap: .6rem; font-size: .88rem; }
.cal-list-date {
    flex: 0 0 3.2rem;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--muted);
    padding-top: .15rem;
}
.cal-list-title { min-width: 0; word-break: break-word; }
.cal-list-type { display: block; }

.cal-note { margin: .85rem 0 0; }

.cal-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    margin: .9rem 0 0;
}

/* Phone width: the grid still has to fit seven columns, so the cells lose
   padding rather than the table gaining a scrollbar. */
@media (max-width: 480px) {
    .calendar-card { padding: .85rem .6rem .9rem; }
    .cal-cell { padding: 1px; }
    .cal-cell > .cal-day,
    .cal-cell > .cal-link {
        min-height: 2.2rem;
        padding: .25rem .05rem;
        font-size: .8rem;
    }
    .cal-link .cal-day { font-size: .82rem; }
    .calendar th { font-size: .62rem; }
}

/* FR-41 in-app document viewer. aspect-ratio rather than a fixed height so the
   frame keeps a page-like shape on a phone instead of becoming a letterbox;
   min-height stops it collapsing where aspect-ratio is unsupported. Tokens
   only, so the surround follows the dark theme. */
.doc-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}
.doc-viewer {
    margin-top: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius, 8px);
    overflow: hidden;
    background: var(--bg);
}
.doc-frame {
    display: block;
    width: 100%;
    /* Height from the VIEWPORT, not an aspect ratio. A ratio sizes the frame
       from its own width and so ignores how tall the screen actually is: on a
       wide monitor it produced a frame taller than the window, and on a laptop
       a short one with empty space under it. This takes what is left after the
       top bar and the page's own furniture, so the page fills the screen it
       has. The subtraction is deliberately a little conservative — better a
       short scroll than a frame that overhangs the window. */
    height: calc(100vh - 23rem);
    min-height: 24rem;
    border: 0;
}
@media (max-width: 480px) {
    .doc-frame {
        height: calc(100vh - 13rem);
        min-height: 20rem;
    }
}

/* While a month is being fetched. Deliberately subtle: the swap is usually
   fast enough that a spinner would flash, but with no cue at all a slow month
   looks like a dead button. Tokens only. */
.calendar-section[aria-busy="true"] .calendar-card {
    opacity: .55;
    transition: opacity .12s ease-in;
}
.calendar-section[aria-busy="true"] .calendar-nav {
    pointer-events: none;
}

/* --- The college seal, faint, behind every page ---------------------------
   One fixed layer on the shell rather than a background on each screen, so it
   does not scroll with the content or repeat per card, and so there is exactly
   one place to tune it. It sits above the page background and below everything
   else: cards and the sidebar are opaque, so the mark shows through the gutters
   and around the content, which is what makes it read as a watermark rather
   than as a picture behind text.

   pointer-events: none so it can never intercept a click. Only painted when a
   logo has actually been supplied (.has-brand-mark), so no request is made for
   a file that is not there. One rule per format because the CSP forbids the
   inline style that would otherwise let PHP pass the filename in. */
.app-shell { position: relative; }

.has-brand-mark::before {
    content: "";
    position: fixed;
    /* Centred on the CONTENT PANEL, not the browser window: with the sidebar
       occupying a fixed column, a viewport-centred mark sits visibly off to the
       left of the area it is supposed to sit behind. Inset by the sidebar width
       and the top bar's height so the seal is centred in what the reader is
       actually looking at. Still fixed, so it does not travel with the scroll. */
    top: var(--topbar-h);
    right: 0;
    bottom: 0;
    left: 0;
    background-repeat: no-repeat;
    background-position: center;
    /* Big enough to read as the college seal behind the page rather than a
       small stamp in the middle of it. vmin so it scales off the SHORTER axis
       and cannot overflow a short window; the px cap stops it from becoming a
       texture on a large monitor. */
    background-size: min(78vmin, 780px);
    opacity: var(--watermark-opacity);
    pointer-events: none;
    z-index: 0;
}
/* Signed in, at desktop, the content panel starts after the sidebar. */
.app-shell-auth.has-brand-mark::before { left: var(--sidebar-w); }
/* Signed out there is no sidebar and no top bar, so it fills the window. */
.app-shell:not(.app-shell-auth).has-brand-mark::before { top: 0; left: 0; }

/* Must come AFTER the two rules above: a media query adds no specificity, so
   source order is what decides. Declared earlier (inside the <=899px block up
   the file) it was silently losing to the desktop inset, and the mark stayed
   240px off-centre on a phone. */
@media (max-width: 899px) {
    /* Sidebar is a stacked drawer here, so the panel is the full width again. */
    .app-shell-auth.has-brand-mark::before { left: 0; }
}
.brand-mark-svg::before  { background-image: url("../img/logo.svg"); }
.brand-mark-png::before  { background-image: url("../img/logo.png"); }
.brand-mark-webp::before { background-image: url("../img/logo.webp"); }
.brand-mark-jpg::before  { background-image: url("../img/logo.jpg"); }
.brand-mark-jpeg::before { background-image: url("../img/logo.jpeg"); }

/* Stacking, stated once. The watermark is a fixed pseudo-element, so without an
   explicit layer it would paint over the page.

   ONLY the content column gets this — never a blanket `.app-shell > *`. That
   selector has the same specificity as .topbar and .sidebar and sits later in
   the file, so it overrode BOTH their position (the chrome scrolled away) and
   their z-index (the content painted over the top bar). Each layer is declared
   on the thing it belongs to: watermark 0, content 1, top bar 20, sidebar 30. */
.app-shell > .app-main {
    position: relative;
    z-index: 1;
}

/* --- Signed-out layout ----------------------------------------------------
   The sign-in card is the only thing on the page, so it is centred in the
   window rather than pushed down from the top. min-height on the shell (not
   the card) is what lets `margin: auto` resolve vertically; the card keeps its
   own max-width. Padding rather than pure centring so a short viewport, or a
   validation error growing the card, scrolls instead of clipping it. */
.app-shell:not(.app-shell-auth) {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
}
.app-shell:not(.app-shell-auth) .app-main { width: 100%; }
.app-shell:not(.app-shell-auth) .auth-card { margin: 0 auto; }

/* --- Fixed chrome: the offsets the out-of-flow bars leave behind -----------
   The bar is out of flow, so nothing reserves its height. ONE offset, on the
   shell, rather than one per child: at narrow widths the sidebar is a drawer
   that may or may not be in flow (it is display:none when closed), so padding
   the children instead would either double up when the drawer is open or leave
   the content under the bar when it is closed. The sidebar is fixed at desktop
   and so is unaffected by the shell padding either way. */
.app-shell-auth { padding-top: var(--topbar-h); }

@media (min-width: 900px) {
    /* The bar starts where the sidebar ends. */
    .app-shell-auth > .topbar { left: var(--sidebar-w); }
    /* The sidebar owns the full viewport height; its own scrollbar handles a
       menu longer than that. */
    .app-shell-auth > .sidebar { height: 100vh; }
}

@media (max-width: 899px) {
    /* Stacked: the sidebar is a drawer in normal flow again, so it must not be
       fixed, and the bar spans the full width. */
    .app-shell-auth > .sidebar {
        position: static;
        width: auto;
        height: auto;
    }
    .app-shell-auth > .topbar { left: 0; }
}

/* Extracted .docx text (FR-41). Pre-wrap keeps the paragraph breaks the
   extractor preserved without letting a long unbroken line force the page
   sideways; the max-height plus scroll stops a 30,000-character chapter from
   burying the actions above it. tabindex on the element makes the scroll region
   reachable by keyboard, which a plain overflow container is not. */
.doc-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    max-height: 60vh;
    overflow-y: auto;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    font-size: .9rem;
    line-height: 1.65;
}
.doc-text:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (max-width: 480px) {
    .doc-text { max-height: 50vh; font-size: .85rem; }
}

/* --- Rendered .docx (FR-41) -----------------------------------------------
   A reading surface, not a replica of a Word page: the goal is that a reviewer
   can read the document and judge it, so the type is comfortable and the
   structure (headings, emphasis, tables, images) survives. Page geometry does
   not, and the note above the render says so. Tokens throughout, so it follows
   the dark theme. */
.doc-render {
    max-height: 72vh;
    overflow-y: auto;
    /* The desk the sheets sit on, not the paper itself — the pages inside carry
       the surface colour, and the gap between them is what makes the document
       read as separate pages rather than one scroll. */
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    font-size: .92rem;
    line-height: 1.7;
}
.doc-render:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.doc-note { margin-bottom: .75rem; }

.doc-render .dv-p { margin: 0 0 .7rem; }
.doc-render .dv-li { padding-left: 1.5rem; position: relative; }
.doc-render .dv-li::before { content: "•"; position: absolute; left: .5rem; color: var(--muted); }
.doc-render .dv-h,
.doc-render .dv-title {
    margin: 1.4rem 0 .6rem;
    line-height: 1.3;
}
.doc-render .dv-title { font-size: 1.25rem; }
.doc-render h3.dv-h { font-size: 1.15rem; }
.doc-render h4.dv-h { font-size: 1.05rem; }
.doc-render h5.dv-h,
.doc-render h6.dv-h { font-size: .95rem; }
.doc-render .dv-link { color: var(--brand); text-decoration: underline; }
.doc-render .dv-tab { display: inline-block; width: 2em; }

/* Its own scroll container: a wide Word table must not drag the page sideways. */
.doc-render .dv-table-wrap { overflow-x: auto; margin: 0 0 1rem; }
.doc-render .dv-table {
    border-collapse: collapse;
    width: 100%;
    font-size: .85rem;
}
.doc-render .dv-table td {
    border: 1px solid var(--border);
    padding: .4rem .55rem;
    vertical-align: top;
}
.doc-render .dv-table .dv-p:last-child { margin-bottom: 0; }

.doc-render .dv-img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: .75rem 0;
}

@media (max-width: 480px) {
    .doc-render { padding: 1rem; max-height: 60vh; font-size: .88rem; }
}

/* --- Document modal (FR-41) ------------------------------------------------
   Sized to the viewport rather than the content: a document is long, so the
   dialog claims a fixed share of the screen and scrolls inside, instead of
   growing until it is taller than the window and unreachable at the bottom.
   The head is sticky within it so Close is always in reach. */
.doc-modal {
    /* Wider than a form dialog would be: the content is a document, often with
       wide tables, and 920px left them cramped while the dialog had room to
       spare. Capped so the line length stays readable on a large monitor. */
    width: min(1100px, 94vw);
    max-width: 94vw;
    height: min(88vh, 900px);
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 18px 48px rgba(40, 32, 6, .28);
    overflow: hidden;
}
.doc-modal::backdrop {
    background: rgba(26, 22, 6, .55);
}
.doc-modal-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.doc-modal-title {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}
.doc-modal-close {
    flex: none;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg);
    color: var(--text);
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
}
.doc-modal-close:hover { background: var(--gold); color: var(--gold-ink); }
.doc-modal-close:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.doc-modal-body {
    height: calc(100% - 3.6rem);
    overflow-y: auto;
    padding: 1.1rem 1.25rem 1.5rem;
}
/* Inside the dialog the cards are already framed by it, so they drop their own
   frame rather than stacking a box inside a box. */
.doc-modal-body .form-card {
    /* max-width matters most here: .form-card is capped at 480px because it was
       built for the sign-in and profile forms, and without resetting it the
       document sat in a 480px column inside a 900px dialog with the rest empty.
       A document is not a form and wants the whole width. */
    max-width: none;
    width: 100%;
    border: 0;
    box-shadow: none;
    padding: 0;
    margin: 0 0 1.25rem;
    background: transparent;
}
/* The render and the PDF frame each get their own scroll on the page; inside
   the dialog the dialog scrolls, so they grow instead of nesting scrollbars. */
.doc-modal-body .doc-render { max-height: none; overflow: visible; }
.doc-modal-body .doc-text { max-height: none; }
/* The dialog already caps itself against the viewport, so inside it the frame
   is sized as a share of the dialog rather than of the window — the page rule
   would overhang and make the dialog scroll twice. */
.doc-modal-body .doc-frame { height: 66vh; min-height: 24rem; }

@media (max-width: 480px) {
    .doc-modal { width: 96vw; height: 92vh; border-radius: 10px; }
    .doc-modal-body { padding: .9rem 1rem 1.2rem; }
}

/* The dialog's own actions. "Open full page" sits beside Close because the
   dialog is capped at a share of the viewport, and a long document is easier
   to read on the page that has the whole window. */
.doc-modal-actions {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex: none;
}
.doc-modal-full {
    font-size: .85rem;
    font-weight: 600;
    color: var(--brand);
    text-decoration: none;
    white-space: nowrap;
    padding: .35rem .6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
}
.doc-modal-full:hover { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.doc-modal-full:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

@media (max-width: 480px) {
    /* The title needs the room more than the label does on a phone. */
    .doc-modal-full { padding: .3rem .45rem; font-size: .8rem; }
}

/* The standalone viewer page has the same problem for the same reason: its
   cards are .form-card, so the document was boxed into 480px of a 900px column.
   Scoped to [data-doc-body], which exists only on that page. */
[data-doc-body] .form-card {
    max-width: none;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}
[data-doc-body] .page-head { max-width: none; }

/* --- Formatting carried over from the document (FR-41) ---------------------
   The renderer emits these as CLASSES because the CSP forbids inline style, so
   every visual property has to be a fixed name. That is also why the indent is
   quantised: a class cannot carry an arbitrary measurement. */
.doc-render .dv-center { text-align: center; }
.doc-render .dv-justify { text-align: justify; }
.doc-render .dv-right { text-align: right; }

/* Word's default first-line indent is 720 twips — half an inch. */
.doc-render .dv-indent { text-indent: 3em; }

.doc-render .dv-pad-1 { margin-left: 2em; }
.doc-render .dv-pad-2 { margin-left: 4em; }
.doc-render .dv-pad-3 { margin-left: 6em; }
.doc-render .dv-pad-4 { margin-left: 8em; }

.doc-render .dv-red { color: var(--doc-red); }
.doc-render .dv-blue { color: var(--doc-blue); }
.doc-render .dv-green { color: var(--doc-green); }

.doc-render .dv-mark {
    background: var(--doc-mark);
    color: var(--doc-mark-ink);
    padding: 0 .1em;
}

/* A centred heading must not also be indented — Word's own precedence, and
   without this a centred-and-indented paragraph drifts off centre. */
.doc-render .dv-center.dv-indent,
.doc-render .dv-right.dv-indent { text-indent: 0; }

/* --- Pages (FR-41) ---------------------------------------------------------
   Proportioned to A4 via min-height rather than a fixed height: the split
   comes from Word's recorded break positions, not from measuring text, so a
   page holds whatever fell on it and must be free to grow rather than clip. */
.doc-render .dv-page {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 2px;
    box-shadow: var(--shadow);
    margin: 0 auto 1.25rem;
    /* Width and padding come from the paper and margin classes below, which the
       renderer derives from the document's own w:sectPr. CSS inches are a real
       unit (96px), so a Letter page is drawn at the size it would print. */
    box-sizing: border-box;
    max-width: 100%;
}
.doc-render .dv-page:last-child { margin-bottom: 0; }

.doc-render .dv-page-num {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 1rem;
    margin: 0;
    text-align: center;
    font-size: .75rem;
    color: var(--muted);
}

/* A single unpaginated page is not a page — drop the paper metaphor rather
   than pretend a continuous scroll is one sheet. */
.doc-render .dv-page:only-child {
    min-height: 0;
    box-shadow: none;
    border: 0;
    padding: 1rem 1.25rem;
    max-width: none;
}
.doc-render .dv-page:only-child .dv-page-num { display: none; }

@media (max-width: 640px) {
    .doc-render { padding: .75rem; }
    .doc-render .dv-page {
        padding: 1.5rem 1.25rem 2.5rem;
        min-height: 0;
    }
}

/* --- Paper (FR-41) ---------------------------------------------------------
   Sizes as declared in the document, not assumed. min-height rather than
   height: the page split comes from Word's recorded break positions, and this
   renderer's line heights are not Word's, so a page must be free to grow
   rather than clip its own content. Content therefore never disappears; a page
   may simply run a little longer than it does in Word. */
.doc-render .dv-paper-letter { width: 8.5in; min-height: 11in; }
.doc-render .dv-paper-a4     { width: 8.268in; min-height: 11.693in; }
.doc-render .dv-paper-legal  { width: 8.5in; min-height: 14in; }
.doc-render .dv-paper-a5     { width: 5.83in; min-height: 8.27in; }
.doc-render .dv-paper-b5     { width: 6.93in; min-height: 9.84in; }

.doc-render .dv-paper-letter.dv-landscape { width: 11in; min-height: 8.5in; }
.doc-render .dv-paper-a4.dv-landscape     { width: 11.693in; min-height: 8.268in; }
.doc-render .dv-paper-legal.dv-landscape  { width: 14in; min-height: 8.5in; }
.doc-render .dv-paper-a5.dv-landscape     { width: 8.27in; min-height: 5.83in; }
.doc-render .dv-paper-b5.dv-landscape     { width: 9.84in; min-height: 6.93in; }

/* Margins in quarter-inch steps, one class per side, as the document sets them.
   The 1.5in left on both of this college's submissions is a binding margin —
   visibly not the 1in default, and exactly the kind of thing a fixed padding
   would have thrown away. */
.doc-render .dv-mt-1 { padding-top: .25in; }  .doc-render .dv-mb-1 { padding-bottom: .25in; }
.doc-render .dv-mt-2 { padding-top: .5in; }   .doc-render .dv-mb-2 { padding-bottom: .5in; }
.doc-render .dv-mt-3 { padding-top: .75in; }  .doc-render .dv-mb-3 { padding-bottom: .75in; }
.doc-render .dv-mt-4 { padding-top: 1in; }    .doc-render .dv-mb-4 { padding-bottom: 1in; }
.doc-render .dv-mt-5 { padding-top: 1.25in; } .doc-render .dv-mb-5 { padding-bottom: 1.25in; }
.doc-render .dv-mt-6 { padding-top: 1.5in; }  .doc-render .dv-mb-6 { padding-bottom: 1.5in; }
.doc-render .dv-mt-7 { padding-top: 1.75in; } .doc-render .dv-mb-7 { padding-bottom: 1.75in; }
.doc-render .dv-mt-8 { padding-top: 2in; }    .doc-render .dv-mb-8 { padding-bottom: 2in; }

.doc-render .dv-ml-1 { padding-left: .25in; }  .doc-render .dv-mr-1 { padding-right: .25in; }
.doc-render .dv-ml-2 { padding-left: .5in; }   .doc-render .dv-mr-2 { padding-right: .5in; }
.doc-render .dv-ml-3 { padding-left: .75in; }  .doc-render .dv-mr-3 { padding-right: .75in; }
.doc-render .dv-ml-4 { padding-left: 1in; }    .doc-render .dv-mr-4 { padding-right: 1in; }
.doc-render .dv-ml-5 { padding-left: 1.25in; } .doc-render .dv-mr-5 { padding-right: 1.25in; }
.doc-render .dv-ml-6 { padding-left: 1.5in; }  .doc-render .dv-mr-6 { padding-right: 1.5in; }
.doc-render .dv-ml-7 { padding-left: 1.75in; } .doc-render .dv-mr-7 { padding-right: 1.75in; }
.doc-render .dv-ml-8 { padding-left: 2in; }    .doc-render .dv-mr-8 { padding-right: 2in; }

/* A page wider than the screen would otherwise scroll the whole viewer
   sideways. Below the width of a sheet the paper stops being literal: it keeps
   its proportions loosely but fits the screen, because an unreadable accurate
   page is worth less than a readable approximate one. */
@media (max-width: 900px) {
    .doc-render [class*="dv-paper-"] {
        width: 100%;
        min-height: 0;
    }
    .doc-render [class*="dv-ml-"] { padding-left: 1.25rem; }
    .doc-render [class*="dv-mr-"] { padding-right: 1.25rem; }
    .doc-render [class*="dv-mt-"] { padding-top: 1.5rem; }
    .doc-render [class*="dv-mb-"] { padding-bottom: 2rem; }
}

/* A live region mid-fetch. Same restraint as the calendar: the swap is usually
   too fast for a spinner, but with no cue at all a slow search looks like a
   dead button. */
[data-live-region][aria-busy="true"] {
    opacity: .55;
    transition: opacity .12s ease-in;
}

/* --- Giving the document the screen (FR-41) --------------------------------
   .wrap caps content at 900px. That is the right readable measure for forms and
   tables, and the wrong one for a document: on a 1920px screen it left roughly
   480px for the page itself once the sidebar, and the browser's own PDF toolbar
   and thumbnail rail, had taken their share — which is why a document opened at
   69% zoom and had to be read at arm's length.

   :has() is what lets the page widen its own container without a second body
   class or a per-view stylesheet. Where it is unsupported nothing matches and
   the page stays at 900px: the old behaviour, not a broken one. */
.wrap:has([data-doc-body]) {
    max-width: none;
    padding-left: 2rem;
    padding-right: 2rem;
    /* Measured, not guessed: at the page's own 3rem the frame's bottom edge
       fell about 70px below the fold on a 1080px screen. Everything above the
       frame — top bar, title block, card heading, toolbar — comes to roughly
       21rem, which is what the frame's height subtracts. */
    padding-top: 1.75rem;
}

/* Form screens keep the old measure. A 480px card centres itself in whatever
   column it is given, so in a 1240px one it drifted away from its own page
   title, which stays left-aligned — the heading ended up stranded at the far
   left of an empty band. Nothing is gained by the extra width there either: a
   form is a single column of fields, not a table.

   The viewer is excluded because it uses .form-card for the document itself,
   and that is the one card that wants the whole screen. */
.wrap:has(.form-card):not(:has([data-doc-body])) { max-width: 900px; }

/* Full screen is hidden until app.js confirms the browser allows it — the API
   is refused outright in some embedded and iframed contexts, and a button that
   does nothing is worse than no button. */
.doc-fullscreen { display: none; }
.can-fullscreen .doc-fullscreen { display: inline-block; }

.doc-tools {
    display: flex;
    justify-content: flex-end;
    margin: 1rem 0 .4rem;
}
/* The toolbar has taken over the gap the frame used to open with; keeping both
   left a visible step between the button and the document it acts on. */
.doc-viewer-shell .doc-viewer { margin-top: 0; }

/* The shell is what the browser promotes, so the button travels with it and
   stays reachable; :fullscreen matches only that promoted element. The frame
   drops its viewport maths here and simply takes the space left beside the
   toolbar. */
.doc-viewer-shell:fullscreen {
    display: flex;
    flex-direction: column;
    padding: .4rem .6rem .6rem;
    background: var(--bg);
}
.doc-viewer-shell:fullscreen .doc-tools { margin: 0 0 .4rem; }
.doc-viewer-shell:fullscreen .doc-viewer {
    display: flex;
    flex: 1 1 auto;
    /* Against the flex default of min-height:auto, which would let the frame
       push the shell past the screen instead of shrinking to fit it. */
    min-height: 0;
    margin-top: 0;
}
.doc-viewer-shell:fullscreen .doc-frame {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
}

@media (max-width: 899px) {
    /* The sidebar is a drawer at this width and the screen is small: the wider
       gutters would cost more than the width they buy back. */
    .wrap:has([data-doc-body]) { padding-left: 1.25rem; padding-right: 1.25rem; }
}

/* --- Batch D: upload notes, revision notes, released documents ----------
   All built from the existing tokens so both themes follow automatically;
   nothing here hard-codes a colour. */

/* FR-43: the note a faculty member attached to one upload. Sits under the
   filename in Version history, quiet enough not to compete with it. */
.upload-comment {
    display: block;
    margin-top: .2rem;
    font-size: .85rem;
    font-style: italic;
    color: var(--muted);
}

/* The same note on the upload form itself. Full width under the file picker
   rather than beside it: the row is already tight on a narrow screen. */
.upload-note {
    display: block;
    width: 100%;
    margin: .4rem 0;
    padding: .35rem .5rem;
    font-size: .85rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
}

/* FR-44: the reviewer's page-anchored notes, on the review form. */
.revision-notes { border: 1px solid var(--border); border-radius: 8px; padding: .75rem 1rem; }
.revision-notes legend { font-weight: 600; padding: 0 .4rem; }
.note-row { display: flex; gap: .75rem; align-items: flex-end; margin-top: .5rem; }
.note-row .note-page { flex: 0 0 6rem; }
.note-row .note-text { flex: 1 1 auto; }
.note-label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: .15rem; }
.note-row input {
    width: 100%;
    padding: .35rem .5rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
}

/* FR-44 again, on the faculty member's side: the list they act on. */
.revision-note-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.revision-note-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .6rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--brand);
    border-radius: 8px;
    padding: .6rem .9rem;
}
.note-page-link {
    flex: 0 0 auto;
    font-weight: 600;
    font-size: .85rem;
    white-space: nowrap;
}
/* "General" is not a link, so it must not look like one. */
.note-page-none { color: var(--muted); font-weight: 500; }
.note-body { flex: 1 1 14rem; }

/* FR-45: the Secretary's release form. */
.release-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.15rem;
    max-width: 34rem;
}

@media (max-width: 40rem) {
    /* Page and text stack rather than squeeze to unusable widths. */
    .note-row { flex-direction: column; align-items: stretch; gap: .35rem; }
    .note-row .note-page { flex: 1 1 auto; }
}

/* --- Live search panel (FR-37) ---
   Sits at the top of <main>, as a sibling of [data-page-content] rather than
   inside it, and app.js fills it with the results lifted out of /search while
   hiding the page underneath. Empty and hidden until then, so a browser
   without script never renders it and the top bar's form submits exactly as
   it always did.

   The [hidden] rule below is the load-bearing part. `hidden` is only a UA
   `display: none`, so ANY author rule setting `display` on one of these
   elements would silently beat it and leave the panel on screen permanently —
   including a rule added later by someone who has never read this comment.
   Scoped to these two attributes rather than declared globally on [hidden],
   which would reach markup this file knows nothing about. */
.live-search[hidden],
[data-page-content][hidden] { display: none !important; }

.live-search { margin: 0 0 1.25rem; }

/* The one line that is announced as the term changes. Styled as a statement
   about the search rather than as a result: same left-rule treatment as the
   other "here is what you are looking at" notes in the app. :empty so a
   cleared status does not leave an empty bordered box behind it. */
.live-search-status {
    margin: 0 0 1.25rem;
    padding: .55rem .85rem;
    font-size: .9rem;
    line-height: 1.5;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--brand);
    border-radius: 0 8px 8px 0;
}
.live-search-status:empty { display: none; }

/* The first heading inside the lifted results has the status line directly
   above it, which is already spaced; .section-title's own 2rem top margin
   doubles that into a gap that reads as a missing element. */
.live-search [data-live-search-target] > .section-title:first-child { margin-top: 0; }

/* --- The composition behind a percentage (FR-16, FR-17, FR-24) ---
   Sits under the figure cards on the two screens that have no status bar to
   spell the parts out. Pulled up against the card grid, because it belongs
   to the figures above it rather than to the section below. */
.figure-composition { margin: -.5rem 0 1.5rem; }

/* FR-53 (R6-7): the Staff group's two figures, in one compact row under the College's cards on the dashboard and
   the board. It reuses .measure's surface; every colour is an existing token, so both themes are covered. */
.measure.staff-panel { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem 1.5rem; padding: .85rem 1.25rem; margin-bottom: 1.5rem; }
.staff-panel-label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.staff-panel-item { font-variant-numeric: tabular-nums; color: var(--text); }
.staff-panel .staff-panel-view { margin-left: auto; }
/* R6-8 (E11, E12): the Staff Overdue item is a link in the Overdue colour (the same token the Overdue chips and
   rows use, both themes), and the note takes a line of its own under the figures. */
.staff-panel .staff-panel-overdue { color: var(--st-overdue); font-weight: 600; }
.staff-panel-note { flex: 1 0 100%; margin: 0; font-size: .85rem; color: var(--muted); }

/* --- Review queue: filters and results (FR-12) ---
   The filter row carries five controls now, so it wraps; .filter-actions keeps
   the button and Clear together on whichever line they land on rather than
   letting Clear wrap away from the button it belongs beside. */
.filter-form .filter-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
}

/* The count above the table. It is the first thing that changes when a filter
   is applied, which is what tells the reader the filter did anything at all on
   a result set too long to take in at a glance. */
.queue-count { margin: 0 0 .75rem; }

/* The submission time, beside its date. Quieter than the date because the date
   is what is scanned and the time only matters when a time range is set. */
.queue-time { margin-left: .4rem; font-size: .8rem; color: var(--muted); }

/* Dimmed while a live filter is in flight, so a slow response reads as "this
   is being updated" rather than as stale results that ignored the change.
   A transition, not a spinner: the swap is usually too fast to see one. */
[data-live-filter-region] { transition: opacity .12s ease-in-out; }
[data-live-filter-region].is-updating { opacity: .45; }

/* --- Row action menu (faculty checklist, FR-7) ---
   A <details>/<summary> pair, not a scripted dropdown. It opens, closes,
   takes focus, is Enter/Space-activatable and announces its expanded state
   to a screen reader with no JavaScript — which this app needs, because the
   CSP forbids inline handlers and the checklist has to work on a phone with
   scripting off.

   The trade-off is that only one can be styled open at a time per browser
   default, and clicking outside does not close it. For a two-item menu that
   is an acceptable price for not shipping a focus trap. */
/* No `position: relative` here any more: it existed only to be the containing
   block for an absolutely positioned panel, and there is no longer one. */
.row-menu { display: inline-block; }

/* The three dots. Sized to the other .btn-sm controls in the cell so the
   action row stays on one baseline, and square so it reads as an icon button
   rather than a short label. */
.row-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 1.9rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    /* The default disclosure triangle would sit beside the dots. */
    list-style: none;
}
.row-menu-toggle::-webkit-details-marker { display: none; }
.row-menu-toggle::marker { content: ''; }
.row-menu-toggle:hover { border-color: var(--brand); color: var(--brand); }
.row-menu-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.row-menu[open] > .row-menu-toggle { border-color: var(--brand); color: var(--brand); }

/* Claims a full line of the action cell while open, so the panel is as wide
   as the column instead of as narrow as the gap left by three buttons. */
.row-menu[open] { flex: 1 1 100%; }

/* IN FLOW, deliberately, not absolutely positioned.

   An absolute panel cannot escape .table-wrap. That wrapper declares only
   `overflow-x: auto` for wide tables, but a scroll container clips BOTH axes:
   with `overflow-y` left at `visible` it computes to `auto`. So the panel was
   cut off at the wrapper's bottom edge and the table grew an inner vertical
   scrollbar, and scrolling it to read the panel pushed the row that the panel
   belongs to out of sight.

   It only bites when few rows follow the one being opened. On seeded demo data
   seven rows sit below, the wrapper is ~1027px tall, and the panel still lands
   inside it -- measured clipping 0px. On the pilot screen, which has a single
   requirement, the wrapper is 282px and the panel hangs 57px past it. That is
   why no local screen showed this.

   In flow, opening the menu makes the row taller instead, and a taller row is
   something no scroll container can clip. The phone layout already did exactly
   this, so this is now one behaviour at every width rather than two. */
.row-menu-panel {
    width: auto;
    margin-top: .5rem;
    padding: .75rem .85rem;
    text-align: left;
    white-space: normal;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.row-menu-note,
.row-menu-warn { margin: 0 0 .6rem; font-size: .8rem; line-height: 1.5; }
.row-menu-note { color: var(--muted); }
.row-menu-note strong { color: var(--text); }
/* The withdrawal consequence, stated rather than hidden behind a confirm()
   the CSP would block and nobody reads. */
.row-menu-warn { color: var(--err); }
.row-menu-form { margin: 0; }

/* The stacked phone layout needs nothing of its own any more: the panel is in
   flow at every width now, and the cell there is already full width. */
@media (max-width: 640px) {
    .row-menu { display: block; }
}

/* ---------------------------------------------------------------------------
   The requirement form's faculty picker: search + employment narrowing
   (the Secretary's 2026-10-15 request).

   Hidden unless app.js is running. The whole control is a view operation over
   a list that is already on screen, so with no script there is nothing for it
   to do -- and a dead search box is worse than none. `.js` is set on <html>
   by app.js before paint, which is the same progressive-enhancement hook the
   mobile nav toggle uses.
   --------------------------------------------------------------------------- */
.picker-tools { display: none; }
.js .picker-tools {
    display: block;
    margin: .35rem 0 .6rem;
    padding: .55rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
}

/* The magnifier sits INSIDE the field rather than beside it, so the control
   reads as one thing and the panel -- which is already indented inside a
   fieldset inside a form -- does not lose another 2rem of width to a button
   that does nothing a placeholder could not say. */
.picker-search {
    position: relative;
    display: block;
}
.picker-search .picker-search-icon {
    position: absolute;
    left: .5rem;
    top: 50%;
    width: 1rem;
    height: 1rem;
    margin-top: -.5rem;
    pointer-events: none;
    stroke: var(--muted);
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
}
.picker-search input {
    width: 100%;
    padding: .4rem .55rem .4rem 1.9rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
}
.picker-search input:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 1px;
}
/* The UA's own clear button, kept: it is one of the few native affordances a
   search field has, and people look for it. */
.picker-search input::-webkit-search-cancel-button { cursor: pointer; }

/* A segmented control rather than three loose pills. Equal columns, so the
   three fit one row at the panel's width instead of wrapping "Part-time
   instructors" onto a line of its own -- which is what made the group read as
   two unrelated controls. */
.picker-filters {
    display: grid;
    /* Four segments since R6-6: All, Full-time, Part-time, Staff. A fixed 3 would
       wrap Staff onto a second row and read as a second control. */
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: .45rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    background: var(--surface);
}
.picker-filters .filter-tab {
    border: 0;
    border-radius: 0;
    padding: .35rem .25rem;
    font-size: .78rem;
    text-align: center;
    cursor: pointer;
    white-space: nowrap;
    /* The divider lives on the left edge of every button but the first, so the
       control has no double border down the middle and no gap at the ends. */
    border-left: 1px solid var(--border);
}
.picker-filters .filter-tab:first-child { border-left: 0; }
.picker-filters .filter-tab.active { color: var(--on-primary); background: var(--primary); }
.picker-filters .filter-tab:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: -2px;
}
/* This ring is drawn INSIDE the segment, so on the blue active one it sits on
   --primary: --on-primary there is 5.67:1 (light) and 6.69:1 (dark). */
.picker-filters .filter-tab.active:focus-visible {
    outline: 2px solid var(--on-primary);
    outline-offset: -2px;
}
/* R6-8 (C21): the picker column is 220-236px under 480px, which gave each of the four buttons ~49px and clipped
   "Full-time" / "Part-time" to "Full-tim" / "Part-tim". Two rows of two instead. The divider is redrawn for two
   rows: the third button starts a row so it loses its left border, and the third and fourth gain a top border,
   so there is no double border and no gap. From 480px up the four-in-a-row rule above is untouched. The buttons'
   accessible names are the full text either way. */
@media (max-width: 479px) {
    .picker-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .picker-filters .filter-tab:nth-child(3) { border-left: 0; }
    .picker-filters .filter-tab:nth-child(n+3) { border-top: 1px solid var(--border); }
}
/* R6-9a: at exactly 320px a two-up cell is ~59.5px and "Part-time" (600 weight) is ~2px wider than the cell's
   content box, so its last glyph touched the clipped, rounded edge. Trim the side padding and a hair of type under
   340px; 340px and up are unchanged. */
@media (max-width: 339px) {
    .picker-filters .filter-tab { padding-left: .1rem; padding-right: .1rem; font-size: .75rem; }
}

/* A sentence, not a badge: it has to be able to say "2 selected, 1 of them
   hidden by this filter, and still selected", which is the one thing about
   this control that can surprise somebody. */
.picker-count {
    margin: .4rem 0 0;
    font-size: .8rem;
    line-height: 1.35;
}

/* The list reads as the picker's result, so it sits in the panel's surface
   with rows that are separated rather than merely stacked, and each row is a
   whole-width hit target rather than a label the width of its text. */
.js .audience-panel .checkbox-list {
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    max-height: 16rem;
}
.audience-panel .checkbox-list li + li { border-top: 1px solid var(--border); }
.audience-panel .checkbox-list .checkbox-label {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .4rem .55rem;
    cursor: pointer;
}
.audience-panel .checkbox-list .checkbox-label:hover { background: var(--bg); }
.audience-panel .checkbox-list input[type="checkbox"] { flex: none; margin: 0; }
/* The program code and the part-time note are secondary to the name, and they
   go to the right so the names stay in one readable column. */
.audience-panel .checkbox-list .muted-note { margin-left: auto; font-size: .78rem; }
.audience-panel .checkbox-list .muted-note + .muted-note { margin-left: .4rem; }

/* The [hidden] guard, for the fourth time in this stylesheet. `hidden` is only
   a UA `display: none`, and .checkbox-label above now sets `display: flex` on
   the row's own child -- so the day anyone moves that display onto the <li>
   itself, every filtered-out row comes back and the filter silently stops
   working. Cheap now, invisible later. */
.checkbox-list li[hidden] { display: none !important; }

/* The standalone sort form, on screens with no filter form to host the field.
   Laid out as one row so it reads as a single control rather than a second
   filter panel competing with the table beneath it. */
.sort-form { align-items: flex-end; }

/* The Sort button exists for the no-script path only: [data-autosubmit] makes
   it redundant the moment app.js runs, and a button nobody ever needs to press
   teaches people to look for one elsewhere. Hidden under .js, exactly as the
   picker tools are SHOWN under it. */
.js .sort-go { display: none; }

/* --- Profile screen (Task 11) -- FR-5 profile, FR-40 avatar ---------------
   The client's mockup: a photo card beside two stacked cards. Tokens only, so
   the dark theme follows with no second rule set; measured pairs are in
   contrast_check.py. One column by default (phones, 320px included), two from
   1024px: the sidebar takes 256px of that, and a third of what remains is the
   narrowest the photo card can be before its button wraps. Every track is
   minmax(0, ...) or min(100%, ...), so a long email or filename can never
   widen a column. */
.page-pill {
    display: inline-block;
    margin-bottom: .6rem;
    padding: .25rem .8rem;
    border: 1px solid var(--gold-strong);
    border-radius: 999px;
    background: var(--gold-soft);
    color: var(--text);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}
.profile-main {
    display: grid;
    gap: 1.25rem;
    min-width: 0;
}
@media (min-width: 1024px) {
    .profile-grid { grid-template-columns: minmax(15rem, 1fr) minmax(0, 2fr); }
}

.profile-card {
    min-width: 0;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}
@media (max-width: 480px) {
    .profile-card { padding: 1.1rem; }
}
.profile-card-title {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: 0 0 1rem;
    padding-bottom: .85rem;
    border-bottom: 1px solid var(--border);
    font-size: 1.15rem;
}
.profile-icon {
    flex: none;
    width: 1.4rem;
    height: 1.4rem;
    fill: none;
    stroke: var(--blue);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Detail fields: one column on a phone, two from 640px. The password trio sizes
   itself instead (1 to 3 columns by the room the card has). */
.profile-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    column-gap: 1.25rem;
}
@media (min-width: 640px) {
    .profile-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.profile-fields .field { min-width: 0; }
.profile-fields--three {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
}
.profile-field--wide { grid-column: 1 / -1; }

/* Editable inputs sit on the card's surface; read-only values sit on the page
   ground, so "grey" reads as "not yours to change". */
.profile-card .field input { background: var(--surface); }
.profile-readonly {
    padding: .55rem .7rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: .9rem;
    overflow-wrap: anywhere;
}
.profile-note {
    margin: .35rem 0 0;
    color: var(--muted);
    font-size: .85rem;
}
.profile-card .role-pill {
    font-size: .8rem;
    color: var(--ok);
    background: var(--ok-bg);
    padding: .2rem .65rem;
}

/* Photo card. */
.photo-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 1.25rem;
}
.profile-card--photo .avatar-lg {
    width: 9rem;
    height: 9rem;
}
.profile-card--photo .avatar-lg .avatar-initials { font-size: 2.75rem; }
@media (max-width: 480px) {
    .profile-card--photo .avatar-lg { width: 6.5rem; height: 6.5rem; }
    .profile-card--photo .avatar-lg .avatar-initials { font-size: 2rem; }
}
.profile-card--photo .photo-form {
    width: 100%;
    align-items: center;
    gap: .6rem;
}
/* The real <input type=file> is clipped, not display:none: it stays focusable
   and the label that wraps it is the visible button. */
.choose-photo {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    padding: .6rem 1rem;
    border: 1px solid var(--blue);
    border-radius: 8px;
    background: var(--blue-bg);
    color: var(--blue);
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
}
.choose-photo:hover { border-color: var(--primary-hover); color: var(--primary-hover); }
.choose-photo:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.choose-photo.has-file { border-color: var(--brand); }
.choose-photo > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.choose-photo-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
}
.photo-caption {
    margin: 0;
    color: var(--muted);
    font-size: .8rem;
    text-align: center;
}

/* Buttons with a leading glyph (Upload, Save details, Change password). */
.btn-with-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
}
.btn-icon {
    flex: none;
    width: 1.1rem;
    height: 1.1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
/* end Profile screen (Task 11) */

/* --- Compliance Matrix screen (Task 12) -- FR-18, Batch G employment tabs ---
   The client's mockup: a Secretary pill, blue-outlined filter tabs (the
   selected one filled), and one card holding the matrix under a tinted header
   band. Tokens only. The table scrolls INSIDE the card (.matrix-wrap is the
   overflow-x container and the card is min-width: 0), so the page itself never
   scrolls sideways; the first column stays sticky on an opaque --surface (the
   matrix is excluded from zebra for exactly that reason). */
.page-pill-icon {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    margin-right: .4rem;
    vertical-align: -.2em;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Outlined blue when idle, filled (the shared .active rule) when selected. */
.filter-tabs--matrix .filter-tab:not(.active) {
    color: var(--blue);
    border-color: var(--blue);
    background: var(--surface);
}
.filter-tabs--matrix .filter-tab:not(.active):hover { background: var(--blue-bg); color: var(--blue); }

.matrix-card {
    min-width: 0;
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}
@media (max-width: 480px) {
    .matrix-card { padding: .9rem; }
}
.matrix-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin: 0 0 1rem;
}
.matrix-card-title {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: 0;
    font-size: 1.15rem;
}
.matrix-card-icon {
    flex: none;
    width: 1.4rem;
    height: 1.4rem;
    fill: none;
    stroke: var(--blue);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.matrix-card .table-wrap { box-shadow: none; }
.matrix-card .matrix-wrap { margin-bottom: 0; }
.matrix-card .alert { margin: 0; }

.matrix-table thead th {
    background: var(--blue-bg);
    color: var(--text);
}
.matrix-col-title {
    display: block;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text);
}
.matrix-table .matrix-col-meta { font-size: .75rem; }
.matrix-table .matrix-faculty-col { border-right: 1px solid var(--border); }
.matrix-none { color: var(--muted); }
/* end Compliance Matrix screen (Task 12) */

/* --- Round 4 shared chrome (Step 1) -- plan §3 ---
   The client's Secretary mockups, as reusable pieces: section pill, filter
   panel, summary banner, table card with a header band, outlined small button
   and empty state. Token-only (both themes come for free): every colour is a
   var(), including the five status tones, so the status palette stays the
   single source. There is no Overdue tone: Overdue is a flag, not a status.
   Classes first used in later steps (section pill, field icon, card head,
   submitted tone) are defined here so those steps reuse the names. */
.page-pill--section {
    background: var(--blue-bg);
    border-color: var(--blue);
    color: var(--text);
}

.filter-panel {
    min-width: 0;
    margin: 0 0 1rem;
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}
.filter-panel .filter-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
    gap: 1rem;
    margin: 0;
    align-items: end;
}
.filter-panel .filter-form .field { min-width: 0; margin-bottom: 0; }
.field-icon {
    width: 1rem;
    height: 1rem;
    margin-right: .4rem;
    vertical-align: -.15em;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.summary-banner {
    --banner-tint: var(--blue-bg);
    --banner-ink: var(--blue);
    display: flex;
    align-items: center;
    gap: .9rem;
    margin: 0 0 1rem;
    padding: .9rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--banner-tint);
    color: var(--text);
}
.summary-banner--pending   { --banner-tint: var(--st-pending-bg);   --banner-ink: var(--st-pending); }
.summary-banner--submitted { --banner-tint: var(--st-submitted-bg); --banner-ink: var(--st-submitted); }
.summary-banner--approved  { --banner-tint: var(--st-approved-bg);  --banner-ink: var(--st-approved); }
.summary-banner--revised   { --banner-tint: var(--st-revised-bg);   --banner-ink: var(--st-revised); }
.summary-banner-icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: var(--surface);
    color: var(--banner-ink);
}
.summary-banner-glyph {
    width: 1.4rem;
    height: 1.4rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.summary-banner .status-pill { box-shadow: inset 0 0 0 1px currentColor; }
.summary-banner-text { margin: 0; color: var(--text); }
.summary-banner-sub { margin: .15rem 0 0; font-size: .85rem; color: var(--text); }
.summary-banner-body { flex: 1 1 auto; min-width: 0; }

.table-card {
    min-width: 0;
    margin: 0 0 1rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}
.table-card .table-wrap { box-shadow: none; }
.table-card .table thead th { background: var(--blue-bg); color: var(--text); }
.table-card .alert { margin: 0; }
.table-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin: 0 0 .9rem;
}
.table-card-title {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: 0;
    font-size: 1.15rem;
}
.table-card-icon {
    flex: none;
    width: 1.4rem;
    height: 1.4rem;
    fill: none;
    stroke: var(--blue);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.btn-outline-sm {
    background: var(--surface);
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline-sm:hover { background: var(--blue-bg); }
.btn-sm .btn-icon { width: .95rem; height: .95rem; }

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: .5rem;
    padding: 2rem 1rem;
    white-space: normal;
}
.empty-state--pending   { --empty-tint: var(--st-pending-bg);   --empty-ink: var(--st-pending); }
.empty-state--submitted { --empty-tint: var(--st-submitted-bg); --empty-ink: var(--st-submitted); }
.empty-state--approved  { --empty-tint: var(--st-approved-bg);  --empty-ink: var(--st-approved); }
.empty-state--revised   { --empty-tint: var(--st-revised-bg);   --empty-ink: var(--st-revised); }
.empty-state-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: var(--empty-tint, var(--blue-bg));
    color: var(--empty-ink, var(--blue));
}
.empty-state-glyph {
    width: 2rem;
    height: 2rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.empty-state-title { margin: 0; font-weight: 600; font-size: 1rem; color: var(--text); }
.empty-state-text { margin: 0; font-size: .9rem; color: var(--muted); }

.input-icon-wrap { position: relative; display: block; }
.input-icon {
    position: absolute;
    left: .65rem;
    top: 50%;
    width: 1rem;
    height: 1rem;
    margin-top: -.5rem;
    pointer-events: none;
    fill: none;
    stroke: var(--muted);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.input-icon-wrap input { padding-left: 2.1rem; }

@media (max-width: 480px) {
    .filter-panel, .table-card { padding: .9rem; }
}

@media print {
    .filter-panel { display: none; }
    .summary-banner, .summary-banner-icon, .table-card, .empty-state-icon { background: none; box-shadow: none; border-color: currentColor; }
    .table-card .table thead th { background: none; }
    .summary-banner, .summary-banner-text, .summary-banner-sub, .table-card .table thead th,
    .empty-state-title, .empty-state-text { color: inherit; }
}

/* Record-state dot (Round 4 Step 8, plan 3.6): Active/Inactive are record states, not
   submission statuses, and Active shares the Approved green. A dot (not the Approved
   check) tells them apart in greyscale. Drawn in the pill's own text colour. */
.status-pill-active::before, .status-pill-inactive::before { content: "\25CF\00a0"; }
/* end Round 4 shared chrome (Step 1) */

/* --- Round 4 Review Queue (Step 2b) -- plan §2 ---
   The queue's six columns plus three icon buttons are wider than the card at
   1200-1440px, so the action column was cut off inside the scrolling
   .table-wrap. The modifier sits on the SECTION (never on the cell, whose
   attributes other suites pin): every cell may wrap except Submitted (a date
   and a time, kept on one line), and the buttons wrap onto a second line
   inside their cell. Narrowest content per column, padding included: about
   92 + 122 + 102 + 117 + 197 + 145 = 775px against a 848px card interior at a
   1200px viewport, so the table fits with no horizontal scroll from there up.
   These rules apply at every width; at 640px and below .table--stack turns the
   cells into blocks, so the nowrap on Submitted has no visible effect there. */
.table-card--queue .table th,
.table-card--queue .table td { white-space: normal; }
.table-card--queue .table td[data-label="Submitted"] { white-space: nowrap; }
.table-card--queue .table-actions > * { margin: .15rem .4rem .15rem 0; }
.table-card--queue .table-actions > * + * { margin-left: 0; }
/* end Round 4 Review Queue (Step 2b) */

/* --- Round 4 Review Queue (Step 2c) -- plan §2 ---
   At a 1200px viewport the card interior is 849px and the table needed 853px,
   with the three buttons stacked three high. Between the stacked layout
   (641px) and 1279px the time drops under its date (saves about 70px), and
   the cells take .65rem of side padding instead of 1rem (saves about 25px
   across six columns), which leaves the action column room for its buttons
   side by side. A VIEWPORT query, not a print block. */
@media (min-width: 641px) and (max-width: 1279px) {
    .table-card--queue .table td[data-label="Submitted"] { white-space: normal; }
    .table-card--queue .table td[data-label="Submitted"] .queue-time { display: block; margin-left: 0; }
    .table-card--queue .table th,
    .table-card--queue .table td { padding-left: .65rem; padding-right: .65rem; }
    .table-card--queue .table-actions > * { margin-right: .3rem; }
}
/* end Round 4 Review Queue (Step 2c) */

/* --- B4 Bulk approve on the Review Queue (FR-60) ---
   One narrow checkbox column in front of the six, so the table still fits its card (the 2.25rem column is paid for by
   the side padding the 641-1279px band already trims). The header cell holds the script-made select-all box. At 640px
   and below .table--stack makes the cell a labelled block ("SELECT" on the left, the box on the right); a row with
   nothing to tick has no cell there at all. The bar and the column are screen-only (hidden in the print block above). */
.bulk-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1rem;
    margin: 0 0 .75rem;
}
/* The per-row .sr-only labels are absolutely positioned; without a containing block they sit outside the scroller and can
   widen the page (the matrix's lesson). The queue's scroller is the containing block now. */
.table-card--queue .table-wrap { position: relative; }
.bulk-hint { flex: 1 1 16rem; margin: 0; font-size: .85rem; color: var(--muted); }
.bulk-bar button[disabled] { opacity: .55; cursor: not-allowed; }
/* The script-made select-all lives in the bar, not the clipped table header, so it is visible at every width. */
.bulk-all-label { display: inline-flex; align-items: center; gap: .4rem; font-size: .9rem; cursor: pointer; }
.bulk-all-label input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    margin: 0;
    cursor: pointer;
    accent-color: var(--primary);
}
.table-card--queue .table th.col-select,
.table-card--queue .table td.col-select { width: 2.25rem; padding-left: .65rem; padding-right: .25rem; text-align: center; }
.table-card--queue .table .col-select input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    margin: 0;
    vertical-align: middle;
    cursor: pointer;
    accent-color: var(--primary);
}
/* Between the stacked layout and 1279px the existing band already trims side padding; the checkbox column is trimmed
   harder so adding it costs about 24px instead of 34 (measured: 5px of horizontal scroll at 1000px with realistic data
   before this, none after). Rows still scroll inside .table-wrap where they did before the column existed. */
@media (min-width: 641px) and (max-width: 1279px) {
    .table-card--queue .table th.col-select,
    .table-card--queue .table td.col-select { width: 1.75rem; padding-left: .35rem; padding-right: .1rem; }
    .table-card--queue .table .col-select input[type="checkbox"] { width: 1rem; height: 1rem; }
}
@media (max-width: 640px) {
    .table-card--queue .table td.col-select { width: 100%; text-align: left; }
    .table-card--queue .table td.col-select--none { display: none; }
}
/* end B4 Bulk approve */

/* --- Review Queue: stack when the CARD is too narrow for the table (2026-11-29) ---
   The queue's seven columns (with the checkbox) need about 730px of card interior no matter how the cells wrap, and
   that much is not there in two separate bands of VIEWPORT width: 641-806px (no sidebar yet, the card is the whole
   page) and 900-1100px (the sidebar takes 221px back). A viewport breakpoint cannot name both, so the card measures
   itself: it is a size container, and below 48rem (816px of interior, a little over the 730px floor so a longer name
   does not tip it) it takes the same labelled-block layout .table--stack gives a phone at 640px and below. Every rule
   is the phone block's own, scoped to the queue; the interior is 849px at 1200px and up, so desktop is unchanged.
   Screen only: a printed queue keeps its table. Selectors are (0,2,1) or (0,3,1) and come after the 641-1279px rules
   above so they win where those would otherwise apply (padding, checkbox column, the date/time split). */
.table-card--queue { container: queue-card / inline-size; }
@media screen {
    @container queue-card (max-width: 48rem) {
        .table-card--queue .table--stack thead {
            position: absolute;
            width: 1px;
            height: 1px;
            overflow: hidden;
            clip: rect(0 0 0 0);
            white-space: nowrap;
        }
        .table-card--queue .table--stack,
        .table-card--queue .table--stack tbody,
        .table-card--queue .table--stack tr,
        .table-card--queue .table--stack td { display: block; width: 100%; }
        .table-card--queue .table--stack tr { border-bottom: 1px solid var(--border); padding: .35rem 0; }
        .table-card--queue .table--stack tbody tr:last-child { border-bottom: none; }
        .table-card--queue .table--stack td {
            border-bottom: none;
            white-space: normal;
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            gap: .35rem 1rem;
            padding: .3rem .9rem;
        }
        .table-card--queue .table--stack td::before {
            content: attr(data-label);
            font-weight: 700;
            font-size: .7rem;
            text-transform: uppercase;
            letter-spacing: .04em;
            color: var(--muted);
            flex-shrink: 0;
        }
        .table-card--queue .table--stack td .checklist-subtitle { flex-basis: 100%; }
        .table-card--queue .table--stack td.table-actions { display: block; }
        .table-card--queue .table--stack td.table-actions::before { display: block; margin-bottom: .35rem; }
        .table-card--queue .table--stack td[colspan] { display: block; }
        .table-card--queue .table--stack td[colspan]::before { content: none; }
        .table-card--queue .table--stack td[data-label="Submitted"] { white-space: normal; }
        .table-card--queue .table--stack td[data-label="Submitted"] .queue-time { display: inline; margin-left: .4rem; }
        .table-card--queue .table--stack td.col-select { width: 100%; text-align: left; }
        .table-card--queue .table--stack td.col-select--none { display: none; }
    }
}
/* end Review Queue card-width stacking */

/* --- Round 4 Submission Search (Step 3) -- plan §2 ---
   Seven columns and two icon buttons are wider than the card at 1200px, so the
   modifier (on the SECTION, never on a cell) lets every cell wrap except the
   two dates, and lets the buttons wrap inside their cell. Narrowest content per
   column, padding included: about 92 + 122 + 102 + 117 + 127 + 127 + 145 = 832px
   against an 849px card interior at a 1200px viewport; the band below trims the
   side padding between the stacked layout (641px) and 1279px for the slack.
   At 640px and below .table--stack turns the cells into blocks. Not a print block. */
.table-card--search .table th,
.table-card--search .table td { white-space: normal; }
.table-card--search .table td[data-label="Deadline"],
.table-card--search .table td[data-label="Submitted"] { white-space: nowrap; }
.table-card--search .table-actions > * { margin: .15rem .4rem .15rem 0; }
.table-card--search .table-actions > * + * { margin-left: 0; }
@media (min-width: 641px) and (max-width: 1279px) {
    .table-card--search .table th,
    .table-card--search .table td { padding-left: .65rem; padding-right: .65rem; }
    .table-card--search .table-actions > * { margin-right: .3rem; }
}
/* end Round 4 Submission Search (Step 3) */

/* --- Round 4 Monitoring Board (Step 4) -- plan §2 ---
   Two filled card rows, no blank cell at any width. Row 1 is the existing
   .dash-cards--5 (1 / 2 / 3 / 5 columns) and the extra .board-cards--5 turns its
   768-1279px three-column layout into a six-track grid (three cards of two
   tracks, then two of three) so the second line is full. Row 2 is its own
   three-card grid: 1 column, 2 from 480px with the last card spanning, 3 from
   768px. Every track is minmax(0, 1fr) and the cards are min-width: 0, so a long
   detail wraps and never widens a column. Progress takes a blue tint, and the
   two rates carry a decorative meter under the figure. Tokens only. */
.card.tint-blue { border-left-color: var(--blue); --card-tint: var(--blue-bg); --card-ink: var(--blue); }
.board-cards--3 { grid-template-columns: minmax(0, 1fr); }
.board-cards--3 > .card, .board-cards--5 > .card { min-width: 0; }
@media (min-width: 480px) {
    .board-cards--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .board-cards--3 > :last-child { grid-column: 1 / -1; }
}
@media (min-width: 768px) {
    .board-cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .board-cards--3 > :last-child { grid-column: auto; }
}
@media (min-width: 768px) {
    .board-cards--5 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .board-cards--5 > .card { grid-column: span 2; }
    .board-cards--5 > .card:nth-child(n + 4) { grid-column: span 3; }
}
@media (min-width: 1280px) {
    .board-cards--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .board-cards--5 > .card, .board-cards--5 > .card:nth-child(n + 4) { grid-column: auto; }
}
.board-meter { margin: .5rem 0 .25rem; }
.pbar-fill--approved { fill: var(--st-approved-fill); }
/* end Round 4 Monitoring Board (Step 4) */

/* --- Round 4 Reports (Step 5) -- plan §2 ---
   The Reports cards reuse the Board's tint and meter classes; the second row
   has two cards, so .board-cards--2 is one column, then two equal columns from
   480px (no blank cell). The report tables are the widest in the system (nine
   columns per faculty, ten in the returned list with a free-text comment), so
   the modifier on the SECTION (never on a cell) lets every cell wrap, breaks a
   long comment or file name anywhere, trims the side padding and the type size
   below 1440px, and keeps the dates on one line from 1440px up. At 640px and
   below .table--stack turns the cells into blocks. Tokens only; not a print
   block. */
.board-cards--2 { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 480px) {
    .board-cards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.table-card-head .section-title { margin: 0; }
.table-card--report .table th,
.table-card--report .table td { white-space: normal; }
.table-card--report .table td[data-label="Reviewer's comment"] { overflow-wrap: break-word; }
.table-card--report .table td[data-label="File"] { overflow-wrap: anywhere; }
@media (min-width: 641px) and (max-width: 1439px) {
    .table-card--report .table th,
    .table-card--report .table td { padding-left: .5rem; padding-right: .5rem; }
    .table-card--report .table { font-size: .85rem; }
}
@media (min-width: 1440px) {
    .table-card--report .table td[data-label="Deadline"],
    .table-card--report .table td[data-label="Approved on"],
    .table-card--report .table td[data-label="Returned on"],
    .table-card--report .table td[data-label="Last updated"] { white-space: nowrap; }
}
/* Step 5d: the four list tables have eight to ten columns (pending 8, approved 9,
   overdue 9, returned 10), and the card is never wider than about 1160px even at
   1920 (849px at 1200, 1089 at 1440), so they cannot be comfortable as tables:
   columns of 65-118px broke words mid-word ("Revise d", "Mendoz a"). From 641px up
   each row is a compact grid card instead: the header row is visually hidden but
   stays in the tree for assistive technology (clipped 1px box, not display:none),
   each cell shows its own data-label as a small muted caption above the value, the
   long cells (Requirement, the reviewer's comment) take the full row, and the pill
   and its chip never break (a chip may wrap to the next line as a whole). Three
   equal columns, four from 1440px; text breaks only where a word cannot fit
   (overflow-wrap: break-word), never anywhere. Every track is minmax(0, 1fr), so
   a cell cannot widen its card. At 640px and below the existing .table--stack
   takes over unchanged. The 5b fixed-layout shares were retired with this. */
@media (min-width: 641px) {
    .table-card--report .table-wrap { position: relative; }
    .table-card--report .table[data-report-list] { display: block; width: 100%; font-size: .9rem; }
    .table-card--report .table[data-report-list] thead {
        position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
        overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
    }
    .table-card--report .table[data-report-list] tbody { display: block; }
    .table-card--report .table[data-report-list] tr {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: .6rem 1rem;
        padding: .85rem 1rem;
        border-bottom: 1px solid var(--border);
    }
    .table-card--report .table[data-report-list] tbody tr:last-child { border-bottom: none; }
    .table-card--report .table[data-report-list] td {
        display: block; min-width: 0; padding: 0; border: 0;
        white-space: normal; overflow-wrap: break-word;
    }
    .table-card--report .table[data-report-list] td::before {
        content: attr(data-label);
        display: block; margin-bottom: .15rem;
        font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
        color: var(--muted);
    }
    .table-card--report .table[data-report-list] td[data-label="Requirement"],
    .table-card--report .table[data-report-list] td[data-label="Reviewer's comment"] { grid-column: 1 / -1; }
    .table-card--report .table[data-report-list] td[data-label="Reviewer's comment"] { order: 99; }
    .table-card--report .table[data-report-list] .status-pill,
    .table-card--report .table[data-report-list] .chip-overdue { white-space: nowrap; }
    .table-card--report .table[data-report-list] .status-pill { margin: 0 .3rem .15rem 0; }
    .table-card--report .table[data-report-list] .chip-overdue { margin-left: 0; }
}
@media (min-width: 1440px) {
    .table-card--report .table[data-report-list] tr { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Print and the Summary cards: the main print block sizes every .card at 30%
   of its container (written for the old .cards block), which in a grid cell
   shrinks each card to a third of its track. A plain override with higher
   specificity, a no-op on screen (grid items already fill their track), so no
   second print block and no print rule is edited. */
.board-cards--5 > .card, .board-cards--3 > .card, .board-cards--2 > .card { width: auto; margin: 0; }
.board-cards--2 > .card { min-width: 0; }
/* end Round 4 Reports (Step 5) */

/* --- Round 4 Audit Log (Step 6) -- plan §2 ---
   Inside the audit card the role pill is the neutral blue pair (a role is not a
   status, and the shared pill colour turns gold in the dark theme) and the action label is
   the neutral text-on-background pair with a hairline outline (gold is reserved
   for Submitted). Both are scoped to the card; no existing rule is edited.
   Fit (html is 106.25%, so 1rem is 17px): six columns with a Details cell that must
   stay readable need roughly 1085px of content and padding against a card of 1089px
   at a 1440px viewport (browser-measured: the table-wrap scrolls by 0px there), but
   849px at 1200 and 929px at 1280, which no padding trim can fit without a word per
   line. So from 1440px the table keeps its columns (the short ones never wrap,
   Details breaks only a single over-long token and keeps a 16rem minimum, set only
   there: a minimum in the stacked layout would exceed a 320px phone's card), and
   from 641 to 1439px each entry is a compact grid card, the
   Step 5d technique: the header row is visually hidden but kept for assistive
   technology, each cell shows its own data-label above the value, Details takes
   the full row. At 640px and below .table--stack takes over. No font is shrunk. */
.table-card--audit .role-pill { display: block; width: fit-content; margin-top: .2rem; color: var(--blue); background: var(--blue-bg); }
.table-card--audit .action-label { color: var(--text); background: var(--bg); border: 1px solid var(--border); white-space: nowrap; }
.table-card--audit .table td[data-label="Actor"] { white-space: normal; }
.table-card--audit .table td[data-label="Details"] { white-space: normal; overflow-wrap: break-word; }
@media (min-width: 1440px) {
    .table-card--audit .table td[data-label="When"],
    .table-card--audit .table td[data-label="Action"],
    .table-card--audit .table td[data-label="Entity"],
    .table-card--audit .table td[data-label="IP"] { white-space: nowrap; }
    .table-card--audit .table td[data-label="Details"] { min-width: 16rem; }
}
@media (min-width: 641px) and (max-width: 1439px) {
    .table-card--audit .table-wrap { position: relative; }
    .table-card--audit .table { display: block; width: 100%; }
    .table-card--audit .table thead {
        position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
        overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
    }
    .table-card--audit .table tbody { display: block; }
    .table-card--audit .table tr {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: .5rem .75rem;
        padding: .5rem .6rem;
        border-bottom: 1px solid var(--border);
    }
    .table-card--audit .table tbody tr:last-child { border-bottom: none; }
    .table-card--audit .table .role-pill { display: inline-block; margin: 0 0 0 .3rem; }
    .table-card--audit .table td {
        display: block; min-width: 0; padding: 0; border: 0;
        white-space: normal; overflow-wrap: break-word;
    }
    .table-card--audit .table td::before {
        content: attr(data-label);
        display: block; margin-bottom: .15rem;
        font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
        color: var(--muted);
    }
    .table-card--audit .table td[data-label="Details"] { grid-column: 1 / -1; order: 99; min-width: 0; }
    .table-card--audit .table td[colspan] { grid-column: 1 / -1; }
    .table-card--audit .table td[colspan]::before { content: none; }
}
/* Step 6b: denser cards. Arithmetic (Segoe UI measured, rem = 17px): the widest
   action label ("profile_photo_removed") is about 164px with its padding and
   border, and never wraps, so a cell must be at least that wide. A row is the
   viewport minus 385px with the sidebar (900px and up) and minus 85px without it,
   less .6rem of padding each side and the column gaps (.75rem). Four columns give
   (735 - 20 - 38) / 4 = 169px at 1120px, so from 1120px an entry is exactly two
   grid rows: When, Actor, Action and Entity, then IP and Details (across the other
   three columns), about 104px for a short entry. Three columns give 170px at 641px
   and 173px at 950px, but only 156px at 900px, so from 900 to 949px (where the
   sidebar has just appeared) two columns are used. Details always takes its own
   row below 1120px. */
@media (min-width: 900px) and (max-width: 949px) {
    .table-card--audit .table tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1120px) and (max-width: 1439px) {
    .table-card--audit .table tr { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .table-card--audit .table td[data-label="IP"] { grid-column: 1; grid-row: 2; }
    .table-card--audit .table td[data-label="Details"] { grid-column: 2 / -1; grid-row: 2; order: 0; }
}
/* end Round 4 Audit Log (Step 6) */

/* --- Round 4 Archive (Step 7) -- plan §2 ---
   One archive for both roles. The index is four short columns and fits as a plain
   table. The show table is seven columns for the Secretary (six for Faculty) with
   up to three buttons, and the card is never wider than about 1160px. Arithmetic
   (Segoe UI measured, rem = 17px): the narrowest content per column is about
   Faculty 105 + Requirement 119 + Document Type 119 + Deadline 130 + Status 179
   (pill and chip kept on one line) + Last updated 130 + actions 154 = 936px at
   1rem of padding, 852px at .65rem. That fits a card of 929px at a 1280px viewport
   (77px spare) and 1089px at 1440, so from 1280px it is a real table: the short
   cells never wrap, names and titles wrap between words, the buttons wrap inside
   their cell. Below 1280px it cannot (849px at 1200), so from 641 to 1279px each
   row is a compact grid card, the Step 5d/6b technique: the header row hidden but
   kept for assistive technology, each cell showing its own data-label, Requirement
   across the full row, three columns (170px at 641px) and four from 1000px (139px,
   enough for the widest unbroken cell, a pill or a date). At 640px and below
   .table--stack takes over. No minimum width is set anywhere (it overflowed a
   320px phone in Step 6) and no font is shrunk. */
.table-card--archive-rows .table td[data-label="Faculty"],
.table-card--archive-rows .table td[data-label="Requirement"],
.table-card--archive-rows .table td[data-label="Document Type"] { white-space: normal; overflow-wrap: break-word; }
.table-card--archive-rows .table td.table-actions { white-space: normal; }
.table-card--archive-rows .table-actions > * { margin: .15rem .4rem .15rem 0; }
.table-card--archive-rows .table-actions > * + * { margin-left: 0; }
@media (min-width: 1280px) {
    .table-card--archive-rows .table td[data-label="Deadline"],
    .table-card--archive-rows .table td[data-label="Status"],
    .table-card--archive-rows .table td[data-label="Last updated"] { white-space: nowrap; }
}
@media (min-width: 1280px) and (max-width: 1439px) {
    .table-card--archive-rows .table th,
    .table-card--archive-rows .table td { padding-left: .65rem; padding-right: .65rem; }
}
@media (min-width: 641px) and (max-width: 1279px) {
    .table-card--archive-rows .table-wrap { position: relative; }
    .table-card--archive-rows .table { display: block; width: 100%; }
    .table-card--archive-rows .table thead {
        position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
        overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
    }
    .table-card--archive-rows .table tbody { display: block; }
    .table-card--archive-rows .table tr {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: .5rem .75rem;
        padding: .5rem .6rem;
        border-bottom: 1px solid var(--border);
    }
    .table-card--archive-rows .table tbody tr:last-child { border-bottom: none; }
    .table-card--archive-rows .table td {
        display: block; min-width: 0; padding: 0; border: 0;
        white-space: normal; overflow-wrap: break-word;
    }
    .table-card--archive-rows .table td::before {
        content: attr(data-label);
        display: block; margin-bottom: .15rem;
        font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
        color: var(--muted);
    }
    .table-card--archive-rows .table td[data-label="Requirement"] { grid-column: 1 / -1; order: -1; }
    .table-card--archive-rows .table td[data-label="Document"] { grid-column: 1 / -1; }
    .table-card--archive-rows .table td[colspan] { grid-column: 1 / -1; }
    .table-card--archive-rows .table td[colspan]::before { content: none; }
}
@media (min-width: 1000px) and (max-width: 1279px) {
    .table-card--archive-rows .table tr { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .table-card--archive-rows .table td[data-label="Document"] { grid-column: span 3; }
}
/* end Round 4 Archive (Step 7) */

/* --- Round 4 Form modal (Step 8) -- plan §7 ---
   The create-form dialog built by app.js (FR-27, FR-28, FR-29). Tokens only, so
   both themes come for free; the scrim is the --backdrop token.
   DISPLAY TRAP: only .form-modal[open] may set display. A closed dialog is hidden
   by the user agent, and any author display on .form-modal itself would beat that
   and leave an empty dialog on every page. The status line carries the hidden
   attribute for the same reason and so has no display rule either. */
.form-modal {
    width: min(48rem, calc(100vw - 2rem));
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.form-modal[open] { display: flex; flex-direction: column; }
.form-modal::backdrop { background: var(--backdrop); }
.form-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    flex: none;
}
.form-modal-title { margin: 0; font-size: 1.15rem; }
.form-modal-close { flex: none; cursor: pointer; }
.form-modal-status {
    margin: 0;
    padding: .6rem 1.25rem;
    color: var(--text);
    background: var(--info-bg);
    border-bottom: 1px solid var(--border);
}
.form-modal-body.form-card {
    max-width: none;
    width: auto;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 1.25rem;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
    flex: 1 1 auto;
}
html.has-form-modal { overflow: hidden; }
@media (max-width: 640px) {
    .form-modal { width: 100vw; max-width: 100vw; height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
}
/* end Round 4 Form modal (Step 8) */

/* --- Round 4 Academic Periods fit (Step 9b) -- plan §2 ---
   Six columns, the last holding Edit plus Close period / Make active. Browser-measured
   intrinsic width 979px (every cell on one line) against a card of 885px at a 1200px
   viewport and 929px at 1280, so it scrolled sideways below 1440. Three causes, each
   removed: the Actions cell was nowrap (its buttons now wrap inside the cell), the
   Dates cell wrapped to four lines at narrow widths (each end of the range is a
   .date-part that never breaks, so the range is two lines at most), and the cell
   padding is trimmed from 1280 to 1439px. Below 1280px it is the Archive technique:
   from 641 to 1279px each period is a grid card (header row visually hidden but kept
   for assistive technology, each cell showing its own data-label), the Period across
   the full row, then Dates, Requirements, Submissions and Status in four columns
   (114px at 900px, where the sidebar has just appeared; the widest unbroken cell is
   a date or the Archived pill), the Actions across the full row. At 640px and below
   .table--stack takes over. No minimum width is set and no font is shrunk. Tokens
   only; the print caption colour lives in the existing shared print block. */
.table-card--periods .date-part { white-space: nowrap; }
.table-card--periods .table td .muted-note { margin: .2rem 0 0; }
.table-card--periods .table td[data-label="Period"] { white-space: normal; overflow-wrap: break-word; }
.table-card--periods .table td.table-actions { white-space: normal; }
.table-card--periods .table-actions > * { margin: .15rem .4rem .15rem 0; }
.table-card--periods .table-actions > * + * { margin-left: 0; }
/* Effectively a no-op today (.table th, td already nowrap); kept for symmetry with
   Archive so the intent survives if the base rule changes. */
@media (min-width: 1280px) {
    .table-card--periods .table td[data-label="Requirements"],
    .table-card--periods .table td[data-label="Submissions"],
    .table-card--periods .table td[data-label="Status"] { white-space: nowrap; }
}
@media (min-width: 1280px) and (max-width: 1439px) {
    .table-card--periods .table th,
    .table-card--periods .table td { padding-left: .65rem; padding-right: .65rem; }
}
@media (min-width: 641px) and (max-width: 1279px) {
    .table-card--periods .table-wrap { position: relative; }
    .table-card--periods .table { display: block; width: 100%; }
    .table-card--periods .table thead {
        position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
        overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
    }
    .table-card--periods .table tbody { display: block; }
    .table-card--periods .table tr {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: .5rem .75rem;
        padding: .5rem .6rem;
        border-bottom: 1px solid var(--border);
    }
    .table-card--periods .table tbody tr:last-child { border-bottom: none; }
    .table-card--periods .table td {
        display: block; min-width: 0; padding: 0; border: 0;
        white-space: normal; overflow-wrap: break-word;
    }
    .table-card--periods .table td::before {
        content: attr(data-label);
        display: block; margin-bottom: .15rem;
        font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
        color: var(--muted);
    }
    .table-card--periods .table td[data-label="Period"],
    .table-card--periods .table td.table-actions { grid-column: 1 / -1; }
    .table-card--periods .table td[colspan] { grid-column: 1 / -1; }
    .table-card--periods .table td[colspan]::before { content: none; }
}
/* end Round 4 Academic Periods fit (Step 9b) */

/* --- Round 4 Requirements (Step 10) -- plan §2 ---
   Seven columns, the last holding Edit plus Delete or "Has uploads". The Periods and
   Archive technique, scoped to .table-card--requirements. The free-text columns (Title,
   Document Type, Applies to) may wrap and break a long word, and so may the Actions
   cell (its buttons wrap inside it), so none of them forces the table wider than its
   card; the cell padding is trimmed from 1280 to 1439px. Below 1280px each requirement
   is a grid card: from 641 to 1279px the header row is visually hidden but kept for
   assistive technology and each cell shows its own data-label. The Title takes the whole
   first row, then Document Type, Applies to and Deadline in three columns, then Progress,
   Created and Actions. At 640px and below .table--stack takes over with no rule here.
   No minimum width is set and no font is shrunk. Tokens only; the print rules live in
   the existing shared print block. */
.table-card--requirements .table td[data-label="Title"],
.table-card--requirements .table td[data-label="Document Type"],
.table-card--requirements .table td[data-label="Applies to"] { white-space: normal; overflow-wrap: break-word; }
.table-card--requirements .table td.table-actions { white-space: normal; }
.table-card--requirements .table-actions > * { margin: .15rem .4rem .15rem 0; }
.table-card--requirements .table-actions > * + * { margin-left: 0; }
.table-card--requirements .table-actions .muted-note { white-space: nowrap; }
@media (min-width: 1280px) and (max-width: 1439px) {
    .table-card--requirements .table th,
    .table-card--requirements .table td { padding-left: .65rem; padding-right: .65rem; }
}
@media (min-width: 641px) and (max-width: 1279px) {
    .table-card--requirements .table-wrap { position: relative; }
    .table-card--requirements .table { display: block; width: 100%; }
    .table-card--requirements .table thead {
        position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
        overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
    }
    .table-card--requirements .table tbody { display: block; }
    .table-card--requirements .table tr {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: .5rem .75rem;
        padding: .5rem .6rem;
        border-bottom: 1px solid var(--border);
    }
    .table-card--requirements .table tbody tr:last-child { border-bottom: none; }
    .table-card--requirements .table td {
        display: block; min-width: 0; padding: 0; border: 0;
        white-space: normal; overflow-wrap: break-word;
    }
    .table-card--requirements .table td::before {
        content: attr(data-label);
        display: block; margin-bottom: .15rem;
        font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
        color: var(--muted);
    }
    .table-card--requirements .table td[data-label="Title"] { grid-column: 1 / -1; }
    .table-card--requirements .table td[colspan] { grid-column: 1 / -1; }
    .table-card--requirements .table td[colspan]::before { content: none; }
}
/* end Round 4 Requirements (Step 10) */

/* --- Round 4 Users (Step 11) -- plan §2 ---
   Six columns, the last holding Edit plus Deactivate, Activate or the self-row sentence.
   The Periods and Requirements technique, scoped to .table-card--users. Name, Role and
   Email may wrap, Email at any character because an address has no spaces to break at, and
   so may the Actions cell, so none of them forces the table wider than its card; the cell
   padding is trimmed from 1280 to 1439px. From 641 to 1279px each account is a grid card:
   the header row is visually hidden but kept for assistive technology and each cell shows
   its own data-label. Name takes the whole first row, Email two columns beside Role, then
   Program, Status and Actions. At 640px and below .table--stack takes over with no rule
   here. Both roles share the one blue pill (the base .role-pill is green, which reads as
   Approved). No minimum width is set and no font is shrunk. Tokens only; the print rules
   live in the existing shared print block. */
.table-card--users .role-pill { color: var(--blue); background: var(--blue-bg); }
.table-card--users .table td[data-label="Role"] .muted-note { display: block; margin: .2rem 0 0; }
.table-card--users .table td[data-label="Name"],
.table-card--users .table td[data-label="Role"] { white-space: normal; overflow-wrap: break-word; }
.table-card--users .table td[data-label="Email"] { white-space: normal; overflow-wrap: anywhere; }
.table-card--users .table td.table-actions { white-space: normal; }
.table-card--users .table-actions > * { margin: .15rem .4rem .15rem 0; }
.table-card--users .table-actions > * + * { margin-left: 0; }
@media (min-width: 1280px) and (max-width: 1439px) {
    .table-card--users .table th,
    .table-card--users .table td { padding-left: .65rem; padding-right: .65rem; }
}
@media (min-width: 641px) and (max-width: 1279px) {
    .table-card--users .table-wrap { position: relative; }
    .table-card--users .table { display: block; width: 100%; }
    .table-card--users .table thead {
        position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
        overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
    }
    .table-card--users .table tbody { display: block; }
    .table-card--users .table tr {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: .5rem .75rem;
        padding: .5rem .6rem;
        border-bottom: 1px solid var(--border);
    }
    .table-card--users .table tbody tr:last-child { border-bottom: none; }
    .table-card--users .table td {
        display: block; min-width: 0; padding: 0; border: 0;
        white-space: normal; overflow-wrap: break-word;
    }
    .table-card--users .table td::before {
        content: attr(data-label);
        display: block; margin-bottom: .15rem;
        font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
        color: var(--muted);
    }
    .table-card--users .table td[data-label="Name"] { grid-column: 1 / -1; }
    .table-card--users .table td[data-label="Email"] { grid-column: span 2; }
    .table-card--users .table td[colspan] { grid-column: 1 / -1; }
    .table-card--users .table td[colspan]::before { content: none; }
}
/* end Round 4 Users (Step 11) */

/* --- Round 4 Faculty Compliance (Step 12) -- plan §2 ---
   Two screens, one region: Faculty Compliance (.table-card--compliance, eight columns) and
   the per-faculty card (.table-card--standing, five columns plus a paired note row). The
   figure cards KEEP the .measure markup (suite_monitoring_reports reads the figures through
   .measure-value / .measure-detail, and the card's print contract is written against
   .measure), so the board's look -- tinted left border, icon chip, blue and green meters --
   comes from here, scoped to .compliance-figures. Progress is --blue, not the base rule's
   yellow, which is the Submitted colour and nothing else. The base .meter rect.meter-fill--progress is NOT edited
   (suite_status_colours pins it and admin/requirements/show.php uses it); the override below
   is (0,3,1) against the base (0,2,1). .compliance-figures--2 is the two-card modifier and
   no rule sets grid-template-columns on .compliance-figures itself, because the card's
   three-card grid (.board-cards--3, earlier in the file) owns that.
   The Faculty and Requirement cells may wrap, and so may the card's Action cell, so neither
   table is forced wider than its panel; the cell padding is trimmed from 1280 to 1439px.
   Faculty and Requirement break at ANY character (overflow-wrap: anywhere, as Users' Email):
   break-word does not shrink a cell's minimum width, and a 120-character name or a 60-character
   unbroken word measured 2489px and 1048px of scroll in a 929px panel at 1280px.
   From 641 to 1279px each row is a grid card: the header row is visually hidden but kept for
   assistive technology and each cell shows its data-label. THESE TWO BLOCKS ARE
   `screen and`, unlike Periods, Requirements and Users: a printed page is about 720-770px
   wide, inside 641-1279, and these two screens print as TABLES (the card is the signed
   statement accreditation asks for). At 640px and below .table--stack takes over, and that
   never matches a print page. No minimum width is set and no font is shrunk. Tokens only; the
   print rules live in the existing shared print block. */
.compliance-figures > .measure { min-width: 0; }
.compliance-figures--2 { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 480px) { .compliance-figures--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.compliance-figures .measure--progress   { border-left: 4px solid var(--blue);              --card-tint: var(--blue-bg);         --card-ink: var(--blue); }
.compliance-figures .measure--compliance { border-left: 4px solid var(--st-approved-fill);  --card-tint: var(--st-approved-bg);  --card-ink: var(--st-approved); }
.compliance-figures .measure--overdue    { border-left: 4px solid var(--st-overdue-fill);   --card-tint: var(--st-overdue-bg);   --card-ink: var(--st-overdue); }
.compliance-figures .meter { background: var(--blue-bg); }
.compliance-figures .meter rect.meter-fill--progress { fill: var(--blue); }

.table-card--compliance .table td[data-label="Faculty"] { white-space: normal; overflow-wrap: anywhere; }
@media (min-width: 1280px) and (max-width: 1439px) {
    .table-card--compliance .table th,
    .table-card--compliance .table td { padding-left: .65rem; padding-right: .65rem; }
}
@media screen and (min-width: 641px) and (max-width: 1279px) {
    .table-card--compliance .table-wrap { position: relative; }
    .table-card--compliance .table { display: block; width: 100%; }
    .table-card--compliance .table thead {
        position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
        overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
    }
    .table-card--compliance .table tbody { display: block; }
    .table-card--compliance .table tr {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: .5rem .75rem;
        padding: .5rem .6rem;
        border-bottom: 1px solid var(--border);
    }
    .table-card--compliance .table tbody tr:last-child { border-bottom: none; }
    .table-card--compliance .table td {
        display: block; min-width: 0; padding: 0; border: 0;
        white-space: normal; overflow-wrap: break-word;
    }
    .table-card--compliance .table td::before {
        content: attr(data-label);
        display: block; margin-bottom: .15rem;
        font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
        color: var(--muted);
    }
    .table-card--compliance .table td[data-label="Faculty"] { grid-column: 1 / -1; }
    .table-card--compliance .table td[colspan] { grid-column: 1 / -1; }
    .table-card--compliance .table td[colspan]::before { content: none; }
}

.table-card--standing .table td[data-label="Requirement"] { white-space: normal; overflow-wrap: anywhere; }
.table-card--standing .table td.table-actions { white-space: normal; }
@media (min-width: 1280px) and (max-width: 1439px) {
    .table-card--standing .table th,
    .table-card--standing .table td { padding-left: .65rem; padding-right: .65rem; }
}
@media screen and (min-width: 641px) and (max-width: 1279px) {
    .table-card--standing .table-wrap { position: relative; }
    .table-card--standing .table { display: block; width: 100%; }
    .table-card--standing .table thead {
        position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
        overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
    }
    .table-card--standing .table tbody { display: block; }
    .table-card--standing .table tr {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: .5rem .75rem;
        padding: .5rem .6rem;
        border-bottom: 1px solid var(--border);
    }
    .table-card--standing .table tbody tr:last-child { border-bottom: none; }
    .table-card--standing .table td {
        display: block; min-width: 0; padding: 0; border: 0;
        white-space: normal; overflow-wrap: break-word;
    }
    .table-card--standing .table td::before {
        content: attr(data-label);
        display: block; margin-bottom: .15rem;
        font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
        color: var(--muted);
    }
    .table-card--standing .table td[data-label="Requirement"] { grid-column: 1 / -1; }
    .table-card--standing .table td.table-actions { grid-column: 1 / -1; }
    .table-card--standing .table td[colspan] { grid-column: 1 / -1; }
    .table-card--standing .table td[colspan]::before { content: none; }
    /* the note stays joined to its requirement, as .table--stack does on a phone */
    .table-card--standing .table tr.has-note { border-bottom: none; padding-bottom: 0; }
    .table-card--standing .table .checklist-note-row { padding-top: 0; }
}
/* end Round 4 Faculty Compliance (Step 12) */

/* --- Round 4 Detail screens (Step 13) -- plan §2 ---
   Requirement detail (.table-card--audience), Submission detail (.table-card--versions and
   .table-card--released) and the review decision. The requirement page reuses Step 12's
   .compliance-figures, which already turns the Progress meter blue; only the third card's
   gray tint is new. The FROZEN blocks (decision form, release form, revision-note list,
   upload comments, preview frame) have no rule here: nothing in this region touches them.
   Faculty, File and Message cells break at ANY character (break-word does not lower a
   cell's minimum width, as Step 12 measured). From 641 to 1279px each row is a grid card;
   THESE THREE BLOCKS ARE `screen and`, because a printed page is about 720-770px wide,
   inside 641-1279, and these tables print as tables. At 640px and below .table--stack
   takes over. No minimum width is set and no font is shrunk. Tokens only; the print rules
   live in the existing shared print block. */
.detail-heading { display: flex; align-items: center; gap: .5rem; }
.detail-heading-icon {
    width: 1.15rem; height: 1.15rem; flex: none;
    fill: none; stroke: var(--blue); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.decision-form-wrap > .detail-heading { margin: 0 0 1rem; font-size: 1.05rem; }

.compliance-figures .measure--pending { border-left: 4px solid var(--st-pending-fill); --card-tint: var(--st-pending-bg); --card-ink: var(--st-pending); }

.table-card--audience .table td[data-label="Faculty"],
.table-card--versions .table td[data-label="File"],
.table-card--released .table td[data-label="File"],
.table-card--released .table td[data-label="Message"] { white-space: normal; overflow-wrap: anywhere; }
.table-card--audience .table td.table-actions,
.table-card--versions .table td.table-actions { white-space: normal; }
@media (min-width: 1280px) and (max-width: 1439px) {
    .table-card--audience .table th, .table-card--audience .table td,
    .table-card--versions .table th, .table-card--versions .table td { padding-left: .65rem; padding-right: .65rem; }
}

@media screen and (min-width: 641px) and (max-width: 1279px) {
    .table-card--audience .table-wrap { position: relative; }
    .table-card--audience .table { display: block; width: 100%; }
    .table-card--audience .table thead {
        position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
        overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
    }
    .table-card--audience .table tbody { display: block; }
    .table-card--audience .table tr {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: .5rem .75rem;
        padding: .5rem .6rem;
        border-bottom: 1px solid var(--border);
    }
    .table-card--audience .table tbody tr:last-child { border-bottom: none; }
    .table-card--audience .table td {
        display: block; min-width: 0; padding: 0; border: 0;
        white-space: normal; overflow-wrap: break-word;
    }
    .table-card--audience .table td::before {
        content: attr(data-label);
        display: block; margin-bottom: .15rem;
        font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
        color: var(--muted);
    }
    .table-card--audience .table td[data-label="Faculty"],
    .table-card--audience .table td.table-actions,
    .table-card--audience .table td[colspan] { grid-column: 1 / -1; }
    .table-card--audience .table td[colspan]::before { content: none; }
    .table-card--audience .table tr.has-note { border-bottom: none; padding-bottom: 0; }
    .table-card--audience .table .checklist-note-row { padding-top: 0; }
}
@media screen and (min-width: 641px) and (max-width: 1279px) {
    .table-card--versions .table-wrap { position: relative; }
    .table-card--versions .table { display: block; width: 100%; }
    .table-card--versions .table thead {
        position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
        overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
    }
    .table-card--versions .table tbody { display: block; }
    .table-card--versions .table tr {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: .5rem .75rem;
        padding: .5rem .6rem;
        border-bottom: 1px solid var(--border);
    }
    .table-card--versions .table tbody tr:last-child { border-bottom: none; }
    .table-card--versions .table td {
        display: block; min-width: 0; padding: 0; border: 0;
        white-space: normal; overflow-wrap: break-word;
    }
    .table-card--versions .table td::before {
        content: attr(data-label);
        display: block; margin-bottom: .15rem;
        font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
        color: var(--muted);
    }
    .table-card--versions .table td[data-label="File"],
    .table-card--versions .table td.table-actions { grid-column: 1 / -1; }
}
@media screen and (min-width: 641px) and (max-width: 1279px) {
    .table-card--released .table-wrap { position: relative; }
    .table-card--released .table { display: block; width: 100%; }
    .table-card--released .table thead {
        position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
        overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
    }
    .table-card--released .table tbody { display: block; }
    .table-card--released .table tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .5rem .75rem;
        padding: .5rem .6rem;
        border-bottom: 1px solid var(--border);
    }
    .table-card--released .table tbody tr:last-child { border-bottom: none; }
    .table-card--released .table td {
        display: block; min-width: 0; padding: 0; border: 0;
        white-space: normal; overflow-wrap: break-word;
    }
    .table-card--released .table td::before {
        content: attr(data-label);
        display: block; margin-bottom: .15rem;
        font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
        color: var(--muted);
    }
    .table-card--released .table td[data-label="File"],
    .table-card--released .table td[data-label="Message"],
    .table-card--released .table td.table-actions { grid-column: 1 / -1; }
}
/* The review page's Batch F document set (ruling 2026-10-30). The existing .doc-set* rules are NOT
   edited; these scoped overrides sit beside them. A 120-character subject label made the `auto`
   first track as wide as the label and a 100-character unbroken file name could not break, so the
   PAGE scrolled from a phone to about 1000px (BASE already did at 600px). The first track is
   capped, and subject and name may shrink and break at any character. The three-track grid is
   limited to `screen` from 641px so the existing phone rule (one column) and the printed page
   (which hides the actions) are untouched. */
@media screen and (min-width: 641px) {
    .review-meta .doc-set-item { grid-template-columns: fit-content(12rem) minmax(0, 1fr) auto; }
}
.review-meta .doc-set-subject,
.review-meta .doc-set-name { display: block; min-width: 0; overflow-wrap: anywhere; }
/* The "Showing <subject> -- <file name>." line under the preview frame repeats the same unbroken name. */
.review-meta .muted-note { overflow-wrap: anywhere; }
/* end Round 4 Detail screens (Step 13) */

/* --- Wide add/edit forms (FR-26..FR-29, FR-35; 2026-12-03) ---------------------------------
   Every System Configuration add/edit form (Users, Requirements, Document types, Periods) was a
   480px column in a 1920px page, so a form of seven fields scrolled twice over its own height.
   The forms are now a two-column grid on a wide card and the old single column on a narrow one.

   NO MARKUP CHANGED. Five suites pin these forms byte for byte, so the hook is the shape that
   only an add/edit card has: a .form-card holding a <form> whose direct child is .form-actions
   (the viewer's card and the profile cards never match). The card is a size CONTAINER, and every
   rule below is an @container query on the CARD'S width, not a viewport breakpoint: from 768px
   the card sits beside a 256px sidebar, so the page width is not the card width (the Review
   Queue lesson, 2026-11-29). 36rem of interior is the two-column floor (two fields of 15rem and
   a 1.5rem gutter); 48rem is where the audience control splits into two panes. In the create
   modal the same container query applies, so the dialog gets two columns too.

   Reading order is DOM order: nothing here uses `order` or a negative tabindex, so row by row is
   the tab order (the check walks it). `.is-hidden` and `.is-not-applicable` are display: none
   and take no cell, so a hidden field never leaves a hole. */
.wrap:has(.form-card form > .form-actions):not(:has([data-doc-body])) { max-width: 1040px; padding-block: 1.25rem .5rem; }
main:has(.form-card form > .form-actions) + .foot { margin-top: 1rem; }
.form-card:has(form > .form-actions) { container: form-card / inline-size; }
.form-card:has(form > .form-actions):not(.form-modal-body) {
    max-width: 1040px;
    margin-top: 0;
    padding: 1.25rem 1.5rem;
}
/* The pill and the title share a line: a stacked pill + h1 cost ~110px of a 720px screen. */
.form-card:has(form > .form-actions) > .page-pill,
.form-card:has(form > .form-actions) > h1 { display: inline-block; vertical-align: middle; }
.form-card:has(form > .form-actions) > .page-pill { margin: 0 .85rem .75rem 0; }
.form-card:has(form > .form-actions) > h1 { margin: 0 0 .75rem; }

@container form-card (min-width: 36rem) {
    .form-card form {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 1.5rem;
        align-items: start;
    }
    .form-card form > .field { margin-bottom: .75rem; min-width: 0; }
    /* Whole-row blocks: the audience fieldset, the per-subject switch, the Periods activation
       note (a label with no control), the Periods display label (it carries a long hint) and
       the actions. */
    .form-card form > fieldset,
    .form-card form > .field:has(> label:not([for])),
    .form-card form > .field:has(> #label),
    .form-card form > .form-actions { grid-column: 1 / -1; }
    .form-card .field-help { font-size: .8rem; }
    .form-card form > .form-actions {
        margin-top: .1rem;
        padding-top: .85rem;
        border-top: 1px solid var(--border);
    }
    /* The role warning sits inside its field; keep it from stretching the row's other cell. */
    .form-card .field > .alert { margin: .6rem 0 0; }
}

/* Audience control (Requirements): label | explanation rows instead of a stacked list, and the
   faculty picker as tools beside the list. Only from 48rem of card, and the picker pane only
   under .js (the tools do not exist without it). The panels carry :not(.is-hidden) because a
   plain `display` here would beat `.audience-panel.is-hidden { display: none }`, the same trap
   as [hidden] on .live-search (fifth time). */
@container form-card (min-width: 48rem) {
    .form-card .audience-field {
        display: grid;
        grid-template-columns: minmax(9rem, max-content) minmax(0, 1fr);
        column-gap: 1.5rem;
        align-items: baseline;
    }
    .form-card .audience-field .radio-label { margin: .45rem 0 0; }
    .form-card .audience-field > .field-help { margin: .45rem 0 0; }
    .form-card .audience-field > .audience-panel:not(.is-hidden),
    .form-card .audience-field > .field-err { grid-column: 1 / -1; }
    .form-card .audience-panel[data-audience-panel="program"] > select { max-width: 24rem; }
    .js .form-card .audience-panel[data-audience-panel="individual"]:not(.is-hidden) {
        display: grid;
        grid-template-columns: minmax(14rem, 17rem) minmax(0, 1fr);
        column-gap: 1rem;
        align-items: start;
    }
    .js .form-card .audience-panel[data-audience-panel="individual"] > .field-label,
    .js .form-card .audience-panel[data-audience-panel="individual"] > .field-err { grid-column: 1 / -1; }
    .js .form-card .audience-panel[data-audience-panel="individual"] > .picker-tools { grid-column: 1; margin: 0; }
    .js .form-card .audience-panel[data-audience-panel="individual"] > .checkbox-list { grid-column: 2; margin: 0; max-height: 14rem; }
}
/* end Wide add/edit forms */
