/* ---------------------------------------------------------------------------
   AlphaDrill exam runner - structural layout for the full-screen test view.
   Colours here are only fallbacks; exam-lux.css recolours everything to the
   AlphaDrill ink/bone/gold palette (and dark mode). This file owns layout, not
   brand identity - the runner is AlphaDrill's own design, not a clone.
--------------------------------------------------------------------------- */
:root{
  --green:#8cc63f;          /* Prometric green bars */
  --green-d:#7ab32f;
  --dark:#3f3f3f;           /* top/bottom chrome */
  --ink:#222;
  --line:#bbb;
  --bg:#e9ecef;
  --sel:#e8a33d;            /* selected choice outline (orange in screenshots) */
  --ok:#1f7a33;
  --bad:#b3261e;
  --font:"Segoe UI",Arial,Helvetica,sans-serif;
}
*{box-sizing:border-box}
body{margin:0;font-family:var(--font);color:var(--ink);background:var(--bg)}
a{color:#2a6fb0}
.muted{color:#666;font-size:14px}
code{background:#dde2e6;padding:1px 5px;border-radius:3px}
.hidden{display:none!important}

/* ---------- generic pages (home / results / dashboard) ---------- */
.home-wrap{max-width:980px;margin:0 auto;padding:28px 22px}
.home-header h1{margin:0 0 4px;font-size:24px}
.mode-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;margin-top:22px}
.mode-card{background:#fff;border:1px solid var(--line);border-radius:8px;padding:20px}
.mode-card h2{margin:0 0 6px;font-size:18px}
.mode-card p{font-size:14px;color:#555;min-height:38px}
.mode-card label{display:block;font-size:13px;margin:8px 0 2px;color:#444}
.mode-card input,.mode-card select{width:100%;padding:7px;border:1px solid var(--line);border-radius:4px}
.btn-primary.btn-pending{background:#b78600;border-color:#8c6700;animation:pulseSave 1s ease-in-out infinite}
@keyframes pulseSave{0%,100%{opacity:1}50%{opacity:.78}}
.btn-primary{background:var(--green);border:1px solid var(--green-d);color:#fff;
  padding:9px 18px;border-radius:4px;font-weight:600;cursor:pointer;text-decoration:none;display:inline-block}
.btn-primary:hover{background:var(--green-d)}
.btn-ghost{background:#fff;border:1px solid var(--line);color:#333;
  padding:9px 16px;border-radius:4px;cursor:pointer;text-decoration:none;display:inline-block}

.score-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin:18px 0}
.score-card{background:#fff;border:1px solid var(--line);border-radius:8px;
  padding:18px;text-align:center;font-size:13px;color:#666}
.score-card .big{display:block;font-size:30px;color:var(--ink);font-weight:700}

/* ---- End-of-session results screen ---- */
.results-pane{max-width:680px;margin:0 auto;padding:8px 4px 32px}
.results-block{margin:20px 0}
.results-block h3{font-size:13px;text-transform:uppercase;letter-spacing:.06em;color:#6c7589;margin:0 0 8px}
.pass-list,.weak-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:2px}
.pass-list li,.weak-list li{display:flex;align-items:baseline;gap:10px;padding:9px 12px;background:#fafaf7;
  border:1px solid var(--line);border-radius:6px;font-size:14px}
.pass-list li span:first-child,.weak-list li span:first-child{flex:1;color:var(--ink)}
.pass-list li strong,.weak-list li strong{font-size:15px;min-width:46px;text-align:right}
.pass-list .fine,.weak-list .fine{min-width:96px;text-align:right}
.results-rec{background:#fbf7ee;border:1px solid #e4dccd;border-radius:8px;padding:12px 14px;
  font-size:14px;line-height:1.5;color:var(--ink);margin:18px 0 6px}
.results-actions{flex-wrap:wrap;gap:10px;margin-top:18px}

.data-table{width:100%;border-collapse:collapse;background:#fff;margin:10px 0 22px}
.data-table th,.data-table td{border:1px solid #d6dadf;padding:8px 10px;font-size:14px;text-align:left}
.data-table th{background:#f1f3f5}
.pill{display:inline-block;padding:2px 9px;border-radius:11px;font-size:12px;font-weight:700;color:#fff}
.pill-hi{background:var(--bad)} .pill-mid{background:#d98324} .pill-ok{background:var(--ok)}
.two-col{display:grid;grid-template-columns:1fr 1fr;gap:22px}
.trend{display:flex;gap:6px;align-items:flex-end;height:140px;background:#fff;
  border:1px solid var(--line);border-radius:8px;padding:14px}
.trend .bar{flex:1;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;height:100%}
.trend .bar-fill{width:60%;background:var(--green);border-radius:3px 3px 0 0}
.trend .bar span{font-size:11px;color:#666;margin-top:3px}

/* ---------- exam runner - full-screen test layout ---------- */
/* Body is a viewport-tall flex column: shared nav on top, the runner shell
   filling the middle, the shared footer pinned to the bottom. The page itself
   never scrolls - only the panes inside the board do. */
.exam-body{background:#fff;overflow:hidden;height:100vh;display:flex;flex-direction:column}
.exam-body>.bank-tabs{flex:none}
.exam-body>.import-foot{flex:none}
/* shell takes the space between the shared nav and footer; only the panes
   inside it scroll, so the question on the right stays pinned while the user
   scrolls down the vignette on the left. */
.exam-shell{flex:1 1 auto;min-height:0;overflow:hidden;display:flex;flex-direction:column}

/* Exam status bar - a tight single row: question identity on the left, the
   live timer + progress, then the test actions pushed to the right. */
.exam-topbar{background:var(--dark);color:#fff;display:flex;align-items:center;
  gap:10px 26px;padding:9px 24px;font-size:13px;flex-wrap:wrap;
  position:sticky;top:0;z-index:50}
.exam-topbar strong{font-weight:700}

/* action buttons - submit (primary) + finish (secondary), aligned right */
.tb-actions{display:flex;gap:10px;align-items:center;margin-left:auto}
.exam-topbar .btn-primary{padding:8px 22px;border-radius:6px;font-weight:600}
.tb-actions .tb-finish{margin-left:4px}
.src-ref{display:inline-flex;align-items:center;background:#2b2b2b;color:#e0e0e0;
  border:1px solid #555;border-radius:4px;padding:6px 12px;font-size:12.5px;
  font-weight:600;max-width:230px;white-space:nowrap;overflow:hidden;
  text-overflow:ellipsis;cursor:help}
.tb-left{line-height:1.4;display:flex;flex-direction:column;gap:2px}
.tb-qline{font-size:14px;font-weight:600}
.tb-qline .tb-lbl{font-weight:600;opacity:.62;text-transform:uppercase;
  letter-spacing:.07em;font-size:11px;margin-right:3px}
.tb-qline #qNum{font-weight:700}
.tb-sep{opacity:.4;margin:0 2px}
.tb-src{font-size:11.5px;font-weight:500;letter-spacing:.02em;opacity:.78;
  max-width:320px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:default}
.tb-mid{display:flex;align-items:center;gap:8px;line-height:1.2}
.tb-mid .clock{font-size:17px}
.tb-time{display:flex;flex-direction:column;gap:1px}
.tb-time .tb-lbl{font-size:10px;text-transform:uppercase;letter-spacing:.07em;opacity:.62}
.tb-time #timer{font-weight:700;font-size:14px;font-variant-numeric:tabular-nums}
.tb-progress{display:flex;align-items:center;gap:10px;font-size:11.5px;
  font-weight:600;letter-spacing:.01em;line-height:1}
.tb-bar{width:120px;height:6px;background:#5d5d5d;border-radius:99px;overflow:hidden;margin:0}
.tb-bar span{display:block;height:100%;background:#cfcfcf;border-radius:99px;transition:width .25s ease}
.tb-finish{background:#f6f0d8;color:#3a3a3a;border:1px solid #c9c08f;
  padding:8px 18px;border-radius:6px;font-weight:600;text-decoration:none;font-size:13px}
.tb-finish:hover{background:#efe6c4}

/* test context band - a slim editorial strip under the status bar */
.exam-testbar{background:var(--green);color:#fff;padding:7px 24px;font-size:12.5px;
  display:flex;justify-content:space-between;align-items:center;gap:16px;font-weight:600;
  position:sticky;top:var(--topbar-h,46px);z-index:49}
.exam-testbar .tb-meta{flex:none;letter-spacing:.02em}
.exam-testbar .tb-topic{min-width:0;white-space:nowrap;overflow:hidden;
  text-overflow:ellipsis;text-align:right;font-weight:500;opacity:.92}
.exam-testbar sup{font-size:9px}

/* main row: nav rail beside a bordered board (case pane | question pane) */
.exam-main{flex:1;display:flex;background:#fff;min-height:0;gap:18px;
  padding:20px max(24px,calc((100% - 1280px)/2 + 24px)) 22px}
.exam-nav{width:60px;flex:none;display:flex;flex-direction:column;gap:8px;
  padding:4px 2px;overflow:auto;background:transparent;border-right:0}
.navnum{position:relative;height:38px;border-radius:10px;background:#eef0f2;
  color:#555;display:flex;align-items:center;justify-content:center;
  font-size:13px;font-weight:600;text-decoration:none;
  cursor:pointer;transition:background .12s,color .12s,box-shadow .12s}
a.navnum:hover{background:#e3e6e9;color:#222}
.navnum.done{background:#1f1f1f;color:#fff}
a.navnum.done:hover{background:#000}
.navnum.active{background:#a9d96a;color:#33401c}
a.navnum.active:hover{background:#a9d96a;color:#33401c}
.navchild{margin-left:14px;height:34px;font-size:12px}
.navgroup{position:relative;height:38px;border-radius:10px;
  background:#eef0f2;color:#555;display:flex;align-items:center;
  justify-content:center;gap:6px;font-size:13px;font-weight:600}
.navgroup.done{background:#1f1f1f;color:#fff}
.navgroup.active{background:#a9d96a;color:#33401c}
.navcaret{font-size:10px;opacity:.85}
.navarrow{position:absolute;right:-9px;color:#a9d96a;font-size:15px;
  text-shadow:0 0 0 #a9d96a}

.exam-board{flex:1;min-width:0;min-height:0;border:1px solid #c4c8cc;
  border-radius:12px;background:#fff;display:flex;overflow:hidden}
.exam-content{flex:1;display:flex;min-width:0;min-height:0}
.exam-content.single .pane-right{flex:1;padding:22px 28px;overflow:auto;
  min-height:0}
.exam-content.split{flex:1;display:flex;min-width:0;min-height:0}
.exam-content.split .pane-left{width:46%;min-width:320px;display:flex;
  flex-direction:column;min-height:0;border-right:1px solid #c4c8cc;background:#fff}
.exam-content.split .pane-right{flex:1;padding:22px 26px;overflow:auto;
  min-width:0;min-height:0}

/* "Case Scenario" panel header (charcoal title bar like the real driver) */
.case-titlebar{background:var(--dark);color:#fff;display:flex;
  justify-content:space-between;align-items:center;padding:7px 14px;
  font-size:15px;font-weight:600;flex:none}
.case-ico{color:#cfcfcf;font-size:13px;letter-spacing:6px}
.case-body{flex:1;min-height:0;overflow:auto;padding:20px 24px}
.pane-left .vignette{border:0;background:none;padding:0;margin:0;max-height:none}
.vignette{font-size:14px;line-height:1.65;color:#222}
.vignette p{margin:0 0 12px}
.case-launch{display:inline-flex;align-items:center;gap:8px;border:1px solid #c4c8cc;
  border-radius:4px;background:#fafafa;padding:9px 16px;font-size:14px;
  font-weight:600;margin-bottom:20px}
.case-launch .cl-ico{font-size:16px;color:#5a7d33}

table.exhibit{border-collapse:collapse;margin:12px 0;font-size:13px;width:100%}
table.exhibit td,table.exhibit th{border:1px solid #c7ccd1;padding:6px 10px}
table.exhibit tr:first-child td,table.exhibit th{background:#eef1f3;font-weight:700}

/* question stem + answer choices */
.qstem{font-size:15px;line-height:1.55;background:#eef0f1;border:1px solid #dfe2e4;
  padding:15px 18px;border-radius:4px;margin-bottom:22px}
.qimg{max-width:100%;border:1px solid var(--line);margin-bottom:20px}
.choices{display:flex;flex-direction:column;gap:18px;max-width:880px}
.choice{display:flex;align-items:stretch;gap:14px;cursor:pointer}
.choice .ckey{flex:none;width:20px;text-align:center;font-weight:700;font-size:15px;
  align-self:center;color:#333}
.choice .cbox{flex:1;display:flex;align-items:center;border:1px solid #2f2f2f;
  border-radius:3px;padding:16px 18px;background:#fff;min-height:54px;
  font-size:14.5px;transition:border-color .1s,box-shadow .1s}
.choice:hover .cbox{background:#fafafa}
.choice .cbox input{position:absolute;opacity:0;width:0;height:0}
.choice.sel .cbox{border-color:var(--sel);box-shadow:0 0 0 2px var(--sel) inset}
.choice.correct .cbox{border-color:var(--ok);box-shadow:0 0 0 2px var(--ok) inset}
.choice.wrong .cbox{border-color:var(--bad);box-shadow:0 0 0 2px var(--bad) inset}
.choices textarea{width:100%;padding:12px;border:1px solid #c4c8cc;border-radius:4px;
  font-family:var(--font);font-size:14px;line-height:1.5}

/* self-graded feedback block (study-mode addition, kept tidy) */
.feedback{margin-top:24px;border:1px solid var(--line);border-radius:6px;overflow:hidden}
.feedback .fb-head{padding:12px 16px;font-weight:700;color:#fff}
.feedback.good .fb-head{background:var(--ok)}
.feedback.bad .fb-head{background:var(--bad)}
.feedback .fb-key-label{padding:8px 16px 0;font-size:12px;font-weight:700;
  text-transform:uppercase;letter-spacing:.4px;color:#777;background:#fbfbfb}
.feedback .fb-expl{padding:8px 16px 14px;background:#fbfbfb;font-size:14px;
  line-height:1.55;white-space:pre-wrap}
.self-grade{display:flex;align-items:center;gap:12px;padding:12px 16px;
  background:#f1f3f5;border-top:1px solid var(--line)}
.self-grade span{font-size:14px;color:#444;margin-right:auto}

/* bottom charcoal bar - sticks to the viewport bottom like the real exam */
.exam-footer{background:var(--dark);color:#fff;display:flex;align-items:center;
  justify-content:space-between;padding:9px 16px;
  position:sticky;bottom:0;z-index:40}
.ft-tools{display:flex;align-items:center;gap:14px}
.ft-ico{width:30px;height:30px;border-radius:50%;display:flex;align-items:center;
  justify-content:center;font-size:16px;color:#3a3a3a;background:#d7d7d7}
.ft-ico.ft-help{font-weight:700}
.ft-tools .qid{color:#9a9a9a;font-size:12px;margin-left:6px}
.exam-disclaimer{color:#9a9a9a;font-size:11px;line-height:1.4;text-align:right;max-width:64ch}
.exam-disclaimer a{color:#c8c8c8;text-decoration:underline}
.footer-btns{display:flex;gap:10px;align-items:center}
.ft-flag{width:38px;height:38px;border-radius:4px;background:#fff;border:1px solid #c9c08f;
  color:var(--green-d);font-size:18px;cursor:pointer;line-height:1}
.ft-flag.flagged{background:var(--sel);color:#fff;border-color:var(--sel)}
.exam-footer .btn-primary{background:var(--green);border:1px solid var(--green-d);
  padding:9px 22px;border-radius:5px;font-weight:700}
.exam-footer .btn-primary:hover{background:var(--green-d)}
.exam-footer .btn-ghost{background:#fff;border:1px solid #c9c08f;padding:9px 18px;
  border-radius:5px;font-weight:700;color:#3a3a3a}

/* ---------- phone layout (iPhone Safari, practice on the go) ---------- */
@media(max-width:760px){
  html{-webkit-text-size-adjust:100%}
  /* topbar: let the chrome wrap instead of overflowing off-screen */
  .exam-topbar{gap:10px 16px;flex-wrap:wrap;padding:8px 12px;font-size:12.5px}
  .tb-mid{gap:7px}
  .tb-progress{order:3}
  .tb-finish{margin-left:auto;padding:7px 14px;font-size:13px}
  .exam-testbar{flex-wrap:wrap;gap:2px 12px;font-size:12px}

  /* stack the rail above the board as a horizontal, swipeable strip */
  .exam-shell{min-height:auto}
  .exam-main{flex-direction:column;padding:8px;gap:8px}
  .exam-nav{width:auto;flex-direction:row;flex-wrap:nowrap;overflow-x:auto;
    gap:6px;padding:8px 6px;-webkit-overflow-scrolling:touch;order:-1;
    background:#f4f6f7;border-right:0;border-bottom:1px solid #c4c8cc;
    max-height:none}
  .navnum,.navgroup{flex:none;height:34px;min-width:42px;padding:0 12px;
    border-radius:17px}
  .navchild{margin-left:0;height:34px;font-size:12px}
  .navarrow{display:none}

  /* vignette + question stack vertically, page scrolls instead of panes */
  .exam-board{flex-direction:column;overflow:visible}
  .exam-content,.exam-content.split{flex-direction:column}
  .exam-content.split .pane-left{width:100%;min-width:0;
    border-right:0;border-bottom:1px solid #c4c8cc}
  .case-body{padding:14px 16px}
  .exam-content.single .pane-right,
  .exam-content.split .pane-right{width:100%;padding:16px 16px 24px;
    max-height:none;overflow:visible}

  .qstem{font-size:16px;padding:13px 14px}
  .choices{gap:12px}
  .choice .cbox{padding:14px;min-height:52px;font-size:16px}
  .choices textarea{font-size:16px}            /* >=16px stops iOS focus-zoom */

  .self-grade{flex-wrap:wrap;gap:8px}
  .self-grade .btn-primary,.self-grade .btn-ghost{flex:1 1 100%;text-align:center}

  /* action buttons get thumb-friendly full-width sizing on phones */
  .tb-actions{order:5;width:100%;margin-left:0;flex-wrap:wrap;gap:8px}
  .exam-topbar .btn-primary{flex:1 1 auto;text-align:center;padding:12px 18px}
  .exam-topbar #nextBtn{flex:1 1 100%}
  .tb-actions .tb-finish{flex:1 1 100%;text-align:center;margin-left:0}

  /* generic pages */
  .home-wrap{padding:18px 14px}
  .data-table{display:block;overflow-x:auto;white-space:nowrap}
}

/* ---------- importer review ---------- */
.rev-card{background:#fff;border:1px solid var(--line);border-radius:6px;padding:14px;margin:12px 0}
.rev-card.rev-flag{border-left:5px solid #d98324}
.rev-keep{font-size:12px;color:#666;float:right}
.rev-card textarea,.rev-card input,.rev-card select{width:100%;padding:7px;
  border:1px solid var(--line);border-radius:4px;margin:4px 0;font-family:var(--font)}
.rev-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.rev-vig{font-size:13px;background:#f6f7f8;border:1px solid #e3e6e9;
  border-radius:4px;padding:8px 10px;margin:4px 0}
.rev-vig summary{cursor:pointer;color:#2a6fb0;font-weight:600}
.rev-vig table.exhibit td{border:1px solid #c7ccd1;padding:4px 7px}
@media(max-width:760px){.mode-grid,.score-grid,.two-col,.rev-grid{grid-template-columns:1fr}}

/* --------------------------------------------------------------------------
   Question Bank - structured revision view (distinct from the exam runner)
-------------------------------------------------------------------------- */
.bank-wrap{max-width:min(1680px,96vw);margin:0 auto;padding:22px 26px 60px;
  font-family:Segoe UI,Arial,sans-serif;color:var(--ink)}
.bank-tabs{display:flex;gap:4px;margin-bottom:22px;border-bottom:2px solid var(--line)}
.bank-tabs.home{max-width:760px;margin:18px auto 0}
.bank-tabs a{padding:10px 20px;text-decoration:none;color:#555;font-weight:600;
  border:1px solid transparent;border-bottom:none;border-radius:6px 6px 0 0}
.bank-tabs a.active{background:#fff;color:var(--ink);
  border-color:var(--line);border-bottom:2px solid #fff;margin-bottom:-2px}
.bank-tabs a:hover{color:var(--ink)}
.bank-wrap h1{font-size:24px;margin:6px 0 4px}
.crumb{font-size:13px;color:#666;margin:0 0 14px}
.crumb a{color:#3a6ea5;text-decoration:none}
.bank-row{display:grid;grid-template-columns:1fr auto;gap:8px 16px;
  align-items:center;padding:16px 20px;background:#fff;border:1px solid var(--line);
  border-left:4px solid #c4c4c4;border-radius:8px;text-decoration:none;
  color:var(--ink);transition:box-shadow .12s}
.bank-row:hover{box-shadow:0 2px 8px rgba(0,0,0,.08)}
.bank-row.unmapped{background:#fbfbf5;border-left-style:dashed}
.br-name{font-weight:700;font-size:16px}
.br-meta{display:flex;gap:6px;justify-self:end;align-items:center}
.bank-row .bar{grid-column:1/-1;height:6px;background:#e9e9e9;
  border-radius:4px;overflow:hidden}
.bank-row .bar .bar-fill{display:block;height:100%;background:var(--green)}
.pill{font-size:12px;background:#eef1f4;color:#445;padding:3px 9px;border-radius:11px}
.pill.accg{background:#e3f3e6;color:var(--ok)}
.pill.acca{background:#fdf2dd;color:#9a6b15}
.pill.accr{background:#fbe6e4;color:var(--bad)}
.bar{grid-column:1/-1;height:5px;background:#eef1f4;border-radius:3px;overflow:hidden}
.bar-fill{display:block;height:100%;background:var(--green)}
.sec-head{display:flex;justify-content:space-between;align-items:center;
  flex-wrap:wrap;gap:12px;margin-bottom:8px}
.cat-h{font-size:17px;margin:26px 0 10px;padding-bottom:5px;
  border-bottom:1px solid var(--line)}
.qcard{background:#fff;border:1px solid var(--line);border-radius:8px;
  margin-bottom:8px}
.qcard>summary{cursor:pointer;padding:13px 16px;display:grid;
  grid-template-columns:150px 1fr 160px;gap:14px;align-items:start;list-style:none}
.qcard>summary::-webkit-details-marker{display:none}
.qcard[open]>summary{border-bottom:1px solid var(--line);background:#fafafa}
.q-src{font-size:11px;color:#777;text-transform:uppercase;letter-spacing:.04em}
.q-stem{font-size:14px;line-height:1.45}
.q-hist{font-size:12px;color:#666;text-align:right}
.warn{color:#9a6b15;font-weight:600}
.qbody{padding:14px 18px;font-size:14px;line-height:1.5}
.qbody .vignette{background:#f7f7f4;border:1px solid var(--line);
  padding:10px 14px;border-radius:6px;margin-bottom:12px;font-size:13px}
.opts{list-style:none;padding:0;margin:0 0 12px}
.opts li{padding:6px 10px;border:1px solid #e4e4e4;border-radius:5px;margin:4px 0}
.opts li.right{background:#e8f5ea;border-color:#bcdcc1}
.tag{font-size:11px;background:var(--ok);color:#fff;padding:1px 7px;
  border-radius:9px;margin-left:6px}
.ans{background:#f9fbfc;border-left:3px solid var(--green);
  padding:10px 14px;border-radius:0 6px 6px 0}
.expl{margin-top:6px;white-space:pre-wrap}
.q-meta{margin-top:10px;font-size:12px}

.btn-reset{background:#fff;border:1px solid #c0392b;color:#c0392b;padding:.45rem .8rem;border-radius:6px;font-size:.85rem;cursor:pointer}
.btn-reset:hover{background:#c0392b;color:#fff}

.start-here{display:inline-block;margin-left:.6rem}
.start-here button{background:#fff;border:1px solid var(--green,#2e7d32);color:var(--green,#2e7d32);font-size:.72rem;padding:.15rem .45rem;border-radius:5px;cursor:pointer}
.start-here button:hover{background:var(--green,#2e7d32);color:#fff}
.ct-grid label{display:block;margin:.4rem 0}
#gradeBox textarea{width:100%;min-height:90px}
.grade-score{font-size:1.4rem;font-weight:700}

/* ---------- Progress Dashboard ---------- */
.dash{max-width:1000px}
.dash-head{display:flex;align-items:center;justify-content:space-between;
  flex-wrap:wrap;gap:10px;margin-bottom:14px}
.dash-head h1{margin:0;font-size:23px}
.mode-toggle{display:flex;border:1px solid var(--line);border-radius:6px;overflow:hidden}
.mode-toggle button{background:#fff;border:0;border-left:1px solid var(--line);
  padding:8px 14px;font-size:13px;cursor:pointer;color:#444}
.mode-toggle button:first-child{border-left:0}
.mode-toggle button.on{background:var(--green);color:#fff;font-weight:700}

.kstats{display:grid;grid-template-columns:repeat(7,1fr);gap:10px;margin:0 0 18px}
.kstats.rev{grid-template-columns:repeat(5,1fr)}
.ks{background:#fff;border:1px solid var(--line);border-radius:8px;
  padding:12px 8px;text-align:center;font-size:12px;color:#666}
.ks-n{display:block;font-size:22px;font-weight:700;color:var(--ink);margin-bottom:3px}
.status-ontrack .ks-n,.status-ahead .ks-n,.status-complete .ks-n{color:var(--ok)}
.status-behind .ks-n{color:var(--bad)}

.card{background:#fff;border:1px solid var(--line);border-radius:8px;
  padding:16px 18px;margin:0 0 18px}
.card h2{margin:0 0 12px;font-size:17px}
.card h3{margin:16px 0 8px;font-size:14px;color:#444}
.card-h{display:flex;justify-content:space-between;align-items:center;
  flex-wrap:wrap;gap:10px;margin-bottom:10px}
.card-h h2{margin:0}
svg.chart{width:100%;height:auto;display:block;background:#fcfcfc;
  border:1px solid #eee;border-radius:4px}
.axis{stroke:#9aa3ab;stroke-width:1.5}
.grid{stroke:#e8ebee;stroke-width:1}
.axis-lbl,.mk-lbl,.pass-l{font:13px var(--font);fill:#666}
.tick{font:13px var(--font);fill:#5b6b7b}
.mk-lbl{font:13px var(--font);font-weight:600}
.pass-l{font:12px var(--font);font-weight:600}
.ln-actual{fill:none;stroke:var(--ok);stroke-width:3.5;
  stroke-linejoin:round;stroke-linecap:round}
.ln-pace{fill:none;stroke:#8893a0;stroke-width:2.5;stroke-dasharray:9 6}
.mk{stroke-width:2;stroke-dasharray:5 4}
.mk-t{stroke:#2a6fb0}.mk-e{stroke:var(--bad)}
.mk-t-l{fill:#2a6fb0}.mk-e-l{fill:var(--bad)}
.pass{stroke-width:1.5;stroke-dasharray:7 5}
.pass-ov{stroke:#2a6fb0}.pass-mcq{stroke:var(--ok)}.pass-cr{stroke:#d98324}
.pl-ov{fill:#2a6fb0}.pl-mcq{fill:var(--ok)}.pl-cr{fill:#d98324}
.ln-ov{fill:none;stroke:#2a6fb0;stroke-width:3.5;stroke-linejoin:round}
.ln-ov100{fill:none;stroke:#9fc0dd;stroke-width:2}
.ln-mcq{fill:none;stroke:var(--ok);stroke-width:3;stroke-linejoin:round}
.ln-cr{fill:none;stroke:#d98324;stroke-width:3;stroke-linejoin:round}
.sw-mk-t{background:#2a6fb0}.sw-mk-e{background:var(--bad)}
.legend{display:flex;gap:18px;flex-wrap:wrap;font-size:12px;color:#555;margin-top:8px}
.legend .sw{display:inline-block;width:16px;height:3px;margin-right:5px;
  vertical-align:middle}
.sw-actual{background:var(--ok)}.sw-pace{background:#888}
.sw-ov{background:#2a6fb0}.sw-mcq{background:var(--ok)}
.sw-cr{background:#d98324}.sw-ov100{background:#9fc0dd}
.empty{padding:8px 0}

.tcards{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
.tcard{border:1px solid var(--line);border-left:4px solid #bbb;
  border-radius:6px;padding:12px 14px}
.tcard.st-strong{border-left-color:var(--ok)}
.tcard.st-weak{border-left-color:var(--bad)}
.tcard.st-okay{border-left-color:#d98324}
.tc-top{display:flex;justify-content:space-between;align-items:center;
  margin-bottom:8px}
.badge{font-size:11px;font-weight:700;padding:2px 8px;border-radius:10px;
  color:#fff;text-transform:capitalize}
.b-strong{background:var(--ok)}.b-weak{background:var(--bad)}
.b-okay{background:#d98324}.b--{background:#aaa}
.tc-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:4px 10px;
  font-size:12px;color:#666;margin:8px 0}
.tc-grid b{color:var(--ink)}
.bar{display:block;height:7px;background:#e6e6e6;border-radius:4px;overflow:hidden}
.bar-fill{display:block;height:100%;background:var(--green)}
.redo-mini button,.redo-inline button{cursor:pointer}
.redo-mini{margin-top:8px}
.redo-mini button{background:#fff;border:1px solid var(--line);
  padding:5px 10px;border-radius:4px;font-size:12px;color:#333}
.redo-mini button:hover:not([disabled]){background:#f1f3f5}
.redo-mini button[disabled]{opacity:.4;cursor:not-allowed}
.redo-inline{display:flex;gap:8px;align-items:center}
.redo-inline select{padding:7px;border:1px solid var(--line);border-radius:4px}

.rc-tabs{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:12px}
.rc-tabs a{text-decoration:none;font-size:13px;color:#444;background:#f1f3f5;
  border:1px solid var(--line);border-radius:5px;padding:6px 11px}
.rc-tabs a.on{background:var(--green);color:#fff;border-color:var(--green-d);font-weight:700}
.rc-tabs .cnt{font-weight:700;margin-left:4px}
.qcard{border:1px solid var(--line);border-radius:6px;padding:11px 13px;
  margin-bottom:9px}
.qc-meta{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:7px}
.tag{font-size:11px;background:#eef1f4;color:#445;padding:2px 7px;border-radius:4px}
.tag.muted{background:none;color:#888;padding:2px 2px}
.t-EOC{background:#dde9f5;color:#1e4e79}.t-Example{background:#e6f2e0;color:#37601f}
.t-MCQ{background:#e9e4f5;color:#4a327d}.t-CR{background:#f7e6d4;color:#8a4b16}
.tag.st-correct{background:#d9efdd;color:#1f7a33}
.tag.st-incorrect{background:#f6dada;color:#b3261e}
.tag.st-unattempted{background:#eee;color:#777}
.qc-stem{font-size:13px;line-height:1.5;margin-bottom:6px}
.qc-ans{display:flex;gap:18px;font-size:12.5px;margin-bottom:4px}
.qc-exp{font-size:12.5px;line-height:1.55;color:#444;padding:8px 0}
details summary{cursor:pointer;font-size:12px;color:#2a6fb0}

/* ---------- merged Question Bank + Dashboard ---------- */
.merge{max-width:min(1680px,96vw);margin:0 auto;padding:18px 26px}
.merge-grid{display:grid;grid-template-columns:1fr 1fr;gap:26px;
  align-items:start}
.rail{background:#fff;border:1px solid var(--line);
  border-radius:10px;padding:18px 20px}
.rail-head{display:flex;align-items:center;justify-content:space-between;
  flex-wrap:wrap;gap:10px;margin-bottom:8px}
.rail h1{margin:0;font-size:21px}
.rail h3{margin:20px 0 8px;font-size:14px;color:#333;font-weight:600}
.rail h3 .muted{font-weight:400}
.tgt-form{display:flex;align-items:center;gap:6px;font-size:12px}
.tgt-form label{color:#555}
.tgt-form input[type=date]{padding:5px 7px;border:1px solid var(--line);
  border-radius:4px;font-size:12px}
.tgt-form button{padding:5px 11px;border:1px solid var(--green-d);
  background:var(--green);color:#fff;border-radius:4px;cursor:pointer;
  font-weight:600;font-size:12px}
.rail .kstats{grid-template-columns:repeat(3,1fr);gap:8px;margin:0 0 6px}
.rail .ks{padding:10px 4px}
.rail .ks-n{font-size:19px}
.rail svg.chart{height:auto}
.rail .legend{font-size:11px;gap:10px;margin-top:5px}
.rail-redo{display:flex;flex-direction:column;gap:7px;margin-top:16px;
  border-top:1px solid #eee;padding-top:14px}
.rail-redo select{padding:7px;border:1px solid var(--line);border-radius:4px}
.rail-redo .btn-primary{text-align:center}
.main{min-width:0}
.main .mode-toggle{margin-bottom:16px}

.bank-list{display:flex;flex-direction:column;gap:10px}
.brow{display:block;text-decoration:none;color:var(--ink);background:#fff;
  border:1px solid var(--line);border-left:4px solid #c4c4c4;
  border-radius:8px;padding:13px 16px;transition:box-shadow .12s}
.brow:hover{box-shadow:0 2px 8px rgba(0,0,0,.08)}
.brow.st-strong{border-left-color:var(--ok)}
.brow.st-weak{border-left-color:var(--bad)}
.brow.st-okay{border-left-color:#d98324}
.brow-head{display:flex;align-items:center;gap:10px}
.brow-name{font-weight:700;font-size:15px;flex:1}
.brow-tot{font-size:12px;font-weight:700;color:#fff;background:#5b6b7b;
  padding:2px 9px;border-radius:11px}
.brow-splits{display:flex;flex-wrap:wrap;gap:8px 20px;margin:9px 0 8px;
  font-size:12.5px;color:#555}
.brow-splits .grp em{color:#bbb;margin:0 5px;font-style:normal}
.ap{display:inline-block;font-style:normal;font-size:10.5px;font-weight:700;
  color:#fff;border-radius:9px;padding:1px 6px;margin-left:2px}
.ap.g{background:var(--ok)}.ap.a{background:#d98324}.ap.r{background:var(--bad)}
.ap.n{background:#cfcfcf}
.brow-bar{height:6px;background:#e9e9e9;border-radius:4px;overflow:hidden}
.brow-bar span{display:block;height:100%;background:var(--green)}
.brow-foot{display:flex;justify-content:space-between;font-size:11.5px;
  color:#777;margin-top:7px}

/* toggle row + Sudden Death launcher (separate feature) */
.toggle-row{display:flex;align-items:center;justify-content:space-between;
  gap:14px;margin-bottom:16px;flex-wrap:wrap}
.toggle-row .mode-toggle{margin:0}
.sd-launch button{display:inline-flex;align-items:center;gap:6px;
  background:#2f2f2f;color:#fff;border:1px solid #1f1f1f;border-radius:6px;
  padding:9px 16px;font-size:13px;font-weight:700;cursor:pointer}
.sd-launch button:hover{background:#1f1f1f}

/* Question Bank list: answered items go dark */
.qcard.answered>summary{background:#2f2f2f;color:#fff;border-color:#2f2f2f}
.qcard.answered>summary .q-src,
.qcard.answered>summary .q-stem,
.qcard.answered>summary .q-hist{color:#e8e8e8}
.qcard.answered.ans-ok>summary{border-left:5px solid var(--ok)}
.qcard.answered.ans-no>summary{border-left:5px solid var(--bad)}
.qcard .done-dot{color:#8cc63f;font-size:11px;margin-left:4px}
.qcard.answered.ans-no .done-dot{color:#ff6b61}

@media(max-width:980px){
  .merge-grid{grid-template-columns:1fr}
  .rail{position:static}
}
@media(max-width:760px){
  .kstats,.kstats.rev{grid-template-columns:repeat(2,1fr)}
  .tcards{grid-template-columns:1fr}
}

/* ---- current-accuracy bar chart ---- */
.accbars{display:flex;flex-direction:column;gap:10px;margin:6px 0 4px}
.accbar{display:flex;align-items:center;gap:10px}
.accbar .ab-lbl{width:62px;font-size:12px;font-weight:700;color:#444}
.accbar .ab-track{position:relative;flex:1;height:18px;background:#eef0f2;
  border-radius:9px}
.accbar .ab-fill{display:block;height:100%;border-radius:9px;
  transition:width .3s ease}
.accbar .ab-fill.g{background:var(--ok)}
.accbar .ab-fill.r{background:var(--bad)}
.accbar .ab-pass{position:absolute;top:-3px;width:2px;height:24px;
  background:#222}
.accbar .ab-val{width:118px;text-align:right;font-size:13px;font-weight:700;
  color:#333}
.accbar .ab-val em{display:block;font-size:10px;font-weight:400;color:#999;
  font-style:normal}

/* ---- live rank: worst learning modules ---- */
.worst-lm{margin:22px 0 8px;border-top:1px solid #e3e6ea;padding-top:14px}
.worst-lm h3{margin:0 0 10px}
.wl-list{list-style:none;margin:0;padding:0;display:flex;
  flex-direction:column;gap:6px}
.wl-row{display:flex;align-items:center;gap:12px;background:#fafbfc;
  border:1px solid #e8eaed;border-radius:7px;padding:8px 12px}
.wl-pos{width:22px;height:22px;flex:none;border-radius:50%;
  background:var(--bad);color:#fff;font-size:12px;font-weight:700;
  display:flex;align-items:center;justify-content:center}
.wl-name{flex:1;font-size:13px;font-weight:600;color:#333}
.wl-name em{display:block;font-size:11px;font-weight:400;color:#999;
  font-style:normal}
.wl-att{font-size:12px;color:#777}

/* ---- LM chapter list category splits ---- */
.br-splits{display:block;font-size:11.5px;color:#666;margin:6px 0 4px;
  line-height:1.7}
.br-splits b{color:#333}
.br-splits em{color:#c8c8c8;margin:0 6px;font-style:normal}
