/* ===== Secure Exam — student PWA (mobile first) ===== */
:root {
  --navy: #1e2a4a; --navy-2: #2b3a63; --saffron: #f28c28; --saffron-d: #d9731a;
  --bg: #f3f5f9; --card: #fff; --ink: #1a2133; --muted: #66708a; --line: #e2e6ef;
  --ok: #16a34a; --bad: #dc2626; --warn: #d97706; --review: #7c3aed;
  --radius: 14px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 4px 14px rgba(16,24,40,.06);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[x-cloak] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", sans-serif; }
body { overscroll-behavior: none; }
button { font: inherit; cursor: pointer; }
input { font: inherit; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.25; }
.row { display: flex; align-items: center; gap: 6px; }
.row.gap { gap: 10px; }
.grow { flex: 1; min-width: 0; }
.pad { padding: 16px; }
.center { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; }
.center-text { text-align: center; }
.small, .hint { font-size: 13px; color: var(--muted); }
.err { color: var(--bad); font-size: 14px; margin: 8px 0; }

/* ----- buttons ----- */
.btn { border: 0; border-radius: 10px; padding: 11px 16px; font-weight: 600; background: #e9edf5; color: var(--ink);
  min-height: 44px; transition: transform .05s, background .15s; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.ghost.on { border-color: var(--review); color: var(--review); background: #f3edff; }
.btn.block { display: block; width: 100%; margin-top: 10px; }
.btn.big { padding: 14px; font-size: 17px; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 0; background: rgba(255,255,255,.12); color: inherit; font-size: 18px; }
.icon-btn.light { background: rgba(255,255,255,.15); color: #fff; }
.icon-btn.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card.narrow { max-width: 420px; width: 100%; }

/* ----- net strip ----- */
.netbar { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 6px 14px; color: #fff; }
.netbar.on { background: #0f5132; } .netbar.off { background: #8a3b00; }
.netbar .dot, .sync .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.pill { margin-left: auto; padding: 1px 8px; border-radius: 99px; font-weight: 600; }
.pill.warn { background: var(--saffron); color: #1a1a1a; }

/* ----- login ----- */
.login { min-height: calc(100vh - 32px); display: flex; flex-direction: column; justify-content: center; padding: 20px; max-width: 420px; margin: 0 auto; }
.brand { text-align: center; margin-bottom: 18px; }
.logo { width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 18px; background: linear-gradient(135deg, var(--navy), var(--navy-2));
  color: var(--saffron); font-size: 32px; font-weight: 800; display: grid; place-items: center; }
.brand p { color: var(--muted); margin: 0; }
.form label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 14px; color: var(--muted); }
.form input { display: block; width: 100%; margin-top: 6px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px;
  background: #fbfcfe; color: var(--ink); font-size: 17px; }
.form input:focus { outline: none; border-color: var(--saffron); box-shadow: 0 0 0 3px rgba(242,140,40,.18); }

/* ----- home ----- */
.appbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; background: var(--navy); color: #fff; }
.hello { font-weight: 700; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { font-size: 13px; opacity: .8; }
.chips { display: flex; gap: 8px; padding: 12px 16px 4px; overflow-x: auto; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 16px; font-weight: 600; font-size: 14px; color: var(--muted); }
.chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.list { padding: 10px 16px 40px; display: grid; gap: 12px; max-width: 760px; margin: 0 auto; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.exam { cursor: pointer; border-left: 4px solid var(--line); }
.exam.live, .exam.resume { border-left-color: var(--ok); }
.exam.upcoming { border-left-color: var(--warn); cursor: default; }
.exam.ended, .exam.finished { opacity: .75; cursor: default; }
.exam h3 { font-size: 17px; margin: 6px 0; }
.exam-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.badge { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: 6px; }
.badge.mock { background: #e0f2fe; color: #075985; } .badge.test { background: #fef3c7; color: #92400e; } .badge.exam { background: #fee2e2; color: #991b1b; }
.state { font-weight: 700; color: var(--ok); } .state.up { color: var(--warn); } .state.end { color: var(--muted); }
.state.res { color: var(--saffron-d); } .state.done { color: var(--navy); }
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); }
.paper-code { font-weight: 700; letter-spacing: .4px; color: var(--ink, #1e2a4a); background: rgba(30,42,74,.07); border-radius: 5px; padding: 1px 6px; }
.paper-code.sm { font-size: 11px; color: inherit; background: rgba(255,255,255,.18); margin-right: 6px; }
.ex-title { display: flex; align-items: center; }
.ex-title .paper-code.sm { flex: none; }
.ex-title > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-line { margin-top: 8px; font-size: 14px; display: flex; gap: 12px; }
.cta { margin-top: 10px; font-weight: 700; color: var(--saffron-d); text-align: right; }
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); background: #111827; color: #fff;
  padding: 10px 18px; border-radius: 10px; font-size: 14px; z-index: 80; max-width: 90vw; }

/* ----- brief ----- */
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.facts div, .sum div { background: var(--bg); border-radius: 10px; padding: 10px; text-align: center; }
.facts b, .sum b { display: block; font-size: 22px; color: var(--navy); }
.facts span, .sum span { font-size: 12px; color: var(--muted); }
.rules ul { padding-left: 18px; margin: 0 0 12px; } .rules li { margin-bottom: 6px; font-size: 14.5px; }
.instructions { background: #fff8ef; border: 1px solid #fde3c6; border-radius: 10px; padding: 10px 12px; font-size: 14px; }

/* ----- exam ----- */
.exam-screen { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.exambar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--navy); color: #fff; min-height: 56px; }
.ex-title { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-right { display: flex; align-items: center; gap: 8px; }
.timer { font: 700 20px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: rgba(255,255,255,.12); padding: 7px 10px; border-radius: 8px; letter-spacing: .5px; }
.timer.low { background: var(--saffron); color: #1a1a1a; }
.timer.critical { background: var(--bad); color: #fff; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .65; } }
.big-timer { font-size: 40px; display: inline-block; margin: 10px 0; padding: 10px 18px; color: var(--navy); background: var(--bg); }
.sync { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 4px 8px; border-radius: 99px; background: rgba(255,255,255,.12); }
.sync.ok { color: #86efac; } .sync.pend { color: #fde68a; } .sync.off { color: #fdba74; }
.viol { font-size: 12px; font-weight: 700; background: var(--bad); color: #fff; padding: 4px 8px; border-radius: 99px; }

.exam-body { flex: 1; display: flex; min-height: 0; position: relative; }
.paper { flex: 1; overflow-y: auto; padding: 16px 14px 24px; background-color: var(--bg); background-repeat: repeat;
  transition: filter .08s; -webkit-overflow-scrolling: touch; }
.q-wrap { max-width: 860px; margin: 0 auto; }
.q-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 13px; color: var(--muted); font-weight: 600; }
.q-marks { background: #fff; border: 1px solid var(--line); padding: 2px 8px; border-radius: 6px; }
.q-body { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); font-size: 16.5px; margin-bottom: 14px; }
.options { display: grid; gap: 10px; }
.opt { display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left; background: var(--card); border: 2px solid var(--line);
  border-radius: 12px; padding: 12px 14px; min-height: 54px; color: var(--ink); }
.opt:hover { border-color: #c7cfdf; }
.opt.selected { border-color: var(--navy); background: #eef2fb; }
.opt-l { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px;
  background: var(--bg); color: var(--navy); }
.opt.selected .opt-l { background: var(--navy); color: #fff; }
.opt-t { flex: 1; min-width: 0; padding-top: 3px; }

.examfoot { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 8px 10px calc(8px + var(--safe-b)); background: #fff; border-top: 1px solid var(--line); }
.examfoot .btn { padding: 10px 6px; font-size: 14px; }

/* palette: bottom sheet on phones, sidebar on desktop */
.palette { position: fixed; left: 0; right: 0; bottom: 0; max-height: 78vh; overflow-y: auto; background: #fff; z-index: 40;
  border-radius: 18px 18px 0 0; padding: 16px 16px calc(16px + var(--safe-b)); transform: translateY(105%); transition: transform .22s ease;
  box-shadow: 0 -10px 30px rgba(0,0,0,.15); }
.palette.open { transform: none; }
.scrim { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 35; }
.pal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.pal-head .icon-btn { background: var(--bg); color: var(--ink); }
.pal-name { font-weight: 700; } .pal-sub { font-size: 13px; color: var(--muted); }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend .cell { width: 18px; height: 18px; min-height: 0; border-radius: 5px; padding: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 8px; margin-bottom: 14px; }
.cell { min-height: 42px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; font-weight: 700; font-size: 14px; color: var(--muted); position: relative; }
.cell.skipped { background: #fde8e8; border-color: #f7c1c1; color: #9b1c1c; }
.cell.answered { background: var(--ok); border-color: var(--ok); color: #fff; }
.cell.review { box-shadow: inset 0 0 0 3px var(--review); }
.cell.review::after { content: ''; position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--review); }
.cell.current { outline: 3px solid var(--saffron); outline-offset: 1px; }
i.cell { display: inline-block; }
.only-mobile { display: inline-grid; place-items: center; }

@media (min-width: 900px) {
  .palette { position: static; transform: none; width: 320px; max-height: none; border-radius: 0; border-left: 1px solid var(--line); box-shadow: none; }
  .scrim, .only-mobile { display: none !important; }
  .examfoot { grid-template-columns: repeat(4, 160px); justify-content: center; }
  .paper { padding: 24px 28px; }
}

/* ----- shield / modals ----- */
.shield { position: fixed; inset: 0; z-index: 60; background: rgba(15,23,42,.92); display: grid; place-items: center; padding: 20px; color: #fff; }
.shield-box { text-align: center; max-width: 360px; }
.shield-icon { font-size: 48px; }
.shield .small { color: #cbd5e1; }
.modal { position: fixed; inset: 0; z-index: 70; background: rgba(15,23,42,.55); display: grid; place-items: center; padding: 16px; }
.modal-box { background: #fff; border-radius: 16px; padding: 20px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }

/* ----- done ----- */
.done-icon { width: 72px; height: 72px; margin: 0 auto 10px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; font-size: 34px; color: var(--ok); }
.score { font-size: 40px; font-weight: 800; color: var(--navy); margin: 10px 0; }
.pending-box { background: #fff8ef; border: 1px solid #fde3c6; border-radius: 12px; padding: 12px; margin: 12px 0; text-align: left; }
.pending-box p { margin: 0 0 6px; }

.spinner { width: 40px; height: 40px; border: 4px solid var(--line); border-top-color: var(--navy); border-radius: 50%; animation: spin .8s linear infinite; }

/* ===== Question formatting (shared with admin preview) ===== */
.qf-text { white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; }
.qf-text + .qf-code, .qf-code + .qf-text { margin-top: 10px; }
.qf-inline { font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Courier New", monospace; font-size: .92em; background: #eef1f7; color: #b4235a;
  padding: 1px 6px; border-radius: 5px; white-space: pre-wrap; }
.qf-code { border-radius: 10px; overflow: hidden; background: #0f172a; color: #e2e8f0; margin: 2px 0; }
.qf-code-head { font: 700 10.5px/1 system-ui, sans-serif; letter-spacing: .1em; color: #94a3b8; padding: 7px 12px; background: #111c33; border-bottom: 1px solid #1e293b; }
.qf-code pre { margin: 0; padding: 10px 0; overflow-x: auto; -webkit-overflow-scrolling: touch; tab-size: 4; }
.qf-code code { display: block; font: 13.5px/1.6 ui-monospace, "SF Mono", Menlo, Consolas, "Courier New", monospace; white-space: pre; counter-reset: ln; min-width: max-content; }
.qf-ln { counter-increment: ln; padding-right: 16px; }
.qf-ln::before { content: counter(ln); display: inline-block; width: 2.6em; padding-right: 12px; margin-right: 4px; text-align: right; color: #475569; border-right: 1px solid #1e293b; }
.qf-kw { color: #c792ea; } .qf-st { color: #c3e88d; } .qf-nu { color: #f78c6c; } .qf-cm { color: #7f8ca3; font-style: italic; }
.qf-pp { color: #ffcb6b; } .qf-fn { color: #82aaff; }
.opt .qf-code { margin-top: 2px; }
@media (min-width: 600px) { .qf-code code { font-size: 14.5px; } }

/* ===== Lockdown ===== */
html.exam-locked, html.exam-locked * { -webkit-user-select: none !important; user-select: none !important; -webkit-touch-callout: none !important; }
html.exam-locked img { pointer-events: none; -webkit-user-drag: none; }
html.shield-on .paper, html.shield-flash .paper, html.shield-on .palette, html.shield-flash .palette { filter: blur(26px) saturate(.4); }
html.shield-flash .paper { opacity: .2; }
@media print { body * { display: none !important; } body::after { content: "Printing is disabled during the exam."; display: block; padding: 40px; } }

/* ---------- login: date of birth vs exam code ---------- */
.seg { display: flex; gap: 4px; background: rgba(30,42,74,.07); border-radius: 10px; padding: 4px; margin-bottom: 14px; }
.seg-btn { flex: 1; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600;
  color: var(--muted, #6b7280); padding: 9px 8px; border-radius: 7px; cursor: pointer; }
.seg-btn.active { background: #fff; color: var(--navy, #1e2a4a); box-shadow: 0 1px 3px rgba(16,24,40,.14); }
.code-input { text-align: center; font-size: 30px; font-weight: 700; letter-spacing: 12px; text-indent: 12px; }

/* ---------- report / review of a finished paper ---------- */
.review-screen .pad { padding-bottom: 40px; }
.cta.review { color: var(--navy, #1e2a4a); font-weight: 700; }
.rq { border-left: 4px solid var(--muted, #9aa3b2); }
.rq.correct { border-left-color: #1f9d55; }
.rq.wrong { border-left-color: #d64545; }
.rq.skipped { border-left-color: #c8ccd4; }
.rq-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.rq-no { font-weight: 800; color: var(--navy, #1e2a4a); }
.rq-marks { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.badge.correct { background: #e6f5ec; color: #1f7a45; }
.badge.wrong { background: #fdeaea; color: #b53434; }
.badge.skipped { background: #eef0f4; color: #6b7280; }
.ropt { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border-radius: 8px;
  border: 1px solid #e6e8ee; margin-bottom: 6px; background: #fff; }
.ropt.right { border-color: #1f9d55; background: #f2fbf6; }
.ropt.wrong { border-color: #d64545; background: #fdf4f4; }
.ropt.picked { box-shadow: inset 0 0 0 1px rgba(30,42,74,.18); }
.rkey { font-weight: 800; min-width: 18px; }
.rtext { flex: 1; min-width: 0; }
.rtag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  color: #6b7280; align-self: center; white-space: nowrap; }
.rtag.ok { color: #1f7a45; }
.rq-foot { font-size: 12.5px; color: var(--muted, #6b7280); margin: 8px 0 0; }
.explain { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: #f6f7fa; font-size: 14px; }

/* ---------- one device at a time ---------- */
.locked-box { background: #fdf4f4; border: 1px solid #f0c9c9; border-radius: 10px;
  padding: 10px 12px; margin: 4px 0 10px; }
.locked-box b { color: #b53434; display: block; font-size: 14.5px; line-height: 1.4; }

/* ---------- module-wise (sectioned) papers ---------- */
/* Section bar, directly under the exam header. A phone only has room for a short code
   per section, so the tab carries NA / VA / LR and the answered count; the full name
   rides above the question, where there is a whole line for it. */
.sec-bar { flex: none; display: flex; align-items: stretch; background: #fff;
  border-bottom: 1px solid var(--line); box-shadow: 0 1px 3px rgba(16,24,40,.07); }
.sec-bar-label { display: none; }
.sec-strip { display: flex; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.sec-strip::-webkit-scrollbar { display: none; }

.sec-tab { position: relative; flex: 1 0 auto; display: flex; align-items: center; gap: 8px;
  min-width: 84px; padding: 7px 12px 10px; border: 0; border-right: 1px solid var(--line);
  background: #fff; font: inherit; color: var(--muted); cursor: pointer; }
.sec-tab:last-child { border-right: 0; }
.sec-tag { flex: none; min-width: 30px; height: 24px; padding: 0 7px; border-radius: 7px; display: grid;
  place-items: center; font: 800 12px/1 inherit; letter-spacing: .03em;
  background: #eef1f7; color: var(--navy); }
.sec-meta { display: grid; gap: 1px; min-width: 0; text-align: left; }
.sec-full { display: none; font-size: 13px; font-weight: 700; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sec-count { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.sec-count b { color: var(--navy); font-size: 13px; }

.sec-tab.active { background: #eef2fb; }
.sec-tab.active .sec-tag { background: var(--navy); color: #fff; }
.sec-tab.active .sec-full { color: var(--navy); }
.sec-tab.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--saffron); }
.sec-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(16,24,40,.07); }
.sec-prog i { display: block; height: 100%; background: var(--ok); transition: width .25s; }
.sec-tab.active .sec-prog { bottom: 3px; }

/* which section the question on screen belongs to */
.q-sec { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-bottom: 10px;
  padding: 7px 11px; background: #eef2fb; border-left: 3px solid var(--navy); border-radius: 8px; }
.q-sec-name { font: 800 11.5px/1.35 inherit; letter-spacing: .06em; text-transform: uppercase; color: var(--navy); }
.q-sec-pos { font-size: 12px; color: var(--muted); font-weight: 600; }
.linklike { background: none; border: 0; padding: 0; margin-left: auto; font: 600 12px/1.35 inherit;
  color: var(--navy); text-decoration: underline; cursor: pointer; }

/* palette: short-code pills, then that one section's numbers */
.pal-tabs { display: flex; gap: 6px; margin-bottom: 10px; overflow-x: auto; scrollbar-width: none; }
.pal-tabs::-webkit-scrollbar { display: none; }
.pal-tab { flex: 1 0 auto; display: grid; gap: 1px; justify-items: center; min-width: 58px;
  border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 6px 9px;
  font: inherit; color: var(--muted); cursor: pointer; }
.pal-tab b { display: flex; align-items: center; gap: 5px; font: 800 12.5px/1 inherit; color: var(--ink); }
.pal-tab > span { font-size: 11px; font-weight: 700; }
.pal-tab.active { border-color: var(--navy); background: #eef2fb; }
.pal-tab.active b { color: var(--navy); }
/* the section being written carries a live dot — a drawn element, never a CSS escape */
.pal-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); display: none; }
.pal-tab.live .pal-dot { display: block; }

.pal-sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.pal-sec-head b { color: var(--navy); }
.pal-total { margin: 0 0 12px; text-align: center; }

@media (min-width: 900px) {
  /* room for the full name next to the code */
  .sec-bar-label { display: flex; flex: none; align-items: center; padding: 0 14px;
    font: 800 10.5px/1 inherit; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
    background: #f7f9fc; border-right: 1px solid var(--line); }
  .sec-tab { min-width: 170px; max-width: 300px; padding: 8px 18px 11px; }
  .sec-full { display: block; }
  .q-sec-name { font-size: 12px; }
}

/* a passage / DI table shared by the next few questions */
.passage-pane { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; }
.passage-head { display: none; font: 700 12.5px/1.3 inherit; color: var(--navy); padding: 10px 14px;
  background: #eef2fb; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; }
.passage-toggle { display: flex; width: 100%; gap: 10px; justify-content: space-between; align-items: center;
  background: #eef2fb; border: 0; padding: 11px 14px; font: 700 13px/1.35 inherit; color: var(--navy); text-align: left; }
.passage-body { padding: 14px; font-size: 16px; }
.passage-title { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.q-pane { min-width: 0; }

@media (min-width: 900px) {
  .only-desk { display: block !important; }
  /* Split view: the passage scrolls on its own, so it stays in sight while the
     student works through the questions that depend on it. */
  .paper.with-passage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; overflow: hidden; padding: 0; }
  .paper.with-passage > .passage-pane { margin: 0; border-radius: 0; box-shadow: none; overflow-y: auto;
    border-right: 1px solid var(--line); -webkit-overflow-scrolling: touch; }
  .paper.with-passage > .q-pane { overflow-y: auto; padding: 24px 28px; }
  .paper.with-passage .q-wrap { max-width: none; }
}
.sec-table { width: 100%; border-collapse: collapse; margin: 14px 0 4px; font-size: 13.5px; text-align: left; }
.sec-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.sec-table td { padding: 8px; border-bottom: 1px solid var(--line); }
.sec-table td:first-child { font-weight: 600; }
.sec-table .muted { color: var(--muted); }

.coding-pane,.problem-pane{min-width:0}.coding-problem pre{white-space:pre-wrap;overflow-wrap:anywhere}.coding-pane select{font:inherit;max-width:100%;padding:8px;border:1px solid #dfe5ef;border-radius:8px}.exam-locked .cm-editor,.exam-locked .cm-editor *{user-select:text!important;-webkit-user-select:text!important}@media(min-width:900px){.q-wrap.coding-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:24px;align-items:start}.coding-layout>.q-sec,.coding-layout>.q-head{grid-column:1/-1}.coding-layout>.problem-pane{grid-column:1}.coding-layout>.coding-pane{grid-column:2}}
