/* KU B.A. LL.B. Entrance Hall
   Two visual worlds: the app (dashboard) and the hall (desk, paper, OMR). */

:root {
  --navy: #16233f;
  --navy-2: #22355c;
  --ink: #1a1f2b;
  --muted: #5d6677;
  --line: #dcdfe6;
  --bg: #f3f1ec;
  --card: #ffffff;
  --accent: #a3271f;
  --accent-2: #c9a24b;
  --ok: #1f7a45;
  --bad: #b3261e;
  --mid: #b7791f;
  --paper: #fbfaf6;
  --paper-ink: #141414;
  --pen: #17307f;
  --omr: #c2255c;
  --desk: #3a2a1d;
  --radius: 14px;
  --serif: "Times New Roman", Times, "Nimbus Roman No9 L", "Liberation Serif", "Noto Serif", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--sans); font-size: 16px; line-height: 1.5; color: var(--ink);
  background: var(--bg); overflow-x: hidden; overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
h1, h2, h3, h4, h5, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; line-height: 1.2; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { touch-action: manipulation; cursor: pointer; }
table { border-collapse: collapse; width: 100%; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.mt { margin-top: 22px; }
.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 20px; border-radius: 10px; border: 1.5px solid transparent;
  font-weight: 650; text-decoration: none; text-align: center; line-height: 1.2;
  transition: transform .08s, background .15s;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: #8c1f18; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.ghost.light { border-color: rgba(255,255,255,.4); color: #fff; }
.btn.danger { background: #fff; border-color: var(--bad); color: var(--bad); }
.btn.small { min-height: 40px; padding: 6px 14px; font-size: 14px; }
.btn.big { min-height: 54px; font-size: 17px; padding: 12px 26px; }
.btn:focus-visible, .opt:focus-visible, .bub:focus-visible, .chip:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid var(--accent-2); outline-offset: 2px;
}
.link { background: none; border: 0; padding: 8px; color: var(--pen); text-decoration: underline; }

.crest {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy); color: var(--accent-2); font: 700 34px/1 var(--serif);
  border: 3px double var(--accent-2); margin: 0 auto 14px;
}
.crest.small { width: 34px; height: 34px; font-size: 19px; border-width: 2px; margin: 0; flex: none; }
.eyebrow { font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 650; }

/* -------------------------------------------------------------- boot */
.boot { min-height: 100dvh; display: grid; place-items: center; background: var(--navy); color: #fff; }
.boot-card { text-align: center; }

/* ------------------------------------------------------------- shell */
.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.page {
  flex: 1; width: 100%; max-width: 1120px; margin: 0 auto;
  padding: calc(18px + var(--safe-t)) calc(16px + var(--safe-r)) calc(96px + var(--safe-b)) calc(16px + var(--safe-l));
  display: flex; flex-direction: column; gap: 16px; min-width: 0;
}
.nav {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-around; align-items: stretch;
  background: var(--navy); color: #c9d1e2;
  padding: 6px calc(6px + var(--safe-r)) calc(6px + var(--safe-b)) calc(6px + var(--safe-l));
}
.nav-brand { display: none; }
.nav a {
  flex: 1; min-width: 0; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; font-size: 11.5px; font-weight: 600; border-radius: 10px;
}
.nav a.on { color: #fff; background: rgba(255,255,255,.12); }
.nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

@media (min-width: 900px) {
  .shell { flex-direction: row; }
  .nav {
    position: sticky; top: 0; bottom: auto; height: 100dvh; width: 208px; flex: none;
    flex-direction: column; justify-content: flex-start; gap: 4px;
    padding: calc(18px + var(--safe-t)) 12px 18px calc(12px + var(--safe-l));
  }
  .nav-brand { display: flex; align-items: center; gap: 10px; color: #fff; padding: 4px 8px 18px; font-size: 17px; }
  .nav a { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 12px; font-size: 15px; }
  .page { padding: calc(28px + var(--safe-t)) calc(32px + var(--safe-r)) 48px 32px; gap: 20px; }
}

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.page-head h2 { font-size: clamp(22px, 3.4vw, 28px); }
.hello { font-family: var(--serif); }
.back { text-decoration: none; color: var(--muted); font-weight: 600; min-height: 40px; display: inline-flex; align-items: center; }

.hero {
  background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff;
  border-radius: var(--radius); padding: clamp(20px, 4vw, 34px);
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
}
.hero .eyebrow { color: var(--accent-2); }
.hero h1 { font-family: var(--serif); font-size: clamp(28px, 5vw, 42px); }
.hero p { color: #d5dbea; max-width: 62ch; }
.hero .muted { color: #aeb8cf; font-size: 14px; }
.hero.live { background: linear-gradient(135deg, #5c1410, var(--accent)); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat b { display: block; font-size: 26px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13.5px; }

.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; align-items: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(16px, 2.6vw, 22px); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card h2 { font-size: 18px; }
.card .btn { align-self: flex-start; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }

.row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 0; border-top: 1px solid var(--line); text-decoration: none; min-height: 56px;
}
.row > div:first-child { min-width: 0; }
.row b { display: block; }
.row span { color: var(--muted); font-size: 13.5px; }
.row strong { font-size: 20px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row strong small { font-size: 13px; color: var(--muted); font-weight: 500; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; flex: none; }
.pill { background: var(--accent); color: #fff !important; font-size: 13px !important; padding: 5px 12px; border-radius: 99px; font-weight: 650; }
@media (max-width: 520px) { .row:has(.row-actions) { flex-direction: column; align-items: stretch; } .row-actions { justify-content: flex-start; } }

.weak { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.weak li { display: grid; grid-template-columns: 1fr 96px; align-items: center; gap: 12px; }
.weak b { display: block; }
.weak span { color: var(--muted); font-size: 13.5px; }
.bar { display: inline-block; width: 96px; max-width: 100%; height: 8px; border-radius: 99px; background: #e8e9ee; overflow: hidden; vertical-align: middle; }
.bar i { display: block; height: 100%; border-radius: 99px; }
.bar .low { background: var(--bad); } .bar .mid { background: var(--mid); } .bar .high { background: var(--ok); }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
.grid th, .grid td { padding: 9px 10px; border-top: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.grid th:first-child, .grid td:first-child { text-align: left; white-space: normal; }
.grid thead th { border-top: 0; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.grid tbody th { font-weight: 600; }
.barcell { text-align: right; }

.facts { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 9px; }
.coach { border-left: 5px solid var(--accent-2); }
.coach ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.trend { width: 100%; height: 110px; color: var(--accent); overflow: visible; }

.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.field input { min-height: 48px; padding: 10px 14px; border: 1.5px solid #b9bfcc; border-radius: 10px; background: #fff; font-weight: 400; font-size: 16px; width: 100%; max-width: 420px; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
.check input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.chip { display: inline-flex; align-items: center; min-height: 34px; padding: 4px 12px; border-radius: 99px; background: #eef0f4; border: 1.5px solid transparent; font-size: 13.5px; font-weight: 600; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters .chip { min-height: 40px; }
.filters .chip.on { background: var(--navy); color: #fff; }

/* ------------------------------------------------------------- toast */
.toast {
  position: fixed; z-index: 100; left: 50%; bottom: calc(84px + var(--safe-b)); transform: translate(-50%, 20px);
  max-width: min(92vw, 520px); background: #1c1c1e; color: #fff; padding: 12px 18px; border-radius: 12px;
  font-size: 15px; opacity: 0; pointer-events: none; transition: .2s; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.warn { background: #7a1c16; }

.modal { position: fixed; inset: 0; z-index: 90; background: rgba(10,14,24,.6); display: grid; place-items: center; padding: 20px; }
.modal-card { background: #fff; border-radius: 16px; padding: 24px; width: min(100%, 440px); display: flex; flex-direction: column; gap: 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ============================================================== HALL */
.hall { min-height: 100dvh; }
.gate {
  background: radial-gradient(ellipse at top, #2a3f6b, var(--navy) 60%); display: grid; place-items: center;
  padding: calc(20px + var(--safe-t)) calc(16px + var(--safe-r)) calc(20px + var(--safe-b)) calc(16px + var(--safe-l));
}
.gate-card {
  background: var(--paper); border-radius: 18px; width: min(100%, 600px); padding: clamp(20px, 5vw, 36px);
  display: flex; flex-direction: column; gap: 16px; text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.45);
}
.gate-card h1 { font-family: var(--serif); font-size: clamp(24px, 4.6vw, 32px); }
.gate-card .field, .gate-card .check, .gate-rules { text-align: left; }
.gate-card .field input { max-width: none; }
.gate-card .btn.big { align-self: stretch; }
.admit { text-align: left; border: 1.5px solid #222; font-family: var(--serif); }
.admit th, .admit td { padding: 8px 12px; border: 1px solid #999; font-size: 16px; }
.admit th { width: 42%; background: #efece2; font-weight: 700; }
.gate-rules { margin: 0; padding-left: 20px; color: #3b3f4a; font-size: 14.5px; display: flex; flex-direction: column; gap: 6px; }
.gate-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.gate-actions .btn { flex: 1 1 180px; }
.printer { height: 6px; border-radius: 99px; background: #e2ddcf; overflow: hidden; }
.printer span { display: block; width: 40%; height: 100%; background: var(--accent); border-radius: 99px; animation: print 1.6s ease-in-out infinite; }
@keyframes print { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }

.desk {
  position: fixed; inset: 0; display: flex; flex-direction: column; overflow: hidden;
  background: var(--desk);
  background-image: repeating-linear-gradient(92deg, rgba(0,0,0,.10) 0 2px, transparent 2px 9px), linear-gradient(180deg, #4a3524, #2c1f15);
}
.hallbar {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: calc(8px + var(--safe-t)) calc(12px + var(--safe-r)) 8px calc(12px + var(--safe-l));
  background: #14110e; color: #f1ece0; border-bottom: 2px solid #000;
}
.clock { display: flex; flex-direction: column; line-height: 1; padding: 6px 12px; border: 1.5px solid #5a5347; border-radius: 8px; background: #000; }
.clock small { font-size: 9.5px; letter-spacing: .14em; color: #a59c8b; }
.clock b { font: 700 24px/1.1 ui-monospace, "Cascadia Mono", Consolas, monospace; font-variant-numeric: tabular-nums; color: #f6e7b4; }
.clock.late b { color: #ff6b5e; animation: pulse 1s infinite; }
.hallbar-mid { flex: 1; min-width: 0; font-size: 14px; color: #cfc7b6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hallbar .btn.ghost { border-color: #6a6253; color: #f1ece0; }
.hallbar .btn.danger { background: var(--accent); color: #fff; border-color: var(--accent); }
.invigilator {
  flex: none; background: #f6e7b4; color: #2b2410; padding: 9px calc(14px + var(--safe-r)) 9px calc(14px + var(--safe-l));
  font-size: 14.5px; text-align: center; border-bottom: 1px solid #b9a45b;
}

.desk-split { flex: 1; min-height: 0; display: flex; position: relative; }
.desk-scroll {
  flex: 1; min-width: 0; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: 18px calc(10px + var(--safe-r)) calc(40px + var(--safe-b)) calc(10px + var(--safe-l));
  display: flex; flex-direction: column; align-items: center; gap: 22px;
}
.cover-actions { width: min(100%, 860px); display: flex; justify-content: center; padding-bottom: 20px; }
.cover-actions .btn { width: min(100%, 460px); box-shadow: 0 10px 30px rgba(0,0,0,.4); }

/* ---------------------------------------------------------- the sheet */
.sheet {
  container-type: inline-size; position: relative; flex: none;
  width: min(100%, 860px); background: var(--paper); color: var(--paper-ink);
  background-image: radial-gradient(rgba(120,110,90,.07) 1px, transparent 1.2px), linear-gradient(180deg, #fdfcf9, #f6f3ea);
  background-size: 5px 5px, 100% 100%;
  box-shadow: 0 2px 0 #d9d3c3, 0 14px 34px rgba(0,0,0,.5);
  font-family: var(--serif); border-radius: 2px;
}
.sheet-foot {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 8px;
  font-size: clamp(11.5px, 2cqw, 15px); padding-top: 14px;
}
.sheet-foot b:last-child { text-align: right; }
.pg { display: flex; flex-direction: column; align-items: center; font-weight: 700; line-height: 1; }
.pg i { width: 26px; height: 5px; margin-top: 2px; background: repeating-linear-gradient(90deg, #111 0 5px, transparent 5px 7px); }

/* cover page: sized in container units so it keeps the proportions of the
   printed page on a phone and on a tablet alike */
.cover { padding: clamp(10px, 3.2cqw, 30px); font-size: clamp(10.5px, 2.02cqw, 17px); line-height: 1.22; }
.cover-frame { border: 0.22em solid #111; border-radius: 1em; padding: 1.3em 1.5em 0.9em; }
.srno { text-align: right; font-weight: 700; font-size: 1.15em; padding-right: .5em; }
.srno .dots { display: inline-block; min-width: 8.5em; border-bottom: 2px dotted #111; text-align: center; position: relative; height: 1.2em; }
.stamp { position: absolute; left: 50%; bottom: .1em; transform: translateX(-50%) rotate(-3deg); color: #c8213a; font: 700 1.5em/1 "Courier New", ui-monospace, monospace; letter-spacing: .06em; opacity: .9; }
.cover-title { text-align: center; font-size: 2.3em; font-weight: 700; margin-top: .55em; letter-spacing: .01em; }
.cover-school { text-align: center; font-size: 1.55em; font-weight: 700; margin-top: .7em; }
.cover-course { text-align: center; font-size: 1.5em; font-weight: 700; margin-top: .55em; }
.cover-meta { display: flex; justify-content: space-between; align-items: flex-end; gap: 1em; margin-top: .5em; font-size: 1.08em; }
.cover-left > div { display: grid; grid-template-columns: 9.2em 1.6em auto; }
.cover-right { display: flex; flex-direction: column; align-items: flex-end; gap: .35em; }
.series { display: flex; align-items: center; gap: .7em; }
.series-box { border: .16em solid #111; border-radius: .35em; padding: 0 .5em; font-size: 1.7em; font-weight: 700; line-height: 1.1; }
.roll { display: flex; align-items: center; gap: .6em; }
.roll-boxes { display: inline-flex; border: .12em solid #111; }
.roll-boxes i { width: 1.75em; height: 1.9em; border-right: .08em solid #111; display: grid; place-items: center; font: italic 600 1.25em/1 "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive; color: var(--pen); }
.roll-boxes i:last-child { border-right: 0; }
@container (max-width: 560px) {
  .cover-meta { flex-direction: column-reverse; align-items: stretch; gap: .6em; }
  .cover-right { align-items: flex-end; }
  .ins, .q-pre { text-align: left; }
}
.cover-left b { white-space: nowrap; }
.cover-rule { border-top: .16em solid #111; margin-top: .45em; }
.ins-head { text-align: center; font-weight: 700; margin: .7em 0 .5em; }
.ins { margin: 0; padding-left: 2.2em; display: flex; flex-direction: column; gap: .78em; text-align: justify; }
.ins li { padding-left: .3em; }
.cover .sheet-foot { font-size: 1em; font-weight: 700; padding-top: 1em; }
.seal {
  position: absolute; right: -6px; top: 42%; z-index: 2; border: 0; background: #d3261f; color: #fff;
  font: 800 clamp(13px, 3cqw, 24px)/1 var(--sans); letter-spacing: .08em;
  padding: 1.1em .45em; border-radius: 3px 0 0 3px; box-shadow: -3px 3px 8px rgba(0,0,0,.35);
  animation: nudge 2.4s ease-in-out infinite;
}
.seal span { writing-mode: vertical-rl; transform: rotate(180deg); display: block; }
@keyframes nudge { 0%, 80%, 100% { transform: translateX(0); } 88% { transform: translateX(-6px); } }

/* question pages */
.page.sheet, .sheet.page { padding: clamp(16px, 4.6cqw, 42px) clamp(14px, 4.4cqw, 40px) clamp(12px, 3cqw, 24px); max-width: 860px; margin: 0; gap: 0; display: block; }
.cols { font-size: clamp(16px, 2.15cqw, 18.5px); line-height: 1.38; }
@container (min-width: 620px) { .cols { column-count: 2; column-gap: 2.4em; } }
.q { display: grid; grid-template-columns: 2.1em 1fr; break-inside: avoid; padding: 0 0 .85em; border-radius: 4px; scroll-margin: 90px; }
.q.flash { animation: flash 1.2s ease-out; }
@keyframes flash { 0% { background: rgba(246,231,180,.95); } 100% { background: transparent; } }
.q-num { font-weight: 400; }
.q-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.q-pre { break-inside: avoid; white-space: pre-wrap; margin: 0 0 .8em; padding: .5em .7em; border: 1px solid #555; font-size: .95em; text-align: justify; }
.opts { list-style: none; margin: .25em 0 0; padding: 0; }
.opt {
  width: 100%; min-height: 38px; display: grid; grid-template-columns: 2.5em 1fr; align-items: center; gap: .15em;
  background: none; border: 0; padding: .2em .2em .2em .1em; text-align: left; font-family: var(--serif); font-size: 1em; line-height: 1.3; color: inherit; border-radius: 6px;
}
.opt:active { background: rgba(23,48,127,.08); }
.opt .lab { position: relative; justify-self: start; padding: .1em .15em; white-space: nowrap; }
.opt .txt { overflow-wrap: anywhere; }
.opt.sel .lab::after {
  content: ""; position: absolute; inset: -.16em -.2em -.12em -.24em; border: .13em solid var(--pen);
  border-radius: 48% 52% 50% 50% / 55% 48% 52% 45%; transform: rotate(-7deg);
}
.opt.sel .txt { text-decoration: underline; text-decoration-color: rgba(23,48,127,.55); text-underline-offset: .2em; }

.rough { min-height: 0; }
.rough-head { display: flex; justify-content: space-between; align-items: center; font-size: 17px; }
.rough-head b { flex: 1; text-align: center; letter-spacing: .06em; }
#rough { display: block; width: 100%; height: min(70dvh, 620px); touch-action: none; cursor: crosshair; border: 1px dashed #b5ad98; margin-top: 8px; }

/* ------------------------------------------------------------- OMR */
.omr-panel {
  flex: none; width: 372px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: 18px calc(12px + var(--safe-r)) calc(24px + var(--safe-b)) 4px;
}
.omr-close { display: none; }
.omr-sheet { background: #fffdfd; border: 2px solid var(--omr); box-shadow: 0 10px 26px rgba(0,0,0,.45); padding: 12px 10px 14px; color: #222; }
.omr-head { text-align: center; border-bottom: 2px solid var(--omr); padding-bottom: 8px; color: var(--omr); }
.omr-title { font: 700 16px/1.2 var(--serif); letter-spacing: .05em; }
.omr-sub { font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.omr-ids { display: flex; justify-content: space-between; margin-top: 6px; font-size: 13px; color: #222; }
.omr-ids b { color: var(--pen); }
.omr-note { font-size: 10.5px; margin-top: 4px; }
.omr-grid { columns: 2; column-gap: 10px; column-rule: 1.5px solid var(--omr); padding-top: 8px; }
.omr-row { display: grid; grid-template-columns: 30px repeat(4, 1fr); align-items: center; justify-items: center; break-inside: avoid; height: 40px; }
.omr-row:nth-child(5n) { border-bottom: 1px dashed rgba(194,37,92,.45); }
.omr-n { background: none; border: 0; padding: 0; width: 30px; height: 40px; font: 700 13px/1 var(--sans); color: var(--omr); text-align: right; padding-right: 4px; }
.bub {
  width: 29px; height: 29px; border-radius: 50%; border: 1.6px solid var(--omr); background: #fff; color: var(--omr);
  font: 600 12px/1 var(--sans); padding: 0; position: relative;
}
.bub::before { content: ""; position: absolute; inset: -6px -3px; }
.bub.on { background: radial-gradient(circle at 42% 40%, #2b3d7c, #101a3f 70%); border-color: #101a3f; color: transparent; }
.omr-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 30px; font-size: 10.5px; color: var(--omr); }
.omr-foot span { border-top: 1px solid var(--omr); padding-top: 3px; flex: 1; text-align: center; }

#omr-toggle { display: none; }
@media (max-width: 1023px) {
  #omr-toggle { display: inline-flex; }
  .omr-panel {
    position: absolute; z-index: 10; left: 0; right: 0; bottom: 0; width: auto; max-height: 82%;
    background: rgba(20,14,9,.96); padding: 0 calc(10px + var(--safe-r)) calc(16px + var(--safe-b)) calc(10px + var(--safe-l));
    transform: translateY(105%); transition: transform .22s ease-out; border-radius: 16px 16px 0 0; visibility: hidden;
  }
  .omr-panel.open { transform: none; visibility: visible; }
  .omr-close { display: block; position: sticky; top: 0; z-index: 1; width: 100%; min-height: 46px; background: rgba(20,14,9,.96); color: #f1ece0; border: 0; font-weight: 650; }
  .omr-sheet { max-width: 760px; margin: 0 auto; }
  .omr-grid { columns: 148px 4; }
}
@media (max-width: 420px) {
  .hallbar { gap: 6px; padding-left: calc(8px + var(--safe-l)); padding-right: calc(8px + var(--safe-r)); }
  .hallbar .btn.small { padding: 6px 10px; font-size: 13px; }
  .clock { padding: 5px 8px; } .clock b { font-size: 20px; }
  .hallbar-mid { font-size: 12.5px; }
}
@media (max-height: 480px) and (orientation: landscape) {
  .clock small { display: none; }
  .hallbar { padding-top: calc(4px + var(--safe-t)); padding-bottom: 4px; }
  .desk-scroll { padding-top: 10px; }
}

/* ============================================================ RESULT */
.slip { background: var(--paper); border: 1.5px solid #222; border-radius: 6px; padding: clamp(18px, 3.4vw, 28px); display: flex; flex-direction: column; gap: 14px; font-family: var(--serif); }
.slip .eyebrow { font-family: var(--sans); }
.slip-main { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 36px; }
.score b { font-size: clamp(56px, 12vw, 84px); line-height: .95; font-variant-numeric: tabular-nums; }
.score span { display: block; font-size: 17px; color: var(--muted); }
.slip-facts { display: grid; grid-template-columns: repeat(2, minmax(120px, 1fr)); gap: 12px 26px; flex: 1; min-width: min(100%, 260px); }
.slip-facts b { display: block; font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.slip-facts span { font-family: var(--sans); font-size: 13.5px; color: var(--muted); }
.ok { color: var(--ok); } .bad { color: var(--bad); }
.verdict { font-size: 19px; font-style: italic; }
.flag { font-family: var(--sans); font-size: 14px; color: #7a4b00; background: #fff4d6; border-radius: 8px; padding: 8px 12px; }

#review { display: flex; flex-direction: column; gap: 14px; }
.rev { border: 1px solid var(--line); border-left: 6px solid var(--line); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; background: #fff; min-width: 0; }
.rev.right { border-left-color: var(--ok); } .rev.wrong { border-left-color: var(--bad); } .rev.blank { border-left-color: #8a91a0; }
.rev-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rev-n { font-weight: 800; font-size: 17px; }
.rev-tag { margin-left: auto; font-weight: 700; font-size: 14px; white-space: pre; }
.rev.right .rev-tag { color: var(--ok); } .rev.wrong .rev-tag { color: var(--bad); } .rev.blank .rev-tag { color: var(--muted); }
.rev .q-text { font-family: var(--serif); font-size: 18px; line-height: 1.4; }
.rev .q-pre { font-family: var(--serif); font-size: 16.5px; margin: 0; }
.rev-opts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rev-opts li { display: grid; grid-template-columns: 2.4em 1fr; gap: 4px; padding: 8px 10px; border-radius: 8px; border: 1px solid transparent; font-family: var(--serif); font-size: 17px; }
.rev-opts li > div { min-width: 0; overflow-wrap: anywhere; }
.rev-opts em { font: 700 12px/1 var(--sans); font-style: normal; text-transform: uppercase; letter-spacing: .05em; margin-left: 10px; white-space: nowrap; }
.rev-opts small { display: block; font: 400 14px/1.4 var(--sans); color: var(--muted); margin-top: 3px; }
.rev-opts .is-answer { background: #e8f5ec; border-color: #9fd3b1; } .rev-opts .is-answer em { color: var(--ok); }
.rev-opts .is-chosen { background: #fdecea; border-color: #f0b1ab; } .rev-opts .is-chosen em { color: var(--bad); }
.why { background: #f6f4ee; border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.why h4 { font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--navy); }
.src { font-size: 12.5px; color: var(--muted); }
.deep-text { border-left: 4px solid var(--accent-2); padding: 4px 0 4px 14px; display: flex; flex-direction: column; gap: 6px; }
.deep-text h5 { font-size: 13px; letter-spacing: .06em; color: var(--accent); margin-top: 6px; }
.empty { color: var(--muted); text-align: center; padding: 20px; }

@media (max-width: 520px) {
  .grid th, .grid td { padding: 8px 6px; font-size: 14px; }
  .result .grid tr > :nth-child(2), .result .grid tr > :nth-child(7) { display: none; }
}
/* ---------------------------------------------- multi-exam additions */
a.nav-brand { text-decoration: none; }
.q-section { column-span: all; font: 700 1.05em/1.3 var(--serif); text-align: center; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 .9em; padding: .25em 0; border-top: 2px solid #111; border-bottom: 2px solid #111; }
.again { font-size: 13.5px; color: #5a3d00; }
.level { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.level.weak { background: #fdecea; color: var(--bad); }
.level.improving { background: #fff4d6; color: #7a4b00; }
.level.strong { background: #e8f5ec; color: var(--ok); }
.level.new { background: #eef0f4; color: var(--muted); }
.topics th small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.exam-card h2 { font-family: var(--serif); font-size: 22px; }
.form { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.form .field { width: 100%; max-width: 520px; }
.field select, .field textarea {
  min-height: 48px; padding: 10px 14px; border: 1.5px solid #b9bfcc; border-radius: 10px; background: #fff;
  font: inherit; font-weight: 400; font-size: 16px; width: 100%; color: inherit;
}
.field textarea { font-family: ui-monospace, Consolas, monospace; font-size: 13.5px; line-height: 1.45; resize: vertical; }
.field input[type="file"] { padding: 9px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.katex { font-size: 1.05em; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print { .nav, .hallbar, .omr-panel, .toast { display: none !important; } .desk { height: auto; overflow: visible; background: #fff; } }
