/* TAO Tools — shared styles for practice, simulations & review */

.overflow-x-auto:not(.hidden):has(> svg.question-chart--q883) {
    display: block;
}
#sequence-svg svg.question-chart--q883,
#q-sequence svg.question-chart--q883,
svg.question-chart--q883 {
    display: block;
    width: 100%; min-width: 560px; max-width: none !important;
    height: auto;
}

.tao-tool-btn {
    /* ux_audit_2026_05_11 P1-3: toolbar buttons were 26-28px tall — below the
       44px mobile minimum tap target. Bumped without changing visual footprint
       of the active/hover states. */
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 44px; padding: 8px 12px; border-radius: 8px;
    border: 1.5px solid transparent;
    font-size: 14px; color: #4b5563;
    cursor: pointer; transition: all 0.15s;
    background: transparent; white-space: nowrap;
}
.tao-tool-btn:hover { background: #f3f4f6; }
.tao-tool-btn.active { border-color: #3b82f6; background: #eff6ff; color: #1d4ed8; }
/* The same cascade trap as `.floating-panel.hidden` below, one element further
   out. The Calculator and Notes buttons ship carrying `hidden` and lose it only
   where the section offers them, but the inline-flex above is one class wide,
   like Tailwind's `.hidden`, and loads after it — so the buttons were painted in
   every section, verbal and abstract included. Scoped to this button and not
   written as a bare `.hidden` rule on purpose: a one-class rule here would also
   outrank Tailwind's responsive `sm:inline`, which is what puts the button
   labels back on wide screens. */
.tao-tool-btn.hidden { display: none; }

/* Candidate data tables ---------------------------------------------------
   A column heading is ONE LABEL, and no table hides a figure.

   QR550 (thesilverbromide, hu, 2026-10-22, q12818 — "table headings are
   split, and the whole table is not visible at once") was caused by the cure
   for QR542.  That fix put `overflow-wrap: anywhere` on every header and body
   cell so a wide table could be squeezed into a 320px phone instead of being
   dragged sideways.  `anywhere` is the one wrap value that counts towards a
   column's MIN-CONTENT width, so it told `table-layout: auto` that any column
   may legally shrink to a SINGLE CHARACTER — and the algorithm took the
   offer.  Measured on the page he was served, 360px: all six Hungarian
   headers came out mid-word, "Tagállam" as one letter per line, and the table
   grew about nine screens tall, which is the second half of the same
   sentence — the table was no longer visible at once and neither was the
   question under it.  English did the same thing ("MEMBER STATE" as eleven
   lines); Hungarian only made it unmissable.

   So both symptoms had one cause and there is one rule: A WORD IS NEVER CUT.
   `overflow-wrap: break-word` wraps exactly like `anywhere` once a column HAS
   a width, but it does not offer the layout algorithm a one-character floor,
   so a column is never narrower than its longest word and a heading always
   reads as a heading.  It stays as the safety valve for a pathological token
   wider than the phone itself.

   The width that is no longer paid out of legibility is paid out of
   scrolling, HONESTLY: the wrapper still scrolls horizontally, the hint
   below it says so in the candidate's own language, the row-label column is
   pinned so he never loses the row he is reading, and nothing is ever
   clipped.  Both are switched on by `data-scrollable`, which DomSafe sets on
   a wrapper whose table really is wider than its box — so a table that fits,
   which is most of them, renders exactly as it does today.

   The floors QR542 retired stay retired: no `min-width` on the table and
   none on a cell, `table-layout: auto` with `width: 100%`, and the fit on a
   narrow screen bought from padding and font size rather than from a
   column. */
.question-table-wrap {
    width: 100%; max-width: 100%; min-width: 0; margin: 16px 0;
    border: 1px solid #e5e7eb; border-radius: 8px;
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
    overflow-x: auto; overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
}
.question-table-wrap:focus-visible {
    outline: 2px solid #003399; outline-offset: 2px;
}
/* The affordance. Hidden until DomSafe proves the table really is wider than
   its box, so a table that fits never tells a candidate to scroll it. */
.question-table-hint {
    display: none;
    margin: -8px 0 16px; padding: 0 2px;
    font-size: 12px; line-height: 1.4; color: #4b5563;
}
.question-table-wrap[data-scrollable="true"] + .question-table-hint,
[data-table-scroll][data-scrollable="true"] + .question-table-hint {
    display: flex; align-items: center; gap: 6px;
}
.question-table-hint::before {
    content: "\2194"; font-size: 14px; line-height: 1; color: #003399;
}
.question-data-table {
    width: 100%; max-width: 100%; min-width: 0;
    table-layout: auto; border-collapse: separate; border-spacing: 0; font-size: 14px;
}
.question-data-table th,
.question-data-table td {
    min-width: 0; vertical-align: top;
    overflow-wrap: break-word; word-break: normal;
    hyphens: none; -webkit-hyphens: none;
}
.question-data-table .question-table-header {
    padding: 10px 12px; text-align: left;
    font-size: 12px; line-height: 1.4; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
    color: white; background: #003399;
    overflow-wrap: break-word; word-break: normal; hyphens: none;
}
.question-data-table .question-table-cell {
    padding: 10px 12px; color: #374151; text-align: left;
    line-height: 1.45; overflow-wrap: break-word; word-break: normal; hyphens: none;
}
.question-data-table .question-table-cell--label {
    color: #111827; font-weight: 500;
}
.question-data-table .question-table-cell--numeric {
    color: #374151; text-align: right;
    font-size: 13px; font-variant-numeric: tabular-nums;
    font-family: ui-monospace, monospace; white-space: nowrap;
}
/* `border-collapse: separate` is what lets a cell be `position: sticky`
   without its borders being left behind, so the row rule that used to live on
   the <tr> lives on its cells instead. Same hairline, same places. */
.question-data-table .question-table-row {
    background: #ffffff;
}
.question-data-table .question-table-row--alt { background: #f9fafb; }
.question-data-table .question-table-row > .question-table-cell {
    border-bottom: 1px solid #f3f4f6;
}
.question-data-table .question-table-row:last-child > .question-table-cell {
    border-bottom: 0;
}
/* Headings stay attached to their data while the table is scrolled: the
   header row down the page, the row-label column across it. Both are scoped
   to a wrapper that actually scrolls, and the label cells repeat their row's
   own background so nothing shows through underneath them. */
.question-table-wrap[data-scrollable="true"] .question-data-table thead th {
    position: sticky; top: 0; z-index: 3;
}
.question-table-wrap[data-scrollable="true"] .question-data-table .question-table-header:first-child,
.question-table-wrap[data-scrollable="true"] .question-data-table .question-table-cell--label {
    position: sticky; left: 0;
}
.question-table-wrap[data-scrollable="true"] .question-data-table .question-table-header:first-child {
    z-index: 4;
}
.question-table-wrap[data-scrollable="true"] .question-data-table .question-table-cell--label {
    z-index: 2; box-shadow: 1px 0 0 #e5e7eb;
}
.question-table-wrap[data-scrollable="true"] .question-data-table .question-table-row > .question-table-cell--label {
    background: #ffffff;
}
.question-table-wrap[data-scrollable="true"] .question-data-table .question-table-row--alt > .question-table-cell--label {
    background: #f9fafb;
}

/* The fit is bought from padding, letter-spacing and font size — never from a
   column and never from a word.  A 320px phone leaves a 224px content box; a
   narrow table of three-digit figures fits it with the values below, and a
   six- or seven-column table with long headings does not, which is what the
   scroll affordance above is for.  Numeric cells keep `white-space: nowrap`
   on purpose: a figure written "3 400" with a thin space must not be broken
   across two lines and read as two figures. */
@media (max-width: 767px) {
    .question-data-table { font-size: 12px; }
    .question-data-table .question-table-header {
        padding: 6px 4px; font-size: 10px; letter-spacing: 0;
    }
    .question-data-table .question-table-cell {
        padding: 6px 4px; font-size: 12px;
    }
    .question-data-table .question-table-cell--numeric {
        padding: 6px 4px; font-size: 11px;
    }
}

.elim-x {
    width: 22px; height: 22px; border-radius: 50%;
    border: 1.5px solid #d1d5db; background: white;
    color: #9ca3af; font-size: 11px; cursor: pointer;
    display: none; align-items: center; justify-content: center;
    transition: all 0.15s; flex-shrink: 0; line-height: 1;
}
.elim-x:hover { border-color: #ef4444; color: #ef4444; background: #fef2f2; }
.elim-x.is-eliminated { background: #fef2f2; border-color: #ef4444; color: #ef4444; }
.eliminator-on .elim-x { display: flex; }

/* THE HIGHLIGHT, DEFINED ONCE -------------------------------------------
   The four surfaces that offer the tool each used to set the colour inline
   from their own copy of the JavaScript (`mark.style.backgroundColor`), and
   one of them (practice_block.html, the numerical block) set a different
   property on an unclassed <mark>, so the same tool had three slightly
   different definitions and the block's highlights could not even be clicked
   off. The colour lives here now and nowhere else; static/tao-highlight.js
   mirrors the two values for its contrast arithmetic and
   test_tao_highlighter_graphs.py fails if they drift.

   #111827 on #fef08a is 15.0:1 — AA and AAA at any size, and a
   lightness contrast rather than a hue one, so it survives protanopia,
   deuteranopia and tritanopia. There is one theme on this site; if a dark one
   is ever added, these two declarations are the only place it has to answer.

   `.tao-highlight-svg` is the SVG form of the same band: a <rect> drawn
   behind a chart label, because an HTML <mark> inside SVG <text> renders no
   glyphs at all (thesilverbromide, 2026-10-22: "The highlighter makes text
   invisible on the graphs"). */
.tao-highlight { background-color: #fef08a; color: #111827; padding: 0 1px; border-radius: 2px; }
.tao-highlight-svg { fill: #fef08a; }
/* The "Aa" chip on the Highlight button. Same yellow, same ink, same source:
   the four toolbars used to carry it as an inline style and two of them had
   drifted to a different text colour. */
.tao-highlight-swatch { background-color: #fef08a; color: #111827; }
.highlighter-on .tao-highlight,
.highlighter-on .tao-highlight-svg { cursor: pointer; }

.floating-panel {
    position: fixed; z-index: 50; background: white;
    border-radius: 12px; border: 1px solid #d1d5db;
    box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.15);
    overflow: auto;
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    /* §4.2.2.4/§4.2.2.5: both TAO widgets resize in height and width. */
    resize: both;
    min-width: 240px;
    min-height: 180px;
}
.tao-panel-anchor { display: none !important; }
/* A closed panel must stay closed. Tailwind's `.hidden{display:none}` and this
   file's `.tao-calculator{display:flex}` are both one class wide, and this file
   loads second, so the calculator won the cascade and sat open on every screen
   that includes the partial — verbal included. Two classes always beat one. */
.floating-panel.hidden { display: none; }
.floating-panel.is-dragging { user-select: none; }
.panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px; background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
    gap: 8px; cursor: move; user-select: none; touch-action: none;
}
.panel-header:focus-visible {
    outline: 2px solid #60a5fa; outline-offset: -2px;
}
.panel-drag-grip {
    color: #9ca3af; font-size: 15px; font-weight: 700;
    letter-spacing: -3px; line-height: 1; flex: 0 0 auto;
}
.panel-title { font-size: 13px; font-weight: 600; color: #374151; }
.panel-drag-hint {
    margin-left: auto; color: #6b7280; font-size: 10px;
    font-weight: 500; line-height: 1.2; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.panel-header:focus-visible .panel-drag-hint { color: #1d4ed8; }
.is-dragging .panel-header { cursor: grabbing; }
.panel-close {
    width: 24px; height: 24px; border-radius: 6px;
    border: none; background: transparent; color: #9ca3af;
    cursor: pointer; font-size: 18px; display: flex;
    align-items: center; justify-content: center; line-height: 1;
}
.panel-close:hover { background: #e5e7eb; color: #374151; }

/* Calculator — replica of EPSO "Instructions for online Testing (TAO)",
   March 2026, §4.2.2.5: dark title bar, black display, light-blue digit pad,
   blue operator column, "=" across two columns. The display is a div and is
   not selectable, so nothing can be copied out of it. */
.tao-calculator { display: flex; flex-direction: column; }
.tao-calculator .panel-header { flex: 0 0 auto; }
/* §6.4.5: "You can resize the calculator in height and width." The panel has
   resized since 2026-08-19 (`resize: both` above), but the height went to the
   DISPLAY, so a taller calculator was a taller black band over the same small
   keys. The keypad takes the height now and the display keeps its own, which
   is what the candidate is actually asking for when he drags the corner. */
.tao-calculator .calc-display { flex: 0 0 auto; }
.tao-calculator .calc-keys { flex: 1 1 auto; grid-auto-rows: minmax(38px, 1fr); }
.tao-calculator .panel-header {
    background: #1a1a1a; border-bottom: none;
    justify-content: flex-start; position: relative; padding-left: 42px;
}
.tao-calculator .panel-title {
    color: #ffffff; font-size: 12px; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase;
}
.tao-calculator .panel-drag-grip { color: #9ca3af; }
.tao-calculator .panel-drag-hint { color: #d1d5db; }
.tao-calculator .panel-close {
    position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
    color: #d1d5db;
}
.tao-calculator .panel-close:hover { background: #333333; color: #ffffff; }

/* THE DISPLAY CARRIES AN EXPRESSION, NOT ONE REGISTER (2026-10-21).
   With BODMAS on, a single-register display hides what is pending: after
   `2 + 3 x` the candidate must be able to see `2+3x`, because the 3 has not
   been consumed yet. So the display can hold up to about thirty characters in
   a 288px panel, and does it the way the TAO engine does: one line, no
   wrapping (wrapping used to grow the panel and push the keypad off a phone),
   shrinking at fifteen, twenty-three and thirty-one characters, then
   scrolling horizontally with the NEWEST characters in view. Courier New
   advances 0.6em, so 256px of content box holds ~16 characters at 26px, 22 at
   19px, 30 at 14px and 38 at 11px — past anything a candidate types, since
   `=` closes a group and starts a new expression. `justify-content: flex-end`
   keeps the right-hand end of a longer one on screen and `updateDisplay` in
   tao-session-tools.js parks scrollLeft at the same end, because browsers
   disagree about which end of an overflowing flex item stays reachable.
   Still a div, but its TEXT IS SELECTABLE, so the result of an operation can
   be copied out of it with Ctrl/Cmd+C: the candidate has that in the real
   exam and could not have it here (owner decision via Cris, 2026-11-05, from
   a candidate report). 427-26 V1 §6.4.5 says nothing either way about copy,
   so the exam's own behaviour decides. The KEYPAD below stays unselectable,
   so a drag that runs past the display picks up no key glyphs, and
   tao-session-tools.js still cancels every other copy on the panel and every
   paste into it. */
.calc-display {
    width: 100%; min-height: 68px; flex: 1 1 auto; padding: 14px 16px;
    font-family: 'Courier New', monospace;
    font-size: 26px; text-align: right; border: none;
    background: #1a1a1a; color: #ffffff;
    display: flex; align-items: flex-end; justify-content: flex-end;
    overflow-x: auto; overflow-y: hidden; white-space: nowrap; outline: none;
    -webkit-user-select: text; -moz-user-select: text; -ms-user-select: text; user-select: text;
    cursor: text;
}
.calc-display--long { font-size: 19px; }
.calc-display--very-long { font-size: 14px; }
.calc-display--huge { font-size: 11px; }
.calc-keys {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
    background: #ffffff;
    /* The display above is selectable so the result can be copied; the keys
       are not, so a selection dragged past the end of the display cannot
       scoop up "789x" along with the number. */
    -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;
}
.calc-btn {
    padding: 16px 10px; font-size: 15px; border: none;
    background: #e8f1fd; color: #111827; cursor: pointer; border-radius: 0;
    transition: background 0.1s; line-height: 1; font-weight: 600;
}
.calc-btn:hover { background: #d7e6fb; }
.calc-btn:active { background: #c6d9f7; }
.calc-btn.fn { background: #f2f2f2; }
.calc-btn.fn:hover { background: #e6e6e6; }
.calc-btn.op { background: #2d6fd4; color: #ffffff; }
.calc-btn.op:hover { background: #2560bb; }
.calc-btn.eq { background: #2d6fd4; color: #ffffff; grid-column: span 2; }
.calc-btn.eq:hover { background: #2560bb; }

/* THE OCTOBER KEYPAD (TAO 427-26 V1, §6.4.5), drawn 2026-11-03.
   Two key positions are legible in the document's thumbnail and both are now
   real keys: the delete key to the LEFT of AC, and the ^ / v icons that
   review previous operations. The three cells the thumbnail shows as
   occupied but unreadable are NOT guessed: the keys we have are widened to
   fill their row instead, so the pad has no blanks and no invented buttons. */
.calc-btn.span2 { grid-column: span 2; }
.calc-btn.hist { background: #f2f2f2; }
.calc-btn.hist:hover { background: #e6e6e6; }
.calc-btn.calc-icon { display: flex; align-items: center; justify-content: center; }
.calc-btn.calc-icon svg {
    width: 20px; height: 20px; fill: currentColor; stroke: none;
    pointer-events: none;
}
.calc-btn.calc-icon svg .calc-icon-stroke {
    fill: none; stroke: currentColor; stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round;
}
/* A history icon with nothing to review is inert, and says so instead of
   looking broken when it is pressed. */
.calc-btn[disabled] { opacity: 0.35; cursor: default; }
.calc-btn.hist[disabled]:hover { background: #f2f2f2; }

/* TAO is a desktop test environment, while PassEPSO candidates also open
   practice on narrow windows and phones. At that width an overlay hides the
   very question the calculator is meant to support. The shared helper moves
   open panels into this in-flow dock, so the question and options are pushed
   down rather than covered. */
.tao-mobile-panel-dock { display: flex; flex-direction: column; gap: 12px; }
.tao-mobile-panel-dock:empty { display: none; }

@media (max-width: 1100px) {
    .floating-panel {
        position: static !important; top: auto !important; right: auto !important;
        bottom: auto !important; left: auto !important;
        max-height: none !important; resize: none;
        margin: 12px 0; overflow: visible;
    }
    .tao-mobile-panel-dock .floating-panel { margin: 0; }
    .tao-mobile-docked .panel-header { cursor: default; touch-action: auto; }
    .tao-mobile-docked .panel-drag-hint { display: none; }
    .tao-mobile-docked .panel-drag-grip { opacity: 0.6; }
}

@media (max-width: 767px) {
    .floating-panel {
        width: 100% !important; max-width: 100% !important;
        min-width: 0; min-height: 0;
    }
}

.hl-clear {
    width: 22px; height: 22px; border-radius: 50%;
    border: 1.5px solid #d1d5db; background: white;
    cursor: pointer; font-size: 11px; display: flex;
    align-items: center; justify-content: center;
    color: #9ca3af; line-height: 1;
}
.hl-clear:hover { border-color: #ef4444; color: #ef4444; }

/* A VERBAL ITEM IS A PASSAGE WITH ITS OPTIONS BELOW IT, FULL WIDTH
   (Marta Ari, paying candidate, 2026-11-04: "in the simulator the answer
   options are at the right side; in the real exam they are below the text").

   She is right, and the reference photograph of the real TAO verbal screen
   settles it: the passage runs the full width of the question pane, and the
   options are stacked UNDER it as full-width boxes, each with its radio on
   the left. There is no right-hand column anywhere on that screen.

   WHAT WAS HERE BEFORE, and why it went. On 2026-10-18 Haryo Nindito reported
   that he could not see the passage and the options at once at 1280x720, and
   the fix was a two-equal-column grid from 1024px up (passage left; stem and
   options right) inside a widened 1120px shell. It measured well -- 623px of
   item against 582px of room became 407px -- and it was still the wrong shape:
   it put the options somewhere TAO does not put them, on the one surface whose
   whole purpose is to be the real screen. `Fidelity to TAO wins` (the standing
   rule), so the prose split is retired and the stacked layout is back.

   WHAT IS KEPT FROM THAT WORK. Not the wide shell: at 1120px a text-sm
   passage runs about 130 characters a line, which is the unreadable measure
   the split was invented to avoid, and TAO's own passage is not that wide. A
   prose item therefore keeps the surface's normal max-w-3xl card, which is
   the geometry the page had before 2026-10-18 and the geometry every phone
   has always had. Haryo's underlying point -- that comparing options against
   the passage costs scrolling -- is TRUE OF THE REAL TEST TOO, which is the
   answer to it on a simulation surface.

   WHAT IS NOT TOUCHED: the TABLE split below. A numerical data table beside
   its five short options was the other half of the same 2026-10-18 report, it
   was approved separately (Cris, 2026-10-18), it is a numerical item and not
   a verbal one, and the photograph says nothing about it. `question-shell--wide`
   therefore still exists and is still switched on -- for a table item only.

   `prep.question_layout.item_uses_two_columns` and its JavaScript mirror
   `itemUsesTwoColumns` are KEPT, and are still pinned to each other by a
   test: they are now only the shape predicate that keeps a prose item OUT of
   the table split (an item with a prose passage and a table in its stem is a
   prose item). Neither switches a layout class on any more. */
.question-split { display: block; }

@media (min-width: 1024px) {
    /* The page's own container is the width authority (prep/base.html `main`,
       max-w-6xl -> a 1120px content box); this only stops the narrower
       max-w-3xl cap from applying to a TABLE item, the one shape that still
       takes a second column. */
    .question-shell--wide { max-width: none; }

    /* A TABLE ITEM KEEPS ITS TABLE AND STILL SHOWS OPTION E (approved by
       Cris, 2026-10-18; the same report, the other section).

       A prose item stacks (see the note above: TAO puts a verbal item's
       options under its passage, full width). A numerical item is a different
       shape -- one data table and five option strings of 9.8 characters on
       average -- so it keeps the layout approved for it on its own terms: the
       stimulus stays on the left at the width it needs, and the options sit in
       a NARROW right-hand column beside it. Nothing in the TAO verbal
       photograph speaks to a table item, so nothing here changed on
       2026-11-04.

       MEASURED BEFORE, on the pages production serves, 60 random active
       numerical items, 1366x768 and 1280x720 (identical geometry at both):
       0 of 60 fitted, the last option was below the fold in 60 of 60, the
       median item ended 344px past it and the worst 827px.

       THE 320px IS MEASURED, not chosen. Over all 4,515 option strings of the
       903 items this rule reaches, a 320px column (240px of text after the
       letter badge, the gap, the padding and the border) leaves 4,491 of them
       on ONE line and none on three; and it leaves the stimulus column 758px
       at both laptop widths, which is 8px MORE than the 750px a table gets
       today, so no table in the bank can come out taller than it is now.

       `width: fit-content` on the table is the rest of Cris's instruction: a
       six-column numeric table does not need 758px, and a table that is only
       as wide as its own figures is a table a candidate can read across. The
       `max-width: 100%` of the wrapper still applies, so a table that cannot
       fit the column wraps its cells the way it does today -- QR542 again:
       it must FIT, it must never get an inner scrollbar.

       AREAS, NOT FLEX, and for the reason the prose split used to give: the
       surfaces disagree about DOM order (practice renders passage, stem,
       options; the simulations render stem, passage, options), and named
       areas put the stimulus in the left column on all of them without moving
       a single element. `grid-column: 1` on the default child is the opposite
       of what the prose split used to do and is deliberate: anything a
       surface adds that is
       not one of the three named parts belongs with the stimulus, never under
       the options. The stem is a DIV on every surface for the same reason --
       as a `<p>` it cannot contain the table, which the parser then lifts out
       into an implicit row below the options column. */
    .question-split--table {
        display: grid;
        grid-template-columns: minmax(0, 1fr) fit-content(20rem);
        grid-template-areas: "passage options" "stem options";
        column-gap: 1.5rem;
        align-items: start;
    }
    .question-split--table > * { grid-column: 1; }
    .question-split--table > .question-split-passage { grid-area: passage; }
    .question-split--table > .question-split-stem { grid-area: stem; }
    .question-split--table > .question-split-options { grid-area: options; }
    /* A trailing margin at the foot of a column is dead space: nothing
       follows it. */
    .question-split--table > .question-split-passage,
    .question-split--table > .question-split-options { margin-bottom: 0; }
    /* THE OPTIONS COLUMN TAKES WHAT IT NEEDS, NOT A FIXED 20rem
       (QR550, second half: "the whole table is not visible at once").

       The 20rem above was measured against the option STRINGS -- mean 9.8
       characters, p90 15 -- and it is still their ceiling. But it was being
       spent whether they needed it or not, and the table pays for every
       pixel it does not get: at 1280-1920px the page's content box is 1120px,
       the card leaves 1072px, and a fixed 320px column plus the 24px gutter
       left the stimulus 728px for good. MEASURED over the live bank as
       served (2026-10-23, 17,444 table renderings across the source and all
       23 translations, laid out by prep/table_layout_contract.py): 1,449 of
       them -- 8.3%, and a German or Finnish six-column table far more often
       than an English one -- could not fit 728px with their headings whole,
       so the candidate had to drag the table sideways to read it. Under a
       two-minute clock that is marks.

       `fit-content(20rem)` is the same ceiling with the waste removed: the
       track is the options' own max-content width, capped at 20rem, so no
       option wraps that did not wrap before and nothing moves on an item
       whose options really are that wide. The slack goes to the table. Same
       bank, same arithmetic, after: 214 renderings (1.23%) still have to
       scroll, and they keep the honest affordance -- the hint, the pinned
       row label, nothing clipped.

       The 10rem floor is the other side of it: an item whose options are
       "A", "12", "None" would otherwise shrink the column to a stub, and a
       10rem (160px) button is the narrowest that still reads as one. */
    .question-split--table > .question-split-options { min-width: 10rem; }
    .question-split--table .question-table-wrap { width: fit-content; }
    .question-split--table .question-data-table { width: auto; }
}

/* MARK FOR LATER REVIEW — the TAO bookmark (Marta Ari, 2026-11-04).
   The control itself sits at the bottom-right of the question pane, where the
   reference photograph of the real TAO screen has it, and the mark it leaves
   is repeated in the navigation strip so the candidate can see at a glance
   what they still owe themselves. One colour for the whole concept (amber),
   deliberately NOT the blue of a selected option or the green of an answered
   question: a flag is neither. */
.tao-flag-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tao-flag-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.7rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.6rem;
    background: #fff;
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.1;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.tao-flag-btn:hover { border-color: #f59e0b; color: #b45309; }
.tao-flag-btn:focus-visible { outline: 2px solid #f59e0b; outline-offset: 2px; }
.tao-flag-btn .tao-flag-icon { font-size: 0.95rem; line-height: 1; }

/* Pressed state. `aria-pressed` is the source of truth for assistive
   technology and `.is-flagged` for the paint, and both are set together. */
.tao-flag-btn.is-flagged {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #92400e;
}

/* The navigation strip's own marker. A flagged question keeps whatever it
   already says about being answered, unanswered or current -- the flag is an
   EXTRA signal and never replaces one -- so it is drawn as a ring plus a
   small corner dot rather than by recolouring the button. */
.q-dot-flagged {
    position: relative;
    box-shadow: 0 0 0 2px #f59e0b;
}
.q-dot-flagged::after {
    content: "";
    position: absolute;
    top: -3px;
    right: -3px;
    width: 7px;
    height: 7px;
    border-radius: 9999px;
    background: #f59e0b;
    border: 1px solid #fff;
}

/* The OVERVIEW counter beside the strip: how many are flagged, and a way back
   to them. Hidden entirely at zero, so a candidate who never flags anything
   sees no new chrome at all. */
.tao-flag-overview {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.55rem;
    border: 1px solid #fcd34d;
    border-radius: 9999px;
    background: #fffbeb;
    color: #92400e;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.tao-flag-overview:hover { background: #fef3c7; }
.tao-flag-overview[hidden] { display: none; }
