/* Corrobora's brand (see the brand guide): claret, Inter, borders rather than shadows, light and dark modes.
   Every colour is a variable, so the whole app follows the brand from this one place. */
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("/static/vendor/inter/Inter-Regular.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("/static/vendor/inter/Inter-Medium.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("/static/vendor/inter/Inter-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("/static/vendor/inter/Inter-Bold.woff2") format("woff2"); }
:root {
  --page: #f7f6f7; --surface: #ffffff; --line: #e6e2e4; --line-strong: #8a8186; --ink: #1f1b1d; --muted: #645d61;
  --accent: #9e1b34; --accent-deep: #681024; --accent-tint: #f8e8ec; --accent-ink: #ffffff; --gold: #9e1b34;
  --true: #23683f; --true-bg: #e3f1e8; --suspect: #85570f; --suspect-bg: #fbf0dc;
  --false: #a3125f; --false-bg: #fbe3f0; --neutral: #5d6470; --neutral-bg: #eceef1;
  --radius: 10px; --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #141214; --surface: #1e1b1d; --line: #332e31; --line-strong: #7a7176; --ink: #efeaec; --muted: #a9a0a5;
    --accent: #e07489; --accent-deep: #f2a9b8; --accent-tint: #35181f; --accent-ink: #1a1214; --gold: #e07489;
    --true: #8fd4a8; --true-bg: #1c3326; --suspect: #ecc078; --suspect-bg: #3a2e18;
    --false: #f39bd0; --false-bg: #42182f; --neutral: #b4bac4; --neutral-bg: #2a2d33;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }      /* hidden stays hidden, whatever the element's own layout */
body { margin: 0; background: var(--page); color: var(--ink); font: 16px/1.55 var(--sans); }
h1, h2, h3, .brand { font-weight: 600; line-height: 1.2; letter-spacing: -.02em; }
h1 { font-size: 2rem; letter-spacing: -.03em; margin: .2rem 0 .4rem; }
h2 { font-size: 1.35rem; margin: 1.6rem 0 .6rem; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
code { background: var(--neutral-bg); padding: 0 .3em; border-radius: 4px; }

.top { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1.5rem;
       background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .5rem; font-size: 1.35rem; letter-spacing: -.035em; color: var(--ink); text-decoration: none; }
.brand svg { width: 1.9rem; height: 1.9rem; flex: none; }
nav a { margin-left: 1.2rem; text-decoration: none; color: var(--muted); }
nav a:hover { color: var(--ink); }
main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 2rem 1rem; border-top: 1px solid var(--line); }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.crumbs { font-size: .9rem; color: var(--muted); margin: 0; }
.crumbs a { color: var(--muted); }
.notice { background: var(--surface); border-left: 4px solid var(--accent); padding: .7rem 1rem; border-radius: 6px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.card { display: flex; flex-direction: column; gap: .6rem; background: var(--surface); border: 1px solid var(--line);
        border-radius: var(--radius); padding: 1.1rem; margin-bottom: 1rem; }
.link-card { text-decoration: none; color: var(--ink); transition: border-color .15s; }
.link-card:hover { border-color: var(--accent); }
.link-card:has(details[open]) { z-index: 5; }
.eyebrow { font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 760px) { .columns { grid-template-columns: 1fr; } }

label { display: flex; flex-direction: column; gap: .25rem; font-size: .9rem; }
input, textarea, select { font: inherit; padding: .5rem .6rem; border: 1px solid var(--line-strong); border-radius: 6px;
                  background: var(--page); color: var(--ink); }
button, .button { font: inherit; font-weight: 600; padding: .55rem 1.1rem; border-radius: 6px; cursor: pointer;
                  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); text-decoration: none; }
button.secondary, .button.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
button:hover:not(:disabled):not(.secondary):not(.danger):not(.link-button):not(.icon-button) { background: var(--accent-deep); border-color: var(--accent-deep); color: var(--surface); }
button:disabled { opacity: .45; cursor: not-allowed; }

.list { list-style: none; padding: 0; margin: 0 0 1rem; }
.list li { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.tag { font-size: .75rem; padding: .1rem .5rem; border-radius: 99px; background: var(--neutral-bg); color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin: 1rem 0 .3rem; }
.inline-form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.status { padding: .6rem 1rem; border-radius: 6px; background: var(--neutral-bg); }
.status-running { background: var(--suspect-bg); }
.status-failed { background: var(--false-bg); }
.table-head { display: flex; justify-content: space-between; align-items: center; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
details.edit summary { font-size: .8rem; color: var(--muted); cursor: pointer; }
details.edit form { display: flex; flex-direction: column; gap: .3rem; margin-top: .4rem; }

.chip { display: inline-block; font-size: .78rem; font-weight: 700; padding: .12rem .55rem; border-radius: 99px; white-space: nowrap; }
.chip.big { font-size: .95rem; padding: .25rem .8rem; }
.chip-true { background: var(--true-bg); color: var(--true); }
.chip-suspect { background: var(--suspect-bg); color: var(--suspect); }
.chip-false { background: var(--false-bg); color: var(--false); }
.chip-not-checked { background: var(--neutral-bg); color: var(--neutral); }
.warn-text { color: var(--suspect); }

.report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.report-section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .2rem 1.2rem .9rem; margin-top: .8rem; }
.report-section h2 { margin: .9rem 0 .4rem; }
.report-section h3 { margin: 1rem 0 .4rem; }
.report-section > p { margin: .4rem 0; }
.report-head h1 + p { margin: 0; }
/* Folded explanations and legends in a report: one small line until opened */
details.explain { margin: .2rem 0 .6rem; }
details.explain > summary { cursor: pointer; font-size: .85rem; color: var(--muted); }
details.explain[open] > summary { margin-bottom: .4rem; }
details.explain .legend { margin-bottom: .4rem; }
/* Long text in a report cell, folded to a few lines until clicked (details.clamp) */
details.clamp > summary { list-style: none; cursor: pointer; }
details.clamp > summary::-webkit-details-marker { display: none; }
details.clamp:not([open]) .clamp-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
details.clamp:not([open]) .clamp-extra { display: none; }       /* the sentence before: shown once opened */
td.exists details.clamp { margin: .35rem 0; }
td.exists details.clamp:not([open]) .clamp-text { -webkit-line-clamp: 2; }
details.clamp > summary:hover .clamp-text { color: var(--ink); text-decoration: underline dotted; }
.report-section.pending { opacity: .75; }
.section-head { display: flex; align-items: center; gap: 1rem; }
.reference { border-left: 4px solid var(--line); padding: .6rem 1rem; margin: 1rem 0; background: var(--page); border-radius: 0 8px 8px 0; }
.verdict-true { border-left-color: var(--true); }
.verdict-suspect { border-left-color: var(--suspect); }
.verdict-false { border-left-color: var(--false); }
.reference-top { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.reference p { margin: .45rem 0; }
.raw { color: var(--ink); }
.fields { display: flex; flex-wrap: wrap; gap: .35rem; }
.field { font-size: .75rem; padding: .1rem .5rem; border-radius: 4px; background: var(--neutral-bg); color: var(--muted); }
.field-match { background: var(--true-bg); color: var(--true); }
.field-typo { background: var(--suspect-bg); color: var(--suspect); }
.field-differs, .field-wrong { background: var(--false-bg); color: var(--false); }
.empty { padding: 1rem; background: var(--page); border-radius: 8px; }

@media print {
  .top nav, .no-print, footer, .crumbs { display: none; }
  body { background: #fff; color: #000; }
  .report-section { border: none; padding: 0; }
}

/* Editing and deleting courses and assignments */
details.deleted { margin: .6rem 0 1rem; }
details.deleted > summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
button.danger { background: transparent; color: var(--false); border-color: var(--false); }
.notice.warning { border-left-color: var(--suspect); }
form.notice.warning { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.deleted-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.prompt { color: var(--muted); max-width: 70ch; }

/* The ⋯ menu for editing or deleting a course or assignment */
details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; width: 2rem; height: 2rem; display: grid; place-items: center;
  border-radius: 50%; color: var(--muted); font-size: 1.3rem; line-height: 1; user-select: none; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu > summary:hover, details.menu[open] > summary { background: var(--neutral-bg); color: var(--ink); }
.menu-panel { position: absolute; right: 0; top: 2.3rem; z-index: 20; width: min(300px, 85vw); display: flex; flex-direction: column;
  gap: .8rem; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .14); }
.menu-panel form { display: flex; flex-direction: column; gap: .5rem; }
.link-card { position: relative; }
.link-card > details.menu { position: absolute; top: .6rem; right: .6rem; z-index: 2; }
.card-link { color: var(--ink); text-decoration: none; }
.card-link::after { content: ""; position: absolute; inset: 0; }        /* the whole card is clickable */
.title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.row-with-menu { display: flex; justify-content: space-between; align-items: center; }

/* The citation pairing table in a report */
.legend { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; align-items: baseline; margin: 0 0 1.2rem; }
.legend dd { margin: 0; font-size: .88rem; color: var(--muted); }
table.pairing td { font-size: .92rem; }
table.pairing .number { text-align: right; }
table.pairing .form { display: block; }
table.pairing td:nth-child(6) { min-width: 140px; }
main.wide { max-width: 1600px; }
.wide .table-wrap td { white-space: normal; }
table.pairing tr.status-false { background: color-mix(in srgb, var(--false-bg) 45%, transparent); }
details.full-reference summary { cursor: pointer; font-weight: 600; min-width: 140px; }
details.full-reference p { font-size: .85rem; color: var(--muted); max-width: 40ch; margin: .4rem 0 0; }
.chip-neutral { background: var(--neutral-bg); color: var(--neutral); }
.legends { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 0 2rem; }
.legends h3 { font-size: 1rem; margin: .4rem 0 .6rem; }
table.pairing td.exists { min-width: 180px; }
table.pairing td.exists p { margin: .35rem 0; }
.setting-group { display: flex; flex-direction: column; gap: .5rem; padding: .8rem 0; border-top: 1px solid var(--line); }
pre.essay-text { white-space: pre-wrap; font-size: .85rem; max-height: 420px; overflow: auto;
  background: var(--page); padding: .8rem; border-radius: 6px; max-width: 80ch; }
a.button { display: inline-block; }
td.claim { min-width: 240px; max-width: 420px; }
label.checkbox { flex-direction: row; gap: .5rem; align-items: flex-start; }
label.checkbox input { margin-top: .25rem; }
.status-stopped { background: var(--suspect-bg); }

/* Settings: one panel per AI provider, side by side */
.provider-panels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 980px) { .provider-panels { grid-template-columns: 1fr; } }
.provider h2 { margin-top: .2rem; }
.provider h3 { font-size: 1rem; margin: .6rem 0 0; }
.model-list { list-style: none; padding: 0; margin: 0; }
.model-list li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .35rem 0;
  border-bottom: 1px solid var(--line); }
.model-list code { word-break: break-all; }
.small-button { font-size: .78rem; padding: .2rem .6rem; }
.add-model { display: flex; gap: .4rem; }
.add-model input { flex: 1; min-width: 0; }
select { font: inherit; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 6px; background: var(--page); color: var(--ink); }
.default-save { position: absolute; left: -9999px; }
.label-row { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
label.narrow { max-width: 520px; }
.grade-line { display: grid; grid-template-columns: 1fr 3.6rem; gap: .4rem; align-items: center; min-width: 240px; margin: .1rem 0; }
.grade-line .chip { justify-self: end; }
details.research > summary { cursor: pointer; }
details.research[open] > summary { margin-bottom: .6rem; }

/* Accounts */
.narrow-card { max-width: 460px; margin: 2rem auto; }
.copy-link { width: 100%; font-family: monospace; font-size: .85rem; }
form.sign-out { display: inline-flex; gap: .5rem; align-items: center; margin-left: 1.2rem; }
button.link-button { background: none; border: none; color: var(--muted); font-weight: 400; padding: 0; }
button.link-button:hover { color: var(--ink); }
nav { display: flex; align-items: center; flex-wrap: wrap; gap: .2rem; }
.people .list li { gap: .6rem; }

/* The review page: the essay on the left, its references on the right */
main.full { max-width: 1800px; }
.review { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); gap: 1.5rem; align-items: start; }
@media (max-width: 1000px) { .review { grid-template-columns: 1fr; } }
.review-toolbar { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; gap: .8rem; align-items: center;
  padding: .6rem 0; background: var(--page); }
#pair-mode.active { background: var(--accent); color: var(--accent-ink); }
.pages { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.sheet { position: relative; background: #fff; box-shadow: 0 2px 12px rgba(0, 0, 0, .15); }
.sheet canvas { display: block; }
.text-sheet { width: min(100%, 860px); }
.plain-text { white-space: pre-wrap; padding: 2.5rem 3rem; color: #1c2333; line-height: 1.7; }
.marks { position: absolute; inset: 0; pointer-events: none; }
.marks .hl { position: absolute; pointer-events: auto; padding: 0; border: none; border-radius: 2px; cursor: pointer;
  mix-blend-mode: multiply; }
.review.pairing .marks .hl { pointer-events: none; }          /* while pairing, the words underneath can be selected */
.hl.paired { background: rgba(46, 125, 79, .28); }
.hl.year-mismatch { background: rgba(214, 150, 40, .38); }
.hl.no-reference { background: rgba(179, 38, 30, .30); }
.hl.set-by-instructor { background: rgba(43, 76, 126, .30); }
.marks .hl.focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.legend-chips { display: inline-flex; gap: .4rem; }
.legend-chips .hl { padding: .05rem .45rem; border-radius: 4px; color: #1c2333; }
.sources-pane { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; padding-right: .3rem; }
.reference-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .6rem; }
.reference-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .8rem; }
.reference-card p { margin: .35rem 0; }
.corrections-log { margin-top: 1rem; }
.popover { position: absolute; z-index: 40; width: 330px; display: flex; flex-direction: column; gap: .5rem; padding: .9rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
.popover select { width: 100%; }
dialog.editor { width: min(860px, 95vw); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.4rem;
  background: var(--surface); color: var(--ink); }
dialog.editor::backdrop { background: rgba(0, 0, 0, .35); }
.editor-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.editor-head h2 { margin: 0; }
.style-switch { display: inline-flex; border: 1px solid var(--accent); border-radius: 6px; overflow: hidden; }
.style-switch button { border: none; border-radius: 0; background: transparent; color: var(--accent); padding: .35rem .9rem; }
.style-switch button.active { background: var(--accent); color: var(--accent-ink); }
.preview { background: var(--page); border-left: 4px solid var(--gold); padding: .7rem .9rem;
  border-radius: 0 6px 6px 0; min-height: 2.6rem; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem 1rem; }
.field-grid .wide, .field-grid .authors { grid-column: 1 / -1; }
fieldset.authors { border: 1px solid var(--line); border-radius: 6px; padding: .5rem .7rem; display: flex; flex-direction: column; gap: .4rem; }
.author-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: .4rem; }
.editor-actions { margin-top: 1rem; }

/* Misattribution: one finding per line, and the key words a passage shares with the sentence */
.findings { margin: 0 0 .4rem; padding-left: 1.1rem; }
.findings li { margin: .1rem 0; }
b.shared { background: var(--suspect-bg, #fdf1d6); font-weight: 600; border-radius: 2px; padding: 0 1px; }

/* Support access: the banner staff see while looking inside a university, and the requests admins and instructors answer */
.support-banner { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
                  padding: .6rem 1.5rem; background: var(--suspect-bg); color: var(--suspect); border-bottom: 1px solid var(--line); }
.support-banner form { margin: 0; }
.support-requests .support-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.support-requests form { margin: 0; }

/* Sign-in page: the full logo above the form */
.login-logo img { display: block; width: min(280px, 100%); height: auto; margin: .4rem 0 .8rem; }

/* ---------- App frame (v29): sidebar, page, toasts, icons ---------- */
.icon { width: 1.05em; height: 1.05em; flex: none; vertical-align: -0.15em; }
button .icon, .button .icon, .row-action .icon { margin-right: .4em; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

body.with-sidebar { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: .3rem;
           padding: 1.1rem .9rem; background: var(--surface); border-right: 1px solid var(--line); }
.sidebar .brand { padding: .2rem .5rem .6rem; }
.sidebar-university { margin: 0 .5rem .6rem; font-size: .85rem; font-weight: 600; color: var(--muted); }
.sidebar nav { display: flex; flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 2px; }
.sidebar nav a { display: flex; align-items: center; gap: .6rem; padding: .48rem .6rem; border-radius: 8px; color: var(--ink);
                 text-decoration: none; font-size: .93rem; margin: 0; }
.sidebar nav a:hover { background: var(--neutral-bg); }
.sidebar nav a.current { background: var(--accent-tint); color: var(--accent-deep); font-weight: 600; }
.sidebar nav a .icon { color: var(--muted); }
.sidebar nav a.current .icon { color: var(--accent); }
.course-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-label { margin: .9rem .6rem .2rem; font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sidebar-account { margin-top: auto; display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; padding: .8rem .6rem 0;
                   border-top: 1px solid var(--line); }
.sidebar-account .link-button { display: inline-flex; align-items: center; gap: .4rem; color: var(--ink); font-size: .93rem; }
.page { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.page main { width: 100%; padding-inline: 2rem; }
.page footer { margin-top: auto; }
.mobile-bar { display: none; }
button.icon-button { background: none; border: 1px solid var(--line-strong); color: var(--ink); padding: .4rem; border-radius: 8px; }
@media (max-width: 860px) {
  body.with-sidebar { display: block; }
  .mobile-bar { display: flex; justify-content: space-between; align-items: center; padding: .7rem 1rem; background: var(--surface);
                border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
  .sidebar { display: none; position: fixed; inset: 57px 0 0 0; height: auto; z-index: 29; }
  .sidebar .brand { display: none; }
  body.sidebar-open .sidebar { display: flex; }
  .page main { padding-inline: 1rem; }
}

.toast { position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 50; margin: 0; max-width: min(420px, calc(100vw - 2.4rem));
         padding: .8rem 1rem; border-radius: 10px; background: var(--ink); color: var(--page); font-size: .92rem;
         box-shadow: 0 8px 24px rgba(0, 0, 0, .18); transition: opacity .4s, transform .4s; }
.toast.gone { opacity: 0; transform: translateY(8px); pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* ---------- Course cards on the home page ---------- */
.course-card { gap: .35rem; }
.course-card .chips { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }

/* ---------- Ledger tools, progress, empty states ---------- */
.ledger-summary { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; align-items: center; margin: .2rem 0 .8rem; font-size: .92rem; }
.ledger-tools { display: flex; flex-wrap: wrap; gap: .8rem 1.4rem; align-items: center; margin-bottom: .8rem; }
.segmented { display: inline-flex; align-items: center; gap: .3rem; }
.segmented button { padding: .3rem .7rem; font-size: .85rem; font-weight: 500; }
.segmented button[aria-pressed="true"] { background: var(--accent-tint); border-color: var(--accent); color: var(--accent-deep); }
.search { flex-direction: row; align-items: center; gap: .4rem; border: 1px solid var(--line-strong); border-radius: 6px;
          padding: 0 .6rem; background: var(--surface); }
.search input { border: 0; background: transparent; padding: .4rem 0; min-width: 17rem; }   /* fits the French placeholder too */
.search input:focus { outline: none; }
.search:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
table.ledger thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
table.ledger tbody tr:hover { background: color-mix(in srgb, var(--accent-tint) 45%, transparent); }
table.ledger td { font-variant-numeric: tabular-nums; }
/* Report and Review sit one above the other so the last column stays narrow. */
.row-action { display: flex; align-items: center; margin-bottom: .25rem; white-space: nowrap; font-size: .9rem; }
.empty-state { display: grid; justify-items: center; gap: .3rem; padding: 2rem 1rem; text-align: center; }
.empty-state .icon { width: 2rem; height: 2rem; color: var(--muted); }
.progress { margin: 1rem 0; }
.progress-steps { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .55rem; }
.progress-steps li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .8rem; font-size: .9rem; }
.progress-steps .bar { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--neutral-bg); overflow: hidden; }
.progress-steps .bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s; }
@media print { .sidebar, .mobile-bar, .toast { display: none !important; } body.with-sidebar { display: block; } }
button.icon-button:hover { background: var(--neutral-bg); }
/* File drop zone (replaces the browser's own "Choose files" box). */
.drop-zone { display: flex; flex-direction: row; align-items: center; gap: .8rem; font-size: .95rem; padding: .7rem 1rem; min-width: min(100%, 22rem);
             border: 1.5px dashed var(--line-strong); border-radius: 10px; background: var(--surface); cursor: pointer;
             transition: border-color .15s, background .15s; }
.drop-zone > .icon { width: 1.4rem; height: 1.4rem; color: var(--accent); flex: none; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--accent); background: var(--accent-tint); }
.drop-zone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.drop-zone.picked { border-style: solid; border-color: var(--accent); }
.drop-zone.picked .drop-files { color: var(--ink); }
.drop-browse { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.actions .inline-form { flex: 1 1 26rem; }   /* takes the row on wide screens, its own line on phones */
.actions .drop-zone { flex: 1; }
/* A card split into separate parts (e.g. a university's admins vs. support access), each with its own heading. */
.card-section { border-top: 1px solid var(--line); padding-top: .8rem; margin-top: .4rem; display: grid; gap: .5rem; }
.card-section h3 { display: flex; align-items: center; gap: .45rem; margin: 0; font-size: .95rem; }
.card-section h3 .icon { color: var(--accent); }
/* The ledger fits a laptop screen: the student cell holds the ID and links, and grades sit beside their labels. */
table.ledger th, table.ledger td { padding: .65rem .6rem; }
table.ledger .student-cell { min-width: 8rem; max-width: 11rem; overflow-wrap: anywhere; }
table.ledger .student-cell .requirements-chip { display: flex; }
table.ledger .student-cell > strong, table.ledger .student-cell > span { display: block; margin-bottom: .2rem; }
table.ledger .student-cell .row-action { margin: 0; font-size: .85rem; }
table.ledger .grade-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .1rem .4rem; min-width: 0; max-width: 13rem; }
table.ledger td .chip { margin: 0 .15rem .25rem 0; }
/* English | Français: at the bottom of the sidebar and on the sign-in pages. */
.language-switch { margin: .6rem 0 0; font-size: .85rem; color: var(--muted); }
.language-switch b { color: var(--ink); font-weight: 600; }
.language-switch a { color: var(--muted); }
.language-switch a:hover { color: var(--accent); }
.sidebar .language-switch { padding: 0 .6rem; }
/* A role or status tag stays on one line. */
.tag { white-space: nowrap; }

/* The academic integrity report form: its settings on the left (they stay in view), the findings on the right. */
.integrity-form { display: grid; grid-template-columns: minmax(16rem, 22rem) 1fr; gap: 2rem; align-items: start; }
.integrity-settings { position: sticky; top: 1rem; display: grid; gap: .9rem; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; }
.integrity-settings label, .finding textarea { display: grid; gap: .35rem; width: 100%; }
.integrity-findings h2 { margin-top: 1.4rem; }
.finding { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem;
  margin-bottom: .7rem; display: grid; gap: .45rem; }
.finding:has(input:checked) { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
label.finding-head { gap: .55rem; align-items: center; flex-wrap: wrap; cursor: pointer; font-size: 1rem; }
label.finding-head input, [data-choose-all] { margin-top: 0; accent-color: var(--accent); }
.integrity-settings p { margin: 0; }
.finding blockquote { margin: 0; padding: .45rem .7rem; background: var(--page); border-left: 3px solid var(--line-strong); }
.finding p { margin: 0; }
.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: .3rem; }
@media (max-width: 800px) { .integrity-form { grid-template-columns: 1fr; } .integrity-settings { position: static; } }

/* Reviewing verdicts (verdicts.html, reviews.html): a person's verdict is marked, Corrobora's stays one hover away. */
.reviewed { font-size: .75rem; font-weight: 600; color: var(--accent); margin-left: .35rem; white-space: nowrap; cursor: help; }
.tag.accent { background: var(--accent-tint); color: var(--accent-deep); }
.accent-text { color: var(--accent); display: inline-flex; gap: .3rem; align-items: center; }
.sidebar .count { margin-left: auto; background: var(--accent); color: var(--accent-ink); border-radius: 99px; font-size: .72rem;
  font-weight: 700; padding: 0 .45rem; }
.verdict-list:not(.show-all) .finding[data-quiet="yes"] { display: none; }
.finding details { border-top: 1px solid var(--line); padding-top: .5rem; }
.finding summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: .9rem; }
.review-form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; margin: .7rem 0; }
.review-form .grow, .inline-form .grow { flex: 1 1 16rem; }
.review-history { margin: .6rem 0; }
.review-history li { display: grid; gap: .2rem; padding: .45rem 0; border-bottom: 1px dashed var(--line); }
.discussion { display: grid; gap: .45rem; background: var(--page); border-radius: 8px; padding: .6rem .7rem; }

/* Source requirements (rules.html) and revised essays */
.rules-panel { padding: .8rem 1rem; margin: .8rem 0 1rem; }
.rules-panel summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: .3rem .7rem; align-items: baseline; }
.rules-form { display: grid; gap: .8rem; margin-top: .8rem; }
.rule-row { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: end; }
.rule-row input[type=number] { width: 5.5rem; }
.rule-row .grow { flex: 1 1 18rem; }
.label-text { font-size: .9rem; display: block; margin-bottom: .25rem; }
.area-picker { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; border: 1px solid var(--line-strong); border-radius: 6px; padding: .3rem; background: var(--page); }
.area-picker input { border: 0; flex: 1 1 14rem; background: transparent; }
.tag.area { background: var(--accent-tint); color: var(--accent-deep); display: inline-flex; gap: .3rem; align-items: center; }
.tag.area button { border: 0; background: none; color: inherit; padding: 0 .1rem; cursor: pointer; font: inherit; }
.rule-results li { display: flex; gap: .5rem; align-items: baseline; }
.requirements-chip { display: inline-flex; gap: .3rem; align-items: center; margin-top: .25rem; }
form.revision { display: inline; }
form.revision .row-action { cursor: pointer; }
.notice-line { background: var(--suspect-bg); color: var(--suspect); border-radius: 8px; padding: .5rem .8rem; }
.changes h3 { font-size: .95rem; margin: .9rem 0 .3rem; }
.retention-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; align-items: end; margin: .6rem 0; }
.retention-form input[type=number] { width: 6rem; }
form.revision .row-action { flex-direction: row; gap: .25rem; font-size: .9rem; }
.student-cell .tag { display: inline-block; width: fit-content; }

/* Sign-in with Keycloak: the main button, then Corrobora's own sign-in on the computer running it */
.login-card .stack { display: grid; gap: .8rem; }
.local-sign-in { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: .4rem; }
.small-heading { font-size: .95rem; margin: 0; }
.setup-steps { padding-left: 1.2rem; display: grid; gap: .6rem; margin: 0; }
.qr { margin: .6rem 0 .3rem; } .qr svg { width: 220px; height: 220px; display: block; shape-rendering: crispEdges; }   /* a QR code: never cropped */
input[name=code] { font-size: 1.4rem; letter-spacing: .3em; text-align: center; }
.login-card.stack { display: grid; gap: .8rem; }
/* Testing shortcut (temporary, see testing_shortcut.py) */
.testing-shortcut { border: 1.5px dashed var(--suspect); background: var(--suspect-bg); border-radius: var(--radius); padding: .9rem; margin-top: 1rem; display: grid; gap: .6rem; }
.testing-shortcut .small-heading { color: var(--suspect); display: flex; gap: .35rem; align-items: center; }

/* Results you can click to change (report page) */
/* "Quiet darken": a faint ▾ inside the chip; pointing at it deepens the chip and shows the ▾. Keyboard focus adds a soft
   ring as well, so it can always be seen. */
.chip-button { border: 0; background: none; padding: 0; cursor: pointer; display: inline-flex; font: inherit; border-radius: 99px; }
.chip-button .chip { transition: background-color .12s; }
.chip .caret { font-size: .62rem; margin-left: .3rem; opacity: .45; transition: opacity .12s; }
.chip-button:hover .chip, .chip-button:focus-visible .chip { background: color-mix(in srgb, currentColor 16%, var(--surface)); }
.chip-button:hover .caret, .chip-button:focus-visible .caret { opacity: 1; }
.chip-button:focus { outline: none; }
.chip-button:focus-visible { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px color-mix(in srgb, var(--accent) 45%, transparent); }
.verdict-dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; width: min(30rem, 92vw);
  background: var(--surface); color: var(--ink); }
.verdict-dialog::backdrop { background: rgb(0 0 0 / .35); }
.verdict-dialog .stack { display: grid; gap: .8rem; }

/* The integrity report's preview, and the report just created */
.report-preview { width: 100%; height: 78vh; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.preview-actions { gap: .6rem; }
.created-report { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; border-left: 3px solid var(--true); margin-bottom: 1rem; }

/* ---------- Citation styles: the list and the drag-and-drop builder ---------- */
.style-builder { display: flex; flex-direction: column; gap: .9rem; }
.type-tabs { display: flex; flex-wrap: wrap; gap: .35rem; border-bottom: 1px solid var(--line); padding-bottom: .5rem; }
.type-tabs button { background: var(--surface); color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: .3rem .8rem; font-weight: 500; }
.type-tabs button.active { background: var(--accent-tint); color: var(--accent-deep); border-color: var(--accent); }
.type-tabs button:hover:not(.active) { color: var(--ink); border-color: var(--line-strong); background: var(--surface); }
.type-tabs .tab-gap { color: var(--accent); }
.type-tabs .add-type { padding: .25rem .5rem; border-radius: 99px; }
.builder-board { display: flex; flex-direction: column; gap: .9rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; }
.strip { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; min-height: 3.4rem; padding: .7rem; border: 2px dashed var(--line-strong);
         border-radius: var(--radius); background: var(--page); }
.strip-empty { font-size: .9rem; }
.style-builder .piece, .style-builder .tile { font: 500 .92rem/1.2 var(--sans); padding: .45rem .7rem; border-radius: 10px; cursor: pointer; touch-action: none; user-select: none;
                border: 1px solid var(--line-strong); border-bottom-width: 3px; background: var(--surface); color: var(--ink); }
.style-builder .piece-field, .style-builder .tile-field { border-color: var(--accent); color: var(--accent-deep); background: var(--accent-tint); }
.style-builder .piece-text, .style-builder .tile-text { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; min-width: 2.2rem; text-align: center; }
.style-builder .piece.selected { outline: 2px solid var(--accent); outline-offset: 2px; background: var(--surface); }
.read-only .piece { cursor: pointer; touch-action: auto; }
.piece-required { margin-left: .2rem; color: var(--accent); font-weight: 700; }
.style-builder button.piece:hover:not(:disabled), .style-builder button.tile:hover:not(:disabled) { background: var(--surface); color: var(--ink); border-color: var(--ink); }
.style-builder button.piece-field:hover:not(:disabled), .style-builder button.tile-field:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); color: var(--accent-deep); border-color: var(--accent); }
.being-dragged { opacity: .35; }
.drag-ghost { position: fixed; z-index: 50; pointer-events: none; box-shadow: 0 8px 20px rgb(0 0 0 / .18); transform: rotate(-2deg); }
.drop-marker { width: 3px; align-self: stretch; min-height: 2rem; border-radius: 2px; background: var(--accent); }
.example { border-left: 3px solid var(--accent); padding: .2rem 0 .2rem .9rem; }
.example-text { margin: .2rem 0; font-size: 1.02rem; overflow-wrap: anywhere; }
.check-good { color: var(--true); } .check-bad { color: var(--accent); }
.part-settings { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; align-items: center; color: var(--muted); }
.part-settings label { display: inline-flex; flex-direction: row; align-items: center; gap: .4rem; }
.part-settings select { width: auto; }
.strip:has(.drop-marker) .strip-empty { display: none; }
.style-builder + .card, .style-builder ~ .card { margin-top: 1.2rem; }
.piece-settings { border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem; display: flex; flex-direction: column; gap: .6rem; }
.piece-settings-head { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; }
.piece-settings-head strong { margin-right: auto; }
.piece-settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .6rem .9rem; }
.piece-settings-grid label, .names-settings label { display: flex; flex-direction: column; gap: .2rem; font-size: .88rem; color: var(--muted); }
.piece-settings-grid label input:not([hidden]) { margin-top: .25rem; }
.names-settings { border: 1px solid var(--line); border-radius: 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .6rem .9rem; }
.tray { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; border-top: 1px solid var(--line); padding-top: .9rem; }
.tray h3 { margin: 0 0 .4rem; font-size: .9rem; color: var(--muted); }
.tiles { display: flex; flex-wrap: wrap; gap: .4rem; }
.custom-separator input { width: 11rem; }
.save-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .6rem 1rem; }
.small-dialog { width: min(34rem, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; background: var(--surface); color: var(--ink); }
.small-dialog::backdrop { background: rgb(0 0 0 / .35); }
.small-dialog h2 { margin-top: 0; }
.small-dialog label { display: flex; flex-direction: column; gap: .3rem; margin: .7rem 0; }
.style-labels { display: grid; grid-template-columns: minmax(12rem, 1fr) minmax(14rem, 2fr); gap: .8rem; }
.style-labels label { display: flex; flex-direction: column; }
@media (max-width: 720px) { .style-labels { grid-template-columns: 1fr; } }
/* the list of styles: chips for the standard ones, then a row per style */
.standard-styles { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .4rem 0 1.4rem; }
.standard-chip { border: 1px solid var(--line-strong); border-radius: 99px; padding: .25rem .85rem; font-weight: 600; font-size: .9rem;
                 color: var(--ink); background: var(--surface); text-decoration: none; }
.standard-chip:hover { border-color: var(--accent); color: var(--accent); }
.group-head { font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 1.4rem 0 .5rem; }
.style-rows { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.style-row { display: flex; align-items: center; gap: .4rem; border-bottom: 1px solid var(--line); padding-right: .6rem; }
.style-row:last-child { border-bottom: none; }
.style-row-link { flex: 1; display: flex; align-items: center; gap: .8rem; padding: .8rem 1rem; color: var(--ink); text-decoration: none; min-width: 0; }
.style-row-link:hover .style-row-name { color: var(--accent); }
.style-row-text { display: flex; flex-direction: column; min-width: 0; }
.style-row-name { font-weight: 600; }
.style-row-sub { font-size: .85rem; color: var(--muted); }
.style-row-status { margin-left: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem; }
.chevron { color: var(--muted); font-size: 1.2rem; }
.pill { font-size: .75rem; font-weight: 600; border-radius: 99px; padding: .15rem .6rem; white-space: nowrap; }
.pill-published { background: var(--true-bg); color: var(--true); }
.pill-draft { background: var(--suspect-bg); color: var(--suspect); }
.pill-none { background: var(--neutral-bg); color: var(--muted); }
.publish-hint { flex-basis: 100%; text-align: right; margin: 0; }
@media (max-width: 720px) { .tray { grid-template-columns: 1fr; } }
.newer-style { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; }
/* semesters: three boxes and the button on one baseline (one column on a phone) */
.semester-form { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: .6rem; align-items: end; }
.semester-form label { display: flex; flex-direction: column; gap: .25rem; font-size: .88rem; color: var(--muted); }
.semester-form input, .semester-form button { box-sizing: border-box; height: 2.7rem; margin: 0; }
@media (max-width: 720px) { .semester-form { grid-template-columns: 1fr; } }
.menu-panel form + form { border-top: 1px solid var(--line); padding-top: .6rem; margin-top: .4rem; }
/* ---------- Usage dashboard ---------- */
.usage-controls select { width: auto; }
.usage-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin: 1rem 0 1.2rem; }
.usage-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; display: flex; flex-direction: column; gap: .35rem; }
.usage-figure { font-size: 1.7rem; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.usage-figure small { font-size: 1rem; color: var(--muted); font-weight: 500; }
.meter { display: block; flex: 1; height: 8px; border-radius: 99px; background: var(--neutral-bg); overflow: hidden; min-width: 80px; }
.meter > span { display: block; height: 100%; border-radius: 99px; background: var(--true); }
.meter.warn > span { background: var(--suspect); } .meter.over > span { background: var(--false); } .meter.neutral > span { background: var(--line-strong); }
.meter-row { display: flex; align-items: center; gap: .6rem; }
.pct { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 3.2rem; text-align: right; }
.usage-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr)); gap: .9rem; }
.usage-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; display: flex; flex-direction: column; gap: .55rem; }
.usage-card h3 { margin: 0; font-size: 1.05rem; }
.usage-card-head { display: flex; align-items: center; gap: .9rem; }
.ring { flex: none; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; }
.ring > span { width: 58px; height: 58px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 600; font-size: .9rem; }
.ring-none { background: var(--neutral-bg); } .ring-none > span { font-size: .78rem; }
.usage-part { display: grid; grid-template-columns: minmax(0, 1fr) 9rem 3.6rem; gap: .6rem; align-items: center; font-size: .9rem; }
.usage-people { width: 100%; } .usage-people th.number, .usage-people td.number { text-align: right; font-variant-numeric: tabular-nums; }
.usage-people th a { color: inherit; text-decoration: none; } .usage-people th a.sorted { color: var(--accent); }
.usage-people .group-row td { background: var(--page); font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.budget-requests .request-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.budget-requests .request-row > span { display: flex; flex-direction: column; }
.budget-line { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 1rem; padding: .35rem 0; border-bottom: 1px solid var(--line); }
.budget-line input { width: 10rem; }
.over-budget { color: var(--false); }
@media (max-width: 720px) { .usage-tiles { grid-template-columns: 1fr; } .usage-part { grid-template-columns: 1fr 6rem 3.2rem; } }
/* ---------- People ---------- */
.people-filters { display: flex; flex-wrap: wrap; gap: .6rem; margin: .8rem 0 .3rem; }
.people-filters input[type=search] { flex: 1 1 16rem; } .people-filters select { width: auto; }
.bulk-bar { position: sticky; top: .5rem; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; background: var(--ink); color: var(--surface);
            border-radius: 10px; padding: .55rem .9rem; margin: .6rem 0; }
.bulk-bar[hidden] { display: none; }
.bulk-bar button:not(.link-button) { background: transparent; border: 1px solid color-mix(in srgb, var(--surface) 45%, transparent); color: var(--surface); padding: .3rem .7rem; }
.bulk-bar .link-button { color: color-mix(in srgb, var(--surface) 70%, transparent); margin-left: auto; }
.bulk-bar select { width: auto; max-width: 18rem; padding: .3rem .5rem; }
.people-table { width: 100%; } .people-table td { vertical-align: top; }
.person-link { color: var(--ink); text-decoration: none; } .person-link:hover { color: var(--accent); }
.role-chip { display: inline-block; font-size: .78rem; border-radius: 99px; padding: .12rem .55rem; background: var(--neutral-bg); margin: .1rem .25rem .1rem 0; }
.status-pill { font-size: .75rem; font-weight: 600; border-radius: 99px; padding: .15rem .6rem; white-space: nowrap; }
.status-active { background: var(--true-bg); color: var(--true); } .status-invited { background: var(--suspect-bg); color: var(--suspect); }
.status-disabled { background: var(--neutral-bg); color: var(--muted); }
.role-line { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border: 1px solid var(--line); border-radius: 8px; padding: .5rem .8rem; }
.role-line .inline-form { gap: .4rem; }
.give-role { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; margin-top: .4rem; }
.give-role label { display: flex; flex-direction: column; gap: .25rem; }
.activity li { padding: .35rem 0; border-bottom: 1px solid var(--line); }
/* ---------- Submission report ---------- */
.file-problem { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; font-weight: 600; color: var(--suspect); background: var(--suspect-bg);
                border-radius: 99px; padding: .1rem .55rem; text-decoration: none; margin-top: .2rem; }
.submission-lines li, .file-problems li { display: flex; gap: .6rem; align-items: baseline; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.submission-lines .tag { margin-left: .4rem; }
.title-page-parts { border: none; padding: 0; margin: 0; } .title-page-parts legend { margin-bottom: .3rem; }
.title-page-parts .check { display: inline-flex; flex-direction: row; align-items: center; gap: .35rem; margin-right: 1.2rem; }
.count-row { align-items: center; } .count-row .count-name { min-width: 5rem; }
.count-row label { flex-direction: row; align-items: center; gap: .4rem; }
.measured dl { display: grid; grid-template-columns: 11rem 1fr; gap: .3rem 1rem; margin-top: .6rem; }
.measured dd { margin: 0; overflow-wrap: anywhere; }

/* Staff (v53): Contracts under Home, the renewal reminders, the staff and per-university usage tables. */
.sidebar nav a.sub-link { padding-left: 2.1rem; font-size: .92em; }
.renewals { border-left: 4px solid var(--suspect); }
.renewals li { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.staff-table td, .staff-table th { vertical-align: top; }
.staff-table .checks { display: flex; flex-wrap: wrap; gap: .25rem .8rem; }
.staff-table label.check { flex-direction: row; align-items: center; gap: .3rem; font-weight: 400; }
.status-tag.running { background: var(--true-bg); color: var(--true); }
.status-tag.ended { background: var(--neutral-bg); color: var(--muted); }
.status-tag.upcoming { background: var(--accent-tint); color: var(--accent-deep); }
.contract-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .6rem 1rem; align-items: end; }
.contract-form .wide { grid-column: 1 / -1; }
.suggestion-box { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .8rem; }
.notice .icon { vertical-align: -2px; margin-right: .3rem; }

/* The audit log a week at a time (v54): weeks down the side, the brief, the filters. */
.audit-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 1rem; align-items: start; }
.audit-weeks { padding: .6rem; gap: 2px; max-height: 75vh; overflow-y: auto; }
.audit-weeks .sidebar-label { margin: .2rem .5rem .3rem; }
.audit-weeks a { display: flex; justify-content: space-between; padding: .4rem .6rem; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: .92rem; }
.audit-weeks a:hover { background: var(--neutral-bg); }
.audit-weeks a.current { background: var(--accent-tint); color: var(--accent-deep); font-weight: 600; }
.audit-week { display: flex; flex-direction: column; gap: .9rem; min-width: 0; }
.brief { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: .8rem 1.1rem; }
.brief p { margin: 0; } .brief p + p { margin-top: .3rem; }
.audit-filters { display: flex; flex-wrap: wrap; gap: .5rem .7rem; align-items: flex-end; }
.audit-filters label { flex-direction: column; font-size: .8rem; color: var(--muted); gap: .15rem; }
.audit-filters select, .audit-filters input { font-size: .9rem; }
.small-dialog label.check { flex-direction: row; align-items: center; gap: .4rem; flex-wrap: wrap; }
@media (max-width: 760px) { .audit-layout { grid-template-columns: 1fr; } .audit-weeks { max-height: 12rem; } }

/* People for instructors and TAs (v54): their reporting chain as a ladder. */
.chain-layout { display: flex; gap: 1.2rem; align-items: flex-start; flex-wrap: wrap; }
.ladder { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; min-width: min(100%, 26rem); flex: 1; max-width: 34rem; }
.rung { position: relative; display: flex; gap: .8rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .55rem .9rem; }
.rung > span:last-child { display: flex; flex-direction: column; }
.rung + .rung::before { content: ""; position: absolute; left: 28px; top: -19px; height: 18px; border-left: 2px solid var(--line-strong); }
.rung.me { border-color: var(--accent); background: var(--accent-tint); }
.rung.empty { border-style: dashed; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--neutral-bg); display: grid; place-items: center; font-weight: 700; color: var(--muted); font-size: .85rem; flex: none; }
.ask-card { width: min(100%, 20rem); }

/* A segmented choice made of radio buttons (new client: university, faculty or department). */
fieldset.segmented { border: 0; padding: 0; margin: 0; display: inline-flex; gap: .3rem; flex-wrap: wrap; }
.segment { flex-direction: row; align-items: center; padding: .3rem .8rem; border: 1px solid var(--line); border-radius: 99px; font-size: .88rem; font-weight: 500; cursor: pointer; background: var(--surface); }
.segment input { position: absolute; opacity: 0; pointer-events: none; }
.segment:has(input:checked) { background: var(--accent-tint); border-color: var(--accent); color: var(--accent-deep); }
.segment:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
a.card-link.usage-tile { color: var(--ink); text-decoration: none; }
.ok-text { color: var(--true); }
.usage-tiles.four { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.audit-weeks a { width: 100%; gap: .6rem; box-sizing: border-box; text-align: left; }
.audit-weeks { align-items: stretch; flex-wrap: nowrap; flex-direction: column; } .audit-weeks .sidebar-label { text-align: left; }
.audit-weeks a { margin-left: 0; }
.audit-filters label { flex: 0 1 auto; } .audit-filters select { max-width: 15rem; }

/* Sales (v55): the tile map of Canada, the board. Claret: under contract; amber: in the pipeline; grey: the rest. */
:root { --won: #9e1b34; --pipe: #e3b04b; --none-tile: #e4e0e3; }
.sales-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1rem; align-items: start; }
.sales-map svg { width: 100%; height: auto; display: block; }
.sales-map .tile { stroke: var(--surface); stroke-width: 1.6; cursor: pointer; transition: opacity .15s; }
.sales-map .tile.won { fill: var(--won); } .sales-map .tile.pipe { fill: var(--pipe); } .sales-map .tile.none { fill: var(--none-tile); }
.sales-map .tile.other { opacity: .28; }
.sales-map .tile:hover, .sales-map .tile:focus-visible, .sales-map .tile.picked { stroke: var(--ink); stroke-width: 2.5; outline: none; }
.sales-map .tile.chosen { stroke: var(--accent); stroke-width: 3.2; }
.sales-map .province { fill: none; stroke: var(--line-strong); stroke-width: 1.3; stroke-linejoin: round; pointer-events: none; }
.sales-map .province.lit { stroke: var(--accent); stroke-width: 3; }
.sales-map text { font: 600 12px Inter, sans-serif; fill: var(--ink); pointer-events: none; }
.sales-map text tspan { font-weight: 400; fill: var(--muted); }
.legend-row { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .85rem; color: var(--muted); align-items: center; margin-top: .5rem; }
.hx { display: inline-block; width: 13px; height: 14px; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); margin-right: .3rem; vertical-align: -2px; }
.hx.won { background: var(--won); } .hx.pipe { background: var(--pipe); } .hx.none { background: var(--none-tile); }
.hx.ring { background: radial-gradient(circle, var(--none-tile) 36%, var(--won) 38%, var(--won) 62%, var(--none-tile) 64%); }
/* (v56) a tile where a faculty or department is under contract carries a claret ring */
.sales-map .ring { fill: none; stroke: var(--won); stroke-width: 2; pointer-events: none; }
.deal-line { display: grid; gap: .1rem; padding: .35rem 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.deal-line .person { padding-left: 1.15rem; } .deal-line .person .link-button { margin-left: .3rem; }
.small-form summary { cursor: pointer; color: var(--accent); width: fit-content; } .small-form form { margin: .4rem 0 .2rem; }
.deal summary .tag { margin: .15rem 0; white-space: normal; max-width: 100%; display: inline-block; line-height: 1.3; }
.small-form summary { list-style: none; } .small-form summary::-webkit-details-marker { display: none; }
.sales-side { display: flex; flex-direction: column; gap: .8rem; position: sticky; top: 1rem; }
.sales-side .card { gap: .35rem; }
.sales-history li { color: var(--muted); }
.board { display: grid; grid-template-columns: repeat(8, minmax(9.5rem, 1fr)); gap: .6rem; overflow-x: auto; padding-bottom: .5rem; }
.board-column { background: var(--neutral-bg); border-radius: var(--radius); padding: .5rem; display: flex; flex-direction: column; gap: .4rem;
                min-height: 14rem; max-height: 75vh; overflow-y: auto; }      /* a long column scrolls on its own; the page stays short */
.stack.tight { display: grid; gap: .3rem; }
.board-column.over { outline: 2px dashed var(--accent); }
.board-column h3 { margin: .1rem .2rem .3rem; font-size: .85rem; }
.deal { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .45rem .55rem; font-size: .84rem; cursor: grab; }
.deal summary { list-style: none; cursor: pointer; } .deal summary::-webkit-details-marker { display: none; }
.deal form { margin-top: .4rem; display: flex; flex-direction: column; gap: .3rem; }
.deal textarea, .deal input, .deal select { font-size: .82rem; }
@media (max-width: 900px) { .sales-layout { grid-template-columns: 1fr; } .sales-side { position: static; } }

/* ---------- v57: report flags, what was checked, citation density ---------- */
.chip-link { text-decoration: none; } .chip-link:hover .chip { outline: 2px solid currentColor; outline-offset: 1px; }
[data-flag].flag-current { outline: 3px solid var(--accent); outline-offset: -3px; background: var(--accent-tint); }
.flag-nav { position: fixed; right: 1rem; bottom: 1rem; z-index: 5; display: flex; gap: .5rem; align-items: center; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: .4rem .6rem; box-shadow: 0 4px 18px rgb(0 0 0 / .12); }
mark.cited { background: var(--accent-tint); color: var(--accent-deep); border-radius: 3px; padding: 0 .15em; font-weight: 600; }
td.compared blockquote { margin: .2rem 0 .3rem; padding: .3rem .5rem; border-left: 3px solid var(--line-strong); background: var(--page); }
.density-strip { display: flex; align-items: flex-end; gap: 4px; height: 84px; padding-top: 4px; border-bottom: 1px solid var(--line); max-width: 760px; }
.density-bar { flex: 1 1 0; min-width: 10px; max-width: 44px; height: var(--h); background: var(--true-bg); border: 1px solid var(--true);
  border-radius: 4px 4px 0 0; display: flex; justify-content: center; align-items: flex-start; text-decoration: none; }
.density-bar.thin { background: var(--suspect-bg); border-color: var(--suspect); cursor: pointer; }
.density-bar.end { background: repeating-linear-gradient(45deg, var(--neutral-bg) 0 4px, var(--surface) 4px 8px); border-color: var(--line-strong); }
.density-bar:hover { outline: 2px solid var(--ink); }
.density-count { font-size: .7rem; font-weight: 600; color: var(--ink); line-height: 1.6; }
.density-key { display: inline-block; width: 11px; height: 11px; margin-right: .3rem; vertical-align: -1px; border-radius: 2px;
  background: var(--true-bg); border: 1px solid var(--true); }
.density-key.thin { background: var(--suspect-bg); border-color: var(--suspect); }
.density-key.end { background: repeating-linear-gradient(45deg, var(--neutral-bg) 0 2px, var(--surface) 2px 4px); border-color: var(--line-strong); }
.thin-list li { display: grid; grid-template-columns: auto 1fr; gap: .6rem; padding: .5rem .3rem; border-bottom: 1px solid var(--line); scroll-margin-top: 5rem; }
.admin-section > summary { cursor: pointer; } .admin-section > summary h2 { display: inline; }
