/* Bank Clerical Prelims — product UI.
   Method borrowed from Advox: true-neutral greys so the accent never bleeds
   into surfaces, a real 1.08:1 card lift instead of borders doing the work,
   a contrast-verified ink scale, and an accent that is rationed rather than
   sprayed. Every ratio below was measured, not guessed.

     #1A5CFF on #FFFFFF ......... 5.23:1   (AA body, and white on it is also
                                            5.23:1, so filled buttons carry
                                            white text safely)
     #0B44C8 on #FFFFFF ......... 7.85:1   accent text and links
     ink      #161718 ........... 17.95:1
     ink-soft #4C4D4E ...........  8.47:1
     muted    #696A6B ...........  5.42:1
     faint    #8D8E8F ...........  3.28:1  labels and icons, never body
     surface over canvas ........  1.08:1  the card lift
*/

:root {
  --brand: #1A5CFF;
  --brand-text: #0B44C8;
  --brand-soft: #EEF3FF;
  --brand-line: #C9DBFF;
  --on-brand: #FFFFFF;

  --canvas: #F5F6F7;
  --surface: #FFFFFF;
  --surface-sunken: #EFF0F1;
  --surface-raised: #E9EAEC;

  --ink: #161718;
  --ink-soft: #4C4D4E;
  --muted: #696A6B;
  --faint: #8D8E8F;

  --hairline: #E5E6E7;
  --hairline-strong: #D5D6D7;

  --field-bg: #FFFFFF;
  --field-line: #D5D6D7;
  --field-border: #949596;

  --ok: #2A7841;      --ok-soft: #E8F6EC;   --ok-line: #BEE3C9;
  --danger: #B4453E;  --danger-soft: #FDEDEC; --danger-line: #F2CBC8;
  --warn: #8A5A12;    --warn-soft: #FDF3E4; --warn-line: #EFD9B4;
  --info: #2B6EA1;    --info-soft: #EAF3FB;
  --violet: #6042B8;  --violet-soft: #F1ECFC; --violet-line: #D8CBF5;

  --lift-sm: 0 1px 2px rgba(22, 23, 24, .05);
  --lift-md: 0 4px 16px rgba(22, 23, 24, .08);
  --lift-lg: 0 16px 48px rgba(22, 23, 24, .14);
  --overlay: rgba(22, 23, 24, .42);

  --r-sm: 5px; --r: 8px; --r-lg: 12px; --r-pill: 9999px;
  --rail-w: 232px;
  --mono: "Google Sans Code", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Google Sans", "Google Sans Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { margin: 0; font-family: var(--sans); background: var(--canvas); color: var(--ink); font-size: 14.5px; line-height: 1.6; }
::selection { background: var(--brand-soft); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: var(--r-sm); }
a { color: var(--brand-text); text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: -.021em; line-height: 1.18; font-weight: 600; }
h1 { font-size: 27px; font-weight: 650; letter-spacing: -.026em; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 10px; }

.kicker { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); }
.sub { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.mono { font-family: var(--mono); }

/* ================= app shell: rail + main ================= */
.shell { display: flex; min-height: 100vh; }
.rail { width: var(--rail-w); flex: none; background: var(--surface); border-right: 1px solid var(--hairline); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.rail .brand { display: flex; align-items: center; gap: 9px; padding: 16px 16px 18px; }
.rail .mark { width: 26px; height: 26px; background: var(--brand); color: var(--on-brand); border-radius: var(--r-sm); display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }
.rail .bn { font-size: 14.5px; font-weight: 650; letter-spacing: -.015em; }
.navgroup { padding: 4px 10px 12px; }
.navgroup .glabel { font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); padding: 8px 8px 6px; }
.navitem { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border: none; background: none;
           border-radius: var(--r-sm); font: inherit; font-size: 13.5px; color: var(--ink-soft); cursor: pointer; }
.navitem:hover { background: var(--surface-sunken); color: var(--ink); }
.navitem.on { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
.navitem .dot { width: 6px; height: 6px; border-radius: var(--r-pill); background: var(--faint); flex: none; }
.navitem.on .dot { background: var(--brand); }
.navitem.done .dot { background: var(--ok); }
.rail .foot { margin-top: auto; border-top: 1px solid var(--hairline); padding: 12px; }
.rail .who { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.rail .who .av { width: 26px; height: 26px; border-radius: var(--r-pill); background: var(--surface-raised); color: var(--ink-soft); display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }
.rail .who .nm { font-weight: 600; }
.rail .who .rl { font-size: 11.5px; color: var(--muted); }

.main { flex: 1; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 14px 26px; background: var(--surface); border-bottom: 1px solid var(--hairline); position: sticky; top: 0; z-index: 4; }
.topbar .sp { flex: 1; }
.topbar h1 { font-size: 20px; }
.topbar .crumb { font-size: 12.5px; color: var(--muted); }
.wrap { padding: 24px 26px 72px; max-width: 1180px; }

/* ================= stat cards ================= */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 22px; }
.statc { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: 15px 17px; box-shadow: var(--lift-sm); position: relative; }
.statc.on { border-color: var(--brand-line); }
.statc .k { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.statc .v { font-size: 30px; font-weight: 650; letter-spacing: -.03em; line-height: 1.1; margin-top: 7px; font-variant-numeric: tabular-nums; }
.statc .n { font-size: 12px; color: var(--faint); margin-top: 3px; }
.statc.accent .v { color: var(--brand-text); }
.statc.ok .v { color: var(--ok); }
.statc.bad .v { color: var(--danger); }

/* ================= cards ================= */
.card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: 19px 21px; margin-bottom: 14px; box-shadow: var(--lift-sm); }
.card > h2 { margin-bottom: 4px; }
.card.pad0 { padding: 0; overflow: hidden; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-main { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 16px; align-items: start; }

.note { border-radius: var(--r); padding: 11px 13px; font-size: 13px; background: var(--info-soft); color: var(--info); border: 1px solid #CFE3F3; display: flex; gap: 9px; }
.note.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.note.bad { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.note.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }

/* ================= controls ================= */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px; font-family: var(--sans);
       font-size: 13px; font-weight: 600; color: var(--ink); background: var(--surface); border: 1px solid var(--field-line);
       border-radius: var(--r-sm); cursor: pointer; white-space: nowrap; flex: none; box-shadow: var(--lift-sm);
       transition: background .12s ease, border-color .12s ease, box-shadow .12s ease, transform .06s ease; }
.btn:hover { border-color: var(--field-border); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn:disabled:hover { border-color: var(--field-line); }
.btn.pri { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.pri:hover { background: var(--brand-text); border-color: var(--brand-text); }
.btn.pri:disabled { background: var(--surface-raised); border-color: var(--surface-raised); color: var(--faint); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.dark:hover { background: #000; border-color: #000; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.ok:hover { background: #226235; border-color: #226235; }
.btn.markb { background: var(--violet-soft); border-color: var(--violet-line); color: var(--violet); }
.btn.markb:hover { border-color: var(--violet); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-sunken); color: var(--ink); }
.btn.wide { width: 100%; }
.btn.lg { height: 40px; padding: 0 20px; font-size: 14px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.field { display: grid; gap: 5px; margin-bottom: 14px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.field input, .field select { height: 36px; padding: 0 11px; font-size: 13.5px; font-family: var(--sans); color: var(--ink);
       background: var(--field-bg); border: 1px solid var(--field-line); border-radius: var(--r-sm); outline: none; width: 100%;
       transition: border-color .12s ease, box-shadow .12s ease; }
.field input:hover, .field select:hover { border-color: var(--field-border); }
.field input:focus, .field select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field .err { color: var(--danger); font-size: 12px; }

/* ================= set picker ================= */
.setsw { display: grid; grid-template-columns: repeat(auto-fit, minmax(156px, 1fr)); gap: 10px; margin-bottom: 8px; }
.setb { text-align: left; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: 13px 15px;
        cursor: pointer; color: var(--ink); box-shadow: var(--lift-sm); transition: border-color .12s ease, box-shadow .12s ease, transform .08s ease; }
.setb:hover { border-color: var(--field-border); box-shadow: var(--lift-md); transform: translateY(-1px); }
.setb.on { border-color: var(--brand); box-shadow: var(--lift-md); }
.setb b { display: block; font-size: 14.5px; font-weight: 650; }
.setb.on b { color: var(--brand-text); }
.setb span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.setb .pill { display: inline-block; margin-top: 8px; font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: var(--r-pill); background: var(--surface-sunken); color: var(--muted); }
.setb.on .pill { background: var(--brand-soft); color: var(--brand-text); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; margin: 0; font-size: 13px; }
.kv dt { color: var(--muted); font-size: 12.5px; }
.kv dd { margin: 0; color: var(--ink-soft); }

/* ================= preflight ================= */
.pf-grid { display: grid; gap: 7px; }
.pf-row { display: flex; align-items: center; gap: 11px; padding: 10px 13px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r); }
.pf-row.is-bad { background: var(--danger-soft); border-color: var(--danger-line); }
.pf-row.is-adv { background: var(--warn-soft); border-color: var(--warn-line); }
.pf-row .st { width: 19px; height: 19px; border-radius: var(--r-pill); display: grid; place-items: center; flex: none; font-size: 10.5px; font-weight: 700; color: #fff; }
.pf-row .st.ok { background: var(--ok); }
.pf-row .st.bad { background: var(--danger); }
.pf-row .st.adv { background: var(--warn); }
.pf-row .lbl { font-size: 13.5px; font-weight: 600; }
.pf-row .dt { font-size: 12.5px; color: var(--muted); }
.advtag { font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--warn); border: 1px solid var(--warn-line); background: #fff; border-radius: var(--r-sm); padding: 1px 5px; margin-left: 7px; }
.pf-cam { width: 100%; aspect-ratio: 4/3; background: #0E0E0F; border-radius: var(--r-lg); overflow: hidden; display: grid; place-items: center; color: var(--faint); font-size: 12.5px; }
.proctor-video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }

.meter { height: 6px; background: var(--surface-raised); border-radius: var(--r-pill); overflow: hidden; }
.meter > i { display: block; height: 100%; width: 0%; background: var(--ok); border-radius: var(--r-pill); transition: width .1s linear; }
.meter.hot > i { background: var(--warn); }
.metrow { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.metrow .lab { min-width: 84px; }
.metrow .meter { flex: 1; }
.metrow .val { font-family: var(--mono); font-size: 11.5px; min-width: 60px; text-align: right; color: var(--ink-soft); }

.rules { margin: 0; padding-left: 19px; color: var(--ink-soft); }
.rules li { margin-bottom: 7px; font-size: 13.5px; }
.rules b { color: var(--ink); }
.agree { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; margin-top: 16px; padding: 13px; background: var(--brand-soft); border: 1px solid var(--brand-line); border-radius: var(--r); color: var(--brand-text); }
.agree input { margin-top: 3px; accent-color: var(--brand); }

/* ================= exam console ================= */
.console { display: flex; flex-direction: column; height: 100vh; overflow: hidden; background: var(--canvas); }
.tbar { display: flex; align-items: center; gap: 14px; background: var(--surface); border-bottom: 1px solid var(--hairline); padding: 9px 16px; flex: none; z-index: 3; }
.tbar .mark { width: 28px; height: 28px; background: var(--brand); color: #fff; border-radius: var(--r-sm); display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }
.tbar .tt b { display: block; font-size: 13px; font-weight: 650; }
.tbar .tt span { font-size: 11.5px; color: var(--muted); }
.tbar .sp { flex: 1; }
.integ { font-size: 11.5px; color: var(--muted); text-align: right; line-height: 1.45; }
.integ b { color: var(--warn); font-weight: 700; }
.integ.hot b { color: var(--danger); }
.cam-thumb { width: 84px; aspect-ratio: 4/3; background: #0E0E0F; position: relative; border-radius: var(--r-sm); overflow: hidden; flex: none; }
.cam-thumb .rec { position: absolute; top: 5px; left: 5px; width: 6px; height: 6px; border-radius: var(--r-pill); background: #E5484D; }
.cam-thumb .vu { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.2); }
.cam-thumb .vu > i { display: block; height: 100%; width: 0%; background: #4CC38A; transition: width .12s linear; }
.cam-thumb .fbadge { position: absolute; right: 4px; top: 4px; font-family: var(--mono); font-size: 8.5px; padding: 1px 4px; border-radius: 3px; background: rgba(0,0,0,.6); color: #fff; }
.cam-thumb .fbadge.bad { background: #E5484D; }
.sectimer { display: flex; flex-direction: column; align-items: flex-end; padding-left: 14px; border-left: 1px solid var(--hairline); }
.sectimer small { font-size: 10.5px; color: var(--muted); }
.sectimer .clk { font-family: var(--mono); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.sectimer.low .clk { color: var(--danger); }

.secnav { display: flex; background: var(--surface); border-bottom: 1px solid var(--hairline); padding: 0 10px; flex: none; }
.secnav .stab { display: inline-flex; align-items: center; gap: 8px; height: 39px; padding: 0 14px; font-size: 13px; font-weight: 600;
                color: var(--faint); background: transparent; border: none; cursor: default; position: relative; }
.secnav .stab.on { color: var(--brand-text); }
.secnav .stab.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--brand); }
.secnav .stab.done { color: var(--ok); }
.secnav .stab .badge { font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: var(--r-pill); background: var(--surface-sunken); color: var(--muted); }
.secnav .stab.on .badge { background: var(--brand-soft); color: var(--brand-text); }
.secnav .stab.done .badge { background: var(--ok-soft); color: var(--ok); }

.body { display: flex; flex: 1; overflow: hidden; }
.qpane { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.qhead { display: flex; align-items: center; gap: 11px; padding: 11px 22px; border-bottom: 1px solid var(--hairline); background: var(--surface); flex: none; }
.qhead .sp { flex: 1; }
.qhead .mk { font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: var(--r-pill); }
.qhead .mk.pos { color: var(--ok); background: var(--ok-soft); }
.qhead .mk.neg { color: var(--danger); background: var(--danger-soft); }

.qscroll { flex: 1; overflow: auto; padding: 22px 24px; display: flex; gap: 20px; align-items: flex-start; }
.ctxpane { flex: 0 0 36%; min-width: 330px; max-width: 470px; align-self: stretch; overflow: auto; background: var(--surface);
           border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: 16px 18px; font-size: 14.5px; line-height: 1.72;
           color: var(--ink); box-shadow: var(--lift-sm); }
.ctxpane .ctxtitle { font-size: 12.5px; line-height: 1.5; color: var(--muted); margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--hairline); }
.ctxpane p { margin: 0 0 11px; max-width: 64ch; }
.ctxpane b { color: var(--brand-text); }
.ctxpane table { border-collapse: separate; border-spacing: 0; width: 100%; margin: 12px 0; font-size: 13px; border: 1px solid var(--hairline); border-radius: var(--r); overflow: hidden; }
.ctxpane th, .ctxpane td { border-bottom: 1px solid var(--hairline); padding: 7px 9px; text-align: center; }
.ctxpane th { font-size: 11.5px; font-weight: 700; color: var(--ink-soft); background: var(--surface-sunken); }
.ctxpane tr:last-child td { border-bottom: none; }
.ctxpane td { font-variant-numeric: tabular-nums; }

.qmain { flex: 1; min-width: 0; }
.qmain.full { max-width: 840px; }
.stem { font-size: 16.5px; line-height: 1.55; margin: 0 0 20px; max-width: 72ch; color: var(--ink); font-weight: 600; letter-spacing: -.012em; }
.stem sup { font-size: .7em; }
.opts { display: grid; gap: 7px; max-width: 840px; }
.opt { display: flex; align-items: flex-start; gap: 12px; padding: 12px 15px; cursor: pointer; background: var(--surface);
       border: 1px solid var(--field-line); border-radius: var(--r); box-shadow: var(--lift-sm);
       transition: border-color .12s ease, background .12s ease, box-shadow .12s ease; }
.opt:hover { border-color: var(--field-border); box-shadow: var(--lift-md); }
.opt.sel { border-color: var(--brand); background: var(--brand-soft); box-shadow: var(--lift-md); }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt .lt { font-family: var(--mono); font-size: 11px; font-weight: 600; width: 21px; height: 21px; display: grid; place-items: center; flex: none;
           border: 1px solid var(--field-line); border-radius: var(--r-sm); color: var(--muted); background: var(--surface); }
.opt.sel .lt { background: var(--brand); border-color: var(--brand); color: #fff; }
.opt .tx { font-size: 14.5px; line-height: 1.55; color: var(--ink); }
.kbd { margin-top: 20px; font-size: 12px; color: var(--faint); }
kbd { font-family: var(--mono); border: 1px solid var(--field-line); border-bottom-width: 2px; border-radius: 3px; padding: 1px 5px; font-size: 10.5px; background: var(--surface); }

.abar { display: flex; align-items: center; gap: 8px; padding: 11px 22px; border-top: 1px solid var(--hairline); background: var(--surface); flex: none; flex-wrap: wrap; }
.abar .sp { flex: 1; }

.side { width: 248px; border-left: 1px solid var(--hairline); background: var(--surface); display: flex; flex-direction: column; overflow: hidden; flex: none; }
.side .cand { display: flex; align-items: center; gap: 10px; padding: 14px; border-bottom: 1px solid var(--hairline); }
.side .cand .av { width: 30px; height: 30px; background: var(--brand-soft); color: var(--brand-text); border-radius: var(--r-pill); display: grid; place-items: center; font-size: 11.5px; font-weight: 700; flex: none; }
.side .cand .nm { font-size: 13px; font-weight: 650; }
.side .cand .em { font-size: 11.5px; color: var(--muted); }
.legend { padding: 14px; display: grid; gap: 8px; border-bottom: 1px solid var(--hairline); }
.legend .row { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--ink-soft); }

.pb { min-width: 32px; height: 30px; border: 1px solid var(--field-line); background: var(--surface); font-family: var(--mono); font-size: 12px;
      font-weight: 600; cursor: pointer; display: inline-grid; place-items: center; border-radius: var(--r-sm); color: var(--ink-soft);
      font-variant-numeric: tabular-nums; transition: border-color .12s ease; }
.pb:hover { border-color: var(--field-border); }
.pb.static { min-width: 20px; height: 18px; font-size: 9.5px; cursor: default; }
.pb.nv { color: var(--muted); }
.pb.na { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.pb.a  { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.pb.m  { background: var(--violet-soft); border-color: var(--violet-line); color: var(--violet); }
.pb.am { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-text); }
.pb.cur { outline: 2px solid var(--ink); outline-offset: 1px; }
.palwrap { flex: 1; overflow: auto; padding: 14px; }
.palwrap h4 { font-size: 11.5px; font-weight: 700; color: var(--muted); margin-bottom: 10px; }
.pal { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }

/* ================= modal / toast ================= */
.modal { position: fixed; inset: 0; background: var(--overlay); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal .box { background: var(--surface); border-radius: var(--r-lg); max-width: 470px; width: 100%; padding: 21px; box-shadow: var(--lift-lg); }
.modal .actions { justify-content: flex-end; margin-top: 18px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 15px;
         border-radius: var(--r); font-size: 13px; z-index: 60; max-width: 90vw; box-shadow: var(--lift-lg); }
.toast.warn { background: var(--warn); }

/* ================= tables ================= */
.tblwrap { overflow-x: auto; }
table.tbl { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
table.tbl th, table.tbl td { border-bottom: 1px solid var(--hairline); padding: 9px 11px; text-align: left; }
table.tbl th { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); background: var(--surface-sunken); }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl td { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
table.tbl td b { color: var(--ink); }

/* ================= result ================= */
.scoreline { display: flex; align-items: center; gap: 38px; flex-wrap: wrap; }
.bigscore { display: flex; align-items: baseline; gap: 6px; }
.bigscore .v { font-size: 50px; font-weight: 650; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; color: var(--brand-text); }
.bigscore .d { font-size: 13px; color: var(--muted); }
.stat { margin: 0 24px 8px 0; }
.stat .k { font-size: 11.5px; color: var(--muted); }
.stat .v { font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; }
.anagrid { display: flex; flex-wrap: wrap; }

.co-scale { position: relative; height: 30px; margin: 30px 0 6px; border-radius: var(--r); background: linear-gradient(90deg, var(--danger-soft), var(--warn-soft) 55%, var(--ok-soft)); border: 1px solid var(--hairline); }
.co-fill { position: absolute; inset: 0 auto 0 0; background: rgba(26,92,255,.13); border-right: 2px solid var(--brand); border-radius: var(--r) 0 0 var(--r); }
.co-mark { position: absolute; top: -20px; transform: translateX(-50%); font-family: var(--mono); font-size: 9.5px; white-space: nowrap; text-transform: uppercase; }
.co-mark::after { content: ""; position: absolute; left: 50%; top: 15px; width: 1px; height: 30px; transform: translateX(-50%); background: currentColor; opacity: .55; }
.co-mark span { padding: 2px 6px; border: 1px solid currentColor; border-radius: 3px; background: var(--surface); }
.co-mark.sbi { color: var(--warn); }
.co-mark.ibps { color: var(--danger); }
.co-mark.you { top: 35px; color: var(--brand); }
.co-mark.you::after { top: -30px; }
.co-mark.you span { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; }
.co-axis { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10px; color: var(--faint); margin-top: 10px; }

.rq { border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: 16px 18px; margin-bottom: 9px; background: var(--surface); box-shadow: var(--lift-sm); }
.rq.is-ok { border-left: 3px solid var(--ok); }
.rq.is-bad { border-left: 3px solid var(--danger); }
.rq.is-skip { border-left: 3px solid var(--hairline-strong); }
.rq .top { display: flex; gap: 8px; align-items: center; font-size: 11.5px; color: var(--muted); margin-bottom: 11px; flex-wrap: wrap; }
.rq .top b { color: var(--ink); font-weight: 700; }
.rq .stem { max-width: 80ch; font-size: 15px; }
.tag { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: var(--r-pill); }
.tag.ok { color: var(--ok); background: var(--ok-soft); }
.tag.bad { color: var(--danger); background: var(--danger-soft); }
.tag.skip { color: var(--muted); background: var(--surface-sunken); }
.ro { display: grid; gap: 5px; margin: 11px 0; }
.ro > div { display: flex; gap: 10px; padding: 9px 12px; font-size: 13.5px; border: 1px solid var(--hairline); border-radius: var(--r); color: var(--ink-soft); }
.ro > div b { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.ro .key { border-color: var(--ok-line); background: var(--ok-soft); color: var(--ink); }
.ro .key b { color: var(--ok); }
.ro .mine.wrong { border-color: var(--danger-line); background: var(--danger-soft); }
.ro .mine.wrong b { color: var(--danger); }
.ro .who { margin-left: auto; font-size: 10.5px; font-weight: 600; color: var(--muted); }
.ex { max-width: 92ch; background: var(--surface-sunken); border-radius: var(--r); padding: 12px 14px; font-size: 13px; line-height: 1.65; color: var(--ink-soft); }
.ex b { color: var(--ink); }

/* ================= capture report ================= */
.caprow { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 13px; }
.caprow dt { color: var(--muted); font-size: 12.5px; }
.caprow dd { margin: 0; color: var(--ink-soft); word-break: break-word; }
.evlist { max-height: 330px; overflow: auto; border: 1px solid var(--hairline); border-radius: var(--r); }
.evrow { display: flex; gap: 12px; padding: 8px 12px; font-size: 12.5px; border-bottom: 1px solid var(--hairline); align-items: baseline; }
.evrow:last-child { border-bottom: none; }
.evrow .ts { font-family: var(--mono); color: var(--faint); flex: none; }
.evrow .ty { font-weight: 650; flex: none; min-width: 126px; }
.evrow.sev { background: var(--danger-soft); }
.evrow.sev .ty { color: var(--danger); }
.evrow.warnrow .ty { color: var(--warn); }
.evrow .de { color: var(--muted); }
.spark { display: flex; align-items: flex-end; gap: 1px; height: 42px; background: var(--surface-sunken); border-radius: var(--r); padding: 3px; }
.spark i { flex: 1; background: var(--brand); opacity: .55; border-radius: 1px 1px 0 0; min-height: 1px; }
.spark i.hot { background: var(--warn); opacity: 1; }

/* ================= responsive ================= */
@media (max-width: 1180px) { .grid-main { grid-template-columns: 1fr; } }
@media (max-width: 1080px) {
  .grid2 { grid-template-columns: 1fr; }
  .side { display: none; }
  .qscroll { flex-direction: column; }
  .ctxpane { flex: none; max-width: none; width: 100%; min-width: 0; }
  .cam-thumb { width: 64px; }
  .integ { display: none; }
  .sectimer .clk { font-size: 17px; }
}
@media (max-width: 860px) {
  .rail { display: none; }
  .wrap { padding: 18px 16px 60px; }
  .topbar { padding: 12px 16px; }
}

/* Overall wall clock beside the section clock */
.sectimer.alt { background: var(--surface-sunken); }
.sectimer.alt .clk { color: var(--ink-soft); }

/* ---------- DI charts (inline SVG, no library, no network) ---------- */
.chart { margin: 14px 0 6px; padding: 0; }
.chart > figcaption {
  font: 500 11.5px/1.3 "Google Sans Code", ui-monospace, monospace;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px;
}
.chart svg {
  display: block; width: 100%; height: auto;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--hairline); border-radius: var(--r-sm);
  padding: 10px 6px; box-sizing: border-box;
}
.chart svg text { font-family: "Google Sans", system-ui, sans-serif; }
@media print { .chart svg { break-inside: avoid; } }

/* ---------- puzzle arrangement diagrams (score sheet only) ---------- */
.ctxsol {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--hairline);
}
.ctxsoltitle {
  font: 500 11.5px/1.3 "Google Sans Code", ui-monospace, monospace;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--brand-text); margin-bottom: 4px;
}
.chart.diag svg { padding: 14px 8px; }
.diagnote {
  margin: 8px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted);
}
/* A solution diagram sits inside a solution block, so it needs less lead-in. */
.ex .chart { margin: 12px 0 2px; }
.ex .chart > figcaption { margin-bottom: 6px; }

/* ================= sign in: promo rail + form panel ================= */
/* Split screen after Advox: the rail carries the pitch, the panel the form.
   No gradient. The two halves are separated by a tone step and one hairline. */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(430px, 38%);
  background: var(--canvas);
}
.auth-rail {
  display: flex; flex-direction: column; gap: 28px;
  padding: 44px 40px;
  /* A flat tint of the one accent, not a second colour and not a gradient.
     surface-sunken against canvas is only about 1.07:1, which reads as an
     accident rather than as two deliberate halves. */
  background: var(--brand-soft);
  border-right: 1px solid #DCE5FB;
}
.auth-rail-body { margin: auto 0; display: flex; flex-direction: column; gap: 18px; max-width: 520px; }

.auth-lockup { display: flex; align-items: center; gap: 11px; }
.mark.lg {
  width: 34px; height: 34px; border-radius: var(--r-sm);
  background: var(--brand); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; letter-spacing: .01em;
}
.auth-wordmark { font-size: 15px; font-weight: 650; color: var(--ink); letter-spacing: -.01em; }
.auth-subword { font-size: 12.5px; color: var(--muted); margin-top: 1px; }

.auth-kicker {
  font: 500 11.5px/1.3 "Google Sans Code", ui-monospace, monospace;
  letter-spacing: .05em; text-transform: uppercase; color: var(--brand-text);
}
.auth-display {
  margin: 0; font-size: clamp(27px, 3.1vw, 38px); font-weight: 700;
  line-height: 1.12; letter-spacing: -.025em; color: var(--ink);
}
.auth-points {
  list-style: none; margin: 0; padding: 24px 0 0;
  display: flex; flex-direction: column; gap: 20px;
  border-top: 1px solid #DCE5FB;
}
.auth-point { display: flex; gap: 11px; align-items: flex-start; }
.auth-point-ico { flex: none; margin-top: 2px; color: var(--brand-text); line-height: 0; }
.auth-point-title { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.4; }
.auth-point-body { font-size: 13px; line-height: 1.55; color: var(--ink-soft); max-width: 52ch; margin-top: 3px; }
.auth-foot {
  margin: 0; font: 400 12px/1.5 "Google Sans Code", ui-monospace, monospace;
  color: var(--brand-text); opacity: .62; letter-spacing: .01em;
}

.auth-panel {
  display: flex; flex-direction: column;
  padding: 22px 30px 40px; background: var(--canvas); overflow-y: auto;
}
.auth-panel-brand { display: none; }
.auth-card {
  width: 100%; max-width: 372px; margin: auto;
  padding: 28px; background: var(--surface);
  border: 1px solid var(--hairline); border-radius: var(--r-lg);
  box-shadow: var(--lift-sm);
  display: flex; flex-direction: column; gap: 14px;
}
.auth-head { display: flex; flex-direction: column; gap: 5px; margin-bottom: 2px; }
.auth-title {
  margin: 0; font-size: 25px; font-weight: 650; line-height: 1.16;
  letter-spacing: -.022em; color: var(--ink);
}
.auth-card .field { margin: 0; }
.auth-card .btn.lg { margin-top: 4px; }
.auth-note { margin: 2px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }

/* The rail is the first thing to go; the card keeps its border a while longer. */
@media (max-width: 1000px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-rail { display: none; }
  .auth-panel-brand { display: block; margin-bottom: 8px; }
}
@media (max-width: 520px) {
  .auth-panel { padding: 22px 16px 32px; }
  .auth-card { padding: 20px 4px; border: 0; box-shadow: none; background: transparent; }
}

/* The rail carries the pitch on a wide screen. Below 1000px it is gone, so a
   condensed version of the same pitch moves into the form panel rather than
   the promise disappearing entirely on a phone. */
.auth-mini { display: none; }
.auth-panel-points, .auth-panel-foot { display: none; }
@media (max-width: 1000px) {
  .auth-panel { padding-top: 26px; }
  .auth-panel-brand { display: block; margin-bottom: 0; }
  .auth-mini { display: flex; flex-direction: column; gap: 6px; margin: 22px 0 4px; max-width: 520px; }
  .auth-minihead {
    margin: 0; font-size: clamp(22px, 5.4vw, 28px); font-weight: 700;
    line-height: 1.16; letter-spacing: -.022em; color: var(--ink);
  }
  .auth-card { margin: 22px 0 0; }
  .auth-panel-points {
    display: flex; flex-direction: column; gap: 16px;
    list-style: none; margin: 26px auto 0; padding: 22px 0 0;
    width: 100%; max-width: 372px;
    border-top: 1px solid var(--hairline);
  }
  .auth-panel-foot { display: block; margin: 20px auto 0; width: 100%; max-width: 372px; }
}
@media (max-width: 520px) {
  .auth-panel-points, .auth-panel-foot { max-width: none; }
}
