/* OUS exam monitoring pages: one shared stylesheet (docs/web-v1-spec.md section 2).
   No shadows, no gradients, no animations: only a short colour transition. */

/* ---------------------------------------------------------------- font */
@font-face {
  font-family: "Cairo";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/cairo/cairo-arabic-400-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "Cairo";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/cairo/cairo-arabic-700-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "Cairo";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/cairo/cairo-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Cairo";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/cairo/cairo-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* -------------------------------------------------------------- tokens */
/* Official palette (dashboard v2, docs/dashboard-v2-spec.md 2): primary #0B3A75,
   secondary #1458A6, action #1769C2. Status colours keep one meaning each. */
:root {
  color-scheme: light;
  --bg: #F4F7FB;
  --surface: #FFFFFF;
  --surface-2: #F8FAFD;
  --side-bg: #FFFFFF;
  --text: #172B4D;
  --text-2: #5B6B82;
  --border: #DCE5F0;
  --brand: #1769C2;
  --brand-hover: #1458A6;
  --brand-bg: #E8F1FB;
  --brand-deep: #0B3A75;
  --link-hover: #1458A6;
  --on-brand: #FFFFFF;
  --on-brand-hover: #FFFFFF;
  --head-bg: #0B3A75;
  --head-bg-2: #1458A6;
  --head-text: #FFFFFF;
  --ok: #168A4A;
  --ok-bg: #E4F4EA;
  --ok-text: #0F6B39;
  --done: #1769C2;
  --done-bg: #E6F0FB;
  --done-text: #0F4F96;
  --bad: #D93642;
  --bad-bg: #FCE9EB;
  --bad-text: #A51E2A;
  --warn: #D99516;
  --warn-bg: #FDF3DF;
  --warn-text: #7A4F00;
  --idle: #94A3B8;
  --idle-bg: #EEF2F7;
  --idle-text: #475569;
  /* solid seat tiles: the text on them keeps 4.5:1 (green and red are a shade deeper) */
  --ok-solid: #13793F;
  --done-solid: #1769C2;
  --bad-solid: #C42F3B;
  --warn-solid: #D99516;
  --idle-solid: #94A3B8;
  --on-solid: #FFFFFF;
  --on-warn-solid: #172B4D;
  --on-idle-solid: #172B4D;
  --empty-line: #6B7A90;
  --map-land: #DCE8F6;
  --map-line: #1458A6;
  --backdrop: rgba(11, 31, 59, 0.55);
  --font: "Cairo", "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif;
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #101827;
    --surface: #192536;
    --surface-2: #1E2C40;
    --side-bg: #111D30;
    --text: #F1F5F9;
    --text-2: #A7B4C8;
    --border: #304157;
    --brand: #4D94E8;
    --brand-hover: #73ABEE;
    --brand-bg: #17304F;
    --link-hover: #8DBBF2;
    --on-brand: #0B1628;
    --on-brand-hover: #0B1628;
    --head-bg: #111D30;
    --head-bg-2: #142844;
    --head-text: #F1F5F9;
    --ok: #34B06C;
    --ok-bg: #12301F;
    --ok-text: #8EE0B0;
    --done: #4D94E8;
    --done-bg: #132D4B;
    --done-text: #A9CDF6;
    --bad: #EE5D69;
    --bad-bg: #3A1A21;
    --bad-text: #FFB3BA;
    --warn: #E5A93A;
    --warn-bg: #3A2C12;
    --warn-text: #F7D58F;
    --idle: #7D8DA6;
    --idle-bg: #223047;
    --idle-text: #CBD5E1;
    --empty-line: #8494AC;
    --map-land: #1E3554;
    --map-line: #6FA5E6;
    --backdrop: rgba(0, 0, 0, 0.6);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101827;
  --surface: #192536;
  --surface-2: #1E2C40;
  --side-bg: #111D30;
  --text: #F1F5F9;
  --text-2: #A7B4C8;
  --border: #304157;
  --brand: #4D94E8;
  --brand-hover: #73ABEE;
  --brand-bg: #17304F;
  --link-hover: #8DBBF2;
  --on-brand: #0B1628;
  --on-brand-hover: #0B1628;
  --head-bg: #111D30;
  --head-bg-2: #142844;
  --head-text: #F1F5F9;
  --ok: #34B06C;
  --ok-bg: #12301F;
  --ok-text: #8EE0B0;
  --done: #4D94E8;
  --done-bg: #132D4B;
  --done-text: #A9CDF6;
  --bad: #EE5D69;
  --bad-bg: #3A1A21;
  --bad-text: #FFB3BA;
  --warn: #E5A93A;
  --warn-bg: #3A2C12;
  --warn-text: #F7D58F;
  --idle: #7D8DA6;
  --idle-bg: #223047;
  --idle-text: #CBD5E1;
  --empty-line: #8494AC;
  --map-land: #1E3554;
  --map-line: #6FA5E6;
  --backdrop: rgba(0, 0, 0, 0.6);
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
h1, h2, h3 { margin: 0; line-height: 1.4; font-weight: 700; }
h1 { font-size: 20px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
p { margin: 0; }
a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
table { border-collapse: collapse; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.top :focus-visible { outline-color: var(--head-text); }
.ltr { direction: ltr; unicode-bidi: isolate; }
/* Latin input (usernames): typed left to right; the Arabic placeholder stays right to left. */
.ltr-input:not(:placeholder-shown) { direction: ltr; text-align: right; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.small { font-size: 14px; }
.tiny { font-size: 12px; }
.bold { font-weight: 700; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------- icons */
.ic {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
  vertical-align: middle;
}
.ic-lg { width: 28px; height: 28px; }
.ic-xl { width: 48px; height: 48px; }

/* -------------------------------------------------------------- layout */
.wrap { max-width: 760px; margin: 0 auto; padding: 16px var(--gutter) 48px; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row-sb { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.grow { flex: 1 1 auto; min-width: 0; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.card > h2, .card-h { margin-bottom: 12px; }
.center { text-align: center; }
.full-msg { text-align: center; padding: 32px 16px; }
.full-msg .ic-xl { color: var(--bad); margin-bottom: 8px; }
.full-msg-info .ic-xl { color: var(--brand); } /* "not open yet" is not an error */
.full-msg h1 { margin-bottom: 8px; }
.full-msg p + p, .full-msg p + .btn, .full-msg .btn + p { margin-top: 16px; }

/* ---------------------------------------------------------- top header */
.top { background: var(--head-bg); color: var(--head-text); border-bottom: 3px solid var(--brand); }
.top-in {
  max-width: 760px; margin: 0 auto; padding: 6px var(--gutter);
  display: flex; align-items: center; gap: 8px; min-height: 56px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
/* the university emblem (assets/logo-mark.svg) on a white tile: its black and blue
   parts need a light ground on the blue header (light mode) and the dark one */
.logo-mark {
  display: block; width: 34px; height: 38px; flex: none; box-sizing: border-box;
  padding: 3px; border-radius: 8px; background: #FFFFFF; object-fit: contain;
}
.brand-t { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.brand-t strong { font-size: 16px; }
.brand-en { font-size: 12px; }
.btn-top {
  background: transparent; color: var(--head-text); border: 1px solid transparent;
  border-radius: 8px; min-width: 44px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; padding: 0 8px; transition: border-color .15s, background-color .15s;
}
.btn-top:hover { border-color: var(--head-text); }

/* ------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; min-width: 44px; padding: 8px 16px;
  border: 1px solid var(--brand); border-radius: 8px;
  background: var(--brand); color: var(--on-brand);
  font-weight: 700; text-decoration: none; cursor: pointer; text-align: center;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--on-brand-hover); }
.btn-2 { background: var(--surface); color: var(--text); border-color: var(--text-2); }
.btn-2:hover { background: var(--brand-bg); border-color: var(--brand); color: var(--text); }
.btn-bad { background: var(--bad-bg); color: var(--bad-text); border-color: var(--bad); }
.btn-bad:hover { background: var(--bad-bg); color: var(--bad-text); border-color: var(--bad-text); }
.btn[disabled], .btn[disabled]:hover {
  background: var(--idle-bg); color: var(--idle-text); border-color: var(--idle); cursor: not-allowed;
}
.btn-lg { min-height: 56px; font-size: 18px; padding: 10px 20px; }
.btn-sm { min-height: 44px; padding: 4px 12px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-icon { padding: 0; width: 44px; }
.linkbtn {
  background: none; border: 0; padding: 8px 12px; min-height: 44px; min-width: 44px; cursor: pointer;
  color: var(--brand); text-decoration: underline; text-underline-offset: 3px;
}
.actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 480px) { .actions { grid-template-columns: 1fr 1fr; } }

/* --------------------------------------------------------------- forms */
.field { display: block; }
.field > span, .field > .lbl { display: block; font-weight: 700; margin-bottom: 4px; }
.field .hint { display: block; font-size: 14px; color: var(--text-2); margin-top: 4px; font-weight: 400; }
.inp {
  display: block; width: 100%; min-height: 44px; padding: 8px 12px;
  border: 1px solid var(--text-2); border-radius: 8px;
  background: var(--surface); color: var(--text);
  transition: border-color .15s;
}
.inp:focus { border-color: var(--brand); }
select.inp { padding-inline-end: 8px; }
.form-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid-2 { grid-template-columns: 1fr 1fr; } }
.check { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }
.msg { font-size: 14px; }
.msg-bad { color: var(--bad-text); background: var(--bad-bg); border: 1px solid var(--bad); border-radius: 8px; padding: 8px 12px; }
.msg-ok { color: var(--ok-text); background: var(--ok-bg); border: 1px solid var(--ok); border-radius: 8px; padding: 8px 12px; }

/* --------------------------------------------------- pills and badges */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px; border-radius: 999px; border: 1px solid var(--border);
  font-size: 14px; font-weight: 700; line-height: 1.6; white-space: nowrap;
  background: var(--idle-bg); color: var(--idle-text);
}
.pill .ic { width: 16px; height: 16px; }
.pill.s-in_exam, .pill.p-ok { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok); }
.pill.s-submitted { background: var(--done-bg); color: var(--done-text); border-color: var(--done); }
.pill.s-not_submitted, .pill.p-bad { background: var(--bad-bg); color: var(--bad-text); border-color: var(--bad); }
.pill.s-offline, .pill.p-warn { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn); }
.pill.s-idle, .pill.p-idle { background: var(--idle-bg); color: var(--idle-text); border-color: var(--idle); }
.pill.p-info { background: var(--brand-bg); color: var(--text); border-color: var(--brand); }

/* ------------------------------------------------------- notice bars */
.note {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: 8px; border: 1px solid var(--border);
}
.note .ic { margin-top: 2px; }
.note strong { display: block; }
.note .grow > * + * { margin-top: 2px; }
.note-bad { background: var(--bad-bg); color: var(--bad-text); border-color: var(--bad); border-width: 2px; }
.note-warn { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn); }
.note-info { background: var(--brand-bg); color: var(--text); border-color: var(--brand); }
.note-ok { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok); }
.note .btn { flex: none; }
@media (max-width: 479px) { .note { flex-wrap: wrap; } .note .grow { flex: 1 1 200px; } }

/* --------------------------------------------------------- hall header */
.hall-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.hall-head .grow p { color: var(--text-2); font-size: 14px; }

/* ------------------------------------------------------------ counters */
.counters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 600px) { .counters { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.counter {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto;
  column-gap: 8px; align-items: center;
  padding: 12px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
}
.counter .ic { grid-row: 1 / span 2; width: 28px; height: 28px; }
.counter-n { font-size: 28px; line-height: 1.2; font-weight: 700; font-variant-numeric: tabular-nums; }
.counter-l { font-size: 14px; font-weight: 700; }
.counter-sub { grid-column: 1 / -1; font-size: 14px; margin-top: 4px; }
.counter.s-in_exam { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok); }
.counter.s-submitted { background: var(--done-bg); color: var(--done-text); border-color: var(--done); }
.counter.s-not_submitted { background: var(--bad-bg); color: var(--bad-text); border-color: var(--bad); }
.counter.s-offline { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn); }
.counter.s-total { background: var(--brand-bg); color: var(--text); border-color: var(--brand); }

/* ------------------------------------------------------------ seat map */
.seatmap h2 { margin-bottom: 12px; }
.seats {
  display: grid; gap: 4px;
  grid-template-columns: repeat(6, minmax(44px, 1fr));
}
@media (min-width: 400px) { .seats { grid-template-columns: repeat(8, minmax(44px, 1fr)); } }
@media (max-width: 479px) {
  :root { --gutter: 12px; }
  .page-h .seatmap, .page-d .seatmap { border: 0; background: transparent; padding: 4px 0; }
}
@media (min-width: 400px) and (max-width: 479px) {
  /* 8 seats of 44px and their gaps need 380px: keep them at 400px wide */
  .page-h .wrap, .page-d .main { padding-left: 8px; padding-right: 8px; }
}
.seat {
  position: relative; min-width: 44px; min-height: 44px; aspect-ratio: 1 / 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  border-radius: 8px; border: 1px solid var(--border); padding: 2px;
  background: var(--surface); color: var(--text);
  font-weight: 700; font-size: 16px; line-height: 1.1; font-variant-numeric: tabular-nums;
  transition: border-color .15s, background-color .15s;
}
button.seat { cursor: pointer; }
button.seat:hover { border-color: var(--text); }
.seat .seat-ic { width: 16px; height: 16px; margin-top: 2px; stroke-width: 2.5; }
.seat.s-in_exam { background: var(--ok-solid); color: var(--on-solid); border-color: var(--ok-solid); }
.seat.s-submitted { background: var(--done-solid); color: var(--on-solid); border-color: var(--done-solid); }
.seat.s-not_submitted { background: var(--bad-solid); color: var(--on-solid); border: 2px solid var(--bad-text); }
.seat.s-offline { background: var(--warn-solid); color: var(--on-warn-solid); border-color: var(--warn-solid); }
.seat.s-idle { background: var(--idle-solid); color: var(--on-idle-solid); border-color: var(--idle-solid); }
.seat.seat-empty { background: var(--idle-bg); color: var(--text-2); border: 1px dashed var(--empty-line); font-weight: 400; }
.seats-extra { margin-top: 12px; }
.seats-extra h3 { font-size: 14px; color: var(--text-2); margin-bottom: 6px; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 14px; }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend .seat { min-width: 24px; min-height: 24px; width: 24px; height: 24px; padding: 0; }
.legend .seat .seat-ic { width: 14px; height: 14px; margin: 0; }
ul.plain, ol.plain { list-style: none; margin: 0; padding: 0; }
/* answer progress (docs/exam-progress-v1-spec.md 7): a seat that has not answered every
   question with 10 minutes or less left gets an orange ring inside it; answers changed
   right after a return get a dot in the corner (an indicator to review, not proof) */
.seat.seat-inc { outline: 3px solid var(--warn-solid); outline-offset: -6px; }
.seat.seat-inc:focus-visible { outline-color: var(--brand); outline-offset: 2px; }
.seat.seat-flag::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 10px; height: 10px;
  border-radius: 50%; background: #FFFFFF; border: 3px solid var(--bad-solid);
}
.legend .seat.seat-inc { outline-width: 2px; outline-offset: -4px; }
.legend .seat.seat-flag::after { top: 1px; left: 1px; width: 8px; height: 8px; border-width: 2px; }
.inc-list { margin-top: 12px; }
.inc-list h3 { font-size: 14px; color: var(--warn-text); margin-bottom: 6px; }
.inc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.inc-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 2px 12px;
  border-radius: 999px; border: 1px solid var(--warn); background: var(--warn-bg); color: var(--warn-text);
  font-weight: 700; font-size: 14px; cursor: pointer; transition: border-color .15s, background-color .15s;
}
.inc-chip:hover { border-color: var(--warn-text); }
.inc-sw { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--warn-solid); flex: none; }
/* the 5-minute alert sound button of /h/ while it is on */
.btn-2[aria-pressed="true"] { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok); }

/* -------------------------------------------------------------- events */
.events { list-style: none; margin: 0; padding: 0; }
.events li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border); min-height: 44px;
}
.events li:last-child { border-bottom: 0; }
.ev-time { font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 14px; flex: none; min-width: 3.2em; }
.ev-seat { font-weight: 700; flex: none; }
.ev-dot {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--idle-bg); color: var(--idle-text); border: 1px solid var(--idle);
}
.ev-dot .ic { width: 16px; height: 16px; }
.ev-dot.s-in_exam { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok); }
.ev-dot.s-submitted { background: var(--done-bg); color: var(--done-text); border-color: var(--done); }
.ev-dot.s-not_submitted { background: var(--bad-bg); color: var(--bad-text); border-color: var(--bad); }
.ev-dot.s-offline { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn); }
.ev-dot.s-info { background: var(--brand-bg); color: var(--text); border-color: var(--brand); }
.empty { color: var(--text-2); padding: 8px 0; }

/* ------------------------------------------------------- tables, bars */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; font-size: 16px; }
.tbl th, .tbl td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: start; vertical-align: middle; white-space: nowrap; }
.tbl .hbar { min-width: 96px; }
.tbl th { font-size: 14px; color: var(--text-2); font-weight: 700; white-space: nowrap; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl td.n, .tbl th.n { font-variant-numeric: tabular-nums; }
.tbl a { font-weight: 700; display: inline-flex; align-items: center; min-height: 44px; }
.kv { display: grid; grid-template-columns: minmax(8em, auto) 1fr; gap: 0 12px; margin: 0; }
.kv dt, .kv dd { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--border); }
.kv dt { color: var(--text-2); font-size: 14px; }
.kv dd { font-weight: 700; }
.hbar { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.hbar-t { flex: 1 1 auto; height: 10px; border-radius: 5px; background: var(--idle-bg); border: 1px solid var(--border); overflow: hidden; }
.hbar-f { display: block; height: 100%; width: 0; background: var(--done); }
.hbar-f.b-brand { background: var(--brand); }
.hbar-v { font-size: 14px; font-variant-numeric: tabular-nums; min-width: 3em; }
.copy-row { display: flex; gap: 8px; align-items: center; min-width: 260px; }
.copy-row .btn { flex: none; white-space: nowrap; }
.tbl .row { flex-wrap: nowrap; }
.copy-row .inp { direction: ltr; font-size: 14px; }
.code { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; letter-spacing: 1px; font-weight: 700; }

/* -------------------------------------------------- overlays and sheet */
.overlay {
  position: fixed; inset: 0; z-index: 60; overflow-y: auto;
  background: var(--bg); color: var(--text);
  display: flex; flex-direction: column; align-items: center;
  padding: 56px 16px 24px; text-align: center;
}
.ov-in { margin: auto 0; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.overlay h2 { font-size: 20px; }
.ov-close { position: absolute; top: 8px; left: 8px; }
.qr-box {
  background: #FFFFFF; border-radius: 12px; padding: 8px; border: 1px solid var(--border);
  width: min(92vw, 72vh, 560px); line-height: 0;
}
.qr-box svg { width: 100%; height: auto; display: block; }
.qr-small { width: 220px; }
.qr-box p { line-height: 1.6; padding: 16px; }
.qr-box p.muted { color: #475569; }
.qr-text { font-size: 18px; font-weight: 700; max-width: 32em; }

.pin { display: flex; direction: ltr; gap: 6px; justify-content: center; width: 100%; max-width: 560px; }
.pin span {
  flex: 1 1 0; max-width: 64px; min-width: 0; aspect-ratio: 3 / 4;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; font-weight: 700; font-variant-numeric: tabular-nums;
  border: 2px solid var(--brand); border-radius: 8px; background: var(--surface); color: var(--text);
}
@media (max-width: 420px) { .pin span { font-size: 30px; } }
.ring { position: relative; width: 72px; height: 72px; }
.ring svg { width: 72px; height: 72px; transform: rotate(-90deg); }
.ring .ring-t { stroke: var(--border); }
.ring .ring-f { stroke: var(--brand); }
.ring-n {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums;
}

.backdrop { position: fixed; inset: 0; z-index: 40; background: var(--backdrop); }
.sheet {
  position: fixed; z-index: 41; left: 0; right: 0; bottom: 0;
  max-width: 640px; margin: 0 auto; max-height: 85vh; overflow-y: auto;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-bottom: 0; border-radius: 12px 12px 0 0;
  padding: 12px 16px 24px;
}
.sheet-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.modal {
  position: fixed; z-index: 70; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(92vw, 440px); background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px; padding: 20px;
}
.modal p { margin-bottom: 16px; }
.modal .row { justify-content: flex-end; }
.modal-back { z-index: 69; }
.toast {
  position: fixed; z-index: 80; bottom: 16px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 8px 16px; border-radius: 8px; font-size: 14px;
  max-width: 92vw;
}

/* ------------------------------------------------------------ login */
.login { max-width: 420px; margin: 0 auto; padding: 32px var(--gutter); }
.login .card { padding: 24px 20px; }
.login h1 { margin-bottom: 4px; }
.login p.muted { margin-bottom: 16px; font-size: 14px; }
.login form > * + * { margin-top: 14px; }
.otp { display: flex; direction: ltr; gap: 6px; justify-content: center; }
.otp input {
  width: 48px; height: 56px; min-width: 0; flex: 1 1 0; max-width: 56px;
  text-align: center; font-size: 24px; font-weight: 700; padding: 0;
  border: 1px solid var(--text-2); border-radius: 8px; background: var(--surface); color: var(--text);
}
.otp input:focus { border-color: var(--brand); }

/* ---------------------------------------------------------- dashboard */
.page-d .top-in, .page-d .wrap { max-width: none; }
.top-d { flex-wrap: wrap; }
.top-d .menu-btn { order: 0; }
.top-d .brand { flex: none; order: 1; }
.top-d .brand-t strong, .who { white-space: nowrap; }
.top-d .top-tools { order: 2; }
.top-d .top-row2 { order: 3; }
.brand-link { color: inherit; text-decoration: none; }
.brand-link:hover { color: inherit; }
.login-head { margin-bottom: 16px; }
.side-who { display: flex; flex-direction: column; padding: 8px 12px 12px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.top-tools { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.who { display: flex; flex-direction: column; line-height: 1.3; font-size: 14px; text-align: start; padding: 0 6px; }
.who span { font-size: 12px; }
@media (max-width: 419px) {
  .who { display: none; }
  .top-d .brand { flex: 1 1 0; min-width: 0; }
  .top-d .brand-t strong { white-space: normal; } /* the name may take two lines */
  .top-d .brand-en { display: none; }
}
.top-row2 { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.top-row2 .inp { min-width: 0; background: var(--surface); color: var(--text); border-color: var(--border); }
.top-row2 .sel { flex: 1 1 220px; }
.top-row2 form { flex: 1 1 220px; display: flex; gap: 6px; }
@media (max-width: 479px) { .top-row2 .sel { flex-basis: 150px; } .top-row2 form { flex-basis: 150px; } }
.top-row2 .btn { flex: none; }
.shell { display: block; }
.side {
  background: var(--side-bg); border-inline-start: 1px solid var(--border);
  padding: 12px 8px;
}
.side a {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px;
  border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 700;
  transition: background-color .15s, color .15s;
}
.side a:hover { background: var(--brand-bg); color: var(--text); }
.side a[aria-current="page"] { background: var(--brand-bg); color: var(--text); }
.side a[aria-current="page"] .ic { color: var(--brand); }
.menu-btn { display: inline-flex; }
@media (max-width: 899px) {
  .side { position: fixed; z-index: 45; top: 0; bottom: 0; right: 0; width: min(290px, 86vw); overflow-y: auto; border-inline-start: 0; border-inline-end: 1px solid var(--border); }
  .side:not(.open) { display: none; }
  .side-back { z-index: 44; }
}
@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: calc(100vh - 60px); }
  .side { position: sticky; top: 0; align-self: start; min-height: calc(100vh - 60px); border-inline-start: 0; border-inline-end: 1px solid var(--border); }
  .menu-btn, .side-back { display: none !important; }
  .side .side-close, .side .side-who { display: none; }
}
.main { padding: 16px var(--gutter) 48px; min-width: 0; }
.main > * + * { margin-top: 16px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 14px; color: var(--text-2); }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; }
.crumbs .ic { width: 14px; height: 14px; transform: scaleX(-1); }
.page-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.upd { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); }
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.center-card a { text-decoration: none; color: inherit; display: block; }
.center-card h3 { margin-bottom: 8px; color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.page-d .seats { max-width: 720px; }

/* -------------------------------------------------------------- camera */
/* docs/camera-v1-spec.md: the BigBlueButton client in a frame (/h/ shares, /d/ watches) */
.cam > * + * { margin-top: 12px; }
.cam-frame { display: block; width: 100%; height: 240px; border: 1px solid var(--border); border-radius: 8px; background: var(--idle-bg); }
.cam-frame.cam-tall { height: 440px; max-height: 70vh; }
.cam-cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.cam-card h3 { font-size: 16px; }
textarea.inp { min-height: 88px; resize: vertical; }

/* ----------------------------------------------------------- enrolment */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.steps li:last-child { border-bottom: 0; }
.step-ic {
  width: 44px; height: 44px; flex: none; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-bg); color: var(--text); border: 1px solid var(--brand);
}
.step-ic .ic { width: 24px; height: 24px; }
.steps .grow > * + * { margin-top: 8px; }
.sec-h { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sec-h .ic { width: 28px; height: 28px; color: var(--brand); }
.yours { border-color: var(--brand); border-width: 2px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.facts .pill { white-space: normal; }

/* -------------------------------------------------------------- print */
@media print {
  .top, .side, .actions, .btn, .upd { display: none !important; }
  body { background: #FFFFFF; color: #000000; }
}
