/* Teach Me Maths: the maths exercise book.
   Design tokens first; change a colour or size here and it changes everywhere. */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../fonts/atkinson-hyperlegible-next-400.63730b9efc0d.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../fonts/atkinson-hyperlegible-next-700.fed09c9882e4.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Colour */
  --paper: #ffffff;        /* page background */
  --grid: #e4eaf2;         /* table rules and borders */
  --ink: #1c2b45;          /* text */
  --ink-soft: #4a5872;     /* secondary text (7:1 on white) */
  --biro: #2b55c9;         /* links and buttons */
  --highlighter: #ffe35a;  /* the one accent: marks the newest series */
  --teal-pale: #e1eded;    /* 13% brand teal on white: the row under the cursor */
  --teal: #137475;         /* brand colour, from the logo */
  --tangent: #b34723;      /* calculus graphs: the tangent line (rust, distinct from the biro curve) */
  --normal: #397344;       /* calculus graphs: the normal line (green, dashed) */

  /* Type */
  --font: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", sans-serif;
  --text-sm: 0.9375rem;
  --text-base: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: 1.625rem;
  --text-2xl: clamp(1.75rem, 1.2rem + 2.2vw, 2.5rem);
  --text-hero: clamp(1.6875rem, 1.2rem + 2.2vw, 2.5rem); /* home page heading */

  /* Space and layout */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --doodle-size: 640px;    /* one tile of the doodle background (static/img/doodle.svg) */
  --radius: 6px;
  --page-width: 72rem;
  --measure: 68ch;         /* comfortable line length for reading */
  --focus: 3px solid var(--biro);
}

/* Base ------------------------------------------------------------------ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.55;
}

main {
  flex: 1;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 var(--space-4);
}

h1 {
  font-size: var(--text-2xl);
}

h2 {
  font-size: var(--text-xl);
  margin-top: var(--space-8);
}

p,
ul {
  margin: 0 0 var(--space-4);
}

a {
  color: var(--biro);
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

img {
  max-width: 100%;
  height: auto;
}

/* The hidden attribute always wins, even over an element's own display rule. */
[hidden] {
  display: none !important;
}

.wrap {
  width: 100%;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.page {
  padding-top: var(--space-6);
  padding-bottom: var(--space-12);
}

.prose > * {
  max-width: var(--measure);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -3rem;
  padding: var(--space-2) var(--space-4);
  background: var(--paper);
  z-index: 10;
}

.skip-link:focus {
  top: var(--space-2);
}

/* Header and footer ------------------------------------------------------ */

.site-header {
  border-bottom: 1px solid var(--grid);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap; /* if the name and menu can't share a line, the menu drops below */
  align-items: center;
  justify-content: space-between;
  column-gap: var(--space-4);
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
}

@media (max-width: 30rem) {
  .site-header__inner {
    column-gap: var(--space-3); /* a little more room for the name on small phones */
  }
}

/* The narrowest phones (under ~370px): slightly smaller menu text so the
   name and "Past Papers" still share one line. */
@media (max-width: 23rem) {
  .site-nav a {
    font-size: var(--text-sm);
  }
}

/* The site name with the infinity mark to its left (one link; the mark is decorative). */
.site-header__name {
  display: flex;
  align-items: center;
  gap: 0.38em; /* scales with the name */
  color: var(--teal);
  font-size: calc(var(--text-hero) * 1.08); /* very slightly bigger than the home heading */
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap; /* always one line */
  padding: var(--space-2) 0;
}

.site-header__mark {
  height: 0.78em; /* about the cap height of the name: as tall as its "T", a touch more */
  width: auto;
  flex: none;
}

.site-header__name:hover {
  text-decoration: underline;
}

.site-nav {
  display: flex;
  gap: var(--space-6);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  padding: var(--space-2) 0;
}

.site-nav a:hover {
  color: var(--biro);
  text-decoration: underline;
}

.site-footer {
  border-top: 1px solid var(--grid);
  color: var(--ink-soft);
  font-size: var(--text-sm);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: var(--space-8);
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
}

.site-footer p {
  margin: 0 0 var(--space-2);
}

.site-footer__links {
  display: flex;
  gap: var(--space-4);
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-2);
}

/* Home ------------------------------------------------------------------ */

/* Faint maths doodles (signs, shapes, pi, y = mx + c ...) on white, like the
   WhatsApp chat wallpaper. The tile repeats seamlessly; its colour is set in
   tools/make_doodle.py, which draws it. */
.doodle {
  background-color: var(--paper);
  background-image: url("../img/doodle.8b69417548f4.svg");
  background-size: var(--doodle-size) var(--doodle-size);
}

/* Paper pages: doodles only in the side margins. The content column is a
   white sheet running from the header to the footer. */
.doodle--sides {
  display: flex;
  flex-direction: column;
}

.doodle--sides > .page {
  flex: 1;
  background: var(--paper);
}

.hero {
  padding: var(--space-12) 0;
}

/* The home heading breaks where the meaning breaks:
   wider screens:  Maths past papers and mark schemes / for GCSE, A Level and IGCSE
   phones:         Maths past papers / and mark schemes for / GCSE, A Level and IGCSE */
.hero__title {
  font-size: var(--text-hero); /* 27px minimum so line 3 fits a 360px phone */
  text-wrap: balance; /* if a line still has to wrap, split it evenly */
}

.hero__title .phone-break {
  display: none;
}

@media (max-width: 30rem) {
  .hero__title .phone-break {
    display: inline;
  }

  .hero__title .wide-break {
    display: none;
  }
}

.hero__lead {
  font-size: var(--text-lg);
  margin-bottom: var(--space-8);
}

.choose {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: var(--space-4);
  scroll-margin-top: var(--space-4);
}

.choose__card {
  background: var(--paper);
  border: 1px solid var(--grid);
  border-top: 4px solid var(--teal);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-6) var(--space-6);
}

.choose__title {
  font-size: var(--text-xl);
  margin: 0 0 var(--space-3);
}

.choose__boards {
  list-style: none;
  padding: 0;
  margin: 0;
}

.choose__boards a {
  display: block;
  padding: var(--space-2) 0;
  font-size: var(--text-lg);
  font-weight: 700;
}

/* A card that is one link (an untiered set on a hub): just the title, in ink, the whole card lit pale teal under
   the cursor (Ben, 8 Oct 2026: no caption, no link blue). */
.choose__card--link {
  display: block;
  color: var(--ink);
  text-decoration: none;
}

.choose__card--link .choose__title {
  margin-bottom: 0;
}

.choose__card--link:hover,
.choose__card--link:focus-visible {
  background: var(--teal-pale);
  border-color: var(--teal);
}

.choose__card--link:hover .choose__title {
  text-decoration: underline;
}

.choose__also {
  margin: var(--space-3) 0 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--grid);
}

/* A note under the cards (worksheets chooser). */
.choose__note {
  margin: var(--space-6) 0 0;
  color: var(--ink-soft);
}

/* The "Other qualifications" card on the past papers page: a link and a line of examples. */
.choose__card--other .choose__title a {
  text-decoration: none;
}

.choose__card--other .choose__title a:hover {
  text-decoration: underline;
}

.choose__card--other p {
  margin: 0;
  color: var(--ink-soft);
}

/* The past papers page: a hero that sits closer to the header, with breadcrumbs. */
.hero--inner {
  padding-top: var(--space-6);
}

/* Board page ------------------------------------------------------------ */

.breadcrumbs {
  font-size: var(--text-sm);
  color: var(--ink-soft);
  margin-bottom: var(--space-4);
}

.spec-code {
  font-weight: 400;
  color: var(--ink-soft);
}

.board-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-6);
  margin-bottom: var(--space-6);
}

.board-bar__formulae {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.board-bar__note {
  margin: 0;
  color: var(--ink-soft);
}

/* The "123 worksheets with solutions." line always takes a row of its own, under the tier switch
   and links, so it doesn't jump between Foundation and Higher (whose line is longer). */
.board-bar__count {
  flex-basis: 100%;
}

/* Phones: the second sentence ("Foundation topics are also listed…") starts a new line. */
@media (max-width: 44rem) {
  .board-bar__also {
    display: block;
  }
}

/* Two-way switch (Higher | Foundation, A Level | AS Level). Plain links, no JavaScript. */
.switch {
  display: inline-flex;
  border: 2px solid var(--biro);
  border-radius: var(--radius);
  overflow: hidden;
}

.switch a {
  padding: var(--space-2) var(--space-4);
  font-weight: 700;
  text-decoration: none;
  min-width: 6.5rem;
  text-align: center;
}

.switch a + a {
  border-left: 2px solid var(--biro);
}

.switch a[aria-current="page"] {
  background: var(--biro);
  color: var(--paper);
}

.switch a:not([aria-current]):hover {
  background: var(--grid);
}

.switch a:focus-visible {
  outline-offset: -5px;
  outline-color: var(--highlighter);
}

/* The paper grid: one row per series, one column per paper. */
.paper-grid-scroll {
  overflow-x: auto;
}

.paper-grid {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.paper-grid th,
.paper-grid td {
  text-align: left;
  vertical-align: top;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--grid);
}

/* Column headings wrap (long Core Maths paper names) rather than forcing a sideways scroll. */
.paper-grid thead th {
  font-size: var(--text-sm);
  border-bottom: 2px solid var(--ink);
}

.paper-grid tbody th {
  white-space: nowrap;
}

.paper-grid tbody th a {
  color: var(--ink);
  font-weight: 700;
}

/* The row you're looking at… */
.paper-grid tbody tr:hover > *,
.paper-grid tbody tr:focus-within > * {
  background: var(--teal-pale);
}

/* …and the newest series, marked like a highlighter pen across the name. */
.is-newest th a {
  background: var(--highlighter);
  padding: 0 var(--space-1);
  margin: 0 calc(-1 * var(--space-1));
  box-decoration-break: clone;
}

.newest-tag {
  display: block;
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--ink-soft);
}

.doc-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
}

.doc-link {
  display: inline-block;
  padding: var(--space-1) 0;
}

/* Phones: each series becomes its own block with its papers listed inside. */
@media (max-width: 44rem) {
  .paper-grid,
  .paper-grid tbody,
  .paper-grid tr,
  .paper-grid th,
  .paper-grid td {
    display: block;
  }

  .paper-grid thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .paper-grid tbody tr {
    border: 1px solid var(--grid);
    border-radius: var(--radius);
    margin-bottom: var(--space-4);
    overflow: hidden;
  }

  .paper-grid tbody th {
    font-size: var(--text-lg);
    background: var(--paper);
    border-bottom: 2px solid var(--ink);
    display: flex;
    align-items: baseline;
    gap: var(--space-3);
  }

  .newest-tag {
    display: inline;
  }

  .paper-grid td {
    display: grid;
    grid-template-columns: minmax(6rem, 40%) 1fr;
    gap: var(--space-4);
  }

  .paper-grid td::before {
    content: attr(data-label);
    font-weight: 700;
  }

  .paper-grid td:last-child {
    border-bottom: 0;
  }

  .paper-grid td.is-empty {
    display: none;
  }
}

/* Specs with many papers (Edexcel and MEI Further Maths): the phone layout at every
   width, with the series blocks two across when there's room. Keep these rules
   the same as the phone rules above. */
.paper-grid--stacked,
.paper-grid--stacked tbody,
.paper-grid--stacked tr,
.paper-grid--stacked th,
.paper-grid--stacked td {
  display: block;
}

.paper-grid--stacked thead {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.paper-grid--stacked tbody tr {
  border: 1px solid var(--grid);
  border-radius: var(--radius);
  margin-bottom: var(--space-4);
  overflow: hidden;
}

.paper-grid--stacked tbody th {
  font-size: var(--text-lg);
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
}

.paper-grid--stacked .newest-tag {
  display: inline;
}

.paper-grid--stacked td {
  display: grid;
  grid-template-columns: minmax(6rem, 40%) 1fr;
  gap: var(--space-4);
}

.paper-grid--stacked td::before {
  content: attr(data-label);
  font-weight: 700;
}

.paper-grid--stacked td:last-child {
  border-bottom: 0;
}

.paper-grid--stacked td.is-empty {
  display: none;
}

@media (min-width: 60rem) {
  .paper-grid--stacked tbody {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
    align-items: start;
  }

  .paper-grid--stacked tbody tr {
    margin-bottom: 0;
  }
}

/* Series page ------------------------------------------------------------ */

.series-group h2 {
  margin-top: var(--space-6);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--ink);
}

.series-papers {
  list-style: none;
  padding: 0;
  /* The papers share one name column, so their links line up down the list,
     and the boxes are only as wide as the widest row needs. */
  display: grid;
  grid-template-columns: auto auto;
  width: fit-content;
  max-width: 100%;
}

.series-paper {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(5rem, 12rem) 1fr; /* browsers without subgrid */
  grid-template-columns: subgrid;
  align-items: center;
  column-gap: var(--space-6);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--grid);
  font-variant-numeric: tabular-nums;
}

/* Phones: a name too long to share the line with its buttons puts them
   underneath (OCR Core Maths, Further Maths); short names keep them beside. */
@media (max-width: 40rem) {
  .series-paper {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-6);
  }

  .series-paper__name {
    min-width: 5.5rem;
  }
}

/* Foundation and Higher side by side when there's room; one paper column
   (untiered specs) keeps to a readable width rather than the whole page. */
.series-groups {
  max-width: 48rem;
}

@media (min-width: 60rem) {
  .series-groups--two {
    max-width: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: var(--space-8);
    align-items: start;
  }
}

.series-paper:hover {
  background: var(--teal-pale);
}

.series-paper__name {
  font-weight: 700;
}

.series-nav {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  margin: var(--space-8) 0 var(--space-4);
}

.series-nav__newer {
  margin-left: auto;
}

/* Worksheets -------------------------------------------------------------- */

/* Jump links to each strand (Number, Algebra …). */
.strand-nav ul {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
  font-size: var(--text-sm);
}

.strand h2 {
  margin-top: var(--space-8);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--ink);
  scroll-margin-top: var(--space-4);
}

/* One row per worksheet: name on the left, the two PDF links on the right. */
.sheet-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sheet {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: var(--space-2) var(--space-6);
  padding: var(--space-3) var(--space-2);
  margin: 0 calc(-1 * var(--space-2));
  border-bottom: 1px solid var(--grid);
  font-variant-numeric: tabular-nums;
}

.sheet:hover,
.sheet:focus-within {
  background: var(--teal-pale);
}

.sheet__name a {
  color: var(--ink);
  font-weight: 700;
}

.sheet__meta {
  display: inline-block;
  margin-left: var(--space-2);
  color: var(--ink-soft);
  font-size: var(--text-sm);
}

/* Grade filter, sort and search (shown by static/js/worksheets.js). */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-6);
  align-items: flex-end;
  margin-bottom: var(--space-6);
  padding: var(--space-4);
  border: 1px solid var(--grid);
  border-radius: var(--radius);
}

.controls__field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.controls__field--search {
  flex: 1 1 14rem;
}

.controls label {
  font-size: var(--text-sm);
  font-weight: 700;
}

.controls select,
.controls input {
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink-soft);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  min-height: 2.75rem;
}

.controls input {
  width: 100%;
}

.controls select:focus-visible,
.controls input:focus-visible {
  border-color: var(--biro);
  outline: var(--focus);
  outline-offset: 2px;
}

/* "× Reset filters": grey text, only while something is applied. It sits on the controls' row, level with the
   middle of the boxes (Ben, 9 Nov 2026: on a line of its own it made the box taller and pushed the list down),
   and wraps underneath only where the row has no room. */
.controls__reset {
  display: inline-flex;
  align-items: center;
  gap: 0.3em; /* a flex box drops the space between × and the words */
  align-self: flex-end;
  min-height: 2.75rem;
  width: max-content;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: var(--text-sm);
  color: var(--ink-soft);
  cursor: pointer;
}

.controls__reset:hover {
  color: var(--biro);
  text-decoration: underline;
}

.no-match {
  padding: var(--space-4);
  border: 1px solid var(--grid);
  border-radius: var(--radius);
}

.button--small {
  padding: var(--space-1) var(--space-4);
  margin-left: var(--space-2);
}

/* Small labels beside a title: grade, strand (in the flat views), tier. */
.tag,
.tier-tag {
  display: inline-block;
  margin-left: var(--space-2);
  padding: 0 var(--space-2);
  border: 1px solid var(--ink-soft);
  border-radius: var(--radius);
  color: var(--ink-soft);
  font-size: var(--text-sm);
  line-height: 1.4;
  vertical-align: 0.1em;
}

.grade-tag,
.level-tag {
  border-color: var(--teal);
  color: var(--teal);
}

/* The strand label only earns its place when the list isn't grouped by strand. */
.sheets--strand .strand-tag {
  display: none;
}

/* Phones: title, then the tags, then the question count, each on its own line, with the links below. */
@media (max-width: 44rem) {
  .sheet {
    grid-template-columns: 1fr;
    gap: var(--space-1);
  }

  .sheet__name a {
    display: inline-block;
  }

  .sheet__tags,
  .sheet__meta {
    display: block;
    margin: var(--space-1) 0 0;
  }

  .sheet__tags .tag,
  .sheet__tags .tier-tag {
    margin: 0 var(--space-2) 0 0;
  }
}

/* One worksheet's page: the two PDF buttons and its details. */
.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: var(--space-6) 0;
}

.button {
  display: inline-block;
  padding: var(--space-2) var(--space-6);
  border: 2px solid var(--biro);
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
}

.button:first-child {
  background: var(--biro);
  color: var(--paper);
}

.button:hover {
  text-decoration: underline;
}

/* The sheet's facts: course, strand and grade in bold, one per line; then
   "15 questions, 32 marks, 6 pages" in grey underneath. */
.facts {
  max-width: var(--measure);
  margin: 0 0 var(--space-8);
  padding: var(--space-4) 0;
  border-top: 1px solid var(--grid);
  border-bottom: 1px solid var(--grid);
  font-variant-numeric: tabular-nums;
}

.facts__main {
  list-style: none;
  margin: 0 0 var(--space-2);
  padding: 0;
  font-weight: 700;
  line-height: 1.7;
}

.facts__meta {
  margin: 0;
  color: var(--ink-soft);
}

/* Mock exams -------------------------------------------------------------- */

.disclaimer {
  color: var(--ink-soft);
  font-size: var(--text-sm);
}

.sheet__title {
  font-weight: 700;
}

/* Indicative grade boundaries under each set: a two-row table, grades across the top. */
.boundaries {
  margin: var(--space-4) 0 0;
}

.boundaries table {
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.boundaries__title {
  margin: 0 0 var(--space-1);
  font-size: var(--text-sm);
  color: var(--ink-soft);
}

.boundaries th,
.boundaries td {
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--grid);
  text-align: center;
}

.boundaries th {
  text-align: left;
  font-weight: 700;
}

.boundaries__note {
  margin: var(--space-2) 0 0;
  font-size: var(--text-sm);
  color: var(--ink-soft);
}

/* Practice questions ------------------------------------------------------- */

/* The maths is LaTeX until KaTeX has drawn it (static/js/practice.js); keep the raw code out of sight meanwhile. */
.maths-pending .tex {
  visibility: hidden;
}

/* Maths wider than a phone scrolls sideways inside its own box instead of widening the page: maths on a
   line of its own (.katex-display) and any line of text holding wide maths (a row of matrices). A box
   that scrolls sideways also trims whatever pokes out above or below it, and tall maths does poke out of
   its line (a power on top of a fraction lost the top of its 3), so each box is given room above and
   below (--maths-room) and pulled back by the same amount, leaving the spacing as it was.
   ".reading" is in the selector to outrank KaTeX's own stylesheet, which loads after this one. */
.reading {
  --maths-room: 0.6em;
}

.reading .katex-display {
  margin: calc(1em + var(--space-1) - var(--maths-room)) 0;
  padding: var(--maths-room) 0;
  overflow-x: auto;
  overflow-y: hidden;
}

/* A topic's page is one column for reading, set in the middle of the white sheet so that the
   questions sit well clear of the doodles on either side (Ben, 5 Oct 2026). */
.reading {
  max-width: var(--measure);
  margin: 0 auto;
}

.question {
  margin-top: var(--space-8);
  padding-top: var(--space-4);
  border-top: 2px solid var(--ink);
  scroll-margin-top: var(--space-4);
  scroll-margin-bottom: var(--space-4); /* room under the Previous / Next row when it is put at the bottom of the window */
}

.question__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  margin: 0 0 var(--space-4);
  font-size: var(--text-lg);
}

.question__title .tag {
  font-weight: 400;
}

.question__marks,
.part__marks {
  color: var(--ink-soft);
  font-size: var(--text-sm);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.question__marks {
  margin-left: auto;
  padding-left: var(--space-4);
}

.question__text > * {
  margin: 0 0 var(--space-3);
}

.question__text p,
.steps li,
.reveal p {
  padding-block: var(--maths-room);
  overflow-x: auto;
  overflow-y: hidden;
}

.question__text p {
  margin-block: calc(-1 * var(--maths-room)) calc(var(--space-3) - var(--maths-room));
}

/* One sentence per line (Ben, 14 Nov 2026), each line a block with a little room above it (15 Nov 2026, on Higher
   Composite Functions Q3, where a full-size 6/x almost touched "Find fg(5)" on the line below): practice/text.py
   sends a paragraph's sentences as <span class="line">. The gap between paragraphs (the papers' gap between the
   information and the instruction) stays clearly bigger, so the groups still read as groups. */
.question__text {
  --line-gap: 0.3em;
}

.question__text .line {
  display: block;
}

.question__text .line + .line {
  margin-top: var(--line-gap);
}

.reading .questions .question__text p:not(:last-child) {
  margin-bottom: calc(var(--space-4) - var(--maths-room));
}

/* A piece of maths taller than the words (a full-size fraction, a power on a fraction, a matrix or a vector) keeps
   a little clear of the lines above and below it: its margin makes the line box that much taller. The worked
   solution's steps too, whose fractions are drawn full size as the question's are (static/js/practice.js). */
.reading .questions .question__text .tex:has(.mfrac, .mtable),
.reading .questions .steps .tex:has(.mfrac, .mtable) {
  margin-block: 0.4em;
}

/* A list in a question (lines of working, say) gets room for tall maths too: a fraction in one line was
   touching the fraction in the next (Ben, 8 Oct 2026, on Trigonometric Identities question 12). */
.reading .question__text li {
  padding-block: calc(var(--maths-room) / 2);
}

.reading .question__text li + li {
  margin-top: var(--space-1);
}

/* An equation in a sentence stays on one line where it fits, moving to the next line whole, and is
   only broken (at an = or + sign) when it is wider than the line itself (Ben, 5 Oct 2026: on a phone
   "y = −x" had its "−x" on the next line). The same for a phrase, one of several facts set side by
   side with a gap between them (practice/text.py): the line wraps at the gaps. */
.reading .tex:not(.tex--display),
.phrase {
  display: inline-block;
  max-width: 100%;
}

.phrase--gap {
  margin-right: 1em;
}

.phrase--gap-wide {
  margin-right: 2em;
}

.phrase--indent {
  margin-left: 1em;
}

.phrase--indent-wide {
  margin-left: 2em;
}

.question__diagram {
  margin: var(--space-4) 0;
}

/* Part of a diagram that appears once a part of the question is answered correctly (static/js/practice.js). */
.question__diagram [data-show-after] {
  display: none;
}

.question__diagram [data-show-after].is-shown {
  display: inline;
}

/* 30rem (480px) since 14 Nov 2026 (Ben): about 63% of the 760px question column, as a diagram on the papers takes
   half to three-quarters of the text width, and its labels then come out close to the question text's size. */
.question__diagram svg {
  display: block;
  width: 100%;
  max-width: 30rem;
  height: auto;
}

/* A graph that values are read from is shown larger (data-size="large" on the pack's SVG). */
.question__diagram svg[data-size="large"] {
  max-width: 36rem;
}

/* A drawing much taller than it is wide (a protractor standing on a north line, Bearings; 14 Nov 2026): the full
   column on a phone, so its scale stays readable, but no taller than a large square drawing elsewhere. The box is
   capped at 36rem high and the drawing is fitted inside it, centred (the SVG's own preserveAspectRatio). */
.question__diagram svg[data-size="tall"] {
  max-height: 36rem;
}

/* A narrow drawing (16 Nov 2026, Ben: "stem and leaf text is unnecessarily big?"): a stem and leaf diagram is drawn
   300 units wide (tools/stem_leaf_drawings.py) and shown at most 18.75rem, so on a laptop a unit is a pixel and its
   18-unit digits are the question text's size, as on the papers; on a 360px phone about 15.7px (13.7px in a worked
   solution). Worked-solution copies too (.solution-diagram is also .question__diagram; this outranks its 30rem). */
.question__diagram svg[data-size="narrow"] {
  max-width: 18.75rem;
}

/* Two more laptop widths (16 Nov 2026, Ben, on the geometry topics' labels at 24-30px beside 17px question text):
   tools/drawing_sizes.py gives a drawing whose largest label would be over 21px at 480px the widest of 420px
   ("w420"), 360px ("w360") or 300px ("narrow", above) that brings it to 20px or less. A phone's column is narrower
   than all three, so phones show these drawings exactly as before. */
.question__diagram svg[data-size="w420"] {
  max-width: 26.25rem;
}

.question__diagram svg[data-size="w360"] {
  max-width: 22.5rem;
}

/* Key facts as small pictures (Ben, 18 Nov 2026, on Parallel and Perpendicular Lines: "diagrams are too small, text
   is much smaller than main body of paragraphs, and there's lots of unused white space either side"). The facts were
   one drawing, shown 360px wide with its words inside it at about 12px. Now each fact is its own small picture
   (data-size="panel", 180 units wide) with its sentence underneath as page text, set out across the column: two
   across on a phone, three on wider screens, or two larger ones where there are one, two or four (.facts--pairs).
   A short last row is centred. The row is one drawing card (.question__diagram), so it follows the dark theme and
   the colour schemes as any drawing does. */
.question__diagram.facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem 1rem;
}
.fact {
  flex: 0 1 calc((100% - 1rem) / 2);
  min-width: 0;
  margin: 0;
  text-align: center;
}
.fact__picture svg[data-size="panel"] { max-width: 100%; }
.fact figcaption { margin-top: 0.25rem; line-height: 1.4; }
.fact figcaption p { margin: 0; }
.fact figcaption p + p { margin-top: 0.25rem; }
@media (min-width: 600px) {
  .question__diagram.facts { gap: 1.5rem 1.25rem; padding-block: 1.25rem; }
  .fact { flex-basis: calc((100% - 2.5rem) / 3); }
  .facts--pairs .fact { flex-basis: calc((100% - 1.25rem) / 2); max-width: 18rem; }
}

/* Grid answers (static/js/grid.js, 8 Nov 2026): the question's drawing is tapped to place points. The drawing is
   white in both themes (design.css; the dark-drawings topics get Forest versions there), so the answer's colours are
   fixed ones that read on white: the site's red marker for what the student places, its green for the keyboard cursor
   and the tap target. */
.question__diagram--grid {
  --grid-answer: #d7263d;
  --grid-target: #23644d;
  padding-inline: 6px;
  cursor: crosshair;
  -webkit-tap-highlight-color: transparent;
}
.question__diagram--grid svg { max-width: 36rem; user-select: none; -webkit-user-select: none; }
.question__diagram--grid:focus { outline: none; }
.question__diagram--grid:focus-visible { outline: var(--focus); outline-offset: 2px; }
.grid-answer__join {
  fill: none;
  stroke: var(--grid-answer);
  stroke-width: 3px;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.grid-answer__join.is-closed { fill: var(--grid-answer); fill-opacity: .16; }
.grid-answer__ruled {
  stroke: var(--grid-answer);
  stroke-width: 3px;
  vector-effect: non-scaling-stroke;
}
.grid-answer__cross { stroke: var(--grid-answer); stroke-width: 3.5px; stroke-linecap: round; vector-effect: non-scaling-stroke; fill: none; }
.grid-answer__dots circle { fill: var(--grid-answer); stroke: #ffffff; stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.grid-answer__target, .grid-answer__cursor { display: none; pointer-events: none; }
.grid-answer__target.is-shown { display: inline; }
.grid-answer__target circle {
  fill: var(--grid-target);
  fill-opacity: .12;
  stroke: var(--grid-target);
  stroke-width: 2px;
  vector-effect: non-scaling-stroke;
}
.question__diagram--grid:focus-visible .grid-answer__cursor {
  display: inline;
  fill: none;
  stroke: var(--grid-target);
  stroke-width: 2px;
  stroke-dasharray: 4 3;
  vector-effect: non-scaling-stroke;
}
.grid-answer * { pointer-events: none; }
/* A table of values over a grid (Ben, 15 Nov 2026): the one drawing shown as two pieces, the table (in the boxes'
   form, .drawing-boxes) and the grid (templates/practice/_table_grid.html), each its viewBox cropped to its region.
   Both pieces keep the drawing's own width, so the table and the grid line up as on the paper, and clip at their
   viewBox (what lies in the other piece's region is never drawn). */
.drawing-boxes__drawing svg,
.question__diagram--table-grid svg { overflow: hidden; }
.question__diagram--table-grid svg:not([data-size="large"]) { max-width: 30rem; }
/* Under (b)'s wording the grid takes the question's full width, out from under the (b), so it lines up with the table
   above it and keeps its size on a phone. */
.part--labelled .part__body > .question__diagram--table-grid {
  margin-inline-start: calc(-1.75rem - var(--space-2));
}
/* Part (a)'s drawing with its boxes (16 Nov 2026), under "(a)", its instruction and marks: the drawing likewise takes
   the question's full width, out from under the (a), so it lines up with the grid below it as on the paper; the notes
   and Check stay under the instruction, as (b)'s do. */
.part--labelled .part__body > .answer--drawing > .drawing-boxes {
  margin-inline-start: calc(-1.75rem - var(--space-2));
}
/* A column vector answer (8 Nov 2026): two boxes, one above the other, in tall brackets (static/js/vector.js). */
.vector-answer { border: 0; margin: 0; padding: 0; min-width: 0; }
.vector-answer .answer__row { align-items: center; }
.vector-answer__vector { display: inline-flex; align-items: stretch; gap: 0.3rem; margin-right: 0.5rem; }
.vector-answer__boxes { display: flex; flex-direction: column; gap: 0.4rem; padding: 0.3rem 0; }
.vector-answer__box {
  width: 4rem;
  padding: 0.4rem 0.5rem;
  font: inherit;
  font-size: 1.15rem;
  text-align: center;
  border: 1px solid var(--grid);
  border-radius: 9px;
  background: var(--paper);
  color: inherit;
}
.vector-answer__box:focus-visible { outline: 3px solid var(--accent, #23644d); outline-offset: 1px; }
.vector-answer__bracket {
  /* Drawn as a thin curve, like the question's own column vectors (KaTeX's tall brackets). */
  width: 0.75rem;
  border: 2px solid currentColor;
  border-right: 0;
  border-radius: 100% 0 0 100% / 50% 0 0 50%;
}
.vector-answer__bracket:last-child { border-left: 0; border-right: 2px solid currentColor; border-radius: 0 100% 100% 0 / 0 50% 50% 0; }
.answer--correct .vector-answer__box { border-color: var(--accent, #23644d); }
/* A coordinates answer as the papers print it, "( ....... , ....... )" (14 Nov 2026): a box for x and one for y
   between a printed bracket, comma and bracket (_coordinate_frame.html). Hidden until static/js/coordinates.js puts
   coord-framed on the form (or the together field), which also hides the one box it fills. */
.coord-answer { display: none; }
.coord-framed .coord-answer { display: inline-flex; align-items: center; gap: 0.3rem; margin-right: 0.25rem; }
.coord-framed .coord-source { display: none; }
.coord-answer__sign { font-size: 1.7rem; line-height: 1; color: var(--ink); }
.coord-answer__sign--comma { align-self: flex-end; padding-bottom: 0.35rem; margin: 0 0.1rem; }
.coord-answer__box {
  width: 5rem;
  min-width: 0;
  min-height: 2.75rem;
  padding: 0.4rem 0.5rem;
  font: inherit;
  font-size: 1.15rem;
  text-align: center;
  border: 1px solid var(--grid);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
}
.coord-answer__box:focus-visible { border-color: var(--biro); outline: var(--focus); outline-offset: 2px; }
.answer--correct .coord-answer__box { border-color: var(--accent, #23644d); }
.together__field--right .coord-answer__box { border-color: var(--teal); }
@media (max-width: 380px) {
  .coord-answer__box { width: 4.25rem; }
}
/* "Write down two factors of 26" as the papers print it, "……… , ………" (Part.value_boxes; 15 Nov 2026): a short box per
   value with a printed comma between them (_value_boxes.html). Hidden until static/js/values.js puts values-split on
   the form, which also hides the one box it fills and that box's typing help. Each box is at most 8rem (a number
   box's 10rem less the comma), so two sit side by side on a 360px phone with Check under them; three or four wrap. */
.value-boxes { display: none; }
.values-split .value-boxes { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.3rem; margin-right: 0.25rem; }
.values-split .value-source,
.values-split .answer__help { display: none; }
.value-boxes__comma { align-self: flex-end; padding-bottom: 0.35rem; margin: 0 0.1rem; font-size: 1.7rem; line-height: 1; color: var(--ink); }
.value-boxes__box {
  width: 8rem;
  min-width: 0;
  min-height: 2.75rem;
  padding: 0.4rem 0.5rem;
  font: inherit;
  font-size: 1.15rem;
  text-align: center;
  border: 2px solid var(--ink-soft);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
}
.value-boxes__box:focus-visible { border-color: var(--biro); outline: var(--focus); outline-offset: 2px; }
.answer--correct .value-boxes__box { border-color: var(--teal); }
@media (max-width: 380px) {
  .value-boxes__box { width: 6.75rem; }
}

/* Click a number from a printed list (Part.list_picks; 15 Nov 2026): the question's list of numbers, turned by
   static/js/picks.js into buttons 44px high at least. The chosen ones are ringed and tinted, as a student rings a
   number on the paper; after Check each carries ✓ (or ✗, for one wrong choice) on its top right corner. While the list
   is used, the part's box and its typing help are hidden; "Type instead" brings them back and the list is printed
   plainly again (the buttons disabled). */
.num-row.pick-row--on { gap: 0.6rem 0.9rem; }
.pick-row .pick {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  margin: 0;
  padding: 0.3rem 0.7rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: none;
  color: var(--ink);
  font: inherit;
  line-height: 1.2;
  -webkit-tap-highlight-color: transparent;
}
.pick-row--on .pick {
  border-color: var(--grid);
  background: var(--surface, #ffffff);
  cursor: pointer;
}
@media (hover: hover) {
  .pick-row--on .pick:hover { border-color: var(--border-hover, var(--teal)); }
}
.pick-row .pick:focus-visible { outline: var(--focus); outline-offset: 2px; }
.pick-row--on .pick[aria-pressed="true"] {
  border-color: var(--teal);
  background: var(--teal-pale);
  box-shadow: inset 0 0 0 1px var(--teal);
  font-weight: 700;
}
.pick-row--on .pick.is-wrong { border-color: var(--marker); box-shadow: inset 0 0 0 1px var(--marker); }
.pick__mark {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  transform: translate(45%, -45%);
  padding: 0.15em 0.3em;
  border-radius: 999px;
  background: var(--surface, #ffffff);
  box-shadow: 0 0 0 1px currentColor;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
}
.pick__mark:empty { display: none; }
.pick.is-right .pick__mark { color: var(--teal); }
.pick.is-wrong .pick__mark { color: var(--marker); }
.answer--picks .answer__label,
.answer--picks .answer__input,
.answer--picks .unit-box,
.answer--picks .answer__help,
.answer--picks .keys { display: none; }
.pick-help { margin: 0 0 var(--space-2); font-size: var(--text-sm); color: var(--ink-soft); }


/* A fraction answer as the papers print it (15 Nov 2026): a box for the numerator over a box for the denominator with
   a printed line between them, and for a mixed number a box for the whole number beside them (_fraction_frame.html).
   Hidden until static/js/fractions.js puts frac-framed on the form, which also hides the one box it fills, and the
   typing help that goes with that box ("Type instead" brings both back). */
.frac-answer { display: none; }
.frac-framed .frac-answer { display: inline-flex; align-items: center; gap: 0.5rem; margin-right: 0.25rem; }
.frac-framed .frac-source,
.frac-framed .answer__help { display: none; }
.frac-framed .answer__row { align-items: center; }
.frac-answer__fraction { display: inline-flex; flex-direction: column; align-items: center; gap: 0.3rem; }
.frac-answer__line { display: block; width: 100%; height: 0; border-top: 2px solid var(--ink); }
.frac-answer__box {
  width: 3.75rem;
  min-width: 0;
  min-height: 2.75rem;
  padding: 0.35rem 0.4rem;
  font: inherit;
  font-size: 1.15rem;
  text-align: center;
  border: 1px solid var(--grid);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
}
.frac-answer__whole { width: 3.25rem; }
.frac-answer__box:focus-visible { border-color: var(--biro); outline: var(--focus); outline-offset: 2px; }
.answer--correct .frac-answer__box { border-color: var(--accent, #23644d); }
.frac-framed .frac-answer__swap { margin-top: var(--space-1); }
.grid-instruction { margin: var(--space-3) 0 var(--space-2); font-weight: 700; }
/* A plain squared grid's points can't be typed: its box is kept for screen readers only. */
form.answer--grid-plain .answer__label,
form.answer--grid-plain .answer__input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.answer--grid-plain .answer__row { justify-content: flex-start; }
.grid-tools { display: none; gap: var(--space-2); justify-content: center; margin: calc(-1 * var(--space-2)) 0 var(--space-4); }
.js .grid-tools { display: flex; }
.grid-tools__button {
  font: inherit;
  font-size: .95rem;
  min-height: 40px;
  min-width: 5.5rem;
  padding: 6px 16px;
  border: 1px solid var(--grid);
  border-radius: 100px;
  background: var(--surface-soft);
  color: var(--ink);
  cursor: pointer;
}
.grid-tools__button:hover:not(:disabled) { background: var(--surface-hover); }
.grid-tools__button:disabled { opacity: .5; cursor: default; }

/* Worked-solution drawings stay inside the closed disclosure, beside the step they explain. */
.solution-diagram { margin: var(--space-3) 0; }
.solution-diagram svg { max-width: 30rem; }
.solution-diagram figcaption {
  max-width: 34rem;
  margin: var(--space-2) auto 0;
  color: #173d32;
  font-size: var(--text-sm);
  line-height: 1.6;
}

/* Tap to enlarge (static/js/enlarge.js, 14 Nov 2026): on phones a drawing opens on its own, full screen, to be
   pinch-zoomed. The wrapper holds the drawing and its magnifier button and has no box of its own, so the drawing's
   margins pass through it and nothing moves. The button and the zoom-in pointer show on phones only (enlarge-on). */
.enlarge-wrap { position: relative; }
.enlarge-button { display: none; }
html.enlarge-on .enlarge-button {
  display: grid;
  place-items: center;
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: #23644d;
  cursor: zoom-in;
}
html.enlarge-on .enlarge-button svg {
  width: 30px;
  height: 30px;
  padding: 5px;
  border: 1px solid #d4e2d7;
  border-radius: 50%;
  background: #ffffffe6;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
html.enlarge-on .question__diagram--enlarge { cursor: zoom-in; -webkit-tap-highlight-color: transparent; }

html.enlarge-open { overflow: hidden; }
.enlarge {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--paper);
  touch-action: none;
  overscroll-behavior: contain;
}
.enlarge[hidden] { display: none; }
.enlarge__stage {
  display: flex;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 16px 16px 32px;
  touch-action: none;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.enlarge__stage::-webkit-scrollbar { display: none; }
/* margin: auto centres the drawing while it fits, and lets it scroll from its edge once zoomed past the screen. */
.enlarge__card {
  flex: none;
  margin: auto;
  padding: 8px;
  border-radius: 12px;
  background: #ffffff;
  color: #173d32;
  box-shadow: 0 2px 14px #173d3218;
}
.enlarge__card svg { display: block; max-width: none; }
/* The parts drawn once a part of the question is answered are copied with the drawing, shown or not. */
.enlarge [data-show-after] { display: none; }
.enlarge [data-show-after].is-shown { display: inline; }
.enlarge__close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--grid);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  cursor: pointer;
}
.enlarge__close:focus-visible { outline-offset: 2px; }
.enlarge__close svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.enlarge__help {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.8125rem;
  text-align: center;
  pointer-events: none;
}
/* Once zoomed the hint has done its job, and would sit over the drawing. */
.enlarge.is-zoomed .enlarge__help { display: none; }

/* A question in parts: the (a), (b), (c) down the left, the wording beside them. */
.part {
  margin-top: var(--space-4);
}

.part--labelled {
  display: grid;
  grid-template-columns: 1.75rem 1fr; /* a fixed width, so (a), (b) and (c) line their wording up */
  gap: var(--space-2);
}

.part__label {
  font-weight: 700;
}

.part__body {
  min-width: 0; /* lets wide maths scroll inside the grid instead of stretching it */
}

.part__marks {
  margin: 0;
}

/* The answer box: a line to type on (or choices to pick from), the Check button and the result.
   Typing boxes and Check need the page's script, so they show only once it is known to be running
   (the "js" class, set in the page's head). */
.answer {
  margin-top: var(--space-4);
}

html:not(.js) .answer__label,
html:not(.js) .answer__row,
html:not(.js) .answer__check,
html:not(.js) .answer__help,
html:not(.js) .keys {
  display: none;
}

.answer__label {
  display: block;
  margin-bottom: var(--space-1);
  font-size: var(--text-sm);
  font-weight: 700;
}

.answer__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* "x = [box] Check" (Part.inline_label; Ben, 17 Nov 2026): a part whose wording is only "x =" has it beside its
   box, as the papers print "x = ……", in place of the "Your answer" heading. The wording and the part's own
   "1 mark" above are hidden while the script runs (without it the box isn't shown, so they stay). */
.answer__row--inline {
  align-items: center;
}

.answer__label--inline {
  flex: none;
  margin: 0;
  font-size: inherit;
  font-weight: 400;
}

.js .part--inline > .part__body > .question__text,
.js .part--inline > .part__body > .part__marks {
  display: none;
}

.js .part--inline > .part__body > .answer {
  margin-top: var(--space-3);
}

.answer__input {
  flex: 1 1 12rem;
  min-width: 0;
  max-width: 22rem;
  min-height: 2.75rem;
  padding: var(--space-2) var(--space-3);
  border: 2px solid var(--ink-soft);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

.answer__input:focus-visible {
  border-color: var(--biro);
  outline: var(--focus);
  outline-offset: 2px;
}

/* A unit printed beside a number box, as the papers print their answer lines, "£ ………" and "……… cm" (Part.unit,
   14 Nov 2026). The box and its unit are one flex item, so the Check button still wraps under them on a phone. The
   unit is printed, not typed: it can't be selected with the answer, and screen readers hear it in the box's name. */
.unit-box {
  display: inline-flex;
  flex: 1 1 12rem;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  max-width: 25rem;
}

.unit-box .answer__input {
  flex: 1 1 0;
  width: 0;
  max-width: none;
}

/* A number answer is short, as the papers' answer line is (about 4 cm, under a quarter of the text width; Ben,
   15 Nov 2026): 10rem holds about 12 characters ("£1,234.56", "3.07×10^6"). Algebra, inequality and list boxes
   keep their room. A ratio box is as short (Ben, 15 Nov 2026: "4:3" is short; the papers print one plain answer
   line for a ratio, the colon written by the student, so it stays one box). */
form.answer[data-type="number"] > .answer__row > .answer__input,
form.answer[data-type="ratio"] > .answer__row > .answer__input {
  flex: 0 1 10rem;
  max-width: 10rem;
}

form.answer[data-type="number"] .unit-box {
  flex: 0 1 auto;
  max-width: none;
}

form.answer[data-type="number"] .unit-box .answer__input {
  flex: 0 1 10rem;
  width: 10rem;
  max-width: 10rem;
}

/* A row of a stem and leaf diagram (Part.leaf_stem, 15 Nov 2026): the stem and its bar printed, as a paper's blank
   row is, then one box for the leaves, room for about twelve of them with spaces. The row and Check share a line
   on a 360px phone: the box gives way to the button before the button wraps. */
.leaf-row {
  display: inline-flex;
  flex: 1 1 10.5rem;
  align-items: stretch;
  min-width: 0;
  max-width: 16rem;
}

.leaf-row__stem {
  display: flex;
  flex: none;
  align-items: center;
  margin-right: var(--space-2);
  padding-right: 0.55em;
  border-right: 2px solid var(--ink);
  color: var(--ink);
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  user-select: none;
  -webkit-user-select: none;
}

.answer__input.leaf-row__input {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  max-width: none;
  padding-left: var(--space-2);
  padding-right: var(--space-2);
  font-variant-numeric: tabular-nums;
}

.unit-box__unit {
  flex: none;
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}

.together__row .unit-box {
  flex: 0 1 14rem;
}

.answer .button {
  background: var(--biro);
  color: var(--paper);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.answer .button:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Keys for the symbols a keyboard lacks. */
.keys {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.key {
  min-width: 2.75rem;
  min-height: 2.5rem;
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--ink-soft);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.key:hover {
  background: var(--teal-pale);
}

/* The equation editor's fraction key (static/js/editor.js): an a-over-b at the other keys' text size, centred
   in the key (the button is a flex box so the stack isn't left sitting on the text baseline). */
.key--fraction {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.key__fraction {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.key__fraction span:first-child {
  padding: 0 0.2em 0.1em;
  border-bottom: 1px solid currentColor;
}

.key__fraction span:last-child {
  padding-top: 0.1em;
}

.answer__help {
  margin: var(--space-2) 0 0;
  color: var(--ink-soft);
  font-size: var(--text-sm);
}

.answer__feedback {
  margin: var(--space-3) 0 0;
  font-weight: 700;
}

.answer__feedback:empty {
  display: none;
}

.answer__feedback[data-result="correct"] {
  color: var(--teal);
}

.answer--correct .answer__input {
  border-color: var(--teal);
}

.answer__read {
  display: block;
  margin-top: var(--space-1);
  color: var(--ink-soft);
  font-weight: 400;
}

/* The equation editor (static/js/editor.js, MathLive): a maths field in the text box's place, same size and
   border; MathLive's own colours set through its custom properties. The field sits in .answer__row. */
.answer__field {
  flex: 1 1 12rem;
  min-width: 0;
  max-width: 22rem;
  min-height: 2.75rem;
  padding: var(--space-1) var(--space-3);
  border: 2px solid var(--ink-soft);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-size: 1.2rem;
  --caret-color: var(--biro);
  --selection-background-color: var(--surface-hover);
  --selection-color: var(--ink);
  --contains-highlight-background-color: var(--surface-soft);
  --placeholder-color: var(--ink-soft);
  --smart-fence-color: var(--ink-soft);
  --primary-color: var(--biro);
}

.answer__field:focus-within {
  border-color: var(--biro);
  outline: var(--focus);
  outline-offset: 2px;
}

.answer__field::part(menu-toggle),
.answer__field::part(virtual-keyboard-toggle) {
  display: none;
}

.answer--correct .answer__field {
  border-color: var(--tick, var(--biro));
}

.answer__swap {
  display: block;
  margin-top: var(--space-2);
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font: inherit;
  font-size: var(--text-sm);
  text-decoration: underline;
  cursor: pointer;
}

/* MathLive's on-screen keyboard (touch screens), in the page's colours. */
body {
  --keyboard-background: var(--surface);
  --keyboard-border: var(--grid);
  --keycap-background: var(--paper);
  --keycap-background-hover: var(--surface-hover);
  --keycap-text: var(--ink);
  --keycap-secondary-background: var(--surface-soft);
  --keycap-secondary-background-hover: var(--surface-hover);
  --keycap-secondary-text: var(--ink);
  --keyboard-accent-color: var(--biro);
  --keyboard-toolbar-text: var(--ink);
  --keyboard-toolbar-background-hover: var(--surface-soft);
}

/* "Reads as" under the box: what the typing will be read as, drawn while the student types (practice.js). */
.answer__preview {
  margin: var(--space-2) 0 0;
  color: var(--ink-soft);
  font-size: var(--text-sm);
}

.reading .answer__preview .tex {
  color: var(--ink);
  font-size: 1.1rem;
  padding: var(--maths-room) 0;
  margin: calc(-1 * var(--maths-room)) 0;
}

/* "Flag a mistake in this question": a quiet link under the result, after a second wrong answer. */
.answer__flag,
.answer__flagged {
  display: block;
  margin-top: var(--space-2);
  color: var(--ink-soft);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 400;
}

.answer__flag {
  padding: 0;
  border: 0;
  background: none;
  text-decoration: underline;
  cursor: pointer;
}

.answer__flag:hover {
  color: var(--biro);
}

/* "Custom hint" (practice/hints.py): a button in the Check button's style under the result, after any
   wrong answer (Ben, 28 Oct 2026). The hint itself is a paragraph at the question's own size, set off by a rule. */
.answer__hint-link {
  display: block;
  margin-top: var(--space-3);
  background: var(--biro);
  color: var(--paper);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.answer__hint {
  margin: var(--space-3) 0 0;
  padding: var(--space-2) var(--space-3);
  border-left: 3px solid var(--accent, var(--biro));
}

/* The general Hint bar is hidden while a custom hint is on offer, and once the question is right; the worked
   solution under it then keeps the gap the first bar would have had. */
.reveal--hint[hidden] {
  display: none;
}

.question .reveal--hint[hidden] + .reveal {
  margin-top: var(--space-6);
}

/* Multiple choice: each choice is a row to press, lettered A, B, C, D. */
.choices {
  margin: 0 0 var(--space-3);
  padding: 0;
  border: 0;
  counter-reset: choice;
}

.choice {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--grid);
  border-radius: var(--radius);
  cursor: pointer;
  counter-increment: choice;
}

.choice:hover,
.choice:has(input:checked) {
  background: var(--teal-pale);
}

.choice:has(input:checked) {
  border-color: var(--teal);
}

.choice input {
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: var(--teal);
}

.choice__text::before {
  content: counter(choice, upper-alpha) ".";
  margin-right: var(--space-2);
  font-weight: 700;
}

/* A question checked together (Question.together; Ben, 5 Nov 2026): a short labelled box for each value, a picker
   of the options last, one Check. Each box carries its own mark (✓ or ✗) beside it and any note under it. Like the
   other answer boxes it needs the page's script. */
html:not(.js) .answer--together {
  display: none;
}

.together__field {
  margin: 0 0 var(--space-3);
  padding: 0;
  border: 0;
  min-width: 0;
}

.together__label {
  display: block;
  margin-bottom: var(--space-1);
  padding: 0;
  font-size: var(--text-sm);
  font-weight: 700;
}

/* "x = [box]" (Part.inline_label; Ben, 17 Nov 2026): the label beside its box, in the text's size and weight. */
.together__label--inline {
  flex: none;
  margin: 0;
  font-size: inherit;
  font-weight: 400;
}

.together__row,
.picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.together__input {
  flex: 0 1 12rem;
}

.together__mark {
  min-width: 1.25rem;
  font-weight: 700;
  font-size: var(--text-lg);
}

.together__field--right .together__mark {
  color: var(--teal);
}

.together__field--right .together__input {
  border-color: var(--teal);
}

.together__note:empty {
  display: none;
}

.together__note {
  margin: var(--space-1) 0 0;
  font-size: var(--text-sm);
}

.picker__option {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 2.75rem;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--grid);
  border-radius: var(--radius);
  cursor: pointer;
}

.picker__option:hover,
.picker__option:has(input:checked) {
  background: var(--teal-pale);
}

.picker__option:has(input:checked) {
  border-color: var(--teal);
}

.picker__option input {
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: var(--teal);
}

.answer--together .answer__check {
  margin-top: var(--space-1);
}

/* In-line boxes (Question.inline; Ben, 14 Nov 2026): the calculation on one centred line, as the papers print it,
   a typing box in place of each square. The line wraps between its pieces on a narrow phone, never inside one. Each
   box's ✓ or ✗ sits inside the box's right edge, so a mark appearing never moves the line. The Check button and the
   line under it stay at the left, as under every other answer. */
.inline-sum {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2) 0.4em;
  margin: var(--space-4) 0 var(--space-3);
}

.reading .inline-sum .tex {
  padding: 0;
  margin: 0;
}

.together__field.inline-sum__box {
  position: relative;
  display: inline-flex;
  margin: 0;
}

.answer__input.inline-sum__input {
  flex: none;
  width: 5.5em;
  max-width: none;
  padding-right: 1.6em;
  text-align: center;
}

.inline-sum__box .together__mark {
  position: absolute;
  top: 50%;
  right: 0.45em;
  min-width: 0;
  transform: translateY(-50%);
  line-height: 1;
  pointer-events: none;
}

.inline-sum__notes .together__note {
  margin: 0 0 var(--space-2);
}

@media (max-width: 30rem) {
  .answer__input.inline-sum__input {
    width: 4.6em;
  }
}

/* Boxes in the drawing (Question.drawing; Ben, 14 Nov 2026): a small typing box laid exactly over each rect the pack
   marks data-answer-box, placed in percentages of the drawing (templates/practice/_drawing_form.html), so the frame
   must be exactly the drawing's size: the same widths as .question__diagram svg. The drawing is white in both themes (but
   see the dark-drawings topics in design.css, which give Forest dark versions of these colours)
   (design.css), so the box's colours are fixed ones that read on white. The drawn rect is hidden while the script runs
   (the typing box draws its own edge in its place); without scripts the form's controls are hidden and the drawing,
   empty boxes and all, shows as it is. The ✓ or ✗ sits on the box's top right corner, so it never covers the typing. */
html:not(.js) .answer--together.answer--drawing {
  display: block;
}

html:not(.js) .drawing-boxes__box,
html:not(.js) .drawing-boxes__notes {
  display: none;
}

.drawing-boxes__frame {
  position: relative;
  max-width: 30rem;
  margin-inline: auto;
  container-type: inline-size;
}

.drawing-boxes__frame:has(svg[data-size="large"]) {
  max-width: 36rem;
}

/* The narrower laptop widths (tools/drawing_sizes.py and tools/narrow_drawings.py), so the boxes stay over their drawn rects. */
.drawing-boxes__frame:has(svg[data-size="w420"]) { max-width: 26.25rem; }
.drawing-boxes__frame:has(svg[data-size="w360"]) { max-width: 22.5rem; }
.drawing-boxes__frame:has(svg[data-size="narrow"]) { max-width: 18.75rem; }

.js .drawing-boxes [data-answer-box] {
  visibility: hidden;
}

.together__field.drawing-boxes__box {
  position: absolute;
  display: block;
  margin: 0;
}

.answer__input.drawing-boxes__input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-width: none;
  margin: 0;
  padding: 0 1px;
  /* The ordinary answer box's look (Ben, 16 Nov 2026: they were pale blue with a navy edge): its pale green tint and
     green focus ring, with a stronger green-grey edge (the site's --ink-soft, 5.9:1 on white) so the box still stands
     out from the drawing's lines. Fixed Paper colours, since the drawing is white in both themes (design.css gives the
     Forest ones on topics whose drawings are dark). */
  border: 2px solid #52695d;
  border-radius: 6px;
  background: #f7fbf7;
  color: #173d32;
  /* About the size of the drawing's own numbers, never under 16px (phones zoom in on smaller typing). */
  font-size: max(16px, min(1.5rem, calc(var(--box-size, 8) * 0.55cqw)));
  line-height: 1;
  text-align: center;
}

/* A list typed in a drawing's box (a Venn diagram's region, "2, 7"; 16 Nov 2026): the smallest typing phones don't zoom
   in on, so a list of three two-digit numbers fits the box on a phone and a laptop alike. */
.drawing-boxes__box--list .answer__input.drawing-boxes__input {
  font-size: 1rem;
}

/* An oval answer box (an ellipse or circle in the drawing: a frequency tree's ovals, 14 Nov 2026): the typing box is
   rounded into the same oval, and its mark sits nearer the outline, which leaves the box's corners empty. */
.drawing-boxes__box--oval .answer__input.drawing-boxes__input {
  border-radius: 50%;
}

/* On an oval (frequency trees) the corner is beside the branch labels, so the mark goes under the oval's middle. */
.drawing-boxes__box.drawing-boxes__box--oval .together__mark {
  right: 50%;
  transform: translate(50%, 70%);
}

.answer__input.drawing-boxes__input:focus-visible,
.answer__input.drawing-boxes__input:focus {
  border-color: #23644d;
  background: #ffffff;
  outline: 3px solid #23644d;
  outline-offset: 1px;
}

.drawing-boxes__box.together__field--right .drawing-boxes__input {
  border-color: #23644d;
  background: #e2eee4;
}

.drawing-boxes__box.together__field--wrong .drawing-boxes__input {
  border-color: #b3261e;
}

/* The tick or cross sits on the box's bottom right corner (Ben, 15 Nov 2026): on the top corner it covered what is
   printed above the box, such as a table's x-values. Drawn above the neighbouring boxes so the whole circle shows,
   and smaller on phones, where the boxes are narrow. */
.drawing-boxes__box .together__mark {
  position: absolute;
  bottom: 0;
  right: 0;
  z-index: 3;
  min-width: 0;
  transform: translate(45%, 70%);
  font-size: 1.15rem;
  line-height: 1;
  pointer-events: none;
}

@media (max-width: 599px) {
  .drawing-boxes__box .together__mark {
    font-size: 0.8rem;
  }
}

.drawing-boxes__box .together__mark:not(:empty) {
  padding: 0.15em 0.25em;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 0 0 1px currentColor;
}

.drawing-boxes__box.together__field--right .together__mark {
  color: #23644d;
}

.drawing-boxes__box.together__field--wrong .together__mark {
  color: #b3261e;
}

.drawing-boxes__notes .together__note {
  margin: 0 0 var(--space-2);
}

/* A table of values with a graph (14 Nov 2026): the parts that read from the graph wait until the table is right and
   the graph is drawn (static/js/practice.js holds them). Their wording shows, as on the paper; their boxes are faded
   and can't be used, under a line saying why. */
.follow-ups__held {
  margin: var(--space-4) 0 0;
  font-style: italic;
}

.follow-ups.is-held form.answer {
  opacity: 0.45;
}

/* A plain number shown as text rather than maths (practice/text.py, 15 Nov 2026): kept on one line, so
   "−14°" and "34 989" never split. */
.num {
  white-space: nowrap;
}

/* A list of numbers on a line of its own (practice/text.py number_row): centred, set apart as the papers set them. */
.num-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5em 2.5em;
  margin: var(--space-3) 0;
}

/* On a phone the gaps narrow, and a row too long for the line has its numbers made one width (--phone-number) and is
   narrowed to the width number_row works out (--phone-row), which holds the numbers its lines share out evenly, so it
   wraps 4 + 4 rather than 6 + 2, in columns (Ben, 15 Nov 2026). A screen narrower still wraps it further, never off
   the page. */
@media (max-width: 599px) {
  .num-row {
    gap: 0.5em 1.5em;
  }

  .num-row[style] {
    max-width: var(--phone-row);
    margin-left: auto;
    margin-right: auto;
  }

  .num-row[style] > .num {
    min-width: var(--phone-number);
    text-align: center;
  }
}

/* Drag to order (Part.order_tiles; Ben, 15 Nov 2026): "Write these numbers in order of size" answered with a tile for
   each number the question prints, dragged (or tapped two at a time, or moved with the arrow keys) into order by
   static/js/drag.js, which writes the list into the form's box. While the tiles show, that box, its label and help,
   and the question's printed list (the tiles are those numbers) are hidden. Tiles are 44px tall at least, to tap, and
   wrap onto more rows on a narrow phone. */
.order-tiles__help {
  margin: 0 0 var(--space-2);
  color: var(--ink-soft);
  font-size: var(--text-sm);
}

.order-tiles__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
  padding: 0;
  list-style: none;
}

.order-tiles__item {
  margin: 0;
  padding: 0;
}

/* On a phone the numbers stand in a numbered column, dragged up and down (Ben, 15 Nov 2026: a row of five
   wrapped its last number onto a line of its own, and some lists have seven). The first in the order is at the top. */
@media (max-width: 599px) {
  .order-tiles__list {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    max-width: 15rem;
    counter-reset: order-place;
  }

  .order-tiles__item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    counter-increment: order-place;
  }

  .order-tiles__item::before {
    content: counter(order-place);
    flex: none;
    width: 1.25rem;
    color: var(--ink-soft);
    font-size: var(--text-sm);
    text-align: right;
  }

  .order-tiles__item .order-tile {
    flex: 1 1 auto;
  }
}

.order-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.5rem;
  min-height: 2.75rem;
  margin: 0;
  padding: 0.4rem 0.85rem;
  border: 2px solid var(--grid);
  border-radius: var(--radius);
  background: var(--surface, #ffffff);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-lg);
  line-height: 1.2;
  cursor: grab;
  touch-action: none; /* a finger on a tile drags it; the page still scrolls from anywhere else */
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.reading .order-tile .tex {
  margin: 0;
  padding: 0;
}

@media (hover: hover) {
  .order-tile:hover {
    border-color: var(--border-hover, var(--teal));
  }
}

.order-tile:focus-visible {
  outline: var(--focus);
  outline-offset: 2px;
}

.order-tiles__item.is-picked .order-tile {
  border-color: var(--teal);
  background: var(--teal-pale);
}

.order-tiles__item.is-dragging {
  position: relative;
  z-index: 3;
}

.order-tiles__item.is-dragging .order-tile {
  border-color: var(--teal);
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.2);
  cursor: grabbing;
}

.order-tiles__list.is-sorting,
.order-tiles__list.is-sorting .order-tile {
  cursor: grabbing;
}

.answer--correct .order-tile {
  border-color: var(--teal);
}

.answer--tiles .answer__label,
.answer--tiles .answer__input,
.answer--tiles .answer__help,
.answer--tiles .keys {
  display: none;
}

.question.is-tiled .order-printed {
  display: none;
}

/* The verb that asks for an answer given by a click or a drag (practice/text.py, mark_actions; Ben, 15 Nov 2026):
   "write down" without the page's script, or while the box is typed in (is-typed, from picks.js and drag.js);
   "choose" or "put" while the answer is clicked or dragged. */
.action-word__clicked { display: none; }
.js .action-word__typed { display: none; }
.js .action-word__clicked { display: inline; }
.js .action-word.is-typed .action-word__typed { display: inline; }
.js .action-word.is-typed .action-word__clicked { display: none; }

/* "click" on a laptop, "tap" on a touch screen, in the tiles' and the symbols' help lines. */
.drag-tap {
  display: none;
}

@media (pointer: coarse) {
  .drag-click {
    display: none;
  }

  .drag-tap {
    display: inline;
  }
}

/* Symbols into gaps (Part.symbol_gap; Ben, 15 Nov 2026): the symbols in a box, as the papers print "= < >", and a
   gap in each statement to drag one into. A gap is a square like the papers' box; its ✓ or ✗ sits on its bottom right
   corner, so it never covers the symbol. A symbol stays in the box after use. */
.symbol-box {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  width: max-content;
  max-width: 100%;
  margin: var(--space-4) auto var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 2px solid var(--ink);
  border-radius: 2px;
}

.symbol-tile,
.symbol-gap__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin: 0;
  padding: 0;
  border: 2px solid var(--grid);
  border-radius: var(--radius);
  background: var(--surface, #ffffff);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-xl);
  line-height: 1;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.symbol-tile {
  cursor: grab;
}

.symbol-gap__button {
  border-color: var(--ink);
  border-radius: 2px;
  cursor: pointer;
}

.reading .symbol-tile .tex,
.reading .symbol-gap .tex {
  margin: 0;
  padding: 0;
}

.symbol-tile:focus-visible,
.symbol-gap__button:focus-visible {
  outline: var(--focus);
  outline-offset: 2px;
}

@media (hover: hover) {
  .symbol-tile:hover {
    border-color: var(--border-hover, var(--teal));
  }
}

.symbol-tile.is-picked {
  border-color: var(--teal);
  background: var(--teal-pale);
}

.symbol-help {
  margin: 0 0 var(--space-2);
  color: var(--ink-soft);
  font-size: var(--text-sm);
  text-align: center;
}

.inline-sum.inline-sum--symbols {
  gap: var(--space-2) 0.6em;
  margin: var(--space-3) 0;
}

.answer--symbols .inline-sum--symbols + .inline-sum--symbols {
  margin-top: var(--space-4);
}

.symbols-choosing .symbol-gap__button,
.symbol-gap.is-target .symbol-gap__button {
  background: var(--teal-pale);
}

.symbol-gap.is-target .symbol-gap__button {
  border-color: var(--teal);
}

.symbol-gap.is-lifted .symbol-gap__face {
  opacity: 0.35;
}

.symbol-gap.together__field--right .symbol-gap__button {
  border-color: var(--teal);
}

.symbol-gap.together__field--wrong .symbol-gap__button {
  border-color: var(--marker);
}

.inline-sum__box.symbol-gap .together__mark {
  top: auto;
  right: -0.55em;
  bottom: -0.55em;
  padding: 0.1em 0.25em;
  border-radius: 999px;
  background: var(--surface, #ffffff);
  box-shadow: 0 0 0 1px currentColor;
  font-size: 0.95rem;
  transform: none;
}

.inline-sum__box.symbol-gap .together__mark:empty {
  display: none;
}

.symbol-gap.together__field--wrong .together__mark {
  color: var(--marker);
}

/* The symbol under the finger while it is dragged (added to the page by drag.js). */
.symbol-ghost {
  position: fixed;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border: 2px solid var(--teal);
  border-radius: var(--radius);
  background: var(--surface, #ffffff);
  color: var(--ink);
  font-size: var(--text-xl);
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.2);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* Tap the graph (Question.choice_panels; Ben, 14 Nov 2026): a target over each labelled panel of the drawing
   (templates/practice/_panel_form.html), placed in percentages of the drawing, so the frame is exactly the drawing's
   size, as for the answer boxes above. Each target is a label holding a hidden radio button: the chosen panel is
   outlined and tinted, the keyboard's panel ringed, and after Check the chosen one carries ✓ or ✗ in its top right
   corner. The drawing is white in both themes (design.css; dark versions on the dark-drawings topics), so the colours
   are fixed ones that read on white. */
.tap-panels__choices {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.tap-panels__help {
  margin: var(--space-3) 0 0;
}

.tap-panels__tap {
  display: none;
}

@media (pointer: coarse) {
  .tap-panels__click {
    display: none;
  }

  .tap-panels__tap {
    display: inline;
  }
}

.tap-panels__frame {
  position: relative;
  max-width: 30rem;
  margin-inline: auto;
}

.tap-panels__frame:has(svg[data-size="large"]) {
  max-width: 36rem;
}

/* The narrower laptop widths (tools/drawing_sizes.py and tools/narrow_drawings.py), so the targets stay over their panels. */
.tap-panels__frame:has(svg[data-size="w420"]) { max-width: 26.25rem; }
.tap-panels__frame:has(svg[data-size="w360"]) { max-width: 22.5rem; }
.tap-panels__frame:has(svg[data-size="narrow"]) { max-width: 18.75rem; }

.tap-panel {
  position: absolute;
  display: block;
  margin: 0;
  border-radius: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .tap-panel:hover {
    background: rgb(35 100 77 / 0.06);
    box-shadow: inset 0 0 0 2px rgb(35 100 77 / 0.4);
  }
}

.tap-panel:has(input:checked) {
  background: rgb(35 100 77 / 0.1);
  box-shadow: inset 0 0 0 3px #23644d;
}

.tap-panel:has(input:focus-visible) {
  outline: 3px solid #23644d;
  outline-offset: 2px;
}

.tap-panel.is-wrong,
.tap-panel.is-wrong:has(input:checked) {
  background: rgb(179 38 30 / 0.07);
  box-shadow: inset 0 0 0 3px #b3261e;
}

.tap-panel__mark {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 0.15em 0.3em;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 0 0 1px currentColor;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

.tap-panel__mark:empty {
  display: none;
}

.tap-panel.is-right .tap-panel__mark {
  color: #23644d;
}

.tap-panel.is-wrong .tap-panel__mark {
  color: #b3261e;
}

/* Small targets (15 Nov 2026): a letter and its cross on a probability scale, a point, a region's letter ("spot"), or
   a name in a table, a row of plots ("row"). The chosen one is ringed, as a student rings a letter, with a lighter
   tint so the label inside still reads. A spot's mark sits on its top right corner, half outside, above the labels
   beside it (on its top left at the drawing's right edge, so nothing spills off a phone's screen); a row's sits inside
   its right end, clear of a name centred in a table cell. */
.tap-panel--spot,
.tap-panel--row {
  border-radius: 10px;
}

.tap-panel--spot:has(input:checked),
.tap-panel--row:has(input:checked) {
  background: rgb(35 100 77 / 0.08);
}

.tap-panel--spot.is-wrong,
.tap-panel--spot.is-wrong:has(input:checked),
.tap-panel--row.is-wrong,
.tap-panel--row.is-wrong:has(input:checked) {
  background: rgb(179 38 30 / 0.06);
}

.tap-panel--spot .tap-panel__mark {
  top: 0;
  right: 0;
  z-index: 1;
  transform: translate(50%, -50%);
  font-size: 0.85rem;
}

.tap-panel--spot.tap-panel--edge .tap-panel__mark {
  right: auto;
  left: 0;
  transform: translate(-50%, -50%);
}

.tap-panel--row .tap-panel__mark {
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  font-size: 0.9rem;
}

/* Letter buttons (Part.letter_buttons): two or more parts choose between one drawing's panels, so each has a row of
   letters A B C D under its wording, the screen's form of "write the letter of the graph". */
.choices.choices--letters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.choice.choice--letter {
  position: relative;
  justify-content: center;
  min-width: 3rem;
  min-height: 2.75rem;
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 700;
}

.choice--letter:has(input:focus-visible) {
  outline: var(--focus);
  outline-offset: 2px;
}

.choice--letter.is-wrong,
.choice--letter.is-wrong:has(input:checked) {
  border-color: var(--marker);
}

.choice__mark {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(40%, -45%);
  padding: 0.1em 0.25em;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 0 0 1px currentColor;
  font-size: 0.85rem;
  line-height: 1;
}

.choice__mark:empty {
  display: none;
}

.choice--letter.is-right .choice__mark {
  color: var(--teal);
}

.choice--letter.is-wrong .choice__mark {
  color: var(--marker);
}

/* Hint and worked solution: closed until asked for. */
.reveal {
  margin-top: var(--space-3);
  border: 1px solid var(--grid);
  border-radius: var(--radius);
}

.question .reveal:first-of-type {
  margin-top: var(--space-6);
}

.reveal summary {
  padding: var(--space-2) var(--space-4);
  color: var(--biro);
  font-weight: 700;
  cursor: pointer;
}

.reveal[open] summary {
  border-bottom: 1px solid var(--grid);
}

.reveal > :not(summary) {
  margin: var(--space-3) var(--space-4);
}

.reveal p {
  margin-block: calc(var(--space-3) - var(--maths-room));
}

.reveal__part {
  font-size: var(--text-base);
}

/* A column of steps. (A flex column, so that the steps' margins add up rather than merge.) */
.steps {
  display: flex;
  flex-direction: column;
  padding: 0;
  list-style: none;
}

/* A clear gap between one step and the next (Ben, 5 Oct 2026: the first version was half this). */
.steps li {
  margin-block: calc(var(--space-2) - var(--maths-room));
}

/* "This section is in development…": a quiet box under the heading (Ben, 5 Oct 2026). */
.notice {
  max-width: var(--measure);
  margin: 0 0 var(--space-6);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--grid);
  border-left: 4px solid var(--teal);
  border-radius: var(--radius);
  color: var(--ink-soft);
  font-size: var(--text-sm);
}

/* "Have a pen and paper handy…": one line under the heading of the list and of each topic. */
/* Jump links, one square per question, on a topic page with more than five questions. */
.jump__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0 0 var(--space-6);
  padding: 0;
  list-style: none;
  font-variant-numeric: tabular-nums;
}

.jump__list a {
  display: inline-block;
  min-width: 2.5rem;
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--ink-soft);
  border-radius: var(--radius);
  text-align: center;
  text-decoration: none;
}

.jump__list a:hover {
  background: var(--teal-pale);
}

.jump__list .jump__challenge {
  border-color: var(--teal);
  color: var(--teal);
}

/* One question at a time (Ben, 9 Oct 2026). With scripts, a page with more than five questions shows
   one at a time: the square of the question being shown is filled in, a square whose question has been
   answered in full is shaded, and "Show all questions" puts the long page back. Without scripts every
   question is on the page and the controls are hidden (static/js/practice.js). */
.one-at-a-time .jump__list {
  margin-bottom: var(--space-3);
}

.jump__all {
  margin: 0 0 var(--space-6);
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font: inherit;
  font-size: var(--text-sm);
  text-decoration: underline;
  cursor: pointer;
}

.jump__all:hover {
  color: var(--ink);
}

/* Changing question scrolls the title to the top, with a little room above it. */
.topic-page .topic-heading h1 {
  scroll-margin-top: var(--space-4);
}

html:not(.js) .jump__all,
html:not(.js) .question__nav,
.showing-all .question__nav {
  display: none;
}

/* Previous | 7 of 20 | Next question, under each question. */
.question__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-4);
  margin-top: var(--space-6);
  font-variant-numeric: tabular-nums;
}

.question__count {
  color: var(--ink-soft);
  font-size: var(--text-sm);
}

.question__prev,
.question__next {
  display: inline-block;
  padding: var(--space-2) var(--space-6);
  border: 2px solid var(--biro);
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
}

.question__next {
  background: var(--biro);
  color: var(--paper);
}

/* With no Previous on the first question, the count keeps its place in the middle. */
.question__nav > .question__count:first-child {
  margin-left: auto;
}

.question__nav > .question__count:last-child {
  margin-right: auto;
}

/* On a phone the two buttons share a line and the count goes under them. */
@media (max-width: 30em) {
  .question__nav {
    justify-content: space-between;
  }

  .question__count {
    order: 1;
    flex-basis: 100%;
    text-align: center;
  }

  .question__next {
    margin-left: auto;
  }
}

.practice-note {
  margin: 0 0 var(--space-4);
  font-style: italic;
}

.practice-foot {
  margin-top: var(--space-12);
}

/* On a topic's page, a clear gap after the last question, so the links don't crowd it. */
.reading .practice-foot {
  margin-top: calc(2 * var(--space-12));
}

/* Revision notes ----------------------------------------------------------- */

/* The topic bar: Notes, Practice questions, Worksheet. A row of plain tabs under the heading of each
   of a topic's pages, the one being read underlined (templates/notes/_topic_bar.html). */
.topic-bar {
  max-width: var(--measure);
  margin: 0 0 var(--space-6);
  border-bottom: 1px solid var(--grid);
}

.topic-bar ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-6);
  margin: 0;
  padding: 0;
  list-style: none;
}

.topic-bar a,
.topic-bar span {
  display: inline-block;
  margin-bottom: -1px; /* its underline sits on the bar's own line */
  padding: var(--space-2) 0;
  border-bottom: 3px solid transparent;
  font-weight: 700;
  text-decoration: none;
}

.topic-bar [aria-current] {
  border-bottom-color: var(--ink);
}

.topic-bar a:hover {
  border-bottom-color: var(--biro);
}

/* Notes are read at length, with maths in most lines, so their lines are set further apart than
   the rest of the site's, and the points of a list are set apart from each other (Ben, 5 Oct 2026:
   the first version looked cramped). */
.notes {
  line-height: 1.85;
}

.notes .question__text li + li {
  margin-top: var(--space-2);
}

.notes-section {
  scroll-margin-top: var(--space-4);
}

/* A worked example: set apart in a box, its question above a line and its steps below. */
.example {
  margin-top: var(--space-8);
  padding: var(--space-4) var(--space-4) var(--space-6);
  border: 1px solid var(--grid);
  border-top: 2px solid var(--ink);
  border-radius: 0 0 var(--radius) var(--radius);
}

.example .notes-section__title {
  margin-top: 0;
  font-size: var(--text-lg);
}

.example__question {
  padding-bottom: var(--space-1);
  border-bottom: 1px solid var(--grid);
}

.example__steps {
  margin: var(--space-4) 0 0;
}

/* One step at a time (static/js/notes.js). The steps are folded away from the start by a class the
   page's head sets, and each shows once it has been asked for. */
.steps-folded .example:not(.example--open):not(.example--try) .example__steps > .step:not(.is-shown),
.steps-folded .step--your-turn:not(.is-done) .your-turn__after,
.step--your-turn.is-done .your-turn__show,
.step--your-turn.is-told .answer {
  display: none;
}

/* A "your turn" step: the student types the next line. Its box holds an answer form, which must not be
   trimmed, so the room that tall maths needs is given to its lines of text instead of to the step. */
.steps .step--your-turn {
  padding-block: 0;
  overflow: visible;
}

.your-turn {
  margin-block: var(--space-2);
  padding-left: var(--space-4);
  border-left: 4px solid var(--biro);
}

.step--your-turn.is-done .your-turn {
  border-left-color: var(--grid);
}

.your-turn__prompt,
.your-turn__after {
  margin: 0;
  padding-block: var(--maths-room);
  overflow-x: auto;
  overflow-y: hidden;
}

.your-turn .answer {
  margin-top: 0;
}

/* "Now try this" (18 Nov 2026): a whole question straight after the worked example it follows, joined to it
   by a small gap and a coloured top edge. The working waits (static/js/notes.js sets is-waiting) until the
   answer is right or "Show me the working" is pressed; once it is given, the answer box goes. */
.notes .example--try {
  margin-top: var(--space-3);
  border-top: 2px solid var(--biro);
}

.example--try .example__question {
  border-bottom: 0;
}

.try__prompt {
  margin: 0;
}

.try .answer {
  margin-top: var(--space-2);
}

.try__show {
  margin: var(--space-2) 0 0;
  font-size: var(--text-sm);
}

.example--try.is-waiting .try__working,
.example--try.is-done .try__show,
.example--try.is-told .answer {
  display: none;
}

.try__working {
  margin-top: var(--space-4);
  border-top: 1px solid var(--grid);
}

/* The Key facts as an A4 poster to download (18 Nov 2026). */
.notes-poster {
  margin: var(--space-3) 0 var(--space-4);
}

/* "Before you start" and "Next": links to other topics, the same for every visitor (18 Nov 2026). */
.notes-links {
  margin: var(--space-4) 0;
}

.notes-links--next {
  margin-top: var(--space-8);
}

.try__more {
  margin: var(--space-4) 0 0;
  font-size: var(--text-sm);
}

.example__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-6);
  margin: var(--space-4) 0 0;
}

.example__next {
  background: var(--biro);
  color: var(--paper);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* A quiet button that reads as a link: "Show all steps", "Show me". */
.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--biro);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.your-turn__show {
  margin: var(--space-2) 0 var(--space-3);
  font-size: var(--text-sm);
}

/* An interactive graph (static/js/graph.js): the equation, the plot, then a slider for each letter. */
.graph--live {
  max-width: 26rem;
  margin: var(--space-4) 0 var(--space-6);
}

.graph__equation {
  margin: 0 0 var(--space-2);
  font-size: var(--text-lg);
  text-align: center;
}

.graph__plot {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--grid);
  border-radius: var(--radius);
  font-size: 0.8125rem;
}

.graph__grid {
  stroke: var(--grid);
  stroke-width: 1;
}

.graph__axis {
  stroke: var(--ink);
  stroke-width: 1.5;
}

.graph__numbers {
  fill: var(--ink-soft);
}

.graph__numbers .graph__letter {
  fill: var(--ink);
  font-size: 1rem;
}

.graph__guide {
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 1.5;
  stroke-dasharray: 5 5;
}

.graph__curve {
  fill: none;
  stroke: var(--biro);
  stroke-width: 3;
}

.graph__point {
  fill: var(--biro);
  stroke: var(--paper);
  stroke-width: 2;
}

/* The point a slider moves: solid, in the deep red the diagrams mark angles and tangents with. */
.graph__point--live {
  fill: var(--tangent);
}

/* A circle theorem diagram: its points sit on the circle with no ring round them (a ring broke the circle's
   line), and its title is the theorem in words. */
.graph--circle .graph__point {
  stroke: none;
}

.graph__title {
  font-weight: 700;
  line-height: 1.35;
  text-wrap: balance;
}

/* The turning point's coordinates, with a white edge so they read over the grid. */
.graph__label {
  fill: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  paint-order: stroke;
  stroke: var(--paper);
  stroke-width: 5px;
}

.graph__sliders {
  margin-top: var(--space-3);
}

.graph__slider {
  display: grid;
  grid-template-columns: 1.25rem 1fr 2rem;
  align-items: center;
  gap: var(--space-3);
}

.graph__slider input {
  width: 100%;
  height: 2.25rem; /* room for a thumb */
  margin: 0;
  accent-color: var(--biro);
}

.graph__letter {
  font-style: italic;
  font-weight: 700;
}

.graph__value {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.graph__facts {
  margin-top: var(--space-2);
}

.graph__facts p {
  margin: 0;
}

.graph__hint {
  margin: var(--space-2) 0 0;
  color: var(--ink-soft);
  font-size: var(--text-sm);
}

.graph__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
}

.graph__key::before {
  content: "";
  display: inline-block;
  width: 1.3rem;
  margin-right: .35rem;
  border-top: 3px solid var(--biro);
  vertical-align: middle;
}

.graph__key--tangent::before { border-color: var(--tangent); }
.graph__key--normal::before { border-color: var(--normal); border-top-style: dashed; }
.graph__tangent { fill: none; stroke: var(--tangent); stroke-width: 2.5; }
.graph__normal { fill: none; stroke: var(--normal); stroke-width: 2.5; stroke-dasharray: 7 5; }
.graph__right-angle { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.graph__slider--point { grid-template-columns: 1fr 3rem; }
.graph__slider--point label { grid-column: 1 / -1; }
.graph__reset { font-size: var(--text-sm); }

/* The notes read aloud (static/js/listen.js): a button for the whole page, a quiet one under each
   heading, and the part being read lit up. */
.listen {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-6);
  margin: 0 0 var(--space-6);
}

/* The choice of voice: a button for each, the chosen one filled in. */
.listen__voices {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
}

.listen__voice {
  padding: var(--space-1) var(--space-3);
  border: 2px solid var(--biro);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--biro);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.listen__voice[aria-pressed="true"] {
  background: var(--biro);
  color: var(--paper);
}

.listen__all,
.player__toggle {
  background: var(--biro);
  color: var(--paper);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.listen__section {
  display: block;
  margin: calc(-1 * var(--space-2)) 0 var(--space-3);
  font-size: var(--text-sm);
}

/* The same tint in the gap around the words as behind them, so the highlight has a little air without
   anything on the page moving. */
.is-reading {
  border-radius: 2px;
  background: var(--teal-pale);
  box-shadow: 0 0 0 0.4rem var(--teal-pale);
}

/* While something is being read, a bar along the bottom of the window: pause, what is being read, stop (and the voice, where there is a choice). */
.player {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  border-top: 2px solid var(--ink);
  background: var(--paper);
}

.player__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  max-width: var(--measure);
  margin: 0 auto;
  padding: var(--space-2) var(--space-4);
}

.player__toggle {
  min-width: 5.5rem;
  padding: var(--space-1) var(--space-4);
  text-align: center;
}

.player__toggle:disabled {
  opacity: 0.6;
  cursor: default;
}

.player__title {
  flex: 1;
  min-width: 8rem;
  margin: 0;
  font-size: var(--text-sm);
}

.player__choice {
  font-size: var(--text-sm);
  white-space: nowrap;
}

.player__choice select {
  font: inherit;
}

/* Room at the foot of the page, so that the bar never covers its last lines. */
.is-listening main {
  padding-bottom: 5rem;
}

/* Other pages ------------------------------------------------------------ */

.company {
  font-style: normal;
  color: var(--ink-soft);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Direct manipulation of the small SVG solid; no animation or model download. */
.graph__plot--rotate { cursor: grab; touch-action: pan-y; }
.graph__plot--rotate.is-dragging { cursor: grabbing; }
.graph__plot--rotate:focus-visible { outline: 3px solid var(--biro); outline-offset: 3px; }
.graph__view-buttons { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-block: 12px; }
.graph__view-buttons .graph__reset { margin: 0; }
.graph__model-label { paint-order: stroke; stroke: var(--paper); stroke-width: 3px; stroke-linejoin: round; }

.graph__linked-diagrams { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: center; }
@media (max-width: 650px) { .graph__linked-diagrams { grid-template-columns: minmax(0, 1fr); } }

/* The Practice Questions, Mock Exams and Worksheets buttons under the papers (Ben, 20 Oct 2026), with one
   sentence above them for both tiers (21-22 Oct 2026). */
.series-more {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-6);
}
.series-more__nudge {
  margin: 0;
  max-width: 60ch;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
.series-more__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

/* A tier's formulae sheet, between its heading and its papers (Ben, 20 Oct 2026). */
.series-group__formulae {
  margin: var(--space-4) 0;
}

/* A step of working in parts: each part on a line of its own (practice_extras.maths_lines; Ben, 19 Nov 2026). */
.steps .step-line {
  display: block;
}
.steps .step-line + .step-line {
  margin-top: 0.35em;
}
