/*
 * AIS: the one shell for every role, and the components of pages rebuilt on it.
 *
 * Direction "Office Stamps": a white record, the official deep green for the
 * chrome, decisions shown as stamps. Roboto Slab speaks for headings, stamps
 * and times; Source Sans 3 carries everything read. Gold is reserved for the
 * current navigation item and the focus ring.
 *
 * Mobile first. The rail appears at 1024px; below it, a top bar and a bottom
 * tab bar. Pages on the older shells still load app.css and never this file.
 */

@font-face { font-family: "Source Sans 3"; font-weight: 400; font-style: normal; font-display: swap; src: url("../google-fonts/fonts/ais/source-sans-3-latin-400.bab398e040a4.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 600; font-style: normal; font-display: swap; src: url("../google-fonts/fonts/ais/source-sans-3-latin-600.8befd6f435e5.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 700; font-style: normal; font-display: swap; src: url("../google-fonts/fonts/ais/source-sans-3-latin-700.63a951688119.woff2") format("woff2"); }
@font-face { font-family: "Roboto Slab"; font-weight: 600; font-style: normal; font-display: swap; src: url("../google-fonts/fonts/ais/roboto-slab-latin-600.a176082902ae.woff2") format("woff2"); }
@font-face { font-family: "Roboto Slab"; font-weight: 700; font-style: normal; font-display: swap; src: url("../google-fonts/fonts/ais/roboto-slab-latin-700.0fcb41f7117e.woff2") format("woff2"); }

:root {
    /* Official greens (the same values as app.css --brand-*). */
    --green-900: #003D33;
    --green-800: #00574B;
    --green-700: #00695C;
    --green-600: #00897B;
    --green-tint: #E6F2F0;
    --on-green: #FFFFFF;
    --on-green-2: #BFE0DA;
    --gold: #FFD54F;

    --ink: #263238;
    --ink-2: #546E7A;
    --line: #E3E7E8;
    --ground: #FFFFFF;
    --ground-2: #F5F7F6;

    /* Stamp and notice tones. Each ink clears 4.5:1 on white and on its tint. */
    --clear: #00695C;
    --clear-tint: #E6F2F0;
    --hold: #C62828;
    --hold-deep: #A51F1F;
    --hold-tint: #FDECEC;
    --disc: #FFFFFF; /* the white disc behind the roundel on green */
    --pending: #546E7A;
    --pending-tint: #EEF2F3;
    --warn: #8A4B00;
    --warn-tint: #FFF4DC;

    /* Solid fills under white text. They start as the inks above and part from
       them in dark mode, where an ink is light and a fill stays deep: text and
       rules use --green-*, --hold and so on; anything white is written on uses
       these. --chrome is the rail and the phone's top bar. */
    --chrome: #00574B;
    --chrome-deep: #003D33;
    --fill: #00574B;
    --fill-deep: #003D33;
    --switch-on: #00695C;
    --clear-fill: #00695C;
    --hold-fill: #C62828;
    --pending-fill: #546E7A;
    --warn-fill: #8A4B00;
    --on-gold: #003D33;
    --field-line: #B0BEC5;
    --wash-edge: #C9E2DD;

    --font-read: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mark: "Roboto Slab", Georgia, serif;

    --radius: 12px;
    --rail: 256px;
    --topbar: 56px;
    --tabbar: 64px;
    --headbar: 0px;  /* the desktop bars; they get a height where they show */
    --footbar: 0px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/*
 * Dark mode (DESIGN.md, "Dark mode"). The reader switches it on
 * (<html data-theme="dark">, set before first paint in core/shell/base.html);
 * it is never automatic. Screen only, so paper always prints the light record.
 * A page needs nothing for it as long as it uses the tokens.
 */
:root { color-scheme: light; }
@media screen {
    :root[data-theme="dark"] {
        color-scheme: dark;

        --green-900: #D5EEE9;
        --green-800: #93D6CA;
        --green-700: #74CDBE;
        --green-600: #4DB6AC;
        --green-tint: #16332E;
        --head-wash: #16332E;
        --wash-edge: #2B4F48;

        --ink: #E4ECEA;
        --ink-2: #A5B6B3;
        --line: #2B3735;
        --ground: #18211F;
        --ground-2: #202B29;
        --desk: #101716;
        --panel-line: #2F3D3A;
        --field-line: #667A7F;

        --clear: #7FD6C6;
        --clear-tint: #123530;
        --hold: #FF9C95;
        --hold-tint: #3B2020;
        --pending: #A6B7BE;
        --pending-tint: #232E31;
        --warn: #F2C572;
        --warn-tint: #35290F;

        --chrome: #0E2A26;
        --chrome-deep: #1B4A42;
        --fill: #00796B;
        --fill-deep: #00695C;
        --switch-on: #00897B;
        --clear-fill: #00796B;

        /* Own steps, validated on the dark panel (2026-11-24). */
        --chart-muted: #5B6B70;
        --cat-1: #0E9A8B;
        --cat-2: #3987E5;
        --cat-3: #D95926;
        --cat-4: #8577E6;
    }
    /* Logos drawn for white paper keep a white plate. */
    [data-theme="dark"] .sys-strip { padding: 8px 12px; border-radius: 10px; background: #fff; }
    [data-theme="dark"] .ais-split-part:is(.is-cat-1, .is-cat-2, .is-cat-3, .is-cat-4) { color: #101716; }
}

/* ---- Base ------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--ink-2) var(--ground-2); }
body.ais {
    margin: 0;
    min-height: 100dvh;
    background: var(--ground);
    color: var(--ink);
    font: 400 16px/1.5 var(--font-read);
    caret-color: var(--green-700);
    -webkit-font-smoothing: antialiased;
}
body.ais.is-locked { overflow: hidden; }
.ais h1, .ais h2, .ais h3 { font-family: var(--font-mark); font-weight: 700; line-height: 1.2; margin: 0; text-wrap: balance; }
.ais p { margin: 0; }
.ais ul, .ais ol { list-style: none; margin: 0; padding: 0; }
.ais a { color: var(--green-700); text-underline-offset: 3px; }
.ais ::selection { background: var(--gold); color: var(--on-gold); }
/* Focus: deep green on the white record (8:1), gold on the green chrome (7:1).
   Gold on white would be 1.4:1, under the 3:1 a focus indicator needs. */
.ais :focus-visible { outline: 3px solid var(--green-800); outline-offset: 2px; }
.ais-rail :focus-visible, .ais-topbar :focus-visible, .home-head :focus-visible { outline-color: var(--gold); }
[x-cloak] { display: none !important; }
.nowrap { white-space: nowrap; }

.ais-skip {
    position: absolute; left: 12px; top: -48px; z-index: 100;
    background: var(--gold); color: var(--on-gold); padding: 10px 14px; border-radius: 8px;
    font-weight: 700; text-decoration: none;
}
.ais-skip:focus { top: calc(12px + var(--safe-top)); }

/* ---- Rail (desktop) ---------------------------------------------------- */

.ais-rail { display: none; }

/* ---- Top bar (phone, tablet) ------------------------------------------- */

.ais-topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 12px;
    height: calc(var(--topbar) + var(--safe-top));
    padding: var(--safe-top) 12px 0;
    background: var(--chrome);
    color: var(--on-green);
}
.ais-topbar-home { display: grid; place-items: center; width: 44px; height: 44px; margin-left: -4px; border-radius: 50%; }
.ais-topbar-home img { width: 34px; height: 34px; border-radius: 50%; background: var(--disc); box-shadow: 0 0 0 2px rgba(255,255,255,0.25); }
.ais-topbar-title { flex: 1; min-width: 0; font: 700 17px/1.2 var(--font-mark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ais-topbar-account {
    display: grid; place-items: center; width: 44px; height: 44px;
    border: 0; border-radius: 50%; background: transparent; color: var(--on-green); font-size: 24px; cursor: pointer;
}
.ais-topbar-account:hover { background: rgba(255,255,255,0.1); }
.ais.is-bare .ais-topbar-account { font-size: 19px; }

/* ---- Main -------------------------------------------------------------- */

.ais-main {
    display: block;
    padding: 16px 16px calc(var(--tabbar) + var(--safe-bottom) + 24px);
    outline: none;
}

.ais-notices { display: grid; gap: 8px; margin-bottom: 16px; }
.ais-notice {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
    padding: 12px 14px; border-radius: 10px;
    background: var(--pending-tint); color: var(--ink); font-size: 15px;
}
.ais-notice.is-success { background: var(--clear-tint); color: var(--clear); }
.ais-notice.is-error { background: var(--hold-tint); color: var(--hold); }
.ais-notice.is-warning { background: var(--warn-tint); color: var(--warn); }
.ais-notice a { font-weight: 700; color: inherit; }

/* ---- Tab bar (phone, tablet) ------------------------------------------- */

.ais-tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: flex;
    height: calc(var(--tabbar) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: var(--ground);
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 16px rgba(38, 50, 56, 0.06);
}
.ais-tab {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    border: 0; background: none; cursor: pointer;
    color: var(--ink-2); text-decoration: none;
    font: 600 12px/1 var(--font-read);
}
.ais .ais-tab { color: var(--ink-2); }
.ais-tab i {
    display: grid; place-items: center;
    width: 44px; height: 28px; border-radius: 14px;
    font-size: 17px;
    transition: background-color 200ms var(--ease-out);
}
.ais-tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.ais .ais-tab[aria-current="page"], .ais .ais-tab.is-current { color: var(--green-800); font-weight: 700; }
.ais-tab[aria-current="page"] i, .ais-tab.is-current i { background: var(--gold); color: var(--on-gold); }

/* ---- Sheets and dialog ------------------------------------------------- */

.ais-scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0, 31, 26, 0.45); }
.ais-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
    max-height: 80dvh; overflow-y: auto;
    padding: 8px 8px calc(16px + var(--safe-bottom));
    background: var(--ground);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 32px rgba(0, 31, 26, 0.18);
}
.ais-sheet::before { content: ""; display: block; width: 40px; height: 4px; margin: 4px auto 12px; border-radius: 2px; background: var(--line); }
.ais-sheet h2 { font-size: 17px; padding: 0 12px 8px; }
.ais-sheet.is-anim { transition: transform 320ms var(--ease-out), opacity 200ms ease; }
.ais-sheet.is-off { transform: translateY(100%); opacity: 0.6; }
.ais-sheet-list a, .ais-sheet-list button {
    display: flex; align-items: center; gap: 14px; width: 100%;
    min-height: 52px; padding: 0 12px;
    border: 0; border-radius: 10px; background: none; cursor: pointer;
    color: var(--ink); text-decoration: none; text-align: left;
    font: 600 16px/1.2 var(--font-read);
}
.ais-sheet-list i { width: 22px; text-align: center; color: var(--green-700); font-size: 17px; }
.ais-sheet-list a:hover, .ais-sheet-list button:hover { background: var(--ground-2); }
.ais-sheet-list a[aria-current="page"] { background: var(--green-tint); color: var(--green-800); }
.ais-sheet-list .is-danger, .ais-sheet-list .is-danger i { color: var(--hold); }

/* Nav groups and waiting counts (back office, admin). A group is a quiet
   heading over a run of items; a count is work waiting, styled like the
   bell's: gold on the green rail, amber on white. */
.ais-nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ais-nav-badge, .ais-tab-badge {
    min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
    background: var(--warn-tint); color: var(--warn);
    font: 700 12px/20px var(--font-read); text-align: center; font-variant-numeric: tabular-nums;
}
.ais-sheet-list .ais-nav-group {
    padding: 14px 12px 4px; color: var(--ink-2);
    font: 700 12px/1 var(--font-read); letter-spacing: 0.06em; text-transform: uppercase;
}
.ais-tab { position: relative; }
.ais-tab .ais-tab-badge {
    position: absolute; top: 4px; left: calc(50% + 8px);
    max-width: none; min-width: 18px; height: 18px; padding: 0 5px; line-height: 18px; font-size: 11px;
}

.ais-dialog {
    width: min(400px, calc(100vw - 32px));
    padding: 24px; border: 0; border-radius: var(--radius);
    color: var(--ink); background: var(--ground);
    box-shadow: 0 24px 48px rgba(0, 31, 26, 0.24);
}
.ais-dialog::backdrop { background: rgba(0, 31, 26, 0.45); }
.ais-dialog h2 { font-size: 20px; }
.ais-dialog p { margin-top: 8px; color: var(--ink-2); }
.ais-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 24px; }

/* ---- Bell and notification panel -------------------------------------- */

.ais-bell {
    position: relative; flex: none;
    display: grid; place-items: center; width: 44px; height: 44px;
    border: 0; border-radius: 50%; background: transparent; cursor: pointer;
    color: var(--on-green); font-size: 19px;
}
.ais-bell:hover { background: rgba(255,255,255,0.1); }
.ais-bell-count {
    position: absolute; top: 4px; right: 2px;
    min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 9px; background: var(--gold); color: var(--on-gold);
    font: 700 11px/18px var(--font-read); text-align: center;
    font-variant-numeric: tabular-nums;
}
.ais-notif-head { display: flex; align-items: center; gap: 8px; padding: 0 4px 8px 12px; }
.ais-notif-head h2 { flex: 1; padding: 0; }
.ais-sheet .ais-notif-head h2 { padding: 0; }
.ais-link-btn { min-height: 44px; padding: 0 8px; border: 0; background: none; cursor: pointer; color: var(--green-700); font: 700 14px/1 var(--font-read); }
.ais-icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; cursor: pointer; color: var(--ink-2); font-size: 18px; }
.ais-icon-btn:hover { background: var(--ground-2); }
.ais-push { display: flex; gap: 12px; margin: 4px 4px 12px; padding: 12px; border-radius: 10px; background: var(--green-tint); }
.ais-push i { color: var(--green-700); font-size: 20px; margin-top: 2px; }
.ais-push p { font-size: 15px; }
.ais-push .ais-btn { margin-top: 10px; min-height: 40px; }
.ais-notif-empty { padding: 16px 12px; color: var(--ink-2); }
.ais-notif-list a {
    display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 12px; align-items: start;
    padding: 12px; border-radius: 10px; color: var(--ink); text-decoration: none;
}
.ais-notif-list a:hover { background: var(--ground-2); }
.ais-notif-dot { width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: transparent; }
.ais-notif-list a.is-unread .ais-notif-dot { background: var(--green-600); }
.ais-notif-list strong { display: block; font-weight: 600; line-height: 1.3; }
.ais-notif-list a.is-unread strong { font-weight: 700; }
.ais-notif-list span span { display: block; color: var(--ink-2); font-size: 14px; }
.ais-notif-list small { display: block; margin-top: 2px; color: var(--ink-2); font-size: 12px; }

/* ---- Buttons ----------------------------------------------------------- */

.ais-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 18px;
    border: 0; border-radius: 10px; cursor: pointer;
    background: var(--fill); color: var(--on-green);
    font: 700 15px/1 var(--font-read); text-decoration: none;
    transition: background-color 160ms ease, transform 160ms var(--ease-out);
}
.ais a.ais-btn { color: var(--on-green); }
.ais-btn:hover { background: var(--fill-deep); }
.ais-btn:active { transform: translateY(1px); }
.ais-btn:disabled, .ais-link-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.ais-btn.is-danger { background: var(--hold-fill); }
.ais-btn.is-danger:hover { background: var(--hold-deep); }
.ais-btn.is-quiet { background: var(--ground-2); color: var(--ink); }
.ais-btn.is-quiet:hover { background: var(--line); }
.ais a.ais-btn.is-quiet { color: var(--ink); }
.ais-btn i { font-size: 13px; }

/* ---- Stamps ------------------------------------------------------------ */

.stamp {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 72px; padding: 4px 8px;
    border: 2px solid currentColor; border-radius: 6px;
    font: 700 11px/1.1 var(--font-mark); letter-spacing: 0.08em; text-transform: uppercase;
    white-space: nowrap;
    transform: rotate(-3deg);
}
.stamp.is-clear { color: var(--clear); background: var(--clear-tint); }
.stamp.is-hold { color: var(--hold); background: var(--hold-tint); }
.stamp.is-pending { color: var(--pending); border-style: dashed; transform: none; }
.stamp.is-neutral { color: var(--pending); border-color: var(--line); transform: none; }

.stamp.is-ring {
    flex: none;
    width: 68px; height: 68px; min-width: 0; padding: 0;
    border: 4px double currentColor; border-radius: 50%;
    background: var(--ground);
    font-size: 12px;
    transform: rotate(-12deg);
}
.stamp.is-ring.is-pending { border-style: double; color: var(--green-800); background: var(--ground); }
.stamp.is-ring.is-clear { background: var(--ground); }

/* The one authored moment: the next-step stamp presses onto the record. */
@media (prefers-reduced-motion: no-preference) {
    .ais-next .stamp.is-ring { animation: stamp-press 520ms var(--ease-out) 120ms both; }
    @keyframes stamp-press {
        from { transform: rotate(-4deg) scale(1.35); opacity: 0.25; }
        to   { transform: rotate(-12deg) scale(1); opacity: 1; }
    }
}

/* ---- Next step --------------------------------------------------------- */

.ais-next {
    display: flex; align-items: flex-start; gap: 16px;
    padding: 16px;
    border: 2px solid var(--green-800); border-radius: var(--radius);
    background: var(--ground);
}
.ais-next.is-hold { border-color: var(--hold); color: var(--hold); }
.ais-next.is-clear { border-color: var(--clear); color: var(--clear); }
.ais-next.is-pending { color: var(--green-800); }
.ais-next-body { min-width: 0; color: var(--ink); }
.ais-next-body h2, .ais-next-body h3 { font-size: 20px; }
.ais-next-body p { margin-top: 4px; color: var(--ink-2); font-size: 15px; }
.ais-next-body .ais-btn { margin-top: 12px; }

/* ---- Ledger (ruled office rows) ---------------------------------------- */

.ledger { margin-top: 28px; }
.ledger-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.ledger-head h2 { font-size: 20px; }
.ledger-count { flex: none; white-space: nowrap; color: var(--ink-2); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ledger-row {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px;
    padding: 12px 0; border-bottom: 1px solid var(--line);
}
.ledger-row strong { display: block; font-weight: 600; font-size: 16px; line-height: 1.3; }
.ledger-row span:not(.stamp) { display: block; color: var(--ink-2); font-size: 14px; }
.ledger-row.is-class { grid-template-columns: 60px minmax(0, 1fr); align-items: start; }
/* A row that is the way into its own page (faculty Home's queues). */
a.ledger-row { color: var(--ink); text-decoration: none; }
a.ledger-row:hover strong { color: var(--green-700); text-decoration: underline; text-underline-offset: 3px; }
.ledger-time { font: 700 17px/1.1 var(--font-mark); color: var(--green-800); font-variant-numeric: tabular-nums; }
.ledger-time small { display: block; margin-top: 2px; font: 600 12px/1 var(--font-read); color: var(--ink-2); }
.ledger-empty { padding: 14px 0; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.ledger-more { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 700; font-size: 15px; text-decoration: none; }
.ledger-more i { font-size: 12px; transition: transform 160ms var(--ease-out); }
.ledger-more:hover i { transform: translateX(3px); }

/* ---- Page head, loading, segmented control ---------------------------- */

/* A single-column working page keeps a reading width on wide screens. */
.page-narrow { max-width: 880px; }
.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: 26px; }
.page-head p { margin-top: 4px; color: var(--ink-2); font-size: 15px; }
.ais-loading { padding: 24px 0; color: var(--ink-2); }

/*
 * Tabs, chips and filters (DESIGN.md, "Segmented control", "Filter chips",
 * "Filters"). One look and one motion for every way a page switches view,
 * section or status; ais.js adds the sliding selection, the arrow keys, the
 * edge fades and the live filters. Pages add no scrolling or option styles of
 * their own: only, where needed, a margin.
 */
.ais-segmented {
    --seg-edge: color-mix(in srgb, var(--green-700) 22%, var(--green-tint));
    /* fit-content: a slot that stretches its children must not stretch this. */
    position: relative; display: inline-flex; gap: 4px; width: fit-content; max-width: 100%;
    margin: 16px 0 0; padding: 4px; vertical-align: top;
    border-radius: 12px; background: var(--ground); box-shadow: inset 0 0 0 1px var(--panel-line, var(--line));
    overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
}
.ais-segmented::-webkit-scrollbar { display: none; }
.ais-segmented :is(button, a) {
    position: relative; z-index: 1; flex: none;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 40px; min-width: 96px; padding: 0 16px;
    border: 0; border-radius: 9px; background: none; cursor: pointer;
    color: var(--ink-2); font: 700 15px/1 var(--font-read); white-space: nowrap; text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 120ms ease;
}
.ais-segmented :is(button, a):focus-visible { outline-offset: -3px; }
.ais-segmented :is(button, a):hover { color: var(--ink); background: var(--ground-2); }
.ais-segmented :is(button, a):active { transform: scale(0.97); }
.ais-segmented button:disabled { opacity: 0.45; cursor: default; transform: none; background: none; }
.ais-segmented :is(button, a) i { font-size: 13px; }
.ais-segmented :is(button, a) b { font-variant-numeric: tabular-nums; font-weight: 600; }
.ais-segmented :is(button[aria-selected="true"], button[aria-pressed="true"], a[aria-current]:not([aria-current="false"])) {
    background: var(--green-tint); color: var(--green-800); box-shadow: inset 0 0 0 1px var(--seg-edge);
}
/* The sliding selection (ais.js measures it; without script the option fills). */
.ais-segmented.has-thumb::before {
    content: ""; position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0;
    width: var(--seg-w, 0px); transform: translateX(var(--seg-x, 0px)); opacity: var(--seg-o, 0);
    border-radius: 9px; background: var(--green-tint); box-shadow: inset 0 0 0 1px var(--seg-edge);
    pointer-events: none;
}
.ais-segmented.has-thumb :is(button[aria-selected="true"], button[aria-pressed="true"], a[aria-current]:not([aria-current="false"])) { background: transparent; box-shadow: none; }
/* A strip wider than its column scrolls; the edge with more beyond it fades. */
.ais-segmented.is-more-end, .ais-chips.is-more-end { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }
.ais-segmented.is-more-start, .ais-chips.is-more-start { -webkit-mask-image: linear-gradient(90deg, transparent, #000 36px); mask-image: linear-gradient(90deg, transparent, #000 36px); }
.ais-segmented.is-more-start.is-more-end, .ais-chips.is-more-start.is-more-end { -webkit-mask-image: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent); }

/* Filter chips: one status out of several, each with its count; they wrap. */
.ais-chips {
    display: flex; gap: 8px; margin: 12px -4px 0; padding: 4px;
    overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
}
.ais-chips::-webkit-scrollbar { display: none; }
.ais-chips > :is(a, button) {
    flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px;
    border: 1px solid var(--line); border-radius: 20px; background: var(--ground); cursor: pointer;
    color: var(--ink); font: 600 14px/1 var(--font-read); text-decoration: none; white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 120ms ease;
}
.ais-chips > :is(a, button):hover { border-color: var(--green-700); }
.ais-chips > :is(a, button):active { transform: scale(0.97); }
.ais-chips > :is(a, button) b { font: 700 15px/1 var(--font-mark); font-variant-numeric: tabular-nums; }
.ais-chips > :is(button[aria-pressed="true"], a[aria-current]:not([aria-current="false"])) {
    border-color: var(--green-800); background: var(--green-tint); color: var(--green-800);
    box-shadow: inset 0 0 0 1px var(--green-800);
}
/* Applied filters: each chip removes its own; "Clear all" ends the row. */
.ais-chips > .is-applied { border-color: color-mix(in srgb, var(--green-700) 30%, transparent); background: var(--green-tint); }
.ais-chips > .is-applied b { font: 600 14px/1 var(--font-read); color: var(--green-800); }
.ais-chips > .is-applied i { font-size: 12px; color: var(--ink-2); transition: color 160ms ease; }
.ais-chips > .is-applied:hover { border-color: var(--green-800); }
.ais-chips > .is-applied:hover i { color: var(--hold); }
.ais-chips > .ais-link-btn { flex: none; display: inline-flex; align-items: center; min-height: 40px; }
@media (min-width: 768px) { .ais-chips { flex-wrap: wrap; overflow: visible; } }

@media (prefers-reduced-motion: no-preference) {
    .ais-segmented.has-thumb.is-ready::before { transition: transform 280ms var(--ease-out), width 280ms var(--ease-out), opacity 160ms ease; }
    /* A tab's panel rises in when it is shown. */
    [role="tabpanel"] { animation: ais-rise 220ms var(--ease-out) backwards; }
}
@keyframes ais-rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes ais-appear { from { opacity: 0; } }
@keyframes ais-scan { from { background-position: -70% 0; } to { background-position: 170% 0; } }

/* ---- Class rows (My Classes) ------------------------------------------- */

.class-list { margin-top: 12px; border-top: 2px solid var(--ink); }
.class-row {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start;
    padding: 14px 0; border-bottom: 1px solid var(--line);
}
/* Faculty Classes: the whole row opens the class page. */
a.class-row { color: var(--ink); text-decoration: none; }
a.class-row:hover strong { color: var(--green-700); text-decoration: underline; text-underline-offset: 3px; }
.faculty-earlier { margin-top: 40px; }
.faculty-earlier-title { font-size: 20px; color: var(--ink-2); }
.faculty-day h3 { margin-top: 16px; padding-bottom: 6px; border-bottom: 1px solid var(--line); font-size: 16px; }
.faculty-week-btn { padding-left: 0; }
.faculty-earlier .record-term { scroll-margin-top: calc(var(--topbar) + 16px); }
.class-main strong { display: block; font-weight: 600; font-size: 16px; line-height: 1.3; }
.class-main > span { display: block; margin-top: 2px; color: var(--ink-2); font-size: 14px; }
.class-slots { margin-top: 6px; display: grid; gap: 2px; font-size: 14px; color: var(--ink-2); }
.class-slots li { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.class-slots b { min-width: 36px; color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.class-slots span { font-variant-numeric: tabular-nums; }
.class-slots .is-tba { font-style: italic; }
.class-eval { display: inline-block; padding: 12px 0 4px; font-weight: 700; font-size: 15px; line-height: 1.35; text-decoration: none; }
.class-eval i { font-size: 12px; margin-left: 2px; }
.class-grade { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; padding-top: 2px; }
.grade-figure { font: 700 22px/1 var(--font-mark); color: var(--ink); font-variant-numeric: tabular-nums; }
abbr[title] { text-decoration: none; cursor: help; }

/* Class rows in columns (Classes, My Classes): from 1024px the course, its
   details and its schedule sit side by side instead of stacking. */
@media (min-width: 1024px) {
    .is-cols .class-row { padding: 10px 0; align-items: center; }
    .is-cols .class-main {
        display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.3fr) minmax(0, 1.9fr);
        column-gap: 20px; align-items: start;
    }
    .is-cols .class-main > span, .is-cols .class-slots { margin-top: 0; }
    .is-cols .class-main > span { padding-top: 1px; }
    .is-cols .class-main > .class-eval { grid-column: 1; padding-top: 4px; }
    .is-cols .class-grade { flex-direction: row-reverse; align-items: center; gap: 12px; padding-top: 0; }
}

/* ---- Weekly timetable (core/ui/_week_grid.html), desktop only ----------- */

.wk-wrap { display: none; }
@media (min-width: 1024px) {
    .wk-wrap:not([style*="display: none"]) { display: block; }
    .wk-wrap:not([style*="display: none"]) ~ .wk-list,
    .wk-wrap:not([style*="display: none"]) ~ .ledger-empty { display: none !important; }
}
.wk-wrap { margin-top: 20px; overflow-x: auto; background: var(--ground); border: 1px solid var(--panel-line); border-radius: var(--radius); }
.wk-grid { min-width: 760px; }
.wk-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.wk-row:last-child { border-bottom: 0; }
.wk-head { background: var(--head-wash); border-bottom: 2px solid var(--green-800); border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; }
.wk-day {
    display: flex; flex-direction: column; justify-content: center; gap: 2px;
    padding: 8px 10px; border-right: 1px solid var(--line);
    font: 700 15px/1.1 var(--font-mark); color: var(--ink);
}
.wk-day small { font: 600 11px/1 var(--font-read); color: var(--green-800); text-transform: uppercase; letter-spacing: 0.04em; }
.wk-row.is-today .wk-day { color: var(--green-900); box-shadow: inset 4px 0 0 var(--green-700); }
.wk-track {
    display: grid; grid-template-columns: repeat(var(--wk-slots), minmax(0, 1fr)); grid-auto-rows: minmax(52px, auto);
    gap: 4px 0; padding: 4px 0; position: relative;
    /* an hour rule every two half-hour columns */
    background-image: linear-gradient(to right, var(--line) 1px, transparent 1px);
    background-size: calc(200% / var(--wk-slots)) 100%;
}
.wk-head .wk-track { grid-auto-rows: auto; padding: 0; background-image: none; }
.wk-hour { padding: 8px 6px; color: var(--green-800); font-size: 12px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; border-left: 1px solid transparent; }
.wk-item {
    display: flex; flex-direction: column; gap: 1px; min-width: 0; margin: 0 2px; padding: 6px 8px;
    border-radius: 8px; background: var(--green-tint); box-shadow: inset 3px 0 0 var(--green-700);
    color: var(--ink); text-decoration: none; overflow: hidden;
}
.wk-item b { font-weight: 700; font-size: 13px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-item span, .wk-item small { color: var(--ink-2); font-size: 12px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-item small { font-variant-numeric: tabular-nums; }
a.wk-item[href]:hover { background: var(--head-wash); box-shadow: inset 3px 0 0 var(--green-800), 0 0 0 1px var(--green-700); }
a.wk-item[href]:hover b { text-decoration: underline; text-underline-offset: 2px; }

/* ---- Clearance (student) ----------------------------------------------- */

.clearance-section + .clearance-section { margin-top: 40px; }
.clearance-done { margin: 16px 0 4px; }
.clearance-done .ais-next-body h3 { font-size: 18px; }
.clearance-start { padding: 16px 0; border-bottom: 1px solid var(--line); }
.clearance-start p { color: var(--ink-2); margin-bottom: 14px; max-width: 60ch; }
.clearance-flag { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 0; color: var(--ink-2); font-size: 15px; border-bottom: 1px solid var(--line); }
.clearance-auto, .ledger-row span.clearance-auto {
    display: inline-block; margin-left: 6px; padding: 1px 8px; vertical-align: 2px;
    border-radius: 999px; background: var(--pending-tint); color: var(--pending);
    font: 600 12px/1.5 var(--font-read);
}
.ledger-row span.clearance-remark { color: var(--ink); }
.clearance-row.is-hold span.clearance-remark { color: var(--hold); font-weight: 600; }
.clearance-note { padding: 12px 0 0; color: var(--ink-2); font-size: 15px; max-width: 65ch; }

/* ---- Facts, tallies, folding terms (Records, My Assessment) ------------ */

.record-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; margin: 0 0 8px; }
.record-facts div { min-width: 0; }
.record-facts dt { color: var(--ink-2); font-size: 13px; font-weight: 600; }
.record-facts dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.record-facts dd.is-figure, .is-figure { font-variant-numeric: tabular-nums; }
@media (min-width: 768px) { .record-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.record-tally { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 8px; }
.record-tally div { display: flex; align-items: baseline; gap: 8px; padding: 8px 14px; border-radius: 10px; background: var(--clear-tint); color: var(--clear); }
.record-tally div:first-child { background: var(--ground-2); color: var(--ink); }
.record-tally div.is-hold { background: var(--hold-tint); color: var(--hold); }
.record-tally div.is-pending { background: var(--pending-tint); color: var(--pending); }
.record-tally dt { font-size: 14px; font-weight: 600; }
.record-tally dd { margin: 0; font: 700 18px/1 var(--font-mark); font-variant-numeric: tabular-nums; }

.record-term { margin-top: 24px; }
.record-term summary {
    display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: center; column-gap: 8px;
    padding: 8px 0; border-bottom: 2px solid var(--ink);
    cursor: pointer; list-style: none;
}
.record-term summary::-webkit-details-marker { display: none; }
.record-term-name { font: 700 20px/1.2 var(--font-mark); }
.record-term-meta { grid-column: 1; grid-row: 2; margin-top: 2px; color: var(--ink-2); font-size: 14px; font-weight: 600; }
.record-term summary i { grid-column: 2; grid-row: 1 / span 2; justify-self: center; color: var(--ink-2); transition: transform 200ms var(--ease-out); }
.record-term[open] summary i { transform: rotate(180deg); }

.fee-row.is-declined strong, .fee-row.is-declined .fee-amount { color: var(--ink-2); text-decoration: line-through; text-decoration-thickness: 1px; }
.fee-amount { font: 600 16px/1.2 var(--font-read); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger-row span.fee-less { color: var(--clear); }
.fee-total { border-top: 2px solid var(--ink); border-bottom: 0; }
.fee-total strong, .fee-total .fee-amount { font: 700 18px/1.2 var(--font-mark); }
.fees-pending strong { display: block; color: var(--ink); margin-bottom: 4px; }

/* ---- Shifting requests ------------------------------------------------- */

.shift-new { margin-bottom: 8px; }
.shift-request { margin-top: 32px; }
.shift-arrow { color: var(--ink-2); font-family: var(--font-read); }
.shift-stages { counter-reset: stage; }
.shift-reason { padding: 12px 0; color: var(--ink-2); font-size: 15px; max-width: 65ch; }
.shift-reason strong { color: var(--ink); }
.ais-link-btn.is-danger { padding: 0; color: var(--hold); }

/* ---- Form fields and form dialogs -------------------------------------- */

.ais-field { display: grid; gap: 6px; margin-top: 16px; }
.ais-field > span { font-weight: 600; }
.ais-field small { color: var(--ink-2); font-size: 13px; }
.ais-field select, .ais-field textarea, .ais-field input {
    width: 100%; min-height: 44px; padding: 10px 12px;
    border: 1px solid var(--field-line); border-radius: 10px; background: var(--ground);
    color: var(--ink); font: 400 16px/1.4 var(--font-read);
}
.ais-field textarea { resize: vertical; }
.ais-field select:focus-visible, .ais-field textarea:focus-visible, .ais-field input:focus-visible { border-color: var(--green-800); }
.ais-dialog.is-form { width: min(520px, calc(100vw - 32px)); }
.ais-dialog-note { margin-top: 16px !important; padding: 10px 12px; border-radius: 10px; background: var(--warn-tint); color: var(--warn) !important; font-size: 14px; }
.ais-field-error { margin-top: 12px !important; color: var(--hold) !important; font-weight: 600; }

/* ---- Toast (a page's answer to an action) ------------------------------ */

/* Floats over the record, above the tab bar, so it may cast the float shadow. */
.ais-toast-region {
    position: fixed; z-index: 35; left: 16px; right: 16px;
    bottom: calc(var(--tabbar) + var(--safe-bottom) + 12px);
    display: flex; justify-content: center; pointer-events: none;
}
.ais-toast {
    display: flex; align-items: center; gap: 4px;
    max-width: 480px; padding: 4px 4px 4px 16px; border-radius: 10px;
    background: var(--ink); color: var(--ground); font-size: 15px;
    box-shadow: 0 8px 24px rgba(0, 31, 26, 0.24);
    pointer-events: auto;
}
.ais-toast.is-error { background: var(--hold-fill); color: #fff; }
.ais-toast .ais-icon-btn { flex: none; color: inherit; }
.ais-toast .ais-icon-btn:hover { background: rgba(255,255,255,0.12); }

/* ---- Enrollment -------------------------------------------------------- */

.enroll-block { margin-bottom: 8px; }
.enroll-block + .enroll-block { margin-top: 12px; }
.enroll-facts { margin: 12px 0 4px; }
.ais-next-body .enroll-facts dd { color: var(--ink); }
.enroll-list { margin-top: 8px; display: grid; gap: 4px; }
.ais .enroll-list li { position: relative; padding-left: 18px; color: var(--ink-2); font-size: 15px; }
.ais .enroll-list li::before { content: ""; position: absolute; left: 4px; top: 0.6em; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-2); }
.ais-dialog .enroll-list { margin-top: 12px; }
.enroll-steps { margin-top: 12px; display: grid; gap: 6px; }
.enroll-steps li { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 15px; }
.enroll-steps li i { width: 16px; text-align: center; font-size: 13px; color: var(--pending); }
.enroll-steps li.is-done { color: var(--clear); }
.enroll-steps li.is-done i { color: var(--clear); }
.enroll-term { color: var(--ink); }

.ledger-tools { display: inline-flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; justify-content: flex-end; }
.ledger-tools .ais-link-btn { min-height: 36px; }

.class-main > .enroll-seats, .class-main > .enroll-note { display: block; margin-top: 4px; font-size: 14px; color: var(--ink-2); }
.class-main > .enroll-seats.is-warn { color: var(--warn); font-weight: 600; }
.class-main > .enroll-seats.is-hold { color: var(--hold); font-weight: 600; }
.class-main > .ais-link-btn { display: inline-flex; align-items: center; margin-top: 4px; }
.enroll-drop { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; margin-top: 8px; color: var(--warn); font-weight: 600; font-size: 14px; }
.enroll-advice { padding: 10px 0 0; color: var(--ink-2); font-size: 14px; }
.enroll-advice.is-note { color: var(--ink); font-size: 15px; }

.enroll-results .ledger-row .ais-btn { min-height: 40px; }

.enroll-checks { margin: 16px 0 0; padding: 0; border: 0; }
.enroll-checks legend { padding: 0; margin-bottom: 4px; font-weight: 600; }
.enroll-check {
    display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 0;
    border-bottom: 1px solid var(--line); cursor: pointer;
}
.enroll-check input { flex: none; width: 20px; height: 20px; accent-color: var(--green-800); }

/* Graduate course selection: the catalog, and the selections beside it. */
.grad-layout { display: grid; gap: 8px; }
/* Grid items default to min-width: auto; the scrolling filter would widen its column past the phone. */
.grad-layout > * { min-width: 0; }
.grad-row.is-dim strong, .grad-row.is-dim .class-main > span { color: var(--ink-2); }
.grad-prereq.is-blocked { color: var(--hold); }
.grad-prereq b { font-weight: 700; }
.grad-action { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.grad-action .ais-btn { min-height: 40px; padding: 0 14px; }
.grad-note { margin-top: 16px; color: var(--ink-2); font-size: 14px; max-width: 60ch; }
@media (min-width: 1024px) {
    .ais-toast-region { bottom: calc(24px + var(--footbar)); left: calc(var(--rail) + 24px); }
    .grad-layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: start; }
    .grad-side { grid-column: 2; grid-row: 1; position: sticky; top: calc(32px + var(--headbar)); }
    .grad-catalog { grid-column: 1; grid-row: 1; }
}

/* ---- Evaluation form (TER) --------------------------------------------- */

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ter-status { margin-bottom: 20px; }
.ter-facts { margin: 20px 0 8px; }
.ter-facts .ter-wide { grid-column: 1 / -1; }
.ter-course { display: block; }
.ter-part { margin-top: 32px; }
.ter-part-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.ter-part-head h2 { font-size: 22px; }
.ter-scale-key { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px !important; color: var(--ink-2); font-size: 14px; }
.ter-scale-key b { font-family: var(--font-mark); color: var(--ink); }
.ter-group { margin-top: 20px; }
.ter-group .ledger-head h3 { font-size: 18px; }
.ter-q { margin: 0; padding: 14px 0; border: 0; border-bottom: 1px solid var(--line); }
.ter-q legend { float: left; width: 100%; padding: 0; margin-bottom: 10px; font-size: 16px; line-height: 1.4; }
.ter-q legend + * { clear: both; }
.ter-num { font: 700 15px/1 var(--font-mark); color: var(--green-800); margin-right: 2px; font-variant-numeric: tabular-nums; }
.ter-q.is-missing legend { color: var(--hold); }
.ter-q.is-missing .ter-num { color: var(--hold); }
.ter-scale { display: flex; gap: 8px; }
.ter-option { position: relative; display: block; }
.ter-option input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.ter-option span[aria-hidden] {
    display: grid; place-items: center; width: 48px; height: 48px;
    border: 2px solid var(--field-line); border-radius: 50%; background: var(--ground);
    font: 700 17px/1 var(--font-mark); color: var(--ink-2); font-variant-numeric: tabular-nums;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.ter-option:hover span[aria-hidden] { border-color: var(--green-700); color: var(--green-800); }
.ter-option input:checked + span { background: var(--fill); border-color: var(--fill); color: var(--on-green); }
.ter-option input:focus-visible + span { outline: 3px solid var(--green-800); outline-offset: 2px; }
.ter-option input:disabled { cursor: default; }
.ter-option input:disabled + span { opacity: 0.4; }
.ter-option input:disabled:checked + span { opacity: 1; }
.ter-q.is-missing .ter-option span[aria-hidden] { border-color: var(--hold); }
.ter-text small { font-weight: 400; color: var(--ink-2); font-size: 14px; }
.ter-answer { padding: 10px 12px; border-radius: 10px; background: var(--ground-2); white-space: pre-line; }
.ter-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 24px; padding-top: 16px; border-top: 2px solid var(--ink); }
.ter-actions p { flex: 1 1 260px; color: var(--ink-2); font-size: 14px; }
@media (max-width: 400px) {
    .ter-scale { justify-content: space-between; gap: 0; }
    .ter-actions .ais-btn { flex: 1 1 100%; }
}
@media (min-width: 768px) {
    .ter-q { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; }
    /* Still floated: a floated legend is ordinary content, so it joins the grid. */
    .ter-q legend { width: auto; margin: 0; }
}
@media print {
    .ais-rail, .ais-topbar, .ais-tabbar, .ais-notice, .ter-actions, .ais-toast-region, .ais-skip { display: none !important; }
    body.ais { display: block; }
    .ais-main { padding: 0; max-width: none; }
    .ter-option span[aria-hidden] { width: 28px; height: 28px; font-size: 12px; }
    .ter-q { padding: 4px 0; break-inside: avoid; }
}

/* ---- NSTP registration ------------------------------------------------- */

.nstp-block { margin-bottom: 8px; }
.nstp-block + .nstp-block { margin-top: 12px; }
.nstp-facts { margin: 12px 0 4px; }
.nstp-facts .nstp-wide { grid-column: 1 / -1; }
.ais-next-body .nstp-facts dd { color: var(--ink); }
.ais-next-body .ais-link-btn { margin-top: 8px; }
.nstp-missing { margin: 10px 0 4px; }
.nstp-missing li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.nstp-missing li span { display: block; color: var(--ink-2); font-size: 14px; }
.ais-next-body p.nstp-remark { color: var(--ink); padding: 10px 12px; border-radius: 10px; background: var(--hold-tint); }
.ais-next-body p.nstp-held { color: var(--ink); }
.nstp-lead { padding: 10px 0 0; color: var(--ink-2); font-size: 15px; max-width: 65ch; }
.nstp-lead.is-warn { color: var(--warn); font-weight: 600; }
.nstp-options { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; border: 0; }
@media (min-width: 576px) { .nstp-options { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); } }
.nstp-option {
    position: relative; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px;
    border: 1px solid var(--field-line); border-radius: 10px; cursor: pointer;
}
.nstp-option input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--green-800); }
.nstp-option-text { flex: 1; min-width: 0; }
.nstp-option-text strong { display: block; font-weight: 700; }
.nstp-option-text span { display: block; color: var(--ink-2); font-size: 14px; }
.nstp-option:has(input:checked) { border-color: var(--green-800); background: var(--green-tint); box-shadow: inset 0 0 0 1px var(--green-800); }
.nstp-option.is-full { cursor: not-allowed; background: var(--ground-2); color: var(--ink-2); }
.nstp-files .ais-field small { font-weight: 400; color: var(--ink-2); font-size: 13px; }
.nstp-files .ais-field a { font-size: 14px; font-weight: 600; }
.nstp-files input[type="file"] { padding: 8px; }
.nstp-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 16px; }
.nstp-msg { font-size: 14px; color: var(--ink-2); }
.nstp-msg.is-error { color: var(--hold); font-weight: 600; }
.nstp-msg.is-success { color: var(--clear); font-weight: 600; }
.nstp-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 16px; margin-top: 24px; padding-top: 16px; border-top: 2px solid var(--ink); }
.nstp-actions .nstp-msg { flex: 1 1 200px; }
@media (max-width: 575px) { .nstp-actions .ais-btn { flex: 1 1 100%; } }

/* ---- Student profile cards (profile page and first-login wizard) -------
 *
 * The cards (students/_sp_section_*.html) keep their Bootstrap-named classes on
 * purpose: they are the contract with static/js/student-profile.js (which
 * builds rows and marks errors with them) and with locations/_address_fields.html,
 * which pages on the older shells still include. Here those names are given the
 * AIS look, and only inside a card, so nothing leaks onto the rest of the page.
 */

.sp-card { margin-top: 32px; }
.sp-card > .card-header {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
    padding-bottom: 8px; border-bottom: 2px solid var(--ink);
}
.sp-card > .card-header h6 { flex: 1 1 auto; margin: 0; font: 700 20px/1.2 var(--font-mark); }
.sp-card .sp-ico { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--green-tint); color: var(--green-800); font-size: 13px; }
.sp-card > .card-body { padding-top: 12px; }
.sp-hint { margin: 0 0 12px; color: var(--ink-2); font-size: 14px; max-width: 65ch; }
.sp-group {
    display: flex; align-items: center; gap: 8px; margin: 24px 0 8px;
    font: 700 13px/1.2 var(--font-read); letter-spacing: 0.06em; text-transform: uppercase; color: var(--green-800);
}
.sp-group::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sp-card .card-body > .sp-group:first-child { margin-top: 4px; }

.sp-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; margin: 0; }
@media (min-width: 768px) { .sp-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.sp-fact dt { color: var(--ink-2); font-size: 13px; font-weight: 600; }
.sp-fact dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }

.sp-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px 16px; }
@media (min-width: 576px) { .sp-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sp-wide { grid-column: 1 / -1; }

.sp-card .form-label { display: block; margin: 0 0 6px; font-weight: 600; font-size: 15px; }
.sp-card .form-control, .sp-card .form-select {
    display: block; width: 100%; min-height: 44px; padding: 10px 12px;
    border: 1px solid var(--field-line); border-radius: 10px; background-color: var(--ground);
    color: var(--ink); font: 400 16px/1.4 var(--font-read);
}
.sp-card .form-select { appearance: auto; padding-right: 8px; }
.sp-card textarea.form-control { min-height: 72px; resize: vertical; }
.sp-card .form-control:focus-visible, .sp-card .form-select:focus-visible { border-color: var(--green-800); }
.sp-card .form-control.is-invalid, .sp-card .form-select.is-invalid { border-color: var(--hold); box-shadow: inset 0 0 0 1px var(--hold); }
.sp-card .invalid-feedback { display: none; margin-top: 6px; color: var(--hold); font-size: 14px; font-weight: 600; }
.sp-card .invalid-feedback.d-block, .sp-card .is-invalid ~ .invalid-feedback { display: block; }
.sp-card .form-text { margin-top: 6px; color: var(--ink-2); font-size: 13px; }
.sp-req, .sp-card .text-danger { color: var(--hold); font-weight: 700; margin-left: 2px; }
.sp-card .text-muted { color: var(--ink-2); font-weight: 400; }
.sp-card .fw-normal { font-weight: 400; }
.sp-card .text-lowercase { text-transform: lowercase; }
.sp-card .d-block { display: block; }
.sp-card .mt-1 { margin-top: 4px; } .sp-card .mt-2 { margin-top: 8px; } .sp-card .mb-0 { margin-bottom: 0; } .sp-card .mb-2 { margin-bottom: 8px; }
.sp-card .d-flex { display: flex; } .sp-card .flex-column { flex-direction: column; } .sp-card .gap-1 { gap: 4px; }
@media (min-width: 576px) { .sp-card .flex-sm-row { flex-direction: row; } .sp-card .flex-sm-wrap { flex-wrap: wrap; } .sp-card .gap-sm-3 { gap: 4px 16px; } }
@media (min-width: 768px) { .sp-card .d-md-none { display: none; } }

/* The shared address partial lays itself out with Bootstrap's grid. */
.sp-card .address-cascade { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px 16px; }
.sp-card .address-cascade > .col-12 { grid-column: 1 / -1; }
/* After .col-12: the partial gives its four selects both classes. */
@media (min-width: 576px) { .sp-card .address-cascade { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sp-card .address-cascade > .col-sm-6 { grid-column: auto; } }
.sp-card .address-cascade > [hidden] { display: none; }
/* The partial sets its own small sizes inline, for the pages that predate this. */
.sp-card .address-cascade .form-label { font-size: 15px !important; font-weight: 600; }
.sp-card .address-cascade .form-text { font-size: 13px !important; }
.sp-card .alert { padding: 12px 14px; border-radius: 10px; background: var(--warn-tint); color: var(--warn); font-size: 15px; margin-bottom: 12px; }

.sp-check { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.sp-check .form-check-input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--green-800); }
.sp-check label { flex: 1; margin: 0; padding: 8px 0; cursor: pointer; }

.sp-when { display: none; }
.sp-when.is-on { display: block; }

.sp-repeat-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.sp-repeat-row .sp-field-label { display: block; margin-bottom: 4px; color: var(--ink-2); font-size: 13px; font-weight: 600; }
@media (min-width: 900px) {
    .sp-repeat-row { grid-template-columns: var(--cols); align-items: end; gap: 8px; }
    .sp-repeat-row .sp-field-label { display: none; }
}
.sp-card .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 44px; padding: 0 16px; border: 0; border-radius: 10px; cursor: pointer;
    font: 700 15px/1 var(--font-read);
}
.sp-card .btn i { font-size: 13px; }
.sp-card .btn-primary { background: var(--fill); color: var(--on-green); }
.sp-card .btn-primary:hover { background: var(--fill-deep); }
.sp-card .btn-outline-secondary { margin-top: 12px; background: var(--ground-2); color: var(--ink); }
.sp-card .btn-outline-secondary:hover { background: var(--line); }
.sp-card .btn-outline-danger { justify-self: start; padding: 0 8px; background: none; color: var(--hold); }
.sp-card .btn-outline-danger:hover { background: var(--hold-tint); }
.sp-card .btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* How much a card still wants: a stamp, kept current by student-profile.js. */
.sp-chip {
    display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px;
    border: 2px solid currentColor; border-radius: 6px;
    font: 700 11px/1.1 var(--font-mark); letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap;
}
.sp-chip.is-complete { color: var(--clear); background: var(--clear-tint); transform: rotate(-3deg); }
.sp-chip.is-partial { color: var(--pending); border-style: dashed; }
.sp-chip i { font-size: 10px; }
.sp-dot { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; font: 700 12px/1 var(--font-read); }
.sp-dot.is-complete { color: var(--clear); background: var(--clear-tint); }
.sp-dot.is-partial { color: var(--pending); background: var(--pending-tint); }

/* Saving one card (profile page). */
.sp-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 12px; padding: 16px 0 4px; }
.sp-status { flex: 1 1 180px; font-size: 14px; color: var(--ink-2); }
.sp-status.text-danger { color: var(--hold); font-weight: 600; }
.sp-status.text-success { color: var(--clear); font-weight: 600; }
.sp-section.is-dirty > .card-header::after {
    content: "Unsaved"; padding: 3px 8px; border: 2px dashed var(--warn); border-radius: 6px;
    color: var(--warn); font: 700 11px/1.1 var(--font-mark); letter-spacing: 0.08em; text-transform: uppercase;
}
@media (max-width: 1023px) {
    .sp-section.is-dirty > .sp-actions {
        position: sticky; z-index: 15; bottom: calc(var(--tabbar) + var(--safe-bottom));
        margin: 0 -16px; padding: 10px 16px; background: var(--ground);
        box-shadow: 0 -6px 16px rgba(0, 31, 26, 0.10);
    }
}
@media (max-width: 575px) { .sp-actions .btn { flex: 1 1 100%; } }

/* Profile page: the sections, as a strip on phones and a list beside the cards. */
.sp-progress-line { color: var(--ink-2); font-size: 15px; }
.sp-progress-line strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.sp-strip {
    position: sticky; top: calc(var(--topbar) + var(--safe-top)); z-index: 20;
    display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
    margin: 12px -16px 20px; padding: 8px 16px; background: var(--ground); border-bottom: 1px solid var(--line);
}
.sp-strip::-webkit-scrollbar { display: none; }
.sp-strip a {
    flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px;
    border-radius: 20px; background: var(--ground-2); color: var(--ink); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap;
}
.ais .sp-strip a { color: var(--ink); }
.ais .sp-strip a.active { background: var(--fill); color: var(--on-green); }
.sp-strip a.active .sp-dot { background: rgba(255,255,255,0.2); color: var(--on-green); }
.sp-toc { display: none; }
[id^="sec-"] { scroll-margin-top: calc(var(--topbar) + var(--safe-top) + 72px); }
@media (min-width: 1024px) {
    .sp-strip { top: var(--headbar); margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
    [id^="sec-"] { scroll-margin-top: 80px; }
}
@media (min-width: 1200px) {
    .sp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 40px; align-items: start; }
    .sp-strip { display: none; }
    .sp-toc { display: block; position: sticky; top: calc(32px + var(--headbar)); }
    .sp-toc h2 { font: 700 13px/1.2 var(--font-read); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 8px; }
    .sp-toc a { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; padding: 0 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; }
    .ais .sp-toc a { color: var(--ink); }
    .sp-toc a:hover { background: var(--ground-2); }
    .ais .sp-toc a.active { background: var(--green-tint); color: var(--green-800); }
    [id^="sec-"] { scroll-margin-top: 24px; }
}

/* First-login wizard: the same cards, one per step. */
.ais.is-bare .ais-main { padding-bottom: 24px; }
.sp-wiz-head { margin-bottom: 16px; }
.sp-wiz-head .sp-wiz-count { display: block; color: var(--ink-2); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sp-wiz-head h1 { font-size: 26px; margin-top: 2px; }
.sp-wiz-head h1:focus { outline: none; }
.sp-wiz-intro { margin-bottom: 12px !important; color: var(--ink-2); font-size: 15px; max-width: 65ch; }
.sp-wiz-review { margin-bottom: 16px; }
.sp-wiz-facts { margin: 0 0 12px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sp-step[hidden] { display: none !important; }
.ais .sp-step.sp-card { margin-top: 16px; }
/* The page head already names the step; the card keeps only its stamp. */
.sp-step > .card-header h6, .sp-step > .card-header .sp-ico { display: none; }
.sp-step > .card-header { justify-content: flex-end; min-height: 34px; }
.sp-wiz-bar {
    position: sticky; bottom: 0; z-index: 25;
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    margin: 20px -16px 0; padding: 12px 16px calc(12px + var(--safe-bottom));
    background: var(--ground); border-top: 1px solid var(--line); box-shadow: 0 -6px 16px rgba(0, 31, 26, 0.08);
}
.sp-wiz-bar .ais-btn { min-height: 48px; }
.sp-wiz-bar .sp-wiz-next { flex: 1; }
.sp-wiz-bar [hidden] { display: none; }
.sp-wiz-msg { flex-basis: 100%; margin: 0; font-size: 15px; color: var(--ink-2); }
.sp-wiz-msg:empty { display: none; }
.sp-wiz-msg.text-danger { color: var(--hold); font-weight: 600; }
.sp-wiz-msg a { color: inherit; font-weight: 700; }
@media (min-width: 576px) { .sp-wiz-bar .sp-wiz-next { flex: 0 0 auto; margin-left: auto; padding: 0 28px; } }
@media (min-width: 768px) { .sp-wiz-bar { margin-left: -24px; margin-right: -24px; padding-left: 24px; padding-right: 24px; } }
.sp-review-list li + li { border-top: 1px solid var(--line); }
.sp-review-list button {
    display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 0;
    border: 0; background: none; cursor: pointer; text-align: left; color: var(--ink); font: 600 16px/1.3 var(--font-read);
}
.sp-review-list button > span:nth-child(2) { flex: 1; }
.sp-review-list .fa-chevron-right { color: var(--ink-2); font-size: 12px; }

@media (min-width: 1024px) {
    /* No rail in the wizard: the top bar stays, and the page is one centred column. */
    body.ais.is-bare { display: block; }
    .ais.is-bare .ais-topbar { display: flex !important; }
    .ais.is-bare .ais-main { max-width: 760px; margin: 0 auto; padding: 32px 24px 24px; }
    .sp-wiz-head h1 { font-size: 32px; }
}

/* ---- Pager and linked ledger rows (shared pages) ---------------------- */

.ais-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-top: 16px; color: var(--ink-2); font-size: 14px; font-weight: 600; }
.ais-pager span { font-variant-numeric: tabular-nums; }
.eval-row > a { display: block; min-width: 0; color: inherit; text-decoration: none; }
.ais .eval-row > a { color: var(--ink); }
.eval-row > a:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.ledger-row span.eval-go { margin-top: 4px; color: var(--green-700); font-weight: 700; font-size: 14px; }
.eval-go i { font-size: 11px; }

/* ---- Academic calendar ------------------------------------------------- */

.cal-back { margin: -8px 0 4px; }
.cal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.cal-frame { display: none; width: 100%; height: 75vh; min-height: 420px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--ground-2); }
.cal-facts { grid-template-columns: minmax(0, 1fr) !important; margin-top: 24px; }
.cal-facts dd .stamp { margin-left: 8px; vertical-align: 1px; }
@media (min-width: 1024px) {
    .cal-frame { display: block; }
    .cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; }
    .cal-facts { margin-top: 0; }
}

/* ---- Support tickets --------------------------------------------------- */

.ticket summary { cursor: pointer; list-style: none; }
.ticket summary::-webkit-details-marker { display: none; }
.ticket summary:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.ticket details[open] summary { border-bottom-color: transparent; }
.ticket-body { padding: 0 0 16px; border-bottom: 1px solid var(--line); }
.ticket-label { margin-top: 8px !important; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.ticket-text { margin-top: 4px !important; white-space: pre-line; overflow-wrap: anywhere; max-width: 70ch; }
.ticket-text.is-answer { padding: 10px 12px; border-radius: 10px; background: var(--green-tint); }
.ticket-text.is-none { color: var(--ink-2); }

/* ---- Account settings -------------------------------------------------- */

.acct-first { margin-top: 0; }
.acct-facts { margin: 12px 0 8px; }
.acct-address { margin-top: 28px; }
/* Account settings: line the address card's title up with the ledger heads
   around it (the profile-card band sits 12px further in from 1024px). */
@media (min-width: 1024px) {
    .ais-main .sp-card.acct-address:not(dialog *, :is(.ledger, .record-term, .ais-panel, .ais-next, .sp-card, .class-list) *) > .card-header { padding-left: 12px; }
}
.acct-row .ais-link-btn, .acct-row .acct-btn { margin-top: 8px; }
.acct-row .acct-btn { min-height: 40px; }
.acct-row .ais-link-btn.is-danger { min-height: 40px; }
.acct-password summary { cursor: pointer; list-style: none; }
.acct-password summary::-webkit-details-marker { display: none; }
.acct-password summary i { color: var(--ink-2); transition: transform 200ms var(--ease-out); }
.acct-password[open] summary i { transform: rotate(180deg); }
.acct-pw-form { padding: 0 0 16px; max-width: 420px; }
.acct-pw-form > .ais-btn { margin-top: 16px; }
.acct-pw { position: relative; display: block; }
.acct-pw input { padding-right: 48px; }
.acct-pw .ais-icon-btn { position: absolute; top: 0; right: 0; }
.acct-msg { margin-top: 12px !important; font-weight: 600; font-size: 15px; }
.acct-msg.is-ok { color: var(--clear); }
.acct-msg.is-error { color: var(--hold); }

/* ---- Install AIS ------------------------------------------------------- */

.ais-install {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 20px; padding: 12px;
    border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--green-tint);
}
.ais-install[hidden] { display: none; }
.ais-install img { flex: none; border-radius: 10px; }
.ais-install-text { flex: 1; min-width: 0; }
.ais-install-text h2 { font-size: 16px; }
.ais-install-text p { font-size: 14px; color: var(--ink-2); }
.ais-install .ais-btn { min-height: 40px; padding: 0 14px; }
.ais-install-close { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: none; color: var(--ink-2); cursor: pointer; }
.ais-install-close:hover { background: rgba(0,0,0,0.06); }

/* ---- Home -------------------------------------------------------------- */

.home-head {
    margin: -16px -16px 20px;
    padding: 4px 16px 24px;
    background: var(--chrome);
    color: var(--on-green);
}
.home-when { display: block; }
.ais-next-body p.is-note { color: var(--ink); }
.home-head h1 { font-size: 26px; margin-top: 2px; }
.home-who { margin-top: 4px; color: var(--on-green-2); font-size: 15px; }
.home-col > :first-child { margin-top: 0; }
.home-col + .home-col { margin-top: 28px; }

/* Personnel Home: a shortcut card per working page, grouped as the rail is. */
.ps-group + .ps-group { margin-top: 24px; }
.ps-group .ps-group-title { margin-bottom: 10px; color: var(--ink-2); font: 700 13px/1.2 var(--font-read); text-transform: uppercase; letter-spacing: 0.06em; }
.ps-cards { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.ps-card {
    display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 16px;
    border: 1px solid var(--panel-line, var(--line)); border-radius: var(--radius); background: var(--ground);
    color: var(--ink); text-decoration: none;
}
.ps-card:hover { border-color: var(--green-700); }
.ps-card:hover .ps-card-label { color: var(--green-700); text-decoration: underline; text-underline-offset: 3px; }
.ps-card-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--green-tint); color: var(--green-800); font-size: 16px; }
.ps-card-label { flex: 1; min-width: 0; font-weight: 600; font-size: 16px; line-height: 1.3; }
.ps-card-badge { flex: none; }
.ps-card-go { flex: none; color: var(--ink-2); font-size: 13px; }
@media (min-width: 768px) { .ps-cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); } }

/* Student Home: one status card per office, each with its shortcut. */
.home-cards { display: grid; gap: 16px; }
.ais-next.home-card { align-items: stretch; }
.home-card .ais-next-body { display: flex; flex-direction: column; flex: 1; }
.home-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.home-card-head .stamp { flex: none; }
.home-card .ais-btn { align-self: flex-start; margin-top: auto; }
.home-card p:last-of-type { margin-bottom: 12px; }
.home-card p.home-closes { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.home-closes i { flex: none; color: var(--green-700); font-size: 13px; }
.ais-next.is-neutral { border-color: var(--line); color: var(--ink-2); }

@media (min-width: 768px) {
    .home-cards { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}

@media (min-width: 768px) {
    .ais-main { padding-left: 24px; padding-right: 24px; }
    .home-head { margin: -16px -24px 24px; padding: 8px 24px 28px; }
    .home-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
    .home-col + .home-col { margin-top: 0; }
}

/* ---- Class grades (faculty class page) --------------------------------- */

/* A way back up to the list a page belongs to. */
.page-back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-bottom: 4px; font-weight: 700; font-size: 15px; text-decoration: none; }
.page-back i { font-size: 13px; }

.grades-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.grades-head .stamp { flex: none; margin-top: 6px; }
.grades-slot { display: block; font-variant-numeric: tabular-nums; }
.grades-page .ais-notices { margin: 8px 0 0; }
.grades-tools { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.grades-tools .ais-btn i { font-size: 13px; }
.ais-btn.is-disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

.grades-cols { display: none; }
.grades-group {
    padding: 16px 0 6px; border-bottom: 1px solid var(--line);
    color: var(--ink-2); font: 700 12px/1.2 var(--font-read); letter-spacing: 0.06em; text-transform: uppercase;
}
.grade-row { border-bottom: 1px solid var(--line); }
/* Phones: the student, then the three grades side by side, then Save. */
.grade-row-inner { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 10px; padding: 14px 0; }
.grade-who { grid-column: 1 / -1; min-width: 0; }
.grade-who strong { display: block; font-weight: 600; font-size: 16px; line-height: 1.3; text-transform: uppercase; overflow-wrap: anywhere; }
.grade-who span { display: block; margin-top: 2px; color: var(--ink-2); font-size: 14px; font-variant-numeric: tabular-nums; }
/* Evaluation stamp: under the name on phones, its own column on desktop. */
.grade-eval { grid-column: 1 / -1; min-width: 0; margin-top: -2px; }
.grade-eval .stamp { padding: 5px 10px; font-size: 12px; }
.grade-cell { min-width: 0; }
.grade-edit, .grade-saved { display: grid; gap: 4px; }
.grade-label { color: var(--ink-2); font-size: 13px; font-weight: 600; }
.grade-edit input[type="number"] {
    width: 100%; min-height: 44px; padding: 0 8px;
    border: 1px solid var(--field-line); border-radius: 10px; background: var(--ground); color: var(--ink);
    font: 600 16px/1 var(--font-read); text-align: center; font-variant-numeric: tabular-nums;
}
.grade-edit input[type="number"]:focus-visible { border-color: var(--green-800); }
.grade-edit input[type="number"]:disabled { background: var(--ground-2); }
.grade-edit input.is-changed { border-color: var(--warn); background: var(--warn-tint); }
.grade-inc { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; font-size: 13px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.grade-inc input { width: 18px; height: 18px; accent-color: var(--green-800); }
.grade-hist { min-height: 32px; padding: 0; justify-self: start; font-size: 13px; }
.grade-saved .grade-figure { font-size: 20px; }
.grade-acts { display: flex; flex-wrap: wrap; gap: 0 12px; }
.grade-acts .ais-link-btn { min-height: 36px; padding: 0; font-size: 13px; }
.grade-save { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.grades-rejected { color: var(--hold) !important; }
.grades-missing { margin-top: 12px; max-height: 260px; overflow-y: auto; display: grid; gap: 6px; font-size: 15px; }
.grades-missing span { color: var(--hold); }
.grades-facts { margin-top: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.grades-history { margin-top: 12px; max-height: 50vh; overflow-y: auto; }

/* ---- Approval queues (drop and shifting requests) --------------------- */

/* One request per row; its two decisions under it on phones, beside it from 768px. */
.queue-row { grid-template-columns: minmax(0, 1fr); align-items: start; }
.ledger-row span.queue-what { margin-top: 4px; color: var(--ink); font-weight: 600; }
.queue-reason { margin: 6px 0 0; padding-left: 10px; border-left: 3px solid var(--line); color: var(--ink); font-size: 15px; overflow-wrap: anywhere; }
.ledger-row span.queue-when { margin-top: 6px; font-size: 13px; }
.queue-remarks { margin: 8px 0 0; display: grid; gap: 4px; font-size: 14px; }
.queue-remarks dt { color: var(--ink-2); font-weight: 600; font-size: 13px; }
.queue-remarks dd { margin: 0; overflow-wrap: anywhere; }
.queue-acts { display: flex; gap: 8px; }
.queue-acts .ais-btn { flex: 1; }
.queue-facts { margin-top: 12px; grid-template-columns: minmax(0, 1fr) !important; }
@media (min-width: 768px) {
    .queue-row { grid-template-columns: minmax(0, 1fr) auto; }
    .queue-acts .ais-btn { flex: none; }
}

/* ---- Advising (program head) ------------------------------------------- */

.ais-check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 15px; cursor: pointer; }
.ais-check input { flex: none; width: 20px; height: 20px; accent-color: var(--green-700); }
.pros-meta span + span::before { content: " · "; }
/*
 * Filters: a white panel of fields (the panel itself is under "Panels and the
 * desk"). Phones lay the fields two abreast with search on its own row; from
 * 768px the fields share rows of at least 176px, search takes two, and the
 * action row sits in the last column. Pages do not set their own columns.
 * A GET form is live (ais.js): it applies itself, so its Apply button hides,
 * and Clear filters shows only when something is set.
 */
.adv-filters { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; margin-top: 16px; align-items: end; }
.adv-filters .ais-field { margin-top: 12px; }
.adv-search, .adv-checks, .adv-filter-acts, .adv-filters > .ais-check { grid-column: 1 / -1; }
.adv-checks { display: flex; flex-wrap: wrap; gap: 0 20px; }
.adv-filter-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; min-height: 44px; padding-top: 8px; }
.adv-filter-acts[hidden], .adv-filter-acts [hidden] { display: none !important; }
.adv-filter-acts .ais-link-btn { min-height: 44px; }
/* Loading: a scan runs along the panel's top edge (after 150ms, so a quick
   answer never flickers), and the results under it dim until they arrive. */
.adv-filters.is-busy::after {
    content: ""; position: absolute; top: -1px; left: 12px; right: 12px; height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--green-700), transparent) 0 0 / 40% 100% no-repeat;
    animation: ais-scan 1s linear infinite, ais-appear 160ms ease 150ms both;
}
.ais-main[aria-busy="true"] .ais-slot:is(.is-body, .is-summary) { opacity: 0.55; transition: opacity 200ms ease 150ms; }
@media (prefers-reduced-motion: no-preference) {
    .ais-main.is-swapped .ais-slot:is(.is-body, .is-summary) { animation: ais-rise 220ms var(--ease-out) backwards; }
}
@media (prefers-reduced-motion: reduce) {
    .adv-filters.is-busy::after { animation: ais-appear 160ms ease 150ms both; background-size: 100% 100%; opacity: 0.6; }
}
.adv-pages { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 16px; color: var(--ink-2); font-size: 14px; }
.adv-by { margin-top: 12px; color: var(--ink-2); font-size: 14px; }
.adv-page .ais-notice { margin-top: 12px; }
.adv-item { align-items: start; }
.adv-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.adv-tags { display: flex !important; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.adv-tag { padding: 2px 8px; border-radius: 6px; background: var(--ground-2); color: var(--ink-2); font-size: 13px; font-weight: 600; }
.adv-tag.is-clear { background: var(--clear-tint); color: var(--clear); }
.adv-tag.is-pending { background: var(--pending-tint); color: var(--pending); }
.ledger-row span.adv-warn { margin-top: 6px; padding: 4px 8px; border-radius: 6px; background: var(--warn-tint); color: var(--warn); font-size: 13px; }
.ledger-row span.adv-warn.is-hold { background: var(--hold-tint); color: var(--hold); }
.ledger-row span.adv-warn:empty { visibility: hidden; }
.ledger-row span.adv-blocked { margin-top: 6px; color: var(--hold); font-size: 13px; font-weight: 600; }
.ledger-row span.adv-notes { margin-top: 4px; font-style: italic; }
.adv-item.is-blocked strong { color: var(--ink-2); }
.adv-note { margin-top: 12px; padding: 10px 12px; border-left: 3px solid var(--line); font-size: 15px; }
.adv-acts { border-bottom: 0; }
@media (min-width: 768px) {
    .adv-filters { grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); }
    .adv-filters .adv-search { grid-column: span 2; }
    .adv-filters > .ais-check { grid-column: auto; }
    .adv-filters .adv-filter-acts { grid-column: auto / -1; justify-content: flex-end; padding-top: 0; }
}

/* ---- Prospectus, read-only (_prospectus_ais.html) ------------------------ */

.pros-facts { margin-top: 16px; }
.pros-switch { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 12px; margin-top: 8px; }
.pros-switch .ais-field { flex: 1 1 260px; }
.pros-switch .ais-btn { margin-bottom: 8px; }
.pros-none { margin-top: 8px; color: var(--ink-2); font-size: 14px; }
.cur-key { margin-top: 16px; color: var(--ink-2); font-size: 13px; }
/* Grades Monitor: the final-rating share, toned by how far along it is. */
/* TER Analytics */
.ter-stamp { margin-top: 6px; white-space: nowrap; }
.ter-total { padding: 10px 0; text-align: right; color: var(--ink-2); font-size: 14px; }
.ter-total b { color: var(--ink); font: 700 18px/1 var(--font-mark); font-variant-numeric: tabular-nums; }
.ter-done { margin-top: 8px; color: var(--clear); font-weight: 600; }
.ter-comment p { margin: 4px 0 0; font-size: 15px; overflow-wrap: anywhere; white-space: pre-line; }
.ter-report { margin-top: 16px; }
.dash-head .ais-btn i { margin-right: 6px; }
.pros-year { margin-top: 12px; }
.pros-period { margin-top: 12px; }
.pros-period h4 { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0 6px; border-bottom: 1px solid var(--ink); font-size: 15px; }
.pros-period h4 span { color: var(--ink-2); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pros-rows { margin: 0; padding: 0; list-style: none; }
.pros-rows li { display: grid; grid-template-columns: minmax(0, 1fr) 44px 64px; gap: 8px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pros-rows li b { font-weight: 700; }
.pros-rows li span:not(.pros-units):not(.pros-grade) { display: block; color: var(--ink-2); font-size: 13px; }
.pros-rows li.is-untaken b { color: var(--ink-2); }
.pros-flag { margin-left: 4px; padding: 1px 6px; border-radius: 6px; background: var(--ground-2); color: var(--ink-2); font-size: 11px; font-weight: 700; }
.pros-units { color: var(--ink-2); font-size: 13px; text-align: center; font-variant-numeric: tabular-nums; }
.pros-units i { font-style: normal; color: var(--line); margin: 0 2px; }
.pros-grade { font: 700 15px/1 var(--font-mark); text-align: right; font-variant-numeric: tabular-nums; }
.pros-grade.is-clear { color: var(--clear); }
.pros-grade.is-hold { color: var(--hold); }
.pros-grade.is-pending { color: var(--pending); }
.pros-grade.is-none { color: var(--ink-2); font-weight: 400; }

/* ---- Student Records: the curriculum as a grid of semester tables ------ */

.rec-year { margin-top: 28px; }
.rec-year:first-child { margin-top: 0; }
.rec-year-title { font-size: 20px; padding-bottom: 12px; }
.rec-grid { display: grid; gap: 20px; align-items: start; }
.ais-main .rec-grid > .ledger.rec-sem, .ais-main .rec-year > .ledger.rec-sem { margin-top: 0; }
.rec-sem .ledger-head h3 { font-size: 18px; }
.rec-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rec-table th {
    padding: 8px 6px; border-bottom: 1px solid var(--line);
    color: var(--ink-2); font-size: 12px; font-weight: 600; text-align: left;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.rec-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.rec-table tbody tr:last-child td { border-bottom: 0; }
.rec-table :is(th, td):first-child { padding-left: 0; }
.rec-table :is(th, td):last-child { padding-right: 0; }
.rec-course b { font-weight: 700; }
.rec-course span { display: block; color: var(--ink-2); font-size: 13px; overflow-wrap: anywhere; }
.rec-num { width: 1%; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.rec-table th.rec-num { text-align: right; }
.rec-term { color: var(--ink-2); font-size: 13px; }
.rec-grade { width: 1%; white-space: nowrap; text-align: right; font: 700 15px/1.3 var(--font-mark); font-variant-numeric: tabular-nums; }
.rec-remark { width: 1%; white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.rec-table .is-clear { color: var(--clear); }
.rec-table .is-hold { color: var(--hold); }
.rec-table .is-pending { color: var(--pending); }
.rec-grade.is-none { color: var(--ink-2); font-weight: 400; }
.rec-table tr.is-untaken .rec-course b { color: var(--ink-2); }
/* Courses outside the curriculum, on the registrar's pages. */
.rec-table tr.is-outside > td { background: var(--warn-tint); }
.is-outside .rec-outside-flag { background: var(--ground); color: var(--warn); }
.is-outside .gc-flag { background: var(--warn-fill); color: var(--on-green); }
.rec-twin { margin-top: 6px; padding: 8px 10px; border-radius: 10px; background: var(--warn-tint); color: var(--warn); font-size: 13px; }
.rec-twin p { margin: 0; }
.rec-twin .ais-link-btn { min-height: 30px; padding: 0; color: inherit; text-decoration: underline; }
.rec-act { display: block; padding: 0; text-align: left; }
@media (min-width: 1024px) { .rec-act { min-height: 30px; } }
.rm-choice { margin: 16px 0 0; padding: 0; border: 0; min-width: 0; }
.rm-choice legend { padding: 0; font-weight: 600; }
.rm-choice .ais-check { display: flex; align-items: flex-start; padding: 10px 0 0; }
.rm-choice .ais-check input { flex: none; }
.rm-choice .ais-field { margin: 4px 0 0 28px; }
.rm-choice select { width: 100%; }
.rec-outside-notice { margin: 8px 0 20px; }
.rec-outside-flag { white-space: nowrap; }
#rec-other { scroll-margin-top: calc(var(--topbar) + var(--safe-top) + 16px); }
@media (min-width: 1024px) { #rec-other { scroll-margin-top: 16px; } }
/* Curriculum view: code and title in their own columns, totals underneath. */
.cur-code { width: 1%; white-space: nowrap; }
.cur-title { color: var(--ink); }
.cur-table tfoot :is(th, td) { padding: 8px 6px; border-top: 2px solid var(--ink); font-weight: 600; text-align: left; }
.cur-table tfoot .rec-num { text-align: right; }

/* The two views of a record: By Semester and Prospectus. */
.rec-views > .ais-segmented { margin-top: 0; }
.rec-views > .ais-notice + .ais-segmented { margin-top: 4px; }
.rec-view { margin-top: 20px; }
.ledger > .rec-views { padding-top: 12px; }
/* Inside a panel a semester's head is a plain rule over its table's columns. */
.ais-main .ledger > .rec-views .rec-sem > .ledger-head { margin-left: 0; margin-right: 0; padding-left: 10px; padding-right: 10px; }
.ais-main .ledger > .rec-views .rec-sem > .ledger-head h3 { padding-left: 0; margin-left: 0; }

/* Grades edited on the record (registrar): the box stands in a cell of its own,
   shown in place of the grade's cell while the page is editing. */
.rec-box, .rec-earlier, .rec-when, .rec-why { display: none; }
.is-editing .rec-box { display: table-cell; width: 1%; text-align: right; }
.is-editing tr:has(> .rec-box) > .rec-grade { display: none; }
.is-editing .rec-earlier { display: table-row; }
/* The remark is of the grade on record, not of the one being typed. */
.is-editing tr:has(.rec-input:is(.is-changed, .is-bad)) > .rec-remark { visibility: hidden; }
.rec-table .rec-earlier .rec-course { padding-left: 16px; }
.rec-input {
    width: 88px; min-height: 44px; padding: 6px 8px;
    border: 1px solid var(--field-line); border-radius: 10px; background: var(--ground);
    color: var(--ink); font: 700 16px/1.2 var(--font-mark); text-align: right; font-variant-numeric: tabular-nums;
}
.rec-input:focus-visible { border-color: var(--green-800); }
.rec-input.is-changed { border-color: var(--green-800); background: var(--green-tint); color: var(--green-800); }
.rec-input.is-bad { border-color: var(--hold); background: var(--hold-tint); color: var(--hold); }
.is-editing .rec-when { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 6px; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.rec-when select { min-height: 44px; max-width: 100%; padding: 4px 8px; border: 1px solid var(--field-line); border-radius: 10px; background: var(--ground); color: var(--ink); font: 400 16px/1.3 var(--font-read); }
.rec-when select:focus-visible { border-color: var(--green-800); }
.is-editing .rec-why:not(:empty) { display: block; margin-top: 4px; color: var(--hold); font-size: 13px; font-weight: 600; }
.rec-bar {
    position: sticky; z-index: 15; bottom: calc(var(--tabbar) + var(--safe-bottom));
    display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px;
    margin: 20px -16px 0; padding: 10px 16px; background: var(--ground); border-top: 1px solid var(--panel-line);
    box-shadow: 0 -6px 16px rgba(0, 31, 26, 0.10);
}
.rec-bar p { flex: 1 1 200px; margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.ais-dialog .rec-review { margin: 16px 0 0; padding: 0; list-style: none; max-height: 40vh; overflow-y: auto; border-top: 2px solid var(--ink); }
.rec-review li { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rec-review strong { display: block; font-weight: 600; }
.rec-review div > span { display: block; color: var(--ink-2); font-size: 13px; }
.rec-review div > .rec-review-note { color: var(--warn); font-weight: 600; }
.rec-review-move { flex: none; font: 700 15px/1.4 var(--font-mark); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rec-review-move > span:first-child { color: var(--ink-2); font-weight: 400; }
.rec-review-move i { font-size: 11px; color: var(--ink-2); }

@media (min-width: 768px) { .rec-bar { margin-left: -24px; margin-right: -24px; padding-left: 24px; padding-right: 24px; } }
@media (min-width: 1024px) {
    .rec-bar { bottom: var(--footbar); margin-left: -40px; margin-right: -40px; padding-left: 40px; padding-right: 40px; }
    .rec-input { min-height: 34px; padding: 4px 8px; font-size: 15px; }
    .rec-when select { min-height: 34px; font-size: 14px; }
    .rec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rec-table :is(th, td):first-child { padding-left: 10px; }
    .rec-table :is(th, td):last-child { padding-right: 10px; }
}

/* ---- Faculty Load and the faculty roster -------------------------------- */

.fl-badge { margin-left: 6px; padding: 1px 7px; border-radius: 9px; background: var(--warn-tint); color: var(--warn); font-size: 13px; }
.fl-program, .fl-year { max-width: 320px; margin-top: 16px; }
.ledger-row span.fl-gap { color: var(--hold); font-weight: 600; }
.fl-row { align-items: start; }
.ais-dialog.fl-dialog { width: min(720px, calc(100vw - 32px)); }
.fl-picker { position: relative; }
.fl-picker label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 14px; }
.fl-picker-row { display: flex; gap: 8px; }
.fl-picker-row input { flex: 1; min-width: 0; }
.fl-results {
    position: absolute; z-index: 5; top: 100%; left: 0; right: 0; margin: 4px 0 0; padding: 4px; list-style: none;
    border: 1px solid var(--line); border-radius: 10px; background: var(--ground); box-shadow: 0 8px 24px rgba(0, 31, 26, 0.16);
}
.fl-results button { display: block; width: 100%; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 8px; background: none; text-align: left; cursor: pointer; font: 15px/1.3 var(--font-read); color: var(--ink); }
.fl-results button:hover, .fl-results button:focus-visible { background: var(--ground-2); }
.fl-results button span { color: var(--ink-2); font-size: 13px; }
.fl-none { padding: 10px; color: var(--ink-2); font-size: 14px; }
.fl-note { display: block; margin-top: 6px; color: var(--warn); font-size: 13px; }
.fl-history { margin-top: 8px; max-height: 50vh; overflow-y: auto; }
.roster { margin-top: 20px; }
.roster-row { align-items: start; }
.roster-classes { margin: 6px 0; padding: 0; list-style: none; font-size: 14px; }
.roster-classes li { padding: 2px 0; font-variant-numeric: tabular-nums; }
.roster-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.roster-units { display: flex; gap: 16px; margin: 0; text-align: right; }
.roster-units dt { color: var(--ink-2); font-size: 12px; font-weight: 600; }
.roster-units dd { margin: 2px 0 0; font: 700 20px/1 var(--font-mark); font-variant-numeric: tabular-nums; }
.roster-open { margin-top: 12px; color: var(--warn); font-size: 14px; }

/* The shared Schedule Editor (static/js/schedule-editor.js) on the shell. It
   writes Bootstrap class names for the sidebar pages it also serves; here only
   its own se- hooks are styled, and the Bootstrap utilities it leans on. */
.se-host .d-none { display: none !important; }
.se-host .se-list { display: flex; flex-direction: column; gap: 8px; }
.se-host .se-empty { padding: 8px 0; color: var(--ink-2); font-size: 14px; }
.se-host .se-row {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center;
    padding: 10px 10px 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--green-700); border-radius: 10px; background: var(--ground);
}
.se-host .se-row.is-conflict { border-left-color: var(--hold); background: var(--hold-tint); }
.se-host .se-row-n { color: var(--ink-2); font-size: 13px; font-weight: 700; }
.se-host .se-row-days { display: flex; flex-wrap: wrap; gap: 4px; }
.se-host .se-row-days button {
    min-width: 40px; min-height: 40px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px;
    background: var(--ground); cursor: pointer; color: var(--ink); font: 700 13px/1 var(--font-read);
}
.se-host .se-row-days button.active { border-color: var(--fill); background: var(--fill); color: #fff; }
.se-host .se-row-time { grid-column: 2 / 3; display: flex; align-items: center; gap: 6px; }
.se-host .se-row-room { grid-column: 2 / 3; }
.se-host select, .se-host input[type="text"] {
    min-height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--ground);
    color: var(--ink); font: 15px/1 var(--font-read);
}
.se-host .se-row-time select { flex: 1; min-width: 0; }
.se-host .se-row-del { grid-column: 3; grid-row: 1; min-width: 44px; min-height: 44px; border: 0; background: none; cursor: pointer; color: var(--hold); }
.se-host .se-room-pair { display: flex; flex-wrap: wrap; gap: 6px; }
.se-host .ui-autocomplete { position: relative; flex: 1 1 160px; }
.se-host .ui-autocomplete input { width: 100%; }
.se-host .ui-autocomplete-menu {
    position: absolute; z-index: 6; left: 0; min-width: 100%; width: max(100%, 280px); max-height: 260px; overflow-y: auto; margin-top: 4px; padding: 4px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--ground); box-shadow: 0 8px 24px rgba(0, 31, 26, 0.16);
}
.se-host .list-group-item { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; text-align: left; cursor: pointer; font: 14px/1.3 var(--font-read); color: var(--ink); }
.se-host .list-group-item:hover { background: var(--ground-2); }
.se-host .list-group-item.disabled { cursor: default; color: var(--ink-2); }
.se-host .ui-autocomplete-sub { display: block; color: var(--ink-2); font-size: 12px; }
.se-host .se-ac-muted { color: var(--ink-2); }
.se-host .se-add {
    display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: 8px; padding: 0 14px;
    border: 1px dashed var(--green-700); border-radius: 10px; background: none; cursor: pointer; color: var(--green-700); font: 700 14px/1 var(--font-read);
}
.se-host .se-issues { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--warn-tint); color: var(--warn); font-size: 14px; }
.se-host .se-issues ul { margin: 4px 0 0; padding-left: 18px; }
.se-host .se-summary { margin-top: 8px; color: var(--ink-2); font-size: 14px; }
.se-host .se-summary:empty { display: none; }
.se-host .se-summary-text { color: var(--ink); font-weight: 600; }
.se-host .me-1 { margin-right: 4px; }
/* Stacked at every width (days, then times, then room): in a dialog the
   seven day toggles leave no room for the times beside them. */
.se-host .se-room-pair > * { flex: 1 1 160px; }
@media (min-width: 768px) {
    .se-host .se-row-time { max-width: 360px; }
}

/* ---- Clearance signatory (faculty) -------------------------------------- */

.sig-notice { margin-top: 12px; }
.sig-switch { max-width: 360px; }
.sig-acts { display: flex; gap: 8px; }
@media (max-width: 767.98px) {
    .sig-row { grid-template-columns: minmax(0, 1fr); }
    .sig-row .adv-side { flex-direction: row; align-items: center; justify-content: space-between; }
}
.sig-tools { border-bottom: 0; margin-top: 8px; }
.sig-tools form { display: inline; }
.ledger-row span.sig-remark { margin-top: 4px; padding-left: 10px; border-left: 3px solid var(--line); color: var(--ink); }
.ledger-row strong a { color: inherit; text-decoration: none; }
.ledger-row strong a:hover { color: var(--green-700); text-decoration: underline; }
.bl-find { margin-top: 8px; }
.bl-picked-title { margin-top: 16px; font-size: 16px; }
.bl-steps { margin: 8px 0; padding-left: 20px; font-size: 14px; display: grid; gap: 6px; }
.bl-import-rows { max-height: 40vh; overflow-y: auto; }

/* ---- Role Dashboard (faculty, head, dean, VPAA) ------------------------ */

/* Figures in ruled rows, not charts. */
.dash-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dash-scope { margin-top: 20px; font: 700 20px/1.2 var(--font-mark); }
.dash-block .record-facts { margin-top: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dash-block .ledger { margin-top: 24px; }
.ledger-head h3 { font-size: 18px; }
.dash-figure { font: 700 22px/1 var(--font-mark); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.ledger-row span.dash-figure { display: block; color: var(--ink); font-size: 22px; }
.dash-rank { text-align: right; }
.ledger-row .dash-rank span:not(.dash-figure) { margin-top: 4px; font-size: 13px; white-space: nowrap; }

@media (min-width: 1024px) {
    /* One line per student under column heads. */
    .grades-cols {
        display: grid; grid-template-columns: minmax(0, 1fr) 132px 132px 132px 88px; gap: 12px;
        padding: 12px 0 8px; border-bottom: 1px solid var(--line);
        color: var(--ink-2); font-size: 13px; font-weight: 700;
    }
    .grade-row-inner { grid-template-columns: minmax(0, 1fr) 132px 132px 132px 88px; gap: 12px; align-items: start; padding: 10px 0; }
    .grade-who { grid-column: auto; padding-top: 10px; }
    /* Up to 1279px a sixth column would crush the names: the stamp stays under
       the name, in the Student column, and may take two lines. */
    .grades-cols-eval { display: none; }
    .grade-eval { grid-column: 1; grid-row: 2; margin-top: -4px; }
    .grade-eval .stamp { max-width: 100%; white-space: normal; text-align: center; }
    .grade-cell .grade-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    /* INC and History share the line under the field. */
    .grade-edit { grid-template-columns: auto auto; justify-content: space-between; column-gap: 8px; }
    .grade-edit input[type="number"] { grid-column: 1 / -1; }
    .grade-save { grid-column: auto; padding-top: 0; }
    .grade-save .ais-btn { width: 100%; padding: 0 12px; }
}
@media (min-width: 1280px) {
    /* Evaluation gets its own column, wide enough for "Not yet evaluated" on one
       line, centred on the 44px grade fields. */
    .grades-cols, .grade-row-inner { grid-template-columns: minmax(0, 1fr) 164px 132px 132px 132px 88px; }
    .grades-cols-eval { display: block; }
    .grade-eval { grid-column: auto; grid-row: auto; margin-top: 0; min-height: 44px; display: flex; align-items: center; }
    .grade-eval .stamp { white-space: nowrap; }
}

/* ---- Desktop: the rail ------------------------------------------------- */

@media (min-width: 1024px) {
    body.ais { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); }
    .ais-topbar, .ais-tabbar, .ais-sheet.is-phone { display: none !important; }

    /* The notification panel becomes a drawer from the right. */
    .ais-notif {
        left: auto; top: 0; right: 0; bottom: 0;
        width: 400px; max-height: none;
        padding: 20px 16px;
        border-radius: 0;
        box-shadow: -8px 0 32px rgba(0, 31, 26, 0.18);
    }
    .ais-notif::before { display: none; }
    .ais-notif.is-off { transform: translateX(100%); }
    .ais-headbar .ais-bell { color: var(--ink-2); }
    .ais-headbar .ais-bell:hover { background: var(--ground-2); color: var(--ink); }

    .ais-rail {
        position: sticky; top: 0;
        display: flex; flex-direction: column;
        height: 100dvh; overflow-y: auto;
        padding: 20px 12px 12px;
        background: var(--chrome);
        color: var(--on-green);
        scrollbar-color: var(--green-600) transparent;
    }
    .ais-rail-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 20px; color: var(--on-green); text-decoration: none; }
    .ais .ais-rail-brand { color: var(--on-green); }
    .ais-rail-brand img { border-radius: 50%; background: var(--disc); }
    .ais-rail-brand strong { display: block; font: 700 20px/1 var(--font-mark); letter-spacing: 0.02em; }
    .ais-rail-brand small { display: block; margin-top: 4px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; color: var(--on-green-2); }

    .ais-rail-nav { flex: 1; }
    .ais-rail-nav ul { display: grid; gap: 2px; }
    .ais-rail-more { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.14); }
    .ais-rail-nav a {
        display: flex; align-items: center; gap: 12px;
        min-height: 42px; padding: 0 12px; border-radius: 10px;
        color: var(--on-green-2); text-decoration: none; font-weight: 600; font-size: 15px;
        transition: background-color 160ms ease, color 160ms ease;
    }
    .ais .ais-rail-nav a { color: var(--on-green-2); }
    .ais-rail-nav i { width: 20px; text-align: center; font-size: 15px; }
    .ais .ais-rail-nav a:hover { background: rgba(255,255,255,0.08); color: var(--on-green); }
    .ais .ais-rail-nav a[aria-current="page"] { background: var(--chrome-deep); color: var(--on-green); font-weight: 700; }
    .ais-rail-nav a[aria-current="page"] i { color: var(--gold); }
    .ais-rail-nav .ais-nav-group {
        padding: 16px 12px 6px; color: var(--on-green-2); opacity: 0.85;
        font: 700 11px/1 var(--font-read); letter-spacing: 0.08em; text-transform: uppercase;
    }
    .ais-rail-nav .ais-nav-badge { background: var(--gold); color: var(--on-gold); }
    /* A grouped list (admin) reads as one list; its headings do the dividing. */
    .ais-rail-more.is-grouped { margin-top: 2px; padding-top: 0; border-top: 0; }

    .ais-rail-user { display: flex; align-items: center; gap: 4px; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.14); }
    .ais-rail-account { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; text-decoration: none; }
    .ais .ais-rail-account { color: var(--on-green); }
    .ais-rail-account:hover { background: rgba(255,255,255,0.08); }
    .ais-rail-account i { font-size: 26px; color: var(--on-green-2); }
    .ais-rail-account span { min-width: 0; font-weight: 600; font-size: 14px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .ais-rail-account small { display: block; font-weight: 400; color: var(--on-green-2); font-size: 12px; }
    .ais-rail-logout { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 10px; background: none; color: var(--on-green-2); cursor: pointer; font-size: 16px; }
    .ais-rail-logout:hover { background: rgba(255,255,255,0.08); color: var(--on-green); }

    .ais-main { width: 100%; max-width: 1180px; padding: 32px 40px 48px; }
    .home-head { margin: 0 0 28px; padding: 0; background: none; color: var(--ink); }
    .home-head h1 { font-size: 32px; }
    .page-head h1 { font-size: 32px; }
    .home-who { color: var(--ink-2); }
    .home-grid { gap: 48px; }
}

.adv-filter-acts .ais-link-btn { display: inline-flex; align-items: center; }

/* ---- Workload (program head, dean, VPAA) -------------------------------- */

.wl-form { margin-top: 16px; }
.wl-form-acts { margin-top: 16px; }
.wl-items { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.wl-items h3 { font-size: 16px; }
.wl-items h3 small { display: block; margin-top: 2px; color: var(--ink-2); font: 400 13px/1.3 var(--font-read); }
.wl-item { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 12px; align-items: end; padding: 8px 0; border-bottom: 1px solid var(--line); }
.wl-history { margin-top: 16px; }
.ledger-row span.wl-flag { margin-top: 4px; font-size: 13px; color: var(--ink); }
.wl-group { margin-top: 16px; }
.wl-groupbox { margin-top: 12px; }
.wl-gap-title { color: var(--hold); }
.wl-acts { margin-top: 12px; flex-wrap: wrap; }
.wl-viewbar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; margin-top: 16px; }
.wl-viewbar .ais-segmented { margin: 0; }
.wl-sep { margin-top: 28px; font-size: 18px; color: var(--ink-2); }
.ws-search { min-width: 220px; margin: 0; }
.wl-current { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.wl-current strong { display: block; font-weight: 600; }
.wl-current span:not(.stamp) { display: block; color: var(--ink-2); font-size: 14px; }
.wl-current .sig-acts { grid-column: 1 / -1; }
.wl-yearrow { align-items: center; }
.wl-curr { margin-top: 6px; min-height: 40px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--ground); font: 14px/1 var(--font-read); color: var(--ink); }
.wl-stepper { display: flex; align-items: center; gap: 8px; }
.wl-stepper .ais-btn { min-width: 44px; padding: 0; justify-content: center; }
.wl-stepper b { min-width: 24px; text-align: center; font: 700 18px/1 var(--font-mark); font-variant-numeric: tabular-nums; }
.wo-count { background: var(--ground-2); color: var(--ink-2); }
.wo-dissolved strong { color: var(--ink-2); text-decoration: line-through; }
.wo-cap { max-width: 180px; }
.wo-pick { cursor: pointer; }
.wo-pick input { width: 20px; height: 20px; accent-color: var(--green-700); }
@media (min-width: 768px) {
    .wl-item { grid-template-columns: 160px minmax(0, 1fr) minmax(0, 1.4fr) auto; }
    .wl-current { grid-template-columns: minmax(0, 1fr) auto auto; }
    .wl-current .sig-acts { grid-column: auto; }
}

/* ---- Registrar: Student Enrollment (phase 4) ---------------------------- */

.re-ran { margin-top: 16px; }
.ais-dialog.re-dialog { width: min(640px, calc(100vw - 32px)); }
.re-dialog .ais-segmented { justify-self: start; }
.re-warn { color: var(--warn) !important; font-weight: 600; }
.re-found { margin-top: 4px; }
.re-picked { margin-top: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--ground-2); }
.re-picked-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.re-picked-head strong { display: block; font-weight: 600; }
.re-picked-head span { display: block; color: var(--ink-2); font-size: 14px; }
.re-picked .record-facts { margin-top: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.re-picked .record-facts div:first-child { grid-column: 1 / -1; }
.re-section { margin-top: 16px; }
.re-already { margin-top: 16px; flex-wrap: wrap; }
.re-already > span > span { display: block; font-size: 14px; }
.re-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 12px; }
.re-result { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.re-mode { color: var(--ink-2); font-size: 14px; }
.re-result .record-tally { margin-top: 8px; }
.re-result .record-tally div { background: var(--ground-2); color: var(--ink); }
.re-result .record-tally div.is-clear { background: var(--clear-tint); color: var(--clear); }
.re-result .record-tally div.is-pending { background: var(--pending-tint); color: var(--pending); }
.re-result .record-tally div.is-hold { background: var(--hold-tint); color: var(--hold); }
.re-sub { margin-top: 16px; font-size: 15px; }
.re-scroll { max-height: 240px; overflow-y: auto; }
.re-dialog .ais-notice { margin-top: 12px; }
.re-guide { margin: 12px 0; font-size: 14px; }
.re-guide summary { cursor: pointer; font-weight: 600; color: var(--green-700); min-height: 32px; }
.re-guide ul { padding-left: 20px; display: grid; gap: 4px; margin: 8px 0; }
.re-example { overflow-x: auto; padding: 10px 12px; border-radius: 8px; background: var(--ground-2); font-size: 12px; line-height: 1.5; }
.re-extra { display: none; }
.re-extra.is-open { display: contents; }
@media (min-width: 576px) { .re-pair { grid-template-columns: 1fr 2fr; } }
@media (min-width: 768px) {
    .re-filters .adv-filter-acts .re-more-btn { display: none; }
    .re-extra { display: contents; }
}

/* ---- Shared back-office pages (phase 4) ---- */

.ais-dialog.tk-dialog { width: min(600px, calc(100vw - 32px)); }
.tk-subject { margin-top: 4px !important; color: var(--ink) !important; font-weight: 600; font-size: 17px; }
.tk-dialog .record-facts { margin-top: 12px; }
.tk-sub { margin-top: 16px; font-size: 15px; }
.tk-desc { white-space: pre-wrap; overflow-wrap: anywhere; }
.tk-saved { color: var(--clear) !important; font-weight: 600; }
.tk-acts .tk-gap { flex: 1; }
.cal-admin { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cal-admin form { display: inline; }
.cal-years { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }

/* ---- finance (phase 4) -------------------------------------------------- */
/* Cashier and billing pages (finance/templates/finance/). Prefix fin-. */

/* fin: cashier */
/* Payment, the Payment desk and Other Collections. Every rule is scoped to the
   page root (.fin-cash). */
.fin-cash .fin-notice { margin-top: 12px; }
.fin-cash .record-tally { margin-top: 12px; }
.fin-cash .record-tally dd { white-space: nowrap; }
.fin-cash .ledger-row span.fee-amount { color: var(--ink); font-size: 16px; }
.fin-cash .fin-mono { font-variant-numeric: tabular-nums; }
.fin-cash .fin-help, .fin-cash .fin-search-acts small { display: block; margin-top: 6px; color: var(--ink-2); font-size: 13px; }
.fin-cash .fin-req { color: var(--hold); font-weight: 700; }
.fin-cash .fin-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fin-cash .fin-block { display: block; margin: 4px 0; }
.fin-cash .fin-row-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; margin-top: 4px; }
.fin-cash .fin-row-acts .ais-link-btn { display: inline-flex; align-items: center; gap: 6px; padding: 0; text-decoration: none; }
.fin-cash .fin-row-acts .ais-link-btn i { font-size: 12px; }
.fin-cash .fin-dialog-figure { font: 700 26px/1.2 var(--font-mark); color: var(--ink) !important; font-variant-numeric: tabular-nums; }

/* The student search (_student_search_ais.html). */
.fin-cash .fin-search-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 12px; }
.fin-cash .fin-search-fields .ais-field { margin-top: 12px; }
.fin-cash .fin-search-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.fin-cash .fin-search-acts small { flex: 1 1 100%; margin: 0; }
.fin-cash .fin-search-rows { margin-top: 8px; }

/* The desk: the queue. */
.fin-cash .fin-head-term { color: var(--ink-2); font: 600 14px/1.3 var(--font-read); }
.fin-cash .fin-queue-row { align-items: start; }
.fin-cash .fin-queue-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.fin-cash .fin-queue-side .fin-row-acts { justify-content: flex-end; }

/* Payment and Other Collections: the form beside the record from 1024px. */
.fin-cash .fin-facts { margin-top: 4px; }
.fin-cash .fin-pay-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 40px; }
.fin-cash .fin-take .ais-field { margin-top: 14px; }
.fin-cash .fin-due { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.fin-cash .fin-due-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-weight: 600; }
.fin-cash .fin-due-total { font: 700 20px/1.2 var(--font-mark); font-variant-numeric: tabular-nums; }
.fin-cash .fin-due-lines { margin: 6px 0 0; padding: 0; list-style: none; color: var(--ink-2); font-size: 14px; }
.fin-cash .fin-due-lines li, .fin-cash .fin-split div { display: flex; justify-content: space-between; gap: 12px; }
.fin-cash .fin-due-lines .fee-amount, .fin-cash .fin-split .fee-amount { font-size: 14px; }
.fin-cash .fin-due-note { margin-top: 4px; color: var(--ink-2); font-size: 14px; }
.fin-cash .fin-peso { display: flex; align-items: center; gap: 8px; }
.fin-cash .fin-peso b { color: var(--ink-2); font: 700 18px/1 var(--font-mark); }
.fin-cash .fin-peso input { flex: 1; min-width: 0; font-variant-numeric: tabular-nums; }
.fin-cash .fin-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.fin-cash .fin-quick .ais-btn { padding: 0 12px; font-size: 14px; font-variant-numeric: tabular-nums; }
.fin-cash .fin-split { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--ground-2); font-size: 14px; }
.fin-cash .fin-split strong { display: block; margin-bottom: 4px; }
.fin-cash .fin-split-extra { margin-top: 4px; color: var(--warn); font-weight: 600; }
.fin-cash .fin-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 12px; }
.fin-cash .fin-more { margin-top: 16px; border: 1px solid var(--line); border-radius: 10px; }
.fin-cash .fin-more-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
    min-height: 48px; padding: 8px 14px; border: 0; border-radius: 10px; background: none; cursor: pointer;
    color: var(--ink); font: 400 15px/1.3 var(--font-read); text-align: left;
}
.fin-cash .fin-more-head small { display: block; color: var(--ink-2); font-size: 13px; }
.fin-cash .fin-more-head i { color: var(--ink-2); transition: transform 200ms var(--ease-out); }
.fin-cash .fin-more-head[aria-expanded="true"] i { transform: rotate(180deg); }
.fin-cash .fin-more-body { padding: 0 14px 14px; border-top: 1px solid var(--line); }
.fin-cash .fin-warn { color: var(--warn); font-weight: 600; }
.fin-cash .fin-post { width: 100%; margin-top: 20px; }
.fin-cash .fin-or-row, .fin-cash .fin-soa-row { align-items: start; }
.fin-cash .fin-or-row.is-voided strong, .fin-cash .fin-or-row.is-voided span.fee-amount { color: var(--ink-2); }
.fin-cash .fin-soa-row.is-reversed strong, .fin-cash .fin-soa-row.is-reversed span.fee-amount { color: var(--ink-2); text-decoration: line-through; text-decoration-thickness: 1px; }
.fin-cash .ledger-row span.fin-move { font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fin-cash .ledger-row span.fin-move.is-credit { color: var(--clear); }

/* Other Collections. */
.fin-cash .fin-payor { margin: 16px 0 0; }
.fin-cash .fin-chosen { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--ground-2); }
.fin-cash .fin-chosen strong { display: block; font-weight: 600; }
.fin-cash .fin-chosen span { display: block; color: var(--ink-2); font-size: 14px; }
.fin-cash .fin-picker { margin-top: 4px; }
.fin-cash .fin-lines-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.fin-cash .fin-lines-head h3 { font-size: 17px; }
.fin-cash .fin-lines { margin: 0; padding: 0; list-style: none; }
.fin-cash .fin-line {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; gap: 0 10px; align-items: end;
    padding: 4px 0 12px; border-bottom: 1px solid var(--line);
}
.fin-cash .fin-line .ais-field { margin-top: 10px; }
.fin-cash .fin-line .ais-field > span { font-size: 14px; }
.fin-cash .fin-line-fee { grid-column: 1 / -1; }
.fin-cash .fin-line .fin-num { text-align: right; }
.fin-cash .fin-line-amount { grid-column: 1 / 3; display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; color: var(--ink-2); font-size: 14px; }
.fin-cash .fin-line-remove { grid-column: 3; grid-row: 2; color: var(--hold); }
.fin-cash .fin-total { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0; border-bottom: 2px solid var(--ink); font: 700 18px/1.2 var(--font-mark); }
.fin-cash .fin-total .fee-amount { font: inherit; font-variant-numeric: tabular-nums; }
@media (min-width: 576px) {
    .fin-cash .fin-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fin-cash .fin-pair.fin-or { grid-template-columns: 7fr 5fr; }
}
@media (min-width: 768px) {
    .fin-cash .fin-search-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .fin-cash .fin-search-acts small { flex: 1 1 auto; }
    .fin-cash .fin-line { grid-template-columns: minmax(0, 1fr) 76px 120px 110px 44px; }
    .fin-cash .fin-line-fee { grid-column: auto; }
    .fin-cash .fin-line-amount { grid-column: auto; display: block; margin: 0; padding-bottom: 12px; text-align: right; }
    .fin-cash .fin-line-amount span { display: none; }
    .fin-cash .fin-line-remove { grid-column: auto; grid-row: auto; }
}
@media (min-width: 1024px) {
    .fin-cash .fin-pay-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; }
    .fin-cash.fin-other .fin-pay-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
}
.fin-cash .fin-facts .fin-wide { grid-column: 1 / -1; }
@media (min-width: 768px) { .fin-cash .fin-facts .fin-wide { grid-column: span 2; } }
.fin-cash .fin-search-rows strong span { display: inline; color: var(--ink); font-size: 16px; }
/* fin: cashier end */

/* fin: office */
/* OR Management, Account Holds, Finance Reports, Sponsors, Sponsor Remittances.
   Every rule is scoped to the page root (.fin-office). */
.fin-office .fin-notice { margin-top: 12px; }
.fin-office .fin-row { align-items: start; }
.fin-office .fin-row.is-voided strong, .fin-office .fin-row.is-voided .fee-amount { color: var(--ink-2); }
.fin-office .fin-row.is-picked { background: var(--green-tint); box-shadow: -8px 0 0 var(--green-tint), 8px 0 0 var(--green-tint); }
.fin-office .fin-or { font-variant-numeric: tabular-nums; }
.fin-office .ledger-row span.fin-tag, .fin-office .ledger-row span.fin-inline { display: inline-block; }
.fin-office .ledger-row span.fin-tag { margin-left: 6px; vertical-align: 1px; background: var(--warn-tint); color: var(--warn); }
.fin-office .ledger-row span.fin-side-label { font-size: 12px; }
/* A row's actions sit under both columns, so they wrap across the full width. */
.fin-office .fin-acts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0 16px; margin-top: -6px; }
.fin-office .fin-acts .ais-link-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0; text-decoration: none; }
.fin-office .ledger-head + .cur-key { margin-top: 8px; }
.fin-office .fin-acts .ais-link-btn i { font-size: 12px; }
.fin-office .fin-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 12px; }
.fin-office .fin-upper { text-transform: uppercase; }
.fin-office .fin-changes { margin: 6px 0 4px; padding-left: 18px; font-size: 14px; }
.fin-office .fin-changes s { color: var(--ink-2); }
.fin-office .ledger-row .fin-changes span { display: inline; color: var(--ink); font-size: 14px; }
.fin-office .fin-rev { grid-template-columns: minmax(0, 1fr); }
.fin-office .fin-wide { width: min(640px, calc(100vw - 32px)); }
.fin-office .fin-first { margin-top: 20px; }
.fin-office .fin-block { width: 100%; }
.fin-office .fin-scope { color: var(--ink-2); font: 600 14px/1.3 var(--font-read); }
.fin-office .record-tally div.is-clear { background: var(--clear-tint); color: var(--clear); }
/* A sum that is no decision (total held, a report's totals) stays on Desk Grey. */
.fin-office .record-tally div.is-sum { background: var(--ground-2); color: var(--ink); }
.fin-office .page-head p { max-width: 75ch; }
/* A report is a table of figures: it scrolls sideways in its own box, never the page. */
.fin-office .fin-table-wrap { overflow-x: auto; margin-top: 4px; }
.fin-office .fin-table-wrap:focus-visible { outline: 3px solid var(--green-800); outline-offset: 2px; }
.fin-office .fin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.fin-office .fin-table th { padding: 10px 12px 8px 0; border-bottom: 1px solid var(--ink); text-align: left; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.fin-office .fin-table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
.fin-office .fin-table .is-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fin-office .fin-table .is-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.fin-office .fin-table th:last-child, .fin-office .fin-table td:last-child { padding-right: 0; }
@media (min-width: 576px) {
    .fin-office .fin-pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .fin-office .fin-pair.is-code { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
}
@media (min-width: 1024px) {
    .fin-office .fin-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px; align-items: start; }
}
/* fin: office end */

/* fin: assessments */
.fin-asmt .fin-back { margin: -8px 0 4px; }
.fin-asmt .fin-subhead { margin-top: 24px; font-size: 17px; }
.fin-asmt .fin-find { margin-top: 8px; }
.fin-asmt .fin-find-form { margin-top: 0; }
.fin-asmt .fin-find-form, .fin-asmt .fin-run-form { grid-template-columns: minmax(0, 1fr); }
.fin-asmt .fin-results { margin-top: 8px; border-top: 2px solid var(--ink); }
.fin-asmt .fin-results a.ledger-row:hover strong { color: var(--green-700); }
.fin-asmt .fin-row-link { display: inline-flex; align-items: center; text-decoration: none; }
.fin-asmt .fin-tools { border-bottom: 0; padding-bottom: 0; }
.fin-asmt .fin-totals { margin-top: 20px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fin-asmt .fin-totals dd { font: 700 18px/1.2 var(--font-mark); }
.fin-asmt .fin-amounts { text-align: right; }
.fin-asmt .ledger-row .fin-amounts span.fin-balance { margin-top: 4px; color: var(--ink); font: 600 16px/1.2 var(--font-read); }
.fin-asmt .ledger-row .fin-amounts span.fin-of { font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fin-asmt .fin-notice { margin-top: 4px; font-size: 15px; }
.fin-asmt .fin-run-form .adv-filter-acts { padding-top: 16px; flex-wrap: wrap; }
.fin-asmt .fin-tally-plain { background: var(--ground-2) !important; color: var(--ink) !important; }
.fin-asmt .fin-notices { margin: 16px 0 0; }
.fin-asmt .fin-notices .ais-notice strong { display: block; }
.fin-asmt .fin-quote { display: block; margin-top: 4px; padding-left: 10px; border-left: 3px solid currentColor; overflow-wrap: anywhere; }
.fin-asmt .fin-list { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 2px; }
.fin-asmt .fin-list.fin-plain { margin: 0; padding-left: 0; list-style: none; }
.fin-asmt .fin-fix { margin-top: 8px; }
.fin-asmt .fin-help { margin-top: 4px; }
.fin-asmt .fin-checks { margin: 4px 0 0; padding: 0; list-style: none; }
.fin-asmt .fin-checks .adv-tag { margin-left: 4px; }
.fin-asmt .fin-ref { display: block; margin: -6px 0 6px 28px; color: var(--ink-2); font-size: 13px; }
.fin-asmt .fin-drift { margin-top: 8px; }
.fin-asmt .fin-optional { margin-top: 8px; border-top: 1px solid var(--line); }
.fin-asmt .fin-optional .ledger-row { padding: 2px 0; }
.fin-asmt .fin-confirm { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.fin-asmt .fin-confirm > div { flex: 1 1 260px; }
.fin-asmt .ledger-count.fin-ok { color: var(--clear); }
.fin-asmt .ledger-count.fin-warn { color: var(--warn); }
.fin-asmt .fin-unit { padding: 14px 0; border-bottom: 1px solid var(--line); }
.fin-asmt .fin-unit strong { display: block; font-weight: 600; }
.fin-asmt .fin-unit-name { display: block; color: var(--ink-2); font-size: 14px; }
.fin-asmt .fin-unit-why { margin-top: 6px; color: var(--ink-2); font-size: 14px; }
.fin-asmt .fin-cands { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.fin-asmt .fin-cand small { color: var(--ink-2); font-weight: 600; }
.fin-asmt .fin-unit-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; align-items: end; }
.fin-asmt .fin-unit-form .ais-btn { grid-column: 1 / -1; margin-top: 12px; justify-self: start; }
.fin-asmt .fin-actions { border-bottom: 0; }
.fin-asmt .fin-btnrow { display: flex; flex-wrap: wrap; gap: 8px; }
.fin-asmt .fin-held { margin-top: 0; }
.fin-asmt .fin-meta { margin-top: 4px; }
.fin-asmt .fin-ask-detail { color: var(--ink) !important; font: 700 18px/1.2 var(--font-mark); font-variant-numeric: tabular-nums; }
@media (min-width: 768px) {
    .fin-asmt .fin-find-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
    .fin-asmt .fin-run-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .fin-asmt .fin-run-form .adv-filter-acts { grid-column: 1 / -1; }
    .fin-asmt .fin-unit-form { grid-template-columns: 140px 140px auto; }
    .fin-asmt .fin-unit-form .ais-btn { grid-column: auto; margin-top: 0; margin-bottom: 0; }
}
/* fin: assessments end */

/* fin: fees */
/* Fees Management, Fee Schedules, a schedule, Special Tags, FHE Billing (fin-fs-). */
.fin-fs-row { align-items: start; }
.fin-fs-row.is-dim strong { color: var(--ink-2); }
/* Spans inside a row's name or detail line run inline, not as their own lines. */
.fin-fs-row strong span:not(.stamp):not(.adv-tag) { display: inline; color: inherit; font-size: inherit; }
.ledger-row span.fin-fs-inline, .ledger-row span.fin-fs-programme { display: inline; }
.ledger-row span.fin-fs-programme.is-all { font-style: italic; }
.fin-fs-code { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.fin-fs-row strong .fin-fs-name { font-weight: 400; }
.fin-fs-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0 4px; }
.fin-fs-acts .ais-link-btn.is-danger { padding: 0 8px; }
.fin-fs-upper { text-transform: uppercase; }
.fin-fs-pair, .fin-fs-trio { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 12px; }
.fin-fs-group { margin: 16px 0 0; padding: 4px 0 0; border: 0; border-top: 1px solid var(--line); }
.fin-fs-group legend { padding: 12px 0 4px; font-weight: 600; }
.fin-fs-group legend small { color: var(--ink-2); font-weight: 400; font-size: 13px; }
.fin-fs-group .ais-check { display: flex; }
.fin-fs-help { margin: 4px 0 0; color: var(--ink-2); font-size: 13px; }
.ais-dialog p.fin-fs-help { margin-top: 4px; font-size: 13px; }
.ais-dialog p.fin-fs-detail { color: var(--ink); font-weight: 600; }
.fin-fs-dialog { width: min(640px, calc(100vw - 32px)); }
.fin-fs-dialog form > .ais-check { margin-top: 12px; }
.fin-fs-notice { margin-top: 12px; }
.fin-fs-notice strong { color: inherit; }
.fin-fs-list { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 2px; }
.fin-fs-import-rows { max-height: 260px; overflow-y: auto; margin-top: 12px; border-top: 2px solid var(--ink); }
.fin-fs-back { margin: -8px 0 4px; }
.fin-fs-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.fin-fs-head h1 { overflow-wrap: anywhere; }
.fin-fs-head .stamp { flex: none; margin-top: 6px; }
.fin-fs-counts { margin-top: 12px; font-size: 15px; }
.ais-dialog .fin-fs-counts p { color: var(--ink); }
.ais-dialog .fin-fs-counts p + p { margin-top: 6px; }
.fin-fs-sub { margin-top: 8px !important; color: inherit !important; }
.fin-fs-progress { margin-top: 16px; }
.fin-fs-bar { height: 10px; border-radius: 5px; background: var(--ground-2); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.fin-fs-bar span { display: block; height: 100%; background: var(--green-700); transition: width 320ms var(--ease-out); }
.fin-fs-progress p { margin-top: 6px; color: var(--ink-2); font-size: 14px; font-variant-numeric: tabular-nums; }
.fin-fs-progress-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; }
.fin-fs-pct { display: block; color: var(--ink-2); font-size: 13px; text-align: right; }
.fin-fs-pct b { display: block; font: 700 22px/1 var(--font-mark); color: var(--green-800); font-variant-numeric: tabular-nums; }
.ledger-row span.fin-fs-links a { font-weight: 600; }
.fin-fs-tag { margin-left: 4px; vertical-align: 1px; }
.fin-fs-retired { margin-top: 32px; }
.fin-fs-retired summary { border-bottom-width: 1px; border-color: var(--line); }
.fin-fs-retired .record-term-name { font-size: 17px; color: var(--ink-2); }
.fin-fs-effect { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fin-fs-effect legend, .fin-fs-effect .fin-fs-help { grid-column: 1 / -1; }
.fin-fs-choice { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; padding: 10px 12px; border: 1px solid var(--field-line); border-radius: 10px; cursor: pointer; }
.fin-fs-choice:has(input:checked) { border-color: var(--green-800); background: var(--green-tint); }
.fin-fs-choice:has(input:disabled) { cursor: not-allowed; opacity: 0.7; }
.fin-fs-choice input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--green-700); }
.fin-fs-choice b { display: block; font-weight: 700; }
.fin-fs-choice small { display: block; color: var(--ink-2); font-size: 13px; }
.fin-fs-more { margin-top: 16px; }
.fin-fs-more summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--green-700); font-weight: 700; font-size: 14px; }
.fin-fs-para { margin: 12px 0; color: var(--ink-2); font-size: 15px; max-width: 70ch; }
.fin-fs-para code, .fin-fs-dialog code { font-size: 13px; overflow-wrap: anywhere; }
.fin-fs-signatories { margin-top: 20px; }
.fin-fs-name-field { max-width: 480px; }
.fin-fs-tools { border-bottom: 0; }
.fin-fs-result { margin-top: 12px; }
.fin-fs-result p { margin-top: 8px; color: var(--ink-2); font-size: 14px; }
.fin-fs-warn { color: var(--warn) !important; font-weight: 600; }
@media (min-width: 576px) {
    .fin-fs-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fin-fs-trio { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 768px) {
    .fin-fs-fhe-form { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.4fr) minmax(0, 1fr) auto; }
}
.ledger-row span.fin-fs-amt { color: var(--ink); font: 600 16px/1.2 var(--font-read); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger-row.fee-total span.fin-fs-amt { font: 700 18px/1.2 var(--font-mark); }
.fin-fs-row strong span.adv-tag { display: inline-block; font-size: 13px; color: var(--ink-2); }
@media (max-width: 767.98px) {
    .fin-fs-stack { grid-template-columns: minmax(0, 1fr); }
    .fin-fs-stack .adv-side { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
    .fin-fs-stack .fin-fs-pct { text-align: left; }
    .fin-fs-stack .fin-fs-pct b { display: inline; margin-right: 4px; }
}
/* fin: fees end */

/* ---- regstudent (phase 4) ---------------------------------------------- */
/* Registrar: the per-student enrollment page (registrar/enrollments_student.html). */

.rs-back { margin-bottom: 4px; }
.rs-back i { font-size: 12px; }
.rs-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.rs-head > div { min-width: 0; }
.rs-head h1 { overflow-wrap: anywhere; }
.rs-head .stamp { flex: none; margin-top: 6px; }
.rs-banners { display: grid; gap: 8px; margin-bottom: 16px; }
.rs-banners .ais-notice { flex-wrap: wrap; }
.rs-by { display: block; margin-top: 4px; font-size: 13px; opacity: 0.9; }
.rs-facts { margin-top: 4px; }
.rs-facts dt { display: flex; align-items: center; gap: 2px; min-height: 24px; }
.rs-facts .stamp { margin-top: 4px; }
.rs-pencil {
    display: inline-grid; place-items: center; width: 44px; height: 44px; margin: -10px 0;
    border: 0; border-radius: 10px; background: none; cursor: pointer; color: var(--green-700); font-size: 13px;
}
.rs-pencil:hover { background: var(--ground-2); }
.rs-assess { margin-top: 12px; }

.rs-action { grid-template-columns: minmax(0, 1fr); }
.rs-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.rs-acts .ais-btn { min-height: 44px; }
.ais-btn.is-quiet.rs-danger { color: var(--hold); }
.ledger-row strong.rs-hold { color: var(--hold); }
.ledger-row span.rs-warn { color: var(--warn); font-weight: 600; }

.rs-tools { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rs-row-acts { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 2px; }
.rs-row-acts .ais-link-btn { min-height: 44px; padding: 0; }
.rs-row-acts .ais-link-btn.is-danger { color: var(--hold); }
.ledger-row span.rs-blocked { font-size: 13px; color: var(--ink-2); font-style: italic; }
.rs-inline-notice { margin-top: 12px; }
.rs-course { align-items: start; }
.rs-course-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; padding-top: 2px; }
.ledger-row span.rs-units { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger-row span.rs-units.is-dim { color: var(--ink-2); font-weight: 400; }
.rs-total { border-top: 2px solid var(--ink); border-bottom: 0; }
.rs-total-figure { font: 700 18px/1.2 var(--font-mark); font-variant-numeric: tabular-nums; }

.rs-dialog { width: min(600px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; }
.rs-dialog fieldset { margin: 16px 0 0; padding: 0; border: 0; min-width: 0; }
.rs-dialog legend { padding: 0; margin-bottom: 6px; font-weight: 600; }
.rs-dialog .ais-notice { margin-top: 12px; }
.rs-ink { color: var(--ink); }
.rs-list { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 2px; font-size: 14px; }
.rs-quote { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--ground-2); }
.rs-quote strong { display: block; font-weight: 600; }
.rs-quote span { display: block; color: var(--ink-2); font-size: 14px; }
.rs-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 12px; }
.rs-picked { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--ground-2); }
.rs-picked > div { min-width: 0; }
.rs-picked span { display: block; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.rs-picked strong { display: block; font-weight: 600; overflow-wrap: anywhere; }
.rs-results { margin-top: 4px; max-height: 260px; overflow-y: auto; }
.rs-result {
    display: block; width: 100%; min-height: 44px; padding: 10px 4px;
    border: 0; border-bottom: 1px solid var(--line); background: none; cursor: pointer; text-align: left; color: var(--ink); font: inherit;
}
.rs-result:hover { background: var(--ground-2); }
.rs-result strong { display: block; font-weight: 600; }
.rs-result span { display: block; color: var(--ink-2); font-size: 14px; }
.rs-choices { display: grid; gap: 8px; }
.rs-choice {
    display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: start; gap: 12px;
    padding: 10px 12px; border: 1px solid var(--field-line); border-radius: 10px; cursor: pointer;
}
.rs-choice:has(input:checked) { border: 2px solid var(--green-800); padding: 9px 11px; background: var(--green-tint); }
.rs-choice.is-full { cursor: not-allowed; opacity: 0.6; }
.rs-choice input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--green-800); }
.rs-choice-main { min-width: 0; }
.rs-choice-main strong { display: block; font-weight: 600; }
.rs-choice-main > span { display: block; color: var(--ink-2); font-size: 14px; }
.rs-choice .class-slots { margin-top: 4px; }
.rs-seats { display: flex; flex-direction: column; align-items: flex-end; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rs-seats b { font: 700 15px/1.2 var(--font-mark); }
.rs-seats.is-clear { color: var(--clear); }
.rs-seats.is-warn { color: var(--warn); }
.rs-seats.is-hold { color: var(--hold); }
.rs-preview { margin-top: 12px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 10px; }
.rs-preview .cur-key { margin: 8px 0; }
.rs-hold-line { margin: 8px 0 !important; color: var(--hold) !important; font-weight: 600; }
.rs-kv { margin: 0; }
.rs-kv div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.rs-kv div:last-child { border-bottom: 0; }
.rs-kv dt { flex: none; max-width: 45%; color: var(--ink-2); }
.rs-kv dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.rs-kv dd.is-clear { color: var(--clear); }
.rs-kv dd.is-hold { color: var(--hold); }
.rs-dialog .rs-sub { margin-top: 20px; font-size: 15px; }
.rs-grave h2 { color: var(--hold); }
.rs-grave h2 i { font-size: 17px; }
.rs-detail { color: var(--ink) !important; font-weight: 600; }
.rs-back-btn { margin-right: auto; }
@media (min-width: 576px) { .rs-pair { grid-template-columns: 1fr 1fr; } }
@media (min-width: 768px) {
    .rs-action { grid-template-columns: minmax(0, 1fr) auto; }
    .rs-acts { justify-content: flex-end; }
}

/* ---- academicadmin (phase 4) ------------------------------------------- */
/* The admin's catalogue (courses, programs, prospectus) and its clearance,
   evaluation and workload rooms. Prefix ac-. */

a.ais-link-btn.ac-link { display: inline-flex; align-items: center; text-decoration: none; }
[x-data^="ac"] .ais-link-btn.is-danger { min-height: 44px; padding: 0 8px; }
.ac-wrap { flex-wrap: wrap; justify-content: flex-end; }
.ac-hold { color: var(--hold); font-weight: 600; }
.ledger-row span.ac-hold, .enroll-list li.ac-hold { color: var(--hold); }
.ledger-row span.ac-warn { color: var(--warn); }
.ac-muted { color: var(--ink-2); font-weight: 400; }
.ac-hint { display: block; color: var(--ink-2); font-size: 13px; margin-top: 8px; }
.ac-sub { margin-top: 16px; font-size: 16px; }
.ac-facts { margin-top: 8px; }
.ac-notice, .ac-preview { margin-top: 12px; }
.ac-inline { display: inline; }
/* Clearance Setup: the two switches' stamps side by side in the page head. */
.ac-stamps { display: inline-flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.ac-dialog { width: min(600px, calc(100vw - 32px)); }
.ac-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }.ac-scroll { max-height: 220px; overflow-y: auto; }
.ac-found { margin-top: 4px; }
.ac-picked { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--ground-2); }
.ac-pick-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 12px; }
@media (min-width: 576px) {
    .ac-pick-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ac-pick-fields .adv-filter-acts { grid-column: 1 / -1; }
}
.ac-pick-fields .adv-filter-acts { padding-top: 8px; flex-wrap: wrap; }
.ac-pick-fields .ac-hint { margin-top: 0; }

/* A search field with its results listed under it. */
.ac-ac { position: relative; }
.ac-menu { margin-top: 4px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--ground); }
.ac-menu li + li { border-top: 1px solid var(--line); }
.ac-menu button {
    display: block; width: 100%; min-height: 44px; padding: 8px 12px;
    border: 0; background: none; cursor: pointer; text-align: left;
    color: var(--ink); font: 600 15px/1.3 var(--font-read);
}
.ac-menu button small { display: block; color: var(--ink-2); font-weight: 400; font-size: 13px; }
.ac-menu button:hover { background: var(--ground-2); }
.ac-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ac-chip {
    display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px;
    border: 1px solid var(--green-800); border-radius: 18px; background: var(--green-tint);
    color: var(--green-800); font: 600 14px/1 var(--font-read); cursor: pointer;
}
.ac-chip i { font-size: 11px; }

/* Courses */
.ac-bulkbar { margin-top: 12px; }
.ac-pageall { margin-top: 4px; }
.ac-course { grid-template-columns: 28px minmax(0, 1fr); align-items: start; }
.ac-course > .adv-side { grid-column: 2; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 0 8px; }
.ac-course > .adv-side .sig-acts { justify-content: flex-start; gap: 0 4px; }
.ac-course > .adv-side .ais-link-btn { padding: 0 6px; }
.ac-pick-box { display: flex; align-items: center; min-height: 24px; padding-top: 2px; cursor: pointer; }
.ac-pick-box input { width: 20px; height: 20px; accent-color: var(--green-700); }
.ac-course.is-archived strong { color: var(--ink-2); }
.ac-cname { display: inline !important; font-size: 16px !important; color: inherit !important; }
@media (min-width: 768px) {
    .ac-course { grid-template-columns: 28px minmax(0, 1fr) auto; }
    .ac-course > .adv-side { grid-column: auto; flex-wrap: nowrap; justify-content: flex-end; }
}
.ac-sib { align-items: flex-start; margin-top: 12px; }
.ac-sib input { flex: none; margin-top: 2px; }
.ac-sib small { display: block; margin-top: 2px; font-size: 13px; }
.ac-ran { margin-top: 12px; }

/* Programs and the prospectus */
.ledger-row span.ac-acronym { font-weight: 600; color: var(--ink); }
.ac-set { margin-left: 4px; padding: 1px 6px; border-radius: 6px; background: var(--pending-tint); color: var(--pending); font-size: 12px; }
.ac-units { white-space: nowrap; color: var(--ink-2); font-size: 14px; }
.ac-curricula { padding-left: 18px; list-style: disc; }
.ac-form { margin-top: 4px; }
.ac-form-acts { justify-content: flex-start; }
@media (min-width: 768px) { .ac-search { grid-template-columns: minmax(0, 1fr) auto; } }

/* Evaluation answers */
.ac-q { font-weight: 400 !important; }
.ac-qn { color: var(--ink-2); font-weight: 600; margin-right: 4px; }
.ac-answers > div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.ac-answers dt { font-weight: 600; }
.ac-answers dd { margin: 6px 0 0; }
.ac-answers dd.ac-muted { font-style: italic; }

/* Clearance analytics */

/* ---- regqueues (phase 4) ------------------------------------------------ */
/* Registrar Dashboard, request queues, transactions, tagging, activity log;
   the Cashier's dropping and shifting fee pages. Prefixes rq- and cq-. */

/* Dashboard: what waits, then the figures as facts and ruled lists. */
.rq-first { margin-top: 0; }
.rq-dash-top { display: grid; gap: 28px; }
.rq-count {
    min-width: 40px; padding: 4px 10px; border-radius: 6px; text-align: center;
    background: var(--warn-tint); color: var(--warn);
    font: 700 17px/1.1 var(--font-mark); font-variant-numeric: tabular-nums;
}
.rq-go { color: var(--ink-2); font-size: 13px; }
.rq-dash-title { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 24px; }
.rq-scope { margin-top: 28px; color: var(--ink-2); font-size: 15px; max-width: 75ch; }
.rq-scope strong { color: var(--ink); }
.rq-facts { margin-top: 20px; gap: 20px; }
.rq-n { flex: none; white-space: nowrap; text-align: right; font: 700 18px/1.2 var(--font-mark); font-variant-numeric: tabular-nums; }
.rq-group {
    display: flex; justify-content: space-between; gap: 12px; padding: 16px 0 6px; border-bottom: 1px solid var(--line);
    color: var(--ink-2); font: 700 12px/1.2 var(--font-read); letter-spacing: 0.06em; text-transform: uppercase;
}
.rq-group .rq-n { font-size: 15px; color: var(--ink); letter-spacing: 0; }
.rq-table-wrap { max-width: 100%; overflow-x: auto; margin-top: 4px; }
.rq-table-wrap:focus-visible { outline: 3px solid var(--green-800); outline-offset: 2px; }
.rq-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rq-table th, .rq-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.rq-table thead th { color: var(--ink-2); font-size: 13px; font-weight: 700; white-space: nowrap; }
.rq-table tbody th { font-weight: 600; }
.rq-table th small { display: block; color: var(--ink-2); font-size: 12px; font-weight: 400; }
.rq-table tfoot th, .rq-table tfoot td { border-top: 2px solid var(--ink); border-bottom: 0; font-weight: 700; }
.rq-table .rq-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rq-none { color: var(--ink-2); }
.rq-breakdown { min-width: 980px; }
.rq-breakdown tbody th { min-width: 220px; }

/* Queues: search, the selection bar, rows with a tick box. */
.rq-linkbtn { display: inline-flex; align-items: center; text-decoration: none; }
.rq-selbar {
    position: sticky; top: calc(var(--topbar) + var(--safe-top, 0px)); z-index: 5;
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
    margin-top: 16px; padding: 10px 12px; border: 1px solid var(--green-800); border-radius: 10px;
    background: var(--green-tint); font-weight: 700; color: var(--green-800);
}
.rq-all { margin-top: 4px; }
.rq-row { grid-template-columns: 32px minmax(0, 1fr); align-items: start; }
.rq-row .rq-acts { grid-column: 2; }
.rq-pick { display: grid; place-items: center; width: 32px; min-height: 44px; margin-top: -10px; cursor: pointer; }
.rq-pick input { width: 20px; height: 20px; accent-color: var(--green-700); }
.ledger-row span.rq-what { margin-top: 4px; color: var(--ink); font-weight: 600; }
.rq-skipped { margin-top: 12px; }
.rq-skipped ul { margin: 6px 0 0; padding-left: 18px; font-size: 14px; display: grid; gap: 4px; }
.rq-notice { margin-top: 16px; flex-wrap: wrap; }
.rq-notice p + p { margin-top: 4px; }
.rq-notes { margin: 6px 0 10px; padding-left: 18px; display: grid; gap: 4px; }
.ledger-row .rq-open { display: inline-flex; margin-top: 4px; font-weight: 700; font-size: 14px; text-decoration: none; }
.rq-wide-dialog { width: min(600px, calc(100vw - 32px)); }

/* Detail pages: facts, then actions, then the log. */
.rq-detail-facts { margin-top: 8px; }
.rq-detail-facts dd small { display: block; margin-top: 2px; color: var(--ink-2); font-size: 13px; font-weight: 400; }
.rq-detail-facts .rq-span { grid-column: 1 / -1; }
.rq-how { margin-top: 8px; }

/* Activity log: the module as a quiet tag. */
.rq-mod {
    align-self: start; max-width: 140px; padding: 2px 8px; border-radius: 6px;
    background: var(--ground-2); color: var(--ink-2); font-size: 12px; font-weight: 600; text-align: right;
}
.ledger-row span.rq-mod { display: inline-block; color: var(--ink-2); font-size: 12px; }

/* Cashier: the drop credit forecast, the payment fields. */
.cq-credit { margin-top: 12px; }
.cq-credit .ledger-rows { margin-top: 4px; }
.cq-amount { max-width: 260px; }

@media (min-width: 768px) {
    .rq-dash-filters .rq-wide { grid-column: span 2; }
    .rq-row { grid-template-columns: 32px minmax(0, 1fr) auto; }
    .rq-row .rq-acts { grid-column: auto; }
}
@media (min-width: 1024px) {
    .rq-selbar { top: calc(16px + var(--headbar)); }
    .rq-dash-top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; align-items: start; }
}

/* ---- people (phase 4) ---- */
/* Admin Students, Student Terms, Faculty, Colleges, Sections, Rooms; the
 * registrar's Student Masterlist, student record and Graduates Tagging.
 * Prefix ppl-. */

.ppl-row { align-items: start; }
.ppl-row > div:first-child { min-width: 0; }
.ppl-row strong a { color: inherit; text-decoration: none; }
.ppl-row strong a:hover { color: var(--green-700); text-decoration: underline; text-underline-offset: 3px; }
.ppl-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.ppl-stamps { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.ppl-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0 4px; }
.ppl-acts .ais-link-btn { min-height: 40px; }
.ppl-acts a.ais-link-btn { display: inline-flex; align-items: center; text-decoration: none; }
.ppl-acts form { display: inline; }
.ppl-row.is-off strong { color: var(--ink-2); }
.ledger-row span.ppl-note { margin-top: 4px; color: var(--ink); }
.ledger-row span.ppl-id { font-variant-numeric: tabular-nums; }
@media (max-width: 767.98px) {
    .ppl-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .ppl-side { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
    .ppl-stamps { justify-content: flex-start; }
    .ppl-acts { justify-content: flex-start; margin-left: -8px; }
}

/* Filters: two to a row on phones, flowing from 768px; search spans two. */
@media (min-width: 768px) {
    .ppl-filters .ppl-checks { grid-column: span 2; }
}
.ppl-checks { display: flex; flex-wrap: wrap; gap: 0 20px; align-self: end; }

/* Search-and-choose (people/_picker.html). */
.ppl-pick { position: relative; }
.ais .ppl-pick-list {
    margin: 0; padding: 4px; list-style: none;
    border: 1px solid var(--line); border-radius: 10px; background: var(--ground);
    max-height: 240px; overflow-y: auto;
}
.ppl-pick-list button {
    display: block; width: 100%; min-height: 44px; padding: 8px 10px; text-align: left;
    border: 0; border-radius: 8px; background: none; cursor: pointer; color: var(--ink); font: inherit;
}
.ppl-pick-list button:hover { background: var(--ground-2); }
.ppl-pick-list strong { display: block; font-weight: 600; font-size: 15px; }
.ppl-pick-list span { display: block; color: var(--ink-2); font-size: 13px; }
.ppl-pick-none { padding: 10px; color: var(--ink-2); font-size: 14px; }
.ais-field small.ppl-picked { color: var(--clear); font-weight: 600; }
.ppl-req { color: var(--hold); }

/* Dialogs: wider forms, paired fields, steps and CSV previews. */
.ais-dialog.ppl-wide { width: min(720px, calc(100vw - 32px)); }
.ppl-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 12px; align-items: start; }
@media (min-width: 576px) {
    .ppl-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ppl-pair.is-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.ais .ppl-group { margin-top: 20px; padding-bottom: 6px; border-bottom: 1px solid var(--line); font-size: 16px; }
.ppl-guide { margin-top: 12px; font-size: 14px; }
.ppl-guide summary { cursor: pointer; min-height: 32px; font-weight: 600; color: var(--green-700); }
.ppl-guide dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 12px; margin: 8px 0; }
.ppl-guide dt { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.ppl-guide dd { margin: 0; color: var(--ink-2); }
.ppl-guide p { margin-top: 8px; color: var(--ink-2); }
.ais .ppl-guide ul { display: grid; gap: 4px; margin: 8px 0 0; padding-left: 20px; list-style: disc; color: var(--ink-2); }
.ppl-code { display: block; overflow-x: auto; margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: var(--ground-2); font: 12px/1.5 ui-monospace, Consolas, monospace; white-space: pre; }
.ppl-preview { max-height: 45vh; overflow-y: auto; margin-top: 8px; border-top: 2px solid var(--ink); }
.ppl-preview .ledger-row { padding: 10px 0; }
.ppl-cols { display: flex; flex-wrap: wrap; gap: 0 16px; }
.ppl-cols .ais-check { min-height: 36px; font-size: 14px; }
.ppl-step { margin-top: 4px; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.ppl-dialog-tools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; }
.ppl-result { margin-top: 16px; }
.ais .ppl-result ul { margin: 8px 0 0; padding-left: 20px; }

/* Facts at the head of a record (student terms, student record). */
.ppl-facts { margin-top: 4px; }
.record-tally div.ppl-neutral { background: var(--ground-2); color: var(--ink); }
/* Counts that are also shortcuts to the list they count (Masterlist). */
.ais .ppl-tiles { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 8px; padding: 0; list-style: none; }
.ppl-tiles a {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 14px;
    border-radius: 10px; background: var(--ground-2); color: var(--ink);
    font-size: 14px; font-weight: 600; text-decoration: none;
}
.ppl-tiles a b { font: 700 18px/1 var(--font-mark); font-variant-numeric: tabular-nums; }
.ppl-tiles a:hover span { text-decoration: underline; text-underline-offset: 3px; }
.ppl-tiles a.is-clear { background: var(--clear-tint); color: var(--clear); }
.ppl-tiles a.is-warn { background: var(--warn-tint); color: var(--warn); }
.ppl-tiles a.is-pending { background: var(--pending-tint); color: var(--pending); }
.ppl-tiles a[aria-current="true"] { box-shadow: inset 0 0 0 2px currentColor; }

/* The student record form (registrar). */
.ppl-idgen { display: grid; gap: 4px; margin-top: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--ground-2); }
.ppl-idgen > small, .ppl-idgen-sub small { color: var(--ink-2); font-size: 13px; }
.ppl-idgen-sub { display: grid; gap: 4px; margin-left: 28px; }
.ppl-idgen .ais-field.ppl-idgen-sub { margin-top: 8px; max-width: 320px; }
.ppl-derived { min-height: 44px; display: flex; align-items: center; padding: 0 12px; border-radius: 10px; background: var(--ground-2); color: var(--ink-2); }
.ais .ppl-hits { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.ais-field small .stamp { margin-right: 6px; vertical-align: 1px; }
.ppl-form-acts { margin-top: 24px; border-bottom: 0; align-items: center; }
.ppl-cancel { display: inline-flex; align-items: center; text-decoration: none; }
@media (min-width: 576px) { .ppl-idfield { max-width: 360px; } }
.ais p.ppl-key { margin-top: 12px; }
.ppl-digit { padding: 0 2px; border-radius: 3px; background: var(--warn-tint); color: var(--warn); font-weight: 700; }

/* ---- regacademic (phase 4) ---- */
/* Registrar: Course Offerings, Course Equivalence, Sections, Student Records,
   Prospectus, Report Generation, Historical Grades, Grades Rectification,
   Helpdesk, Student Information (ISI). */

/* -- Course Offerings (co-) -- */
.co-noterm { margin-top: 12px; }
.co-pending {
    display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px;
    border: 1px solid var(--warn); border-radius: 20px; background: var(--warn-tint); cursor: pointer;
    color: var(--warn); font: 600 14px/1 var(--font-read);
}
.co-row { align-items: start; row-gap: 8px; }
.co-row.is-dissolved .co-main strong, .co-row.is-dissolved .co-main > span { color: var(--ink-2); }
.co-sched { margin: 4px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--ink-2); }
.co-sched li { display: flex; flex-wrap: wrap; gap: 0 8px; }
.co-sched b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.co-sched span { font-variant-numeric: tabular-nums; }
.co-sched .is-tba { font-style: italic; }
.ledger-row span.co-seats { color: var(--ink-2); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.co-seats b { color: var(--ink); font: 700 16px/1 var(--font-mark); }
.ledger-row .co-seats span { display: inline; color: inherit; font-size: inherit; }
.ledger-row span.co-seats.is-near, .co-seats.is-near b { color: var(--warn); }
.ledger-row span.co-seats.is-full, .co-seats.is-full b { color: var(--hold); }
.co-acts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; }
.co-term { grid-column: 1 / -1; }
.co-act {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-width: 44px; min-height: 44px; padding: 0 8px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--ground); cursor: pointer;
    color: var(--green-800); font: 700 14px/1 var(--font-read);
}
.co-act:hover { background: var(--ground-2); }
.co-act:disabled { opacity: 0.45; cursor: not-allowed; }
.co-act.is-danger { color: var(--hold); }
.co-act i { font-size: 14px; }
.ais-dialog.co-dialog { width: min(720px, calc(100vw - 32px)); }
.co-dialog .ais-notice { margin-top: 12px; }
.co-pick { justify-self: start; margin-top: 0; }
.co-page .ais-field > span small, .co-page .fl-picker label small { color: var(--ink-2); font-weight: 400; font-size: 13px; }
.co-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 12px; }
.co-history-btn { padding-left: 0; }
.co-history-btn i { font-size: 12px; margin-right: 4px; }
.ais-dialog.co-roster { width: min(960px, calc(100vw - 32px)); }
.ais-dialog p.co-roster-title { color: var(--ink); font-weight: 600; }
.ais-dialog p.co-roster-upload { font-size: 13px; }
.co-grade-tools { margin-top: 12px; }
.co-roster .ais-notice { margin-top: 12px; }
.co-roster-body { margin-top: 8px; }
.co-grade-head { display: none; }
.co-sex h3 { margin-top: 16px; padding: 6px 0; border-bottom: 2px solid var(--ink); color: var(--ink-2); font: 700 12px/1.2 var(--font-read); letter-spacing: 0.06em; text-transform: uppercase; }
.co-grade-row {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 44px; gap: 6px 8px; align-items: end;
    padding: 10px 0; border-bottom: 1px solid var(--line);
}
.co-grade-who { grid-column: 1 / -1; min-width: 0; }
.co-grade-who strong { display: block; font-weight: 600; line-height: 1.3; }
.co-grade-who span { display: block; color: var(--ink-2); font-size: 14px; }
.co-grade-who span.is-off { color: var(--hold); }
.co-grade-cell { display: grid; gap: 2px; min-width: 0; }
.co-grade-cell > span { color: var(--ink-2); font-size: 12px; font-weight: 600; }
.co-grade-cell input {
    width: 100%; min-height: 44px; padding: 6px; border: 1px solid var(--field-line); border-radius: 8px;
    background: var(--ground); color: var(--ink); text-align: center; font: 400 16px/1.2 var(--font-read); font-variant-numeric: tabular-nums;
}
.co-grade-cell input:focus-visible { border-color: var(--green-800); }
.co-grade-cell b { min-height: 44px; display: grid; place-items: center; font: 700 16px/1 var(--font-mark); font-variant-numeric: tabular-nums; }
.co-grade-acts { display: flex; flex-direction: column; align-items: center; }
.co-dev-del { color: var(--hold); }
.co-print { margin-right: auto; }
.co-steps { display: flex; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; counter-reset: co-step; }
.co-steps li {
    flex: 1; display: flex; align-items: center; gap: 8px; padding-bottom: 8px;
    border-bottom: 3px solid var(--line); color: var(--ink-2); font-weight: 600; font-size: 14px; counter-increment: co-step;
}
.co-steps li::before {
    content: counter(co-step); display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%;
    background: var(--ground-2); font: 700 13px/1 var(--font-mark);
}
.co-steps li[aria-current="step"] { border-color: var(--green-800); color: var(--green-800); }
.co-steps li[aria-current="step"]::before { background: var(--fill); color: #fff; }
.co-steps li.is-done { border-color: var(--clear); color: var(--clear); }
.co-choice { align-items: center; }
.co-choice .ais-check { align-items: flex-start; min-width: 0; }
.co-choice .ais-check input { flex: none; margin-top: 2px; }
.co-choice .ais-check > span { min-width: 0; }
.ledger-row span.co-choice-n { white-space: nowrap; font-size: 13px; font-variant-numeric: tabular-nums; }
.co-merge-facts { margin-top: 8px; }
.ais-notice span.co-block { display: block; font-size: 14px; }
.ais-dialog p.co-del-label { color: var(--ink); font: 700 18px/1.3 var(--font-mark); }
.ledger-row span.co-warn { color: var(--warn); font-weight: 600; }
@media (min-width: 576px) { .co-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 768px) {
    .co-term { grid-column: auto; }
    .co-grade-head {
        display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 88px) 44px; gap: 8px;
        padding: 0 0 6px; color: var(--ink-2); font-size: 12px; font-weight: 700; text-align: center;
    }
    .co-grade-head span:first-child { text-align: left; }
    .co-grade-row { grid-template-columns: minmax(0, 1fr) repeat(3, 88px) 44px; align-items: center; }
    .co-grade-who { grid-column: auto; }
    .co-grade-cell > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .co-grade-acts { flex-direction: row; }
}
@media (min-width: 1024px) {
    .co-row { grid-template-columns: minmax(0, 1fr) auto auto; }
    .co-acts { grid-column: 3; grid-row: 1; flex-wrap: nowrap; }
}
.co-picker-box { position: relative; }
/* -- end co -- */

/* -- Sections, Student Records, Prospectus (sec-, mls-, rp-) -- */
/* Sections: a term's sections, folded by program. */
.sec-notice { margin-top: 12px; flex-wrap: wrap; }
.sec-pick { margin-top: 24px; }
.sec-page .ledger-head { flex-wrap: wrap; }
.sec-page .ledger-head h2 { flex: 1 0 auto; }
.sec-group-toggle {
    display: grid; grid-template-columns: minmax(0, 1fr) 28px; align-items: center; column-gap: 8px;
    width: 100%; min-height: 52px; padding: 10px 0; border: 0; border-bottom: 1px solid var(--line);
    background: none; cursor: pointer; text-align: left; color: var(--ink); font: inherit;
}
.sec-group-name { font-size: 16px; line-height: 1.3; }
.sec-group-name b { font-weight: 700; }
.sec-group-name span { color: var(--ink-2); font-weight: 600; }
.sec-group-count { grid-column: 1; grid-row: 2; margin-top: 2px; color: var(--ink-2); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sec-group-toggle > i { grid-column: 2; grid-row: 1 / span 2; justify-self: center; color: var(--ink-2); transition: transform 200ms var(--ease-out); }
.sec-group-toggle[aria-expanded="true"] > i { transform: rotate(180deg); }
.sec-group-toggle:hover .sec-group-name b { color: var(--green-700); }
.sec-group .ledger-rows { padding-left: 16px; border-left: 2px solid var(--line); }
.sec-row { align-items: start; }
.sec-adviser { display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; padding: 0; text-align: left; line-height: 1.3; }
.sec-adviser i { font-size: 12px; }
.ledger-row .sec-adviser span { color: inherit; font-size: 14px; }
.sec-del { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.sec-del i { font-size: 13px; }
.sec-dialog { width: min(600px, calc(100vw - 32px)); }
.sec-steps { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 12px 0 0; padding: 0; list-style: none; counter-reset: secstep; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.sec-steps li { counter-increment: secstep; }
.sec-steps li::before { content: counter(secstep) ". "; }
.sec-steps li.is-current { color: var(--green-800); }
.sec-steps li.is-done { color: var(--clear); }
.sec-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 12px; }
.sec-years { margin-top: 12px; }
.sec-year { transition: background-color 300ms ease; }
.sec-year.is-bypass strong { color: var(--warn); }
.sec-year.is-flash { background: var(--warn-tint); }
.ledger-row span.sec-skip { color: var(--hold); font-weight: 600; }
.sec-stepper { display: flex; align-items: center; gap: 4px; }
.sec-stepper .ais-icon-btn { border: 1px solid var(--field-line); border-radius: 10px; color: var(--ink); font: 700 20px/1 var(--font-read); }
.sec-stepper .ais-icon-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.sec-stepper b { min-width: 28px; text-align: center; font: 700 18px/1 var(--font-mark); font-variant-numeric: tabular-nums; }
.sec-stepper .sec-remove { border-color: transparent; color: var(--hold); font-size: 16px; }
.sec-bypass { margin-top: 12px; padding: 4px 12px 12px; border: 1px dashed var(--warn); border-radius: 10px; background: var(--warn-tint); }
.sec-bypass .ais-check span { color: var(--ink); }
.sec-bypass-add { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 12px; }
.sec-bypass-add .ais-field { flex: 1 1 150px; margin-top: 8px; }
.sec-bypass-add .ais-btn { margin-bottom: 26px; background: var(--ground); }
.sec-confirm-facts { margin-top: 16px; }
.sec-sub { margin-top: 16px; font-size: 16px; }
.sec-acts { display: contents; }
.sec-impact div { background: var(--hold-tint); color: var(--hold); }
.sec-impact div:first-child { background: var(--hold-tint); color: var(--hold); }
.sec-impact dt { font-size: 13px; max-width: 16ch; line-height: 1.25; }
.sec-dialog .ais-notice { margin-top: 12px; }
.sec-found { margin-top: 4px; max-height: 260px; overflow-y: auto; }
.sec-picked { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--ground-2); }
.sec-picked span { display: block; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.sec-picked strong { display: block; font-weight: 600; }
.sec-adv-acts .sec-remove-adv { margin-right: auto; color: var(--hold); }
@media (min-width: 576px) { .sec-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Student Records */
.mls-facts { margin-top: 4px; }
.mls-wide { grid-column: 1 / -1; }
@media (min-width: 768px) { .mls-wide { grid-column: span 2; } }
.mls-from-to { margin-top: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }

/* Prospectus */
.ledger-row span.rp-count { flex: none; white-space: nowrap; color: var(--ink-2); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pros-rows.rp-rows li { grid-template-columns: minmax(0, 1fr) 52px 40px 44px; align-items: center; padding: 4px 0; }
.pros-rows.rp-rows li > div { padding: 4px 0; }
.rp-flag-warn { background: var(--warn-tint); color: var(--warn); }
.rp-edit { color: var(--green-700); font-size: 15px; }
.rp-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.rp-units .ais-notice { margin-top: 12px; }
/* -- end sec -- */

/* -- Report Generation, Historical Grades, Course Equivalence (rg-, hg-, ceq-) -- */
/* Report Generation: each report a fold under the ledger rule. */
.rg-report { border-bottom: 1px solid var(--line); }
.rg-report summary {
    display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: center; column-gap: 8px;
    min-height: 56px; padding: 10px 0; cursor: pointer; list-style: none;
}
.rg-report summary::-webkit-details-marker { display: none; }
.rg-name { font-weight: 600; font-size: 16px; line-height: 1.3; }
.rg-name i { width: 20px; margin-right: 6px; color: var(--green-700); font-size: 15px; text-align: center; }
.rg-meta { grid-column: 1; grid-row: 2; margin-top: 2px; padding-left: 26px; color: var(--ink-2); font-size: 14px; }
.rg-report summary > .fa-chevron-down { grid-column: 2; grid-row: 1 / span 2; justify-self: center; color: var(--ink-2); transition: transform 200ms var(--ease-out); }
.rg-report[open] summary > .fa-chevron-down { transform: rotate(180deg); }
.rg-report summary:hover .rg-name { color: var(--green-700); }
.rg-desc { max-width: 70ch; color: var(--ink-2); font-size: 15px; }
.rg-fields { grid-template-columns: minmax(0, 1fr); margin-top: 0; padding-bottom: 16px; }
.rg-fields .adv-filter-acts { flex-wrap: wrap; padding-top: 16px; }
.rg-hint { color: var(--ink-2); font-size: 14px; }
@media (min-width: 768px) {
    .rg-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rg-fields .adv-filter-acts { grid-column: 1 / -1; }
    .rg-fields.is-exam { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Course Equivalence */
.ceq-back { margin-bottom: 4px; }
.ceq-back i { font-size: 12px; }
.ceq-filters { grid-template-columns: minmax(0, 1fr); margin-top: 0; }
.ceq-row { grid-template-columns: minmax(0, 1fr); align-items: start; gap: 4px; }
.ceq-course { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ceq-course > div { min-width: 0; }
.ledger-row span.ceq-count { flex: none; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ceq-acts { display: grid; gap: 4px 12px; }
.ceq-slot { margin-top: 4px; }
.ceq-slot > span { font-size: 13px; color: var(--ink-2); }
.ceq-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
@media (min-width: 768px) {
    .ceq-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ceq-acts { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
}
/* At a desk each course is one line: the course, then its slot and actions. */
@media (min-width: 1024px) {
    .ceq-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); align-items: center; gap: 16px; }
    .ceq-course { flex-direction: column; gap: 0; }
    .ceq-slot { margin-top: 0; }
    .ceq-slot > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .ceq-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); gap: 16px; margin-top: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: 13px; font-weight: 700; }
}
@media (max-width: 1023.98px) { .ceq-cols { display: none; } }

/* Historical Grades */
.hg-step { margin-top: 32px; }
.hg-step:first-of-type { margin-top: 0; }
.hg-num {
    display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 6px;
    border-radius: 50%; background: var(--ink); color: var(--ground);
    font: 700 14px/1 var(--font-mark); vertical-align: 2px;
}
.hg-class { margin-top: 0; }
.hg-class .ais-field { margin-top: 12px; }
.hg-class .hg-wide { grid-column: 1 / -1; }
@media (max-width: 767.98px) {
    /* A phone keeps room for the boxes beside the fixed student column. */
    .hg-grid .hg-stick { width: 150px; }
    .hg-name { padding-left: 0; }
}
@media (min-width: 768px) {
    .hg-class { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .hg-class .hg-wide { grid-column: span 3; }
    .hg-class .ais-field:not(.hg-wide) { grid-column: span 2; }
}
@media (min-width: 1200px) {
    .hg-class { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr) repeat(3, minmax(0, 1fr)); }
    .hg-class .hg-wide, .hg-class .ais-field:not(.hg-wide) { grid-column: auto; }
}
.hg-search { max-width: 560px; }
.hg-search .ais-field { margin-top: 12px; }
.hg-found { max-height: 280px; overflow-y: auto; margin-top: 4px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; }
.hg-found .ledger-row:last-child, .hg-found .ledger-empty { border-bottom: 0; }
.ledger-row span.hg-added { justify-self: start; display: inline-block; margin-top: 4px; padding: 2px 8px; border-radius: 6px; background: var(--pending-tint); color: var(--pending); font-size: 13px; font-weight: 600; }
.hg-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 12px 0 0; padding: 0; list-style: none; color: var(--ink-2); font-size: 14px; }
.hg-legend li { display: inline-flex; align-items: center; gap: 6px; }
.hg-swatch { width: 26px; height: 18px; border: 1px solid var(--field-line); border-radius: 5px; background: var(--ground); }
.hg-swatch.is-inc, .hg-cell.is-inc { background: var(--warn-tint); border-color: var(--warn); color: var(--warn); font-weight: 700; }
.hg-swatch.is-drp, .hg-cell.is-drp { background: var(--ground-2); border-color: var(--field-line); color: var(--ink-2); text-decoration: line-through; font-weight: 600; }
.hg-swatch.is-empty, .hg-cell.is-empty { border-style: dashed; border-color: var(--field-line); }

/* The grid stays a table: a grade sheet, read across a student and down a
   subject. The student column stays put while the subjects scroll. */
.hg-grid-wrap { position: relative; max-height: min(65vh, 600px); overflow: auto; margin-top: 16px; border: 1px solid var(--line); border-radius: 10px; }
.hg-grid { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.hg-grid th, .hg-grid td { padding: 6px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.hg-grid thead th {
    position: sticky; top: 0; z-index: 2; background: var(--ground-2); vertical-align: bottom;
    color: var(--ink-2); font-size: 12px; font-weight: 700;
}
.hg-grid thead th:last-child, .hg-grid td:last-child { width: 52px; }
.hg-grid .hg-stick {
    position: sticky; left: 0; z-index: 3; width: 232px; text-align: left; font-weight: 400;
    background: var(--ground); box-shadow: 2px 0 4px -2px rgba(38, 50, 56, 0.2);
}
.hg-grid thead .hg-stick { z-index: 4; background: var(--ground-2); }
.hg-grid tbody tr:hover td { background: var(--green-tint); }
.hg-grid .is-hot { background: var(--green-tint); }
.hg-code { display: block; overflow: hidden; text-overflow: ellipsis; color: var(--ink); font-size: 13px; }
.hg-units { display: block; min-height: 15px; font-weight: 400; }
.hg-fill { width: 100%; max-width: 120px; min-height: 32px; margin-top: 4px; border: 1px solid var(--line); border-radius: 6px; background: var(--ground); color: var(--ink-2); font: 400 13px/1 var(--font-read); }
.hg-sex th { position: static; padding: 6px 12px; background: var(--pending-tint); color: var(--pending); text-align: left; font: 700 12px/1.2 var(--font-read); letter-spacing: 0.06em; text-transform: uppercase; }
.hg-sex th span { position: sticky; left: 12px; }
.hg-who { display: flex; align-items: baseline; gap: 6px; }
.hg-who b { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 600; color: var(--ink); }
.hg-no { min-width: 18px; color: var(--ink-2); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hg-filled { margin-left: auto; color: var(--ink-2); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hg-filled.is-done { color: var(--clear); }
.hg-name { display: block; overflow: hidden; text-overflow: ellipsis; padding-left: 24px; color: var(--ink-2); font-size: 13px; }
.hg-cell {
    width: 100%; max-width: 120px; min-height: 36px; padding: 4px 2px;
    border: 1px solid var(--field-line); border-radius: 6px; background: var(--ground);
    color: var(--ink); text-align: center; font: 400 16px/1.2 var(--font-read); font-variant-numeric: tabular-nums;
}
.hg-cell::placeholder { color: var(--field-line); }
.hg-cell:focus-visible { border-color: var(--green-800); }
.hg-cell.is-bad { border-color: var(--hold); background: var(--hold-tint); color: var(--hold); font-weight: 700; }
.hg-drop { width: 40px; height: 40px; color: var(--hold); font-size: 15px; }
.hg-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.hg-review { display: grid; gap: 0 12px; align-items: end; }
.hg-review .ais-field { margin-top: 12px; }
.hg-review-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
@media (min-width: 768px) {
    .hg-review { grid-template-columns: minmax(0, 320px) auto; justify-content: space-between; }
}
.hg-note { margin-top: 12px; }
.hg-msgs { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; }
.hg-msgs.is-hold { color: var(--hold); font-weight: 600; }
.hg-sub { margin-top: 20px; font-size: 16px; }
.hg-scroll { max-height: 340px; overflow-y: auto; }
.hg-conflict { grid-template-columns: 44px minmax(0, 1fr); }
/* -- end rg -- */

/* -- Grades Rectification, Helpdesk, Student Information (gr-, hd-, isi-) -- */
/* Grades Rectification (registrar/grades/) */
.gr-back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-bottom: 4px; font-weight: 700; font-size: 15px; text-decoration: none; }
.gr-back i { font-size: 12px; }
.gr-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.gr-head > div { min-width: 0; }
.gr-head .stamp { flex: none; margin-top: 6px; }
.gr-row { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
.gr-row .gr-name { color: var(--ink); text-decoration: none; }
.gr-row .gr-name:hover strong { color: var(--green-700); text-decoration: underline; text-underline-offset: 3px; }
.ledger-row span.gr-change { margin-top: 4px; color: var(--ink); }
.gr-change b { font-variant-numeric: tabular-nums; }
.ledger-row span.gr-date { font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gr-acts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.gr-acts .ais-btn { min-height: 40px; padding: 0 14px; }
.gr-facts { margin-top: 20px; }
.ledger-row span.gr-figure, .gr-figure { font: 700 18px/1.1 var(--font-mark); font-variant-numeric: tabular-nums; color: var(--ink); }
.gr-decision { margin: 0; }
.gr-decision div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.gr-decision dt { color: var(--ink-2); font-size: 13px; font-weight: 600; }
.gr-decision dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.ais-dialog.gr-dialog { width: min(600px, calc(100vw - 32px)); }
.gr-found { margin-top: 4px; max-height: 240px; overflow-y: auto; }
.gr-picked { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--ground-2); }
.gr-picked span { display: block; color: var(--ink-2); font-size: 14px; }
.gr-picked span:first-child { font-size: 13px; font-weight: 600; }
.gr-picked strong { display: block; font-weight: 600; }
.gr-grades { margin: 16px 0 0; padding: 0; border: 0; min-width: 0; }
.gr-grades legend { padding: 0; font-weight: 600; }
.gr-grade { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.gr-current { color: var(--ink-2); font-size: 14px; font-variant-numeric: tabular-nums; }
.gr-grade .gr-value { grid-column: 1 / -1; width: 100%; min-height: 44px; margin-bottom: 8px; padding: 10px 12px; border: 1px solid var(--field-line); border-radius: 10px; background: var(--ground); color: var(--ink); font: 400 16px/1.4 var(--font-read); }
.gr-grade .gr-value:disabled { display: none; }
.gr-grade .gr-value:focus-visible { border-color: var(--green-800); }
.gr-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 12px; }
@media (min-width: 576px) {
    .gr-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gr-grade { grid-template-columns: minmax(0, 1fr) 96px 140px; }
    .gr-grade .gr-value { grid-column: auto; margin: 0; }
    .gr-grade .gr-value:disabled { display: block; }
}
@media (min-width: 768px) {
    .gr-row { grid-template-columns: minmax(0, 1fr) auto auto; }
    .gr-acts { grid-row: 1; grid-column: 3; flex-wrap: nowrap; }
}

/* Grade concerns (students/grade_concern_*.html, registrar/grades/concern_*.html) */
.gc-grades { margin: 0; padding: 0; border: 0; min-width: 0; }
.gc-grades legend { padding: 0; font-weight: 600; }
.gc-grades h3 { margin-top: 16px; padding-bottom: 6px; border-bottom: 1px solid var(--line); font-size: 17px; }
.gc-grades ul { margin: 0; padding: 0; list-style: none; }
.gc-grade { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 44px; padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.gc-grade input { margin: 0; width: 20px; height: 20px; accent-color: var(--green-700); }
.gc-course b { display: block; font-weight: 600; }
.gc-course small { display: block; color: var(--ink-2); font-size: 13px; }
.gc-figure { font: 700 17px/1.1 var(--font-mark); font-variant-numeric: tabular-nums; }
.gc-none { color: var(--ink-2); }
.gc-missing { margin-top: 12px; }
.gc-missing input { margin: 0; }
.gc-send { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 20px; }
.gc-send p { margin: 0; color: var(--warn); font-size: 14px; font-weight: 600; }
.gc-text { overflow-wrap: anywhere; }
.gc-flag { background: var(--warn-tint); color: var(--warn); }
.rec-table tr.is-flagged > td { background: var(--warn-tint); }
.is-flagged:not(.is-outside) .gc-flag { background: var(--ground); }
/* The concern beside the grades flagged; the record under both. */
.gc-top { display: grid; gap: 20px; align-items: start; }
.ais-main .gc-top > .ledger { margin-top: 0; }
.gc-top .gr-decision div:last-child { border-bottom: 0; }
.gc-top .gr-row { grid-template-columns: minmax(0, 1fr) auto auto; }
.gc-top .gr-acts { grid-row: 1; grid-column: 3; }
.gc-top + * { margin-top: 24px; }
.gr-page .ais-notice + :is(.ais-notice, .rec-grid) { margin-top: 12px; }
@media (min-width: 1024px) { .gc-top:has(> :nth-child(2)) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.gc-note { margin-bottom: 16px; }

/* Helpdesk (helpdesk/registrar.html, misses.html). helpdesk.js builds the
   rows and articles with these class names. */
.hd-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hd-search { position: relative; }
.hd-search > .fa-magnifying-glass { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-2); pointer-events: none; }
.hd-search input { width: 100%; min-height: 52px; padding: 12px 52px 12px 44px; border: 1px solid var(--field-line); border-radius: 12px; background: var(--ground); color: var(--ink); font: 400 17px/1.4 var(--font-read); }
.hd-search input:focus-visible { border-color: var(--green-800); }
.hd-search input::-webkit-search-cancel-button { display: none; }
.hd-clear { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.hd-clear[hidden] { display: none; }
.hd-tries { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 10px; color: var(--ink-2); font-size: 14px; }
.hd-try { min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--ground); color: var(--ink); font: 600 14px/1 var(--font-read); cursor: pointer; }
.hd-try:hover { border-color: var(--green-700); color: var(--green-800); }
.hd-bar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0 16px; }
.hd-n { margin-left: 6px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hd-n:empty { display: none; }
.hd-area { flex: 1 1 200px; max-width: 320px; margin-top: 8px; }
.hd-panes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 32px; align-items: start; }
.hd-list-card { margin-top: 20px; }
.hd-status { padding: 14px 0; color: var(--ink-2); }
.hd-status-error { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: var(--hold-tint); color: var(--hold); }
.hd-group { padding: 16px 0 4px; color: var(--ink-2); font: 700 12px/1 var(--font-read); letter-spacing: 0.06em; text-transform: uppercase; }
.hd-results { margin: 0; padding: 0; list-style: none; }
.hd-row { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 12px 8px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; color: var(--ink); font: inherit; }
.hd-row:hover { background: var(--ground-2); }
.hd-row.is-active { background: var(--green-tint); box-shadow: inset 3px 0 0 var(--green-800); }
.hd-ico { flex: 0 0 32px; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font-size: 13px; background: var(--pending-tint); color: var(--pending); }
.hd-ico-error { background: var(--hold-tint); color: var(--hold); }
.hd-ico-page { background: var(--clear-tint); color: var(--clear); }
.hd-row-body { min-width: 0; }
.hd-row-title { display: block; font-weight: 600; line-height: 1.35; }
.hd-row-sum { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; color: var(--ink-2); font-size: 14px; }
.hd-row-title mark { padding: 0 1px; border-radius: 2px; background: var(--warn-tint); color: inherit; }
.hd-topics { display: grid; grid-template-columns: minmax(0, 1fr); }
.hd-topic { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 52px; padding: 8px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; color: var(--ink); font: inherit; }
.hd-topic:hover { background: var(--ground-2); }
.hd-topic i { color: var(--green-700); text-align: center; }
.hd-topic strong { font-weight: 600; }
.hd-topic span { color: var(--ink-2); font-size: 14px; white-space: nowrap; }
.hd-article-card { margin-top: 20px; }
.hd-back { padding-left: 0; }
.hd-article h2 { margin: 10px 0 6px; font-size: 22px; line-height: 1.25; }
.hd-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; }
.hd-kind { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--pending-tint); color: var(--pending); }
.hd-kind-error { background: var(--hold-tint); color: var(--hold); }
.hd-kind-page { background: var(--clear-tint); color: var(--clear); }
.hd-lead { margin: 0 0 16px; font-size: 16px; line-height: 1.55; max-width: 65ch; }
.hd-go { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--ground-2); }
.hd-routes { display: grid; gap: 6px; flex: 1 1 240px; min-width: 0; }
.hd-path { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; color: var(--ink); font-size: 14px; }
.hd-path > i { color: var(--ink-2); font-size: 11px; }
.hd-or { color: var(--ink-2); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.hd-crumb { padding: 1px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--ground); }
.hd-go-btn { min-height: 40px; }
.hd-section { margin-top: 20px; }
.hd-section > h3 { margin: 0 0 10px; color: var(--ink-2); font: 700 12px/1 var(--font-read); letter-spacing: 0.06em; text-transform: uppercase; }
.hd-message { margin: 0 0 8px; padding: 10px 14px; border-left: 4px solid var(--hold); border-radius: 0 8px 8px 0; background: var(--ground-2); font-size: 15px; overflow-wrap: anywhere; }
.hd-steps { margin: 0; padding: 0; list-style: none; counter-reset: hdstep; }
.hd-steps li { position: relative; padding: 0 0 12px 40px; line-height: 1.55; counter-increment: hdstep; }
.hd-steps li::before { content: counter(hdstep); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--fill); color: var(--on-green); font: 700 13px/1 var(--font-read); }
.hd-caution { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--warn-tint); color: var(--warn); font-size: 15px; }
.hd-caution > i { margin-top: 3px; }
.hd-caution strong { display: block; }
.hd-related { display: grid; }
.hd-related-link { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; color: var(--ink); font: 600 15px/1.3 var(--font-read); }
.hd-related-link:hover { color: var(--green-700); }
.hd-related-link .hd-ico { flex-basis: 26px; width: 26px; height: 26px; font-size: 11px; }
.hd-article-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 14px; }
.hd-welcome h2 { margin-bottom: 12px; font-size: 20px; }
.hd-how { display: grid; gap: 10px; margin: 0 0 16px; padding-left: 20px; color: var(--ink-2); }
.hd-how strong { color: var(--ink); }
.hd-keys { color: var(--ink-2); font-size: 14px; }
.hd-keys kbd { padding: 0 5px; border: 1px solid var(--line); border-radius: 4px; background: var(--ground-2); color: var(--ink); font-size: 12px; }
.hd-footnote { margin-top: 24px; font-size: 14px; }
@media (max-width: 991.98px) {
    .hd-page:not(.hd-reading) .hd-article-card { display: none; }
    .hd-page.hd-reading .hd-list-card { display: none; }
}
@media (min-width: 992px) {
    .hd-panes { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
    .hd-back { display: none; }
    .hd-article-card { position: sticky; top: calc(24px + var(--headbar)); max-height: calc(100vh - 48px - var(--headbar) - var(--footbar)); overflow-y: auto; padding: 4px 4px 4px 0; }
}

/* Student Information (isi/registrar_*.html) */
.isi-review { margin-top: 8px; }
.isi-review small { display: block; color: var(--ink-2); font-size: 13px; font-weight: 400; }
.isi-facts { margin-top: 12px; }
.isi-facts div.isi-wide { grid-column: 1 / -1; }
.isi-sub { margin-top: 16px; padding-bottom: 6px; border-bottom: 1px solid var(--line); font-size: 16px; }
.ledger-row span.isi-years { white-space: nowrap; font-variant-numeric: tabular-nums; }
/* -- end gr -- */

/* ---- offices (phase 4) ---- */

/* NSTP: Registration List, a registration, Class Management */
.ns-extra { display: none; }
.ns-extra.is-open { display: contents; }
.ns-filters .ns-term { grid-column: 1 / -1; }
@media (min-width: 768px) {
    .ns-extra { display: contents; }
    .adv-filter-acts .ns-more-btn { display: none; }
    .ns-filters .ns-term { grid-column: auto; }
}
.ns-row-main strong { color: var(--ink); }
.ns-bulk, .ns-pickbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 16px; }
.ns-bulk > span, .ns-pickbar > span:first-child { flex: 1 1 240px; }
.ns-pickbar-acts { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ns-page .ledger { margin-top: 24px; }
.ns-all { margin-top: 4px; }
.ledger-row.ns-row { align-items: start; }
.ledger-row.ns-row.has-pick { grid-template-columns: 28px minmax(0, 1fr) auto; }
.ns-pick { display: flex; align-items: center; min-height: 24px; }
.ns-pick input { width: 20px; height: 20px; accent-color: var(--green-700); }
.ns-row-main { min-width: 0; color: var(--ink); text-decoration: none; }
.ns-row-main:hover strong { color: var(--green-700); text-decoration: underline; text-underline-offset: 3px; }
.ledger-row.ns-row > .ns-row-acts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0 16px; margin-top: -4px; }
.ledger-row.ns-row.has-pick > .ns-row-acts { grid-column: 2 / -1; }
.ns-row-acts .ais-link-btn { min-height: 36px; padding: 0; }
.ledger-row strong .stamp.ns-walkin { margin-left: 6px; vertical-align: 2px; }
.ledger-row span.ns-sched { margin-top: 2px; }
.ledger-row span.ns-sched b { color: var(--ink); font-variant-numeric: tabular-nums; }
.stamp.ns-slots { min-width: 0; font-variant-numeric: tabular-nums; }
.ns-mergebar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ns-mergebar .ns-warn { color: var(--hold); font-weight: 600; }
.ns-kinds { margin: 12px 0 0; padding: 0; border: 0; }
.ns-kinds .ais-check { align-items: flex-start; }
.ns-kinds .ais-check input { flex: none; margin-top: 2px; }
.ns-kinds-key { margin: 12px 0 0; padding-left: 20px; color: var(--ink-2); font-size: 14px; }
.ns-kinds-key li + li { margin-top: 4px; }
.ais-dialog.ns-wide { width: min(640px, calc(100vw - 32px)); }
.ns-scroll { max-height: 300px; margin-top: 12px; overflow-y: auto; }
.ais-notice.ns-capnote, .ais-notice.ns-bulk-note { margin-top: 12px; }
.ns-progress { width: 100%; height: 12px; margin-top: 12px; accent-color: var(--green-800); }
.ns-progress-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-variant-numeric: tabular-nums; }
.ais-notice.ns-msg { margin-top: 16px; }
.ns-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 12px; }
.ns-head > div { flex: 1 1 240px; min-width: 0; }
.ns-head h1 { overflow-wrap: anywhere; }
.ns-tools { align-items: center; }
.ns-why { color: var(--ink-2); font-size: 13px; }
.ais-btn.is-quiet.ns-danger-quiet { color: var(--hold); }
.ns-detail .ais-notice { margin-top: 16px; }
.ns-section { margin-top: 28px; }
.ns-section .ais-notice { margin-top: 12px; }
.ns-sub { margin-top: 32px; font: 700 14px/1.2 var(--font-read); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2); }
.ns-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 12px; }
.ns-grid .ais-field { margin-top: 12px; }
@media (min-width: 600px) { .ns-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) {
    .ns-detail .ns-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .ns-detail .ns-span2 { grid-column: span 2; }
    .ns-detail .ns-cc { grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) auto; }
}
.ns-cc-go { display: flex; align-items: flex-end; margin-top: 12px; }
.ns-files { margin-top: 8px; }
.ns-missing { color: var(--hold); font-weight: 600; }
.ns-review .ledger-head { border-bottom-color: var(--green-800); }
.ns-review.is-reject .ledger-head { border-bottom-color: var(--hold); }
.ns-find { margin-top: 8px; }
.ns-card { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.ns-card > strong { display: block; font-weight: 700; }
.ns-card > span { display: block; color: var(--ink-2); font-size: 14px; }
.ns-card .record-facts { margin-top: 8px; }
.ns-verdict { margin-top: 10px !important; color: var(--ink) !important; font-size: 15px; }
.ns-verdict.is-clear { color: var(--clear) !important; }
.ns-verdict.is-warn { color: var(--warn) !important; }
.ns-verdict.is-hold { color: var(--hold) !important; }

/* F-NSTP-01 on screen: paper-like on purpose (fixed width, ruled lines, real
   checkboxes), so a reviewer comparing it with the printed form need not
   translate between two layouts. Below 900px it scrolls sideways inside its
   own frame rather than reflowing into something the paper is not. */
.nsf-scroll { margin-top: 8px; overflow-x: auto; }
@media (min-width: 1024px) { .nsf-hint { display: none; } .nsf-scroll { margin-top: 20px; } }
.nsf-sheet {
    min-width: 640px; max-width: 900px; margin: 0 auto; padding: 14px 16px 18px;
    border: 1px solid #B9BEC4; background: #fff; color: #14181C; font-size: 13px; line-height: 1.35;
}
.nsf-doc-no { text-align: right; font-size: 11.5px; font-weight: 700; line-height: 1.25; }
.nsf-head { display: grid; grid-template-columns: 74px 1fr 74px; align-items: center; gap: 8px; margin-bottom: 8px; padding: 6px 8px; border: 1px solid #14181C; }
.nsf-head img { width: 100%; height: auto; }
.nsf-head-mid { text-align: center; line-height: 1.28; }
.nsf-strong { font-weight: 700; font-size: 13.5px; }
.nsf-form { margin-top: 2px; font-weight: 700; font-size: 16px; }
.nsf-title { font-weight: 700; font-size: 17px; }
.nsf-top { display: grid; grid-template-columns: 1.5fr .8fr 1fr .9fr; border: 1px solid #14181C; border-bottom: 0; }
.nsf-top > div { padding: 5px 7px; border-right: 1px solid #14181C; }
.nsf-top > div:last-child { border-right: 0; }
.nsf-cols { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #14181C; }
.nsf-col { padding: 8px 10px; }
.nsf-col + .nsf-col { border-left: 1px solid #14181C; }
.nsf-section { margin: 2px 0 7px; font-weight: 700; font-size: 14px; }
.nsf-col .nsf-section ~ .nsf-section { margin-top: 14px; }
.nsf-group { margin: 9px 0 5px; font-weight: 700; }
.nsf-bold { font-weight: 700; }
.nsf-top .nsf-bold { margin-top: 4px; }
.nsf-box { margin: 8px 0; padding: 7px 9px; border: 1px solid #14181C; }
.nsf-box .nsf-bold { margin-bottom: 6px; }
.nsf-f { display: flex; align-items: baseline; gap: 6px; margin-bottom: 5px; }
.nsf-f > span:not(.nsf-v) { white-space: nowrap; }
.nsf-v { flex: 1 1 auto; min-width: 0; min-height: 1.15em; padding: 0 2px 1px; border-bottom: 1px solid #5A6169; font-weight: 600; overflow-wrap: anywhere; }
.nsf-v:empty::after { content: '\00a0'; }
.nsf-check { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.nsf-tick { display: inline-flex; flex: 0 0 13px; align-items: center; justify-content: center; width: 13px; height: 13px; border: 1.4px solid #14181C; font-size: 11px; font-weight: 800; line-height: 1; }
.nsf-tick.is-on { background: #14181C; color: #fff; }
.nsf-inline { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; }
.nsf-years .nsf-check { min-width: 44%; }
.nsf-photo { display: flex; align-items: center; justify-content: center; width: 108px; height: 108px; margin: 8px 0 4px; overflow: hidden; border: 1px solid #14181C; background: #FAFBFC; color: #5A6169; text-align: center; font-size: 11px; }
.nsf-photo img { width: 100%; height: 100%; object-fit: cover; }
/* A fault, not an empty slot waiting to be filled in by hand. */
.nsf-photo.is-missing { border-style: dashed; color: var(--hold); font-weight: 700; font-size: 10px; letter-spacing: .02em; line-height: 1.35; }
.nsf-sign { margin-top: 16px; text-align: center; }
.nsf-rule { margin: 0 12% 3px; border-top: 1px solid #14181C; }
.nsf-code { margin-top: 8px; padding: 6px 9px; border: 1px solid #14181C; font-weight: 700; letter-spacing: .02em; }
.nsf-foot { display: flex; justify-content: space-between; margin-top: 6px; color: #5A6169; font-size: 11px; }

/* NSTP coordinator (nsb-) */
/* NSTP coordinator: Dashboard, Regulations, Activity Log, Faculty Evaluation, Report Generation */
.nsb-pages { flex-wrap: wrap; text-align: center; font-variant-numeric: tabular-nums; }

/* Faculty Evaluation */
.dash-figure.nsb-avg.is-clear { color: var(--clear); }
.dash-figure.nsb-avg.is-hold { color: var(--hold); }

/* Report Generation: rows numbered across the whole list. */
.ledger-row.nsb-numbered { grid-template-columns: 40px minmax(0, 1fr); align-items: start; }
.ledger-row span.nsb-num { color: var(--ink-2); font: 700 15px/1.4 var(--font-mark); font-variant-numeric: tabular-nums; }

/* Activity Log */
.ledger-row.nsb-log-row { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
.nsb-when { grid-column: 1 / -1; font: 700 14px/1.2 var(--font-mark); color: var(--green-800); font-variant-numeric: tabular-nums; }
.nsb-when small { margin-left: 8px; font: 600 13px/1 var(--font-read); color: var(--ink-2); }
.ledger-row span.nsb-desc { color: var(--ink); overflow-wrap: anywhere; }
@media (min-width: 768px) {
    .ledger-row.nsb-log-row { grid-template-columns: 112px minmax(0, 1fr) auto; }
    .nsb-when { grid-column: auto; }
    .nsb-when small { display: block; margin: 4px 0 0; }
}

/* Dashboard */
.nsb-none { margin-top: 24px; }
.ledger-head.nsb-subhead { margin-top: 20px; border-bottom-width: 1px; }
.nsb-scroll { margin-top: 12px; overflow-x: auto; }
.nsb-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 15px; }
.nsb-table th, .nsb-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.nsb-table th:first-child, .nsb-table td:first-child { padding-left: 0; }
.nsb-table thead th { color: var(--ink-2); font-size: 13px; font-weight: 700; }
.nsb-table tbody th { font-weight: 600; }
.nsb-table tbody th small { display: block; color: var(--ink-2); font-size: 13px; font-weight: 400; }
.nsb-table .nsb-n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nsb-table tfoot th, .nsb-table tfoot td { border-top: 2px solid var(--ink); border-bottom: 0; font: 700 16px/1.2 var(--font-mark); }
.nsb-empty-cell { color: var(--ink-2); }

/* Regulations */
.nsb-period-state { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 16px; }
.nsb-period-summary { color: var(--ink-2); font-size: 15px; }
.nsb-period-form { display: grid; gap: 0 12px; }
.nsb-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
@media (min-width: 768px) {
    .nsb-period-form { grid-template-columns: 1fr 1fr auto; align-items: end; }
}
.nsb-msg { margin-top: 12px; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.nsb-msg.is-success { color: var(--clear); }
.nsb-msg.is-error { color: var(--hold); }
.nsb-checks { display: flex; flex-wrap: wrap; gap: 0 20px; margin-top: 4px; }
.ledger-row.nsb-cap-row { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
.nsb-cap-row.is-full strong { color: var(--hold); }
.ais-field.nsb-cap-field { grid-column: 1; margin-top: 0; max-width: 200px; gap: 4px; }
.ledger-row .ais-field.nsb-cap-field > span { color: var(--ink); font-size: 14px; font-weight: 600; }
.nsb-cap-row .dash-rank { grid-column: 2; grid-row: 1; }
@media (min-width: 768px) {
    .ledger-row.nsb-cap-row { grid-template-columns: minmax(0, 1fr) 168px 120px; }
    .ais-field.nsb-cap-field { grid-column: 2; grid-row: 1; }
    .nsb-cap-row .dash-rank { grid-column: 3; }
}
/* Figure and its share on one line in the dashboard's ruled lists. */
.nsb-dash .dash-rank { display: flex; align-items: baseline; justify-content: flex-end; gap: 8px; }
.nsb-dash .ledger-row .dash-rank span:not(.dash-figure) { margin-top: 0; min-width: 40px; text-align: right; }
.nsb-res-row { align-items: start; }
.nsb-res-acts { display: flex !important; gap: 4px; }
.nsb-res-acts .ais-link-btn.is-danger { padding: 0 8px; }
.nsb-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.nsb-check-btn { margin-top: 12px; }
.nsb-preview { max-height: 260px; overflow-y: auto; margin-top: 8px; border-top: 1px solid var(--line); }
.nsb-res-dialog .ais-check { margin-top: 12px; }
.nsb-head { flex-wrap: wrap; }
.nsb-head .ais-btn { white-space: nowrap; }
@media (max-width: 575px) { .nsb-pages span { flex-basis: 100%; order: -1; } }

/* OSAS Student Profiles (osas-), kiosk (ki-), Mass Email (mm-) */
/* OSAS: Student Profiles */
.osas-facts { margin-bottom: 0; }
.osas-notice { margin-top: 12px; }
.osas-fields { margin-top: 12px; }
@media (min-width: 768px) { .osas-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Kiosk */
.ki-acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
@media (max-width: 767.98px) {
    .ki-row { grid-template-columns: minmax(0, 1fr); }
    .ki-acts { justify-content: flex-start; }
}
.ki-tools { border-bottom: 0; padding-top: 0; }
.ki-steps { counter-reset: ki; }
.ki-step { counter-increment: ki; position: relative; padding: 16px 0 16px 40px; border-bottom: 1px solid var(--line); }
.ki-step::before {
    content: counter(ki); position: absolute; left: 0; top: 16px;
    display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
    background: var(--green-tint); color: var(--green-800); font: 700 15px/1 var(--font-mark);
}
.ki-step h3, .ki-once summary { font-size: 17px; }
.ki-step p, .ki-once p { margin-top: 4px; color: var(--ink-2); font-size: 15px; max-width: 65ch; }
.ki-step > .ais-btn { margin-top: 12px; }
.ki-upload { display: grid; gap: 0 12px; align-items: end; }
.ki-upload .ais-btn { margin-top: 12px; justify-self: start; }
@media (min-width: 768px) { .ki-upload { grid-template-columns: minmax(0, 1fr) auto; } .ki-upload .ais-btn { margin-top: 0; } }
.ki-once { padding: 12px 0; border-bottom: 1px solid var(--line); }
.ki-once summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; font-family: var(--font-mark); font-weight: 700; }
.ki-email, .mm-email { overflow-wrap: anywhere; }
.ledger-row span.ki-email { color: var(--green-700); }

/* Mass Email */
.mm-tools { border-bottom: 0; padding-top: 0; }
.mm-tools form { display: inline; }
.mm-notices { display: grid; gap: 8px; margin-top: 8px; }
.mm-row { align-items: start; }
.mm-row strong a { color: inherit; text-decoration: none; }
.mm-row strong a:hover { color: var(--green-700); text-decoration: underline; }
.mm-row-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 2px; }
.mm-row-acts form { display: inline; }
.mm-row-acts .ais-link-btn { padding: 0; min-height: 36px; }
.ledger-row b.mm-failed { color: var(--hold); }
.mm-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mm-head > div { min-width: 0; }
.mm-head h1 { overflow-wrap: anywhere; }
.mm-head .stamp { flex: none; margin-top: 6px; }
.mm-notice { margin-top: 8px; }
.mm-wide { grid-column: 1 / -1; }
.mm-facts { margin-top: 12px; }
.mm-frame { display: block; width: 100%; height: 560px; margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--ground); }
.ledger-row span.mm-error { margin-top: 4px; padding-left: 10px; border-left: 3px solid var(--hold-tint); color: var(--hold); overflow-wrap: anywhere; }

/* Mass Email: the composer */
.mm-saved { flex: none; margin-top: 8px; color: var(--ink-2); font-size: 14px; font-weight: 600; text-align: right; max-width: 45%; }
.mm-compose { display: grid; gap: 0 48px; }
.mm-compose .ledger:first-child { margin-top: 20px; }
@media (min-width: 1200px) {
    .mm-compose { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; }
    .mm-side { position: sticky; top: calc(24px + var(--headbar)); }
}
.mm-pair { display: grid; gap: 0 12px; }
@media (min-width: 768px) { .mm-pair { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
.mm-blocks { display: grid; gap: 12px; margin-top: 12px; }
.mm-block { padding: 4px 12px 12px; border: 1px solid var(--line); border-radius: 10px; }
.mm-block-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mm-block-head strong { font: 700 15px/1.2 var(--font-mark); }
.mm-block-acts { display: flex; }
.mm-block-acts .ais-icon-btn { font-size: 15px; }
.mm-block-acts .ais-icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.mm-remove { color: var(--hold); }
.mm-tight { margin-top: 4px; }
.mm-image { margin: 8px 0 0; }
.mm-image img { display: block; max-width: 100%; max-height: 200px; border: 1px solid var(--line); border-radius: 6px; }
.mm-image figcaption { margin-top: 4px; color: var(--ink-2); font-size: 13px; }
.mm-add { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 12px; }
.mm-kind { max-width: 360px; }
.mm-filters-grid, .mm-term-fields { display: grid; gap: 0 12px; }
.mm-term-fields { grid-column: 1 / -1; }
@media (min-width: 768px) {
    .mm-filters-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mm-term-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.mm-filters-grid > .ais-check { margin-top: 8px; }
.mm-multi { position: relative; }
.mm-multi summary {
    display: flex; align-items: center; min-height: 44px; padding: 10px 36px 10px 12px;
    border: 1px solid var(--field-line); border-radius: 10px; background: var(--ground);
    cursor: pointer; list-style: none; position: relative;
}
.mm-multi summary::-webkit-details-marker { display: none; }
.mm-multi summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-multi summary::after {
    content: ""; position: absolute; right: 14px; top: 50%; width: 8px; height: 8px; margin-top: -6px;
    border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: rotate(45deg);
}
.mm-multi[open] summary { border-color: var(--green-800); }
.mm-multi-list { display: grid; max-height: 260px; overflow-y: auto; margin-top: 4px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 10px; }
.mm-multi-list .ais-check { min-height: 40px; align-items: flex-start; padding: 9px 0; font-size: 15px; line-height: 1.35; }
.mm-multi-list .ais-check input { flex: none; margin: 0; }
.mm-audience { margin-top: 16px; }
.mm-audience p + p { margin-top: 4px; }
.mm-samples { color: var(--ink-2); font-size: 14px; overflow-wrap: anywhere; }
.mm-width { margin-top: 12px; }
.mm-width button { min-width: 0; }
.mm-frame-wrap { background: var(--ground-2); border-radius: 10px; }
.mm-frame-wrap .mm-frame { height: 600px; margin-top: 12px; }
.mm-frame.is-narrow { width: 375px; max-width: 100%; margin-inline: auto; }
.mm-problems .stamp { flex: none; }
.mm-ready { margin-top: 12px; }
.mm-send-acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.mm-delete { margin-top: 8px; }
.mm-send-facts { margin-top: 12px; }
.ki-once summary { justify-content: space-between; gap: 12px; }
.ki-once summary::-webkit-details-marker { display: none; }
.ki-once summary { list-style: none; }
.ki-once summary i { flex: none; font-size: 13px; color: var(--ink-2); transition: transform 200ms var(--ease-out); }
.ki-once[open] summary i { transform: rotate(180deg); }
.mm-row-acts a.ais-link-btn { display: inline-flex; align-items: center; text-decoration: none; }

/* ---- system (phase 4) ---------------------------------------------------- */
/* The admin's system pages and the signed-out pages: sign-in, password reset,
 * two-factor, Dashboard, Users, analytics, logs, IP, address migration,
 * Modules, Downtime, Email Accounts, Terms, Fresh Start, Mass Complete. */

/* Sign-in, reset, two-factor: one calm column on the public frame. */
.sys-login { max-width: 440px; margin: 0 auto; }
.sys-login-head { text-align: center; padding: 8px 0 4px; }
.sys-seal { display: block; width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }
.sys-login-head h1 { font-size: 26px; }
.sys-login-head p { margin-top: 4px; color: var(--ink-2); font-size: 15px; }
.sys-login-form { margin-top: 8px; }
.sys-login-checks { display: grid; margin-top: 12px; }
.sys-login-checks .ais-check { align-items: flex-start; padding: 10px 0 0; min-height: 0; }
.sys-login-checks .ais-check input { flex: none; margin-top: 1px; }
.sys-login-terms { display: inline; padding: 0; border: 0; background: none; cursor: pointer; color: var(--green-700); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.sys-login-submit { width: 100%; margin-top: 16px; }
.sys-login-forgot { display: flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 8px; font-weight: 700; font-size: 15px; }
.ais .sys-login-note { margin-top: 12px; }
.ais .sys-login-alt { margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--line); text-align: center; color: var(--ink-2); font-size: 15px; }
.sys-login-alt .ais-link-btn { padding: 0 4px; font-size: 15px; }
.sys-strip { display: block; width: min(320px, 100%); height: auto; margin: 24px auto 0; }

/* Sign-in on the campus. The campus is the chrome; the sign-in card is laid on it.
   images/campus-tone-* is images/reg.jpeg cropped to the building's panorama
   (rows 200-1120) with a light split tone: luminance mapped to green-900,
   #4C8C6E, #FFF4DC (shadows, mids, highlights), blended over the original at
   35%. Sky, facade and walkway keep their colour; shadows lean green, highlights
   warm. The top bar's green runs on into the sky.
   The card overlaps the photo with the seal on its top edge, and is the one
   piece of the record that is lifted (DESIGN.md, "Sign-in card"), so it stands
   clear of the white page below. .sys-login turns into display: contents, so
   its parts take their own places on the page. Messages never touch the card:
   they float as toasts (login.html, block notices), so nothing moves when one
   arrives.
   Sized to fit at 100% zoom: on desktop the whole page fits the window (the
   photo takes what the card leaves); on a phone the photo, the card and its
   last link fit the first screen, with the strip and contacts just below. */
.ais.is-bare .ais-main:has(> .sys-login.is-campus) { display: flex; flex-direction: column; padding-top: 0; }
.sys-login.is-campus { display: contents; }
.sys-campus {
    order: -1; position: relative; overflow: hidden;
    /* Whatever the first screen leaves beside the card (about 560px, 64px of it over the photo), within reason. */
    height: clamp(184px, calc(100svh - var(--topbar) - var(--safe-top) - 520px), 360px);
    margin: 0 -16px; background: var(--chrome);
}
.sys-campus picture, .sys-campus img { display: block; width: 100%; height: 100%; }
.sys-campus img { object-fit: cover; object-position: 50% 52%; }
.sys-campus::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(to bottom, var(--chrome), transparent 34%);
}
@media (prefers-reduced-motion: no-preference) {
    .sys-campus img { animation: sys-campus-settle 1600ms var(--ease-out) both; }
}
@keyframes sys-campus-settle { from { transform: scale(1.06); } }
.sys-campus-name { display: none; }

/* The card: white, 16px corners, lifted with a green-black cast. */
.sys-login-sheet {
    position: relative; z-index: 1;
    width: 100%; max-width: 480px; margin: -64px auto 0;
    padding: 0 20px 16px;
    border-radius: 16px;
    background: var(--ground);
    box-shadow:
        0 0 0 1px rgba(0, 31, 26, 0.06),
        0 2px 4px rgba(0, 31, 26, 0.06),
        0 12px 24px rgba(0, 31, 26, 0.10),
        0 28px 56px rgba(0, 31, 26, 0.16);
}
/* The seal sits on the card's top edge, ringed in the card's white. */
.is-campus .sys-seal { width: 64px; height: 64px; margin: -32px auto 8px; box-shadow: 0 0 0 4px var(--ground); }

/* Sign-in's messages, as toasts. A signed-out page has no tab bar or rail to
   clear, so the stack floats 16px off the bottom, centred; several stack up. */
.ais.is-bare .ais-toast-region { left: 16px; bottom: calc(var(--safe-bottom) + 16px); }
.sys-toasts { flex-direction: column; align-items: center; gap: 8px; }
.sys-toasts .ais-toast { width: 100%; gap: 10px; }
.sys-toasts .ais-toast > span { flex: 1; padding: 10px 0; line-height: 1.35; }
.sys-toasts .ais-toast > i:first-child { flex: none; font-size: 17px; }
.is-campus .sys-login-head { padding: 0; }
.is-campus .sys-login-head p { margin-top: 2px; }
.is-campus .sys-login-form { margin-top: 4px; }
.is-campus .ais-field { margin-top: 12px; gap: 4px; }
.is-campus .sys-login-checks { margin-top: 4px; }
.is-campus .sys-login-checks .ais-check { padding-top: 8px; }
.is-campus .sys-login-submit { margin-top: 14px; }
.is-campus .sys-login-forgot { margin-top: 2px; }
.ais .is-campus .sys-login-note { margin-top: 10px; padding: 10px 12px; font-size: 14px; }
.ais .is-campus .sys-login-alt { margin-top: 12px; padding-top: 4px; }
.sys-login-alt .ais-link-btn { min-height: 40px; }
/* The certification strip, larger than on the plain sign-in column. */
.is-campus .sys-strip { width: min(420px, 100%); margin-top: 28px; }
.is-campus .sys-foot { margin-top: 20px; }
@media (min-width: 768px) {
    .sys-campus { margin-left: -24px; margin-right: -24px; height: clamp(220px, calc(100svh - var(--topbar) - var(--safe-top) - 560px), 460px); }
    .sys-login-sheet { padding-left: 32px; padding-right: 32px; }
}

@media (min-width: 1024px) {
    /* One window, no scroll. The panorama spans it; the card stands on its
       right, the College's name sits on the lawn at left, and the strip and
       contacts follow under the name. Rows: the photo above the card (it takes
       whatever height is left), the 264px the card overlaps it by, then the
       rest of the card. */
    .ais.is-bare .ais-main:has(> .sys-login.is-campus) {
        display: grid;
        grid-template-columns: minmax(40px, 1fr) minmax(0, 600px) 64px 460px minmax(40px, 1fr);
        grid-template-rows: minmax(64px, 1fr) 264px auto;
        min-height: calc(100dvh - var(--topbar) - var(--safe-top));
        max-width: none; margin: 0; padding: 0 0 24px;
    }
    .sys-campus { grid-column: 1 / -1; grid-row: 1 / 3; height: auto; margin: 0; }
    /* Out of flow, so the photo's own height never claims the flexible row. */
    .sys-campus picture { position: absolute; inset: 0; }
    /* A laptop's band is a thin slice: frame the facade and the sculpture,
       the name reads on the shaded plaza below them. */
    .sys-campus img { object-position: 50% 52%; }
    .sys-campus::after {
        background:
            linear-gradient(to bottom, var(--chrome), transparent 26%),
            linear-gradient(to top, rgba(0, 31, 26, 0.82), rgba(0, 31, 26, 0.4) 26%, rgba(0, 31, 26, 0) 48%);
    }
    .sys-campus-name {
        position: relative; z-index: 1;
        grid-column: 2; grid-row: 1 / 3; align-self: end;
        display: grid; gap: 8px; margin: 0 0 32px;
        color: var(--on-green);
    }
    .sys-campus-name strong { font: 700 28px/1.2 var(--font-mark); text-wrap: balance; }
    .sys-campus-name span { color: var(--on-green-2); font-size: 15px; }

    .sys-login-sheet {
        grid-column: 4; grid-row: 2 / -1; align-self: start;
        max-width: none; margin: 0; padding: 0 36px 20px; border-radius: 12px;
    }
    /* No rail beside a signed-out page: the toasts centre in the window. */
    .ais.is-bare .ais-toast-region { left: 16px; bottom: 24px; }
    /* On sign-in they stand in the card's column, under the hand that just pressed Sign in
       (the grid's 460px column, 40px or the centring margin from the right). */
    .ais.is-bare .sys-toasts { left: auto; width: 460px; right: max(40px, calc((100vw - 1124px) / 2)); }
    .is-campus .sys-seal { width: 72px; height: 72px; margin-top: -36px; }
    .is-campus .sys-login-head h1 { font-size: 30px; }

    .sys-login-aside { grid-column: 2; grid-row: 3 / -1; padding-top: 28px; }
    .is-campus .sys-strip { width: min(520px, 100%); margin: 0; }
    .sys-login-aside .sys-foot { text-align: left; }
    .sys-login-aside .sys-foot-line { justify-content: flex-start; margin-left: -12px; }
}
@media (min-width: 1440px) {
    .sys-campus-name strong { font-size: 34px; }
}
/* A tall window has room for the sky and the whole sculpture; the name moves onto the lawn. */
@media (min-width: 1024px) and (min-height: 900px) {
    .sys-campus img { object-position: 50% 70%; }
}

.sys-back { display: flex; justify-content: center; margin-top: 12px; }
.sys-foot { margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 13px; text-align: center; }
.sys-foot-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 12px; }
.sys-foot-line a, .sys-foot-line span { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--ink-2); }
.sys-foot-line a { text-decoration: none; }
.sys-foot-line a:hover { color: var(--green-700); }
.ais .sys-foot-social { justify-content: center; min-width: 44px; font-size: 16px; }
.sys-foot-long { display: none; }
.sys-foot-short { display: block; }
@media (min-width: 768px) {
    .sys-foot-long { display: block; }
    .sys-foot-short { display: none; }
}
.sys-terms-sub { margin-top: 4px !important; font-size: 14px; }
.sys-terms-body { max-height: min(56vh, 520px); overflow-y: auto; margin-top: 12px; padding: 4px 12px 4px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 15px; }
.sys-terms-text { font-size: 15px; }
.sys-terms-text > * { max-width: 75ch; }
.ais :is(.sys-terms-body, .sys-terms-text) h3 { margin: 16px 0 6px; font-size: 16px; }
:is(.sys-terms-body, .sys-terms-text) h4 { margin: 10px 0 4px; font: 600 15px/1.3 var(--font-read); }
:is(.sys-terms-body, .sys-terms-text) p { margin: 6px 0 0 !important; color: var(--ink) !important; }
.ais :is(.sys-terms-body, .sys-terms-text) ul { margin: 6px 0 0; padding-left: 20px; list-style: disc; }
:is(.sys-terms-body, .sys-terms-text) li + li { margin-top: 2px; }
.ais .sys-howto-steps { margin-top: 12px; display: grid; gap: 8px; }
.sys-howto-step { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.sys-howto-step input { flex: none; width: 20px; height: 20px; margin-top: 2px; accent-color: var(--green-700); }
.sys-howto-step span { font-size: 14px; color: var(--ink-2); }
.sys-howto-step b { display: block; color: var(--ink); font-size: 15px; }
.sys-howto-final { cursor: default; opacity: 0.5; border-style: dashed; }
.sys-howto-final.is-ready { opacity: 1; border-style: solid; border-color: var(--clear); background: var(--clear-tint); }
.sys-howto-num { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ground-2); font: 700 12px/1 var(--font-mark); color: var(--ink); }
.sys-howto-final.is-ready .sys-howto-num { background: var(--clear-fill); color: #fff; }
.sys-howto-hint { font-size: 14px; }
.sys-reset-next { margin-top: 16px; }
/* The new-password meter (accounts/set_password.html, sysPassword in auth.js):
   four segments that fill and change tone with data-level 1–4. */
.ais .sys-pw-meter { display: grid; gap: 6px; margin: 10px 0 0; font-size: 14px; color: var(--ink-2); }
.sys-pw-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.sys-pw-bar span { height: 4px; border-radius: 2px; background: var(--line); }
.sys-pw-meter[data-level="1"] .sys-pw-bar span:nth-child(-n+1) { background: var(--hold-fill); }
.sys-pw-meter[data-level="2"] .sys-pw-bar span:nth-child(-n+2) { background: var(--warn-fill); }
.sys-pw-meter[data-level="3"] .sys-pw-bar span:nth-child(-n+3) { background: var(--pending-fill); }
.sys-pw-meter[data-level="4"] .sys-pw-bar span { background: var(--clear-fill); }
.sys-pw-meter[data-level="1"] { color: var(--hold); }
.sys-pw-meter[data-level="4"] { color: var(--clear); }
.ais-field input.sys-otp { font: 700 22px/1 var(--font-mark); letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }
.sys-narrow { max-width: 560px; }
.sys-steps { margin: 4px 0 0; padding-left: 20px; list-style: decimal; display: grid; gap: 4px; font-size: 15px; }
.ais ol.sys-steps { padding-left: 20px; list-style: decimal; }
.sys-totp { display: grid; justify-items: center; gap: 12px; margin-top: 20px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); }
.sys-totp-qr { width: 180px; height: 180px; image-rendering: pixelated; }
.sys-totp-key { width: 100%; }
.sys-totp-key p { color: var(--ink-2); font-size: 14px; }
.sys-totp-row { display: flex; gap: 8px; margin-top: 6px; }
.sys-totp-row code { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px; background: var(--ground-2); font-size: 14px; overflow-wrap: anywhere; }
.sys-form-acts { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* Shared by the admin pages. */
.ais .sys-first { margin-top: 8px; }
.sys-tools { border-bottom: 0; }
.ais .sys-tool-danger { padding: 0 8px; }
.ais .sys-head-note { margin-top: 8px; color: var(--ink-2); font-size: 14px; }
a.sys-head-link { color: var(--green-700); font-weight: 700; text-decoration: none; }
a.sys-head-link:hover { text-decoration: underline; }
.sys-cols { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 32px; }
.sys-cols > .ledger { min-width: 0; }
.sys-mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 14px; overflow-wrap: anywhere; }
.ledger-row strong.sys-mono { font-size: 16px; }
.ledger-row span.sys-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sys-when { color: var(--ink-2); font-size: 13px; font-weight: 600; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.sys-when small { display: block; font-weight: 400; }
.ledger-row span.sys-when { display: block; color: var(--ink-2); font-size: 13px; }
.sys-row-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; margin: 4px 0 0 -8px; }
.sys-row-acts form { display: inline; }
.sys-row-acts .ais-link-btn.is-danger { padding: 0 8px; }
a.ais-link-btn { display: inline-flex; align-items: center; text-decoration: none; }
.sys-dialog { max-height: calc(100dvh - 32px); }
.sys-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.sys-fieldset legend { padding: 0; margin-top: 16px; font-weight: 600; }
.sys-choices { display: grid; }
.sys-choices .ais-check { align-items: flex-start; padding-top: 10px; min-height: 0; }
.sys-choices .ais-check input { flex: none; margin-top: 1px; }
.sys-choices .ais-check small { display: block; color: var(--ink-2); font-size: 13px; }
.sys-choices-row { display: flex; flex-wrap: wrap; gap: 0 20px; }
.sys-choices-row legend { width: 100%; }
.sys-pair { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 12px; }
@media (min-width: 576px) { .sys-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ais-field > span small { font-weight: 400; color: var(--ink-2); }
.ais .sys-check-gap { margin-top: 12px; }
.ais-dialog p.sys-dialog-key { color: var(--ink); font-weight: 700; font-size: 18px; }
.ais-dialog p.sys-picked { color: var(--clear); font-weight: 600; }
.sys-edit-facts { margin-top: 16px; }
.fl-results.sys-results { position: static; margin-top: 8px; box-shadow: none; max-height: 240px; overflow-y: auto; }

/* Figures in rows (Dashboard, analytics). */
.sys-figure-text { min-width: 0; }
.ledger-row .sys-figure-text > span { display: block; color: var(--ink-2); font-size: 14px; }
.ledger-row .sys-figure-text strong { color: var(--ink); }
.sys-figure-side { display: flex; align-items: center; gap: 12px; }
.ledger-row span.sys-figure-side { display: flex; }
.ledger-row span.sys-figure-unit { color: var(--ink-2); font-size: 13px; }
.sys-go { color: var(--green-700); font-size: 13px; }
@media (min-width: 1024px) { .sys-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Users */
.sys-user { align-items: start; }
.ais .sys-online { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 16px; color: var(--ink-2); font-size: 14px; }
.sys-online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--clear); box-shadow: 0 0 0 3px var(--clear-tint); }
.sys-online small { margin-left: auto; font-size: 12px; }

/* Address Migration */
.sys-migrate-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 12px; }
.sys-migrate-bar .ais-chips { margin-top: 0; }
.sys-per { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; color: var(--ink-2); font-size: 14px; }
.sys-per span { margin-right: 4px; }
.sys-per a { display: inline-grid; place-items: center; min-width: 44px; min-height: 40px; padding: 0 8px; border-radius: 9px; color: var(--ink-2); font-weight: 700; font-variant-numeric: tabular-nums; text-decoration: none; }
.sys-per a:hover { background: var(--ground-2); }
.sys-per a[aria-current="page"] { background: var(--fill); color: #fff; }
.sys-bulk { display: grid; gap: 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.sys-bulk-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; }
.sys-bulk .cur-key { margin-top: 8px; }
.sys-band-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-height: 44px; padding: 6px 0; border-bottom: 1px solid var(--line); background: var(--ground-2); cursor: pointer; font-size: 14px; color: var(--ink-2); }
.sys-band-head input, .sys-migrate-row input, .sys-pick input { flex: none; width: 20px; height: 20px; margin: 0 0 0 8px; accent-color: var(--green-700); }
.sys-band-head .sys-mono { color: var(--ink); font-weight: 600; }
.ledger-row.sys-migrate-row { grid-template-columns: 28px minmax(0, 1fr) auto; align-items: start; }
.sys-migrate-row input { margin: 2px 0 0; }
.sys-suggest { color: var(--ink-2); font-size: 14px; font-style: italic; }
@media (max-width: 575.98px) {
    .ledger-row.sys-migrate-row, .ledger-row.sys-pick { grid-template-columns: 28px minmax(0, 1fr); }
    .sys-pick > .stamp, .sys-pick > .sys-figure-side { grid-column: 2; justify-self: start; }
    .sys-migrate-row .adv-side { grid-column: 2; align-items: flex-start; }
}
@media (min-width: 768px) {
    .sys-bulk { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
    .sys-bulk .cur-key { grid-column: 1 / -1; }
}

/* Switches (Modules, Downtime, Email Accounts) */
.sys-switch-row { align-items: start; }
.sys-switch-side { display: flex; align-items: center; gap: 12px; }
.sys-closing { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.sys-closing input { min-height: 44px; padding: 6px 12px; border: 1px solid var(--field-line); border-radius: 10px; background: var(--ground); color: var(--ink); font: 400 16px/1.3 var(--font-read); }
.sys-closing input:focus-visible { border-color: var(--green-800); }
@media (max-width: 767px) { .ledger-row:has(> .sys-closing) { grid-template-columns: minmax(0, 1fr); } .sys-closing { justify-content: flex-start; } }
.sys-switch {
    flex: none; appearance: none; -webkit-appearance: none; position: relative;
    width: 48px; height: 28px; margin: 8px 0; border-radius: 14px;
    background: var(--field-line); cursor: pointer; transition: background-color 160ms ease;
}
.sys-switch::before {
    content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
    background: var(--disc); box-shadow: 0 1px 2px rgba(38, 50, 56, 0.3); transition: transform 160ms var(--ease-out);
}
.sys-switch:checked { background: var(--switch-on); }
.sys-switch.is-hazard:checked { background: var(--hold-fill); }
.sys-switch:checked::before { transform: translateX(20px); }
.sys-switch:disabled { opacity: 0.45; cursor: progress; }
.ais .sys-push { margin-top: 12px; }
.sys-mass { min-height: 44px; margin-top: 4px; font-size: 14px; }
.sys-mass .sys-switch { margin: 0; }

/* Email Accounts */
.sys-quota { margin-top: 16px; grid-template-columns: minmax(0, 1fr); }
.record-facts dd.sys-quota-note { font-weight: 400; color: var(--ink-2); font-size: 14px; }
@media (min-width: 768px) { .sys-quota { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sys-mail { align-items: start; }
.sys-mail.is-off strong { color: var(--ink-2); }
.sys-prio { display: inline-grid; place-items: center; min-width: 32px; height: 24px; margin-right: 6px; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; font: 700 13px/1 var(--font-mark); font-variant-numeric: tabular-nums; color: var(--ink-2); vertical-align: 2px; }

/* Terms, Fresh Start, Mass Complete */
.sys-term { align-items: start; }
.sys-term-flags { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.sys-how { margin-top: 12px; padding: 4px 14px; border-radius: 10px; background: var(--ground-2); font-size: 14px; }
.sys-how summary { min-height: 40px; display: flex; align-items: center; cursor: pointer; font-weight: 700; color: var(--green-700); }
.ais .sys-how ul { padding: 0 0 8px 20px; list-style: disc; display: grid; gap: 4px; }
.ledger-row.sys-pick { grid-template-columns: 28px minmax(0, 1fr) auto; align-items: start; cursor: pointer; }
.sys-pick input { margin: 2px 0 0; }
.sys-pick.is-off { cursor: default; }
.sys-pick.is-off strong { color: var(--ink-2); }
.sys-pick-acts { justify-content: space-between; }
.sys-pick-acts .cur-key { margin: 0; flex: 1 1 auto; }
.sys-mass-all { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; }
.sys-mass-all .cur-key { margin: 0; }

/* Edit User Profile */
.ais .sys-sub { margin-top: 20px; font: 700 13px/1.2 var(--font-read); letter-spacing: 0.06em; text-transform: uppercase; color: var(--green-800); }

.ais .sp-card.sys-address { margin-top: 4px; }
.sys-grid { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 16px; }
@media (min-width: 576px) { .sys-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sys-wide { grid-column: 1 / -1; } }
.sys-edu { margin: 16px 0 0; padding: 4px 14px 14px; border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.sys-edu-head { display: flex; align-items: center; gap: 12px; padding: 0 4px; font: 700 15px/1.2 var(--font-mark); }
#eduList + .ais-btn { margin-top: 12px; }

/* ---- leftovers (phase 4) ---- */
/* The last pages off Bootstrap: the faculty first-login wizard (fsu-), the
   student ID update page (idu-), and the two standalone kiosk screens: the
   frame both share (kio-), the email generator (keg-) and the NSTP walk-in
   kiosk (nk-). The Insights page keeps its own static/css/insights.css. */

/* Student ID update (bare shell). */
.idu-ids {
    display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: 12px 16px;
    margin: 8px 0 20px; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.idu-id { min-width: 0; text-align: center; }
.idu-id dt { color: var(--ink-2); font-size: 13px; font-weight: 600; }
.idu-id dd {
    margin: 4px 0 0; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px;
    font: 700 20px/1.2 var(--font-mark); font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.idu-id.is-old dd { color: var(--ink-2); background: var(--ground-2); }
.idu-id.is-new dd { color: var(--green-800); background: var(--green-tint); border: 2px solid var(--green-800); font-size: 24px; }
.idu-arrow { align-self: center; margin-top: 20px; color: var(--green-700); font-size: 18px; }
.idu-note { margin-bottom: 20px; }
.idu-go { width: 100%; min-height: 52px; font-size: 17px; }
@media (max-width: 479px) { .idu-arrow { margin-top: 0; transform: rotate(90deg); flex-basis: 100%; text-align: center; } .idu-id { flex-basis: 100%; } }

/* Faculty first-login wizard (bare shell). */
.fsu-progress { height: 6px; margin: -4px 0 16px; border-radius: 3px; background: var(--ground-2); overflow: hidden; }
.fsu-progress span { display: block; height: 100%; background: var(--green-700); transition: width 300ms var(--ease-out); }
.fsu-notice { margin-bottom: 16px; }
.fsu-notice > span { flex: 1 1 auto; }
.fsu-errlist { margin-top: 6px !important; padding-left: 18px !important; list-style: disc !important; font-size: 14px; }
.fsu-step .sp-hint { margin-bottom: 4px; }
.fsu .fsu-group {
    display: flex; align-items: center; gap: 8px; margin: 28px 0 0; padding: 0;
    font: 700 13px/1.2 var(--font-read) !important; letter-spacing: 0.06em; text-transform: uppercase; color: var(--green-800);
}
.fsu .fsu-group::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.fsu .fsu-group i { font-size: 12px; }
.fsu-req { color: var(--hold); font-weight: 700; }
.fsu-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; }
@media (min-width: 576px) {
    .fsu-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fsu-row.is-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 576px) and (max-width: 767px) { .fsu-row.is-four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fsu .ais-field input.is-invalid, .fsu .ais-field select.is-invalid { border-color: var(--hold); box-shadow: inset 0 0 0 1px var(--hold); }
.fsu-err { display: none; color: var(--hold) !important; font-size: 14px !important; font-weight: 600; }
.fsu .is-invalid ~ .fsu-err { display: block; }
.fsu-group-err { display: block; margin-top: 8px !important; }
.fsu-check { display: flex; margin-top: 12px; }
.fsu-address.sp-card { margin-top: 12px; }
.fsu-devices { margin: 0; padding: 0; border: 0; min-width: 0; }
.fsu-devices legend { width: 100%; }
.fsu-checks { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; margin-top: 8px; }
@media (min-width: 576px) { .fsu-checks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fsu-checks .ais-check { display: flex; }
.fsu-edu { margin: 16px 0 0; padding: 4px 0 16px; border: 0; border-bottom: 1px solid var(--line); min-width: 0; }
.fsu-edu-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.fsu-edu-head legend { float: left; padding: 0; font: 700 17px/1.2 var(--font-mark); }
.fsu-edu-head .ais-link-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.fsu-edu input[readonly] { background: var(--ground-2); color: var(--ink-2); }
.fsu-edu-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 16px; }
.fsu-edu-add .fsu-group-err { margin-top: 0 !important; }
.fsu-done { display: grid; justify-items: center; gap: 10px; padding: 28px 0 12px; text-align: center; }
.fsu-done h2 { font-size: 24px; }
.fsu-done p { max-width: 52ch; color: var(--ink-2); }
.fsu-done .fsu-done-note { margin-top: 8px; padding: 12px 14px; border-radius: 10px; background: var(--ground-2); color: var(--ink); font-size: 15px; text-align: left; }

/* The two kiosk screens: standalone pages on ais.css, no shell. */
body.ais.kio { display: block; min-height: 100dvh; background: var(--ground-2); }
.kio-frame { display: flex; flex-direction: column; min-height: 100dvh; }
.kio-head {
    display: flex; align-items: center; gap: 12px;
    padding: calc(12px + var(--safe-top)) 16px 12px;
    background: var(--chrome); color: var(--on-green);
}
.kio-head img { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--disc); box-shadow: 0 0 0 2px rgba(255,255,255,0.25); }
.kio-head-name { display: grid; min-width: 0; flex: 1; }
.kio-head-name strong { font: 700 18px/1.2 var(--font-mark); }
.kio-head-name span { color: var(--on-green-2); font-size: 14px; }
.kio-head-step {
    flex: none; padding: 6px 12px; border: 2px solid var(--on-green-2); border-radius: 6px;
    font: 700 12px/1 var(--font-mark); letter-spacing: 0.06em; text-transform: uppercase; font-variant-numeric: tabular-nums;
}
.kio-main { flex: 1; width: 100%; max-width: 800px; margin: 0 auto; padding: 20px 16px calc(32px + var(--safe-bottom)); }
.kio-card { margin-top: 16px; padding: 20px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--ground); }
.kio-card:first-child { margin-top: 0; }
.kio-card h1 { font-size: 24px; }
.kio-lede { margin-top: 4px !important; color: var(--ink-2); }
.kio-req { color: var(--hold); font-weight: 700; }
.kio-field input { min-height: 52px; font-size: 18px; }
.kio .ais-field input.is-invalid { border-color: var(--hold); box-shadow: inset 0 0 0 1px var(--hold); }
.kio-error { margin-top: 16px; }
.kio-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; }
@media (min-width: 640px) { .kio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kio-wide { grid-column: 1 / -1; } }
.kio-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.kio-actions .kio-btn { flex: 1 1 100%; }
.kio-actions.is-split .kio-btn { flex: 1 1 auto; }
.kio-actions.is-split .kio-btn:first-child { flex: 0 0 auto; padding: 0 20px; }
.kio-btn { min-height: 56px; font-size: 17px; white-space: nowrap; }
.kio-steps { display: flex; justify-content: center; gap: 8px; margin-bottom: 20px !important; counter-reset: none; }
.kio-steps li {
    display: flex; align-items: center; gap: 8px; flex: 0 1 auto;
    color: var(--ink-2); font: 700 13px/1.2 var(--font-read); letter-spacing: 0.06em; text-transform: uppercase;
}
.kio-steps li + li::before { content: ""; width: 24px; height: 2px; margin-right: 0; background: var(--line); }
.kio-dot {
    display: grid; place-items: center; width: 32px; height: 32px; border: 2px solid var(--line); border-radius: 50%;
    background: var(--ground); color: var(--ink-2); font: 700 14px/1 var(--font-mark);
}
.kio-steps li.is-current, .kio-steps li.is-done { color: var(--green-800); }
.kio-steps li.is-current .kio-dot { border-color: var(--fill); background: var(--fill); color: var(--on-green); }
.kio-steps li.is-done .kio-dot { border-color: var(--green-800); color: var(--green-800); }
.kio-steps li.is-done + li::before, .kio-steps li.is-current + li::before { background: var(--green-700); }
.kio-steps li.is-current + li::before { background: var(--line); }
@media (max-width: 419px) { .kio-steps { gap: 6px; } .kio-steps li { gap: 6px; font-size: 12px; letter-spacing: 0.04em; } .kio-steps li + li::before { width: 12px; } .keg-creds dd { font-size: 19px; } }
@media (min-width: 480px) { .kio-steps li + li::before { width: 48px; } }
.kio-review { margin: 16px 0 0; }
.kio-review > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.kio-review dt { flex: none; color: var(--ink-2); font-size: 14px; font-weight: 600; }
.kio-review dd { margin: 0; min-width: 0; font-size: 18px; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.kio-review dd.is-empty { color: var(--ink-2); font-weight: 400; font-style: italic; }
@media (min-width: 1024px) {
    .kio-head { padding-left: 32px; padding-right: 32px; }
    .kio-main { padding-top: 32px; }
    .kio-card { padding: 28px; }
}

/* Email generator: the result screen. */
.keg-result-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding-bottom: 16px; border-bottom: 2px solid var(--ink); }
.keg-result-head > div { flex: 1 1 240px; }
.keg-creds { display: grid; gap: 16px; margin: 20px 0 0; }
.keg-creds dt { color: var(--ink-2); font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.keg-creds dd {
    margin: 6px 0 0; padding: 14px 16px; border-radius: 10px; text-align: center; overflow-wrap: anywhere;
    font: 700 22px/1.35 var(--font-mark);
}
.keg-email { background: var(--green-tint); color: var(--green-900); border: 2px solid var(--green-700); }
.keg-password { background: var(--warn-tint); color: var(--ink); border: 2px dashed var(--warn); font-size: 26px !important; letter-spacing: 0.04em; }
.keg-steps { display: grid; gap: 12px; margin-top: 20px !important; padding: 16px !important; border-radius: 10px; background: var(--ground-2); }
.keg-steps li { display: flex; align-items: flex-start; gap: 12px; font-size: 16px; }
.keg-steps i { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--ground); color: var(--green-800); font-size: 14px; }

/* NSTP walk-in kiosk. */
.nk-id { display: grid; justify-items: center; gap: 16px; padding-top: 32px; padding-bottom: 32px; text-align: center; }
.nk-id h1 { font-size: 24px; }
.nk-id-input {
    width: min(100%, 420px); min-height: 60px; padding: 10px 14px;
    border: 1px solid var(--field-line); border-radius: 10px; background: var(--ground); color: var(--ink);
    font: 700 24px/1.2 var(--font-mark); letter-spacing: 0.04em; text-align: center;
}
.nk-id-input:focus-visible { border-color: var(--green-800); }
.nk-id .kio-btn { width: min(100%, 420px); }
.nk-msg { font-size: 15px; }
.nk-msg.is-error { color: var(--hold); font-weight: 600; }
.nk-id .nk-msg { max-width: 48ch; }
.nk-who { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.nk-facts { flex: 1 1 320px; margin: 0; }
.nk-facts .nk-name { grid-column: 1 / -1; }
.nk-facts .nk-name dd { font: 700 22px/1.2 var(--font-mark); }
@media (min-width: 640px) { .nk-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.nk-level { flex: none; }
.nk-h { display: flex; align-items: center; gap: 10px; font-size: 19px; }
.nk-h i { color: var(--green-700); font-size: 15px; }
.nk-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; align-items: start; }
.nk-grid.is-measure { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.nk-grid.is-measure .nk-wide { grid-column: 1 / -1; }
@media (min-width: 640px) {
    .nk-grid.is-measure { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .nk-grid.is-measure .nk-wide { grid-column: span 2; }
    .nk-grid.is-board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.nk-bar .ais-btn.is-quiet { background: var(--ground); box-shadow: inset 0 0 0 1px var(--line); }
.nk-bar .ais-btn.is-quiet:hover { background: var(--line); }
.nk-options { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 12px; }
.nk-options:empty { display: none; }
@media (min-width: 640px) { .nk-options { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.nk-option {
    display: grid; gap: 4px; justify-items: start; min-height: 56px; padding: 12px 14px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--ground);
    color: var(--ink); font: 400 15px/1.35 var(--font-read); text-align: left; cursor: pointer;
}
.nk-option:hover { border-color: var(--green-700); }
.nk-option.is-selected { border-color: var(--green-800); background: var(--green-tint); box-shadow: inset 0 0 0 1px var(--green-800); }
.nk-option strong { font-size: 17px; }
.nk-option-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
.nk-left { color: var(--ink-2); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.nk-sub { color: var(--ink-2); font-size: 15px; overflow-wrap: anywhere; }
.nk-note { margin-top: 12px; }
.nk-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.nk-chip {
    min-height: 48px; padding: 0 16px; border: 1px solid var(--line); border-radius: 10px;
    background: var(--ground); color: var(--ink); font: 600 16px/1.2 var(--font-read); cursor: pointer;
}
.nk-chip:hover { border-color: var(--green-700); }
.nk-chip.is-selected { border-color: var(--fill); background: var(--fill); color: var(--on-green); }
.nk-bar { margin-top: 16px; }
#submitMsg.nk-msg { margin-top: 16px; }
.nk-done { display: grid; justify-items: center; gap: 10px; padding-top: 36px; padding-bottom: 36px; text-align: center; }
.nk-done h1 { font-size: 28px; }
.nk-done-name { font: 700 20px/1.3 var(--font-mark); }
.nk-done .kio-btn { margin-top: 12px; width: min(100%, 420px); }

/* ---- Desktop working layout -------------------------------------------- */
/*
 * From 1024px (2026-11-21): the page takes the full width beside the rail,
 * every page head is ruled off from its content, the rail's account foot
 * stays put while only the navigation scrolls, a footer closes the page, and
 * a ledger with room for it reads as a table: one line per row, its parts in
 * aligned columns, the trailing stamp or actions in the last column.
 * Generated selectors: keep the pattern when editing by hand.
 */

.ais-headbar, .ais-footer { display: none; }

/* A part of a row that is only sometimes there renders empty, so it keeps its
   column on desktop; stacked, it takes no line. */
.ledger-row > div:first-of-type > :empty { display: none; }

@media (min-width: 1024px) {
    .ais-rail { grid-column: 1; overflow: hidden; }
    .ais-main { grid-column: 2; max-width: none; padding: calc(28px + var(--headbar)) 40px calc(40px + var(--footbar)); }
    .page-narrow { max-width: none; }

    /* Only the navigation scrolls; the brand and the account foot stay put. */
    .ais-rail-nav {
        min-height: 0; overflow-y: auto; overscroll-behavior: contain;
        margin: -4px -12px 0; padding: 4px 12px 8px;
        scrollbar-width: thin; scrollbar-color: var(--green-600) transparent;
    }
    .ais-rail-user { flex: none; }
    .ais-rail-brand + .ais-rail-user { margin-top: auto; }

    /* The header and footer (DESIGN.md, Navigation): fixed beside the rail. */
    .ais-headbar, .ais-footer {
        position: fixed; left: var(--rail); right: 0; z-index: 30;
        display: flex; align-items: center; justify-content: space-between; gap: 24px;
        padding: 0 40px; background: var(--ground); color: var(--ink-2);
        white-space: nowrap;
    }
    .ais-headbar { top: 0; height: var(--headbar); border-bottom: 1px solid var(--panel-line); }
    .ais-footer { bottom: 0; height: var(--footbar); border-top: 1px solid var(--panel-line); font-size: 13px; }

    /* Every page head is ruled off from what it heads. */
    .page-head, .grades-head, .home-head { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }

    /* Denser rows, and a quiet wash under the pointer. */
    .ais-main .ledger-row:not(dialog *) {
        padding: 7px 10px;
        transition: background-color 160ms ease, box-shadow 160ms ease;
    }
    .ais-main .ledger-row:not(dialog *):hover { background: var(--ground-2); box-shadow: inset 3px 0 0 var(--green-700); }
    .ais-main .ledger-row:not(dialog *) strong { font-size: 15px; }
    .ais-main .ledger-empty:not(dialog *) { padding: 10px; }
    /* A pointer, not a thumb: row controls can be smaller than 44px here. */
    .ais-main .ledger-row:not(dialog *) .ais-btn { min-height: 34px; padding: 0 12px; font-size: 14px; }
    .ais-main .ledger-row:not(dialog *) .ais-link-btn { min-height: 32px; }

    .fin-office .fin-table th, .fin-office .fin-table td,
    .rq-table th, .rq-table td, .nsb-table th, .nsb-table td { padding-top: 6px; padding-bottom: 6px; }
    :is(.fin-table, .rq-table, .nsb-table) tbody tr > * { transition: background-color 160ms ease; }
    :is(.fin-table, .rq-table, .nsb-table) tbody tr:hover > * { background: var(--ground-2); }
}

/*
 * Ledger columns. How many columns a list needs is read off its widest row:
 * --ledger-lead for a checkbox or time before the text block, --ledger-text
 * for the parts of the text block, --ledger-side for what follows it (stamps,
 * figures, buttons), --ledger-acts for an actions group that sits inside the
 * text block and moves to the end.
 */
.ledger-rows:has(> .ledger-row > div:first-of-type > :nth-child(2), > li > .ledger-row > div:first-of-type > :nth-child(2)) { --ledger-text: repeat(2, auto); --ledger-text-fr: repeat(2, 1fr); }
.ledger-rows:has(> .ledger-row > div:first-of-type > :nth-child(3), > li > .ledger-row > div:first-of-type > :nth-child(3)) { --ledger-text: repeat(3, auto); --ledger-text-fr: repeat(3, 1fr); }
.ledger-rows:has(> .ledger-row > div:first-of-type > :nth-child(4), > li > .ledger-row > div:first-of-type > :nth-child(4)) { --ledger-text: repeat(4, auto); --ledger-text-fr: repeat(4, 1fr); }
.ledger-rows:has(> .ledger-row > div:first-of-type > :nth-child(5), > li > .ledger-row > div:first-of-type > :nth-child(5)) { --ledger-text: repeat(5, auto); --ledger-text-fr: repeat(5, 1fr); }
.ledger-rows:has(> .ledger-row > div:first-of-type > :nth-child(6), > li > .ledger-row > div:first-of-type > :nth-child(6)) { --ledger-text: repeat(6, auto); --ledger-text-fr: repeat(6, 1fr); }
.ledger-rows:has(> .ledger-row > div:first-of-type > :nth-child(7), > li > .ledger-row > div:first-of-type > :nth-child(7)) { --ledger-text: repeat(7, auto); --ledger-text-fr: repeat(7, 1fr); }
.ledger-rows:has(> .ledger-row > div:first-of-type > :nth-child(8), > li > .ledger-row > div:first-of-type > :nth-child(8)) { --ledger-text: repeat(8, auto); --ledger-text-fr: repeat(8, 1fr); }
.ledger-rows:has(> .ledger-row > div:first-of-type + *, > li > .ledger-row > div:first-of-type + *) { --ledger-side: auto; }
.ledger-rows:has(> .ledger-row > div:first-of-type + * + *, > li > .ledger-row > div:first-of-type + * + *) { --ledger-side: auto auto; }
.ledger-rows:has(> .ledger-row > div:first-of-type + * + * + *, > li > .ledger-row > div:first-of-type + * + * + *) { --ledger-side: auto auto auto; }
.ledger-rows:has(> .ledger-row > div:first-of-type > [class*="-row-acts"], > li > .ledger-row > div:first-of-type > [class*="-row-acts"]) { --ledger-acts: auto; }
.ledger-rows:has(> .ledger-row > :first-child:not(div), > li > .ledger-row > :first-child:not(div)) { --ledger-lead: auto; }

@supports (grid-template-columns: subgrid) {
    @media (min-width: 1024px) {
        .ais-main .ledger:not(dialog *) { container: ledger / inline-size; }
    }
    @container ledger (min-width: 900px) {
        .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) {
            display: grid; column-gap: 16px;
            grid-template-columns: var(--ledger-lead,) var(--ledger-text-fr, 1fr) var(--ledger-side,) var(--ledger-acts,);
        }
        .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > li:has(> .ledger-row) { display: contents; }
        .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > :not(.ledger-row, li:has(> .ledger-row)) { grid-column: 1 / -1; }
        /* Lead, side and actions are pinned to the one line first; the text parts
           then flow in order through the columns left between them. */
        .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > .ledger-row, .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > li > .ledger-row { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: center; }
        .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > .ledger-row > div:first-of-type, .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > li > .ledger-row > div:first-of-type { display: contents; }
        .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > .ledger-row > div:first-of-type > *, .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > li > .ledger-row > div:first-of-type > * {
            min-width: 0; margin-top: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
        }
        .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > .ledger-row > div:first-of-type > :empty, .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > li > .ledger-row > div:first-of-type > :empty { display: block; }
        /* Alpine's x-show hides a part with an inline display:none; here it keeps its cell, blank. */
        .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > .ledger-row > div:first-of-type > [x-show][style*='display: none'], .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > li > .ledger-row > div:first-of-type > [x-show][style*='display: none'] { display: block !important; visibility: hidden; }
        .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > .ledger-row > div:first-of-type > * span:not(.stamp), .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > li > .ledger-row > div:first-of-type > * span:not(.stamp) { display: inline; }
        .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > .ledger-row > div:first-of-type > * li, .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > li > .ledger-row > div:first-of-type > * li { flex-wrap: nowrap; }
        .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > .ledger-row > :first-child:not(div), .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > li > .ledger-row > :first-child:not(div) { grid-column: 1; grid-row: 1; }
        .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)):has(> .ledger-row > :first-child:not(div), > li > .ledger-row > :first-child:not(div)) > .ledger-row > div:first-child > :first-child, .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)):has(> .ledger-row > :first-child:not(div), > li > .ledger-row > :first-child:not(div)) > li > .ledger-row > div:first-child > :first-child { grid-column-start: 2; }
        .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > .ledger-row > div:first-of-type > [class*="-row-acts"], .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > li > .ledger-row > div:first-of-type > [class*="-row-acts"] {
            grid-column: -2; grid-row: 1; overflow: visible; display: flex; flex-wrap: nowrap; align-items: center; justify-content: flex-end; gap: 4px 12px; margin: 0;
        }
        .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > .ledger-row > div:first-of-type ~ *, .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > li > .ledger-row > div:first-of-type ~ * { grid-row: 1; justify-self: end; margin-top: 0; }
        .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > .ledger-row > div:first-of-type ~ div, .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > li > .ledger-row > div:first-of-type ~ div {
            display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 12px;
        }
        .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > .ledger-row > div:first-of-type ~ div > *, .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > li > .ledger-row > div:first-of-type ~ div > * { margin: 0; }
        /* The row is named by its first part: it never shrinks to nothing. */
        .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > .ledger-row > div:first-of-type > :first-child, .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > li > .ledger-row > div:first-of-type > :first-child { min-width: 10ch; }
        .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > .ledger-row > div:first-of-type ~ :nth-last-child(1), .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > li > .ledger-row > div:first-of-type ~ :nth-last-child(1) { grid-column: -2; }
        .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > .ledger-row > div:first-of-type ~ :nth-last-child(2), .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > li > .ledger-row > div:first-of-type ~ :nth-last-child(2) { grid-column: -3; }
        .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > .ledger-row > div:first-of-type ~ :nth-last-child(3), .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > li > .ledger-row > div:first-of-type ~ :nth-last-child(3) { grid-column: -4; }
        .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)):has(> .ledger-row > div:first-of-type > [class*="-row-acts"], > li > .ledger-row > div:first-of-type > [class*="-row-acts"]) > .ledger-row > div:first-of-type ~ :nth-last-child(1), .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)):has(> .ledger-row > div:first-of-type > [class*="-row-acts"], > li > .ledger-row > div:first-of-type > [class*="-row-acts"]) > li > .ledger-row > div:first-of-type ~ :nth-last-child(1) { grid-column: -3; }
        .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)):has(> .ledger-row > div:first-of-type > [class*="-row-acts"], > li > .ledger-row > div:first-of-type > [class*="-row-acts"]) > .ledger-row > div:first-of-type ~ :nth-last-child(2), .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)):has(> .ledger-row > div:first-of-type > [class*="-row-acts"], > li > .ledger-row > div:first-of-type > [class*="-row-acts"]) > li > .ledger-row > div:first-of-type ~ :nth-last-child(2) { grid-column: -4; }
        .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)):has(> .ledger-row > div:first-of-type > [class*="-row-acts"], > li > .ledger-row > div:first-of-type > [class*="-row-acts"]) > .ledger-row > div:first-of-type ~ :nth-last-child(3), .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)):has(> .ledger-row > div:first-of-type > [class*="-row-acts"], > li > .ledger-row > div:first-of-type > [class*="-row-acts"]) > li > .ledger-row > div:first-of-type ~ :nth-last-child(3) { grid-column: -5; }
    }
    /* With room to spare, columns fit their content like a table's and what
       follows the text keeps to one line. Narrower, the stamp and actions are
       served first and the text parts share what is left. */
    @container ledger (min-width: 1020px) {
        .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) {
            grid-template-columns: var(--ledger-lead,) var(--ledger-text, auto) var(--ledger-side,) var(--ledger-acts,);
        }
        .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > .ledger-row > div:first-of-type ~ div, .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > li > .ledger-row > div:first-of-type ~ div, .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > .ledger-row > div:first-of-type ~ * div, .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > li > .ledger-row > div:first-of-type ~ * div { flex-wrap: nowrap; }
        /* No part shrinks to a letter or two; an empty one may. */
        .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > .ledger-row > div:first-of-type > :not(:empty), .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > li > .ledger-row > div:first-of-type > :not(:empty) { min-width: 4ch; }
        .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > .ledger-row > div:first-of-type > :first-child, .ledger .ledger-rows:not(.is-stacked, dialog *, :has(> .ledger-row > :first-child:not(div) + :not(div), > li > .ledger-row > :first-child:not(div) + :not(div), > .ledger-row > :only-child:not(div), > li > .ledger-row > :only-child:not(div), > .ledger-row > div:first-of-type + * + * + * + *, > li > .ledger-row > div:first-of-type + * + * + * + *)) > li > .ledger-row > div:first-of-type > :first-child { min-width: 12ch; }
    }
}


/* ---- Desk, panels and page layouts (2026-11-21) ------------------------- */
/*
 * The content sits on a pastel grey desk, and each section of the record is a
 * white panel on it, so the page never melts into one white field. Panels are
 * drawn with a hairline, not a shadow: they are still the record, not things
 * floating over it (The Ruled Record Rule). Section heads carry the colour: a
 * green wash band with a Record Green bar at its left, over a green-800 rule.
 *
 * Panels come from the components (.ledger, .record-facts, .record-term,
 * .adv-filters, .class-list, .sp-card, .ais-panel), never from the layout
 * slots, so a slot whose content is hidden leaves no empty box. A component
 * inside another panel, a next-step block or a dialog stays flat.
 */
:root {
    --desk: #EDF1F0;        /* pastel grey; Slate on it is 4.7:1 */
    --panel-line: #D8E0DF;
    --panel-x: 14px;
    --head-wash: #E6F2F0;   /* = green-tint */
}

body.ais { background: var(--desk); }
body.ais:has(.sys-login.is-campus) { background: var(--ground); }

/* Postgraduate accent (registrar Course Offerings and Student Enrollment):
   while the Postgraduate track is chosen, the page's greens become one blue
   scale built on the chart blue (cat-2), so a postgraduate table cannot be
   mistaken for an undergraduate one. Decision tones (Cleared, Hold, Pending)
   keep their own colours, since they mean the same thing on either track.
   .is-undergrad puts the greens back inside a postgraduate page (an Add
   dialog that has picked Undergraduate). Blue-700 on white is 6.4:1. */
.is-postgrad {
    --green-900: #0B2E59;
    --green-800: #134A8E;
    --green-700: #1A5DB0;
    --green-600: #2A78D6;
    --green-tint: #E8F1FC;
    --head-wash: #E8F1FC;
    --panel-line: #D3DEEC;
    --fill: #134A8E;
    --fill-deep: #0B2E59;
}
.is-undergrad {
    --green-900: #003D33;
    --green-800: #00574B;
    --green-700: #00695C;
    --green-600: #00897B;
    --green-tint: #E6F2F0;
    --head-wash: #E6F2F0;
    --panel-line: #D8E0DF;
    --fill: #00574B;
    --fill-deep: #003D33;
}
@media screen {
    [data-theme="dark"] .is-postgrad {
        --green-900: #CFE2FB;
        --green-800: #A9CCF7;
        --green-700: #8ABBF5;
        --green-600: #3987E5;
        --green-tint: #152A45;
        --head-wash: #152A45;
        --panel-line: #2A3A50;
        --fill: #1A5DB0;
        --fill-deep: #134A8E;
    }
    [data-theme="dark"] .is-undergrad {
        --green-900: #D5EEE9;
        --green-800: #93D6CA;
        --green-700: #74CDBE;
        --green-600: #4DB6AC;
        --green-tint: #16332E;
        --head-wash: #16332E;
        --panel-line: #2F3D3A;
        --fill: #00796B;
        --fill-deep: #00695C;
    }
}

/* Layout slots: spacing only. */
.ais-page { display: block; }
.ais-slot:not(:has(> :not(template, script))) { display: none; }
.ais-slot > :first-child { margin-top: 0; }
.ais-slot + .ais-slot, .ais-slot + .ais-panel, .ais-panel + .ais-slot { margin-top: 20px; }
.ais-slot.is-toolbar { display: grid; gap: 12px; }
.ais-slot.is-toolbar:not(:has(> :not(template, script))) { display: none; }
.ais-slot.is-toolbar > * { margin-top: 0; margin-bottom: 0; }
.ais-page.is-form { max-width: 880px; }
.ais-page.is-form.sys-login { max-width: 440px; } /* the sign-in card's column (password reset, 2FA) */

/* The page head: ruled off, with a short green accent on the rule. */
.page-head:has(> .page-head-text) { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.page-head-text { flex: 1 1 280px; min-width: 0; }
.page-head > :not(.page-head-text) { flex: none; }
.page-head > .stamp { margin-top: 6px; }
.page-head { position: relative; padding-bottom: 14px; border-bottom: 1px solid var(--panel-line); }
.page-head::after {
    content: ""; position: absolute; left: 0; bottom: -2px;
    width: 56px; height: 3px; border-radius: 2px; background: var(--green-700);
}
.page-head h1 { color: var(--green-900); }
dialog .page-head { border-bottom: 0; padding-bottom: 0; }
dialog .page-head::after { display: none; }

/* The panel. */
.ais-main :is(.ledger, .record-term, .class-list, .sp-card, .ais-panel):not(dialog *, :is(.ledger, .record-term, .ais-panel, .ais-next, .sp-card, .class-list) *) {
    background: var(--ground);
    border: 1px solid var(--panel-line);
    border-radius: var(--radius);
    padding: 0 var(--panel-x) 6px;
}
.ais-main .ais-panel:not(dialog *, :is(.ledger, .record-term, .ais-panel, .ais-next, .sp-card) *) { padding: 4px var(--panel-x) 18px; }
.ais-main .ais-panel.is-form > :first-child { margin-top: 12px; }
.ais-main .class-list:not(dialog *, :is(.ledger, .record-term, .ais-panel, .ais-next, .sp-card, .class-list) *) { border-top: 1px solid var(--panel-line); }
.ais-main .ledger:not(dialog *) { margin-top: 20px; }
.ais-slot > .ledger:first-child, .home-col > .ledger:first-child { margin-top: 0; }
.ais-main .ais-next:not(dialog *) + .ledger { margin-top: 20px; }

/* Section heads: the green wash band and its bar. */
.ais-main .ledger:not(dialog *, :is(.ledger, .record-term, .ais-panel, .ais-next, .sp-card) *) > .ledger-head {
    margin: 0 calc(-1 * var(--panel-x)) 2px;
    padding: 12px var(--panel-x) 10px calc(var(--panel-x) + 4px);
    border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
    border-bottom: 2px solid var(--green-800);
    background: var(--head-wash);
    box-shadow: inset 4px 0 0 var(--green-700);
}
.ais-main .ledger:not(dialog *) > .ledger-head h2 { color: var(--green-900); }
.ais-main .ledger:not(dialog *) > .ledger-head .ledger-count { color: var(--green-800); }
/* A ledger nested in a panel keeps the plain ruled head. */
.ais-main :is(.ais-panel, .record-term, .sp-card) .ledger > .ledger-head h2 { color: var(--ink); }

/* The last row needs no rule: the panel's edge closes it. */
.ais-main .ledger:not(dialog *) > :is(.ledger-rows, ul, ol) > .ledger-row:last-child,
.ais-main .ledger:not(dialog *) > :is(.ledger-rows, ul, ol) > li:last-child > .ledger-row,
.ais-main .ledger:not(dialog *) > .ledger-empty:not(:has(~ .ledger-more, ~ .ledger-rows, ~ .ledger-row)),
.ais-main .ledger:not(dialog *) > :last-child:not(.ledger-head) { border-bottom-color: transparent; }
.ais-main .ledger:not(dialog *) > .ledger-more { margin-top: 2px; }
/* An empty state standing outside every panel is a panel of its own. */
.ais-main .ledger-empty:not(dialog *, :is(.ledger, .record-term, .ais-panel, .ais-next, .sp-card, .class-list, .record-facts, .adv-filters, table) *) {
    background: var(--ground);
    border: 1px solid var(--panel-line);
    border-radius: var(--radius);
    padding: 16px var(--panel-x);
}
@media (min-width: 1024px) {
    .ais-main .ledger-empty:not(dialog *, :is(.ledger, .record-term, .ais-panel, .ais-next, .sp-card, .class-list, .record-facts, .adv-filters, table) *) { padding: 16px calc(var(--panel-x) + 10px); }
}

/* Folding terms: the summary takes the same band. */
.ais-main .record-term:not(dialog *, :is(.ledger, .record-term, .ais-panel, .ais-next, .sp-card, .class-list) *) { margin-top: 20px; }
.ais-main .record-term:not(dialog *, :is(.ledger, .record-term, .ais-panel, .ais-next, .sp-card, .class-list) *) > summary {
    margin: 0 calc(-1 * var(--panel-x));
    padding: 10px var(--panel-x) 10px calc(var(--panel-x) + 4px);
    border-radius: calc(var(--radius) - 1px);
    border-bottom: 0;
    background: var(--head-wash);
    box-shadow: inset 4px 0 0 var(--green-700);
}
.ais-main .record-term[open]:not(dialog *, :is(.ledger, .record-term, .ais-panel, .ais-next, .sp-card, .class-list) *) > summary { border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; border-bottom: 2px solid var(--green-800); }
.ais-main .record-term:not(dialog *, :is(.ledger, .record-term, .ais-panel, .ais-next, .sp-card, .class-list) *) .record-term-name { color: var(--green-900); }

/* Profile cards: the card head takes the band. */
.ais-main .sp-card:not(dialog *, :is(.ledger, .record-term, .ais-panel, .ais-next, .sp-card, .class-list) *) > .card-header {
    margin: 0 calc(-1 * var(--panel-x));
    padding-left: calc(var(--panel-x) + 4px); padding-right: var(--panel-x);
    border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
    background: var(--head-wash);
    box-shadow: inset 4px 0 0 var(--green-700);
}

/* Record facts: the summary of a record, on the green wash. */
.ais-main .record-facts:not(dialog *, :is(.ledger, .record-term, .ais-panel, .ais-next, .sp-card) *) {
    padding: 14px var(--panel-x);
    border: 1px solid var(--wash-edge);
    border-radius: var(--radius);
    background: var(--green-tint);
}
.ais-main .record-facts:not(dialog *, :is(.ledger, .record-term, .ais-panel, .ais-next, .sp-card) *) dt { color: var(--green-800); }

/* Filters: a white panel of fields. */
.ais-main .adv-filters:not(dialog *, :is(.ledger, .record-term, .ais-panel, .ais-next, .sp-card) *) {
    padding: 2px var(--panel-x) 14px;
    border: 1px solid var(--panel-line);
    border-radius: var(--radius);
    background: var(--ground);
}

/* Tallies: tone chips, each edged in its own ink so they read on the desk. */
.record-tally div { border: 1px solid color-mix(in srgb, currentColor 24%, transparent); }
.record-tally div:first-child { background: var(--ground); }
.record-tally div.is-sum { background: var(--ground); color: var(--ink); }

/* Quiet things that were Desk Grey on white keep their edge on the desk. */
.ais-main .ais-btn.is-quiet { background: var(--ground); box-shadow: inset 0 0 0 1px var(--panel-line); }
.ais-main .ais-btn.is-quiet:hover { background: var(--ground-2); }
.ais-main .ais-notice { box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 16%, transparent); }

/* Home: the photo slot at the greeting's left. */
.home-head { display: flex; align-items: center; gap: 14px; }
.home-head-text { min-width: 0; flex: 1; }
.home-photo {
    flex: none; display: grid; place-items: center;
    width: 64px; height: 64px; border-radius: 50%;
    background: var(--fill-deep); color: var(--on-green);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35);
    font: 700 22px/1 var(--font-mark); letter-spacing: 0.02em;
    overflow: hidden;
}
.home-photo i { font-size: 26px; color: var(--on-green-2); }
.home-photo img { width: 100%; height: 100%; object-fit: cover; }

@media (min-width: 768px) {
    .home-photo { width: 72px; height: 72px; font-size: 24px; }
}

@media (min-width: 1024px) {
    :root { --panel-x: 8px; }
    .page-head, .grades-head { border-bottom-color: var(--panel-line); }
    .ais-main .ais-panel:not(dialog *, :is(.ledger, .record-term, .ais-panel, .ais-next, .sp-card) *) { padding: 6px 24px 24px; }
    .ais-main .record-facts:not(dialog *, :is(.ledger, .record-term, .ais-panel, .ais-next, .sp-card) *) { padding: 16px 20px; }
    .ais-main .adv-filters:not(dialog *, :is(.ledger, .record-term, .ais-panel, .ais-next, .sp-card) *) { padding: 2px 18px 16px; }
    .ais-main .ledger:not(dialog *) > :is(.ledger-head) { padding-left: 22px; padding-right: 18px; }
    .ais-main .ledger:not(dialog *) > .ledger-more { margin-left: 10px; }
    /* Anything in a ledger that is not a row lines up with the rows' text. */
    .ais-main .ledger:not(dialog *, .hd-list-card) > :not(.ledger-head, .ledger-empty, .ledger-more, .ledger-rows, .ledger-row, table, ul, ol, template, script, :has(.ledger-row, table, ul, ol)) { margin-left: 10px; margin-right: 10px; }
    .ais-main .ledger:not(dialog *) > .fin-search > :is(.fin-search-fields, .fin-search-acts) { margin-left: 10px; margin-right: 10px; }
    .ais-main .sp-card:not(dialog *, :is(.ledger, .record-term, .ais-panel, .ais-next, .sp-card, .class-list) *) { padding-left: 20px; padding-right: 20px; }
    .ais-main .sp-card:not(dialog *, :is(.ledger, .record-term, .ais-panel, .ais-next, .sp-card, .class-list) *) > .card-header { margin: 0 -20px; padding-left: 24px; padding-right: 20px; }
    .ais-main .class-list:not(dialog *, :is(.ledger, .record-term, .ais-panel, .ais-next, .sp-card, .class-list) *) { padding-left: 18px; padding-right: 18px; }
    .ais-main .record-term:not(dialog *, :is(.ledger, .record-term, .ais-panel, .ais-next, .sp-card, .class-list) *) { padding-left: 18px; padding-right: 18px; }
    .ais-main .record-term:not(dialog *, :is(.ledger, .record-term, .ais-panel, .ais-next, .sp-card, .class-list) *) > summary { margin: 0 -18px; padding-left: 22px; padding-right: 18px; }

    .home-head { gap: 20px; border-bottom-color: var(--panel-line); }
    .home-photo {
        width: 88px; height: 88px; font-size: 30px;
        background: var(--fill);
        box-shadow: 0 0 0 4px var(--ground), 0 0 0 5px var(--panel-line);
    }
}

/* ================================================================
   Charts (2026-11-21). DESIGN.md, "Charts". Drawn by the server
   (core/templatetags/charts.py) or by Alpine with the same classes.
   ================================================================ */
:root {
    /* One measure: a single hue. */
    --chart-bar: var(--green-700);
    --chart-track: var(--green-tint);
    --chart-muted: #B0BEC5;
    /* Parts of a whole, in this order only; validated adjacent-pair
       (CVD and normal vision) on white, 2026-11-21. */
    --cat-1: #00897B;
    --cat-2: #2A78D6;
    --cat-3: #EB6834;
    --cat-4: #6250D6;
}

/* Bar chart: label, bar, figure. Phone: label and figure, bar beneath. */
.ais-bars { list-style: none; margin: 0; padding: 4px 0; }
.ais-bar, .ais-bar-link {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "label value" "track track";
    align-items: center;
    gap: 4px 12px;
    padding: 6px 0;
}
.ais-bar:has(> .ais-bar-link) { display: block; padding: 0; }
.ais-bar-link { color: inherit; text-decoration: none; border-radius: 6px; }
.ais-bar-link:hover .ais-bar-label { color: var(--green-700); text-decoration: underline; }
.ais-bar-label { grid-area: label; min-width: 0; font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.ais-bar-label small { display: block; font-size: 12px; color: var(--ink-2); }
.ais-bar-value {
    grid-area: value; font: 600 14px/1.2 var(--font-read); color: var(--ink);
    font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap;
}
.ais-bar-value small { font-weight: 400; font-size: 12px; color: var(--ink-2); margin-left: 4px; }
.ais-bar-track { grid-area: track; display: block; height: 10px; }
.ais-bars.is-rate .ais-bar-track { background: var(--chart-track); border-radius: 0 4px 4px 0; }
.ais-bar-fill {
    display: block; height: 100%; width: var(--w, 0%);
    background: var(--chart-bar);
    border-radius: 0 4px 4px 0;   /* rounded data end, square at the baseline */
}
.ais-bar.is-muted .ais-bar-fill { background: var(--chart-muted); }
.ais-bar.is-muted .ais-bar-label { color: var(--ink-2); font-style: italic; }
@media (min-width: 768px) {
    .ais-bar, .ais-bar-link {
        grid-template-columns: minmax(120px, 34%) minmax(0, 1fr) minmax(64px, auto);
        grid-template-areas: "label track value";
        gap: 12px;
    }
}
@media (min-width: 1024px) {
    .ais-bar, .ais-bar-link { padding: 5px 10px; }
    .ais-bar:has(> .ais-bar-link) { padding: 0; }
}

/* Split bar: one whole, its parts side by side; the legend is the table. */
.ais-split { padding: 10px 0 6px; }
@media (min-width: 1024px) { .ais-split { padding: 12px 10px 8px; } }
.ais-split-bar { display: flex; gap: 2px; height: 28px; }
.ais-split-part {
    flex: 0 1 calc(var(--w) * 1%); min-width: 2px;
    display: flex; align-items: center; padding: 0 8px;
    border-radius: 4px; overflow: hidden; white-space: nowrap;
    font: 600 13px/1 var(--font-read); color: #fff;
}
.ais-split-legend {
    list-style: none; margin: 10px 0 0; padding: 0;
    display: flex; flex-wrap: wrap; gap: 6px 18px;
    font-size: 14px; color: var(--ink);
}
.ais-split-legend li { display: inline-flex; align-items: center; gap: 6px; }
.ais-split-legend b { font-weight: 600; font-variant-numeric: tabular-nums; }
.ais-split-legend small { color: var(--ink-2); font-size: 12px; }
.ais-swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; background: var(--chart-muted); }
:is(.ais-split-part, .ais-swatch).is-cat-1 { background: var(--cat-1); }
:is(.ais-split-part, .ais-swatch).is-cat-2 { background: var(--cat-2); }
:is(.ais-split-part, .ais-swatch).is-cat-3 { background: var(--cat-3); }
:is(.ais-split-part, .ais-swatch).is-cat-4 { background: var(--cat-4); }
:is(.ais-split-part, .ais-swatch).is-clear { background: var(--clear-fill); }
:is(.ais-split-part, .ais-swatch).is-hold { background: var(--hold-fill); }
:is(.ais-split-part, .ais-swatch).is-pending { background: var(--pending-fill); }
:is(.ais-split-part, .ais-swatch).is-warn { background: var(--warn-fill); }
:is(.ais-split-part, .ais-swatch).is-muted { background: var(--chart-muted); }
.ais-split-part.is-muted { color: var(--ink); }

/* Report pages: a section heading, headline figures, a warning count. */
.report-head { margin-top: 32px; }
.report-head h2 { font: 700 20px/1.25 var(--font-mark); color: var(--green-900); }
.report-head p { margin-top: 4px; color: var(--ink-2); font-size: 14px; max-width: 75ch; }
.record-facts.is-figures dd { font: 700 26px/1.1 var(--font-mark); color: var(--ink); font-variant-numeric: tabular-nums; }
.record-facts.is-figures dd small { font: 600 14px/1 var(--font-read); color: var(--ink-2); margin-left: 2px; }
.record-facts.is-figures dd a { color: inherit; text-decoration: none; }
.record-facts.is-figures dd a:hover { color: var(--green-700); text-decoration: underline; text-underline-offset: 3px; }
.record-facts.is-figures dd.sub { margin-top: 4px; font: 400 13px/1.4 var(--font-read); color: var(--ink-2); }
/* Three or six figures sit in rows of three, not four and two. */
@media (min-width: 768px) {
    .record-facts.is-figures:has(> div:nth-child(3):last-child, > div:nth-child(6):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.ledger-count.is-warn { color: var(--warn); }
.ledger-count.is-warn i { margin-right: 4px; }
.chart-note { margin: 4px 0 8px; color: var(--ink-2); font-size: 13px; }
/* What a chart leaves out (nobody to count), folded to a count. */
.chart-more { margin: 4px 0 10px; font-size: 13px; color: var(--ink-2); }
.chart-more summary { cursor: pointer; color: var(--green-700); font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.chart-more ul { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }
@media (min-width: 1024px) { .chart-more { margin-left: 10px; margin-right: 10px; } }

/* A head further down a panel (a college over its programmes) is a subhead,
   not a second band. */
.ais-main .ledger:not(dialog *) > .ledger-head:not(:first-child) {
    margin: 16px 0 0; padding: 0 0 6px; background: none; box-shadow: none;
    border-radius: 0; border-bottom: 1px solid var(--line);
}
.ais-main .ledger:not(dialog *) > .ledger-head:not(:first-child) :is(h2, h3) { font-size: 15px; color: var(--ink); }
@media (min-width: 1024px) {
    .ais-main .ledger:not(dialog *) > .ledger-head:not(:first-child) { margin-left: 10px; margin-right: 10px; padding-left: 0; padding-right: 0; }
}

/* A dashboard's chart panels sit two abreast from 1024px. */
.ais-chart-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 20px; }
.ais-chart-grid > .ledger { margin-top: 0; }
@media (min-width: 1024px) {
    .ais-chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
    .ais-chart-grid > .is-wide { grid-column: 1 / -1; }
}

/* The hover layer (ais.js): one tip, filled with text. */
.ais-tip {
    position: fixed; z-index: 60; pointer-events: none;
    max-width: 280px; padding: 6px 10px; border-radius: 6px;
    background: var(--ink); color: var(--ground); font: 500 13px/1.35 var(--font-read);
    box-shadow: 0 4px 12px rgba(0, 31, 26, 0.18);
}
.ais-tip[hidden] { display: none; }
@media (hover: hover) {
    .ais-bar:hover { background: var(--ground-2); }
    .ais-split-part:hover { filter: brightness(1.08); }
}
@media print {
    .ais-bar-fill, .ais-split-part, .ais-swatch { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Campuses: the Campus filter on every list and report, and the checkbox set
   in the user and campus dialogs (campuses/_filter.html). */
.campus-filter-set, .campus-checks { border: 0; margin: 0; padding: 0; min-width: 0; }
.campus-filter-set { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 0 20px; }
.campus-filter-set legend { float: left; margin-right: 4px; font-weight: 600; line-height: 44px; }
.campus-filter-set legend small { font-weight: 400; color: var(--ink-2); font-size: 13px; }
.ais-main form.adv-filters.campus-filter.campus-filter { padding-block: 4px; margin-bottom: 16px; }
.campus-checks { margin-top: 16px; display: grid; }
.campus-checks legend { font-weight: 600; padding: 0; margin-bottom: 4px; }
.campus-checks small { color: var(--ink-2); font-size: 13px; }
/* A long choice list (the Users dialog's ten units) in two columns. */
.campus-checks.is-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; }
.campus-checks.is-cols > .ais-dialog-note { grid-column: 1 / -1; }
.campus-note { margin-block: 16px; }

/* The formal 1x1 photo: the card on the Student Profile and on the registrar's
   student record, the crop dialog, and the registrar's review grid. Photos are
   square and unrounded, as they print. */
.ph-card { display: grid; gap: 16px; }
.ph-office { padding: 16px 0; }
.ph-slots { display: flex; flex-wrap: wrap; gap: 12px; }
.ph-slot { margin: 0; width: 144px; }
.ph-slot img, .ph-empty { display: block; width: 144px; height: 144px; border: 1px solid var(--panel-line); background: var(--ground); object-fit: cover; }
.ph-empty { display: grid; place-items: center; border-style: dashed; color: var(--ink-2); font-size: 40px; }
.ph-slot figcaption { margin-top: 8px; }
.ph-say { font-weight: 600; }
.ph-card .ph-reason { margin-top: 4px; color: var(--hold); }
.ph-card .ph-rules { margin: 10px 0 0; padding-left: 20px; list-style: disc; color: var(--ink-2); font-size: 15px; }
.ph-card .ph-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; }
.ph-card .ph-note { margin-top: 12px; color: var(--ink-2); font-size: 13px; max-width: 65ch; }
.ph-card .ph-msg { margin-top: 8px; font-weight: 600; }
.ph-card .ph-msg:empty { display: none; }
.ph-card .ph-msg.is-error { color: var(--hold); }
.ph-card .ph-msg.is-success { color: var(--clear); }
.ph-stage { position: relative; width: min(100%, 320px); margin: 16px auto 0; }
.ph-stage canvas { display: block; width: 100%; aspect-ratio: 1; border: 1px solid var(--panel-line); cursor: grab; touch-action: none; }
.ph-stage canvas:active { cursor: grabbing; }
/* Head and shoulders: a hint over the picture, never part of it. */
.ph-guide { position: absolute; left: 27%; top: 12%; width: 46%; height: 60%; border: 2px dashed rgba(255, 255, 255, 0.9); border-radius: 50%; box-shadow: 0 0 0 1px rgba(0, 31, 26, 0.35); pointer-events: none; }
.ph-zoom { display: flex; align-items: center; gap: 12px; margin: 12px auto 0; width: min(100%, 320px); min-height: 44px; font-weight: 600; }
.ph-zoom input { flex: 1; min-width: 0; accent-color: var(--green-700); }
.ph-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ph-bar-count { color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.ph-bar-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px 16px; margin: 0; padding: 16px 0; list-style: none; }
.ph-tile { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 8px; border-radius: 10px; }
.ph-tile.is-picked { background: var(--green-tint); }
.ph-tile-img { display: block; padding: 0; border: 1px solid var(--panel-line); background: var(--ground-2); cursor: zoom-in; }
.ph-tile-img img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.ph-tile-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ph-tile-text a { font-weight: 600; line-height: 1.3; }
.ph-tile-text span { display: block; color: var(--ink-2); font-size: 13px; }
.ais-dialog.ph-look { width: min(520px, calc(100vw - 32px)); }
.ph-look img { display: block; width: 100%; height: auto; margin-top: 12px; border: 1px solid var(--panel-line); background: var(--ground-2); }
@media (min-width: 768px) {
    .ph-card { grid-template-columns: auto minmax(0, 1fr); gap: 24px; }
}

/* Graduation records: the batch page and a graduate's transcript check. */
.gb-lines { padding-bottom: 8px; }
.gb-line { margin: 12px 0 0; padding: 0 0 12px; border: 0; border-bottom: 1px solid var(--line); display: grid; gap: 0 12px; min-width: 0; }
.gb-line legend { font-weight: 600; }
.gb-checks { display: grid; margin-top: 12px; max-height: 40vh; overflow-y: auto; }
.ais-dialog p.gb-say { margin: 0; color: inherit; overflow-wrap: anywhere; }
.ais p.ppl-note { margin: 12px 0 4px; color: var(--ink-2); font-size: 14px; max-width: 70ch; }
.ais h3.gb-group { margin: 20px 0 4px; font-size: 16px; }
.gb-findings li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.gb-findings .stamp { flex: none; min-width: 84px; text-align: center; }
.gb-findings .ais-check { flex: none; min-height: 32px; }
.gb-findings .gb-what { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.ais p.gb-why { color: var(--ink-2); font-size: 14px; }
.gb-accept { display: grid; gap: 12px; justify-items: start; padding: 12px 0; }
.gb-accept .ais-field { width: 100%; }
.gb-heads { display: grid; gap: 4px 16px; margin-top: 8px; }
.gb-heads .ais-field { min-width: 0; }
.gb-heads select { width: 100%; }
@media (min-width: 768px) {
    .gb-heads { grid-template-columns: 1fr 1fr; }
    .gb-line { grid-template-columns: 2fr 1fr 1fr; }
    .gb-line legend { grid-column: 1 / -1; }
}

/* ---- The desktop header and footer, and the theme switch ----------------- */
/*
 * Fixed beside the rail from 1024px (their boxes are under "Desktop", with the
 * rail). Their heights exist only where they show, on screen, so whatever
 * sticks or scrolls into view can simply add --headbar and --footbar. The
 * wizard, the signed-out pages and phones have neither bar.
 */
@media screen and (min-width: 1024px) {
    :root:has(.ais-headbar) {
        --headbar: 60px;
        --footbar: 40px;
        scroll-padding: var(--headbar) 0 var(--footbar);
    }
    .faculty-earlier .record-term { scroll-margin-top: 16px; }
}
.ais-clock { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.ais-clock-time { color: var(--green-900); font: 700 20px/1 var(--font-mark); font-variant-numeric: tabular-nums; }
.ais-clock-date { font-size: 15px; font-weight: 600; }
.ais-clock { flex: none; }
/* What is next: the one part that gives way, cut with an ellipsis. */
.ais-now { flex: 1 1 0; min-width: 0; padding-left: 24px; border-left: 1px solid var(--line); }
.ais-now span { display: block; font-size: 12px; line-height: 1.3; }
.ais .ais-now a { display: block; overflow: hidden; text-overflow: ellipsis; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.3; text-decoration: none; }
.ais .ais-now a:hover { color: var(--green-700); text-decoration: underline; }
.ais-headbar-end { flex: none; display: flex; align-items: center; gap: 16px; }
.ais-find-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; height: 44px; padding: 0 12px;
    border: 1px solid var(--panel-line); border-radius: 10px; background: none; cursor: pointer;
    color: var(--ink-2); font: 600 14px/1 var(--font-read);
}
.ais-find-btn:hover { background: var(--ground-2); color: var(--ink); }
.ais-find-btn kbd { padding: 3px 6px; border: 1px solid var(--panel-line); border-radius: 6px; font: 600 12px/1 var(--font-read); }
.ais-terms { display: flex; gap: 24px; margin: 0 8px 0 0; }
.ais-term dt { font-size: 12px; line-height: 1.3; }
.ais-term dd { margin: 0; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.3; }
.ais-footer > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ais-footer-links { flex: none; display: flex; align-items: center; gap: 20px; }
.ais .ais-footer-links a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; color: var(--ink-2); text-decoration: none; }
.ais .ais-footer-links a:hover { color: var(--green-700); text-decoration: underline; }
.ais-footer-links i { font-size: 13px; }
.ais-online { display: inline-flex; align-items: center; gap: 6px; }
.ais-online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--clear); }
.ais-online.is-off { color: var(--hold); font-weight: 700; }
.ais-online.is-off .ais-online-dot { background: var(--hold); }
/* What a narrower desktop gives up, in this order. */
.ais-footer-short { display: none; }
@media (max-width: 1699px) {
    .ais-footer-full { display: none; }
    .ais-footer-short { display: inline; }
    .ais-headbar .ais-wide { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 1439px) { .ais-term + .ais-term, .ais-footer-site { display: none !important; } }
@media (max-width: 1279px) { .ais-terms, .ais-footer-mail { display: none !important; } }

/* Find a page: a list of the rail's links under one field. */
.ais-dialog.ais-find { width: min(560px, calc(100vw - 32px)); max-height: min(560px, calc(100dvh - 160px)); margin-top: 96px; padding: 0; overflow: hidden; }
.ais-find[open] { display: flex; flex-direction: column; }
.ais-find-box { flex: none; display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 20px; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.ais-find-box input { flex: 1; min-width: 0; min-height: 44px; border: 0; background: none; color: var(--ink); font: 400 17px/1.4 var(--font-read); }
.ais-find-box input:focus-visible { outline: none; }
.ais-find ul { overflow-y: auto; padding: 8px; }
.ais .ais-find li a { display: flex; align-items: center; gap: 14px; min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--ink); font-weight: 600; text-decoration: none; }
.ais-find li i { width: 20px; text-align: center; color: var(--green-700); font-size: 15px; }
.ais-find li small { margin-left: auto; color: var(--ink-2); font-size: 13px; font-weight: 400; }
.ais .ais-find li[aria-selected="true"] a { background: var(--green-tint); color: var(--green-800); }
.ais-dialog .ais-find-none { margin: 0; padding: 0 20px 20px; }
.ais-dialog .ais-find-none:empty { display: none; }

.ais-theme {
    flex: none; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 4px;
    border: 0; border-radius: 10px; background: none; cursor: pointer;
    color: var(--ink-2); font: 600 14px/1 var(--font-read);
}
.ais-theme:hover { color: var(--ink); }
.ais-theme-track {
    position: relative; flex: none; width: 52px; height: 28px; border-radius: 14px;
    background: var(--field-line); transition: background-color 160ms ease;
}
.ais-theme-track::before {
    content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
    background: var(--disc); transition: transform 160ms var(--ease-out);
}
.ais-theme-track i, .ais-sheet-list .ais-theme-track i {
    position: absolute; z-index: 1; top: 3px; left: 3px; display: grid; place-items: center;
    width: 22px; height: 22px; color: #00574B; font-size: 12px;
    transition: transform 160ms var(--ease-out);
}
.ais-theme-track .fa-moon { visibility: hidden; }
[data-theme="dark"] .ais-theme-track { background: var(--switch-on); }
[data-theme="dark"] .ais-theme-track i { transform: translateX(24px); }
[data-theme="dark"] .ais-theme-track::before { transform: translateX(24px); }
[data-theme="dark"] .ais-theme-track .fa-moon { visibility: visible; }
[data-theme="dark"] .ais-theme-track .fa-sun { visibility: hidden; }
.ais-sheet-list .ais-theme-row span:first-of-type { flex: 1; }
@media (prefers-reduced-motion: reduce) {
    .ais-theme-track, .ais-theme-track::before, .ais-theme-track i { transition: none; }
}
@media print { .ais-headbar, .ais-footer { display: none !important; } }
