/* สนามสอบเข้า ม.1 — shared design system
   navy + gold (school-uniform feel), Prompt for headings, IBM Plex Sans Thai Looped for reading */

:root {
  --navy-950: #0b1030;
  --navy-900: #111845;
  --navy-800: #19226b;
  --navy-700: #1f2b8c;
  --navy-600: #3343d1;
  --navy-500: #4b5ae6;
  --navy-100: #e8ebff;
  --navy-50: #f3f4ff;
  --gold: #ffb703;
  --gold-2: #ffd36b;
  --gold-ink: #6b4a00;

  --bg: #f3f5fb;
  --surface: #ffffff;
  --surface-2: #f8f9fd;
  --ink: #161a33;
  --ink-2: #555b7a;
  --ink-3: #8a8fa9;
  --line: #e4e7f1;
  --line-2: #d3d8e8;
  --grid: #eceef5;
  --axis: #c2c6d4;

  /* status (never used as a series colour; always with icon + label) */
  --good: #0aac23;
  --good-ink: #006c10;
  --good-bg: #e7f7ea;
  --warn: #fbb315;
  --warn-ink: #7a5200;
  --warn-bg: #fff6df;
  --serious: #f18a59;
  --bad: #dc3c3d;
  --bad-ink: #a51f20;
  --bad-bg: #fdecec;

  /* subjects (validated categorical order) */
  --s-math: #257de0;
  --s-science: #00a888;
  --s-thai: #ec4647;
  --s-english: #6a4ce2;
  --s-social: #f47230;

  --radius: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(17, 24, 69, .06);
  --shadow: 0 1px 2px rgba(17, 24, 69, .05), 0 10px 30px -8px rgba(17, 24, 69, .14);
  --shadow-lg: 0 2px 6px rgba(17, 24, 69, .06), 0 24px 60px -16px rgba(17, 24, 69, .28);
  --font-head: 'Prompt', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'IBM Plex Sans Thai Looped', 'Prompt', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.3; margin: 0 0 .4em; font-weight: 600; letter-spacing: -.005em; }
h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h2 { font-size: clamp(1.25rem, 2.2vw, 1.55rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .8em; }
a { color: var(--navy-600); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: .875rem; }
.tiny { font-size: .78rem; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pre { white-space: pre-line; }

/* ---------- background ---------- */
.bg-mesh { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: radial-gradient(1200px 600px at 10% -10%, #e3e7ff 0%, transparent 60%),
              radial-gradient(900px 500px at 110% 10%, #fff1cf 0%, transparent 55%),
              var(--bg); }
.bg-mesh .blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; }
.bg-mesh .b1 { width: 420px; height: 420px; background: #c9d0ff; left: -120px; top: 30%; }
.bg-mesh .b2 { width: 360px; height: 360px; background: #ffe2a3; right: -100px; top: -60px; }
.bg-mesh .b3 { width: 300px; height: 300px; background: #c7f0e6; right: 15%; bottom: -120px; }

/* ---------- buttons ---------- */
.btn {
  --b-bg: var(--surface); --b-ink: var(--ink); --b-line: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 44px; padding: .55em 1.15em; border-radius: 12px;
  border: 1.5px solid var(--b-line); background: var(--b-bg); color: var(--b-ink);
  font-family: var(--font-head); font-weight: 500; font-size: .97rem; line-height: 1.2;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), background .15s, border-color .15s, opacity .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); border-color: var(--axis); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:focus-visible, .choice:focus-visible, .nav-cell:focus-visible, .tab:focus-visible, .seg button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.btn-primary { --b-bg: linear-gradient(135deg, var(--navy-700), var(--navy-500)); --b-ink: #fff; border-color: transparent; background: var(--b-bg); box-shadow: 0 6px 18px -6px rgba(51, 67, 209, .6); }
.btn-primary:hover { box-shadow: 0 10px 24px -8px rgba(51, 67, 209, .75); border-color: transparent; }
.btn-gold { background: linear-gradient(135deg, #ffc93d, var(--gold)); color: #2b1d00; border-color: transparent; box-shadow: 0 6px 18px -6px rgba(255, 183, 3, .7); }
.btn-gold:hover { border-color: transparent; }
.btn-danger { --b-ink: var(--bad-ink); --b-line: #f3c2c2; }
.btn-danger:hover { background: var(--bad-bg); border-color: #eaa5a5; }
.btn-danger-solid { background: var(--bad); color: #fff; border-color: transparent; }
.btn-ghost { --b-bg: transparent; --b-line: transparent; }
.btn-ghost:hover { background: rgba(17, 24, 69, .05); box-shadow: none; }
.btn-lg { min-height: 54px; padding: .7em 1.6em; font-size: 1.08rem; border-radius: 14px; }
.btn-sm { min-height: 34px; padding: .3em .75em; font-size: .86rem; border-radius: 10px; }
.btn-block { width: 100%; }
.icon-btn { width: 40px; height: 40px; padding: 0; border-radius: 12px; }

/* ---------- cards & layout ---------- */
.card { background: var(--surface); border: 1px solid rgba(17, 24, 69, .06); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: clamp(18px, 3vw, 28px); }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-title h2, .card-title h3 { margin: 0; }
.container { width: min(1240px, 100% - 32px); margin-inline: auto; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }
.divider { height: 1px; background: var(--line); margin: 16px 0; border: 0; }

/* ---------- form ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span, .label { font-family: var(--font-head); font-size: .9rem; font-weight: 500; color: var(--ink-2); }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: .6em .9em; border-radius: 12px;
  border: 1.5px solid var(--line-2); background: var(--surface); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { min-height: 110px; resize: vertical; line-height: 1.6; }
.input:focus { border-color: var(--navy-500); box-shadow: 0 0 0 4px rgba(75, 90, 230, .15); }
.input-group { position: relative; }
.input-group .input { padding-right: 46px; }
.input-group .peek { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.form-error { color: var(--bad-ink); background: var(--bad-bg); border-radius: 10px; padding: .5em .8em; font-size: .9rem; margin-bottom: 12px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 6px 0; }
.check input { width: 20px; height: 20px; accent-color: var(--navy-600); }

.seg { display: inline-flex; background: #eceef7; border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; border-radius: 9px; padding: .45em 1em; cursor: pointer; font-family: var(--font-head); font-weight: 500; color: var(--ink-2); min-height: 36px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- chips & pills ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: .2em .7em; border-radius: 999px; font-size: .84rem; background: #eef0f7; color: var(--ink-2); font-family: var(--font-head); font-weight: 500; white-space: nowrap; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.chip-subject .dot { background: var(--c, var(--navy-500)); }
.chip-good { background: var(--good-bg); color: var(--good-ink); }
.chip-warn { background: var(--warn-bg); color: var(--warn-ink); }
.chip-bad { background: var(--bad-bg); color: var(--bad-ink); }
.chip-navy { background: var(--navy-100); color: var(--navy-700); }
.chip svg { width: 14px; height: 14px; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 rgba(10, 172, 35, .5); animation: ping 1.8s infinite; flex: none; }
.live-dot.off { background: var(--ink-3); animation: none; }
.live-dot.warn { background: var(--warn); animation: none; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(10, 172, 35, .45); } 70% { box-shadow: 0 0 0 10px rgba(10, 172, 35, 0); } 100% { box-shadow: 0 0 0 0 rgba(10, 172, 35, 0); } }

/* ---------- toasts & modal ---------- */
.toasts { position: fixed; z-index: 1000; left: 50%; top: 14px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100% - 24px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 14px; background: var(--navy-900); color: #fff; box-shadow: var(--shadow-lg); font-size: .95rem; }
.toast svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.toast.good svg { color: #5ee07a; }
.toast.warn { background: #3a2a00; }
.toast.warn svg { color: var(--gold); }
.toast.bad { background: #4a0f10; }
.toast.bad svg { color: #ff8d8d; }
.toast.announce { background: linear-gradient(135deg, var(--navy-800), var(--navy-600)); border: 1px solid rgba(255, 255, 255, .15); }
.toast.announce b { color: var(--gold-2); display: block; font-family: var(--font-head); font-weight: 600; }

.modal-back { position: fixed; inset: 0; z-index: 900; background: rgba(11, 16, 48, .45); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg); padding: clamp(20px, 3vw, 28px); }
.modal.wide { width: min(980px, 100%); }
.modal h2 { margin-bottom: 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.modal-close { float: right; margin: -6px -6px 0 0; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; background: #eceef7; padding: 4px; border-radius: 14px; }
.tab { flex: 1; border: 0; background: transparent; border-radius: 11px; padding: .6em 1em; cursor: pointer; font-family: var(--font-head); font-weight: 500; color: var(--ink-2); min-height: 42px; }
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat { background: var(--surface); border: 1px solid rgba(17, 24, 69, .06); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow-sm); }
.stat .label { font-size: .84rem; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.stat .value { font-family: var(--font-head); font-size: 1.9rem; font-weight: 600; line-height: 1.15; margin-top: 2px; }
.stat .sub { font-size: .8rem; color: var(--ink-3); }

/* ---------- progress ---------- */
.bar { height: 8px; border-radius: 999px; background: #eceef5; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--c, var(--navy-500)); width: 0; transition: width .5s var(--ease); }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 14px; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-family: var(--font-head); font-weight: 500; color: var(--ink-2); font-size: .82rem; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--ink); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .3s; }
.table tbody tr:hover { background: var(--surface-2); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.clickable { cursor: pointer; }

/* ---------- tooltip (charts) ---------- */
.viz-tip { position: fixed; z-index: 1100; pointer-events: none; background: var(--navy-950); color: #fff; padding: 8px 12px; border-radius: 10px; font-size: .84rem; line-height: 1.45; box-shadow: var(--shadow-lg); max-width: 280px; opacity: 0; transition: opacity .12s; }
.viz-tip b { font-family: var(--font-head); font-weight: 600; }
.viz-tip .k { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- charts ---------- */
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar { display: grid; grid-template-columns: minmax(84px, 140px) minmax(0, 1fr) 64px; align-items: center; gap: 12px; }
.hbar .name { display: flex; align-items: center; gap: 8px; font-family: var(--font-head); font-weight: 500; font-size: .92rem; min-width: 0; }
.hbar .name .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; background: var(--c); }
.hbar .name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { position: relative; height: 22px; border-left: 1px solid var(--axis); }
.hbar .track .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--c); border-radius: 0 4px 4px 0; }
.hbar .track .avg { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 2px; }
.hbar .track .grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--grid); }
.hbar .val { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-head); font-weight: 500; font-size: .92rem; }
.hbars.compact .hbar { grid-template-columns: minmax(110px, 220px) minmax(0, 1fr) 54px; }
.hbars.compact .track { height: 14px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .82rem; color: var(--ink-2); margin-top: 12px; }
.legend .key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -2px; background: var(--c); }
.legend .key.tick { width: 3px; height: 14px; border-radius: 2px; background: var(--ink); }

.cols { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: end; gap: 2px; height: 200px; padding-left: 30px; border-bottom: 1px solid var(--axis); }
.cols .gl { position: absolute; left: 30px; right: 0; height: 1px; background: var(--grid); }
.cols .gl span { position: absolute; left: -30px; top: -9px; font-size: .72rem; color: var(--ink-3); width: 26px; text-align: right; font-variant-numeric: tabular-nums; }
.cols .col { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; cursor: default; }
.cols .col i { display: block; width: min(100%, 24px); background: var(--c, var(--navy-500)); border-radius: 4px 4px 0 0; height: 0; min-height: 0; }
.cols .col:hover i { filter: brightness(1.1); }
.cols-x { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; padding-left: 30px; margin-top: 6px; font-size: .72rem; color: var(--ink-3); text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- spinner / skeleton ---------- */
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--navy-100); border-top-color: var(--navy-600); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center-screen { min-height: 70vh; display: grid; place-items: center; }

/* ---------- top bar (shared) ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .82); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid rgba(17, 24, 69, .07); }
.topbar-inner { display: flex; align-items: center; gap: 14px; min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 600; text-decoration: none; color: var(--ink); min-width: 0; }
.brand .logo { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: linear-gradient(135deg, var(--navy-700), var(--navy-500)); color: #fff; font-size: .95rem; box-shadow: 0 6px 14px -6px rgba(51, 67, 209, .7); position: relative; }
.brand .logo::after { content: ''; position: absolute; right: -3px; top: -3px; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); border: 2px solid #fff; }
.brand .brand-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spacer { flex: 1; }
.user-pill { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .88rem; max-width: 260px; }
.user-pill .av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--navy-100); color: var(--navy-700); font-family: var(--font-head); font-weight: 600; flex: none; }
.user-pill .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =================================================================== */
/* login                                                               */
/* =================================================================== */
.page-login { overflow-x: hidden; }
.floaters { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.floaters span { position: absolute; font-family: var(--font-head); font-weight: 600; color: var(--navy-600); opacity: .1; user-select: none; will-change: transform; }
.login-wrap { width: min(1160px, 100% - 32px); margin: 0 auto; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(24px, 5vw, 72px); align-items: center; padding: 40px 0; }
.hero .brand { margin-bottom: 28px; }
.hero-title { font-size: clamp(2.4rem, 6vw, 4.4rem); line-height: 1.12; font-weight: 700; margin: 0 0 12px; letter-spacing: -.02em; }
.hero-title .line { display: block; }
.hero-title .hl { background: linear-gradient(120deg, var(--navy-700), var(--navy-500) 50%, #7b61ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-title .gold { position: relative; display: inline-block; }
.hero-title .gold::after { content: ''; position: absolute; left: 0; right: 0; bottom: .08em; height: .22em; background: var(--gold); opacity: .55; border-radius: 4px; z-index: -1; transform-origin: left; }
.hero-sub { font-size: 1.08rem; color: var(--ink-2); max-width: 32em; }
.hero-stats { display: flex; gap: 12px; margin: 26px 0; flex-wrap: wrap; }
.hero-stats > div { background: var(--surface); border: 1px solid rgba(17, 24, 69, .06); box-shadow: var(--shadow); border-radius: 18px; padding: 12px 20px; min-width: 104px; }
.hero-stats b { display: block; font-family: var(--font-head); font-size: 2rem; line-height: 1.1; font-weight: 700; color: var(--navy-700); }
.hero-stats span { color: var(--ink-2); font-size: .9rem; }
.subject-row { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.subject-row li { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; background: var(--surface); border-radius: 999px; border: 1px solid var(--line); font-family: var(--font-head); font-weight: 500; font-size: .9rem; }
.subject-row .ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff; }
.subject-row .ic svg { width: 16px; height: 16px; }
.auth { padding: clamp(22px, 3.4vw, 36px); position: relative; }
.auth h2 { margin-bottom: 4px; }
.auth .tabs { margin-bottom: 22px; }
.auth-foot { margin-top: 16px; font-size: .86rem; color: var(--ink-3); text-align: center; }
@media (max-width: 900px) {
  .login-wrap { grid-template-columns: minmax(0, 1fr); padding: 24px 0 40px; gap: 22px; min-height: auto; }
  .hero .brand { margin-bottom: 16px; }
  .hero-stats { margin: 16px 0; }
  .hero-stats > div { padding: 10px 16px; min-width: 88px; }
  .hero-stats b { font-size: 1.6rem; }
}

/* =================================================================== */
/* exam                                                                */
/* =================================================================== */
.exam-top .topbar-inner { gap: 12px; }
.timer { display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--navy-950); color: #fff; font-family: var(--font-head); box-shadow: 0 8px 20px -10px rgba(11, 16, 48, .7); flex: none; transition: background .3s; }
.timer svg.ring { width: 34px; height: 34px; transform: rotate(-90deg); flex: none; }
.timer .ring .bg { stroke: rgba(255, 255, 255, .15); }
.timer .ring .fg { stroke: var(--gold); stroke-linecap: round; transition: stroke-dashoffset .9s linear, stroke .3s; }
.timer .t { font-size: 1.25rem; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .02em; color: var(--gold-2); min-width: 4.6ch; }
.timer .lbl { font-size: .7rem; color: rgba(255, 255, 255, .6); line-height: 1; display: block; }
.timer.warn { background: #5a3d00; }
.timer.warn .t { color: #ffe08a; }
.timer.danger { background: #7a1414; animation: tpulse 1s ease-in-out infinite; }
.timer.danger .t { color: #fff; }
.timer.danger .ring .fg { stroke: #fff; }
@keyframes tpulse { 50% { box-shadow: 0 0 0 6px rgba(220, 60, 61, .25); } }

.save-ind { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--ink-3); white-space: nowrap; }
.save-ind svg { width: 16px; height: 16px; }
.save-ind.saving { color: var(--ink-2); }
.save-ind.saved { color: var(--good-ink); }
.save-ind.offline { color: var(--bad-ink); }

.subject-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0; scrollbar-width: none; }
.subject-tabs::-webkit-scrollbar { display: none; }
.stab { flex: none; display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-family: var(--font-head); text-align: left; transition: border-color .15s, box-shadow .15s, transform .15s; }
.stab:hover { transform: translateY(-1px); }
.stab .ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--c); color: #fff; flex: none; }
.stab .ic svg { width: 18px; height: 18px; }
.stab b { display: block; font-weight: 500; font-size: .9rem; line-height: 1.2; }
.stab small { display: block; font-size: .75rem; color: var(--ink-3); line-height: 1.2; font-variant-numeric: tabular-nums; }
.stab .mini { display: block; width: 64px; height: 4px; border-radius: 4px; background: #eceef5; margin-top: 4px; overflow: hidden; }
.stab .mini i { display: block; height: 100%; width: 0; background: var(--c); border-radius: 4px; transition: width .4s var(--ease); }
.stab.active { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 16%, transparent); }

.exam-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; padding: 18px 0 110px; }
.qcard { position: relative; overflow: hidden; }
.qcard::before { content: ''; position: absolute; left: 0; top: 0; right: 0; height: 5px; background: var(--c, var(--navy-500)); }
.qhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.qno { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; background: var(--navy-950); color: #fff; border-radius: 12px; padding: .2em .75em; }
.qno small { font-weight: 400; opacity: .6; font-size: .8em; }
.flag-btn[aria-pressed="true"] { background: var(--warn-bg); border-color: #f5d27a; color: var(--warn-ink); }
.passage { background: #fbf8ef; border: 1px solid #efe5c8; border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; white-space: pre-line; font-size: .98rem; line-height: 1.8; max-height: 46vh; overflow: auto; }
.passage .plabel { display: block; font-family: var(--font-head); font-size: .8rem; color: var(--gold-ink); font-weight: 500; margin-bottom: 4px; }
.qtext { font-size: clamp(1.05rem, 1.6vw, 1.2rem); line-height: 1.85; white-space: pre-line; margin-bottom: 18px; font-weight: 500; }
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice { display: flex; gap: 14px; align-items: center; width: 100%; text-align: left; padding: 12px 16px 12px 12px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; min-height: 60px; font-size: 1.02rem; line-height: 1.6; -webkit-tap-highlight-color: transparent; }
.choice:hover { border-color: #c5cbef; background: #fafbff; }
.choice .letter { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: #eef0fa; color: var(--navy-700); font-family: var(--font-head); font-weight: 600; transition: background .15s, color .15s; }
.choice .ctext { flex: 1; min-width: 0; white-space: pre-line; overflow-wrap: anywhere; }
.choice .tick { flex: none; width: 24px; height: 24px; color: var(--navy-600); opacity: 0; }
.choice.selected { border-color: var(--navy-600); background: #f2f4ff; box-shadow: 0 0 0 4px rgba(75, 90, 230, .12); }
.choice.selected .letter { background: var(--navy-600); color: #fff; }
.choice.selected .tick { opacity: 1; }
.choice.correct { border-color: var(--good); background: var(--good-bg); }
.choice.correct .letter { background: var(--good); color: #fff; }
.choice.wrong { border-color: var(--bad); background: var(--bad-bg); }
.choice.wrong .letter { background: var(--bad); color: #fff; }
.choice[disabled] { cursor: default; }
.qnav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 22px; }
.kbd-hint { font-size: .78rem; color: var(--ink-3); text-align: center; margin-top: 12px; }
.kbd { display: inline-block; padding: 0 .4em; border-radius: 5px; border: 1px solid var(--line-2); background: var(--surface-2); font-family: var(--font-head); font-size: .75rem; }

.navpanel { position: sticky; top: calc(var(--header-h) + 70px); max-height: calc(100vh - var(--header-h) - 90px); overflow: auto; }
.navpanel .card-pad { padding: 18px; }
.nav-group + .nav-group { margin-top: 14px; }
.nav-group h4 { display: flex; align-items: center; gap: 8px; font-size: .86rem; margin-bottom: 8px; font-weight: 500; }
.nav-group h4 .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.nav-group h4 small { margin-left: auto; color: var(--ink-3); font-weight: 400; font-variant-numeric: tabular-nums; }
.nav-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.nav-cell { position: relative; aspect-ratio: 1.15; border-radius: 9px; border: 1.5px solid var(--line); background: var(--surface); font-size: .8rem; font-family: var(--font-head); cursor: pointer; color: var(--ink-2); font-variant-numeric: tabular-nums; padding: 0; transition: background .15s, border-color .15s, color .15s; }
.nav-cell:hover { border-color: var(--navy-500); }
.nav-cell.answered { background: var(--navy-600); border-color: var(--navy-600); color: #fff; }
.nav-cell.flagged::after { content: ''; position: absolute; top: -4px; right: -4px; width: 11px; height: 11px; border-radius: 50%; background: var(--gold); border: 2px solid var(--surface); }
.nav-cell.current { outline: 2.5px solid var(--gold); outline-offset: 1px; }
.nav-legend { display: flex; flex-wrap: wrap; gap: 10px 14px; font-size: .76rem; color: var(--ink-2); margin-top: 14px; }
.nav-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; border: 1.5px solid var(--line); vertical-align: -2px; margin-right: 5px; }
.nav-legend i.a { background: var(--navy-600); border-color: var(--navy-600); }
.nav-legend i.f { background: var(--gold); border-color: var(--gold); border-radius: 50%; }
.nav-legend i.c { outline: 2px solid var(--gold); }

.bottombar { display: none; }
@media (max-width: 1000px) {
  .exam-layout { grid-template-columns: minmax(0, 1fr); padding-bottom: 96px; }
  .navpanel { display: none; }
  .navpanel.open { display: block; position: fixed; left: 0; right: 0; bottom: 0; top: auto; max-height: 75vh; z-index: 80; border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg); }
  .bottombar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .92); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .bottombar .btn { flex: 1; }
  .qnav { display: none; }
  .sheet-back { position: fixed; inset: 0; background: rgba(11, 16, 48, .4); z-index: 75; }
}
@media (max-width: 640px) {
  :root { --header-h: 58px; }
  .exam-top .brand-text, .exam-top .save-ind span { display: none; }
  .timer { padding: 4px 10px 4px 4px; gap: 6px; }
  .timer svg.ring { width: 28px; height: 28px; }
  .timer .t { font-size: 1.05rem; }
  .timer .lbl { display: none; }
  .choice { padding: 10px 12px 10px 10px; gap: 10px; min-height: 56px; }
  .choice .letter { width: 34px; height: 34px; }
  .card-pad { padding: 18px 16px; }
  .exam-submit-label { display: none; }
}

/* lobby */
.lobby { padding: 28px 0 60px; }
.lobby-hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 22px; align-items: stretch; }
@media (max-width: 900px) { .lobby-hero { grid-template-columns: minmax(0, 1fr); } }
.subject-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 18px 0; }
.scard { border-radius: 16px; padding: 14px; border: 1px solid var(--line); background: var(--surface); position: relative; overflow: hidden; }
.scard::after { content: ''; position: absolute; right: -24px; bottom: -24px; width: 80px; height: 80px; border-radius: 50%; background: var(--c); opacity: .09; }
.scard .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--c); color: #fff; margin-bottom: 8px; }
.scard .ic svg { width: 22px; height: 22px; }
.scard b { display: block; font-family: var(--font-head); font-weight: 600; }
.scard small { color: var(--ink-2); }
@media (max-width: 560px) {
  .subject-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
  .scard { padding: 10px 12px; display: flex; align-items: center; gap: 10px; }
  .scard .ic { width: 32px; height: 32px; border-radius: 10px; margin-bottom: 0; flex: none; }
  .scard .ic svg { width: 18px; height: 18px; }
  .scard b { font-size: .92rem; line-height: 1.25; }
}
.rules { margin: 0; padding-left: 1.2em; color: var(--ink-2); }
.rules li { margin-bottom: 6px; }
.status-box { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 14px; min-height: 320px; position: relative; overflow: hidden; }
.status-box .big-icon { width: 84px; height: 84px; border-radius: 26px; display: grid; place-items: center; background: var(--navy-50); color: var(--navy-600); }
.status-box .big-icon svg { width: 44px; height: 44px; }
.countdown { font-family: var(--font-head); font-weight: 700; font-size: clamp(4rem, 12vw, 7rem); line-height: 1; color: var(--navy-700); font-variant-numeric: tabular-nums; }
.status-box .ring-deco { position: absolute; width: 380px; height: 380px; border-radius: 50%; border: 2px dashed var(--navy-100); pointer-events: none; }

/* result */
.result { padding: 26px 0 70px; }
.score-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(20px, 4vw, 44px); align-items: center; }
@media (max-width: 760px) { .score-hero { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; } }
.score-ring { position: relative; width: 210px; height: 210px; }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring .bg { stroke: var(--navy-50); }
.score-ring .fg { stroke: url(#scoreGrad); stroke-linecap: round; }
.score-ring .mid { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.score-ring .mid b { font-family: var(--font-head); font-size: 3.6rem; line-height: 1; font-weight: 700; color: var(--navy-800); font-variant-numeric: tabular-nums; }
.score-ring .mid span { color: var(--ink-3); font-size: .95rem; }
.badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
@media (max-width: 760px) { .badges { justify-content: center; } }
.badge { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 8px 14px; min-width: 96px; }
.badge .label { font-size: .78rem; }
.badge b { display: block; font-family: var(--font-head); font-size: 1.3rem; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.topic-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.topic-list li { display: grid; grid-template-columns: minmax(0, 1fr) 90px 44px; gap: 10px; align-items: center; font-size: .92rem; }
.topic-list .tn { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topic-list .tn .sw { width: 8px; height: 8px; border-radius: 2px; flex: none; background: var(--c); }
.topic-list .tn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-list .tv { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-head); font-weight: 500; }
.review-item { border-top: 1px solid var(--line); padding: 18px 0; }
.review-item:first-child { border-top: 0; }
.review-item .choices { gap: 8px; }
.review-item .choice { min-height: 48px; font-size: .96rem; }
.explain { margin-top: 12px; background: var(--navy-50); border-radius: 12px; padding: 10px 14px; font-size: .93rem; }
.explain b { font-family: var(--font-head); font-weight: 600; color: var(--navy-700); }

/* =================================================================== */
/* admin                                                               */
/* =================================================================== */
.admin-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--navy-950); color: #cfd3ef; padding: 18px 14px; display: flex; flex-direction: column; gap: 6px; }
.side .brand { color: #fff; margin: 4px 6px 18px; }
.side .brand .logo::after { border-color: var(--navy-950); }
.side-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: #cfd3ef; text-decoration: none; font-family: var(--font-head); font-weight: 500; border: 0; background: transparent; cursor: pointer; text-align: left; width: 100%; font-size: .96rem; }
.side-link svg { width: 20px; height: 20px; flex: none; opacity: .85; }
.side-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-link[aria-current="page"] { background: linear-gradient(135deg, rgba(75, 90, 230, .9), rgba(51, 67, 209, .9)); color: #fff; box-shadow: 0 8px 18px -10px rgba(75, 90, 230, .9); }
.side .foot { margin-top: auto; font-size: .8rem; color: #8b91bd; padding: 8px; }
.admin-main { padding: 22px clamp(14px, 3vw, 34px) 60px; min-width: 0; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-head h1 { margin: 0; font-size: clamp(1.4rem, 2.4vw, 1.8rem); }
.mobile-nav { display: none; }
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .mobile-nav { display: flex; position: sticky; top: 0; z-index: 60; gap: 4px; overflow-x: auto; background: var(--navy-950); padding: 8px; scrollbar-width: none; }
  .mobile-nav::-webkit-scrollbar { display: none; }
  .mobile-nav .side-link { flex: none; width: auto; padding: 8px 12px; font-size: .88rem; }
}
.control-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 1100px) { .control-grid { grid-template-columns: minmax(0, 1fr); } }
.status-banner { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 16px; }
.status-banner .big { font-family: var(--font-head); font-weight: 600; font-size: 1.15rem; }
.status-banner.on { background: var(--good-bg); border-color: #bfe8c7; }
.status-banner.sync { background: var(--navy-50); border-color: var(--navy-100); }
.status-banner .icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--surface); flex: none; }
.status-banner .icon svg { width: 24px; height: 24px; }
.ctl-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.ctl-row .input { width: auto; min-height: 40px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters .chip { cursor: pointer; border: 1.5px solid transparent; min-height: 32px; }
.filters .chip[aria-pressed="true"] { background: var(--navy-950); color: #fff; }
.filters .input { max-width: 260px; min-height: 38px; }
.live-name b { display: block; font-family: var(--font-head); font-weight: 500; line-height: 1.3; }
.live-name small { color: var(--ink-3); }
.prog { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.prog .bar { flex: 1; }
.prog span { font-size: .82rem; color: var(--ink-2); font-variant-numeric: tabular-nums; min-width: 52px; }
tr.flash { background: #fff7dc !important; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.score-big { font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.insights { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.insights li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: .94rem; }
.insights li svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.insights li.good svg { color: var(--good); }
.insights li.warn svg { color: #d48f00; }
.insights li.bad svg { color: var(--bad); }
.insights li.info svg { color: var(--navy-500); }
.pd { font-variant-numeric: tabular-nums; font-family: var(--font-head); font-weight: 500; }
.flagset { display: flex; gap: 4px; flex-wrap: wrap; }
.scatter-wrap { position: relative; }
.scatter-wrap svg { width: 100%; height: auto; display: block; overflow: visible; }
.qlist-item { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; background: var(--surface); }
.qlist-item + .qlist-item { margin-top: 10px; }
.qlist-item .q { white-space: pre-line; margin: 6px 0 8px; }
.qlist-item ol { margin: 0; padding-left: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; font-size: .92rem; }
@media (max-width: 700px) { .qlist-item ol { grid-template-columns: minmax(0, 1fr); } }
.qlist-item ol li.ok { color: var(--good-ink); font-weight: 600; }
.cred-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.cred { border: 1.5px dashed var(--line-2); border-radius: 14px; padding: 12px 14px; background: var(--surface); break-inside: avoid; }
.cred b { font-family: var(--font-head); display: block; }
.cred code { font-size: 1.05rem; font-weight: 600; background: var(--navy-50); padding: 1px 6px; border-radius: 6px; }
.choice-dist { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.empty { text-align: center; padding: 40px 16px; color: var(--ink-3); }
.empty svg { width: 46px; height: 46px; opacity: .5; margin-bottom: 8px; }

@media print {
  .side, .mobile-nav, .admin-head .row, .no-print, .topbar, .toasts { display: none !important; }
  .admin-shell { display: block; }
  body { background: #fff; }
  .card { box-shadow: none; border: 0; }
  .print-only-area { display: block !important; }
}

/* =================================================================== */
/* board (projector, dark)                                             */
/* =================================================================== */
.page-board { background: var(--navy-950); color: #e9ecff; min-height: 100vh; overflow-x: hidden; }
.page-board .bg-board { position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(900px 600px at 15% 0%, rgba(75, 90, 230, .35), transparent 60%),
              radial-gradient(800px 500px at 100% 100%, rgba(255, 183, 3, .14), transparent 60%); }
.board { position: relative; z-index: 1; width: min(1600px, 100% - 40px); margin: 0 auto; padding: 26px 0 40px; }
.board-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 22px; }
.board-head h1 { font-size: clamp(1.6rem, 3vw, 2.6rem); margin: 0; color: #fff; }
.board-head .sub { color: #9aa1d4; font-size: 1rem; }
.board-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 1000px) { .board-grid { grid-template-columns: minmax(0, 1fr); } }
.bcard { background: rgba(255, 255, 255, .045); border: 1px solid rgba(255, 255, 255, .08); border-radius: 22px; padding: clamp(16px, 2vw, 24px); backdrop-filter: blur(6px); }
.bcard h2 { color: #fff; font-size: 1.15rem; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.bstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
@media (max-width: 800px) { .bstats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.bstat { background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); border-radius: 18px; padding: 14px 18px; }
.bstat .label { color: #9aa1d4; font-size: .9rem; display: flex; align-items: center; gap: 8px; }
.bstat .value { font-family: var(--font-head); font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; line-height: 1.1; color: #fff; font-variant-numeric: tabular-nums; }
.bstat .value small { font-size: .45em; color: #9aa1d4; font-weight: 500; }
.lb { list-style: none; padding: 0; margin: 0; position: relative; }
.lb li { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 14px; border-radius: 16px; background: rgba(255, 255, 255, .04); margin-bottom: 8px; border: 1px solid rgba(255, 255, 255, .05); }
.lb .rk { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; background: rgba(255, 255, 255, .08); color: #fff; }
.lb li.r1 .rk { background: linear-gradient(135deg, #ffe08a, #ffb703); color: #3a2700; box-shadow: 0 0 24px rgba(255, 183, 3, .45); }
.lb li.r2 .rk { background: linear-gradient(135deg, #f1f3ff, #b9c0dc); color: #23284a; }
.lb li.r3 .rk { background: linear-gradient(135deg, #ffd0a8, #d8833f); color: #3b1d00; }
.lb li.r1 { border-color: rgba(255, 183, 3, .45); background: rgba(255, 183, 3, .08); }
.lb .nm { min-width: 0; }
.lb .nm b { display: block; font-family: var(--font-head); font-weight: 600; font-size: 1.15rem; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb .nm small { color: #9aa1d4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.lb .sc { text-align: right; font-family: var(--font-head); font-weight: 700; font-size: 1.6rem; color: var(--gold-2); font-variant-numeric: tabular-nums; line-height: 1.1; }
.lb .sc small { display: block; font-size: .75rem; color: #9aa1d4; font-weight: 400; }
.page-board .hbar .name, .page-board .hbar .val { color: #e9ecff; }
.page-board .hbar .track { border-left-color: #474b6b; }
.page-board .hbar .track .grid { background: #2a2f55; }
.page-board .cols { border-bottom-color: #474b6b; }
.page-board .cols .gl { background: #2a2f55; }
.page-board .cols .gl span, .page-board .cols-x { color: #8d93c2; }
.ticker { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.ticker li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: rgba(255, 255, 255, .04); }
.ticker li b { font-family: var(--font-head); font-weight: 600; color: #fff; }
.ticker li .sc { margin-left: auto; font-family: var(--font-head); font-weight: 700; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.ticker li .t { color: #8d93c2; font-size: .82rem; }
.board-empty { color: #8d93c2; text-align: center; padding: 30px 10px; }
.page-board .viz-tip { background: #fff; color: var(--navy-950); }
.board-status { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: #e9ecff; font-family: var(--font-head); font-weight: 500; }
.board-status.on { background: rgba(10, 172, 35, .18); color: #9ff0ad; }
.board-status.sync { background: rgba(255, 183, 3, .16); color: var(--gold-2); }
.board-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.board-clock small { display: block; font-size: .8rem; font-weight: 500; color: #9aa1d4; text-align: right; }
.board .btn-ghost { color: #c9cff5; }
.board .btn-ghost:hover { background: rgba(255, 255, 255, .08); }
.lb li { will-change: transform; }
.lb .av { display: none; }
.ticker li .av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .1); color: #fff; font-family: var(--font-head); font-weight: 600; flex: none; }
.board-locked { min-height: 80vh; display: grid; place-items: center; text-align: center; color: #c9cff5; }
.board-locked .icon { width: 64px; height: 64px; margin: 0 auto 14px; color: var(--gold-2); }
.bcard h2 svg { width: 22px; height: 22px; flex: none; }
.board-locked .icon svg { width: 100%; height: 100%; }
.board-locked a { color: var(--gold-2); }
.board-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.board-clock { font-family: var(--font-head); font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 700; color: var(--gold-2); font-variant-numeric: tabular-nums; }

@media (max-width: 999px), (pointer: coarse) { .kbd-hint { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
