/* ==========================================================================
   WVSTU-LMS design system
   Navy + gold institutional palette. Everything is local — no web fonts, no
   CDN, no external images — so a page loads over a weak campus link.
   ========================================================================== */

:root {
  --navy: #0b2545;
  --navy-dark: #071a33;
  --navy-mid: #16375e;
  --gold: #c9a227;
  --gold-light: #e8cf6f;
  --gold-pale: #fdf6e0;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #17222f;
  --muted: #5d6b7d;
  --border: #dde3ec;
  --border-strong: #c3cddc;
  --success: #1c7c46;
  --success-bg: #e6f5ec;
  --warn: #8a6300;
  --warn-bg: #fdf3d8;
  --danger: #b3271b;
  --danger-bg: #fdeceb;
  --info: #1a5fa8;
  --info-bg: #e6effb;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 30, 54, 0.06);
  --shadow-lg: 0 8px 28px rgba(11, 37, 69, 0.14);
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", Roboto, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

/* Author rules such as .btn { display:inline-block } otherwise beat the browser's
   own [hidden] rule, which would leave hidden controls on screen. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
}

a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; }
p { margin: 0 0 12px; }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--gold); color: var(--navy-dark);
  padding: 10px 18px; font-weight: 700; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ------------------------------------------------------------- masthead */
.masthead {
  background: var(--navy);
  color: #fff;
  border-bottom: 4px solid var(--gold);
}
.masthead-inner {
  max-width: 1240px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand:hover { text-decoration: none; }
.crest {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--gold); color: var(--navy-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; letter-spacing: 0.5px;
  border: 2px solid var(--gold-light); flex-shrink: 0;
}
.brand-text .name { font-family: var(--serif); font-size: 17px; font-weight: 700; letter-spacing: 0.2px; }
.brand-text .sub { display: block; font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--gold-light); }

.masthead form.search { margin-left: auto; display: flex; gap: 6px; }
.masthead form.search input {
  border: 1px solid rgba(255,255,255,0.28); background: rgba(255,255,255,0.1);
  color: #fff; padding: 7px 12px; border-radius: 20px; font-size: 13px; width: 190px;
  font-family: inherit;
}
.masthead form.search input::placeholder { color: #b9c8dd; }
.masthead form.search input:focus { background: #fff; color: var(--text); }

.account-menu { display: flex; align-items: center; gap: 10px; }
.account-menu .who { text-align: right; line-height: 1.2; }
.account-menu .who .n { font-size: 13px; font-weight: 600; }
.account-menu .who .r { font-size: 11px; color: var(--gold-light); text-transform: uppercase; letter-spacing: 0.6px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--gold); color: var(--navy-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.linkbtn {
  background: none; border: 1px solid rgba(255,255,255,0.35); color: #fff;
  border-radius: 20px; padding: 6px 14px; font-size: 12px; cursor: pointer; font-family: inherit;
}
.linkbtn:hover { background: rgba(255,255,255,0.12); }

/* ---------------------------------------------------------- primary nav */
.primary-nav { background: var(--navy-mid); }
.primary-nav ul {
  max-width: 1240px; margin: 0 auto; padding: 0 12px;
  list-style: none; display: flex; gap: 2px; overflow-x: auto;
}
.primary-nav a {
  display: block; padding: 12px 16px; color: #d7e2f0; font-size: 14px; font-weight: 500;
  border-bottom: 3px solid transparent; white-space: nowrap;
}
.primary-nav a:hover { color: #fff; background: rgba(255,255,255,0.06); text-decoration: none; }
.primary-nav a[aria-current="page"] { color: #fff; font-weight: 700; border-bottom-color: var(--gold); }

/* ------------------------------------------------------------- structure */
.page { max-width: 1240px; margin: 0 auto; padding: 26px 20px 60px; }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-header h1 { font-family: var(--serif); font-size: 26px; margin: 0; color: var(--navy); }
.page-header .lede { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.page-header .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb span { margin: 0 6px; }

section + section { margin-top: 26px; }
/* Layouts that space their own children must not also inherit that rule. */
.auth-split > section + section,
.live-side > section + section,
.live-grid > section + section,
.grid > section + section { margin-top: 0; }
.section-title { font-family: var(--serif); font-size: 19px; color: var(--navy); margin: 0 0 12px; }

/* ---------------------------------------------------------------- cards */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); margin-bottom: 18px;
}
.card > h2, .card > h3 { margin-top: 0; color: var(--navy); font-family: var(--serif); }
.card > h3 { font-size: 17px; }
.card.tight { padding: 14px 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h3 { margin: 0; }

.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* Cambridge-style signpost boxes */
.signposts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.signpost {
  display: block; background: var(--card); border: 1px solid var(--border);
  border-top: 3px solid var(--gold); border-radius: var(--radius);
  padding: 16px; color: var(--text); box-shadow: var(--shadow);
}
.signpost:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.signpost .t { font-weight: 700; color: var(--navy); display: block; margin-bottom: 3px; }
.signpost .d { font-size: 13px; color: var(--muted); }

.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.stat .num { font-size: 30px; font-weight: 700; color: var(--navy); font-family: var(--serif); line-height: 1.1; }
.stat .label { color: var(--muted); font-size: 13px; margin-top: 3px; }
.stat.accent { border-top: 3px solid var(--gold); }

/* --------------------------------------------------------- course cards */
.course-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow);
}
.course-card:hover { border-color: var(--border-strong); }
.course-card .code {
  align-self: flex-start; background: var(--navy); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: 0.6px;
  padding: 3px 9px; border-radius: 3px;
}
.course-card h3 { margin: 0; font-size: 16px; font-family: var(--sans); }
.course-card h3 a { color: var(--navy); }
.course-card .meta { font-size: 12.5px; color: var(--muted); }
.course-card .desc { font-size: 13.5px; color: var(--text); flex: 1; }
.course-card .foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }

.progress { background: #e7ecf3; border-radius: 20px; overflow: hidden; height: 7px; }
.progress .fill { background: var(--gold); height: 100%; }
.progress.slim { height: 5px; }

/* --------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.5px; background: #fbfcfe; }
tbody tr:hover td { background: #fafbfd; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.compact th, table.compact td { padding: 7px 9px; font-size: 13px; }

/* --------------------------------------------------------------- badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: 0.2px; }
.badge.role-admin { background: var(--danger-bg); color: var(--danger); }
.badge.role-instructor { background: var(--info-bg); color: var(--info); }
.badge.role-student { background: var(--success-bg); color: var(--success); }
.badge.grade-ok, .badge.ok { background: var(--success-bg); color: var(--success); }
.badge.grade-pending, .badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.grade-missing, .badge.bad { background: var(--danger-bg); color: var(--danger); }
.badge.neutral { background: #eef1f6; color: var(--muted); }
.badge.gold { background: var(--gold-pale); color: #7a5f06; }

.pill { display: inline-block; font-size: 11px; padding: 2px 8px; border: 1px solid var(--border-strong); border-radius: 20px; color: var(--muted); }

/* -------------------------------------------------------------- buttons */
.btn {
  display: inline-block; background: var(--navy); color: #fff !important; border: 1px solid var(--navy);
  padding: 9px 18px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600;
  cursor: pointer; text-decoration: none !important; font-family: inherit; text-align: center;
}
.btn:hover { background: var(--navy-dark); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--navy-dark) !important; }
.btn.gold:hover { background: var(--gold-light); }
.btn.outline { background: transparent; color: var(--navy) !important; border-color: var(--border-strong); }
.btn.outline:hover { background: #eef2f8; }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: #8f1f15; }
.btn.small { padding: 5px 12px; font-size: 12px; }
.btn.block { display: block; width: 100%; }
.btn[disabled], .btn.disabled { opacity: 0.5; pointer-events: none; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------- forms */
fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; margin: 0 0 16px; }
legend { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); padding: 0 6px; }
.field { margin-bottom: 14px; }
.field label, .field > .label { display: block; margin-bottom: 5px; font-size: 13px; font-weight: 600; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="datetime-local"], input[type="search"], input[type="file"],
select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
}
textarea { min-height: 90px; resize: vertical; }
select { appearance: auto; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row .field { flex: 1; min-width: 170px; }
.check { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; font-size: 14px; }
.check input { margin-top: 3px; flex-shrink: 0; }
.check label { font-weight: 400; margin: 0; }
form.inline { display: inline; }

/* -------------------------------------------------------------- alerts */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 14px; border-left: 4px solid; }
.alert.error { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.alert.success { background: var(--success-bg); color: var(--success); border-color: var(--success); }
.alert.info { background: var(--info-bg); color: var(--info); border-color: var(--info); }
.alert.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn); }

/* ---------------------------------------------------------------- lists */
.item {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 13px 15px; margin-bottom: 10px; background: #fff;
}
.item:last-child { margin-bottom: 0; }
.item h4 { margin: 0 0 3px; font-size: 15px; }
.item h4 a { color: var(--navy); }
.item .meta { font-size: 12.5px; color: var(--muted); }
.item .body { font-size: 14px; margin-top: 6px; }
.item.flagged { border-left: 3px solid var(--gold); }

.empty { text-align: center; padding: 34px 20px; color: var(--muted); font-size: 14px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); }

/* ----------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 15px; font-size: 13.5px; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs a:hover { color: var(--navy); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--navy); font-weight: 700; border-bottom-color: var(--gold); }
.tabs .count { background: #eef1f6; border-radius: 10px; padding: 0 6px; font-size: 11px; margin-left: 4px; }

details.disclose { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; background: #fff; }
details.disclose > summary { padding: 11px 15px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--navy); }
details.disclose > summary:hover { background: #f7f9fc; }
details.disclose > .inner { padding: 0 15px 15px; border-top: 1px solid var(--border); padding-top: 14px; }

/* ------------------------------------------------------------------ CBT */
.cbt-shell { max-width: 900px; margin: 0 auto; padding: 20px; }
.cbt-bar {
  position: sticky; top: 0; z-index: 20; background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 10px 18px; border-bottom: 3px solid var(--gold); flex-wrap: wrap;
}
.cbt-bar .t { font-weight: 700; font-size: 15px; }
.cbt-bar .sub { font-size: 12px; color: var(--gold-light); }
.cbt-timer {
  font-family: var(--serif); font-size: 22px; font-weight: 700;
  background: rgba(255,255,255,0.12); padding: 4px 14px; border-radius: var(--radius-sm);
  font-variant-numeric: tabular-nums;
}
.cbt-timer.warning { background: var(--warn-bg); color: var(--warn); }
.cbt-timer.critical { background: var(--danger); color: #fff; }
.cbt-save { font-size: 12px; color: #cfe0f2; min-width: 130px; text-align: right; }

.question {
  background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--navy);
  border-radius: var(--radius-sm); padding: 18px 20px; margin-bottom: 16px;
}
.question .qnum { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.7px; color: var(--muted); font-weight: 700; }
.question .qtext { font-size: 16px; margin: 6px 0 14px; }
.question .marks { float: right; font-size: 12px; color: var(--muted); font-weight: 600; }
.option {
  display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; margin-bottom: 7px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; background: #fff;
}
.option:hover { background: #f7f9fc; border-color: var(--border-strong); }
.option input { margin-top: 3px; flex-shrink: 0; }
.option.correct { background: var(--success-bg); border-color: var(--success); }
.option.chosen-wrong { background: var(--danger-bg); border-color: var(--danger); }
.option .tag { margin-left: auto; font-size: 11px; font-weight: 700; }

.qnav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.qnav a {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; color: var(--muted); background: #fff;
}
.qnav a.answered { background: var(--navy); color: #fff; border-color: var(--navy); }
.qnav a:hover { text-decoration: none; border-color: var(--gold); }

.score-hero {
  background: var(--navy); color: #fff; border-radius: var(--radius);
  padding: 22px 26px; display: flex; align-items: center; gap: 26px; flex-wrap: wrap; margin-bottom: 20px;
}
.score-hero .big { font-family: var(--serif); font-size: 42px; font-weight: 700; line-height: 1; }
.score-hero .of { font-size: 13px; color: var(--gold-light); }
.score-hero .verdict { margin-left: auto; text-align: right; }

/* ------------------------------------------------------------ auth pages */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, var(--navy) 0%, var(--navy-dark) 70%); padding: 24px;
}
.auth-box { background: #fff; border-radius: 14px; width: 100%; max-width: 430px; padding: 34px 32px; box-shadow: var(--shadow-lg); }
.auth-box .crest { width: 60px; height: 60px; font-size: 19px; margin: 0 auto 14px; }
.auth-box h1 { text-align: center; font-family: var(--serif); font-size: 20px; color: var(--navy); margin: 0 0 2px; }
.auth-box .tagline { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 22px; }
.auth-box .btn { width: 100%; padding: 11px; margin-top: 4px; }
.demo-accounts { margin-top: 22px; font-size: 12px; color: var(--muted); background: #f6f8fc; padding: 12px 14px; border-radius: var(--radius-sm); }
.demo-accounts strong { color: var(--text); }
.demo-accounts code { font-size: 11.5px; }

/* --------------------------------------------------------------- footer */
.site-footer { background: var(--navy-dark); color: #b9c8dd; margin-top: 50px; font-size: 13px; }
.site-footer .cols { max-width: 1240px; margin: 0 auto; padding: 30px 20px 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 26px; }
.site-footer h4 { color: #fff; font-size: 12px; text-transform: uppercase; letter-spacing: 0.8px; margin: 0 0 10px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: #b9c8dd; }
.site-footer a:hover { color: #fff; }
.site-footer .base { border-top: 1px solid rgba(255,255,255,0.12); padding: 14px 20px; text-align: center; font-size: 12px; color: #8fa2ba; }

/* --------------------------------------------------------------- print */
@media print {
  .masthead, .primary-nav, .site-footer, .btn, .tabs, .actions, form { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .card { border: none; box-shadow: none; padding: 0; }
  .page { padding: 0; max-width: none; }
  a { color: #000; text-decoration: none; }
}

/* ---------------------------------------------------------- responsive */
@media (max-width: 820px) {
  .masthead-inner { padding: 10px 14px; gap: 10px; }
  .masthead form.search { order: 3; width: 100%; margin-left: 0; }
  .masthead form.search input { width: 100%; }
  .account-menu { margin-left: auto; }
  .account-menu .who { display: none; }
  .page { padding: 18px 14px 40px; }
  .page-header h1 { font-size: 21px; }
  .score-hero { padding: 18px; gap: 14px; }
  .score-hero .verdict { margin-left: 0; text-align: left; }
  .cbt-bar { padding: 8px 12px; }
}

/* ==========================================================================
   Identity: crest and campus photography
   The crest appears everywhere; photographs appear only on the front door and
   the catalogue, so the pages people work in every day stay text-only.
   ========================================================================== */
.crest-img {
  height: 44px; width: auto; display: block; flex-shrink: 0;
  background: #fff; border-radius: 8px; padding: 3px 5px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.crest-img.big {
  height: 84px; margin: 0 auto 14px; background: none; box-shadow: none; padding: 0;
}

/* ------------------------------------------------------- sign-in page */
.auth-body { margin: 0; background: var(--navy-dark); }
.auth-split { display: grid; grid-template-columns: 1.15fr 1fr; min-height: 100vh; }

.auth-hero { position: relative; overflow: hidden; background: var(--navy); }
.auth-hero-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.auth-hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7,26,51,0.15) 0%, rgba(7,26,51,0.35) 55%, rgba(7,26,51,0.88) 100%);
}
.auth-hero-caption {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  padding: 30px 38px; color: #fff;
}
.auth-hero-caption .kicker {
  display: block; font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--gold-light); margin-bottom: 6px;
}
.auth-hero-caption h2 { font-family: var(--serif); font-size: 25px; margin: 0 0 4px; font-weight: 700; }
.auth-hero-caption p { margin: 0; font-size: 14px; color: #d5e0ef; font-style: italic; }

.auth-panel { display: flex; align-items: center; justify-content: center; padding: 30px 24px; background: var(--bg); }
.auth-foot { text-align: center; margin: 18px 0 0; font-size: 12px; color: var(--muted); }
.auth-foot .instance { font-size: 11px; opacity: 0.75; }

/* Campus banner on the catalogue — the only photograph behind the sign-in. */
.campus-banner {
  position: relative; border-radius: var(--radius); overflow: hidden;
  margin-bottom: 22px; background: var(--navy); min-height: 132px;
}
.campus-banner img { width: 100%; height: 168px; object-fit: cover; display: block; opacity: 0.62; }
.campus-banner .caption {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center;
  padding: 0 28px; color: #fff;
  background: linear-gradient(90deg, rgba(7,26,51,0.86) 0%, rgba(7,26,51,0.45) 70%, rgba(7,26,51,0.2) 100%);
}
.campus-banner .caption h2 { font-family: var(--serif); font-size: 22px; margin: 0 0 4px; }
.campus-banner .caption p { margin: 0; font-size: 13.5px; color: #d5e0ef; max-width: 46ch; }

/* ==========================================================================
   Live classes
   ========================================================================== */
.live-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 14px; border-radius: 20px; font-size: 12.5px; font-weight: 700;
  background: #eef1f6; color: var(--muted);
}
.live-pill.live { background: var(--danger-bg); color: var(--danger); }
.live-pill.live::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); animation: pulse 1.6s ease-in-out infinite;
}
.live-pill.ended { background: #eef1f6; color: var(--muted); }
.live-pill.scheduled { background: var(--gold-pale); color: #7a5f06; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .live-pill.live::before { animation: none; } }

.live-banner {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--navy); color: #fff; border-left: 5px solid var(--danger);
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 20px;
}
.live-banner strong { display: block; font-size: 15px; }
.live-banner div { font-size: 13px; color: #cfdcec; }
.live-banner .btn { margin-left: auto; }
.live-dot {
  width: 11px; height: 11px; border-radius: 50%; background: var(--danger);
  box-shadow: 0 0 0 4px rgba(179,39,27,0.28); animation: pulse 1.6s ease-in-out infinite; flex-shrink: 0;
}
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

.live-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.live-main { min-width: 0; }

.stage {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px;
  background: #0a1728; border-radius: var(--radius); padding: 10px; min-height: 300px;
}
.stage-empty {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: center;
  color: #8fa2ba; font-size: 14px; min-height: 280px; text-align: center;
}
.tile {
  position: relative; background: #12243c; border-radius: 8px; overflow: hidden;
  aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center;
}
.tile video { width: 100%; height: 100%; object-fit: cover; display: block; background: #12243c; }
.tile.is-self { outline: 2px solid var(--gold); outline-offset: -2px; }
.tile-label {
  position: absolute; left: 8px; bottom: 8px; z-index: 2;
  background: rgba(7,26,51,0.78); color: #fff; font-size: 12px; font-weight: 600;
  padding: 3px 9px; border-radius: 20px; max-width: calc(100% - 16px);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tile-placeholder {
  display: none; position: absolute; inset: 0; z-index: 1;
  align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 34px; font-weight: 700;
  color: var(--navy-dark); background: var(--gold);
}
.tile.audio-only .tile-placeholder { display: flex; }
.tile.audio-only video { opacity: 0; }

.live-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.conn-state { font-size: 12px; color: var(--muted); margin-left: auto; }

.live-side { display: flex; flex-direction: column; gap: 14px; }
.people { list-style: none; margin: 0; padding: 0; max-height: 230px; overflow-y: auto; }
.person {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  padding: 7px 2px; border-bottom: 1px solid var(--border); font-size: 13.5px;
}
.person:last-child { border-bottom: none; }
.person > span:first-child { flex: 1; min-width: 0; }

.chat-card { display: flex; flex-direction: column; }
.chat-log {
  height: 280px; overflow-y: auto; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px; background: #fbfcfe; margin-bottom: 10px;
}
.chat-msg { margin-bottom: 10px; font-size: 13.5px; }
.chat-msg strong { color: var(--navy); font-size: 12.5px; }
.chat-msg.mine strong { color: var(--gold); }
.chat-time { font-size: 11px; color: var(--muted); margin-left: 6px; }
.chat-form { display: flex; gap: 7px; }
.chat-form input { flex: 1; }

.rec-timer {
  font-family: var(--serif); font-size: 20px; font-weight: 700;
  color: var(--navy); font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Safe Exam Browser
   ========================================================================== */
.seb-panel {
  border: 1px solid var(--border-strong); border-left: 4px solid var(--navy);
  background: #f7f9fc; border-radius: var(--radius-sm); padding: 16px 18px; margin: 16px 0;
}
.seb-panel h4 { margin: 0 0 8px; color: var(--navy); font-size: 15px; }
.seb-panel p { font-size: 13.5px; }

/* ---------------------------------------------------------- responsive */
@media (max-width: 1000px) {
  .live-grid { grid-template-columns: 1fr; }
  .live-side { flex-direction: row; flex-wrap: wrap; }
  .live-side > * { flex: 1 1 280px; }
}
@media (max-width: 900px) {
  .auth-split { grid-template-columns: 1fr; min-height: 0; }
  .auth-hero { height: 210px; }
  .auth-hero-caption { padding: 18px 22px; }
  .auth-hero-caption h2 { font-size: 19px; }
  .auth-panel { padding: 22px 16px 40px; }
  .campus-banner img { height: 128px; }
  .campus-banner .caption { padding: 0 18px; }
}
@media (max-width: 820px) {
  .crest-img { height: 36px; }
  .live-banner .btn { margin-left: 0; width: 100%; }
  .stage { grid-template-columns: 1fr; }
}

/* Live-class capacity meter — tells the host, at a glance, what the room can
   carry right now and why the picture just changed. */
.capacity-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 20px; font-size: 12.5px; font-weight: 700;
  background: #eef1f6; color: var(--muted); white-space: nowrap;
}
.capacity-pill.full { background: var(--success-bg); color: var(--success); }
.capacity-pill.degraded { background: var(--warn-bg); color: var(--warn); }
.capacity-pill.audio { background: var(--info-bg); color: var(--info); }
.capacity-note {
  background: var(--gold-pale); border-left: 4px solid var(--gold);
  border-radius: var(--radius-sm); padding: 9px 14px; margin-bottom: 14px;
  font-size: 13px; color: #6b5205;
}

/* Importing a question paper — the preview an instructor confirms before
   anything reaches the bank. Deliberately plain and dense: the job here is to
   read a hundred questions quickly and spot the two that are wrong. */
.import-summary {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 4px;
}
.import-summary .meta { display: flex; flex-wrap: wrap; gap: 6px; }

.import-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 12px 0; position: sticky; top: 0; z-index: 5;
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.import-actions .meta { color: var(--muted); font-size: 13px; }

.import-item {
  background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--success);
  border-radius: var(--radius); padding: 14px 16px; margin-top: 12px; box-shadow: var(--shadow);
}
.import-item.flagged { border-left-color: var(--danger); background: #fffdfd; }
.import-head .check { margin: 0; }
.import-head label { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.import-text { margin: 8px 0 6px; font-weight: 600; }
.import-options { list-style: none; padding: 0; margin: 0 0 6px; font-size: 14px; }
.import-options li { padding: 1px 0; color: var(--muted); }
.import-options li.correct { color: var(--success); font-weight: 600; }
.import-accepted { font-size: 13px; color: var(--muted); margin: 4px 0; }
.import-note { font-size: 12.5px; color: var(--info); margin: 3px 0; }
.import-problem { font-size: 12.5px; color: var(--danger); font-weight: 600; margin: 3px 0; }
.import-fields { margin-top: 10px; gap: 10px; align-items: flex-end; }
.import-fields .field { margin: 0; }
.import-fields input, .import-fields select { width: 100%; }
.import-fields .field:nth-child(1) { flex: 0 0 90px; min-width: 90px; }
.import-fields .field:nth-child(2) { flex: 1 1 220px; min-width: 180px; }
.import-fields .field:nth-child(3) { flex: 0 0 150px; min-width: 150px; }

.pill.ok { border-color: var(--success); color: var(--success); background: var(--success-bg); }
.pill.warn { border-color: var(--warn); color: var(--warn); background: var(--warn-bg); }
.pill.bad { border-color: var(--danger); color: var(--danger); background: var(--danger-bg); }

/* ==========================================================================
   THE ENTRANCE PORTAL

   A candidate meets the university here before they are a student, often on a
   lab machine, often nervous, sometimes on a phone. So: larger type, fewer
   things on the screen, and every state of a paper — ready, running, done,
   shut — visibly different at a glance from the back of a hall.
   ========================================================================== */
.entrance .masthead { border-bottom-color: var(--gold); }

.entrance-hero {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 26px; align-items: center;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); margin-bottom: 22px;
}
.entrance-hero-text { padding: 30px 30px 30px 32px; }
.entrance-hero h1 { font-family: var(--serif); font-size: 30px; color: var(--navy); margin: 6px 0 10px; }
.entrance-hero .eyebrow { margin: 0; font-size: 11.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.entrance-hero .lede { color: var(--muted); font-size: 15px; margin-bottom: 18px; max-width: 46ch; }
.entrance-hero .hero-note { font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.entrance-hero-img { align-self: stretch; }
.entrance-hero-img img { width: 100%; height: 100%; object-fit: cover; display: block; min-height: 240px; }
@media (max-width: 820px) {
  .entrance-hero { grid-template-columns: 1fr; }
  .entrance-hero-img { order: -1; }
  .entrance-hero-img img { min-height: 150px; max-height: 200px; }
}

.btn.big { padding: 13px 26px; font-size: 15px; }

ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 5px 0 5px 20px; position: relative; font-size: 14px; }
ul.plain li::before { content: '·'; position: absolute; left: 6px; color: var(--gold); font-weight: 700; }
ul.plain.big-list li { font-size: 15px; padding: 8px 0 8px 20px; }

/* A paper on the candidate's dashboard. The left edge is the state. */
.entrance-paper { border-left: 5px solid var(--border-strong); }
.entrance-paper.open { border-left-color: var(--gold); }
.entrance-paper.done { border-left-color: var(--success); }
.entrance-paper.shut { border-left-color: var(--border-strong); opacity: 0.85; }
.paper-state { font-size: 13.5px; margin: 8px 0 10px; }
.paper-state.open { color: #7a5f06; font-weight: 600; }
.paper-state.done { color: var(--success); }
.paper-state.running { color: var(--danger); font-weight: 600; }
.paper-state.shut { color: var(--muted); }

/* The receipt after a paper. Big, calm, and free of marks. */
.receipt {
  max-width: 640px; margin: 10px auto; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 34px; text-align: center; box-shadow: var(--shadow);
}
.receipt h1 { font-family: var(--serif); font-size: 25px; color: var(--navy); margin: 10px 0 6px; }
.receipt .lede { color: var(--muted); font-size: 14px; }
.receipt-mark {
  width: 62px; height: 62px; margin: 0 auto; border-radius: 50%;
  background: var(--success-bg); color: var(--success);
  font-size: 32px; line-height: 62px; font-weight: 700;
}
.receipt-table { margin: 20px auto; text-align: left; }
.receipt-note {
  font-size: 13px; color: var(--muted); background: #f7f9fc; border-radius: var(--radius-sm);
  padding: 12px 16px; margin: 16px 0; text-align: left;
}
.receipt h3 { color: var(--navy); font-family: var(--serif); font-size: 16px; text-align: left; }
.receipt ul.plain { text-align: left; margin-bottom: 16px; }

/* The verdict banner on the result page. */
.verdict {
  background: var(--card); border: 1px solid var(--border); border-left: 6px solid var(--border-strong);
  border-radius: var(--radius); padding: 20px 24px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.verdict-qualified { border-left-color: var(--success); }
.verdict-not-qualified { border-left-color: var(--danger); }
.verdict-incomplete { border-left-color: var(--warn); }
.verdict-awaiting-marking { border-left-color: var(--info); }
.verdict-main { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.verdict-label { font-family: var(--serif); font-size: 21px; color: var(--navy); }
.verdict-agg { font-size: 30px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.verdict-note { margin: 8px 0 0; color: var(--muted); font-size: 13.5px; }

.placement { border-top: 1px solid var(--border); padding: 12px 0; }
.placement:first-of-type { border-top: 0; }
.placement-head { display: flex; align-items: center; gap: 10px; }
.placement-label { font-size: 14px; margin-top: 4px; }
.placement-note { font-size: 13px; color: var(--muted); margin-top: 3px; }

/* ------------------------------------------------------------- the slip */
.print-page { background: #eef1f6; padding: 22px; }
.slip {
  max-width: 760px; margin: 0 auto; background: #fff; padding: 34px 40px;
  border: 1px solid var(--border-strong); box-shadow: var(--shadow);
}
.slip-head { display: flex; gap: 16px; align-items: center; border-bottom: 3px solid var(--gold); padding-bottom: 14px; margin-bottom: 18px; }
.slip-inst { font-family: var(--serif); font-size: 20px; font-weight: 700; color: var(--navy); }
.slip-sub { font-size: 12.5px; color: var(--muted); }
.slip-title { font-size: 13.5px; font-weight: 700; margin-top: 6px; text-transform: uppercase; letter-spacing: 0.6px; }
.slip h3 { font-family: var(--serif); color: var(--navy); font-size: 15px; margin: 20px 0 8px; }
.slip-id th { width: 1%; white-space: nowrap; }
.slip-total td { border-top: 2px solid var(--navy); }
.slip-note { font-size: 12px; color: var(--muted); font-style: italic; margin-top: 16px; }
.slip-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-top: 34px; font-size: 12px; color: var(--muted); }
.sig-line { border-top: 1px solid var(--text); width: 240px; margin-bottom: 5px; }
.slip-issued { text-align: right; }
.print-actions { max-width: 760px; margin: 16px auto 0; display: flex; gap: 8px; }

@media print {
  .no-print { display: none !important; }
  .print-page { background: #fff; padding: 0; }
  .slip { border: 0; box-shadow: none; max-width: none; padding: 0; }
  a[href]::after { content: ''; }
}

/* -------------------------------------- the admissions office's own views */
.adm-stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.cand-row.converted td { background: var(--success-bg); }
.cand-row.admitted td { background: #f6fbf8; }
.pin-slip {
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  padding: 12px 16px; margin: 10px 0; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  background: #fbfcfe;
}
.pin-slip strong { font-size: 17px; letter-spacing: 1px; }
.band-editor textarea { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; }

/* Candidate slips, printed and cut up. Two to a row on A4, and each one has to
   survive being folded into a pocket for a week. */
.slip-sheet { max-width: 800px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cand-slip {
  background: #fff; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  padding: 14px 16px; break-inside: avoid; page-break-inside: avoid;
}
.cand-slip-head { display: flex; gap: 8px; align-items: center; border-bottom: 2px solid var(--gold); padding-bottom: 7px; }
.cs-inst { font-family: var(--serif); font-size: 13px; font-weight: 700; color: var(--navy); line-height: 1.2; }
.cs-exam { font-size: 10.5px; color: var(--muted); }
.cs-name { font-size: 15px; font-weight: 700; margin: 10px 0 8px; }
.cs-cred { display: flex; gap: 14px; flex-wrap: wrap; }
.cs-cred > div { flex: 1 1 120px; }
.cs-cred span { display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.7px; color: var(--muted); }
.cs-cred strong { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 16px; letter-spacing: 1px; }
.cs-meta { font-size: 11px; color: var(--muted); margin-top: 8px; }
.cs-foot { font-size: 10px; color: var(--muted); margin-top: 10px; border-top: 1px solid var(--border); padding-top: 6px; }
@media (max-width: 620px) { .slip-sheet { grid-template-columns: 1fr; } }
