/* ===== Bluebook-style SAT practice UI ===== */
:root {
  --blue: #324dc7;
  --blue-dark: #2338a0;
  --blue-light: #e8ecfb;
  --ink: #1e1e1e;
  --gray: #6b6b6b;
  --line: #c7c7c7;
  --chrome: #edf1f8;
  --red: #c13145;
  --yellow-hl: #fde68a;
  --blue-hl: #bfdbfe;
  --pink-hl: #fbcfe8;
  --sans: "Noto Sans", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: "Noto Serif", Georgia, "Times New Roman", "Songti SC", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--sans); color: var(--ink); background: #fff; -webkit-font-smoothing: antialiased; }
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }

/* ---------- Generic buttons ---------- */
.btn {
  border: none; border-radius: 24px; padding: 10px 26px; font-size: 15px; font-weight: 600;
  background: var(--blue); color: #fff; transition: background .15s;
}
.btn:hover { background: var(--blue-dark); }
.btn:disabled { background: #a9b4e3; cursor: default; }
.btn-outline {
  border: 1.5px solid var(--ink); border-radius: 24px; padding: 9px 24px; font-size: 15px; font-weight: 600;
  background: #fff; color: var(--ink);
}
.btn-outline:hover { background: #f3f3f3; }
.btn-yellow { background: #fedb00; color: #1e1e1e; }
.btn-yellow:hover { background: #f0cd00; }
.link-btn { background: none; border: none; color: var(--blue); font-weight: 600; font-size: 14px; padding: 0; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Test shell ---------- */
.shell { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.bb-header {
  flex: 0 0 auto; height: 76px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 28px; background: var(--chrome); position: relative;
}
.bb-header::after, .bb-footer::before {
  content: ""; position: absolute; left: 0; right: 0; height: 3px;
  background: repeating-linear-gradient(90deg, #2d2d2d 0 14px, transparent 14px 20px);
  opacity: .85;
}
.bb-header::after { bottom: 0; }
.bb-title { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.bb-dir-btn { background: none; border: none; padding: 0; font-size: 14px; font-weight: 600; color: var(--ink); display: inline-flex; align-items: center; gap: 4px; }
.bb-center { display: flex; flex-direction: column; align-items: center; }
.bb-timer { font-size: 20px; font-weight: 700; letter-spacing: .5px; min-height: 26px; font-variant-numeric: tabular-nums; }
.bb-timer.warn { color: var(--red); }
.bb-timer-hidden { font-size: 22px; line-height: 26px; }
.bb-hide {
  margin-top: 4px; border: 1px solid #7a7a7a; background: #fff; border-radius: 16px; font-size: 12px;
  padding: 2px 12px; font-weight: 600;
}
.bb-right { display: flex; justify-content: flex-end; gap: 22px; }
.tool-btn {
  background: none; border: none; display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 12px; font-weight: 600; color: var(--ink); padding: 4px 2px; border-radius: 6px;
}
.tool-btn svg { width: 22px; height: 22px; }
.tool-btn.active { color: var(--blue); }
.tool-btn:hover { background: rgba(0,0,0,.04); }

.bb-main { flex: 1 1 auto; position: relative; overflow: hidden; display: flex; }
.bb-footer {
  flex: 0 0 auto; height: 72px; background: var(--chrome); position: relative;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 28px;
}
.bb-footer::before { top: 0; }
.bb-name { font-size: 16px; font-weight: 600; }
.qnav-btn {
  background: #1e1e1e; color: #fff; border: none; border-radius: 8px; padding: 9px 16px;
  font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px;
}
.qnav-btn svg { width: 14px; height: 14px; transition: transform .15s; }
.qnav-btn.open svg { transform: rotate(180deg); }
.bb-nav-btns { display: flex; justify-content: flex-end; gap: 12px; }

/* ---------- Split panes ---------- */
.pane { overflow-y: auto; height: 100%; }
.pane-left { padding: 36px 40px 40px 48px; }
.pane-right { padding: 36px 48px 40px 40px; }
.divider {
  flex: 0 0 6px; background: #d9d9d9; cursor: col-resize; position: relative; height: 100%;
}
.divider::after {
  content: ""; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 18px; height: 34px; border-radius: 6px; background: #1e1e1e;
  -webkit-mask: radial-gradient(circle 1.3px, #000 98%, transparent) 0 0/6px 6px;
  mask: radial-gradient(circle 1.3px, #000 98%, transparent) 0 0/6px 6px;
}
.divider-grip {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 18px; height: 38px;
  background: #1e1e1e; border-radius: 8px; display: flex; align-items: center; justify-content: center;
}
.divider-grip svg { width: 12px; height: 22px; }
.single { flex: 1; display: flex; justify-content: center; overflow-y: auto; }
.single-inner { width: 100%; max-width: 780px; padding: 36px 40px 40px; }

/* ---------- Passage / question text ---------- */
.passage { font-family: var(--serif); font-size: 17px; line-height: 1.75; }
.passage p { margin: 0 0 14px; }
.passage p.poem { white-space: normal; padding-left: 12px; }
.passage ul { margin: 6px 0 0; padding-left: 26px; }
.passage li { margin-bottom: 8px; }
.passage u { text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.blank {
  display: inline-block; width: 74px; border-bottom: 1.5px solid currentColor; vertical-align: baseline;
  height: 1em; margin: 0 2px;
}
.figure { margin: 18px 0; display: flex; justify-content: center; overflow-x: auto; }
.figure table { border-collapse: collapse; font-family: var(--sans); font-size: 14px; }
.figure caption { font-weight: 700; padding-bottom: 8px; font-size: 14px; caption-side: top; }
.figure th, .figure td { border: 1px solid #555; padding: 6px 12px; text-align: center; }
.figure th { background: #f2f2f2; font-weight: 700; }
.figure svg { max-width: 100%; height: auto; }

.q-head {
  display: flex; align-items: center; background: #f0f0f0; border-bottom: 2px dashed #9a9a9a;
  height: 36px; margin-bottom: 18px; position: relative;
}
.q-num {
  background: #1e1e1e; color: #fff; font-weight: 700; font-size: 16px; height: 36px; min-width: 36px;
  display: flex; align-items: center; justify-content: center;
}
.mark-btn {
  background: none; border: none; display: flex; align-items: center; gap: 6px; font-size: 15px;
  margin-left: 12px; color: var(--ink); font-weight: 500;
}
.mark-btn svg { width: 16px; height: 20px; }
.mark-btn.on { font-weight: 700; }
.elim-toggle {
  margin-left: auto; margin-right: 8px; border: 1px solid #555; border-radius: 4px; background: #fff;
  font-size: 12px; font-weight: 700; padding: 1px 6px; position: relative; height: 24px;
}
.elim-toggle span { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.elim-toggle.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.q-prompt { font-family: var(--serif); font-size: 17px; line-height: 1.65; margin-bottom: 20px; }
.q-prompt p { margin: 0 0 12px; }

.choices { display: flex; flex-direction: column; gap: 14px; }
.choice-row { display: flex; align-items: center; gap: 12px; }
.choice {
  flex: 1; display: flex; align-items: center; gap: 14px; text-align: left; background: #fff;
  border: 1.5px solid #3c3c3c; border-radius: 10px; padding: 12px 16px; min-height: 52px;
  font-family: var(--serif); font-size: 17px; color: var(--ink); position: relative; line-height: 1.5;
}
.choice:hover { background: #fafbff; }
.choice .letter {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid #1e1e1e;
  display: flex; align-items: center; justify-content: center; font-family: var(--sans); font-weight: 700; font-size: 14px;
}
.choice.selected { border: 3px solid var(--blue); padding: 10.5px 14.5px; }
.choice.selected .letter { background: var(--blue); border-color: var(--blue); color: #fff; }
.choice.eliminated { color: #8a8a8a; border-color: #b5b5b5; }
.choice.eliminated .letter { border-color: #9a9a9a; }
.choice.eliminated::after {
  content: ""; position: absolute; left: -6px; right: -6px; top: 50%; border-top: 1.5px solid #3c3c3c;
}
.elim-btn {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid #1e1e1e; background: #fff;
  font-size: 13px; font-weight: 700; position: relative; padding: 0;
}
.elim-btn::after {
  content: ""; position: absolute; left: -4px; right: -4px; top: 50%; border-top: 1.5px solid #1e1e1e;
}
.undo-btn { flex: 0 0 auto; width: 34px; background: none; border: none; font-size: 13px; font-weight: 700; text-decoration: underline; padding: 0; }

/* SPR */
.spr-input {
  width: 170px; height: 52px; border: 1.5px solid #3c3c3c; border-radius: 8px; font-size: 22px;
  padding: 0 14px; font-family: var(--sans); margin-top: 8px; outline: none;
  border-bottom: 3px solid #3c3c3c;
}
.spr-input:focus { border-color: var(--blue); }
.spr-preview { margin-top: 14px; font-size: 16px; min-height: 36px; }
.spr-dir { font-size: 15px; line-height: 1.6; }
.spr-dir h3 { font-size: 17px; margin: 0 0 12px; }
.spr-dir ul { padding-left: 22px; }
.spr-dir li { margin-bottom: 6px; }
.spr-table { border-collapse: collapse; width: 100%; font-size: 14px; margin-top: 10px; }
.spr-table th, .spr-table td { border: 1px solid #888; padding: 6px 8px; text-align: center; }
.spr-table th { background: #f2f2f2; }

/* ---------- Popovers & modals ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; display: flex; align-items: center; justify-content: center; }
.modal {
  background: #fff; border-radius: 12px; width: min(820px, 92vw); max-height: 86vh; display: flex; flex-direction: column;
  box-shadow: 0 12px 40px rgba(0,0,0,.3);
}
.modal-body { padding: 28px 36px; overflow-y: auto; font-size: 16px; line-height: 1.65; }
.modal-body h2 { margin-top: 0; font-size: 22px; }
.modal-foot { padding: 16px 28px; border-top: 1px solid #e3e3e3; display: flex; justify-content: flex-end; gap: 12px; }

.qnav-pop {
  position: absolute; bottom: 82px; left: 50%; transform: translateX(-50%); z-index: 40;
  background: #fff; border-radius: 12px; box-shadow: 0 6px 30px rgba(0,0,0,.28); width: min(620px, 94vw);
  padding: 20px 26px 22px;
}
.qnav-pop::after {
  content: ""; position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%);
  border: 10px solid transparent; border-bottom: 0; border-top-color: #fff;
}
.qnav-title { text-align: center; font-weight: 700; font-size: 16px; margin-bottom: 14px; padding-right: 18px; }
.qnav-close { position: absolute; top: 14px; right: 16px; background: none; border: none; font-size: 20px; }
.legend { display: flex; justify-content: center; gap: 22px; font-size: 13px; padding: 10px 0 14px; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; margin-bottom: 16px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-box { width: 16px; height: 16px; border: 1.5px dashed #555; display: inline-block; }
.qgrid { display: grid; grid-template-columns: repeat(10, 40px); gap: 12px 14px; justify-content: center; }
.qcell {
  width: 40px; height: 40px; border: 1.5px dashed #555; background: #fff; color: var(--blue);
  font-weight: 700; font-size: 16px; position: relative; display: flex; align-items: center; justify-content: center; padding: 0;
}
.qcell.answered { background: var(--blue); color: #fff; border: 1.5px solid var(--blue); }
.qcell .pin { position: absolute; top: -15px; left: 50%; transform: translateX(-50%); width: 14px; height: 16px; }
.qcell .flag { position: absolute; top: -7px; right: -6px; width: 12px; height: 15px; }
.qnav-foot { text-align: center; margin-top: 20px; }

.menu-pop {
  position: absolute; top: 70px; right: 20px; z-index: 40; background: #fff; border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,.22); min-width: 220px; padding: 6px 0;
}
.menu-pop button { display: flex; width: 100%; background: none; border: none; text-align: left; padding: 11px 20px; font-size: 15px; gap: 10px; align-items: center; }
.menu-pop button:hover { background: #f2f4fb; }

.dir-pop {
  position: absolute; top: 76px; left: 0; right: 0; z-index: 45; background: #fff; box-shadow: 0 10px 24px rgba(0,0,0,.2);
  max-height: calc(100vh - 160px); overflow-y: auto;
}
.dir-pop-inner { max-width: 960px; margin: 0 auto; padding: 28px 40px; font-size: 16px; line-height: 1.7; }
.dir-pop-foot { text-align: right; margin-top: 14px; }

/* Floating panels (calculator / reference) */
.float-panel {
  position: fixed; z-index: 35; background: #fff; border: 1px solid #999; border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,.25); display: flex; flex-direction: column; overflow: hidden;
}
.float-head {
  background: #1e1e1e; color: #fff; height: 40px; display: flex; align-items: center; padding: 0 12px;
  font-weight: 600; font-size: 14px; cursor: move; user-select: none; gap: 10px;
}
.float-head .grab { opacity: .6; letter-spacing: 1px; }
.float-head .sp { flex: 1; text-align: center; }
.float-head button { background: none; border: none; color: #fff; font-size: 13px; font-weight: 600; padding: 4px 6px; }
.float-body { flex: 1; overflow: auto; position: relative; }
.calc-host { position: absolute; inset: 0; }
.resize-h { position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, #999 50%, #999 60%, transparent 60%, transparent 70%, #999 70%, #999 80%, transparent 80%); }
.ref-body { padding: 18px 22px; font-size: 14px; line-height: 1.5; }
.ref-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 12px; text-align: center; }
.ref-grid svg { width: 100%; max-width: 150px; height: 90px; }
.ref-notes { margin-top: 16px; }
.ref-notes p { margin: 6px 0; }

/* Highlighter toolbar */
.hl-bar {
  position: absolute; z-index: 60; background: #1e1e1e; border-radius: 8px; padding: 6px 8px; display: flex; gap: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,.3); align-items: center;
}
.hl-bar button { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; padding: 0; }
.hl-bar .hl-u { background: #1e1e1e; color: #fff; font-weight: 700; text-decoration: underline; border-radius: 4px; width: 28px; }
.hl-bar .hl-x { background: #1e1e1e; color: #fff; border-radius: 4px; width: 28px; font-size: 14px; }
mark.hl { padding: 0 1px; border-radius: 2px; color: inherit; }
mark.hl-yellow { background: var(--yellow-hl); }
mark.hl-blue { background: var(--blue-hl); }
mark.hl-pink { background: var(--pink-hl); }
mark.hl-under { background: none; text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--blue); }

/* Line reader */
.line-reader { position: fixed; left: 0; right: 0; z-index: 30; pointer-events: none; }
.line-reader .lr-top, .line-reader .lr-bot { position: fixed; left: 0; right: 0; background: rgba(0,0,0,.55); }

/* ---------- Review (check your work) ---------- */
.review-wrap { flex: 1; overflow-y: auto; display: flex; flex-direction: column; align-items: center; padding: 40px 20px; }
.review-wrap h1 { font-size: 30px; margin: 0 0 14px; font-weight: 600; }
.review-wrap .sub { font-size: 16px; text-align: center; max-width: 640px; line-height: 1.6; margin-bottom: 28px; }
.review-card { background: #fff; border-radius: 12px; box-shadow: 0 2px 16px rgba(0,0,0,.14); padding: 24px 32px 30px; width: min(720px, 94vw); }
.review-card .rc-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #ddd; padding-bottom: 14px; margin-bottom: 22px; }
.review-card .rc-head h3 { margin: 0; font-size: 17px; }
.review-card .legend { border: none; padding: 0; margin: 0; }

/* ---------- Break & transitions ---------- */
.break-screen { flex: 1; background: #1e1e1e; color: #fff; display: flex; align-items: center; justify-content: center; gap: 80px; padding: 40px; }
.break-timer-box { border: 1.5px solid #fff; border-radius: 12px; padding: 26px 50px; text-align: center; }
.break-timer-box .lbl { font-size: 18px; margin-bottom: 8px; }
.break-timer-box .t { font-size: 64px; font-weight: 700; font-variant-numeric: tabular-nums; }
.break-info { max-width: 460px; font-size: 16px; line-height: 1.7; }
.break-info h2 { font-size: 26px; margin-top: 0; }
.transition-screen { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.spinner { width: 46px; height: 46px; border: 5px solid #d8def5; border-top-color: var(--blue); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Home ---------- */
.home { min-height: 100vh; background: #f5f7fc; }
.home-top { background: #fff; border-bottom: 1px solid #e3e6ef; height: 64px; display: flex; align-items: center; padding: 0 36px; gap: 14px; }
.home-logo { text-decoration: none; width: 34px; height: 34px; border-radius: 8px; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.home-brand { font-weight: 700; font-size: 18px; }
.home-brand small { font-weight: 500; color: var(--gray); font-size: 13px; margin-left: 8px; }
.home-main { max-width: 1080px; margin: 0 auto; padding: 36px 28px 60px; }
.home h1 { font-size: 28px; margin: 0 0 6px; }
.home .lead { color: var(--gray); margin: 0 0 28px; font-size: 15px; line-height: 1.6; }
.card-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.test-card { background: #fff; border-radius: 14px; box-shadow: 0 1px 8px rgba(20,30,80,.08); padding: 22px 24px; display: flex; flex-direction: column; gap: 10px; border: 1px solid #e6e9f2; }
.test-card h3 { margin: 0; font-size: 20px; }
.test-card .meta { color: var(--gray); font-size: 13px; line-height: 1.6; }
.test-card .best { font-size: 14px; }
.test-card .best b { color: var(--blue); font-size: 18px; }
.test-card .actions { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.tag { display: inline-block; background: var(--blue-light); color: var(--blue); font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; }
.settings { background: #fff; border-radius: 14px; border: 1px solid #e6e9f2; padding: 18px 24px; margin: 28px 0; display: flex; gap: 28px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.settings input[type=text] { border: 1px solid #c9cfdf; border-radius: 8px; padding: 7px 10px; font-size: 14px; width: 180px; }
.settings label { display: inline-flex; align-items: center; gap: 8px; }
.history { background: #fff; border-radius: 14px; border: 1px solid #e6e9f2; padding: 8px 0; }
.history table { width: 100%; border-collapse: collapse; font-size: 14px; }
.history th, .history td { padding: 11px 22px; text-align: left; border-bottom: 1px solid #eef0f5; }
.history th { color: var(--gray); font-weight: 600; font-size: 13px; }
.history tr:last-child td { border-bottom: none; }
.empty { color: var(--gray); padding: 20px 22px; font-size: 14px; }
h2.sec { font-size: 18px; margin: 34px 0 12px; }

/* ---------- Results ---------- */
.results { min-height: 100vh; background: #f5f7fc; }
.res-main { max-width: 1080px; margin: 0 auto; padding: 32px 28px 80px; }
.score-hero { background: #fff; border-radius: 16px; border: 1px solid #e6e9f2; padding: 30px 36px; display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 24px; align-items: center; }
.score-total .lbl { font-size: 14px; color: var(--gray); font-weight: 600; letter-spacing: .5px; text-transform: uppercase; }
.score-total .num { font-size: 64px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.score-total .range { font-size: 13px; color: var(--gray); }
.score-sec { border-left: 1px solid #e6e9f2; padding-left: 24px; }
.score-sec .lbl { font-size: 14px; font-weight: 600; }
.score-sec .num { font-size: 40px; font-weight: 800; color: var(--blue); }
.score-sec .det { font-size: 13px; color: var(--gray); line-height: 1.6; }
.bar-track { height: 8px; background: #e8ebf3; border-radius: 4px; margin: 8px 0 4px; position: relative; overflow: hidden; }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--blue); border-radius: 4px; }
.skills { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 22px; }
.skill-card { background: #fff; border-radius: 14px; border: 1px solid #e6e9f2; padding: 20px 24px; }
.skill-card h3 { margin: 0 0 14px; font-size: 16px; }
.skill-row { margin-bottom: 14px; font-size: 14px; }
.skill-row .top { display: flex; justify-content: space-between; }
.skill-row .top span:last-child { color: var(--gray); }
.boxes { display: flex; gap: 4px; margin-top: 6px; }
.boxes i { flex: 1; height: 10px; border-radius: 2px; background: #e3e6ef; }
.boxes i.on { background: var(--blue); }
.mod-tabs { display: flex; gap: 8px; margin: 30px 0 14px; flex-wrap: wrap; }
.mod-tab { border: 1px solid #c9cfdf; background: #fff; border-radius: 20px; padding: 7px 16px; font-size: 14px; font-weight: 600; color: var(--ink); }
.mod-tab.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.qlist { background: #fff; border-radius: 14px; border: 1px solid #e6e9f2; overflow: hidden; }
.qitem { border-bottom: 1px solid #eef0f5; }
.qitem:last-child { border-bottom: none; }
.qitem-head { display: grid; grid-template-columns: 56px 1fr 120px 120px 70px 30px; align-items: center; padding: 12px 20px; cursor: pointer; font-size: 14px; gap: 8px; }
.qitem-head:hover { background: #f8f9fd; }
.qitem-head .n { font-weight: 700; }
.qitem-head .sk { color: var(--gray); }
.qitem-head .sk b { color: var(--ink); font-weight: 600; }
.ok { color: #1a7f37; font-weight: 700; }
.bad { color: var(--red); font-weight: 700; }
.omit { color: #9a6700; font-weight: 700; }
.diff { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 8px; margin-left: 6px; }
.diff-E { background: #dcfce7; color: #166534; }
.diff-M { background: #fef3c7; color: #92400e; }
.diff-H { background: #fee2e2; color: #991b1b; }
.qitem-body { padding: 6px 28px 26px; border-top: 1px dashed #e3e6ef; background: #fcfcfe; }
.qitem-body .split2 { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.qitem-body .choice { cursor: default; }
.choice.correct { border: 3px solid #1a7f37; padding: 10.5px 14.5px; }
.choice.correct .letter { background: #1a7f37; color: #fff; border-color: #1a7f37; }
.choice.wrong { border: 3px solid var(--red); padding: 10.5px 14.5px; }
.choice.wrong .letter { background: var(--red); color: #fff; border-color: var(--red); }
.expl { margin-top: 18px; background: #fff; border: 1px solid #e3e6ef; border-left: 4px solid var(--blue); border-radius: 8px; padding: 14px 18px; font-size: 15px; line-height: 1.75; }
.expl b { color: var(--blue); }
.res-actions { display: flex; gap: 12px; margin-top: 24px; }
.filter { margin-left: auto; display: flex; gap: 14px; font-size: 14px; align-items: center; }

/* toast */
.toast {
  position: fixed; top: 92px; left: 50%; transform: translateX(-50%); z-index: 100; background: #1e1e1e; color: #fff;
  padding: 12px 22px; border-radius: 8px; font-size: 15px; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.25);
}

@media (max-width: 860px) {
  .score-hero, .skills, .qitem-body .split2 { grid-template-columns: 1fr; }
  .score-sec { border-left: none; padding-left: 0; }
  .qitem-head { grid-template-columns: 40px 1fr 70px 50px; }
  .qitem-head .hide-sm { display: none; }
}

/* ---------- Teacher view ---------- */
.dropzone {
  display: block; text-align: center; background: #fff; border: 2px dashed #b8c1dc; border-radius: 14px;
  padding: 28px 20px; cursor: pointer; transition: background .15s, border-color .15s;
}
.dropzone:hover, .dropzone.over { background: #f3f5fd; border-color: var(--blue); }
.t-toolbar { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; margin: 20px 0 16px; font-size: 14px; }
.t-toolbar select { border: 1px solid #c9cfdf; border-radius: 8px; padding: 6px 8px; font-size: 14px; margin-left: 6px; background: #fff; }
.t-toolbar .btn-outline { padding: 7px 16px; font-size: 14px; }
.btn-outline:disabled { opacity: .45; cursor: default; }
.history { overflow-x: auto; }
.history th, .history td { white-space: nowrap; }
.history td.wrap { white-space: normal; min-width: 140px; }
.t-row { cursor: pointer; }
.t-row:hover td { background: #f8f9fd; }

/* ---------- Proctoring ---------- */
.proctor-box { margin-top: 18px; border: 1.5px solid #d6dcef; background: #f6f8fe; border-radius: 10px; padding: 14px 16px; font-size: 14px; line-height: 1.65; }
.proctor-box p { margin: 6px 0 10px; color: #333; }
.pb-title { font-weight: 700; font-size: 15px; }
.pb-row { display: flex; align-items: center; gap: 16px; }
.intro-cam { width: 160px; height: 120px; background: #1e1e1e; border-radius: 8px; object-fit: cover; transform: scaleX(-1); }
.pb-status { font-size: 13px; color: #c13145; margin-top: 8px; max-width: 320px; }
.pb-status.ok { color: #1a7f37; font-weight: 600; }
.pb-consent { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; font-weight: 600; }
.pb-consent input { margin-top: 4px; }
.bb-name { display: flex; align-items: center; gap: 10px; }
.cam-preview { width: 64px; height: 48px; border-radius: 6px; background: #1e1e1e; object-fit: cover; transform: scaleX(-1); border: 2px solid #1a7f37; }
.proctor-gate { position: fixed; inset: 0; z-index: 200; background: rgba(20, 24, 38, .94); display: flex; align-items: center; justify-content: center; }
.pg-card { background: #fff; border-radius: 14px; padding: 30px 36px; width: min(520px, 92vw); text-align: center; line-height: 1.7; }
.pg-card h2 { margin: 0 0 10px; color: #c13145; }
.pg-card p { margin: 0 0 20px; color: #333; }
.pg-err { color: #c13145; font-size: 14px; margin-top: 10px; min-height: 20px; }
.proctor-card { margin-top: 22px; }
.pc-sub { font-size: 12.5px; font-weight: 400; color: #888; margin-left: 8px; }
.pc-sum { font-size: 14px; margin-bottom: 12px; }
.pc-table { border-collapse: collapse; font-size: 13.5px; margin-bottom: 14px; }
.pc-table th, .pc-table td { border-bottom: 1px solid #eef0f5; padding: 6px 16px 6px 0; text-align: left; }
.pc-table th { color: #888; font-weight: 600; }
.snap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.snap-grid figure { margin: 0; }
.snap-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; background: #e3e6ef; cursor: zoom-in; display: block; }
.snap-grid figure.flagged img { outline: 3px solid #c13145; }
.snap-grid figure.gone img { opacity: .3; cursor: default; }
.snap-grid figcaption { font-size: 12px; color: #666; margin-top: 4px; line-height: 1.4; }
