/* Dashboard /d/ only (docs/dashboard-v2-spec.md): loaded after app.css by d/index.html.
   The shared tokens and components stay in app.css; /h/ and /e/ never load this file. */
:root { --shadow: 0 1px 2px rgba(16, 39, 77, 0.06), 0 2px 8px rgba(16, 39, 77, 0.05); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --shadow: 0 1px 2px rgba(0, 0, 0, 0.3); } }
:root[data-theme="dark"] { --shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }

.page-d .card { box-shadow: var(--shadow); }
.page-d button.seat:hover { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text-2); }
@media print { .sysbar, .bell-panel, .drawer { display: none !important; } }

/* ------------------------------------------- dashboard v2: command center */
/* docs/dashboard-v2-spec.md. Depth comes from layout, type and spacing; motion
   is short, transform/opacity only, and off under prefers-reduced-motion. */
.logo-lg { width: 44px; height: 50px; padding: 4px; border-radius: 10px; }
.page-d .brand-t strong { font-size: 16px; }
.cc-title { line-height: 1.3; min-width: 0; }
.cc-title span { white-space: nowrap; }
@media (min-width: 1024px) { .top-d { flex-wrap: nowrap; } }
.cc-bar { background: var(--surface); color: var(--text); border-bottom: 1px solid var(--border); }
.cc-bar .top-row2 { padding: 8px var(--gutter); max-width: 900px; }
.cc-bar .top-row2 .inp { border-color: var(--text-2); }
.cc-bar :focus-visible { outline-color: var(--brand); }
.bell { position: relative; }
.badge {
  position: absolute; top: 3px; left: 3px; min-width: 20px; height: 20px; padding: 0 4px;
  border-radius: 10px; background: var(--bad-solid); color: #FFFFFF; border: 1px solid #FFFFFF;
  font-size: 12px; font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums;
}
.bell-panel {
  position: fixed; z-index: 50; top: 64px; left: 12px; width: min(400px, calc(100vw - 24px));
  max-height: min(70vh, 560px); overflow-y: auto; box-shadow: 0 8px 28px rgba(11, 31, 59, 0.22);
}
.bell-panel h2 { margin: 0; }
.bell-list { list-style: none; margin: 8px 0 0; padding: 0; }
.bell-list li { border-bottom: 1px solid var(--border); }
.bell-list li:last-child { border-bottom: 0; }
.bell-list a { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 0; color: var(--text); text-decoration: none; }
.bell-list a:hover strong { text-decoration: underline; }

/* sidebar fold (900px and wider) */
.side-fold {
  display: none; width: 100%; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; margin-bottom: 4px;
  background: transparent; border: 1px solid transparent; border-radius: 8px; color: var(--text-2); cursor: pointer; font-weight: 700;
}
.side-fold:hover { background: var(--brand-bg); color: var(--text); }
@media (min-width: 900px) {
  .side-fold { display: flex; }
  .shell.folded { grid-template-columns: 72px minmax(0, 1fr); }
  .shell.folded .side { padding-inline: 8px; }
  .shell.folded .side a, .shell.folded .side-fold { justify-content: center; padding-inline: 0; }
  .shell.folded .side a span, .shell.folded .side-fold span {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
  }
  .shell.folded .side-fold .ic { transform: scaleX(-1); }
}

/* bottom status bar */
.sysbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px;
  padding: 8px var(--gutter); background: var(--surface); border-top: 1px solid var(--border);
  font-size: 14px; color: var(--text-2);
}
.si { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; }
.si .ic { width: 18px; height: 18px; }
.si strong { color: var(--text); font-weight: 700; }
.si-ok .ic, .si-ok strong { color: var(--ok-text); }
.si-bad .ic, .si-bad strong { color: var(--bad-text); }
.si-warn .ic, .si-warn strong { color: var(--warn-text); }
@media (min-width: 900px) { .sysbar { position: sticky; bottom: 0; z-index: 30; } }

/* command center grid; on phones: alerts, counters, cameras, seats, events, map, hall;
   two columns from 768px, three from 1280px (8 seats of 44px need about 380px) */
.cc { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "alerts" "kpis" "cams" "seats" "events" "map" "hall"; }
.cc > * { margin: 0; min-width: 0; }
.cc-alerts { grid-area: alerts; } .kpis { grid-area: kpis; } .cc-cams { grid-area: cams; }
.cc-map { grid-area: map; } .cc-seats { grid-area: seats; } .cc-hall { grid-area: hall; } .cc-events { grid-area: events; }
.cc-alerts:empty { display: none; }
.cc-alerts > * + * { margin-top: 8px; }
@media (min-width: 768px) {
  .cc { grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "alerts alerts" "kpis kpis" "cams cams" "seats seats" "map hall" "events events"; }
}
.cc-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.cc-h h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 18px; }
.cc-h h2 .ic { color: var(--brand); }
.cc-h .inp { width: auto; min-width: 0; max-width: 100%; }
.cc .seatmap { border: 0; box-shadow: none; padding: 0; background: transparent; }
.cc .seatmap > h2 { display: none; }

/* counters */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.kpi {
  display: flex; align-items: center; gap: 12px; min-width: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
}
.kpi-ic { flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--idle-text); }
.kpi-t { display: flex; flex-direction: column; min-width: 0; }
.kpi-l { font-weight: 700; }
.kpi-n { font-size: 30px; line-height: 1.15; font-weight: 700; font-variant-numeric: tabular-nums; display: inline-block; }
.kpi-s { font-size: 12px; color: var(--text-2); }
.kpi.s-total { background: linear-gradient(to left, #0B3A75, #1458A6); border-color: transparent; color: #FFFFFF; grid-column: 1 / -1; }
.kpi.s-total .kpi-l, .kpi.s-total .kpi-s { color: #DCE8F6; }
.kpi.s-total .kpi-ic { color: #FFFFFF; }
@media (min-width: 768px) { .kpi.s-total { grid-column: auto; } }
.kpi.s-not_submitted .kpi-n { color: var(--bad-text); }
.kpi.s-offline .kpi-n { color: var(--warn-text); }
.kpi.s-not_submitted.has { border-color: var(--bad); }
.kpi.s-offline.has { border-color: var(--warn); }

/* cameras: one large + up to four small; a tile never moves in the DOM (that would reload BBB) */
.cams { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cam-tile {
  position: relative; min-width: 0; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: 10px; background: #0E1A2B; color: #FFFFFF; border: 1px solid var(--border);
}
.cam-tile.is-big { grid-column: 1 / -1; order: -1; }
@media (min-width: 1200px) {
  .cams { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cam-tile.is-big { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; min-height: 240px; }
}
.cam-screen { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.cam-screen iframe { width: 100%; height: 100%; border: 0; display: block; background: #0E1A2B; }
.cam-ph { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 12px 48px; text-align: center; color: #C9D6E8; font-size: 14px; }
.cam-ph .ic { width: 32px; height: 32px; opacity: 0.8; }
.cam-tile:not(.is-big) .cam-ph .ic { width: 24px; height: 24px; }
.cam-top, .cam-tools { position: absolute; left: 0; right: 0; display: flex; align-items: center; gap: 6px; padding: 6px 8px; pointer-events: none; }
.cam-top { top: 0; justify-content: space-between; background: linear-gradient(to bottom, rgba(8, 18, 33, 0.78), rgba(8, 18, 33, 0)); }
.cam-tools { bottom: 0; justify-content: flex-start; background: linear-gradient(to top, rgba(8, 18, 33, 0.82), rgba(8, 18, 33, 0)); }
.cam-top, .cam-tools { z-index: 2; }
.cam-tools > * { pointer-events: auto; }
.cam-pick { position: absolute; inset: 0; z-index: 1; width: 100%; padding: 0; background: transparent; border: 0; border-radius: 10px; cursor: pointer; }
.cam-pick:hover { background: rgba(255, 255, 255, 0.06); }
.cam-pick:focus-visible { outline: 3px solid #FFFFFF; outline-offset: -3px; }
.cam-tile:not(.is-big) .cam-tools .cam-btn:not(.cam-x) { display: none; }
.cam-tile:not(.is-big) .cam-ph { padding: 0 0 8px; }
.cam-tile:not(.is-big) .cam-ph span { display: none; }
.cam-name { font-size: 14px; font-weight: 700; line-height: 1.3; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
.cam-tile.is-big .cam-name { font-size: 16px; }
.cam-st { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: rgba(15, 29, 51, 0.85); border: 1px solid rgba(255, 255, 255, 0.3); }
.cam-st.st-live { background: #C42F3B; border-color: #C42F3B; }
.cam-st.st-lost { background: #7A4F00; border-color: #D99516; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #FFFFFF; }
.cam-btn {
  min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 10px;
  border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.4); background: rgba(15, 29, 51, 0.8); color: #FFFFFF;
  font-weight: 700; font-size: 14px; cursor: pointer;
}
.cam-btn:hover { background: rgba(23, 105, 194, 0.9); border-color: #FFFFFF; }
.cam-btn[disabled], .cam-btn[disabled]:hover { opacity: 0.55; cursor: not-allowed; background: rgba(15, 29, 51, 0.8); }
.cam-btn .ic { width: 18px; height: 18px; }
.cam-tile:not(.is-big) .cam-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.cam-tile :focus-visible { outline-color: #FFFFFF; }
.cam-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font-size: 14px; color: var(--text-2); }

/* centers map */
.map-svg { display: block; width: 100%; height: auto; max-height: 360px; margin: 0 auto; }
.map-land { fill: var(--map-land); stroke: var(--map-line); stroke-width: 3; stroke-linejoin: round; }
.map-pt { cursor: pointer; }
.map-pt .hit { fill: transparent; }
.map-pt .dot { stroke: var(--surface); stroke-width: 5; fill: var(--idle-solid); }
.map-pt.s-in_exam .dot { fill: var(--ok-solid); }
.map-pt.s-submitted .dot { fill: var(--done-solid); }
.map-pt.s-not_submitted .dot { fill: var(--bad-solid); }
.map-pt.s-offline .dot { fill: var(--warn-solid); }
.map-pt:focus { outline: none; }
.map-pt:focus-visible .dot, .map-pt.on .dot { stroke: var(--text); stroke-width: 7; }
.map-info { margin-top: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); }
.map-info h3 { font-size: 16px; margin-bottom: 6px; }
.map-info .facts { margin-top: 6px; }
.map-sub { margin-top: 10px; font-size: 14px; color: var(--text-2); }
.map-sub h3 { font-size: 14px; color: var(--text-2); margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 2px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
}
.chip .sw { width: 10px; height: 10px; border-radius: 50%; background: var(--idle-solid); flex: none; }
.chip.s-in_exam .sw { background: var(--ok-solid); } .chip.s-submitted .sw { background: var(--done-solid); }
.chip.s-not_submitted .sw { background: var(--bad-solid); } .chip.s-offline .sw { background: var(--warn-solid); }

/* hall status */
.stat-list { list-style: none; margin: 0; padding: 0; }
.stat-list li { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 0; border-bottom: 1px solid var(--border); }
.stat-list li:last-child { border-bottom: 0; }
.stat-list .ic { width: 18px; height: 18px; color: var(--text-2); }
.stat-list .grow { font-size: 14px; }
.stat-v { font-size: 12px; color: var(--text-2); text-align: end; }
.stat-n { min-width: 52px; padding: 2px 8px; border-radius: 6px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--idle-bg); }
.stat-list .s-in_exam .ic { color: var(--ok-text); } .stat-list .s-in_exam .stat-n { background: var(--ok-bg); color: var(--ok-text); }
.stat-list .s-submitted .ic { color: var(--done-text); } .stat-list .s-submitted .stat-n { background: var(--done-bg); color: var(--done-text); }
.stat-list .s-not_submitted .ic { color: var(--bad-text); } .stat-list .s-not_submitted .stat-n { background: var(--bad-bg); color: var(--bad-text); }
.stat-list .s-offline .ic { color: var(--warn-text); } .stat-list .s-offline .stat-n { background: var(--warn-bg); color: var(--warn-text); }

/* recent events with center and hall */
.feed { max-height: 420px; overflow-y: auto; overscroll-behavior: contain; }
.feed li { padding: 0; }
.ev-link { display: flex; align-items: flex-start; gap: 10px; width: 100%; min-height: 48px; padding: 6px 0; color: var(--text); text-decoration: none; }
.ev-link:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.ev-link .grow { display: flex; flex-direction: column; min-width: 0; }
.feed .ev-time { padding-top: 2px; }
.ev-where { display: block; font-size: 12px; color: var(--text-2); }

/* seat drawer: a side panel on wide screens, a bottom sheet on phones */
.drawer {
  position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow-y: auto;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-bottom: 0;
  border-radius: 14px 14px 0 0; padding: 14px 16px 24px; box-shadow: 0 -8px 28px rgba(11, 31, 59, 0.2);
}
@media (min-width: 768px) {
  .drawer { top: 0; right: auto; width: min(440px, 92vw); max-height: none; border-radius: 0; border: 0; border-inline-start: 1px solid var(--border); }
}
.drawer > * + * { margin-top: 12px; }

@media (prefers-reduced-motion: no-preference) {
  .kpi-n.bump { animation: kpi-bump .5s ease-out; }
  .live-dot { animation: live-pulse 2s ease-in-out infinite; }
  .drawer { animation: drawer-up .2s ease-out; }
  .bell-panel { animation: fade-in .15s ease-out; }
  .cam-screen iframe, .cam-ph { animation: fade-in .25s ease-out; }
  .kpi, .chip { transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
  .kpi:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(16, 39, 77, 0.10); }
}
@media (prefers-reduced-motion: no-preference) and (min-width: 768px) {
  .drawer { animation-name: drawer-side; }
}
@keyframes kpi-bump { 0% { transform: translateY(3px); opacity: .55; } 100% { transform: none; opacity: 1; } }
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes drawer-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes drawer-side { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }


/* ------------------------------------- the owner's reference design (2026-11-05) */
/* docs/dashboard-v2-spec.md 8: dark navy menu on the left with the icon over the label,
   the banner header (title on the right, the building in the middle, the university on
   the left), the counters in the reference order, the map / small cameras / large camera
   row, events / hall / seats, and the segmented status bar. */
:root {
  --hero-bg: #EAF1FA;
  --hero-sky: #CFE2F6;
  --hero-title: #0B3A75;
  --nav-a: #0B3A75;
  --nav-b: #0A2F60;
  --nav-on: #1769C2;
  --tile-box: #EEF2F7;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --hero-bg: #142033; --hero-sky: #1E3150; --hero-title: #F1F5F9; --nav-a: #111D30; --nav-b: #0E1828; --nav-on: #1458A6; --tile-box: #223047; }
}
:root[data-theme="dark"] { --hero-bg: #142033; --hero-sky: #1E3150; --hero-title: #F1F5F9; --nav-a: #111D30; --nav-b: #0E1828; --nav-on: #1458A6; --tile-box: #223047; }

/* menu: navy, icon over label */
.page-d .side { background: linear-gradient(to bottom, var(--nav-a), var(--nav-b)); border: 0; color: #FFFFFF; padding: 12px 10px; }
.page-d .side a {
  flex-direction: column; justify-content: center; gap: 4px; min-height: 64px; padding: 8px 4px;
  border: 1px solid transparent; border-radius: 12px; color: #FFFFFF; font-size: 14px; text-align: center;
}
.page-d .side a .ic { width: 28px; height: 28px; }
.page-d .side a:hover { background: rgba(255, 255, 255, 0.10); color: #FFFFFF; }
.page-d .side a[aria-current="page"] { background: var(--nav-on); border-color: rgba(255, 255, 255, 0.45); color: #FFFFFF; box-shadow: none; }
.page-d .side a[aria-current="page"] .ic { color: #FFFFFF; }
.page-d .side-fold { color: #DCE8F6; justify-content: center; flex-direction: column; gap: 2px; font-size: 12px; }
.page-d .side-fold:hover { background: rgba(255, 255, 255, 0.10); color: #FFFFFF; }
.page-d .side-who { color: #FFFFFF; border-color: rgba(255, 255, 255, 0.2); }
.page-d .side-who .muted { color: #DCE8F6; }
.page-d .side :focus-visible { outline-color: #FFFFFF; }
@media (min-width: 900px) {
  /* the menu on the left, as in the reference */
  .shell { grid-template-columns: minmax(0, 1fr) 150px; }
  .shell > .side { grid-column: 2; grid-row: 1; }
  .shell > .main { grid-column: 1; grid-row: 1; }
  .shell.folded { grid-template-columns: minmax(0, 1fr) 72px; }
  .shell.folded .side a { min-height: 52px; }
}

/* header: a dark bar on phones; the banner from 1024px */
.page-d .top.hero { background: linear-gradient(to left, #0B3A75, #1458A6); color: #FFFFFF; border: 0; }
.hero-in { gap: 8px; }
.hero-in .menu-btn { order: 0; }
.hero-in .hero-brand { order: 1; flex: 0 1 auto; min-width: 0; }
.hero-in .hero-title { order: 2; display: flex; align-items: center; margin-inline-start: auto; min-width: 0; }
.hero-title .cc-title { display: none; }
.hero-photo { display: none; }
.who { flex-direction: row; align-items: center; gap: 8px; }
.who-ic { display: none; }
.who-t { display: flex; flex-direction: column; line-height: 1.3; }
.find-slot:empty { display: none; }
@media (min-width: 1024px) {
  .page-d .top.hero { background: var(--hero-bg); color: var(--text); }
  .hero-in { align-items: stretch; gap: 0; min-height: 140px; padding: 0; }
  .hero-in .hero-title {
    order: 0; flex: none; flex-direction: column; align-items: flex-start; justify-content: center; gap: 12px;
    margin: 0; padding: 12px 24px;
  }
  .hero-title .cc-title { display: flex; flex-direction: column; border: 0; padding: 0; margin: 0; }
  .hero-title .cc-title strong { font-size: 28px; line-height: 1.25; color: var(--hero-title); white-space: nowrap; }
  .hero-title .cc-title span { font-size: 18px; color: var(--brand); opacity: 1; }
  .hero-in .top-tools { margin: 0; gap: 8px; }
  .hero-in .btn-top { color: var(--text); background: var(--surface); border-color: var(--border); border-radius: 50%; }
  .hero-in .btn-top:hover { border-color: var(--brand); }
  .hero-in :focus-visible { outline-color: var(--brand); }
  .who {
    min-height: 48px; padding: 4px 6px 4px 14px; border: 1px solid var(--border); border-radius: 12px;
    background: var(--surface); color: var(--text); box-shadow: var(--shadow);
  }
  .who-ic { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: #172B4D; color: #FFFFFF; flex: none; }
  .who-t strong { font-size: 14px; }
  .who-t span { font-size: 12px; color: var(--text-2); }
  .hero-photo { order: 1; display: block; position: relative; flex: 1 1 auto; min-width: 160px; overflow: hidden; }
  .hero-photo img {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 45%;
    -webkit-mask-image: linear-gradient(to left, transparent 0, #000 18%, #000 82%, transparent 100%);
    mask-image: linear-gradient(to left, transparent 0, #000 18%, #000 82%, transparent 100%);
  }
  .hero-in .hero-brand {
    order: 2; flex: none; align-self: stretch; gap: 14px; color: #FFFFFF;
    padding-inline-start: 72px; padding-inline-end: 28px; position: relative; isolation: isolate;
  }
  /* the slanted panel sits behind the link, so the focus ring is not clipped */
  .hero-in .hero-brand::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(to left, var(--nav-a), #0F4C92);
    clip-path: polygon(0 0, 100% 0, calc(100% - 56px) 100%, 0 100%);
  }
  .hero-in .hero-brand:focus-visible { outline-color: #FFFFFF; outline-offset: -6px; }
  .hero-brand .logo-lg { order: 1; width: 64px; height: 72px; padding: 6px; border-radius: 50%; }
  .bell-panel { top: 140px; left: auto; right: 16px; }
  .hero-brand .brand-t strong { font-size: 24px; }
  .hero-brand .brand-en { font-size: 18px; }
  .hero-brand:hover { color: #FFFFFF; }
}
@media (min-width: 1280px) {
  .cc-bar { display: none; }
  .find-slot form { display: flex; gap: 4px; }
  .find-slot .inp { width: 200px; min-height: 40px; border-radius: 999px; padding: 4px 14px; border-color: var(--border); }
  .find-slot .btn { min-height: 40px; min-width: 40px; width: 40px; padding: 0; border-radius: 50%; }
}

/* counters: the reference order (right to left) and look */
.kpi.s-total { order: 0; }
.kpi.s-offline { order: 1; }
.kpi.s-not_submitted { order: 2; }
.kpi.s-submitted { order: 3; }
.kpi.s-in_exam { order: 4; }
.kpi { justify-content: space-between; min-height: 96px; padding: 14px 20px; }
.kpi-ic { order: 2; width: 56px; height: 56px; background: transparent; }
.kpi-ic .ic { width: 44px; height: 44px; }
.kpi-l { font-size: 18px; color: var(--text); }
.kpi.s-in_exam .kpi-ic { background: transparent; color: var(--ok-solid); }
.kpi.s-submitted .kpi-ic { background: var(--done-solid); color: #FFFFFF; }
.kpi.s-submitted .kpi-ic .ic { width: 30px; height: 30px; }
.kpi.s-not_submitted .kpi-ic { background: var(--bad-bg); color: var(--bad-solid); }
.kpi.s-not_submitted .kpi-ic .ic { width: 32px; height: 32px; }
.kpi.s-offline .kpi-ic { background: transparent; color: var(--warn-solid); }
.kpi.s-total .kpi-ic { background: transparent; }
.kpi.s-in_exam .kpi-n { color: var(--text); }
.kpi.s-submitted .kpi-n { color: var(--done-text); }

/* cameras */
.cam-st { order: 0; }
.cam-name { order: 1; }
.cam-q { display: none; order: 2; margin-inline-start: auto; padding: 1px 8px; border-radius: 6px; background: rgba(15, 29, 51, 0.85); border: 1px solid rgba(255, 255, 255, 0.3); font-size: 12px; font-weight: 700; }
.cam-tile.is-big .cam-q { display: inline-flex; }
.cam-top { justify-content: flex-start; }
.cam-tile.is-big .cam-q { order: 0; margin-inline-start: 0; }
.cam-tile.is-big .cam-st { order: 3; margin-inline-start: auto; }
.cam-tile:not(.is-big) .cam-name { white-space: normal; padding: 1px 8px; border-radius: 6px; background: rgba(8, 18, 33, 0.72); }

/* map */
.cc-map .map-land { fill: #1A56A8; stroke: #7FB2EE; stroke-width: 4; }
.map-pt .halo { fill: #FFFFFF; opacity: 0.22; }
.map-pt .dot { stroke: #FFFFFF; stroke-width: 6; }
.map-count { margin-top: 8px; text-align: center; }
.map-l { display: block; font-size: 18px; font-weight: 700; }
.map-nrow { display: inline-flex; align-items: center; gap: 10px; }
.map-n { font-size: 30px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.map-ok { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--ok-solid); color: #FFFFFF; }
.map-ok .ic { width: 20px; height: 20px; }

/* hall status: value boxes on the left */
.stat-n { min-width: 72px; border: 1px solid var(--border); background: var(--tile-box); border-radius: 6px; color: var(--text); }
.stat-list .s-in_exam .stat-n, .stat-list .s-submitted .stat-n { background: var(--tile-box); color: var(--text); }
.stat-list .s-not_submitted .stat-n, .stat-list .s-offline .stat-n { background: var(--bad-bg); color: var(--bad-text); }

/* latest events: the icon on the right, the coloured text, the time in a box on the left */
.feed li { border: 0; min-height: 0; }
.feed .ev-link { align-items: center; padding: 6px 10px; margin-bottom: 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.feed .ev-dot { order: 0; background: transparent; border-color: transparent; }
.feed .ev-link .grow { order: 1; }
.feed .ev-time { order: 2; margin-inline-start: auto; min-width: 64px; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--tile-box); color: var(--text); font-weight: 700; text-align: center; }
.feed .sev-not_submitted strong { color: var(--bad-text); }
.feed .sev-offline strong { color: var(--warn-text); }
.feed .sev-submitted .ev-dot { color: var(--done-solid); }
.feed .sev-info .ev-dot { color: var(--ok-solid); }

/* the segmented status bar */
.sysbar { align-items: stretch; gap: 0; padding: 0; min-height: 64px; }
.sb-block { display: flex; align-items: center; gap: 12px; padding: 8px 20px; color: #FFFFFF; background: linear-gradient(to left, var(--nav-a), #123F80); }
.sb-ic { width: 32px; height: 32px; flex: none; }
.sb-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.sb-l, .sb-sub { font-size: 14px; color: #DCE8F6; }
.sb-big { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; color: #FFFFFF; }
.sb-sess { order: 0; flex: 1 1 100%; }
.sb-mid { order: 1; flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-around; gap: 6px 20px; padding: 8px 16px; }
.sb-clock { order: 2; flex: 1 1 100%; }
.sb-sess.st-half { background: #1769C2; }
.sb-sess.st-last10 { background: #8A5A00; }
.sb-sess.st-last5 { background: #C42F3B; }
.sb-sess[class*="st-"] .sb-t > span { color: #FFFFFF; }
.sess-slot:empty { display: none; }
.sess-slot .sel { display: block; }
.sess-slot .inp {
  min-height: 36px; padding: 2px 10px; max-width: 340px; border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.45); background: transparent; color: #FFFFFF; font-weight: 700;
}
.sess-slot .inp option { color: #172B4D; background: #FFFFFF; }
.sess-slot :focus-visible, .sb-block :focus-visible { outline-color: #FFFFFF; }
@media (min-width: 900px) {
  .sb-sess { flex: none; padding-inline-end: 48px; clip-path: polygon(40px 0, 100% 0, 100% 100%, 0 100%); }
  .sysbar { flex-wrap: nowrap; }
  .sb-mid { flex: 1 1 0; min-width: 0; }
  .sb-clock { flex: none; flex-direction: row-reverse; padding-inline-start: 48px; clip-path: polygon(0 0, 100% 0, calc(100% - 40px) 100%, 0 100%); }
}

/* the reference layout from 1280px: no title row or strips above the counters;
   row 2 is map | small cameras | large camera, row 3 events | hall | seats */
@media (min-width: 1280px) {
  .main[data-screen="home"] > .page-title, .main[data-screen="home"] > .upd { display: none; }
  .main[data-screen="home"] > .stack { margin-top: 0; }
  .cc { grid-template-columns: repeat(20, minmax(0, 1fr)); grid-template-areas: none; }
  /* hidden from sight only: the time bar is still announced (aria-live) */
  .cc-alerts { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .cc-alerts a { display: none; }
  .kpis { grid-row: 1; grid-column: 1 / -1; }
  .cc-map { grid-row: 2; grid-column: 1 / span 4; }
  .cc-cams { grid-row: 2; grid-column: 5 / span 16; }
  .cc-events { grid-row: 3; grid-column: 1 / span 7; }
  .cc-hall { grid-row: 3; grid-column: 8 / span 6; }
  .cc-seats { grid-row: 3; grid-column: 14 / span 7; }
  .kpi-s { display: none; }
  .cc-cams .cc-h, .cc-map .cc-h { display: none; }
  .cc-seats .cc-h a.btn { display: none; }
  .cams { grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(0, 2.8fr); }
  .cam-tile.is-big { grid-column: 3; grid-row: 1 / span 2; order: 0; aspect-ratio: auto; min-height: 0; }
  /* compact seats, 8 a row, as in the reference (a pointer screen) */
  .cc .seats { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
  .cc .seat { min-width: 0; min-height: 26px; aspect-ratio: auto; flex-direction: row; gap: 3px; padding: 2px 4px; border-radius: 6px; font-size: 14px; }
  .cc .seat .seat-ic { width: 12px; height: 12px; margin: 0; }
  .cc .legend { gap: 4px 10px; margin-top: 6px; font-size: 12px; }
  .cc .legend .seat { width: 16px; height: 16px; min-width: 16px; min-height: 16px; }
}
/* heights as in the reference (1672 x 941: everything above the status bar) */
@media (min-width: 1024px) {
  .hero-photo { background: linear-gradient(to bottom, var(--hero-sky), var(--hero-bg)); }
  .hero-photo img { object-fit: contain; object-position: center bottom; }
}
@media (min-width: 1280px) {
  .cc-map .map-count { margin-top: 4px; }
  .cc-map .map-l { font-size: 16px; }
  .cc-map .map-sub { margin-top: 6px; font-size: 12px; }
  .cc-map .map-sub h3 { font-size: 12px; margin-bottom: 4px; }
  .cc-map .chip { min-height: 32px; padding: 2px 10px; font-size: 12px; }
  .cc-map .map-sub p { margin-top: 4px; }
  .stat-list li { min-height: 28px; padding: 2px 0; }
  .stat-list .stat-n { padding: 0 8px; }
  .feed .ev-link { min-height: 40px; padding: 4px 10px; margin-bottom: 4px; }
  .feed .ev-time { padding: 2px 8px; }
  .cc-seats .cc-h, .cc-hall .cc-h, .cc-events .cc-h { margin-bottom: 8px; }
  .cc-seats .cc-h h2, .cc-hall .cc-h h2, .cc-events .cc-h h2 { font-size: 16px; }
  .cc-seats .cc-h .inp { min-height: 36px; padding: 2px 10px; font-size: 14px; }
  .cc > .card { padding: 12px 14px; }
  .sysbar { min-height: 0; }
  .sb-block { padding-top: 6px; padding-bottom: 6px; }
  .sb-sess .sb-t { display: grid; grid-template-columns: auto auto; align-items: baseline; column-gap: 12px; }
  .sb-sess .sess-slot, .sb-sess #sb-sess-name { grid-column: 1 / -1; }
  .sess-slot .inp { min-height: 32px; }
  .sb-big { font-size: 20px; }
  .sb-mid { padding: 4px 16px; }
}
.stat-more { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 8px; font-size: 12px; color: var(--text-2); }
.stat-more .row { gap: 6px; }
.stat-more .pill { font-size: 12px; padding: 0 8px; }
.map-abroad { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.map-abroad h3 { margin: 0; }
@media (min-width: 1280px) {
  .cc-cams .cam-meta { display: none; }
  .cc-map .map-n { font-size: 24px; }
  .cc-map .map-ok { width: 28px; height: 28px; }
  .cc-events .feed { max-height: 196px; }
}
@media (min-width: 1280px) {
  .cc-seats .cc-h { flex-wrap: nowrap; }
  .cc-seats .cc-h h2 { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cc-seats .cc-h .row { flex-wrap: nowrap; flex: 0 1 180px; min-width: 0; }
  .cc-seats .cc-h .inp { max-width: 180px; }
  /* the counters above carry the colour key: here only the ring and the dot keep a key */
  .cc .legend li:nth-child(-n+6) { display: none; }
  .cc .legend:not(:has(li:nth-child(7))) { display: none; }
  .cc-map .map-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
  .cc-map .map-sub p { margin: 0; }
}
@media (min-width: 1024px) {
  .hero-in { min-height: 150px; }
}
@media (min-width: 1280px) {
  .main[data-screen="home"] { padding-top: 12px; }
  .cc { gap: 12px; }
  .cc-map .map-svg { max-height: 140px; }
}
@media (min-width: 1280px) {
  .page-d .side { padding: 8px; }
  .page-d .side a { min-height: 56px; padding: 4px; gap: 2px; }
  .page-d .side a .ic { width: 24px; height: 24px; }
  .page-d .side-fold { min-height: 40px; margin-bottom: 2px; }
  .main[data-screen="home"] { padding-bottom: 6px; }
}
@media (min-width: 1024px) {
  /* the shell fills the screen between the header and the status bar, whatever their heights */
  #app-view:not([hidden]) { display: flex; flex-direction: column; min-height: 100vh; }
  .page-d .shell { flex: 1 0 auto; min-height: 0; }
  .page-d .side { align-self: stretch; min-height: 0; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .hero-title .cc-title strong { font-size: 24px; }
  .hero-title .cc-title span { font-size: 16px; }
  .hero-in .hero-title { padding: 10px 16px; }
  .hero-in .hero-brand { padding-inline-start: 56px; padding-inline-end: 16px; gap: 10px; }
  .hero-in .hero-brand::before { clip-path: polygon(0 0, 100% 0, calc(100% - 44px) 100%, 0 100%); }
  .hero-brand .logo-lg { width: 52px; height: 58px; }
  .hero-brand .brand-t strong { font-size: 18px; }
  .hero-brand .brand-en { font-size: 14px; }
  .hero-photo { min-width: 0; }
  .who-t span { display: none; }
}
/* home: the incomplete list is one small line from 1280px (no scrollbar track, the seats
   2px lower), so the page still fits the screen in the last 10 minutes */
@media (min-width: 1280px) {
  .cc .inc-list { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
  .cc .inc-list h3 { flex: none; margin: 0; font-size: 12px; }
  .cc .inc-chips { flex-wrap: nowrap; overflow-x: auto; min-width: 0; scrollbar-width: none; }
  .cc .inc-chips > li { flex: none; }
  .cc .inc-chip { min-height: 28px; padding: 0 8px; font-size: 12px; }
  .cc .inc-chip:focus-visible { outline-offset: -3px; }
  .cc .seatmap:has(.inc-list) > .seats .seat { min-height: 24px; }
}
