/* ExamStudyAid: the topic question and MCQ pages as search reads them (Phase 3, U9: PHASE3-PLAN-v2.md contract 4 and
   U9-amend-v2.md 3.4). Loaded by nb_question_index.html and nb_mcq_index.html straight before the reading sheet, which
   stays the last stylesheet of the head. Three small things, every rule under the two practice columns:
   1. a topic question card's meta line: the marks it already shows, then the board's command word and, on a chapter
      page, the topic number, on the marks' own line in the marks' own voice (no corner stamp: DESIGN.md);
   2. the topic's pages (?page=N): a quiet line under the questions, the pages either side as the notebook's quiet
      buttons and the questions this page holds between them;
   3. under the questions: "What these questions test" (the note's objectives) and the plain links, Revise the note,
      Past papers and Report a mistake, on a white sheet as tinted buttons (2026-11-21).
   Tokens only, both themes; no aria (the markup carries no state); every link and button a 44px target; nothing wider
   than its column at 390px. */

/* ---------- 1 · The card's meta line ---------------------------------- */
/* A line longer than its card ("2 marks · State what is meant by · 3.1" is 313px; a 320px phone's card holds 280)
   wraps between its parts, each line at the right, never inside a part and never after a dot: each dot travels with
   the part after it (nb-tq-part). Nothing is cut off at the card's edge (The No-Sideways Rule). */
html body .nb-qg-column .nb-tq-card .nb-tq-meta:has(.nb-tq-sep) {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--nb-s2);
  row-gap: 0;
}
html body .nb-qg-column .nb-tq-card .nb-tq-meta .nb-tq-part {
  display: inline-flex;
  gap: var(--nb-s2);
  white-space: nowrap;
}
html body .nb-qg-column .nb-tq-card .nb-tq-meta :is(.nb-tq-sep, .nb-tq-word) {
  font: 400 var(--nb-text-base)/1.5 var(--nb-sans);
  color: var(--pl-soft, var(--nb-ink));
  white-space: nowrap;
}
@media (max-width: 600px) {
  /* a phone: the line takes the whole row under the question, the number's column included (it is empty there), so a
     line that fits the card stays one line and only a longer one wraps */
  html body .nb-qg-column .nb-tq-card .nb-tq-meta:has(.nb-tq-sep) {
    grid-column: 1 / -1;
  }
}
/* A head too narrow for the words and the line side by side: the line goes under the question. Beside the question the
   line takes the head's auto column at its full width, so with the rail out at 861 to 1100px, and on a small tablet,
   a long line left the question about 104px at 900 (67px at 861) and broke "reproduction" inside the word. The head is
   a size container from 601px (the phone's own, tq-head in topic-question-card.css, stops at 500px), and below 47.5rem
   of head, where a 313px line would leave the question under 20rem, every card's line moves under its question at the
   right, as at 600px and below; the question then takes the head but for its number. A wider head keeps the line
   beside the question. */
@media (min-width: 601px) {
  html body .nb-qg-column .nb-tq-card .tq-q-head {
    container: pu-head / inline-size;
  }
}
@container pu-head (max-width: 47.5rem) {
  html body .nb-qg-column .nb-tq-card .tq-q-main {
    grid-column: 2 / -1;
    grid-row: 1;
  }
  html body .nb-qg-column .nb-tq-card .nb-tq-meta {
    grid-column: 2 / -1;
    grid-row: 2;
  }
  html body .nb-qg-column .nb-tq-card .nb-tq-meta:has(.nb-tq-sep) {
    grid-column: 1 / -1;
  }
}

/* ---------- 2 · The topic's pages ------------------------------------- */
:is(.nb-qg-column, .nb-mcq-column) .nb-pu-pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--nb-s2) var(--nb-s4);
  margin-block: var(--nb-s7) 0;
  padding-top: var(--nb-s4);
  border-top: 1px solid var(--nb-border);
}
:is(.nb-qg-column, .nb-mcq-column) .nb-pu-pages-here {
  flex: 1 1 auto;
  margin: 0;
  font: 500 var(--nb-text-sm)/1.4 var(--nb-sans);
  text-align: center;
  color: var(--nb-ink);
}
:is(.nb-qg-column, .nb-mcq-column) .nb-pu-page {
  min-height: 44px;
}
:is(.nb-qg-column, .nb-mcq-column) .nb-pu-page--prev {
  order: -1;
}
@media (max-width: 600px) {
  /* a phone: the page's own range on a line of its own, the two ways on under it at each end */
  :is(.nb-qg-column, .nb-mcq-column) .nb-pu-pages-here {
    flex-basis: 100%;
    order: -2;
  }
  :is(.nb-qg-column, .nb-mcq-column) .nb-pu-page--next {
    margin-inline-start: auto;
  }
}
/* Study v5 (owner, 2026-11-21, on a topic question page: "why is this questions 1-20 shown? it looks not like its
   supposed to be here"). The line is the topic's index for a reader without script and for search. Once a script has
   taken the topic over it contradicts what is on screen, so it steps aside:
   - topic questions: question-pager.js marks the list .is-paged and its own bar (Previous, every number, Next) reaches
     every question of the topic, those before this page included, so the line goes whole;
   - MCQs: mcq.js loads the rest of the topic under the list as it scrolls, so "Questions 1-20 of 52" and the next
     page's link go; on ?page=2 and on, the earlier questions are on no screen, so the previous page's link stays. */
.nb-qg-column:has(.question-list.is-paged) .nb-pu-pages,
html.js .nb-mcq-column .nb-pu-pages:not(:has(.nb-pu-page--prev)),
html.js .nb-mcq-column .nb-pu-pages :is(.nb-pu-pages-here, .nb-pu-page--next) {
  display: none;
}

/* ---------- 3 · Under the questions ----------------------------------- */
/* Study v5 (2026-11-15): the block keeps the sheet's own side margins (tq-desk.css centres the sheet), so it stands
   on the question's edges; a plain margin here zeroed them and left it 252px left of the question at 1920.
   2026-11-21 (owner, of the bulleted list and the underlined links: "make this match the theme instead of plain
   ugly"): a white sheet on the desk (raised grey by night) with no edge (apple style: fill, never an outline), the
   objectives as rows between hairlines with their code in the soft ink, then the ways on as tinted buttons, the first
   (the note, when there is one) blue and the rest the ink's quiet tint, and Report a mistake a soft word at the end. */
:is(.nb-qg-column, .nb-mcq-column) .nb-pu {
  margin-block: var(--nb-s7) var(--nb-s6);
  padding: var(--nb-s5) var(--nb-s6) var(--nb-s6);
  background: var(--nb-paper-raised);
  border: 0;
  border-radius: var(--nb-r-lg);
}
:is(.nb-qg-column, .nb-mcq-column) .nb-pu-title {
  margin: 0 0 var(--nb-s2);
  font: 650 var(--nb-text-md)/1.35 var(--nb-sans);
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--nb-ink);
}
:is(.nb-qg-column, .nb-mcq-column) .nb-pu-objectives {
  margin: 0 0 var(--nb-s5);
  padding: 0;
  list-style: none;
  font: var(--nb-type-ui);
  color: var(--nb-ink);
}
:is(.nb-qg-column, .nb-mcq-column) .nb-pu-objective {
  padding: var(--nb-s3) 0;
  overflow-wrap: break-word;
}
:is(.nb-qg-column, .nb-mcq-column) .nb-pu-objective + .nb-pu-objective {
  margin-top: 0;
  border-top: 1px solid var(--nb-border);
}
/* an objective with its specification code ("1.2.A — Describe ...") reads as one line of text, the code soft */
:is(.nb-qg-column, .nb-mcq-column) .nb-pu-objective :is(.obj-code, .nt-objective-dash, .nt-objective-text) {
  font: inherit;
  color: inherit;
}
:is(.nb-qg-column, .nb-mcq-column) .nb-pu-objective :is(.obj-code, .nt-objective-dash) {
  font-weight: 600;
  color: var(--nb-soft);
}
:is(.nb-qg-column, .nb-mcq-column) .nb-pu-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--nb-s2);
  margin: 0;
  padding: 0;
  list-style: none;
}
:is(.nb-qg-column, .nb-mcq-column) .nb-pu-objectives + .nb-pu-links {
  padding-top: var(--nb-s4);
  border-top: 1px solid var(--nb-border);
}
:is(.nb-qg-column, .nb-mcq-column) .nb-pu-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 var(--nb-s4);
  font: 600 var(--nb-text-sm)/1.2 var(--nb-sans);
  color: var(--nb-ink);
  text-decoration: none;
  background: var(--nb-btn-quiet);
  border-radius: var(--nb-r-md);
  transition: background-color var(--nb-dur-1) var(--nb-ease), color var(--nb-dur-1) var(--nb-ease);
}
:is(.nb-qg-column, .nb-mcq-column) .nb-pu-links > li:first-child > .nb-pu-link:not([href^="mailto:"]) {
  color: var(--nb-blue);
  background: var(--nb-btn-blue);
}
:is(.nb-qg-column, .nb-mcq-column) .nb-pu-links > li:has(> .nb-pu-link[href^="mailto:"]) {
  margin-inline-start: auto;
}
:is(.nb-qg-column, .nb-mcq-column) .nb-pu-link[href^="mailto:"] {
  padding: 0;
  font-weight: 500;
  color: var(--nb-soft);
  background: none;
}
@media (hover: hover) {
  :is(.nb-qg-column, .nb-mcq-column) .nb-pu-link:hover {
    background: var(--nb-btn-quiet-on);
  }
  :is(.nb-qg-column, .nb-mcq-column) .nb-pu-links > li:first-child > .nb-pu-link:not([href^="mailto:"]):hover {
    color: var(--nb-blue-strong);
    background: var(--nb-btn-blue-on);
  }
  :is(.nb-qg-column, .nb-mcq-column) .nb-pu-link[href^="mailto:"]:hover {
    color: var(--nb-ink);
    background: none;
  }
}
@media (max-width: 860px), (pointer: coarse) {
  :is(.nb-qg-column, .nb-mcq-column) .nb-pu {
    padding: var(--nb-s4) var(--nb-s4) var(--nb-s5);
  }
  :is(.nb-qg-column, .nb-mcq-column) .nb-pu-link {
    min-height: 44px;
  }
}
:is(.nb-qg-column, .nb-mcq-column) .nb-pu-link:focus-visible {
  outline: 2px solid var(--nb-blue);
  outline-offset: 2px;
}
