/* ProctorEquity — shared layout/component classes on top of modernist.css tokens. */

/* The design tool has since moved the .dc.html pages from the token sheet's original red
   to a blue accent (#1d4ed8 primary / #2f6df6 lighter blue). modernist.css itself still ships
   the old red tokens, so override the accent ramp here in one place rather than hardcoding
   blue hex values across every Blade view. */
:root {
    --color-accent: #1d4ed8;
    --color-accent-100: color-mix(in oklab, #1d4ed8 14%, white);
    --color-accent-200: color-mix(in oklab, #1d4ed8 25%, white);
    --color-accent-300: color-mix(in oklab, #1d4ed8 40%, white);
    --color-accent-400: color-mix(in oklab, #1d4ed8 65%, white);
    --color-accent-500: #1d4ed8;
    --color-accent-600: color-mix(in oklab, #1d4ed8 86%, black);
    --color-accent-700: color-mix(in oklab, #1d4ed8 68%, black);
    --color-accent-800: color-mix(in oklab, #1d4ed8 45%, black);
    --color-accent-900: color-mix(in oklab, #1d4ed8 28%, black);

    --color-accent-2: #1d4ed8;
    --color-accent-2-100: color-mix(in oklab, #1d4ed8 14%, white);
    --color-accent-2-200: color-mix(in oklab, #1d4ed8 25%, white);
    --color-accent-2-300: color-mix(in oklab, #1d4ed8 40%, white);
    --color-accent-2-400: color-mix(in oklab, #1d4ed8 65%, white);
    --color-accent-2-500: #1d4ed8;
    --color-accent-2-600: color-mix(in oklab, #1d4ed8 86%, black);
    --color-accent-2-700: color-mix(in oklab, #1d4ed8 68%, black);
    --color-accent-2-800: color-mix(in oklab, #1d4ed8 45%, black);
    --color-accent-2-900: color-mix(in oklab, #1d4ed8 28%, black);

    /* the lighter blue used as the literal button/highlight fill on the Lecturer/Student portal screens */
    --color-accent-light: #2f6df6;

    /* neutrals and status tones taken verbatim from the .dc.html screens */
    --dc-bg: #f2f4f8;
    --dc-card: #fff;
    --dc-border-strong: #cfd6e4;
    --dc-shadow: rgba(16, 24, 40, .05);
    --dc-shadow-strong: rgba(16, 24, 40, .11);
    --dc-text: #1b2030;
    --dc-muted: #6b7488;
    --dc-muted-strong: #5b6478;
    --dc-border: #e6e9f0;
    --dc-divider: #eef1f6;
    --dc-surface: #f7f8fb;
    --dc-hover: #fafbfd;
    --dc-green: #0a7a58;
    --dc-green-dot: #0fb87c;
    --dc-green-bg: #e9f8f1;
    --dc-amber: #b45309;
    --dc-amber-bar: #f2a33c;
    --dc-amber-bg: #fff3dc;
    --dc-red: #d93a2b;
    --dc-red-bg: #fdecea;
    --dc-blue-bg: #eaf1fe;

    /* extra tones beyond the .dc.html screens, used to tell subjects apart */
    --dc-violet: #6d28d9;
    --dc-violet-bg: #f1ebfe;
    --dc-teal: #0e7490;
    --dc-teal-bg: #e2f4f7;
    --dc-pink: #be185d;
    --dc-pink-bg: #fdeaf3;
}

/* ---- Dark mode -------------------------------------------------------------
   Set by data-theme="dark" on <html> (see layouts/partials/theme.blade.php).
   Only the variables change: every page draws from them, so nothing else
   needs to know which mode it is in. Status and subject colours are lifted
   so they keep their contrast on a dark surface, and their tints are mixed
   with the dark card rather than with white. */
:root[data-theme="dark"] {
    color-scheme: dark;

    --color-bg: #0f131c;
    --color-surface: #1d2331;
    --color-text: #e6e9f0;
    --color-divider: color-mix(in srgb, #e6e9f0 22%, transparent);

    --color-accent: #5b8cff;
    --color-accent-light: #3b74f6;
    --color-accent-100: color-mix(in oklab, #5b8cff 18%, #171c28);
    --color-accent-200: color-mix(in oklab, #5b8cff 30%, #171c28);
    --color-accent-300: color-mix(in oklab, #5b8cff 45%, #171c28);
    --color-accent-400: color-mix(in oklab, #5b8cff 70%, #171c28);
    --color-accent-500: #5b8cff;

    --dc-bg: #0f131c;
    --dc-card: #171c28;
    --dc-text: #e6e9f0;
    --dc-muted: #98a2b6;
    --dc-muted-strong: #b8c0cf;
    --dc-border: #2b3345;
    --dc-border-strong: #3b4458;
    --dc-divider: #242b3a;
    --dc-surface: #1d2331;
    --dc-hover: #1c2230;
    --dc-shadow: rgba(0, 0, 0, .32);
    --dc-shadow-strong: rgba(0, 0, 0, .5);

    --dc-green: #34d399;
    --dc-green-dot: #34d399;
    --dc-green-bg: color-mix(in srgb, #34d399 15%, #171c28);
    --dc-amber: #fbbf24;
    --dc-amber-bar: #f2a33c;
    --dc-amber-bg: color-mix(in srgb, #fbbf24 14%, #171c28);
    --dc-red: #f87171;
    --dc-red-bg: color-mix(in srgb, #f87171 15%, #171c28);
    --dc-blue-bg: color-mix(in srgb, #5b8cff 17%, #171c28);
    --dc-violet: #a78bfa;
    --dc-violet-bg: color-mix(in srgb, #a78bfa 16%, #171c28);
    --dc-teal: #2dd4bf;
    --dc-teal-bg: color-mix(in srgb, #2dd4bf 14%, #171c28);
    --dc-pink: #f472b6;
    --dc-pink-bg: color-mix(in srgb, #f472b6 15%, #171c28);
}
:root[data-theme="dark"] .tone-blue { --tone: #6b9bff; }
:root[data-theme="dark"] .alert-success { background: var(--dc-green-bg); color: var(--dc-green); }
:root[data-theme="dark"] .alert-error { background: var(--dc-red-bg); color: var(--dc-red); }
:root[data-theme="dark"] img, :root[data-theme="dark"] video { color-scheme: light; }

/* The light/dark switch in the top bar. */
.theme-toggle { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--dc-bg); color: var(--dc-muted-strong); display: grid; place-items: center; cursor: pointer; flex: none; transition: background .15s, color .15s; }
.theme-toggle:hover { color: var(--dc-text); background: var(--dc-surface); }
.theme-toggle .moon { display: block; } .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }

/* One colour per subject: set --tone / --tone-bg, read them anywhere inside. */
.tone-blue   { --tone: var(--color-accent-light); --tone-bg: var(--dc-blue-bg); }
.tone-violet { --tone: var(--dc-violet);          --tone-bg: var(--dc-violet-bg); }
.tone-teal   { --tone: var(--dc-teal);            --tone-bg: var(--dc-teal-bg); }
.tone-pink   { --tone: var(--dc-pink);            --tone-bg: var(--dc-pink-bg); }
/* Status tones, for meaning rather than identity: never given to a subject. */
.tone-green  { --tone: var(--dc-green);           --tone-bg: var(--dc-green-bg); }
.tone-amber  { --tone: var(--dc-amber);           --tone-bg: var(--dc-amber-bg); }
.tone-red    { --tone: var(--dc-red);             --tone-bg: var(--dc-red-bg); }
.ichip[class*="tone-"] { background: var(--tone-bg); color: var(--tone); }

/* A subject's code as a small tinted label. Needs a .tone-* on it or above it. */
.scode { font-size: 11px; font-weight: 800; letter-spacing: .02em; padding: 2px 8px; border-radius: 999px; background: var(--tone-bg); color: var(--tone); white-space: nowrap; display: inline-block; }

/* A tinted square holding an icon, for stat cards. */
.ichip { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; }

/* ---- design-system vocabulary, matching the class names used in design/*.dc.html ---- */
.ctitle { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.csub { font-size: 12.5px; margin-top: 3px; color: var(--dc-muted); }
.klabel { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; color: var(--dc-muted); }

.pill { font-size: 11.5px; font-weight: 600; padding: 5px 11px; border-radius: 999px; white-space: nowrap; display: inline-block; }
.pill-blue { background: var(--dc-blue-bg); color: var(--color-accent); }
.pill-amber { background: var(--dc-amber-bg); color: var(--dc-amber); }
.pill-green { background: var(--dc-green-bg); color: var(--dc-green); }
.pill-grey { background: var(--dc-bg); color: var(--dc-muted-strong); }
.pill-red { background: var(--dc-red-bg); color: var(--dc-red); }

.rowbtn { font-size: 12.5px; font-weight: 700; padding: 9px 15px; border-radius: 10px; white-space: nowrap; display: inline-block; border: 0; cursor: pointer; font-family: inherit; text-decoration: none; }
.rowbtn:disabled { opacity: .45; cursor: not-allowed; }
.rowbtn-primary { background: var(--color-accent-light); color: #fff; }
.rowbtn-quiet { background: var(--dc-bg); color: var(--dc-text); }
.rowbtn-outline { background: var(--dc-card); color: var(--dc-text); box-shadow: inset 0 0 0 1px var(--dc-border); }

@keyframes lp { 0%, 100% { opacity: 1 } 50% { opacity: .3 } }
.ld { width: 8px; height: 8px; border-radius: 50%; background: var(--dc-green-dot); animation: lp 1.5s ease-in-out infinite; flex: none; }

.subj { display: flex; align-items: center; gap: 14px; padding: 14px 22px; border-top: 1px solid var(--dc-divider); text-align: left; background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; font-family: inherit; color: inherit; text-decoration: none; cursor: pointer; transition: background .15s; }
.subj:hover { background: var(--dc-hover); }

.scard { background: var(--dc-card); border-radius: 18px; box-shadow: 0 1px 2px var(--dc-shadow), 0 8px 24px var(--dc-shadow); padding: 22px 24px; text-align: left; border: 0; width: 100%; font-family: inherit; color: inherit; text-decoration: none; cursor: pointer; display: flex; flex-direction: column; box-sizing: border-box; transition: transform .15s, box-shadow .15s; }
.scard:hover { transform: translateY(-2px); box-shadow: 0 10px 26px var(--dc-shadow-strong); color: inherit; }

.chk { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-radius: 12px; background: var(--dc-surface); }

.bar { display: block; height: 6px; border-radius: 999px; background: var(--dc-divider); overflow: hidden; }
.bar > span { display: block; height: 100%; }

.notice { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-radius: 14px; background: var(--dc-blue-bg); border: 1px solid #c3d8ff; font-size: 13.5px; font-weight: 700; color: var(--color-accent); }

.layout-shell { min-height: 100vh; display: grid; grid-template-columns: 246px 1fr; background: var(--dc-bg); }
.sidebar { background: var(--dc-card); border-right: 1px solid var(--dc-border); padding: 24px 16px; display: flex; flex-direction: column; gap: 26px; }
.sidebar-section-label { font-size: 10.5px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; padding: 0 14px 8px; color: var(--dc-muted); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px; text-decoration: none; color: inherit; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--color-accent-light); display: grid; place-items: center; flex: none; color: #fff; }
.brand-name { font: 800 15px/1.1 var(--font-heading); }

.navlink { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; font-size: 14px; color: var(--dc-muted-strong); text-decoration: none; transition: background .15s, color .15s; }
.navlink:hover { background: var(--dc-bg); color: var(--dc-text); }
.navlink.active { background: var(--color-accent-light); color: #fff; font-weight: 700; }

.topbar { background: var(--dc-card); border-bottom: 1px solid var(--dc-border); padding: 16px 30px; display: flex; align-items: center; gap: 18px; }
.topbar-crumb { font-size: 13px; color: var(--dc-muted); }
.topbar-crumb a { color: inherit; text-decoration: none; }
.topbar-crumb .current { color: var(--dc-text); font-weight: 700; }
.content { padding: 26px 30px 40px; display: flex; flex-direction: column; gap: 20px; }

.panel { background: var(--dc-card); border-radius: 18px; box-shadow: 0 1px 2px var(--dc-shadow), 0 8px 24px var(--dc-shadow); }

.chip { font-size: 11.5px; padding: 4px 10px; border-radius: 999px; white-space: nowrap; display: inline-flex; align-items: center; }
.chip-accent { background: var(--dc-blue-bg); color: var(--color-accent); }
.chip-neutral { background: var(--dc-bg); color: var(--dc-muted-strong); }
.chip-success { background: var(--dc-green-bg); color: var(--dc-green); }
.chip-warning { background: var(--dc-amber-bg); color: var(--dc-amber); }

.iconbtn { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: color-mix(in srgb, var(--color-text) 55%, transparent); border: 1px solid transparent; text-decoration: none; background: none; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.iconbtn:hover { background: color-mix(in srgb, var(--color-accent) 9%, transparent); color: var(--color-accent); border-color: color-mix(in srgb, var(--color-accent) 25%, transparent); }

.ftab { font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 999px; color: var(--dc-muted-strong); background: none; border: 0; cursor: pointer; font-family: inherit; white-space: nowrap; text-decoration: none; display: inline-block; transition: background .15s, color .15s; }
.ftab:hover { background: var(--dc-divider); color: var(--dc-text); }
.ftab.active { background: var(--dc-card); color: var(--dc-text); font-weight: 700; box-shadow: 0 1px 3px var(--dc-shadow-strong); }

.hrow { display: grid; grid-template-columns: 48px minmax(0, 1fr) 62px 84px 76px; align-items: center; gap: 12px; padding: 15px 20px; border-top: 1px solid var(--dc-divider); width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-bottom: 0; font-family: inherit; color: inherit; text-decoration: none; cursor: pointer; box-sizing: border-box; transition: background .15s; }
.hrow:hover { background: var(--dc-hover); color: inherit; }

.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font: 800 11px var(--font-heading); flex: none; background: color-mix(in srgb, var(--color-accent) 11%, transparent); color: var(--color-accent); }
.avatar-neutral { background: color-mix(in srgb, var(--color-text) 8%, transparent); color: var(--color-text); }
.avatar-solid { background: var(--color-accent-light); color: #fff; font-size: 11.5px; }
.avatar[class*="tone-"], .chip[class*="tone-"] { background: var(--tone-bg); color: var(--tone); }

.qa { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--color-text) 9%, transparent); color: var(--color-text); background: var(--dc-card); text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.qa:hover { border-color: color-mix(in srgb, var(--color-accent) 35%, transparent); box-shadow: 0 6px 18px color-mix(in srgb, var(--color-accent) 14%, transparent); transform: translateY(-1px); }

.table th { border-bottom-width: 1px; padding-block: 10px; }
.table td { font-size: 13.5px; padding-block: 13px; border-bottom-color: color-mix(in srgb, var(--color-text) 7%, transparent); }
.table tbody tr:last-child td { border-bottom: 0; }

.alert { padding: 14px 18px; border-radius: 14px; font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; }
.alert-success { background: color-mix(in srgb, #15803d 10%, transparent); color: #15803d; }
.alert-error { background: color-mix(in srgb, #c2410c 10%, transparent); color: #c2410c; }

/* A mistake is red, under the field it belongs to, whether the server said
   it or the page noticed it first (public/js/field-check.js). */
.field-error { font-size: 12.5px; font-weight: 600; color: var(--dc-red); margin-top: 6px; }
.is-invalid:not([data-min-checked]),
.input:has(+ .field-error) { border-color: var(--dc-red) !important; box-shadow: 0 0 0 3px var(--dc-red-bg) !important; }
.has-error { border-color: var(--dc-red) !important; }

/* The Modernist token sheet sets --radius-md to 0, but the finished .dc.html screens are all
   rounded, so form controls are restyled here to sit with the rest of the app. */
.field > label { font-size: 12.5px; font-weight: 600; margin-bottom: 7px; color: var(--dc-muted-strong); }

.input {
    min-height: 44px;
    padding: 11px 14px;
    font-size: 14px;
    background: var(--dc-card);
    border: 1px solid var(--dc-border);
    border-radius: 11px;
    box-shadow: 0 1px 2px var(--dc-shadow);
    transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: color-mix(in srgb, var(--dc-muted) 80%, transparent); }
.input:hover { border-color: var(--dc-border-strong); }
.input:focus,
.input:focus-visible {
    outline: 0;
    border-color: var(--color-accent-light);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent-light) 18%, transparent);
}

/* the login screen's flush-left underline fields */
.input-underline {
    background: transparent;
    border-width: 0 0 1.5px 0;
    border-radius: 0;
    box-shadow: none;
    padding-inline: 0;
    font-size: 15px;
}
.input-underline:hover { border-color: var(--dc-muted); }
.input-underline:focus,
.input-underline:focus-visible { box-shadow: none; border-color: var(--color-accent-light); }

select.input {
    appearance: none;
    padding-right: 38px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7488' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
}

input[type="file"].input { padding: 8px 10px; cursor: pointer; }
input[type="file"].input::file-selector-button {
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    margin-right: 12px;
    padding: 8px 15px;
    border: 0;
    border-radius: 9px;
    background: var(--dc-blue-bg);
    color: var(--color-accent);
    cursor: pointer;
    transition: background .15s;
}
input[type="file"].input::file-selector-button:hover { background: color-mix(in srgb, var(--color-accent-light) 20%, var(--dc-card)); }

textarea.input { min-height: 110px; padding: 12px 14px; line-height: 1.6; }

.seg { border-radius: 11px; border-color: var(--dc-border); box-shadow: 0 1px 2px var(--dc-shadow); }
.seg-opt { padding: 10px 16px; font-size: 13px; font-weight: 600; transition: background .15s, color .15s; }
.seg-opt + .seg-opt { border-left-color: var(--dc-border); }
.seg-opt:has(input:checked) { background: var(--color-accent-light); color: #fff; }

.radio .dot { border-color: var(--dc-border-strong); }
.radio:hover .dot { border-color: var(--color-accent-light); }
.radio input:checked + .dot { background: var(--color-accent-light); border-color: var(--color-accent-light); }

/* checkboxes (views give the dot a rounded-square radius) get a tick rather than a ring */
.radio input[type="checkbox"] + .dot { border-radius: 6px; }
.radio input[type="checkbox"]:checked + .dot {
    box-shadow: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 13 4 4 10-10'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

.role-tabs { display: flex; gap: 6px; padding: 5px; border-radius: 999px; background: var(--dc-blue-bg); }
.role-tab { flex: 1; justify-content: center; padding: 10px 0; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--dc-muted-strong); transition: background .15s, color .15s, box-shadow .15s; }
.role-tab:hover { color: var(--color-accent); }
.role-tab:has(input:checked) { background: var(--color-accent); color: #fff; box-shadow: 0 3px 10px color-mix(in srgb, var(--color-accent) 32%, transparent); }
.role-tab:has(input:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.role-tab .dot { display: none; }

dialog.modal { width: min(600px, calc(100vw - 64px)); border: 0; border-radius: 22px; padding: 0; box-shadow: 0 24px 60px color-mix(in srgb, #0b1020 28%, transparent); }
dialog.modal::backdrop { background: color-mix(in srgb, #0b1020 45%, transparent); }
.modal-header { padding: 24px 26px 20px; border-bottom: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent); display: flex; align-items: flex-start; gap: 14px; }
.modal-icon { width: 38px; height: 38px; border-radius: 13px; background: color-mix(in srgb, var(--color-accent) 10%, transparent); color: var(--color-accent); display: grid; place-items: center; flex: none; }
.modal-close { width: 32px; height: 32px; border-radius: 10px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; color: color-mix(in srgb, var(--color-text) 50%, transparent); flex: none; }
.modal-body { padding: 22px 26px; display: flex; flex-direction: column; gap: 18px; }
.modal-footer { padding: 18px 26px; border-top: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent); display: flex; gap: 10px; justify-content: flex-end; }

/* Tick boxes for a paper's sections or lab groups. */
.pick-list { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-top: 10px; }
.pick { display: flex; align-items: flex-start; gap: 10px; padding: 11px 13px; border-radius: 11px; border: 1px solid var(--dc-border); background: var(--dc-card); cursor: pointer; font-size: 13px; }
.pick input { margin: 2px 0 0; accent-color: var(--color-accent); flex: none; }
.pick > span { min-width: 0; }
.pick-sub { display: block; font-size: 11.5px; margin-top: 2px; color: var(--dc-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick:has(input:checked) { border-color: var(--color-accent); background: var(--dc-blue-bg); }

/* The admin's section and lab group builder. */
.sec-card { border: 1px solid var(--dc-border); border-radius: 14px; background: var(--dc-card); overflow: hidden; }
.sec-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 34px; gap: 10px; align-items: center; padding: 12px 14px; }
.sec-labs { padding: 4px 14px 12px 34px; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--dc-divider); background: var(--dc-surface); }
.sec-labs .sec-row { padding: 0; grid-template-columns: 96px minmax(0, 1fr) 34px; }
.sec-labs .sec-row:first-child { margin-top: 8px; }
.sec-add { border: 1px dashed var(--dc-border); background: none; border-radius: 10px; padding: 8px 12px; font: 600 12.5px inherit; font-family: inherit; color: var(--color-accent); cursor: pointer; justify-self: start; }
.sec-remove { width: 34px; height: 34px; border-radius: 9px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; color: var(--dc-muted); }
.sec-remove:hover { color: var(--dc-red); background: var(--dc-red-bg); }
.sec-remove:disabled { opacity: .35; cursor: not-allowed; background: none; color: var(--dc-muted); }
.sec-note { font-size: 11.5px; color: var(--dc-muted); }

@media (max-width: 900px) {
  .layout-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

/* On a phone the top bar keeps one line: the page name, the theme switch, the
   bell and the account avatar. The session and the account name go; the avatar
   still opens the account page. */
@media (max-width: 640px) {
  .topbar { padding: 12px 16px; gap: 10px; }
  .topbar-session, .topbar-who { display: none; }
  .topbar-session + * { margin-left: auto; }
  .topbar-user { padding: 4px !important; }
}

/* A builder row's message sits under the row, lined up with its fields. */
.sec-card > .field-error { margin: -4px 14px 10px; }
.sec-labs > .field-error { margin: -2px 0 2px; }
/* A choice row is the box; its borderless text field stays plain inside it. */
.choice-row .input.is-invalid { border-color: transparent !important; box-shadow: none !important; }

/* Answer boxes typed beside a paper set as a PDF (exam page). */
.abox { border: 1px solid var(--dc-border); border-radius: 12px; background: var(--dc-card); padding: 10px 12px 12px; }
.abox-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.abox-label { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--color-accent); }
.abox-part .abox-label { text-transform: none; font-size: 12.5px; }
.abox-tools { margin-left: auto; display: flex; gap: 2px; }
.abox-tool { width: 28px; height: 28px; border-radius: 8px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; color: var(--dc-muted-strong); }
.abox-tool:hover { background: var(--dc-surface); color: var(--dc-text); }
.abox-tool[data-act="delete"]:hover { background: var(--dc-red-bg); color: var(--dc-red); }
.abox-tool:disabled { opacity: .3; cursor: default; background: none; }
.abox-text { width: 100%; box-sizing: border-box; resize: vertical; font-size: 13.5px; line-height: 1.55; }
.abox-parts { display: flex; flex-direction: column; gap: 9px; margin: 10px 0 0 18px; }
.abox-parts:empty { display: none; }
.abox-part { background: var(--dc-surface); border-color: var(--dc-divider); padding: 8px 10px 10px; }
.abox-add-part { margin-top: 9px; margin-left: 18px; border: 1px dashed var(--dc-border); background: none; border-radius: 9px; padding: 6px 11px; font-family: inherit; font-size: 12px; font-weight: 600; color: var(--color-accent); cursor: pointer; }
.abox-add-part:hover { border-color: var(--color-accent); }

/* Brings back the optional "applies to the whole question" box, which is put
   away once the question is being answered in its parts. Quieter than
   "+ Add sub answer": it is the rarer thing to want. */
.abox-shared-open { display: block; width: 100%; margin-bottom: 10px; border: 1px dashed var(--dc-border); background: none; border-radius: 9px; padding: 9px 11px; font-family: inherit; font-size: 12px; font-weight: 600; text-align: left; color: var(--dc-muted); cursor: pointer; }
.abox-shared-open:hover { border-color: var(--dc-muted); color: var(--dc-text); }

/* The same answers, read back to the lecturer and the student. */
.typed-answers { display: flex; flex-direction: column; gap: 10px; }
.typed-answer { border: 1px solid var(--dc-border); border-radius: 12px; padding: 11px 14px; background: var(--dc-card); }
.typed-answer.is-part { margin-left: 22px; background: var(--dc-surface); border-color: var(--dc-divider); }
.typed-answer-label { font-size: 11.5px; font-weight: 800; letter-spacing: .04em; color: var(--color-accent); }
.typed-answer-text { margin-top: 5px; font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.typed-answer-empty { margin-top: 5px; font-size: 12.5px; font-style: italic; color: var(--dc-muted); }
/* A question can be folded closed, leaving one line for it. */
.abox-fold { flex: none; width: 24px; height: 24px; margin-left: -4px; border: 0; border-radius: 7px; background: none; cursor: pointer; display: grid; place-items: center; color: var(--dc-muted-strong); }
.abox-fold:hover { background: var(--dc-surface); color: var(--dc-text); }
.abox-fold svg { transition: transform .15s; }
.abox.is-closed .abox-fold svg { transform: rotate(-90deg); }
.abox-label[data-act="fold"] { cursor: pointer; flex: none; }
.abox-preview { display: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--dc-muted); }
.abox.is-closed .abox-preview { display: block; }
.abox.is-closed > .abox-body { display: none; }
.abox.is-closed > .abox-head { margin-bottom: 0; }

/* Tabs for the files of a Hands-On Test. */
.hot-tab { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 8px 14px; border: 1px solid var(--dc-border); border-radius: 999px; background: var(--dc-card); color: var(--dc-muted-strong); font: 600 13px inherit; font-family: inherit; cursor: pointer; }
.hot-tab:hover { color: var(--dc-text); }
.hot-tab.is-active { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
.paper-tabs.is-strip .hot-tab { padding: 5px 12px; font-size: 12.5px; }

/* The tab strip above a paper's files, wherever the viewer is shown. */
.paper-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.paper-tabs.is-strip { flex: none; margin: 0; padding: 7px 14px; border-bottom: 1px solid var(--dc-divider); background: var(--dc-surface); }

/* Choosing files for a paper: the names run on one line, "a.pdf ×, b.pdf ×",
   with the add button at its end, and wrap only when they run out of room. */
.file-picker { display: flex; flex-direction: column; gap: 7px; }
.file-picker-box { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; border: 1.5px dashed var(--dc-border-strong); border-radius: 12px; background: var(--dc-surface); transition: border-color .15s, background-color .15s; }
.file-picker:not(.has-files) .file-picker-box:hover,
.file-picker.is-dragging .file-picker-box { border-color: var(--color-accent); background: var(--dc-blue-bg); }
.file-picker:not(.has-files) .file-picker-box:hover .file-picker-add-icon,
.file-picker.is-dragging .file-picker-add-icon { background: var(--color-accent); color: #fff; }
.file-picker.has-files .file-picker-box { padding: 9px 14px; border-style: solid; border-color: var(--dc-border); background: var(--dc-card); }
.file-picker-names { min-width: 0; flex: 1 1 auto; font-size: 13px; line-height: 1.7; color: var(--dc-text); }
.file-picker:not(.has-files) .file-picker-names { display: none; }
/* Each name and its × move to the next line together; a name too long for
   the box breaks inside itself rather than running out of it. */
.file-chip { display: inline-block; max-width: 100%; margin-right: 6px; white-space: nowrap; }
.file-chip:not(:last-child)::after { content: ','; color: var(--dc-muted); }
.file-chip .file-chip-name { white-space: normal; overflow-wrap: anywhere; }
.file-chip-name { font-weight: 600; color: var(--dc-text); text-decoration: none; }
a.file-chip-name:hover { color: var(--color-accent); text-decoration: underline; }
.file-chip.is-new .file-chip-name { color: var(--color-accent); }
.file-chip-x { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-left: 3px; border: 0; border-radius: 5px; background: none; cursor: pointer; font: 700 14px inherit; font-family: inherit; line-height: 1; color: var(--dc-muted); vertical-align: -2px; }
.file-chip-x:hover { background: var(--dc-red-bg); color: var(--dc-red); }
.file-chip.is-kept input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.file-chip.is-kept { cursor: pointer; }
.file-chip.is-kept:has(input:checked) .file-chip-name { color: var(--dc-muted); text-decoration: line-through; }
.file-chip.is-kept:has(input:checked) .file-chip-x { color: var(--dc-red); }
/* Empty: a drop zone filling the box, the add button centred in it. */
.file-picker-add { position: relative; flex: 1 1 100%; display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 92px; padding: 16px; border-radius: 11px; color: var(--color-accent); cursor: pointer; }
.file-picker-add-icon { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--dc-blue-bg); color: var(--color-accent); }
.file-picker-add-copy { display: flex; flex-direction: column; gap: 2px; }
.file-picker-add-text { font-size: 14px; font-weight: 700; }
.file-picker-add-hint { font-size: 12px; font-weight: 500; color: var(--dc-muted); }
/* With names: shrinks to "+ Add more" at the right end of the line. */
.file-picker.has-files .file-picker-add { flex: none; margin-left: auto; min-height: 0; gap: 6px; padding: 4px 2px; border-radius: 6px; }
.file-picker.has-files .file-picker-add-icon { width: auto; height: auto; background: none; }
.file-picker.has-files .file-picker-add-text { font-size: 13px; }
.file-picker.has-files .file-picker-add-hint { display: none; }
.file-picker-add:focus-within { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.file-picker.is-full .file-picker-add { opacity: .45; cursor: not-allowed; }
.file-picker-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-picker.is-full .file-picker-input { cursor: not-allowed; }
.file-picker-note { font-size: 12px; font-weight: 600; color: var(--dc-amber); }

/* A shared-screen still that came back: how many times, on the thumbnail. */
.still-count { position: absolute; top: 6px; right: 6px; padding: 2px 7px; border-radius: 999px; background: rgba(8, 12, 20, .78); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .02em; pointer-events: none; }
.still-times { margin-top: 2px; }
/* The AI screen check on a student's report: only the stills it points out,
   each with what appears to be on it and the lecturer's own decision. */
.ai-look { padding: 14px 22px 16px; border-bottom: 1px solid var(--dc-divider); background: var(--dc-surface); }
.ai-look-head { display: flex; align-items: baseline; gap: 6px 12px; flex-wrap: wrap; }
.ai-look-title { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--dc-muted); }
.ai-look-summary { font-size: 13px; font-weight: 600; color: var(--dc-muted-strong); }
.ai-look-item { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 14px; margin: 12px 0 0; padding: 12px; border: 1px solid var(--dc-border); border-radius: 12px; background: var(--dc-card); scroll-margin-top: 20px; }
.ai-look-item:target { border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--dc-blue-bg); }
.ai-look-item.is-decided { opacity: .78; }
.ai-look-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; border-radius: 8px; cursor: zoom-in; background: var(--dc-bg); }
.ai-look-body { min-width: 0; font-size: 13px; }
.ai-look-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-look-times { font-size: 12px; color: var(--dc-muted); }
.ai-look-seen { margin: 8px 0 0; line-height: 1.55; color: var(--dc-text); }
.ai-look-app { margin: 4px 0 0; font-size: 12.5px; color: var(--dc-muted-strong); }
.ai-look-decide { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.ai-look-decision { font-size: 12.5px; font-weight: 600; color: var(--dc-muted-strong); }
.ai-still-tag { display: inline-block; margin-top: 4px; padding: 1px 7px; border-radius: 6px; font-size: 11px; font-weight: 700; }
.ai-still-tag.is-expected { background: var(--dc-green-bg); color: var(--dc-green); }
.ai-still-tag.is-unexpected { background: var(--dc-amber-bg); color: var(--dc-amber); }
.ai-still-tag.is-unclear { background: var(--dc-bg); color: var(--dc-muted-strong); }
@media (max-width: 640px) {
    .ai-look { padding-left: 16px; padding-right: 16px; }
    .ai-look-item { grid-template-columns: minmax(0, 1fr); }
}
.still-times summary { cursor: pointer; color: var(--color-accent); font-weight: 600; list-style: none; }
.still-times summary::-webkit-details-marker { display: none; }
.still-times[open] summary { display: none; }

/* Behaviour timeline: a row whose screen still is pictured on an earlier row
   links there; arriving at that row lights it briefly. */
.same-screen-link { display: inline-flex; align-items: center; min-height: 54px; font-size: 12px; font-weight: 600; color: var(--color-accent); text-decoration: none; white-space: nowrap; }
.same-screen-link:hover { text-decoration: underline; }
.same-screen-link.is-compact { display: inline-block; min-height: 0; margin-top: 8px; }
.timeline-row { scroll-margin-top: 90px; }
.timeline-row:target > td,
.log-row:target { animation: timeline-row-flash 2.4s ease-out; }
/* From blue back to whatever the row's own background is. */
@keyframes timeline-row-flash { from { background: var(--dc-blue-bg); } }

/* ── Marking rubric and suggested marks ──────────────────────────────────── */

/* The rubric, as the lecturer sees it: on the grading screen, and under the
   upload field so they can check the reading worked before marking with it. */
.rubric-panel { padding: 18px 22px; }
.rubric-head { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.rubric-panel.is-missing { background: var(--dc-amber-bg); box-shadow: none; }
.rubric-note { margin: 10px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--dc-amber); max-width: 70ch; }
.rubric-file-link { font-size: 13px; font-weight: 700; color: var(--color-accent); text-decoration: none; overflow-wrap: anywhere; }
.rubric-file-link:hover { text-decoration: underline; }

.rubric-read { margin-top: 12px; }
.rubric-read > summary { cursor: pointer; font-size: 12px; font-weight: 700; letter-spacing: .03em; color: var(--dc-muted-strong); list-style: none; }
.rubric-read > summary::-webkit-details-marker { display: none; }
.rubric-read > summary::before { content: '▸ '; color: var(--dc-muted); }
.rubric-read[open] > summary::before { content: '▾ '; }
/* Pre-wrap, because a rubric's own line breaks are most of its structure. */
.rubric-text { margin-top: 9px; padding: 13px 16px; border: 1px solid var(--dc-border); border-radius: 12px; background: var(--dc-surface); font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 280px; overflow-y: auto; }

.rubric-kept { border: 1px solid var(--dc-border); border-radius: 12px; padding: 12px 14px; background: var(--dc-surface); margin-bottom: 11px; }
.rubric-kept-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rubric-kept .rubric-text { background: var(--dc-card); }
.rubric-remove { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--dc-red); cursor: pointer; }
.rubric-remove input { accent-color: var(--dc-red); }

/* The rubric field: one line of what it is, then the kept rubric as a line,
   or an upload box with typing behind a link. */
.rb-label-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.rb-label-row label { margin-bottom: 0; font-size: 12.5px; font-weight: 600; color: var(--dc-muted-strong); }
.rb-optional { font-weight: 500; color: var(--dc-muted); }
.rb-lede { margin: 4px 0 10px; font-size: 12.5px; color: var(--dc-muted); }
.rb-link { padding: 0; border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--color-accent); cursor: pointer; }
.rb-link:hover { text-decoration: underline; }
.rb-link:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; border-radius: 4px; }
.rb-link[hidden] { display: none; }
.rb-help-toggle { margin-left: auto; font-weight: 600; }
.rb-help { margin: -2px 0 12px; padding: 10px 13px; border-radius: 10px; background: var(--dc-surface); font-size: 12.5px; line-height: 1.6; color: var(--dc-muted-strong); }
.rb-help[hidden], .rb-new[hidden], .rb-pane[hidden] { display: none; }

.rb-kept { padding: 10px 14px; border: 1px solid var(--dc-border); border-radius: 12px; background: var(--dc-surface); }
.rb-kept-line { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; }
.rb-kept-icon { flex: none; color: var(--dc-muted); }
.rb-kept-name { min-width: 0; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.rb-kept-actions { margin-left: auto; display: inline-flex; align-items: center; gap: 16px; }
.rb-kept-actions .rubric-remove { margin-left: 0; }
.rb-kept .rubric-read { margin-top: 8px; }
.rb-kept .rubric-text { background: var(--dc-card); }
.rb-kept.is-removing .rb-kept-name { color: var(--dc-muted); text-decoration: line-through; }
.rb-kept + .rb-new { margin-top: 10px; }

.rb-pane { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.rb-pane > .input { width: 100%; }
.rb-drop { position: relative; align-self: stretch; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 16px; border: 1.5px dashed var(--dc-border-strong); border-radius: 12px; background: var(--dc-surface); color: var(--color-accent); cursor: pointer; transition: border-color .15s, background-color .15s; }
.rb-drop:hover, .rb-drop:focus-within { border-color: var(--color-accent); background: var(--dc-blue-bg); }
.rb-drop-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rb-drop-text { font-size: 13.5px; font-weight: 700; overflow-wrap: anywhere; }
.rb-drop-hint { font-size: 12px; font-weight: 500; color: var(--dc-muted); }
.rb-drop-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.rb-replace-note { margin-top: 8px; font-size: 12.5px; color: var(--dc-muted); }
.rb-replace-note .rb-link { margin-left: 6px; }
@media (prefers-reduced-motion: reduce) { .rb-drop { transition: none; } }

.rubric-upload { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rubric-upload .input { flex: 1 1 260px; padding: 9px 12px; font-size: 13px; }
.rubric-hint { font-size: 12px; color: var(--dc-muted); }

/* A suggested mark beside the box the lecturer types the real one into. It is
   deliberately quieter than the mark itself. */
.suggestion { border: 1px solid var(--dc-border); border-radius: 13px; background: var(--dc-surface); padding: 13px 15px; margin-top: 14px; }
.suggestion.needs-attention { border-color: var(--dc-amber); background: var(--dc-amber-bg); }
.suggestion-head { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.suggestion-meta { flex-basis: 100%; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 9px; }
.suggestion-when { font-size: 11.5px; color: var(--dc-muted); }
.suggestion-total { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.suggestion-outof { font-size: 12.5px; color: var(--dc-muted-strong); }
.suggestion-warning { margin-top: 9px; font-size: 12.5px; font-weight: 600; line-height: 1.55; color: var(--dc-amber); }
.suggestion.needs-attention .suggestion-warning { color: var(--dc-text); }

.suggestion-rows { width: 100%; border-collapse: collapse; margin-top: 11px; }
.suggestion-rows td { padding: 8px 0; border-top: 1px solid var(--dc-divider); font-size: 12.5px; line-height: 1.55; vertical-align: top; }
.suggestion-rows tr:first-child td { border-top: 0; }
.suggestion-rows td.suggestion-criterion { font-weight: 700; padding-right: 12px; min-width: 120px; }
.suggestion-rows td.suggestion-points { white-space: nowrap; font-weight: 800; padding-right: 14px; padding-left: 8px; text-align: right; }
.suggestion-points span { font-weight: 500; color: var(--dc-muted); }
.suggestion-reason { color: var(--dc-muted-strong); }
.suggestion-rows tr.is-over .suggestion-points { color: var(--dc-red); }
.suggestion-no-rubric { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-top: 9px; font-size: 12.5px; line-height: 1.5; color: var(--dc-muted-strong); }
/* A whole-paper suggestion, one block per question with its subtotal. */
.suggestion-groups { display: flex; flex-direction: column; gap: 6px; margin-top: 11px; }
.suggestion-open-all { align-self: flex-end; padding: 0; border: 0; background: none; font: inherit; font-size: 12px; font-weight: 700; color: var(--color-accent); cursor: pointer; }
.suggestion-open-all:hover { text-decoration: underline; }
.suggestion-group { border: 1px solid var(--dc-divider); border-radius: 10px; background: var(--dc-card); }
.suggestion-group > summary { display: flex; align-items: baseline; gap: 10px; padding: 9px 12px; cursor: pointer; list-style: none; font-size: 13px; }
.suggestion-group > summary::-webkit-details-marker { display: none; }
.suggestion-group > summary::before { content: '▸'; flex: none; font-size: 11px; color: var(--dc-muted); }
.suggestion-group[open] > summary::before { content: '▾'; }
.suggestion-group > summary:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; border-radius: 10px; }
.suggestion-group-label { font-weight: 700; }
.suggestion-group-count { font-size: 12px; color: var(--dc-muted); }
.suggestion-group-points { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.suggestion-group-points span { font-weight: 500; color: var(--dc-muted); }
.suggestion-group.is-over { border-color: var(--dc-red); }
.suggestion-group.is-over .suggestion-group-points { color: var(--dc-red); }
.suggestion-group .suggestion-rows { margin: 0 12px 6px; width: calc(100% - 24px); }
.suggestion-reason-only td { padding: 9px 0 6px; }
.suggestion-group .suggestion-rows tr:first-child td { border-top: 1px solid var(--dc-divider); }
.suggestion-agreement { margin-top: 10px; font-size: 12px; font-weight: 600; color: var(--dc-muted-strong); }
