/* ExamStudyAid: the two practice pages, apple style (owner, 2026-10-24: "/apple-style topic questions and mcq BUT DEMO
   ONLY", then "make the answer box nicer in the tqs" and "do it"). A layer loaded by nb_question_index.html and
   nb_mcq_index.html after their own sheets (before the reading sheet, which stays last), every rule under the two
   practice columns, .nb-qg-column (topic questions) and .nb-mcq-column (multiple choice). The chapter rail is not
   touched. What it does:
   - the two pages are one segmented switch, the Premium card's .nb-switch (a grey track, the page you are on raised in
     white), not underlined tabs; the labels are in sentence case in the templates;
   - the "go in order" note keeps its picture, its title in the one ink, no icon on its kicker, and a blue tint for
     "Start at question 1", so the page keeps one solid blue button;
   - multiple choice: the options are raised rows with no edge, blue under the pointer; an answered pick and answer in
     their own wash, no edge; the response says Correct or Not quite in its colour, with no disc and no heading icons;
     Q01 in the ink;
   - topic questions: the marks in the soft ink; the answer box is a sheet of paper to write on (below), the Calculator
     a quiet tint with no icon in its foot; "View model answer" without its book, the AI line soft without its (i).
   Tokens only, both themes; no edge, no glow, no capsule. */

html body :is(.nb-mcq-column, .nb-qg-column) {
  --pl-soft: var(--nb-soft, var(--nb-ink));
  --pl-row: var(--nb-paper-raised);
  --pl-row-on: color-mix(in srgb, var(--nb-blue) 9%, var(--nb-paper-raised));
}

/* ── The two pages as one segmented switch (the Premium card's .nb-switch), not underlined tabs ── */
html body :is(.nb-mcq-column, .nb-qg-column) .questions-mode-tabs {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  flex: 0 0 auto;
  justify-self: start;
  align-self: start;
  width: auto;
  gap: 0;
  padding: 4px;
  border: 0;
  border-radius: var(--nb-r-lg, 12px);
  background: color-mix(in srgb, var(--nb-ink) 6%, transparent);
}
html body :is(.nb-mcq-column, .nb-qg-column) .questions-mode-tabs .qmt-indicator {
  display: none;
}
html body :is(.nb-mcq-column, .nb-qg-column) .questions-mode-tabs .questions-mode-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 10px 22px;
  border-radius: var(--nb-r-md, 8px);
  box-shadow: none;
  font: 500 var(--nb-text-base, 16px)/1 var(--nb-sans);
  text-align: center;
  color: var(--pl-soft);
}
html body :is(.nb-mcq-column, .nb-qg-column) .questions-mode-tabs .questions-mode-tab:hover {
  color: var(--nb-ink);
}
html body :is(.nb-mcq-column, .nb-qg-column) .questions-mode-tabs .questions-mode-tab.is-active {
  background: color-mix(in srgb, white 9%, var(--nb-paper-raised));
  box-shadow: inset 0 1px 0 color-mix(in srgb, white 6%, transparent);
  color: var(--nb-ink);
}
html.theme-light body :is(.nb-mcq-column, .nb-qg-column) .questions-mode-tabs .questions-mode-tab.is-active {
  background: white;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--nb-ink) 10%, transparent), 0 4px 12px -2px color-mix(in srgb, var(--nb-ink) 10%, transparent);
}
/* the masthead and the MCQ bar lose the hairline the tabs stood on */
html body .nb-qg-column .nb-qg-masthead,
html body .nb-mcq-column .nb-mcq-bar {
  border-bottom: 0;
}
html body .nb-mcq-column .nb-mcq-bar {
  row-gap: var(--nb-s4);
}

/* ── The "go in order" note: flat, its title in the one ink, a tinted button ── */
html body :is(.nb-mcq-column, .nb-qg-column) .nb-order-card {
  /* no edge at all: a transparent one let the card's own fill ring the darker scene in a 1px line */
  border-width: 0;
  box-shadow: none;
}
html body :is(.nb-mcq-column, .nb-qg-column) .nb-order-kicker {
  font-weight: 500;
  color: var(--pl-soft);
}
html body :is(.nb-mcq-column, .nb-qg-column) .nb-order-kicker svg {
  display: none;
}
html body :is(.nb-mcq-column, .nb-qg-column) .nb-order-title {
  font-family: var(--nb-sans);
  letter-spacing: -0.02em;
}
html body :is(.nb-mcq-column, .nb-qg-column) .nb-order-title em {
  color: inherit;
}
html body :is(.nb-mcq-column, .nb-qg-column) .nb-order-go {
  border-color: transparent;
  background: color-mix(in srgb, var(--nb-blue) 10%, transparent);
  color: var(--nb-blue);
}
@media (hover: hover) {
  html body :is(.nb-mcq-column, .nb-qg-column) .nb-order-go:hover {
    border-color: transparent;
    background: color-mix(in srgb, var(--nb-blue) 16%, transparent);
    color: var(--nb-blue-strong, var(--nb-blue));
    transform: none;
  }
}

/* ── Multiple choice ── */
html body .nb-mcq-column .nb-mcq-progress-meta {
  color: var(--pl-soft);
}
html body .nb-mcq-column .nb-mcq-progress-meta span {
  color: var(--nb-ink);
  font-weight: 600;
}
html body .nb-mcq-column .nb-mcq-progress-bar {
  height: 4px;
  border-radius: var(--nb-r-sm, 4px);
}
/* the number in the ink, as on topic questions */
html body .nb-mcq-column .mcq-q-no {
  color: var(--nb-ink);
}
/* an option: a raised row with no edge (its fill and its letter say it is a control); blue under the pointer */
html body .nb-mcq-column .mcq-option-btn {
  border-color: transparent;
  background: var(--pl-row);
}
@media (hover: hover) {
  html body .nb-mcq-column .mcq-option-btn:hover:not(:disabled) {
    border-color: transparent;
    background: var(--pl-row-on);
  }
}
@media (prefers-reduced-motion: no-preference) {
  html body .nb-mcq-column .mcq-option-btn:active:not(:disabled) { transform: none; }
}
/* answered: the pick and the answer in their own wash, no edge */
html body .nb-mcq-column .mcq-option-btn:is(.is-correct, .is-incorrect) {
  border-color: transparent;
  background: color-mix(in srgb, var(--mcq-state) 13%, var(--nb-paper-raised));
}
/* the response: no disc round the verdict, no icons on the headings; the word says it in its colour */
html body .nb-mcq-column .mcq-verdict {
  grid-template-columns: minmax(0, 1fr);
}
html body .nb-mcq-column .mcq-verdict-icon,
html body .nb-mcq-column .mcq-expl-icon {
  display: none;
}
html body .nb-mcq-column .mcq-verdict-text {
  font-size: 1.625rem;
  letter-spacing: -0.02em;
}
html body .nb-mcq-column .mcq-answer-ref-label {
  color: var(--pl-soft);
}
html body .nb-mcq-column .mcq-explanation-label {
  padding-left: 0;
  font-weight: 600;
}

/* ── Topic questions ── */
html body .nb-qg-column .nb-tq-card .nb-tq-allocation {
  font-weight: 500;
  color: var(--pl-soft);
}
/* the Calculator: words in a quiet tint, no icon */
html body .nb-qg-column .tqc-has-toggle .tqc-toggle:not([data-ui-pressed="true"]) {
  height: 32px;
  padding: 0 var(--nb-s3);
  border-radius: var(--nb-r-md, 8px);
  background: color-mix(in srgb, var(--nb-ink) 7%, transparent);
  font-weight: 500;
}
html body .nb-qg-column .tqc-has-toggle .tqc-toggle:not([data-ui-pressed="true"]) svg {
  display: none;
}
@media (hover: hover) {
  html body .nb-qg-column .tqc-has-toggle .tqc-toggle:not([data-ui-pressed="true"]):hover {
    background: color-mix(in srgb, var(--nb-ink) 11%, transparent);
  }
}
/* the model answer: blue words and their disclosure, no book */
html body .nb-qg-column .nb-tq-card .tq-reveal-btn > svg:first-child {
  display: none;
}
/* the AI notice: soft words, no (i) */
html body .nb-qg-column .nb-tq-card .qg-ai-notice {
  color: var(--pl-soft);
}
html body .nb-qg-column .nb-tq-card .qg-ai-notice::before {
  content: none;
}
html body .nb-qg-column .nb-tq-card .nb-tq-word-count {
  color: var(--pl-soft);
}

/* ── Phones: the switch spans the column ── */
@media (max-width: 860px) {
  html body :is(.nb-mcq-column, .nb-qg-column) .questions-mode-tabs {
    width: 100%;
  }
  html body :is(.nb-mcq-column, .nb-qg-column) .questions-mode-tabs .questions-mode-tab {
    min-height: 44px;
    padding: 8px 10px;
    font-size: 15px;
    line-height: 1.2;
    white-space: normal;
  }
}

/* ── The answer box: a sheet of paper to write on (owner, 2026-10-24: "make the answer box nicer in the tqs") ──
   The box's wrapper is the sheet: raised paper with a paper shadow, 12px corners and no edge. The words sit on it at a
   reading size and run its full width; under them a quiet foot inside the sheet holds the word count on the left and
   the Calculator on the right, and the words never run under that foot: the box grows with the answer (tq-grow.js), so
   a long one never scrolls inside it. Hovering changes nothing, and focus is still the one thin blue ring, round the
   whole sheet (owner, 2026-10-07 and 2026-10-09). */
html body .nb-qg-column.nb-qg-practice .nb-tq-card .tq-input-wrap {
  position: relative;
  padding-bottom: 52px;
  border-radius: var(--nb-r-lg, 12px);
  background: var(--nb-paper-raised);
  box-shadow: var(--nb-shadow-1);
}
html body .nb-qg-column.nb-qg-practice .nb-tq-card .tq-input-wrap:focus-within {
  outline: 1px solid var(--nb-blue);
  outline-offset: 0;
}
html body .nb-qg-column.nb-qg-practice .nb-tq-card .tq-input-wrap .qg-input,
html body .nb-qg-column.nb-qg-practice .nb-tq-card .tq-input-wrap .qg-input:not(.is-locked),
html body .nb-qg-column.nb-qg-practice .nb-tq-card .tq-input-wrap .qg-input:is(:hover, :focus, :focus-visible) {
  display: block;
  width: 100%;
  min-height: 188px;
  padding: 22px 24px 8px;
  border: 0;
  border-radius: var(--nb-r-lg, 12px) var(--nb-r-lg, 12px) 0 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  font: 400 1.0625rem/1.7 var(--nb-sans);
  resize: none;
}
html body .nb-qg-column.nb-qg-practice .nb-tq-card .tq-input-wrap[data-write="none"] .qg-input {
  min-height: 84px;
}
/* while it marks, and after, the box is read only (grader.js .is-locked): the whole sheet takes the sunken paper */
html body .nb-qg-column.nb-qg-practice .nb-tq-card .tq-input-wrap:has(.qg-input.is-locked) {
  background: var(--nb-paper-sunken, var(--nb-paper));
  box-shadow: none;
}
/* signed out the box takes nothing and has no foot (the sign-in dialog opens from it) */
html body .nb-qg-column.nb-qg-practice .nb-tq-card .tq-input-wrap--signin {
  padding-bottom: 0;
}
html body .nb-qg-column.nb-qg-practice .nb-tq-card .tq-input-wrap--signin .qg-input,
html body .nb-qg-column.nb-qg-practice .nb-tq-card .tq-input-wrap--signin .qg-input:is(:hover, :focus, :focus-visible) {
  padding-bottom: 22px;
  border-radius: var(--nb-r-lg, 12px);
}
html body .nb-qg-column .tqc-has-toggle .tqc-toggle:not([data-ui-pressed="true"]) {
  top: auto;
  bottom: 10px;
  right: 12px;
}
html body .nb-qg-column .nb-tq-card .nb-tq-answer-meta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 32px;
  margin-top: -42px;
  margin-bottom: 26px;
  padding-left: 24px;
  font-size: var(--nb-text-sm);
  pointer-events: none;
}
@media (max-width: 600px) {
  html body .nb-qg-column.nb-qg-practice .nb-tq-card .tq-input-wrap .qg-input,
  html body .nb-qg-column.nb-qg-practice .nb-tq-card .tq-input-wrap .qg-input:not(.is-locked),
  html body .nb-qg-column.nb-qg-practice .nb-tq-card .tq-input-wrap .qg-input:is(:hover, :focus, :focus-visible) {
    min-height: 168px;
    padding: 18px 18px 8px;
  }
  html body .nb-qg-column .nb-tq-card .nb-tq-answer-meta {
    padding-left: 18px;
  }
}

/* ══ Study v5 (2026-11-15, docs/redesign/STUDY-DESIGN.md): the practice pages' fixes, in one place ══════════════════════
   Right, wrong and partly right keep one vocabulary on every tool: --nb-success and --nb-error for the two ends, the ink
   for the middle, and always a word or an icon beside the colour. Tokens only. */

/* ── Multiple choice ── */
/* an unanswered row has a hairline: a white row on the mist desk is 1.06:1 without one. The border stays transparent (the
   answered states and the focus ring draw their own), so the edge is an inset ring that never moves the row. */
html body .nb-mcq-column .mcq-option-btn:not(.is-correct, .is-incorrect) {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--nb-ink) 16%, transparent);
}
/* an answered card at 1280px and up widens to the right only: the card keeps the left edge of the 982px sheet, so the
   number and the options stay where they were and only the response comes in (before, the whole card grew both ways and
   its number and options slid up to 129px to the left). The padding is the room the old centred card had on its left. */
@media (min-width: 1280px) {
  html body .nb-mcq-column .question-card.is-answered {
    padding-inline-start: calc((100% - var(--nb-mcq-sheet-width)) / 2);
  }
}
/* the phone's filled ring: its tick or cross is the page tone on the state's own colour, which holds 4.5:1 in both themes
   (a white glyph on the night's light green was 2.2:1) */
@media (max-width: 640px) {
  html body .nb-mcq-column .mcq-option-btn:is(.is-correct, .is-incorrect) .mcq-opt-mark {
    color: var(--nb-paper);
  }
}
/* the refusal line under the options: a notice, not a footnote */
html body .nb-mcq-column .mcq-answer-note:not([hidden]) {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--nb-r-md, 8px);
  background: color-mix(in srgb, var(--nb-error) 9%, transparent);
  color: var(--nb-ink);
  scroll-margin-bottom: calc(var(--nb-tb-h, 0px) + var(--nb-s5));
}
html body .nb-mcq-column .mcq-answer-note::before {
  content: "";
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  background: var(--nb-error);
  -webkit-mask: var(--pl-notice-icon) center / contain no-repeat;
  mask: var(--pl-notice-icon) center / contain no-repeat;
}

/* ── Topic questions ── */
html body :is(.nb-mcq-column, .nb-qg-column) {
  --pl-notice-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm-1.1 5.2h2.2v6.4h-2.2V7.2Zm1.1 9.2a1.35 1.35 0 1 1 0 2.7 1.35 1.35 0 0 1 0-2.7Z' fill='black'/%3E%3C/svg%3E");
}
/* The form is a column so the word count can sit on the foot of the box whatever shows between them. In the markup the
   hint comes straight after the box, and the count used to be pulled up into the box by -42px: when the hint showed
   (an empty press, the marker not reachable, a refused model answer) the count slid out of the box and under the message.
   The order puts the count right after the box and the hint after the count, and the markup (and the tab order) stay. */
html body .nb-qg-column.nb-qg-practice .nb-tq-card .qg-form {
  display: flex;
  flex-direction: column;
}
html body .nb-qg-column.nb-qg-practice .nb-tq-card .qg-form > .tq-input-wrap { order: 1; }
html body .nb-qg-column.nb-qg-practice .nb-tq-card .qg-form > .nb-tq-answer-meta {
  order: 2;
  /* it was 26px and collapsed with the actions' 16px; a flex column does not collapse, so 26 less 16 */
  margin-bottom: calc(26px - var(--nb-s4));
}
html body .nb-qg-column.nb-qg-practice .nb-tq-card .qg-form > .qg-hint { order: 3; }
html body .nb-qg-column.nb-qg-practice .nb-tq-card .qg-form > .qg-saved { order: 4; }
html body .nb-qg-column.nb-qg-practice .nb-tq-card .qg-form > .nb-tq-actions { order: 5; }
/* an error or a refusal: words in the ink on a wash of the wrong colour, with its mark, where the student is looking
   (the old line was 13px in red with nothing beside it) */
html body .nb-qg-column .nb-tq-card .qg-hint:not([hidden]) {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: var(--nb-s3) 0 0;
  padding: 10px 14px;
  border-radius: var(--nb-r-md, 8px);
  background: color-mix(in srgb, var(--nb-error) 9%, transparent);
  color: var(--nb-ink);
  font: 500 var(--nb-text-base, 16px)/1.45 var(--nb-sans);
  scroll-margin-bottom: calc(var(--nb-tb-h, 0px) + var(--nb-s5));
}
html body .nb-qg-column .nb-tq-card .qg-hint:not([hidden])::before {
  content: "";
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  background: var(--nb-error);
  -webkit-mask: var(--pl-notice-icon) center / contain no-repeat;
  mask: var(--pl-notice-icon) center / contain no-repeat;
}
/* the actions row, and Mark answer in it, stay clear of the thumb bar when the page scrolls them into view (the bar's
   own reservation is the page's foot; this is for a focus or a scroll that lands on them) */
html body .nb-qg-column .nb-tq-card :is(.nb-tq-actions, .tq-mark-btn) {
  scroll-margin-bottom: calc(var(--nb-tb-h, 0px) + var(--nb-s6));
}
@media (max-width: 860px) {
  html body .nb-qg-column .nb-tq-card .tq-mark-btn { min-height: 44px; }
}
/* the Calculator button: 44px where there is a finger (32px on a desk), seated in the box's 52px foot */
@media (max-width: 860px), (pointer: coarse) {
  html body .nb-qg-column .tqc-has-toggle .tqc-toggle:not([data-ui-pressed="true"]) {
    height: 44px;
    bottom: 4px;
  }
}

/* ── A phone: the two tabs keep one line each (owner, 2026-11-27: "these nitpicky things") ──
   Multiple choice questions broke onto a second line beside Topic questions from 430px down; the tab says Multiple
   choice there, its last word kept for a screen reader. */
@media (max-width: 560px) {
  html body .questions-mode-tab .questions-mode-tab-more {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* ── Study v5 (owner, 2026-11-15): one left edge ── */
/* The MCQ page's trail, title, tabs and tally stand on the sheet's left edge, where Q01 and the topic questions page's
   masthead stand; they were 48px in. The tutor's quiz keeps its own column. */
@media (min-width: 861px) {
  html body .nb-mcq-column:not(.nb-quiz) :is(.nb-mcq-head, .nb-mcq-bar) {
    padding-inline-start: 0;
  }
  html body .nb-mcq-column:not(.nb-quiz) .nb-notes-header .nb-breadcrumb ol {
    justify-content: flex-start;
  }
}
/* The trail starts where the title does at every width: from 768px to 860px it still stood centred over the MCQ and
   topic questions titles, which start on the left (the nitpick check, 2026-11-27). */
html body :is(.nb-mcq-column:not(.nb-quiz), .nb-qg-practice) .nb-notes-header .nb-breadcrumb ol {
  justify-content: flex-start;
  text-align: start;
}

/* ── Study v5 (owner, 2026-11-15: "the same issue exists on multiple choice questions"): the number close to its words ── */
/* The number takes the topic questions' 17px with tabular digits (Q01 to Q99 one width) in a 36px column with a 20px
   gap, so the words start about 23px after it (they started 92px from its left, 53px after it) and every card's words
   keep one edge down the list. Under 641px the card keeps its own 44px and 40px columns (notebook-mcq.css). */
html body .question-card .mcq-q-no {
  font-size: var(--nb-text-md);
  font-variant-numeric: tabular-nums;
}
@media (min-width: 641px) {
  html body .question-card {
    --mcq-num-w: 36px;
    --mcq-col-gap: var(--nb-s5);
  }
}
