/* Exam-paper questions (owner reference: a CBT test screen, 17 Oct 2026; CBT typeface and sizes, 19 Oct 2026).
   Loaded after ui.css on every page that shows a question: the full-screen exam panel, the paper view and the result
   review. Arimo (metrically Arial, the CBT screen's face) for English, Noto Sans Devanagari for Hindi; the question is
   one step larger than its options. Markup comes from question_format.py / question-format.js. */
:root{
  --q-font:Arimo,Arial,Helvetica,"Noto Sans Devanagari","Nirmala UI",Mangal,sans-serif;
  --q-size:16px;--q-option-size:15px;--q-leading:1.6;--q-ink:#1b1f24;--q-ring:#8792a2;
}

/* ---------- question bar: "Question No. N", marks and time on the question ---------- */
.question-head{display:flex;justify-content:space-between;align-items:center;gap:8px 12px;padding:10px 18px;border-bottom:1px solid var(--line);background:#fff;flex-wrap:wrap;font-family:var(--q-font)}
.q-no{font-size:16px;font-weight:600;color:var(--ink);white-space:nowrap}
.q-bar-meta{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-left:auto}
.q-marks{display:inline-flex;gap:4px}
.q-marks>span:not(.sr-only),.q-earned{display:inline-flex;align-items:center;min-height:24px;padding:0 8px;border-radius:6px;font-size:13px;font-weight:600;font-variant-numeric:tabular-nums}
.q-plus,.q-earned.good{background:var(--success-wash);color:var(--success)}
.q-minus,.q-earned.bad{background:var(--danger-wash);color:var(--danger)}
.q-earned{background:var(--soft);color:var(--muted)}
.q-time{display:inline-flex;align-items:center;gap:5px;font-size:13px;font-weight:600;color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap}
.q-time svg{flex:none}
.question-head .chip{font-size:12px}
.question-head .lang-toggle a{min-height:30px}

/* ---------- question text ---------- */
.question-body{padding:18px}
.question-text,.question-passage{font-family:var(--q-font);font-size:var(--q-size);line-height:var(--q-leading);font-weight:400;color:var(--q-ink);letter-spacing:0;white-space:normal}
.question-text{margin-bottom:16px}
.question-text img{display:block;max-width:100%;height:auto;margin:6px 0;border-radius:6px}
.question-text .q-figure{display:inline-block;max-width:100%;padding:8px;background:#fff;border:1px solid var(--line);border-radius:8px}
.question-passage{background:var(--soft);border:1px solid var(--line);border-radius:8px;padding:12px 14px;margin-bottom:12px}
.q-line{display:block;margin:0 0 6px}
.q-line:last-child{margin-bottom:0}
.q-label{display:block;font-weight:600;margin:10px 0 2px}
.q-label:first-child{margin-top:0}
/* A numbered statement: the number sits in a fixed 2em gutter, so the first line and every wrapped line start at the
   same place (the space after the number falls at the line start, where the browser drops it). */
.q-li{position:relative;display:block;padding-left:2em;margin:6px 0}
.q-li>.q-num{position:absolute;left:0;top:0}
.q-li+.q-line,.q-li+.q-label{margin-top:12px}
.q-key{display:block;margin:8px 0;word-spacing:.08em}
.q-passage{display:block;background:var(--soft);border:1px solid var(--line);border-radius:8px;padding:12px 14px;margin:6px 0 12px}
.q-table{display:block;overflow-x:auto;border-collapse:collapse;margin:10px 0 12px;max-width:100%;font-size:.94em}
.q-table th,.q-table td{border:1px solid #94a3b8;padding:5px 12px;text-align:center;white-space:nowrap}
.q-table th{background:var(--primary-wash);font-weight:600}
.q-table tbody tr:nth-child(even) td{background:#f8fafc}

/* ---------- typeset math: stacked fractions, radicals, powers ---------- */
.q-frac{position:relative;display:inline-flex;flex-direction:column;vertical-align:middle;text-align:center;font-size:.9em;line-height:1.2;margin:0 .12em}
.q-fn{padding:0 .2em .06em;border-bottom:1px solid currentColor}
.q-fd{padding:.06em .2em 0}
/* The slash and brackets stay in the text for screen readers and copy-paste; only the screen hides them. */
.q-fbar,.q-fp{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);clip-path:inset(50%);white-space:nowrap}
.q-rad{border-top:1px solid currentColor;padding:0 .08em}
.question-text sup,.option sup{font-size:.7em;line-height:0;vertical-align:.55em}

/* ---------- options: radio-circle rows ---------- */
.options{display:grid;gap:6px;margin:0;padding:0;border:0;min-width:0}
/* .portal: the option row beats the site-wide .portal label rule (block, bold, 14px). */
.portal .option{position:relative;display:flex;align-items:flex-start;gap:12px;margin:0;padding:10px 12px;border:1px solid transparent;border-radius:8px;background:transparent;font-family:var(--q-font);font-size:var(--q-option-size);line-height:1.5;font-weight:400;color:var(--q-ink);transition:background .12s,border-color .12s}
.option .opt-text{min-width:0;overflow-wrap:anywhere}
.option img{display:inline-block;vertical-align:middle;max-width:100%;height:auto;margin:0;border-radius:6px}
.option .q-figure{padding:4px;border:0;background:transparent}
/* Exam: a real radio input (keyboard and screen reader), drawn as a circle. */
label.option{cursor:pointer}
label.option:hover{background:#f3f6fa}
.option input{position:absolute;opacity:0;width:1px;height:1px;margin:0}
.opt-radio{flex:none;box-sizing:border-box;display:grid;place-items:center;width:20px;height:20px;margin-top:.2em;border:2px solid var(--q-ring);border-radius:50%;background:#fff}
.opt-letter{flex:none;min-width:1.3em;font-weight:600;color:#334155}
.option input:checked+.opt-radio{border-color:var(--primary)}
.option input:checked+.opt-radio::after{content:"";width:10px;height:10px;border-radius:50%;background:var(--primary)}
.option input:focus-visible+.opt-radio{outline:3px solid var(--accent);outline-offset:2px}
.option:has(input:checked){background:var(--primary-wash);border-color:var(--primary-line)}
.options:disabled .option{cursor:progress}
/* Paper view and review: the letter is kept, because the answer key and the review panel name options by letter. */
.opt-key{flex:none;box-sizing:border-box;display:inline-grid;place-items:center;width:24px;height:24px;margin-top:.1em;border:1.5px solid var(--q-ring);border-radius:50%;font-size:13px;font-weight:600;color:#475569;font-family:var(--q-font)}
div.option{cursor:default}
.option.correct{background:var(--success-wash);border-color:#86d3ad}
.option.correct .opt-key{background:var(--success);border-color:var(--success);color:#fff}
.option.wrong{background:var(--danger-wash);border-color:#f3a6a6}
.option.wrong .opt-key{background:var(--danger);border-color:var(--danger);color:#fff}
.opt-mark{margin-left:auto;padding-left:8px;font-size:12.5px;font-weight:600;color:var(--success);white-space:nowrap;align-self:center}
.opt-mark.wrong{color:var(--danger)}

/* ---------- result review ---------- */
.review-q-head{display:flex;align-items:center;gap:8px 10px;flex-wrap:wrap;margin:0 0 12px;padding:0 0 10px;border-bottom:1px solid var(--line)}
.review-q-head .muted{order:3;flex-basis:100%}
.review-pos{margin-left:auto;font-size:13px;font-weight:600;color:var(--muted)}
.review-question .question-text{margin-bottom:12px}

/* ---------- full-screen exam panel ---------- */
@media(max-width:900px){
  .exam-player .question-head{padding:12px 16px 8px;background:transparent}
  .exam-player .question-body{padding:10px 16px 16px}
  .exam-player label.option{min-height:46px;align-items:center;padding:8px 12px;border-color:var(--line);background:#fff}
  .exam-player label.option .opt-radio{margin-top:0}
  .exam-player .option:has(input:checked){background:var(--primary-wash);border-color:var(--primary)}
  .question-text img{max-height:46vh;width:auto}
}
@media(min-width:901px){
  .exam-player .question-head{flex:none;padding:9px 18px}
}
@media(max-width:600px){
  /* Phones: a size that fits a statement question and its options on one screen; Devanagari keeps the taller lines. */
  :root{--q-size:15px;--q-option-size:14px;--q-leading:1.55}
  .question-text:lang(hi),.question-passage:lang(hi){line-height:1.6}
  .options{gap:8px}
  .portal .option{line-height:1.4}
  .question-head{padding:10px 14px}
  .question-body{padding:14px}
  /* One bar line on a 360px phone: question number, marks, time and language. */
  .exam-player .question-head{gap:6px;padding:10px 14px 8px}
  .exam-player .question-head .chip{display:none}
  .q-no{font-size:15px}
  .q-bar-meta{gap:6px}
  .q-marks>span:not(.sr-only){padding:0 6px}
  .question-head .lang-toggle a{padding:0 7px;min-height:28px}
}
@media(max-width:380px){.q-time svg{display:none}}
/* Questions stored as cleaned HTML (practice/rich_text.py); tables use .q-table above. A drawing without its own width:
   one graph up to 420px, a series of figures about 140px each, an option's figure a 110px tile. */
.q-rich{display:block;overflow-wrap:anywhere}.q-rich p{margin:0 0 .6em}.q-rich ul,.q-rich ol{margin:.3em 0 .6em;padding-left:1.4em}
.q-rich blockquote{margin:.4em 0;padding:.4em .8em;border-left:3px solid var(--line)}
.q-svg{display:inline-block;vertical-align:middle;max-width:100%;height:auto;max-height:46vh;margin:.4em .6em .4em 0}
.q-svg:not([width]){width:min(100%,420px)}.q-rich:has(.q-svg~.q-svg) .q-svg:not([width]){width:min(30%,140px)}
span.q-rich .q-svg{max-height:120px;margin:0}span.q-rich .q-svg:not([width]){width:110px}.q-svg text{font-family:inherit}
.q-rich .q-highlight{background:#fff3c4}.q-rich .q-center{text-align:center}.q-rich .q-note{display:block;color:var(--muted)}
.options.figure-options{grid-template-columns:repeat(auto-fit,minmax(120px,1fr))}
