/* Montserrat is self-hosted (SIL Open Font Licence): the portal makes no request to any
   third party, which keeps the privacy policy and the store privacy labels simple. */
@font-face {
  font-family: "Montserrat"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/montserrat-var.woff2") format("woff2");
}

:root {
  /* ============ TWO COLOURS ============
     1) Denning Purple, anchored on the logo ink #362E7E (sampled from the master lockup)
     2) Champagne Gold #F2CA50
     Everything else is neutral. One functional red exists for errors and absence only,
     because those meanings must not depend on a tint the eye has to decode.
     Ground / panel / gold roughly follows the brand book's 70 / 22 / 8 split.          */

  --p-900: #140E33;   /* deepest ground */
  --p-800: #1B1444;   /* dark surface: sidebar, app icon plate */
  --p-700: #241B5C;
  --p-600: #362E7E;   /* THE logo ink — brand purple */
  --p-500: #453BA0;   /* interactive accent */
  --p-400: #5B4FC0;
  --p-300: #9089D9;
  --p-200: #C9C4EC;
  --p-100: #E8E6F6;   /* accent tint */
  --p-50:  #F4F3FB;

  --g-700: #3730A3;   /* retired gold → indigo */
  --g-600: #4338CA;
  --g-500: #4F46E5;
  --g-400: #6366F1;   /* was brand gold */
  --g-200: #C7CBF7;
  --g-100: #E8E9FC;
  --g-50:  #F3F4FD;

  /* neutrals, faintly cooled toward the ink */
  --n-0:   #FFFFFF;
  --n-25:  #FBFAFD;
  --n-50:  #F6F5FA;
  --n-100: #F0EFF6;
  --n-150: #E7E5F0;
  --n-200: #DEDCEB;
  --n-300: #C6C3DA;
  --n-400: #6E6A8A;
  --n-500: #565273;
  --n-700: #363252;
  --n-900: #191634;

  /* the one functional colour */
  --alert: #B3261E;  --alert-tint: #FBEAE8;

  /* ---- roles ---- */
  --bg: var(--n-50);
  --card: var(--n-0);
  --surface-2: var(--n-25);
  --fill: var(--n-100);
  --fill-2: var(--n-150);
  --line: var(--n-200);
  --line-strong: var(--n-300);
  --text: var(--n-900);
  --text-2: var(--n-500);
  --muted: var(--n-500);
  --text-3: var(--n-400);
  --brand: var(--p-600);
  --accent: #4F46E5;
  --accent-hover: #4338CA;
  --accent-tint: #ECECFC;
  --accent-ring: rgba(79, 70, 229, .24);
  --on-accent: #fff;

  /* ---- status, expressed in the two colours (+ the functional red) ---- */
  --success: #0E9F6E;  --success-tint: #E4F6EF;   /* complete, present, resolved */
  --warning: #B4540A;  --warning-tint: #FBEBDA;   /* due soon, pending, late — amber, not yellow */
  --danger:  var(--alert);  --danger-tint:  var(--alert-tint);
  --info:    #4F46E5;  --info-tint:    #ECECFC;
  --teal:    var(--n-500);  --teal-tint:    var(--n-150);
  --pink:    #4338CA;  --pink-tint:    #E8E9FC;

  /* ---- elevation (neutral) ---- */
  --shadow-xs: 0 1px 2px rgba(25, 22, 52, .05);
  --shadow-sm: 0 1px 3px rgba(25, 22, 52, .06), 0 1px 2px rgba(25, 22, 52, .03);
  --shadow-md: 0 6px 16px rgba(25, 22, 52, .08), 0 2px 5px rgba(25, 22, 52, .04);
  --shadow-lg: 0 24px 56px rgba(20, 14, 51, .20), 0 6px 16px rgba(20, 14, 51, .08);

  /* ---- shape ---- */
  --r-xs: 6px; --r-sm: 9px; --r-md: 12px; --r-lg: 14px; --r-xl: 20px; --r-pill: 999px;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --t: .18s var(--ease);
  /* motion: strong ease-out for things arriving, ease-in-out for things moving on screen,
     the iOS drawer curve for sheets. Durations stay under 300ms for UI; entrances a little longer. */
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  --d-press: 140ms; --d-ui: 220ms; --d-enter: 440ms;

  /* depth: dark mode adds a hairline of light along the top edge of raised surfaces */
  --card-hi: 0 0 #0000;
  --toast-bg: #1B1834; --toast-line: rgba(255, 255, 255, .08);

  --sidebar-w: 252px;
  --topbar-h: 62px;
  --bar: rgba(247, 245, 252, .82);   /* frosted top/bottom bars */
  --font: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* ---- legacy aliases ---- */
  --brand-900: var(--p-900); --brand-800: var(--p-800); --brand-700: var(--p-700);
  --brand-600: var(--p-600); --brand-500: var(--p-500); --brand-400: var(--p-400);
  --brand-200: var(--p-200); --brand-100: var(--p-100); --brand-50: var(--p-50);
  --gold-700: var(--g-700); --gold-600: var(--g-600); --gold-500: var(--g-500);
  --gold-400: var(--g-400); --gold-100: var(--g-100); --gold-50: var(--g-50);
  --indigo: var(--p-800); --indigo-2: var(--p-700); --indigo-3: var(--p-500);
  --violet: var(--p-500); --violet-2: var(--p-400);
  --gold: var(--g-400); --gold-dark: var(--g-600);
  --radius: var(--r-lg); --radius-sm: var(--r-sm);
  --shadow: var(--shadow-sm); --glow: var(--shadow-md);
  --grad: var(--accent);
  --grad-gold: var(--g-400);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.22; letter-spacing: -.012em; }
h2 { font-size: 18px; font-weight: 750; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0 0 .8em; }
a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- app frame ---------- */
.app { display: flex; min-height: 100dvh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; margin-left: var(--sidebar-w); }
.content { flex: 1; padding: 26px 30px 90px; max-width: 1180px; width: 100%; margin: 0 auto; }

/* ---------- sidebar ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 50;
  background: var(--brand-900);
  border-right: 1px solid rgba(255, 255, 255, .07);
  color: rgba(255, 255, 255, .72); display: flex; flex-direction: column; padding: 16px 12px;
}
.sidebar-brand { display: flex; gap: 11px; align-items: center; padding: 8px 10px 22px; }
.brand-mark { width: 34px; height: 33px; flex: none; object-fit: contain; }
.topbar-mark { height: 25px; width: auto; flex: none; }
.only-mobile-inline { display: none; }
.brand-name { font-weight: 800; letter-spacing: .15em; color: #fff; font-size: 13.5px; }
.brand-sub { font-size: 11px; color: rgba(255, 255, 255, .45); letter-spacing: .02em; font-weight: 600; }
.nav { flex: 1; display: flex; flex-direction: column; gap: 1px; overflow-y: auto; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--r-sm);
  color: rgba(255, 255, 255, .72); font-size: 13.5px; font-weight: 600; border: 0; background: none;
  cursor: pointer; width: 100%; text-align: left; transition: background var(--t), color var(--t);
}
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item.active { background: rgba(255, 255, 255, .11); color: #fff; font-weight: 700; }
.nav-item.active svg { opacity: 1; color: var(--gold-400); }
.nav-item.active::before {
  content: ''; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--gold-400);
}
.nav-item .nav-count {
  margin-left: auto; background: var(--danger); color: #fff; border-radius: var(--r-pill);
  font-size: 10.5px; font-weight: 800; padding: 1px 7px; min-width: 20px; text-align: center;
}
.nav-item.active .nav-count { background: var(--danger); color: #fff; }
.sidebar-foot { border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 8px; margin-top: 8px; }

/* ---------- topbar ---------- */
.topbar {
  height: var(--topbar-h); display: flex; align-items: center; gap: 14px;
  padding: 0 30px; background: var(--bar); backdrop-filter: saturate(180%) blur(20px);
  position: sticky; top: 0; z-index: 40; border-bottom: 1px solid var(--line);
}
.page-title { font-size: 17px; font-weight: 750; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.015em; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--card); display: grid; place-items: center; cursor: pointer; color: var(--text-2);
  position: relative; transition: background var(--t), color var(--t), border-color var(--t);
}
.icon-btn:hover { background: var(--fill); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.bell-badge {
  position: absolute; top: -3px; right: -3px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 800; border-radius: var(--r-pill); min-width: 17px; height: 17px;
  display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--bg);
}
.user-chip {
  display: flex; align-items: center; gap: 9px; padding: 4px 12px 4px 4px; border-radius: var(--r-pill);
  background: var(--card); border: 1px solid var(--line); cursor: pointer; transition: background var(--t);
}
.user-chip:hover { background: var(--fill); }
.user-chip .avatar { width: 28px; height: 28px; font-size: 11.5px; }
.user-chip .chip-name { font-size: 12.5px; font-weight: 700; max-width: 130px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .chip-role { font-size: 10.5px; color: var(--text-3); font-weight: 600; text-transform: capitalize; }

/* ---------- avatar ---------- */
.avatar {
  border-radius: 50%; background: var(--brand-500); color: #fff; font-weight: 700;
  display: inline-grid; place-items: center; width: 36px; height: 36px; font-size: 13px; flex: none;
  letter-spacing: .01em; position: relative; overflow: hidden;
}
/* the photo on a linked student's record, over their initials (App.avatarHtml) */
.avatar > .avatar-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- cards / layout ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--card-hi), var(--shadow-xs); padding: 20px;
}
a.card, .card.hoverable { transition: border-color var(--t), box-shadow var(--d-ui) var(--ease-out), transform var(--d-ui) var(--ease-out); }
a.card:hover, .card.hoverable:hover { border-color: var(--line-strong); box-shadow: var(--card-hi), var(--shadow-md); }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  a.card:hover, .card.hoverable:hover, a.stat:hover { transform: translateY(-2px); }
}
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }   /* in a grid the gap spaces cards; the margin pushed row 1 down */
.route-view { display: contents; }   /* one per visit (app.js route); adds no box of its own */
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-title h3 { margin: 0; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-header .sub { color: var(--text-2); font-size: 13px; }
.muted { color: var(--text-2); }
.small { font-size: 12.5px; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }

/* ---------- stats ---------- */
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 16px 18px; box-shadow: var(--shadow-xs);
}
.stat .stat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); }
.stat .stat-value { font-size: 30px; font-weight: 780; margin-top: 5px; letter-spacing: -.028em; line-height: 1.1; }
.stat .stat-sub { font-size: 12px; color: var(--text-2); margin-top: 3px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px;
  border-radius: var(--r-sm); font-weight: 700; font-size: 13px; border: 1px solid transparent;
  cursor: pointer; background: var(--accent); color: var(--on-accent); text-decoration: none; line-height: 1.25;
  /* a hairline of light on the top edge gives the filled button a pressed-metal depth, no gradient */
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 1px 2px rgba(20, 14, 51, .16);
  transition: background var(--t), border-color var(--t), color var(--t), box-shadow var(--t), transform var(--d-press) var(--ease-out);
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(.97); }
.btn-gold { background: var(--gold-400); color: var(--brand-900); }
.btn-gold:hover { background: var(--gold-500); }
.btn-ghost { background: var(--card); color: var(--text); border-color: var(--line); box-shadow: var(--card-hi), var(--shadow-xs); }
.btn-ghost:hover { background: var(--fill); border-color: var(--line-strong); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #A81C42; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: var(--r-xs); }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------- badges / chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: var(--r-xs);
  font-size: 11px; font-weight: 700; background: var(--fill-2); color: var(--text-2); white-space: nowrap;
  letter-spacing: -.005em;
}
.badge-gold { background: var(--warning-tint); color: var(--gold-700); }
.badge-green { background: var(--success-tint); color: var(--success); }
.badge-red { background: var(--danger-tint); color: var(--danger); }
.badge-blue { background: var(--info-tint); color: var(--info); }
.badge-dark { background: var(--brand-800); color: #fff; }
.badge-cat { text-transform: capitalize; }
.chip-row { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  padding: 7px 14px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--card);
  font-size: 12.5px; font-weight: 650; cursor: pointer; color: var(--text-2);
  transition: background var(--t), color var(--t), border-color var(--t);
}
.chip:hover { background: var(--fill); color: var(--text); }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }

/* ---------- tabs ---------- */
/* the rule under the tabs is an inset shadow, so the chosen tab's underline can sit on it without overflowing */
.tabs { display: flex; gap: 2px; box-shadow: inset 0 -1px 0 var(--line); margin-bottom: 18px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; padding: 9px 15px 11px; font-weight: 650; font-size: 13.5px; color: var(--text-2); cursor: pointer;
  border: 0; background: none; white-space: nowrap;
  transition: color var(--t);
}
/* the underline grows out from the middle of the chosen tab while the old one shrinks away */
.tab::after {
  content: ''; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; border-radius: 2px 2px 0 0;
  background: var(--accent); transform: scaleX(0); opacity: 0;
  transition: transform var(--d-ui) var(--ease-out), opacity .12s linear;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); font-weight: 750; }
.tab.active::after { transform: none; opacity: 1; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow-xs); }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3); padding: 11px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2);
  white-space: nowrap; font-weight: 700;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--fill); }

/* ---------- forms ---------- */
.form-field { margin-bottom: 14px; }
.form-field label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.form-field input, .form-field select, .form-field textarea, .input {
  width: 100%; padding: 10px 13px; border-radius: var(--r-sm); border: 1px solid var(--line-strong);
  font-family: inherit; font-size: 13.5px; background: var(--card); color: var(--text); outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.form-field input::placeholder, .form-field textarea::placeholder { color: var(--text-3); }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus, .input:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring);
}
.form-field textarea { min-height: 96px; resize: vertical; }
.form-hint { font-size: 11.5px; color: var(--text-3); margin-top: 5px; }
.form-error { color: var(--danger); font-size: 12.5px; font-weight: 650; margin-top: 6px; }
.form-row { display: flex; gap: 12px; }
.form-row .form-field { flex: 1; }

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(20, 14, 42, .42); backdrop-filter: blur(3px);
  z-index: 100; display: grid; place-items: center; padding: 18px; animation: fadeIn .2s var(--ease-out);
}
.modal {
  background: var(--card); border-radius: var(--r-xl); box-shadow: var(--card-hi), var(--shadow-lg);
  width: 100%; max-width: 560px; max-height: 88dvh; display: flex; flex-direction: column;
  animation: popIn .28s var(--ease-out);
}
.modal-body { overscroll-behavior: contain; }
/* closing: the dialog settles back and fades a little faster than it arrived */
.modal-overlay.is-closing { animation: fadeOut .18s var(--ease-out) forwards; pointer-events: none; }
.modal-overlay.is-closing .modal { animation: popOut .18s var(--ease-out) forwards; }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes popOut { to { transform: translateY(6px) scale(.97); opacity: 0; } }
/* On a phone the dialog is a bottom sheet: it rises from the edge the thumb is on, carries a
   grab handle, and can be dragged down to dismiss (App.modal). */
.sheet-grip { display: none; }
@media (max-width: 640px) {
  .modal-overlay { place-items: end center; padding: 0; padding-top: calc(28px + env(safe-area-inset-top)); }
  .modal {
    max-width: none; max-height: 92dvh; border-radius: 22px 22px 0 0;
    padding-bottom: env(safe-area-inset-bottom); animation: sheetIn .42s var(--ease-drawer);
  }
  .sheet-grip {
    display: block; flex: none; width: 100%; height: 22px; border: 0; padding: 0; background: none; cursor: grab;
    touch-action: none; position: relative;
  }
  .sheet-grip::before {
    content: ''; position: absolute; left: 50%; top: 9px; width: 38px; height: 5px; margin-left: -19px;
    border-radius: 99px; background: var(--line-strong);
  }
  .modal-head { padding-top: 4px; touch-action: none; }
  .modal.is-dragging { animation: none; transition: none; }
  .modal-overlay.is-closing .modal { animation: sheetOut .26s var(--ease-out) forwards; }
}
@keyframes sheetIn { from { transform: translateY(100%); } }
@keyframes sheetOut { to { transform: translateY(100%); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 0; }
.modal-head h3 { margin: 0; font-size: 16.5px; font-weight: 750; }
.modal-body { padding: 14px 22px 22px; overflow-y: auto; }
.modal-close { border: 0; background: none; cursor: pointer; color: var(--text-3); padding: 6px; border-radius: var(--r-xs); transition: background var(--t), color var(--t); }
.modal-close:hover { background: var(--fill); color: var(--text); }
.modal-close svg { width: 18px; height: 18px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { transform: translateY(10px) scale(.97); opacity: 0; } }

/* ---------- toast ---------- */
/* Toasts rise from the bottom and leave the way they came. Transitions (not keyframes) so a
   burst of them retargets smoothly instead of restarting. */
.toast-root { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; width: max-content; max-width: 92vw; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; pointer-events: auto;
  background: var(--toast-bg); color: #fff; padding: 10px 18px 10px 12px; border-radius: var(--r-pill); font-size: 13px;
  font-weight: 650; line-height: 1.35; box-shadow: inset 0 0 0 1px var(--toast-line), var(--shadow-lg); max-width: 92vw;
  opacity: 0; transform: translateY(16px) scale(.96);
  transition: opacity .24s var(--ease-out), transform .36s var(--ease-out);
}
.toast.show { opacity: 1; transform: none; }
.toast.hide { opacity: 0; transform: translateY(8px) scale(.97); transition-duration: .18s, .2s; }
.toast-ic { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.12); }
.toast-ic svg { width: 13px; height: 13px; stroke-width: 2.6; }
.toast.success .toast-ic { background: #10B981; color: #fff; }
.toast.error .toast-ic { background: #EF4444; color: #fff; }
.toast:not(.success):not(.error) { padding-left: 18px; }
.toast:not(.success):not(.error) .toast-ic { display: none; }

/* ---------- empty state ---------- */
/* Empty states carry the column-D as a quiet watermark. */
.empty { text-align: center; padding: 52px 20px; color: var(--text-2); position: relative; }
.empty::before {
  content: ''; display: block; width: 54px; height: 52px; margin: 0 auto 14px;
  background: url('../brand/mark.png') center/contain no-repeat; opacity: .16;
}
.empty svg { display: none; }
.empty .empty-title { font-weight: 750; color: var(--text); margin-bottom: 4px; font-size: 15px; }

/* ---------- list rows ---------- */
.list { display: flex; flex-direction: column; }
.list-row { display: flex; gap: 14px; align-items: center; padding: 13px 4px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row .list-main { flex: 1; min-width: 0; }
.list-row .list-title { font-weight: 700; font-size: 13.5px; }
.list-row .list-sub { font-size: 12px; color: var(--text-2); }

/* ---------- sign in ---------- */
/* One centred card on a quiet background: no brand panel, no marketing line (Adam's UI rule, 6 Oct 2026). */
.login-wrap {
  min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px; padding: 40px 20px; background: var(--bg, #F5F4F9);
}
.login-card {
  width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-xl); box-shadow: var(--shadow-md); padding: 34px 32px 28px;
  animation: cardIn .35s var(--ease) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .login-card { animation: none; } }
.lc-lockup { display: block; width: 190px; max-width: 70%; height: auto; margin: 0 0 22px; }
.lc-brands { display: flex; align-items: center; gap: 14px; margin: 0 0 22px; }
.lc-brands .lc-lockup { flex: 1 1 0; min-width: 0; width: 100%; max-width: 150px; margin: 0; }
.lc-brands-rule { flex: none; width: 1px; align-self: stretch; background: var(--line); }
.login-portal-line {
  font-size: 10.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3);
}
.login-hello { font-size: 26px; font-weight: 760; letter-spacing: -.024em; margin: 6px 0 4px; }
.login-tag { color: var(--text-2); font-size: 13.5px; line-height: 1.5; margin: 0 0 22px; }
.login-hello + form, .login-hello + .form-note { margin-top: 18px; }   /* in the app there is no line under the heading */
.login-email { display: block; color: var(--text); font-weight: 650; margin-top: 4px; word-break: break-all; }
.login-submit { width: 100%; padding: 12px; font-size: 14px; margin-top: 4px; }
.login-link {
  display: block; margin: 16px auto 0; padding: 4px 2px; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--accent);
}
.login-link:hover:not(:disabled) { text-decoration: underline; text-underline-offset: 3px; }
/* Choosing a new password before the portal opens (js/pages/password-change.js): the sign-in card, over everything */
.pwc-root { position: fixed; inset: 0; z-index: 400; overflow-y: auto; background: var(--bg); -webkit-overflow-scrolling: touch; }
body.pwc-open { overflow: hidden; }
.pwc-show { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); margin: 2px 0 14px; cursor: pointer; }
.pwc-show input { width: 15px; height: 15px; accent-color: var(--accent); }
.pwc-out { text-align: center; margin: 6px 0 0; }
.pwc-out .login-link { margin-top: 8px; }
.login-link:disabled { color: var(--text-3); cursor: default; }
.login-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.login-row .login-link { margin: 14px 0 0; }
.form-note {
  font-size: 12.5px; color: var(--text-2); background: var(--fill); border-radius: var(--r-sm);
  padding: 10px 12px; margin: -8px 0 16px;
}
.code-input { font-size: 20px !important; letter-spacing: .32em; font-variant-numeric: tabular-nums; text-align: center; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border: 0; background: none; cursor: pointer;
  color: var(--text-3); display: grid; place-items: center; border-radius: var(--r-xs);
}
.pw-toggle:hover { color: var(--text); background: var(--fill); }
.pw-toggle.is-on { color: var(--accent); }
.pw-toggle svg { width: 17px; height: 17px; }

.demo-accounts { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 18px; }
.demo-head {
  font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 10px;
}
.demo-accounts .demo-btn {
  display: flex; width: 100%; align-items: center; gap: 12px; text-align: left;
  background: var(--card); border: 1px solid var(--line); padding: 10px 12px;
  border-radius: var(--r-md); margin-top: 7px; cursor: pointer; color: var(--text);
  transition: border-color var(--t), background var(--t), transform .12s var(--ease);
}
.demo-accounts .demo-btn:hover { border-color: var(--accent); background: var(--p-50); transform: translateX(2px); }
.demo-accounts .demo-btn svg { width: 15px; height: 15px; margin-left: auto; color: var(--text-3); flex: none; }
.demo-role {
  flex: none; font-size: 9.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); background: var(--p-100); padding: 4px 8px; border-radius: var(--r-xs); min-width: 58px; text-align: center;
}
.demo-who { display: flex; flex-direction: column; min-width: 0; }
.demo-who b { font-size: 13px; font-weight: 700; }
.demo-who span { font-size: 11.5px; color: var(--text-2); }
.login-foot { font-size: 11px; color: var(--text-3); margin: 0; text-align: center; }

@media (max-width: 480px) {
  .login-wrap { justify-content: flex-start; padding: calc(28px + env(safe-area-inset-top)) 14px calc(24px + env(safe-area-inset-bottom)); }
  .login-card { padding: 26px 20px 22px; border-radius: var(--r-lg); }
  .login-hello { font-size: 23px; }
}

/* The sign-in scene: the three campuses from the Career Fair 2026 artwork stand along the
   bottom under its own sky, and the card is an arch like the gateways of the middle campus.
   The drawing is 2031x630 and its middle campus is centred at x 970, so it is shifted to sit
   under the card; it reaches 1.54 heights left of that point and 1.684 heights right.
   --campus-h fills the width where it can; on wide, short screens it stops at 46vh and the
   ends of the drawing fade into the sky. The card may overlap only the empty sky at the top
   of the drawing (the dome starts 37% down), so on short screens the page scrolls instead. */
.login-wrap.login-campus {
  --campus-h: clamp(170px, min(32.5vw, 46vh), 640px);
  position: relative; isolation: isolate; overflow: hidden; justify-content: center;
  padding: max(36px, 5vh) 20px calc(var(--campus-h) * .74);
  background: #DCEBF8 url('../brand/login-sky.jpg') center top / cover no-repeat;
}
.login-wrap.login-campus::before {
  content: ''; position: absolute; inset: auto 0 0; height: var(--campus-h); z-index: -1;
  background: url('../brand/login-campuses.webp') calc(50% + var(--campus-h) * .072) bottom / auto 100% no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent calc(50% - var(--campus-h) * 1.54), #000 calc(50% - var(--campus-h) * 1.3), #000 calc(50% + var(--campus-h) * 1.54), transparent calc(50% + var(--campus-h) * 1.684));
          mask-image: linear-gradient(90deg, transparent calc(50% - var(--campus-h) * 1.54), #000 calc(50% - var(--campus-h) * 1.3), #000 calc(50% + var(--campus-h) * 1.54), transparent calc(50% + var(--campus-h) * 1.684));
}
:root[data-theme="dark"] .login-wrap.login-campus { background-color: #0F172B; background-image: url('../brand/login-sky-dark.jpg'); }
:root[data-theme="dark"] .login-wrap.login-campus::before { background-image: url('../brand/login-campuses-dark.webp'); }
.login-campus .login-card {
  max-width: 404px; padding-top: 62px; border-color: rgba(26, 72, 152, .14);
  border-radius: 50% 50% var(--r-xl) var(--r-xl) / 92px 92px var(--r-xl) var(--r-xl);
  box-shadow: 0 1px 2px rgba(17, 37, 84, .06), 0 26px 60px -22px rgba(17, 37, 84, .34);
}
:root[data-theme="dark"] .login-campus .login-card { border-color: rgba(157, 181, 238, .16); box-shadow: 0 30px 70px -24px rgba(0, 0, 0, .7); }
.login-campus .lc-brands { justify-content: center; margin-bottom: 16px; }
.login-campus .login-portal-line { text-align: center; padding-bottom: 18px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
@media (max-aspect-ratio: 3/4) {
  .login-wrap.login-campus { --campus-h: clamp(190px, 31vh, 330px); }
}
@media (max-width: 480px) {
  .login-wrap.login-campus { padding: calc(24px + env(safe-area-inset-top)) 14px calc(var(--campus-h) * .74); }
  .login-campus .login-card { padding: 54px 20px 22px; border-radius: 50% 50% var(--r-lg) var(--r-lg) / 74px 74px var(--r-lg) var(--r-lg); }
}

/* ---------- mobile tab bar ---------- */
.tabbar { display: none; }

/* ---------- responsive ---------- */
.only-mobile { display: none !important; }
.scrim { position: fixed; inset: 0; background: rgba(20, 14, 42, .45); z-index: 45; }

@media (max-width: 1120px) { .grid-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 1024px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 980px) {
  .content { padding: 20px 18px 96px; }
}

@media (max-width: 760px) {
  .only-mobile { display: grid !important; }
  .main { margin-left: 0; }
  .sidebar { transform: translateX(-105%); transition: transform .28s var(--ease); width: 274px; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .topbar { padding: 0 14px; }
  .user-chip .chip-text { display: none; }
  .only-mobile-inline { display: block; }
  .user-chip { padding: 4px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .form-row { flex-direction: column; gap: 0; }
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 44;
    background: var(--bar); backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    font-size: 10px; font-weight: 650; color: var(--text-3); padding: 5px 0; border-radius: var(--r-sm);
    transition: color var(--t);
  }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.active { color: var(--accent); font-weight: 750; }
}

/* ---------- full-bleed layout (VLE takeover) ---------- */
.app.is-full .sidebar, .app.is-full .topbar, .app.is-full .tabbar, .app.is-full .scrim { display: none !important; }
.app.is-full .main { margin-left: 0; }
.app.is-full .content { padding: 0; max-width: none; }
body.full-layout { background: #0E0722; }

/* ---------- scrollbars ---------- */
/* Slim scrollbars for mouse and trackpad only. Styling ::-webkit-scrollbar switches Chromium to
   classic scrollbars, which on a phone steals width and draws desktop thumbs; touch devices
   keep their own overlay indicators. */
@media (hover: hover) and (pointer: fine) {
  ::-webkit-scrollbar { width: 11px; height: 11px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--n-300); border-radius: var(--r-pill); border: 3px solid var(--bg); }
  ::-webkit-scrollbar-thumb:hover { background: var(--n-400); }
}

/* ---------- brand marks in context ---------- */
.mark-lockup { width: 100%; max-width: 260px; height: auto; display: block; }
.brand-loading { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 0; color: var(--text-3); font-size: 12.5px; font-weight: 600; }
.brand-loading::before {
  content: ''; width: 42px; height: 40px; background: url('../brand/mark.png') center/contain no-repeat;
  animation: markPulse 1.5s var(--ease) infinite;
}
@keyframes markPulse { 0%, 100% { opacity: .22; transform: scale(.97); } 50% { opacity: .75; transform: scale(1); } }

/* ---------- safe areas (notch, status bar, home indicator) ----------
   The page opts into the full screen with viewport-fit=cover, so anything pinned to an
   edge has to keep clear of the system UI itself. In a desktop browser every inset is 0
   and nothing moves; in the iPhone and iPad app and the installed web app they are real. */
.topbar { padding-top: env(safe-area-inset-top); height: calc(var(--topbar-h) + env(safe-area-inset-top)); }
.sidebar { padding-top: calc(16px + env(safe-area-inset-top)); padding-left: calc(12px + env(safe-area-inset-left)); }
/* In the apps the status bar runs the full width, over the sidebar and the top bar alike. The
   sidebar starts below it, so the strip under the clock is light end to end and the dark
   status-bar text the portal asks for stays legible on iPad (and over the phone drawer). */
.in-app .sidebar { top: env(safe-area-inset-top); padding-top: 16px; }
.toast-root { bottom: calc(24px + env(safe-area-inset-bottom)); }
/* On a phone toasts drop in from the top, clear of the tab bar and of any sheet that is open. */
@media (max-width: 760px) {
  .toast-root { bottom: auto; top: calc(10px + env(safe-area-inset-top)); flex-direction: column-reverse; }
  .toast { transform: translateY(-18px) scale(.96); }
  .toast.show { transform: none; }
  .toast.hide { transform: translateY(-10px) scale(.97); }
}


/* ======================= Dark theme ======================= */
/* Components read only role tokens, so redefining the roles here flips the whole
   portal. An inline <head> script sets data-theme before first paint (no flash).
   The VLE is a cinematic surface and stays dark in both themes. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0C0E18;
  --card: #141726;
  --surface-2: #1A1E30;
  --fill: #1F2437;
  --fill-2: #272D45;
  --line: rgba(255,255,255,.085);
  --line-strong: rgba(255,255,255,.17);
  --text: #EEF0F8;
  --text-2: #B6BBD2;
  --muted: #9BA0BA;
  --text-3: #787E99;
  --brand: #8E93FF;
  --accent: #6366F1;
  --accent-hover: #7D83FF;
  --accent-tint: #20233F;
  --accent-ring: rgba(99,102,241,.42);
  --on-accent: #fff;
  --success: #34D399;  --success-tint: #11271D;
  --warning: #E7903E;  --warning-tint: #2E2112;
  --danger:  #F87171;  --danger-tint:  #331C1C;
  --info:    #818CF8;  --info-tint:    #20233F;
  --pink:    #818CF8;  --pink-tint:    #20233F;
  --teal:    #B6BBD2;  --teal-tint:    #242A40;
  /* retired gold ramp, dark variants (all indigo; inverted so "text" stops read light) */
  --g-700: #C7CBF7; --g-600: #A9AFF4; --g-500: #8E93FF; --g-400: #7D83FF;
  --g-200: #3A3F66; --g-100: #20233F; --g-50: #191C30;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.45);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.5), 0 1px 2px rgba(0,0,0,.32);
  --shadow-md: 0 8px 24px rgba(0,0,0,.55), 0 2px 6px rgba(0,0,0,.35);
  --shadow-lg: 0 28px 64px rgba(0,0,0,.66), 0 8px 20px rgba(0,0,0,.46);
  --bar: rgba(16, 18, 30, .82);
  --card-hi: inset 0 1px 0 rgba(255, 255, 255, .045);
  --toast-bg: #262B44; --toast-line: rgba(255, 255, 255, .10);
  /* the light end of the brand ramp is used as tints; in the dark it must be a dark tint */
  --p-50: #171A2C; --p-100: #20233F; --p-200: #3A3F66;
  --brand-50: var(--p-50); --brand-100: var(--p-100); --brand-200: var(--p-200);
}
:root[data-theme="dark"] .topbar-mark { filter: brightness(0) invert(1); }
/* The logo has two treatments only: the original indigo on light, the white knockout on dark. */
.lc-on-dark { display: none; }
:root[data-theme="dark"] .lc-on-light { display: none; }
:root[data-theme="dark"] .lc-on-dark { display: block; }
:root[data-theme="dark"] .pf-about-mark { filter: brightness(0) invert(1); }
:root[data-theme="dark"] .empty::before, :root[data-theme="dark"] .brand-loading::before,
body.full-layout .brand-loading::before { background-image: url('../brand/mark-white.png'); }

/* A short cross-fade when the student flips the theme (not on first load). */
:root.theme-anim, :root.theme-anim * { transition: background-color .28s var(--ease), border-color .28s var(--ease), color .22s var(--ease) !important; }
@media (prefers-reduced-motion: reduce) { :root.theme-anim, :root.theme-anim * { transition: none !important; } }

/* Theme toggle in the topbar */
.theme-toggle { position: relative; }
.theme-toggle .sun, .theme-toggle .moon { position: absolute; inset: 0; display: grid; place-items: center; transition: opacity .2s var(--ease), transform .3s var(--ease); }
.theme-toggle .sun { opacity: 0; transform: rotate(-90deg) scale(.6); }
.theme-toggle .moon { opacity: 1; transform: none; }
:root[data-theme="dark"] .theme-toggle .sun { opacity: 1; transform: none; }
:root[data-theme="dark"] .theme-toggle .moon { opacity: 0; transform: rotate(90deg) scale(.6); }

/* ======================= Brand surfaces & per-programme brand ======================= */
/* Hero accent tokens (brand-adaptive) — used by the dashboard hero on the deep brand panel. */
:root { --hero-ink: #CBD0F7; --hero-glow: rgba(129, 140, 248, .34); }

/* College / Foundation (IFP) students get a maroon world after login. data-brand is set
   from the student's programme; undergrad keeps the indigo base. Orthogonal to light/dark:
   this block only swaps the brand ramp + accent, the neutral surfaces still come from the
   theme. Overriding the --p-* ramp re-tints every brand surface (sidebar, hero, app icon). */
:root[data-brand="college"] {
  --p-900:#2B0000; --p-800:#450000; --p-700:#600000; --p-600:#7F0000; --p-500:#9B1C1C;
  --p-400:#B84A4A; --p-300:#D68F8F; --p-200:#ECC6C6; --p-100:#F7E6E6; --p-50:#FCF4F4;
  --accent:#7F0000; --accent-hover:#600000; --accent-tint:#F7E6E6; --accent-ring:rgba(127,0,0,.24);
  --brand:#7F0000; --info:#9B1C1C; --info-tint:#F7E6E6; --pink:#B23A48; --pink-tint:#F7E6E6;
  --g-700:#600000; --g-600:#7F0000; --g-500:#9B1C1C; --g-400:#B84A4A; --g-200:#ECC6C6; --g-100:#F7E6E6; --g-50:#FCF4F4;
  --hero-ink:#F2CA50; --hero-glow:rgba(190,40,40,.32);
}
:root[data-brand="college"][data-theme="dark"] {
  --accent:#E06B6B; --accent-hover:#EC8E8E; --accent-tint:#2B1414; --accent-ring:rgba(224,107,107,.42);
  --brand:#F0A8A8; --info:#E06B6B; --info-tint:#2B1414; --pink:#E48A96; --pink-tint:#2B1414;
  --g-700:#ECC6C6; --g-600:#DDA0A0; --g-500:#E06B6B; --g-400:#D45A5A; --g-200:#5A1F1F; --g-100:#2B1414; --g-50:#221010;
  --hero-glow:rgba(224,107,107,.30);
  --p-50:#1E1111; --p-100:#2B1414; --p-200:#5A1F1F;
}
/* ...and its own column-D in the quiet watermarks */
:root[data-brand="college"] .empty::before, :root[data-brand="college"] .brand-loading::before { background-image: url('../brand/college-mark.png'); }

/* Neutral login — the programme (and its colour world) is only known after sign-in. */
#login-root { --accent:#3C4257; --accent-hover:#2B3042; --accent-tint:#EDEEF3; --accent-ring:rgba(60,66,87,.22); }
:root[data-theme="dark"] #login-root { --accent:#5A6177; --accent-hover:#6D7590; --accent-tint:#20233A; --accent-ring:rgba(90,97,119,.4); }

/* ===================== Motion ===================== */
/* Every animation here answers "why does this move?": a page arriving, where the chosen tab
   went, what a press did, a number being counted. Durations stay short, entrances ease out,
   things moving on screen ease in and out, and prefers-reduced-motion keeps only fades. */

/* --- pressable things give a small, quick press --- */
.btn, .st-btn, .icon-btn, .chip, .user-chip, .qa a, .login-submit, .card.tap, .tabbar a, .nav-item, .demo-btn {
  -webkit-tap-highlight-color: transparent;
}
@media (prefers-reduced-motion: no-preference) {
  .st-btn, .icon-btn, .chip, .user-chip, .qa a, .card.tap {
    transition: transform var(--d-press) var(--ease-out), background var(--t), border-color var(--t), color var(--t), box-shadow var(--t);
  }
  .btn:active, .st-btn:active, .icon-btn:active, .chip:active, .qa a:active, .login-submit:active, .user-chip:active, .card.tap:active { transform: scale(.97); }
  a.stat:active, a.card:active { transform: scale(.985); transition-duration: 90ms; }
}

/* --- a page arriving: its blocks rise into place one after another (App.motion.enter) --- */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes riseFade { from { opacity: 0; } }
.m-in { animation: rise var(--d-enter) var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms); }
.m-fade { animation: riseFade .3s var(--ease-out) both; }

/* --- loading: a quiet skeleton in the shape of a page, shown only if the wait is noticeable --- */
.skel-page { display: grid; gap: 14px; animation: riseFade .2s linear .16s both; }
.skel-page .skel-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.skel {
  border-radius: var(--r-lg); background: var(--fill); position: relative; overflow: hidden;
}
.skel::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--card) 55%, transparent), transparent);
  animation: shimmer 1.3s var(--ease-in-out) infinite;
}
.skel-title { height: 22px; width: 38%; border-radius: var(--r-xs); }
.skel-hero { height: 150px; }
.skel-card { height: 112px; }
.skel-long { height: 260px; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* --- the sidebar: one highlight glides to the chosen page --- */
.nav { position: relative; }
.nav-ind {
  position: absolute; left: 0; right: 0; top: 0; height: 0; border-radius: var(--r-sm); pointer-events: none;
  background: rgba(255, 255, 255, .11); opacity: 0;
  transition: transform .32s var(--ease-in-out), height .32s var(--ease-in-out), opacity .2s linear;
}
.nav-ind::before {
  content: ''; position: absolute; left: 4px; top: 50%; width: 3px; height: 16px; margin-top: -8px;
  border-radius: 3px; background: var(--gold-400);
}
.nav-ind.is-on { opacity: 1; }
.nav-ind.no-anim { transition: none; }
.nav.has-ind .nav-item.active { background: transparent; }
.nav.has-ind .nav-item.active::before { display: none; }
.nav-item { z-index: 1; }
.nav-item svg { transition: color var(--t), opacity var(--t), transform var(--d-ui) var(--ease-out); }
@media (prefers-reduced-motion: no-preference) {
  .nav-item:active svg { transform: scale(.9); }
}

/* --- the phone tab bar: a pill slides under the chosen tab and its icon lifts --- */
@media (max-width: 760px) {
  .tabbar { position: fixed; }
  .tab-ind {
    position: absolute; top: 8px; left: 0; width: 56px; height: 30px; border-radius: 99px; pointer-events: none;
    background: var(--accent-tint); opacity: 0;
    transition: transform .34s var(--ease-in-out), opacity .2s linear;
  }
  .tab-ind.is-on { opacity: 1; }
  .tab-ind.no-anim { transition: none; }
  .tabbar a { position: relative; z-index: 1; }
  .tabbar a svg { transition: transform var(--d-ui) var(--ease-out); }
  .tabbar a.active svg { transform: translateY(-1px); }
}
@media (max-width: 760px) and (prefers-reduced-motion: no-preference) {
  .tabbar a:active svg { transform: scale(.88); }
}

/* --- drawer scrim fades with the drawer instead of blinking --- */
.scrim { animation: fadeIn .28s var(--ease-out); }
.scrim.is-leaving { animation: fadeOut .22s var(--ease-out) forwards; }

/* --- the top bar separates from the page only once the page scrolls under it --- */
.topbar { border-bottom-color: transparent; transition: border-color .2s linear, box-shadow .2s linear; }
.topbar.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 18px -12px rgba(20, 14, 51, .28); }

/* --- the bell badge pops when something new arrives --- */
@keyframes badgePop { 0% { transform: scale(.6); } 60% { transform: scale(1.15); } 100% { transform: none; } }
.bell-badge.pop { animation: badgePop .42s var(--ease-out); }

/* --- forms: fields answer the pointer and the focus ring eases in --- */
.form-field input:hover:not(:focus):not(:disabled), .form-field select:hover:not(:focus), .form-field textarea:hover:not(:focus), .input:hover:not(:focus) {
  border-color: color-mix(in srgb, var(--line-strong), var(--text) 22%);
}
.table tr.clickable td { transition: background .15s linear; }
.list-row { transition: background .15s linear; }
::selection { background: color-mix(in srgb, var(--accent) 26%, transparent); }

/* --- empty states settle in rather than appear --- */
.empty::before { transition: opacity .3s linear; }

/* --- numbers that count up keep their width while they do --- */
.stat-value, .ring span, [data-count] { font-variant-numeric: tabular-nums; }

/* --- switching theme: the new theme spreads out from the switch (App.theme, View Transitions) --- */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 2; }

/* --- sign in: the card and its parts arrive in sequence (once per visit, so delight is allowed) --- */
.login-wrap {
  background:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--text) 9%, transparent) 1px, transparent 0) 0 0 / 22px 22px,
    var(--bg, #F5F4F9);
}
.login-wrap::before {
  content: ''; position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(60% 55% at 50% 45%, transparent 0, var(--bg) 78%);
}
.login-card, .login-foot { position: relative; }
@media (prefers-reduced-motion: no-preference) {
  .login-card > * { animation: rise .5s var(--ease-out) both; }
  .login-card > :nth-child(2) { animation-delay: 50ms; }
  .login-card > :nth-child(3) { animation-delay: 100ms; }
  .login-card > :nth-child(4) { animation-delay: 150ms; }
  .login-card > :nth-child(5) { animation-delay: 200ms; }
  .login-card > :nth-child(n+6) { animation-delay: 250ms; }
}

/* --- reduced motion: keep the fades that explain a change, drop all movement --- */
@media (prefers-reduced-motion: reduce) {
  .m-in { animation: riseFade .2s linear both; animation-delay: 0s; }
  .modal, .modal-overlay.is-closing .modal { animation: riseFade .15s linear both !important; }
  .toast, .toast.hide { transform: none !important; }
  .nav-ind, .tab-ind, .tab::after { transition: opacity .15s linear !important; }
  .skel::after { animation: none; }
  .bell-badge.pop { animation: none; }
}

/* ============ notice banner (back office: Manage > App screens) ============ */
.notice-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; font-size: 13.5px; line-height: 1.45;
  border-bottom: 1px solid var(--line); background: var(--accent-tint); color: var(--text); }
.notice-bar.is-warning { background: var(--warning-tint); }
.notice-bar .notice-ic { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--card); color: var(--accent); }
.notice-bar.is-warning .notice-ic { color: var(--warning); }
.notice-bar .notice-text { flex: 1; min-width: 0; }
.notice-bar .notice-text a { color: var(--accent); font-weight: 600; }
.notice-bar .notice-x { flex: none; width: 32px; height: 32px; border: 0; border-radius: var(--r-sm); background: transparent;
  color: var(--text-2); display: grid; place-items: center; cursor: pointer; }
.notice-bar .notice-x:hover { background: var(--fill); }
.screen-message { max-width: 560px; margin: 40px auto; }

/* ===================== Portal 2.0 navigation (23 Oct 2026) ===================== */
/* Desktop: the side menu floats as a rounded brand panel inside the window. */
@media (min-width: 761px) {
  .sidebar { top: 12px; bottom: 12px; left: 12px; border-radius: 22px; border: 1px solid rgba(255, 255, 255, .06);
    box-shadow: 0 18px 40px -18px rgba(20, 14, 51, .45); }
  .in-app .sidebar { top: calc(12px + env(safe-area-inset-top)); }
  .main { margin-left: calc(var(--sidebar-w) + 24px); }
}

/* Phone: a floating dock. Up to four tabs with search raised in the middle; it folds to icons while the page is read
   (app.js toggles .mini on scroll) and the pill under the chosen tab follows it (syncIndicators). */
@media (max-width: 760px) {
  .tabbar {
    left: 50%; right: auto; bottom: calc(10px + env(safe-area-inset-bottom)); transform: translateX(-50%);
    padding: 6px; gap: 2px; border: 1px solid var(--line); border-radius: 26px; max-width: calc(100vw - 20px);
    background: var(--bar); box-shadow: 0 14px 34px -14px rgba(20, 14, 51, .42), 0 2px 6px rgba(20, 14, 51, .08);
  }
  .tabbar a { flex: none; width: min(62px, calc((100vw - 112px) / 4)); height: 50px; justify-content: center; gap: 2px; padding: 0;
    border-radius: 20px; font-size: 9.5px; letter-spacing: -.01em; transition: color var(--t), height .3s var(--ease-in-out); }
  .tabbar a svg { width: 21px; height: 21px; }
  .tabbar a span { max-width: 100%; max-height: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 0 2px;
    transition: opacity .18s linear, max-height .3s var(--ease-in-out); }
  .tab-ind { top: 0; left: 0; width: 62px; height: 50px; border-radius: 20px;
    transition: transform .34s var(--ease-in-out), width .3s var(--ease-in-out), height .3s var(--ease-in-out), opacity .2s linear; }
  .tab-search { position: relative; z-index: 1; flex: none; width: 50px; height: 50px; margin: 0 4px; border: 0; border-radius: 18px;
    display: grid; place-items: center; background: var(--accent); color: var(--on-accent); cursor: pointer;
    box-shadow: 0 8px 18px -6px color-mix(in srgb, var(--accent) 70%, transparent);
    transition: transform var(--d-press) var(--ease-out), width .3s var(--ease-in-out), height .3s var(--ease-in-out), border-radius .3s var(--ease-in-out); }
  .tab-search svg { width: 21px; height: 21px; }
  .tab-search:active { transform: scale(.92); }
  .tabbar.mini a { height: 40px; }
  .tabbar.mini a span { opacity: 0; max-height: 0; }
  .tabbar.mini .tab-search { width: 40px; height: 40px; border-radius: 14px; }
}
.tab-search { -webkit-tap-highlight-color: transparent; }

/* The top bar's search (desktop and tablet); on a phone it lives in the dock. */
.search-pill { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 11px; min-width: 210px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--card); color: var(--text-3); font: 600 12.5px var(--font); cursor: pointer;
  box-shadow: var(--card-hi), var(--shadow-xs); transition: border-color var(--t), color var(--t); }
.search-pill:hover { border-color: var(--line-strong); color: var(--text-2); }
.search-pill svg { width: 17px; height: 17px; flex: none; }
.search-pill kbd { margin-left: auto; font: 700 10.5px var(--font); color: var(--text-3); background: var(--fill); border-radius: 6px; padding: 2px 6px; }
@media (max-width: 1060px) { .search-pill { min-width: 0; width: 36px; padding: 0; justify-content: center; } .search-pill span, .search-pill kbd { display: none; } }
@media (max-width: 760px) { .search-pill { display: none; } }

/* Search everything: a sheet on phones, a palette near the top on wider screens. */
.modal.modal-search { max-width: 620px; }
@media (min-width: 641px) {
  .modal-overlay:has(.modal-search) { place-items: start center; padding-top: 11vh; }
  .modal-search .modal-head { display: none; }
  .modal-search .modal-body { padding: 16px; }
}
.srch-q { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 14px; border-radius: 14px; background: var(--surface-2);
  border: 1px solid var(--line); color: var(--text-3); transition: border-color var(--t), box-shadow var(--t); }
.srch-q:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.srch-q input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: 600 15.5px var(--font); color: var(--text); }
.srch-q input::placeholder { color: var(--text-3); }
.srch-q input::-webkit-search-cancel-button { display: none; }
.srch-res { margin-top: 6px; max-height: min(56vh, 460px); overflow-y: auto; overscroll-behavior: contain; }
.srch-h { font-size: 11.5px; font-weight: 800; color: var(--text-3); margin: 12px 6px 6px; }
.srch-item { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; color: inherit; transition: background .12s linear; }
.srch-item:hover, .srch-item.is-sel { background: var(--fill); }
.srch-ic { width: 36px; height: 36px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--accent-tint); color: var(--accent); }
.srch-txt { min-width: 0; }
.srch-txt b { display: block; font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srch-txt span { display: block; font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srch-none { padding: 24px 8px; text-align: center; color: var(--text-3); font-size: 13px; }
.srch-foot { gap: 16px; justify-content: flex-end; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 11.5px; font-weight: 600; color: var(--text-3); }
.srch-foot kbd { font: 700 10.5px var(--font); background: var(--fill); color: var(--text-2); border-radius: 5px; padding: 1px 5px; margin-right: 3px; }
.only-fine { display: none; }
@media (hover: hover) and (pointer: fine) { .only-fine { display: flex; } }

/* A toast's action button (Undo). */
.toast-act { margin-left: 6px; padding: 5px 12px; border: 0; border-radius: 99px; background: rgba(255, 255, 255, .16); color: #fff;
  font: 800 12px var(--font); cursor: pointer; }
.toast-act:hover { background: rgba(255, 255, 255, .26); }
.toast:has(.toast-act) { padding-right: 8px; }

/* ---- Turnitin (public/js/turnitin.js) ---- */
.tii-chip { display: inline-flex; align-items: center; gap: 4px; font: inherit; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 99px;
  border: 0; background: rgba(120,120,140,.14); color: inherit; white-space: nowrap; vertical-align: middle; }
button.tii-chip { cursor: pointer; }
.tii-chip svg { width: 12px; height: 12px; }
.tii-chip.cool { background: rgba(52,211,153,.16); color: #0f9d6b; }
.tii-chip.warm { background: rgba(246,195,90,.2); color: #a3730c; }
.tii-chip.hot, .tii-chip.err { background: rgba(255,111,145,.16); color: #c23660; }
.tii-chip.wait { opacity: .8; }
.tii-block { border: 1px solid rgba(127,127,150,.25); border-radius: 10px; padding: 12px 14px; margin: 0 0 12px; }
.tii-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tii-score { font-size: 18px; font-weight: 900; }
.tii-score.cool { color: #0f9d6b; } .tii-score.warm { color: #a3730c; } .tii-score.hot { color: #c23660; }
.tii-state { font-size: 12px; opacity: .75; }
.tii-err { font-size: 12.5px; color: #c23660; margin: 6px 0 0; }
.tii-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.tii-acts:empty { display: none; }
.tii-note { font-size: 11.5px; opacity: .7; margin: 8px 0 0; }
.tii-eula { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; padding: 12px 14px;
  border-radius: 10px; border: 1px solid rgba(246,195,90,.45); background: rgba(246,195,90,.1); }
.tii-eula b { display: block; margin-bottom: 2px; }
.tii-eula span { font-size: 13px; opacity: .85; }
.tii-eula-acts { display: flex; gap: 8px; }
.tii-fs { border: 0; padding: 0; margin: 12px 0 0; }
.tii-fs legend { font-size: 12px; font-weight: 800; margin-bottom: 4px; }
.tii-steps { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 10px; counter-reset: tii; }
.tii-steps li { counter-increment: tii; display: grid; grid-template-columns: 26px 1fr auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; }
.tii-steps li::before { content: counter(tii); grid-row: span 2; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 800; background: rgba(127,127,150,.18); }
.tii-steps li.done::before { content: '✓'; background: rgba(52,211,153,.2); color: #0f9d6b; }
.tii-steps li b { font-size: 13.5px; } .tii-steps li span { grid-column: 2; font-size: 12px; opacity: .75; }
.tii-steps li .btn { grid-column: 3; grid-row: 1 / span 2; }
.tii-h { margin: 6px 0 8px; font-size: 13px; }
.tii-queue { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tii-errs { margin-bottom: 10px; display: flex; flex-direction: column; gap: 4px; }
.tii-env code { font-size: 11px; }

/* ---------- the side menu for a Local Portal student (js/local.js): its groups and the Delete button ---------- */
#nav .nav-group-label{padding:16px 14px 6px;font-size:12px;font-weight:600;color:rgba(255,255,255,.5)}
#nav .nav-group-label:first-child{padding-top:4px}
#nav button.nav-item{width:100%;background:none;border:0;text-align:left;font:inherit;cursor:pointer}

/* Back to Chats on the pages its rows open (Announcements, Notifications) */
.pg-back { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 10px; color: var(--text-2); font-size: 14px; font-weight: 500; text-decoration: none; }
.pg-back:hover { color: var(--text); }
/* Manage › Turnitin › Check a document (Adam, 9 Nov 2026) */
.tii-checks { margin-top: 16px; }
.tii-warn { color: #a3730c; }
.tii-check-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 10px 0 14px; }
.tii-check-form input[type=file] { max-width: 100%; }
.tii-check-table td { vertical-align: top; }
.tii-check-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .tii-check-acts { justify-content: flex-start; } }
/* Manage › Attendance (Adam, 10 Nov 2026) */
.att-admin #att-student > .card { margin-top: 16px; }
.att-find { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.att-find input { flex: 1 1 240px; min-width: 0; }
.att-results tr.att-on td, .att-marks tr.att-on td { background: var(--fill); }
.att-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 10px; margin: 12px 0; }
.att-stats > div { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; }
.att-stats b { display: block; font-size: 20px; }
.att-stats span { font-size: 12.5px; color: var(--text-2); }
.att-subjects .num, .att-subjects th.num { text-align: right; white-space: nowrap; }
.att-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.att-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text-2); }
.att-filters label.att-chk { flex-direction: row; align-items: center; gap: 6px; padding-bottom: 8px; }
.att-bar { position: sticky; top: 0; z-index: 2; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px 12px; margin-bottom: 12px;
  background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--r-sm); box-shadow: var(--shadow-xs); }
.att-bar[hidden] { display: none; }
.att-bar input { flex: 1 1 180px; min-width: 0; }
.att-marks .att-tick { width: 36px; }
.att-marks .nowrap { white-space: nowrap; }
@media (max-width: 640px) { .att-filters label { flex: 1 1 140px; } }
