/* ------------------------------------------------------------------ Test shell styles */
:root {
  --font: "Open Sans", Arial, Helvetica, sans-serif;
  --bg: #f3f5f7;
  --card: #ffffff;
  --text: #1d2730;
  --muted: #5b6874;
  --line: #d5dce3;
  --accent: #1f5f99;
  --accent-dark: #174a78;
  --accent-soft: #e8f1fa;
  --prompt-bg: #eef4fa;
  --ok: #2f7d4f;
  --ok-soft: #eaf6ee;
  --bad: #b83232;
  --bad-soft: #fbeeee;
  --part: #a35f00;
  --part-soft: #fdf4e3;
  --warn: #9a6200;
  --flag: #c77700;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 32, .06), 0 2px 8px rgba(16, 24, 32, .04);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.5; }
h1, h2 { line-height: 1.25; }
button { font-family: var(--font); }
a { color: var(--accent); }
.t-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.t-loading { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 4rem 1rem; text-align: center; color: var(--muted); }
/* spinner: a ring with one coloured arc; it appears only after a short delay, so fast loads don't flash it */
.t-loading::before {
  content: ""; width: 2.75rem; height: 2.75rem; box-sizing: border-box; border-radius: 50%;
  border: 4px solid var(--accent-soft); border-top-color: var(--accent);
  animation: t-spin .8s linear infinite, t-fadein .2s ease-out .15s both;
}
@keyframes t-spin { to { transform: rotate(360deg); } }
@keyframes t-fadein { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .t-loading::before { animation: t-pulse 1.6s ease-in-out infinite; border-color: var(--accent); }
}
@keyframes t-pulse { 50% { opacity: .35; } }

/* ------------------------------------------------------------------ buttons */
.t-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 2.6rem; padding: .5rem 1.15rem; font-size: .98rem; font-weight: 600; color: var(--accent); background: #fff; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.t-btn:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.t-btn:focus-visible, .t-pq:focus-visible, .t-flag:focus-visible, .t-x:focus-visible { outline: 3px solid rgba(31, 95, 153, .35); outline-offset: 2px; }
.t-btn:disabled { opacity: .45; cursor: not-allowed; }
.t-btn-primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.t-btn-primary:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.t-btn-ghost { background: transparent; }
a.t-btn { text-decoration: none; }
.t-btn-lg { min-height: 3rem; padding: .6rem 2rem; font-size: 1.05rem; }

/* ------------------------------------------------------------------ cards & pages */
.t-page { min-height: 100vh; padding: 3rem 1rem; display: flex; justify-content: center; align-items: flex-start; }
.t-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.t-start, .t-results, .t-error { width: 100%; max-width: 760px; padding: 2.25rem 2.5rem; }
.t-eyebrow { margin: 0 0 .4rem; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.t-start h1, .t-results h1 { margin: 0 0 .5rem; font-size: 1.7rem; font-weight: 700; }
.t-start h2, .t-results h2 { margin: 2rem 0 .75rem; font-size: 1.1rem; }
.t-subtitle { margin: 0 0 .5rem; font-size: 1.1rem; color: var(--muted); }
.t-desc { margin: .5rem 0 0; color: var(--muted); }
.t-details { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 1.75rem 0 1rem; background: var(--line); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.t-details-4 { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.t-details > div { background: #fafbfc; padding: .9rem 1rem; }
.t-details dt { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.t-details dd { margin: .2rem 0 0; font-size: 1.45rem; font-weight: 700; }
.t-details dd small { font-size: .85rem; font-weight: 400; color: var(--muted); }
.t-details dd.is-ok { color: var(--ok); }
.t-details dd.is-bad { color: var(--bad); }
.t-details dd.is-part { color: var(--part); }
.t-facts { margin: 0; padding: 0; list-style: none; }
.t-facts li { position: relative; padding: .2rem 0 .2rem 1.5rem; color: var(--text); }
.t-facts li::before { content: ""; position: absolute; left: .25rem; top: .75rem; width: .45rem; height: .45rem; border-radius: 50%; background: var(--accent); }
.t-instr { margin: 0; padding-left: 1.25rem; color: var(--text); }
.t-instr li { margin: .3rem 0; }
.t-start-actions { margin-top: 2rem; }
.t-error h1 { color: var(--bad); font-size: 1.4rem; margin-top: 0; }
.t-error pre { background: #f4f6f8; padding: .6rem .9rem; border-radius: 4px; }

/* ------------------------------------------------------------------ landing page */
.t-page-home { padding-top: 1.75rem; padding-bottom: 1.75rem; }
.t-home { width: 100%; max-width: 1120px; }
.t-home-head { margin-bottom: 1.1rem; }
.t-home-head .t-eyebrow { margin-bottom: .2rem; }
.t-home-head h1 { margin: 0 0 .3rem; font-size: 1.6rem; font-weight: 700; }
.t-home-intro { margin: 0; max-width: 720px; color: var(--muted); font-size: .95rem; }
.t-home-group + .t-home-group { margin-top: 1.25rem; }
.t-home-group h2 { margin: 0 0 .6rem; font-size: .95rem; font-weight: 600; color: var(--muted); padding-bottom: .35rem; border-bottom: 1px solid var(--line); }
.t-home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: .8rem; }
.t-tcard { display: flex; flex-direction: column; padding: .85rem 1rem .75rem; color: inherit; text-decoration: none; border-top: 3px solid var(--accent); transition: box-shadow .15s, transform .15s, border-color .15s; }
.t-tcard { position: relative; }
.t-tcard:hover { box-shadow: 0 6px 18px rgba(16, 24, 32, .1); transform: translateY(-2px); }
.t-tcard:has(.t-tcard-go:focus-visible) { outline: 3px solid rgba(31, 95, 153, .35); outline-offset: 2px; }
.t-tcard-go { text-decoration: none; }
.t-tcard-go:focus-visible { outline: none; }
.t-tcard-go::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.t-tcard-share { position: relative; z-index: 1; margin-left: auto; padding: .2rem .6rem; font: inherit; font-size: .8rem; font-weight: 600; color: var(--accent); background: #fff; border: 1px solid var(--line); border-radius: 5px; cursor: pointer; }
.t-tcard-share:hover { border-color: var(--accent); background: var(--accent-soft); }
.t-tcard-share:focus-visible { outline: 3px solid rgba(31, 95, 153, .35); outline-offset: 1px; }
.t-tcard-share + .t-tcard-go { margin-left: .6rem; }
.t-tcard-kicker { font-size: .7rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-tcard h3 { margin: .1rem 0 .3rem; font-size: 1.08rem; line-height: 1.3; }
.t-tcard-desc { margin: 0 0 .6rem; font-size: .86rem; line-height: 1.4; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.t-tcard-meta { display: flex; flex-wrap: wrap; gap: .2rem .9rem; margin: auto 0 .55rem; padding: 0; list-style: none; font-size: .84rem; color: var(--muted); }
.t-tcard-meta strong { color: var(--text); font-size: .95rem; }
.t-tcard-foot { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem; padding-top: .55rem; border-top: 1px solid #edf0f3; }
.t-tag { font-size: .72rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: .1rem .55rem; }
.t-tag.is-practice { color: var(--ok); background: var(--ok-soft); }
.t-tcard-go { margin-left: auto; font-weight: 700; font-size: .88rem; color: var(--accent); }
a.t-tcard:hover .t-tcard-go { text-decoration: underline; }
.t-tcard.is-missing { border-top-color: var(--bad); }
.t-home-link { display: inline-block; margin-bottom: 1rem; font-size: .9rem; font-weight: 600; text-decoration: none; }
.t-home-link:hover { text-decoration: underline; }
@media (max-width: 640px) { .t-page-home { padding-top: 1rem; } .t-home-head h1 { font-size: 1.35rem; } }

/* ------------------------------------------------------------------ test layout */
.t-shell { min-height: 100vh; display: flex; flex-direction: column; }
.t-top { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); }
.t-top-in { max-width: 960px; margin: 0 auto; padding: .6rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.t-title { font-weight: 600; font-size: .98rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.t-top-right { display: flex; align-items: center; gap: .75rem; flex: none; }
.t-top .t-btn { min-height: 2.25rem; padding: .35rem .9rem; font-size: .92rem; }
.t-timer { display: inline-flex; align-items: center; gap: .35rem; font-variant-numeric: tabular-nums; font-weight: 600; font-size: .95rem; color: var(--text); }
.t-timer svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.t-timer-rec { color: var(--muted); font-weight: 400; }
.t-timer.is-over { color: var(--warn); }
.t-badge { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); background: var(--accent-soft); padding: .2rem .55rem; border-radius: 4px; }
.t-progress { height: 4px; background: #e7ebef; }
.t-progress-bar { height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.is-review .t-progress { display: none; }

.t-main { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 1.5rem 1rem 6.5rem; }
.t-qcard { padding: 1.75rem 2rem 2rem; }
.t-qhead { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-bottom: 1rem; margin-bottom: 1.25rem; border-bottom: 1px solid #edf0f3; }
.t-qnum { margin: 0; font-size: 1.25rem; font-weight: 700; outline: none; }
.t-of { font-weight: 400; color: var(--muted); font-size: 1rem; }
.t-qmeta { display: flex; align-items: center; gap: .75rem; }
.t-marks { font-size: .88rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: .1rem .65rem; }
.t-flag { display: inline-flex; align-items: center; gap: .3rem; font-size: .88rem; font-weight: 600; color: var(--muted); background: none; border: 1px solid transparent; border-radius: 6px; padding: .25rem .5rem; cursor: pointer; }
.t-flag:hover { border-color: var(--line); }
.t-flag svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.t-flag.is-on { color: var(--flag); }
.t-flag.is-on svg { fill: currentColor; }
.t-qbody { min-height: 10rem; overflow-x: auto; }
.t-qerror { color: var(--bad); }
.t-qactions:not(:empty) { margin-top: 1.5rem; display: flex; gap: .75rem; }

/* feedback */
.t-feedback:not(:empty) { margin-top: 1.5rem; }
.t-fb { border: 1px solid; border-left-width: 5px; border-radius: 6px; padding: .9rem 1.1rem; }
.t-fb p { margin: .45rem 0 0; }
.t-fb.is-ok { border-color: var(--ok); background: var(--ok-soft); }
.t-fb.is-bad { border-color: var(--bad); background: var(--bad-soft); }
.t-fb.is-part { border-color: var(--part); background: var(--part-soft); }
.t-fb.is-part .t-fb-head { color: var(--part); }
.t-fb.is-part .t-fb-icon { background: var(--part); }
.t-fb-head { display: flex; align-items: center; gap: .5rem; }
.t-fb.is-ok .t-fb-head { color: var(--ok); }
.t-fb.is-bad .t-fb-head { color: var(--bad); }
.t-fb-icon { display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; color: #fff; font-size: .85rem; font-weight: 700; }
.t-fb.is-ok .t-fb-icon { background: var(--ok); }
.t-fb.is-bad .t-fb-icon { background: var(--bad); }
.t-fb-score { margin-left: auto; font-size: .88rem; font-weight: 600; }
.t-fb-hint { font-style: italic; }
.t-fb-exp { padding-top: .45rem; border-top: 1px solid rgba(0, 0, 0, .08); }
.t-fb-retry { font-weight: 600; color: var(--text); }
.t-fb-note { font-size: .85rem; color: var(--muted); }

/* bottom navigation */
.t-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); }
.t-nav-in { max-width: 960px; margin: 0 auto; padding: .7rem 1rem; display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.t-nav .t-btn { min-width: 8rem; }

/* question palette */
.t-palette { position: fixed; inset: 0; z-index: 30; background: rgba(16, 24, 32, .35); display: flex; align-items: flex-end; justify-content: center; padding: 1rem; }
.t-palette[hidden] { display: none; }
.t-palette-in { width: 100%; max-width: 640px; max-height: 80vh; overflow: auto; background: #fff; border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0, 0, 0, .18); padding: 1.1rem 1.25rem 1.25rem; margin-bottom: 4rem; }
.t-palette-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
.t-palette-head h2 { margin: 0; font-size: 1.05rem; }
.t-x { width: 2rem; height: 2rem; font-size: 1.5rem; line-height: 1; color: var(--muted); background: none; border: none; border-radius: 4px; cursor: pointer; }
.t-palette-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(2.6rem, 1fr)); gap: .45rem; }
.t-pq { position: relative; height: 2.6rem; font-size: .92rem; font-weight: 600; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.t-pq:hover { border-color: var(--accent); }
.t-pq.is-ans { background: var(--accent-soft); border-color: #a9c4de; }
.t-pq.is-ok { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.t-pq.is-bad { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.t-pq.is-part { background: var(--part-soft); border-color: var(--part); color: var(--part); }
.t-pq.is-cur { box-shadow: 0 0 0 2px var(--accent); }
.t-pq.is-flag::after { content: ""; position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--flag); }
.t-legend { display: flex; flex-wrap: wrap; gap: .5rem 1.1rem; margin-top: 1rem; font-size: .82rem; color: var(--muted); }
.t-legend i { display: inline-block; width: .85rem; height: .85rem; margin-right: .35rem; vertical-align: -2px; border-radius: 3px; border: 1px solid var(--line); }
.t-legend .lg-cur { box-shadow: 0 0 0 2px var(--accent); border-color: #fff; }
.t-legend .lg-ans { background: var(--accent-soft); border-color: #a9c4de; }
.t-legend .lg-flag { background: var(--flag); border-radius: 50%; border-color: var(--flag); }
.t-legend .lg-ok { background: var(--ok-soft); border-color: var(--ok); }
.t-legend .lg-bad { background: var(--bad-soft); border-color: var(--bad); }

/* modal */
.t-modal { position: fixed; inset: 0; z-index: 40; background: rgba(16, 24, 32, .4); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.t-modal-box { width: 100%; max-width: 440px; background: #fff; border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0, 0, 0, .2); padding: 1.5rem; }
.t-modal-box h2 { margin: 0 0 .5rem; font-size: 1.2rem; }
.t-modal-body p { margin: .4rem 0; }
.t-warn { color: var(--warn); font-weight: 600; }
.t-modal-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.25rem; }

/* results */
.t-score { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1.25rem; margin: 1.5rem 0 0; }
.t-score-main { display: flex; align-items: baseline; gap: .35rem; }
.t-score-n { font-size: 2.8rem; font-weight: 700; color: var(--accent); line-height: 1; }
.t-score-d { font-size: 1.4rem; font-weight: 600; color: var(--muted); }
.t-score-l { font-size: .95rem; color: var(--muted); }
.t-score-bar { height: 10px; border-radius: 999px; background: #e7ebef; overflow: hidden; }
.t-score-bar > div { height: 100%; background: var(--accent); border-radius: 999px; }
.t-score-pct { font-size: 1.3rem; font-weight: 700; }
.t-res-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.5rem; }
.t-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; }
.t-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.t-table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #fafbfc; padding: .6rem .75rem; border-bottom: 1px solid var(--line); }
.t-table td { padding: .55rem .75rem; border-bottom: 1px solid #edf0f3; vertical-align: top; }
.t-table tr:last-child td { border-bottom: none; }
.t-rn { font-weight: 700; width: 2.5rem; }
.t-rq span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.t-rm, .t-ra { white-space: nowrap; text-align: center; }
.t-rv { text-align: right; white-space: nowrap; }
.t-st { font-weight: 600; white-space: nowrap; }
.t-st.is-ok { color: var(--ok); }
.t-st.is-bad { color: var(--bad); }
.t-st.is-part { color: var(--part); }
.t-st.is-none { color: var(--muted); }

/* ------------------------------------------------------------------ small screens */
@media (max-width: 640px) {
  .t-page { padding: 1rem; }
  .t-start, .t-results, .t-error { padding: 1.5rem 1.25rem; }
  .t-start h1, .t-results h1 { font-size: 1.35rem; }
  .t-details, .t-details-4 { grid-template-columns: repeat(2, 1fr); }
  .t-details > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .t-main { padding: 1rem .75rem 6rem; }
  .t-qcard { padding: 1.25rem 1rem 1.5rem; }
  .t-qhead { flex-wrap: wrap; }
  .t-nav .t-btn { min-width: 0; padding: .5rem .8rem; }
  .t-title { font-size: .88rem; }
  .t-timer-rec { display: none; }
  .t-score { grid-template-columns: 1fr auto; }
  .t-score-bar { grid-column: 1 / -1; grid-row: 2; }
  .t-ra { display: none; }
}
@media print {
  .t-nav, .t-top, .t-palette { display: none !important; }
  body { background: #fff; }
}

/* ------------------------------------------------------------------ curriculum areas (results) */
.t-code { display: inline-block; min-width: 3.2rem; padding: .05rem .4rem; font-size: .78rem; font-weight: 700; text-align: center; color: var(--accent-dark); background: var(--accent-soft); border: 1px solid #c4d7ea; border-radius: 4px; white-space: nowrap; }
.t-practise { font-size: .85rem; font-weight: 600; white-space: nowrap; }
.t-focus { margin: 0 0 1.25rem; padding: 1rem 1.15rem; background: var(--part-soft); border: 1px solid #f0d9ae; border-radius: 6px; }
.t-focus h3 { margin: 0 0 .5rem; font-size: 1rem; }
.t-focus ul { list-style: none; margin: 0 0 .9rem; padding: 0; }
.t-focus li { display: flex; align-items: baseline; gap: .6rem; padding: .3rem 0; border-bottom: 1px solid #f3e4c6; font-size: .92rem; }
.t-focus li:last-child { border-bottom: none; }
.t-focus-d { flex: 1; }
.t-focus-m { font-weight: 700; color: var(--part); white-space: nowrap; }
.t-focus-none { color: var(--ok); font-weight: 600; }
.t-areas { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.t-area + .t-area { border-top: 1px solid var(--line); }
.t-area > summary { display: grid; grid-template-columns: 1fr minmax(80px, 160px) 3.5rem 3rem; align-items: center; gap: .85rem; padding: .65rem .9rem; cursor: pointer; list-style: none; }
.t-area > summary::-webkit-details-marker { display: none; }
.t-area > summary::before { content: "\25B8"; position: absolute; margin-left: -.75rem; color: var(--muted); font-size: .8rem; }
.t-area[open] > summary::before { content: "\25BE"; }
.t-area > summary { position: relative; padding-left: 1.5rem; }
.t-area > summary:hover { background: #fafbfc; }
.t-area-name { font-weight: 600; font-size: .95rem; }
.t-area-name small { font-weight: 400; color: var(--muted); }
.t-area-bar { height: 8px; border-radius: 999px; background: #e7ebef; overflow: hidden; }
.t-area-bar > span { display: block; height: 100%; border-radius: 999px; }
.t-area-bar.is-ok > span { background: var(--ok); }
.t-area-bar.is-part > span { background: var(--part); }
.t-area-bar.is-bad > span { background: var(--bad); }
.t-area-m { text-align: right; font-size: .9rem; white-space: nowrap; }
.t-area-p { text-align: right; font-weight: 700; font-size: .9rem; }
.t-codes { width: 100%; border-collapse: collapse; font-size: .88rem; background: #fafbfc; border-top: 1px solid #edf0f3; }
.t-codes td { padding: .5rem .9rem; border-top: 1px solid #edf0f3; vertical-align: top; }
.t-codes tr:first-child td { border-top: none; }
.t-codes td:first-child { width: 4.5rem; padding-left: 1.5rem; }
.t-codes-q { margin-top: .15rem; font-size: .8rem; color: var(--muted); }
.t-codes-m { font-weight: 700; white-space: nowrap; text-align: right; }
.t-codes-m.is-ok { color: var(--ok); } .t-codes-m.is-part { color: var(--part); } .t-codes-m.is-bad { color: var(--bad); }
.t-codes-a { text-align: right; width: 7rem; }
.t-areas-note { margin: .6rem 0 0; font-size: .82rem; color: var(--muted); }

/* ------------------------------------------------------------------ curriculum search (finder) */
.t-home-search { margin-top: .75rem; }
.t-btn-sm { min-height: 2.1rem; padding: .3rem .8rem; font-size: .88rem; }
.t-linkbtn { padding: 0; font: inherit; font-size: .88rem; font-weight: 600; color: var(--accent); background: none; border: 0; cursor: pointer; text-decoration: underline; }
.t-code.is-sec { color: var(--muted); background: #f3f5f7; border-style: dashed; border-color: var(--line); }
.t-finder { display: flex; flex-direction: column; height: 100vh; }
.t-finder-head { display: flex; align-items: baseline; gap: 1.25rem; padding: .75rem 1.25rem; background: var(--card); border-bottom: 1px solid var(--line); }
.t-finder-head .t-home-link { margin: 0; }
.t-finder-head h1 { margin: 0; font-size: 1.2rem; }
.t-finder-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; }
.t-finder-left { min-height: 0; display: grid; grid-template-rows: auto minmax(0, var(--tree-h, 1fr)) auto minmax(0, 1fr); border-right: 1px solid var(--line); background: var(--card); }
.t-split { position: relative; height: 10px; margin: -5px 0; z-index: 2; cursor: row-resize; touch-action: none; }
.t-split span { position: absolute; left: 0; right: 0; top: 4px; height: 2px; background: var(--line); transition: background .12s, height .12s, top .12s; }
.t-split span::after { content: ""; position: absolute; left: 50%; top: -3px; width: 36px; height: 8px; margin-left: -18px; border-radius: 4px; background: #c3ccd5; }
.t-split:hover span, .t-split.is-drag span, .t-split:focus-visible span { top: 3px; height: 4px; background: var(--accent); }
.t-split:hover span::after, .t-split.is-drag span::after, .t-split:focus-visible span::after { background: var(--accent); }
.t-split:focus-visible { outline: none; }
.t-finder.is-dragging { user-select: none; }
.t-finder-filters { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem 1rem; padding: .7rem 1rem; border-bottom: 1px solid var(--line); font-size: .88rem; }
.t-finder-filters select { min-height: 2.2rem; padding: .25rem .5rem; font: inherit; border: 1px solid var(--line); border-radius: 6px; background: #fff; max-width: 100%; }
.t-finder-years { display: inline-flex; gap: .7rem; }
.t-finder-years label, .t-finder-opt { white-space: nowrap; color: var(--muted); cursor: pointer; }
.t-finder-tree { overflow: auto; padding: .4rem .5rem .6rem; }
.t-finder-tree ul { list-style: none; margin: 0; padding: 0; }
.t-finder-tree ul ul { padding-left: 1.35rem; }
.t-tn-row { display: flex; align-items: center; }
.t-tn-row label, .t-tn-leaf label { display: flex; align-items: baseline; gap: .45rem; flex: 1; min-width: 0; padding: .28rem .4rem; border-radius: 4px; cursor: pointer; }
.t-tn-row label:hover, .t-tn-leaf label:hover { background: #f3f7fb; }
.t-tn-row input, .t-tn-leaf input { flex: none; transform: translateY(1px); }
.t-tn-tog { flex: none; width: 1.6rem; height: 1.6rem; padding: 0; font-size: .8rem; color: var(--muted); background: none; border: 0; border-radius: 4px; cursor: pointer; }
.t-tn-tog:hover { background: #eef2f6; color: var(--text); }
.t-tn-1 > .t-tn-row .t-tn-l { font-weight: 700; }
.t-tn-2 > .t-tn-row .t-tn-l { font-weight: 600; }
.t-tn-l, .t-tn-d { flex: 1; min-width: 0; }
.t-tn-d { font-size: .88rem; line-height: 1.35; }
.t-tn-leaf { margin-left: 1.6rem; }
.t-tn-leaf .t-code { flex: none; }
.t-tn-leaf.is-empty { color: var(--muted); }
.t-tn-n { flex: none; min-width: 1.8rem; padding: 0 .35rem; font-size: .75rem; font-weight: 700; text-align: center; color: var(--muted); background: #eef2f6; border-radius: 999px; }
.t-finder-none { padding: 1rem; color: var(--muted); }
.t-finder-hits { min-height: 0; display: flex; flex-direction: column; }
.t-finder-hits-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .55rem 1rem; background: #fafbfc; border-bottom: 1px solid var(--line); font-size: .9rem; font-weight: 600; }
.t-finder-hits-act { display: inline-flex; align-items: center; gap: .9rem; }
.t-finder-hits-act [hidden] { display: none; }
.t-hitlist { flex: 1; overflow: auto; list-style: none; margin: 0; padding: 0; }
.t-hit { display: block; width: 100%; padding: .55rem 1rem; font: inherit; text-align: left; color: inherit; background: none; border: 0; border-bottom: 1px solid #edf0f3; border-left: 3px solid transparent; cursor: pointer; }
.t-hit:hover { background: #f6f9fc; }
.t-hit.is-cur { background: var(--accent-soft); border-left-color: var(--accent); }
.t-hit-src { display: flex; justify-content: space-between; gap: .5rem; font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.t-hit-m { font-weight: 600; text-transform: none; letter-spacing: 0; }
.t-hit-s { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: .1rem 0 0; font-size: .92rem; }
.t-finder-right { min-height: 0; overflow: auto; padding: 1.25rem 1.5rem 2rem; }
.t-prev-empty { max-width: 420px; margin: 4rem auto; text-align: center; color: var(--muted); }
.t-prev-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .5rem; }
.t-prev-head .t-eyebrow { margin: 0; }
.t-prev-id { margin: .1rem 0 0; font-size: .85rem; color: var(--muted); }
.t-prev-codes { list-style: none; margin: 0 0 1rem; padding: 0; font-size: .86rem; }
.t-prev-codes li { margin: .2rem 0; }
.t-prev-codes small { color: var(--muted); }
.t-prev-card { padding: 1.5rem 1.75rem 1.25rem; }
.t-prev-card .t-feedback:empty { display: none; }
.t-prev-card .t-feedback { margin-top: 1rem; }
.t-prev-act { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }

@media (max-width: 900px) {
  .t-finder { height: auto; }
  .t-finder-body { grid-template-columns: 1fr; }
  .t-finder-left { grid-template-rows: auto; border-right: 0; }
  .t-split { display: none; }
  .t-finder-tree { max-height: 55vh; }
  .t-hitlist { max-height: 50vh; }
  .t-finder-right { border-top: 2px solid var(--line); padding: 1rem; }
}
@media (max-width: 640px) {
  .t-area > summary { grid-template-columns: 1fr 3.2rem 2.8rem; }
  .t-area-bar { grid-column: 1 / -1; grid-row: 2; }
  .t-codes td:first-child { padding-left: .9rem; }
  .t-codes-a { width: auto; }
  .t-focus li { flex-wrap: wrap; }
  .t-finder-head { flex-wrap: wrap; gap: .25rem; padding: .6rem 1rem; }
  .t-prev-card { padding: 1.1rem 1rem; }
}

/* ------------------------------------------------------------------ finder: question selection and share dialog */
.t-hit-all { display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; }
.t-hit-all input { margin: 0; }
.t-hitrow { display: flex; align-items: flex-start; border-bottom: 1px solid #edf0f3; border-left: 4px solid transparent; transition: background .12s; }
.t-hitrow .t-hit { flex: 1; min-width: 0; border-bottom: 0; border-left: 0; padding-right: .5rem; background: none; }
.t-hit-pick { flex: none; width: 1.4rem; height: 1.4rem; margin: .5rem 1rem 0 .25rem; accent-color: var(--ok); cursor: pointer; }
.t-hitrow:hover { background: #f6f9fc; }
.t-hitrow.is-picked { background: #dff1e5; border-left-color: var(--ok); }
.t-hitrow.is-picked:hover { background: #d3ebdb; }
.t-hitrow .t-hit.is-cur { background: none; }
.t-hitrow:has(.t-hit.is-cur) { box-shadow: inset 0 0 0 2px var(--accent); }
.t-hitrow:has(.t-hit.is-cur):not(.is-picked) { background: var(--accent-soft); }
.t-hit-all input { width: 1.4rem; height: 1.4rem; margin: 0 .05rem 0 .2rem; accent-color: var(--ok); display: block; }
.t-finder-hits-head { padding-right: 1rem; }
.t-share { max-width: 640px; position: relative; }
.t-share-x { position: absolute; top: .6rem; right: .6rem; }
.t-share-sum { margin: 0 0 1rem; color: var(--muted); }
.t-share-grid { display: grid; grid-template-columns: 1fr 240px; gap: 1.25rem; align-items: start; }
.t-share-form { display: grid; gap: .7rem; }
.t-share label { display: grid; gap: .25rem; font-size: .86rem; font-weight: 600; color: var(--muted); }
.t-share input[type=text], .t-share input[type=number], .t-share select { min-height: 2.3rem; padding: .3rem .55rem; font: inherit; font-weight: 400; color: var(--text); border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.t-share label.t-share-chk { display: flex; align-items: center; gap: .45rem; font-weight: 400; color: var(--text); }
.t-share-qr { display: flex; flex-direction: column; align-items: center; }
#t-sh-qr { width: 220px; height: 220px; display: flex; align-items: center; justify-content: center; background: #fafbfc; border: 1px solid var(--line); border-radius: 6px; padding: 8px; box-sizing: content-box; }
#t-sh-qr img, #t-sh-qr canvas { display: block; }
.t-share-qrnote { margin: .4rem 0 0; font-size: .8rem; color: var(--muted); text-align: center; }
.t-share-url { margin-top: 1.1rem; }
.t-share a.t-btn:not([href]), .t-share button:disabled { opacity: .5; pointer-events: none; }
.t-share-urlrow { display: flex; gap: .5rem; }
.t-share-urlrow input { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, Consolas, monospace !important; font-size: .82rem !important; }
.t-share-warn { margin: .6rem 0 0; padding: .55rem .75rem; font-size: .85rem; color: #6b4a00; background: var(--part-soft); border: 1px solid #f0d9ae; border-radius: 6px; }
@media (max-width: 640px) {
  .t-share-grid { grid-template-columns: 1fr; }
  .t-share-qr { order: -1; }
}

/* ------------------------------------------------------------------ print view (?print=1) */
body.t-printing { background: #e9edf1; }
.t-print-bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1rem; padding: .6rem 1.25rem; background: var(--card); border-bottom: 1px solid var(--line); }
.t-print-bar .t-home-link { margin: 0; }
.t-print-bar-t { font-weight: 700; margin-right: auto; }
.t-print-opt { font-size: .9rem; color: var(--muted); cursor: pointer; }
.t-print { max-width: 820px; margin: 1.5rem auto 3rem; padding: 2.5rem 3rem; background: #fff; color: #111; box-shadow: var(--shadow); }
.t-print-head { margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 2px solid #111; }
.t-print-head h1 { margin: 0; font-size: 1.6rem; }
.t-print-sub { margin: .15rem 0 0; font-size: 1.05rem; color: #333; }
.t-print-meta { margin: .4rem 0 0; font-size: .92rem; color: #444; }
.t-print-who { display: grid; grid-template-columns: auto 2fr auto 1fr auto 1fr; align-items: end; gap: .5rem; margin-top: 1.2rem; font-weight: 600; }
.t-print-who i { border-bottom: 1px solid #111; height: 1.4rem; }
.t-print-note { margin: .9rem 0 0; font-size: .92rem; }
.t-prq { position: relative; padding: 1.1rem 0 1.3rem 2.8rem; border-bottom: 1px solid #c9c9c9; break-inside: avoid; page-break-inside: avoid; }
.t-prq-head { position: absolute; left: 0; top: 1.1rem; right: 0; height: 0; }
.t-prq-n { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; font-weight: 700; color: #fff; background: #111; border-radius: 50%; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.t-prq-m { position: absolute; right: 0; top: .2rem; font-size: .82rem; font-weight: 700; padding: .05rem .5rem; border: 1px solid #111; border-radius: 3px; background: #fff; }
.t-prq .qroot { padding-right: 4.5rem; }
.t-print-key { display: none; }
.t-print.with-key .t-print-key { display: block; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 2px solid #111; }
.t-print-key h2 { margin: 0; font-size: 1.4rem; }
.t-pk { width: 100%; margin-top: 1rem; border-collapse: collapse; font-size: .88rem; }
.t-pk th, .t-pk td { padding: .45rem .55rem; border: 1px solid #bbb; text-align: left; vertical-align: top; }
.t-pk th { background: #f1f1f1; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.t-pk-n, .t-pk-m { width: 2.6rem; text-align: center !important; font-weight: 700; }
.t-pk-c { width: 7rem; font-size: .8rem; color: #444; }
.t-pk-note, .t-pk-script { margin: .3rem 0 0; font-size: .82rem; color: #444; }
.t-pk tr { break-inside: avoid; page-break-inside: avoid; }

/* question types on paper: borders instead of fills, no on-screen instructions or buttons */
.t-print .q-prompt { background: none; border-left: 3px solid #111; }
.t-print .q-aural, .t-print .q-help, .t-print .q-spell-bar, .t-print .q-nospeech, .t-print .q-spell-model, .t-print .q-model, .t-print .q-order-ans { display: none !important; }
.t-print input[type=text], .t-print input:not([type]), .t-print .q-sp, .t-print .q-field { background: #fff !important; }
.t-print textarea { background: #fff !important; resize: none; }

@media print {
  @page { margin: 14mm 14mm 16mm; }
  body.t-printing { background: #fff; }
  .t-print-bar { display: none !important; }
  .t-print { max-width: none; margin: 0; padding: 0; box-shadow: none; }
  .t-print.with-key .t-print-key { break-before: page; page-break-before: always; margin-top: 0; padding-top: 0; border-top: 0; }
  .t-prq { padding-top: .8rem; padding-bottom: 1rem; }
}
.t-print .q-match-help, .t-print .q-palette, .t-print .q-palette-label,
.t-print .q-match-clear, .t-print .q-ins-clear, .t-print .q-bar-clear, .t-print .q-gp-clear { display: none !important; }
.t-print .q-match { gap: 5rem; max-width: none; justify-content: flex-start; }
.t-print .q-bar-hit { fill: none !important; }
.t-print .q-part, .t-print .q-figure, .t-print svg, .t-print table, .t-print .q-options { break-inside: avoid; page-break-inside: avoid; }
.t-print .q-working { min-height: 9rem !important; border: 1px solid #888 !important; }
@media screen and (max-width: 640px) {
  .t-print { margin: 0; padding: 1.25rem 1rem; }
  .t-print-bar { flex-wrap: wrap; gap: .5rem; }
  .t-prq .qroot { padding-right: 0; }
  .t-prq-m { top: -.2rem; }
}
.t-finder-lbl { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-right: -.2rem; }

/* checkbox dropdown (builder filters) */
.t-ms { position: relative; }
.t-ms-btn { display: inline-flex; align-items: center; gap: .4rem; min-height: 2.2rem; padding: .25rem .6rem; font: inherit; font-size: .88rem; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.t-ms-btn:hover { border-color: var(--accent); }
.t-ms-btn:focus-visible { outline: 3px solid rgba(31, 95, 153, .35); outline-offset: 1px; }
.t-ms-l { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.t-ms-v { font-weight: 600; white-space: nowrap; max-width: 12rem; overflow: hidden; text-overflow: ellipsis; }
.t-ms.is-filtered .t-ms-btn { border-color: var(--accent); background: var(--accent-soft); }
.t-ms-c { font-size: .75rem; color: var(--muted); }
.t-ms-pop { position: absolute; left: 0; top: calc(100% + 4px); z-index: 30; min-width: 100%; padding: .35rem; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 18px rgba(16, 24, 32, .12); }
.t-ms-pop[hidden] { display: none; }
.t-ms-pop label { display: flex; align-items: center; gap: .5rem; padding: .3rem .5rem; font-size: .9rem; white-space: nowrap; border-radius: 4px; cursor: pointer; color: var(--text); }
.t-ms-pop label:hover { background: #f3f7fb; }
.t-ms-pop input { width: 1.05rem; height: 1.05rem; margin: 0; }
.t-ms-all { border-bottom: 1px solid #edf0f3; border-radius: 4px 4px 0 0 !important; margin-bottom: .2rem; font-weight: 600; }

/* ------------------------------------------------------------------ aural (teacher-read) questions */
.q-aural { display: flex; align-items: flex-start; gap: .9rem; margin: 0 0 1.1rem; padding: .8rem 1rem; background: var(--accent-soft); border-radius: 8px; }
.q-listen { flex: none; display: inline-flex; align-items: center; gap: .45rem; min-height: 2.6rem; padding: .45rem 1rem; font: inherit; font-weight: 600; color: #fff; background: var(--accent); border: 0; border-radius: 6px; cursor: pointer; }
.q-listen:hover { background: var(--accent-dark); }
.q-listen:disabled { opacity: .45; cursor: not-allowed; }
.q-listen svg { width: 1.15em; height: 1.15em; fill: currentColor; }
.q-aural-t { flex: 1; min-width: 0; }
.q-aural-t p { margin: .1rem 0; }
.q-aural-no { color: #8a5a00; font-size: .92rem; }
@media (max-width: 520px) { .q-aural { flex-direction: column; } }

/* ------------------------------------------------------------------ landing: key stage tabs */
.t-stages { display: flex; gap: .35rem; margin: 1.2rem 0 0; border-bottom: 2px solid var(--line); }
.t-stage-tab { display: flex; flex-direction: column; align-items: flex-start; gap: .05rem; margin-bottom: -2px; padding: .6rem 1.25rem .55rem; font: inherit; text-align: left; color: var(--muted); background: none; border: 2px solid transparent; border-bottom-color: var(--line); border-radius: 8px 8px 0 0; cursor: pointer; }
.t-stage-tab:hover { color: var(--text); background: #eef2f6; }
.t-stage-tab[aria-selected="true"] { color: var(--accent); background: var(--card); border-color: var(--line); border-bottom-color: var(--card); }
.t-stage-t { font-size: 1.05rem; font-weight: 700; }
.t-stage-s { font-size: .8rem; font-weight: 600; }
.t-stage-tab[aria-selected="true"] .t-stage-s { color: var(--muted); }
.t-stage { padding: 1.1rem 0 0; }
.t-stage:focus { outline: none; }
.t-stage:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.t-stage-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.25rem; margin-bottom: 1.1rem; }
.t-stage-head p { flex: 1 1 320px; margin: 0; max-width: 720px; color: var(--muted); font-size: .95rem; }
.t-stage-head .t-home-search { margin: 0; }
@media (max-width: 520px) { .t-stage-tab { flex: 1; padding: .55rem .8rem; } }
