/* ================= QuizVerse in the VLE (vle-quiz.js) =================
   The Exams tab's quizzes and activities, the paper's front page, the sitting, and the teacher's extras. Built on the
   VLE's own tokens (vle.css :root); the three kinds of assessment are told apart by one accent each, never by colour
   alone — the label always says which it is. */
.qv-k-in_class_activity { --qv-k: var(--vgold); --qv-k-rgb: var(--vaccent-rgb); }
.qv-k-weekly_quiz { --qv-k: #F6C35A; --qv-k-rgb: 246, 195, 90; }
.qv-k-monthly_quiz { --qv-k: #F0A35E; --qv-k-rgb: 240, 163, 94; }
.qv-k-exam, .qv-k-midterm_exam { --qv-k: #FF8FB0; --qv-k-rgb: 255, 143, 176; }

.qv-cat { display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 6px; background: rgba(var(--vaccent-rgb), .16); color: var(--vgold); white-space: nowrap; }
.qv-cat-weekly_quiz { background: rgba(246, 195, 90, .16); color: #F6C35A; }
.qv-cat-monthly_quiz { background: rgba(240, 163, 94, .16); color: #F0A35E; }
.qv-cat-exam, .qv-cat-midterm_exam { background: rgba(255, 143, 176, .16); color: #FF8FB0; }
.qv-wk { font-size: 11px; font-weight: 700; color: var(--vmuted); }
.qv-mod { font-size: 12px; color: var(--vmuted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.qv-card-top { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.qv-note { font-size: 12.5px; color: var(--vmuted); margin: 4px 0 12px; line-height: 1.55; }

/* ---- the student's list ---- */
.qv-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.qv-sum div { background: var(--vbg2); border: 1px solid var(--vhair); border-radius: 12px; padding: 12px 14px; }
.qv-sum b { display: block; font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; }
.qv-sum span { font-size: 12px; color: var(--vmuted); }
.qv-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.qv-chip { appearance: none; border: 1px solid var(--vhair); background: transparent; color: var(--vmuted); font: inherit; font-size: 12.5px; font-weight: 700;
  padding: 6px 12px; border-radius: 999px; cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.qv-chip span { opacity: .6; margin-left: 3px; font-variant-numeric: tabular-nums; }
.qv-chip:hover { color: #fff; }
.qv-chip.on { background: #fff; border-color: #fff; color: #140A30; }
.qv-group { margin-bottom: 26px; }
.qv-group h2 { font-size: 15px; font-weight: 800; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.qv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.qv-card { display: flex; flex-direction: column; gap: 8px; text-decoration: none; background: var(--vbg2); border: 1px solid var(--vhair);
  border-top: 3px solid var(--qv-k); border-radius: 12px; padding: 14px 16px 12px; transition: border-color .15s, transform .15s; min-width: 0; }
.qv-card:hover { border-color: rgba(var(--qv-k-rgb), .6); transform: translateY(-1px); }
.qv-card:focus-visible { outline: 2px solid var(--qv-k); outline-offset: 2px; }
.qv-card-title { font-size: 15.5px; line-height: 1.35; }
.qv-card-meta { font-size: 12px; color: var(--vmuted); }
.qv-card-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.qv-when { font-size: 11.5px; color: var(--vmuted); }
.qv-when.is-over { color: var(--vdim); }
.qv-st { font-size: 11.5px; font-weight: 800; padding: 3px 9px; border-radius: 99px; background: rgba(255,255,255,.08); color: var(--vmuted);
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.qv-st svg { width: 12px; height: 12px; }
.qv-st-ok { background: rgba(52, 211, 153, .15); color: var(--vgreen); }
.qv-st-wait { background: rgba(var(--vaccent-rgb), .16); color: var(--vgold); }
.qv-st-live { background: rgba(246, 195, 90, .16); color: #F6C35A; }
.qv-st-miss { background: rgba(255, 143, 176, .13); color: #FF8FB0; }
.qv-st-todo { background: rgba(255,255,255,.1); color: #fff; }
.qv-cta { margin-left: auto; font-size: 12.5px; font-weight: 800; display: inline-flex; align-items: center; gap: 2px; color: var(--qv-k); }
.qv-cta svg { width: 14px; height: 14px; }

/* ---- the teacher's list ---- */
.qv-staff-head { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.qv-rows { display: flex; flex-direction: column; gap: 6px; }
.qv-row { display: flex; align-items: center; gap: 12px; text-decoration: none; background: var(--vbg2); border: 1px solid var(--vhair);
  border-radius: 10px; padding: 11px 14px; min-width: 0; }
.qv-row:hover { border-color: rgba(var(--vaccent-rgb), .45); }
.qv-row > svg { width: 16px; height: 16px; color: var(--vdim); flex: none; }
.qv-row > .qv-cat { min-width: 128px; justify-content: center; }
.qv-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.qv-row-body b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qv-row-body span { font-size: 12px; color: var(--vmuted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qv-row-stats { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ---- a paper's front page ---- */
.qv-hero { border-left: 3px solid var(--qv-k); padding: 2px 0 2px 16px; margin: 6px 0 18px; }
.qv-hero h1 { margin: 8px 0 8px; font-size: clamp(22px, 3vw, 30px); line-height: 1.2; }
.qv-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.qv-flags span { font-size: 11.5px; color: var(--vmuted); border: 1px solid var(--vhair); border-radius: 6px; padding: 3px 8px; }
.qv-live { color: var(--vgreen); font-weight: 700; }
.qv-actions { flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.qv-rules { list-style: none; margin: 0 0 18px; padding: 14px 16px; background: var(--vbg2); border: 1px solid var(--vhair); border-radius: 12px;
  display: flex; flex-direction: column; gap: 10px; }
.qv-rules li { font-size: 13.5px; line-height: 1.55; color: var(--vmuted); padding-left: 18px; position: relative; }
.qv-rules li::before { content: ''; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--qv-k); }
.qv-rules li b { color: #fff; }
.qv-rules li svg { width: 14px; height: 14px; vertical-align: -2px; color: var(--qv-k); }
.qv-start { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.qv-pass { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 700; color: var(--vmuted); }
.qv-pass input { background: var(--vbg3); border: 1px solid rgba(255,255,255,.2); border-radius: 10px; color: #fff; font: inherit; font-size: 16px;
  padding: 11px 14px; width: 220px; letter-spacing: .08em; }
.qv-pass input:focus { outline: none; border-color: var(--qv-k); }
.qv-start-note { font-size: 12px; color: var(--vmuted); align-self: center; }
.qv-start .form-error { flex-basis: 100%; }

/* ---- the sitting: its own full-screen surface over the VLE ---- */
body.qv-sitting { overflow: hidden; }
body.qv-sitting .dock, body.qv-sitting .tab-search { display: none !important; }
/* above the VLE's own bars (≤ 62) and the player (90), below dialogs (100) so Hand in can ask, and toasts (200) */
.qv-sit { position: fixed; inset: 0; z-index: 95; background: var(--vbg); color: var(--vtext); display: flex; flex-direction: column; }
.qv-bar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(140px, 260px) auto; align-items: center; gap: 14px;
  padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); border-bottom: 1px solid var(--vhair); background: var(--vbg2); }
.qv-bar-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.qv-bar-title b { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qv-bar-title > span:last-child { font-size: 12px; color: var(--vmuted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qv-bar-mid { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; color: var(--vmuted); min-width: 0; }
.qv-mid-line { display: flex; justify-content: space-between; gap: 10px; min-width: 0; }
.qv-progress { height: 4px; background: rgba(255,255,255,.1); border-radius: 99px; overflow: hidden; }
.qv-progress i { display: block; height: 100%; width: 0; background: var(--qv-k); transition: width .25s; }
.qv-bar-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.qv-bar-right .btn, .qv-bar-right .st-btn { white-space: nowrap; flex: none; }
.qv-save { font-size: 11.5px; color: var(--vmuted); white-space: nowrap; }
.qv-save.ok { color: var(--vgreen); }
.qv-save.warn { color: #F6C35A; }
.qv-clock { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 15px; padding: 6px 11px; border-radius: 8px; background: rgba(255,255,255,.08); white-space: nowrap; }
.qv-clock.low { background: rgba(255,143,176,.2); color: #FF8FB0; }
.qv-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 76px minmax(0, 1fr); }
.qv-nav { overflow-y: auto; padding: 16px 10px; border-right: 1px solid var(--vhair); display: flex; flex-direction: column; gap: 6px; align-items: center; }
.qv-nav a { display: grid; place-items: center; width: 38px; height: 34px; flex: none; border-radius: 8px; font-size: 12.5px; font-weight: 700;
  text-decoration: none; color: var(--vmuted); border: 1px solid var(--vhair); }
.qv-nav a.done { background: rgba(var(--qv-k-rgb), .18); border-color: transparent; color: #fff; }
.qv-nav a:hover { border-color: var(--qv-k); }
.qv-paper { overflow-y: auto; padding: 24px clamp(16px, 4vw, 48px) 48px; background-repeat: repeat; overscroll-behavior: contain; }
.qv-paper > * { max-width: 820px; margin-left: auto; margin-right: auto; }
.qv-section { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--qv-k, var(--vgold)); margin: 26px 0 10px; text-align: left; }
.qv-paper > .qv-section { margin-left: auto; margin-right: auto; }
.qv-q { background: rgba(22, 24, 44, .92); border: 1px solid var(--vhair); border-radius: 12px; padding: 18px 20px; margin-bottom: 12px; scroll-margin-top: 16px; }
.qv-q-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.qv-n { display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 7px; background: rgba(255,255,255,.1); font-size: 12px; font-weight: 800; }
.qv-q-text { font-size: 15.5px; line-height: 1.65; margin: 0 0 14px; white-space: pre-wrap; }
.qv-opts { display: flex; flex-direction: column; gap: 7px; }
.qv-opt { display: flex; align-items: flex-start; gap: 11px; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--vhair); cursor: pointer;
  font-size: 14.5px; line-height: 1.5; transition: background .12s, border-color .12s; }
.qv-opt:hover { background: rgba(255,255,255,.05); }
.qv-opt input { position: absolute; opacity: 0; pointer-events: none; }
.qv-letter { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.3); font-size: 11.5px; font-weight: 800; flex: none; }
.qv-opt input[type=checkbox] + .qv-letter { border-radius: 6px; }
.qv-opt:has(input:checked) { border-color: var(--qv-k); background: rgba(var(--qv-k-rgb), .1); }
.qv-opt:has(input:checked) .qv-letter { background: var(--qv-k); border-color: var(--qv-k); color: #140A30; }
.qv-opt:has(input:focus-visible) { outline: 2px solid var(--qv-k); outline-offset: 2px; }
.qv-hint { font-size: 12px; color: var(--vmuted); margin: 8px 0 0; }
.qv-q .sit-short { width: 100%; }
.qv-editor { border: 1px solid rgba(255,255,255,.16); border-radius: 10px; overflow: hidden; background: rgba(0,0,0,.25); }
.qv-editor:focus-within { border-color: var(--qv-k); }
.qv-tools { display: flex; gap: 4px; flex-wrap: wrap; padding: 6px; border-bottom: 1px solid var(--vhair); background: rgba(255,255,255,.03); }
.qv-tools button, .qv-tools select { appearance: none; border: 1px solid transparent; background: transparent; color: var(--vmuted); font: inherit; font-size: 12.5px;
  min-width: 32px; height: 30px; padding: 0 8px; border-radius: 6px; cursor: pointer; }
.qv-tools select { border-color: var(--vhair); background: var(--vbg3); }
.qv-tools button:hover { background: rgba(255,255,255,.08); color: #fff; }
.qv-rich { min-height: 220px; padding: 14px 16px; font-size: 15px; line-height: 1.7; outline: none; overflow-wrap: anywhere; }
.qv-rich:empty::before { content: attr(data-placeholder); color: var(--vdim); }
.qv-rich ul, .qv-rich ol { padding-left: 1.4em; margin: .4em 0; }
.qv-rich font[size="1"] { font-size: .8em; } .qv-rich font[size="2"] { font-size: .9em; } .qv-rich font[size="4"] { font-size: 1.3em; }
.qv-rich font[size="5"] { font-size: 1.6em; } .qv-rich font[size="6"] { font-size: 2em; } .qv-rich font[size="7"] { font-size: 2.4em; }
/* a student's own bold inside an answer is bold, not the small-caps label .qz-r-text b gives the heading */
.qz-r-text .qv-rich-read b { font-size: inherit; text-transform: none; letter-spacing: normal; color: inherit; font-weight: 700; }
.qz-r-text .qv-rich-read { white-space: normal; }
.qv-rich-read { min-height: 0; padding: 6px 0 0; font-size: 13.5px; line-height: 1.6; }
.qv-wc { display: flex; justify-content: flex-end; padding: 6px 12px; border-top: 1px solid var(--vhair); font-size: 11.5px; color: var(--vmuted); font-variant-numeric: tabular-nums; }
.qv-end { text-align: center; padding: 26px 0 10px; }
.qv-lock { position: absolute; inset: 0; z-index: 5; background: #000; display: grid; place-items: center; padding: 24px; text-align: center; }
.qv-lock > div { max-width: 440px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.qv-lock svg { width: 34px; height: 34px; color: #FF8FB0; }
.qv-lock h2 { margin: 0; font-size: 22px; }
.qv-lock p { margin: 0 0 8px; color: rgba(255,255,255,.75); line-height: 1.55; font-size: 14px; }
@media print { .qv-sit, .qv-paper { display: none !important; } }

/* ---- afterwards ---- */
.qz-r-q.is-marked { border-left-color: var(--vgold); }
.qz-r-q.is-blank { border-left-color: rgba(255,255,255,.2); }
.qv-after .qv-card-top { margin: 6px 0 14px; }
.qv-done { display: flex; gap: 14px; align-items: center; background: var(--vbg2); border: 1px solid var(--vhair); border-radius: 12px; padding: 16px 18px; margin-bottom: 16px; }
.qv-done-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: rgba(52,211,153,.16); color: var(--vgreen); flex: none; }
.qv-done-ic.wait { background: rgba(var(--vaccent-rgb), .16); color: var(--vgold); }
.qv-done b { display: block; font-size: 17px; margin-bottom: 2px; }
.qv-done span { font-size: 13px; color: var(--vmuted); line-height: 1.5; }

/* ---- the teacher's extras ---- */
.qv-imp-sum { font-size: 12.5px; font-weight: 700; margin: 4px 0 8px; }
.qv-imp { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow-y: auto; margin-bottom: 12px; padding-right: 4px; }
.qv-imp-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--vhair); border-radius: 8px; }
.qv-imp-row b { display: block; font-size: 13px; }
.qv-imp-row span { font-size: 11.5px; color: var(--vmuted); }
.qv-imp-row select { width: 100%; min-width: 0; }
@media (max-width: 640px) { .qv-imp-row { grid-template-columns: 1fr; } }
.qv-form .st-check em { font-style: normal; color: var(--vdim); font-weight: 500; }
.qv-hold { margin: 2px 0 6px; }
.qv-hold input[type=checkbox] { width: 17px; height: 17px; flex: none; padding: 0; margin: 0; }
.qv-hold label { display: inline; margin: 0; font-size: 13px; font-weight: 600; cursor: pointer; }
.qv-adv { border: 1px solid var(--vhair); border-radius: 10px; padding: 10px 14px; margin: 6px 0 12px; }
.qv-adv summary { cursor: pointer; font-weight: 700; font-size: 13px; }
.qv-adv[open] summary { margin-bottom: 10px; }
.qv-when-pick { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.qv-campuses { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 14px; }
.qv-campuses label.st-check { display: flex; margin: 0; font-size: 13px; font-weight: 600; }
.qv-campuses input[type=checkbox] { width: 17px; height: 17px; flex: none; padding: 0; margin: 0; }
.qb-sec input { width: 160px; }
/* display: block, not list-item, so a subheading takes no number from the paper's list */
.qv-prev-sec { display: block; list-style: none; background: none !important; border: 0 !important; padding: 6px 0 0 !important; margin-left: -20px; font-size: 12px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .08em; color: var(--vgold); }
.qv-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; padding: 10px 12px; border-radius: 8px;
  background: rgba(var(--vaccent-rgb), .1); border: 1px solid rgba(var(--vaccent-rgb), .25); font-size: 12.5px; }
.qv-suggest span { flex: 1 1 260px; color: var(--vmuted); line-height: 1.5; }
.qz-expl summary { cursor: pointer; color: var(--vmuted); font-weight: 700; }
.qv-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.qv-log li { display: flex; gap: 12px; font-size: 12.5px; color: var(--vmuted); padding: 6px 10px; border-radius: 6px; }
.qv-log li.is-v { background: rgba(255,143,176,.1); color: #FFC2D3; }
.qv-log time { flex: none; width: 118px; color: var(--vdim); font-variant-numeric: tabular-nums; }
.qv-log em { font-style: normal; color: var(--vdim); }
.qv-campus-pick { background: var(--vbg3); border: 1px solid var(--vhair); color: #fff; font: inherit; font-size: 13px; padding: 7px 10px; border-radius: 8px; }
.st-n.warn { background: rgba(255,143,176,.2); color: #FF8FB0; }
.mk-missing em { font-style: normal; color: var(--vdim); font-size: 11px; }

@media (max-width: 900px) {
  .qv-bar { grid-template-columns: minmax(0, 1fr) auto; }
  .qv-bar-mid { grid-column: 1 / -1; grid-row: 2; }
  .qv-bar-title > span:last-child { display: none; }
  .qv-body { grid-template-columns: minmax(0, 1fr); }
  .qv-nav { display: none; }
}
@media (max-width: 640px) {
  .qv-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* three rows on a phone: the title, then the clock with the buttons, then how far along and whether it is saved */
  .qv-bar { gap: 8px; padding-top: 8px; padding-bottom: 8px; }
  .qv-bar-title { grid-column: 1 / -1; }
  .qv-bar-title .qv-cat { display: none; }
  .qv-bar-right { grid-column: 1 / -1; grid-row: 2; }
  .qv-bar-right .btn, .qv-bar-right .st-btn { margin-left: auto; }
  .qv-bar-right .st-btn + .btn { margin-left: 0; }
  .qv-bar-mid { grid-row: 3; }
  .qv-clock { font-size: 13px; padding: 5px 9px; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .qv-bar-right .st-btn { padding: 7px 10px; font-size: 12.5px; }
  .qv-q { padding: 14px 14px; }
  .qv-row { flex-wrap: wrap; }
  .qv-row-stats { width: 100%; justify-content: flex-start; }
  .qv-log time { width: 92px; }
}
@media (prefers-reduced-motion: reduce) { .qv-card, .qv-progress i { transition: none; } .qv-card:hover { transform: none; } }
