/* Exam mode (code_exam): the three-style code blocks and the spec chips in lessons, /gcse/ and /gcse/practice/.
   /gcse/ and the practice are full-screen focused flows like Daily 5: no site header or footer, the X at the top left,
   one big button pinned at thumb reach. Tokens from site.css (light and dark). Selected states are a fill or a full
   outline, never a one-sided border. Every control is at least 44px. */

/* ---------- three styles (OCR, AQA, Python) ---------- */
.xl { margin: 12px 0; }
.xl-tabs { display: inline-flex; gap: 4px; margin: 0 0 6px; padding: 3px; border-radius: 12px; background: var(--paper-2); }
.xl-tabs button { min-width: 64px; min-height: 40px; padding: 0 12px; border: 0; border-radius: 9px; background: none; color: var(--ink-2); font: 650 14px/1 var(--font); cursor: pointer; }
.xl-tabs button[aria-pressed="true"] { background: var(--paper-0); color: var(--ink); box-shadow: 0 0 4px rgba(21, 54, 90, .2); }
.xl-tabs button:focus-visible { outline: 3px solid var(--teal-text); outline-offset: 1px; }
@media (pointer: coarse) { .xl-tabs button { min-height: 44px; } }
.xl .xl-pre { margin: 0; }
.xl .xl-pre:not([data-xl-l="py"]) { display: none; }
html[data-xl="erl"] .xl .xl-pre { display: none; } html[data-xl="erl"] .xl .xl-pre[data-xl-l="erl"] { display: block; }
html[data-xl="aqa"] .xl .xl-pre { display: none; } html[data-xl="aqa"] .xl .xl-pre[data-xl-l="aqa"] { display: block; }
.xl-see { margin: 10px 0 14px; }
.xl-see summary { display: inline-flex; align-items: center; min-height: 44px; color: var(--teal-text); font-weight: 650; cursor: pointer; }
.xl-own .xl-own-pre { margin: 0; }

/* ---------- the lesson's board points: one quiet item on the meta line, the rest folded at the end of the Learn steps ---------- */
.xs-m { display: none; }
html[data-xb="aqa8525"] .xs-m[data-xs-b="aqa8525"], html[data-xb="ocrj277"] .xs-m[data-xs-b="ocrj277"], html[data-xb="pe1cp2"] .xs-m[data-xs-b="pe1cp2"] { display: inline; }
.xs-more { margin: 16px 0 0; }
.xs-more summary { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-2); font-weight: 650; cursor: pointer; }
.xs-more summary:focus-visible { outline: 3px solid var(--teal-text); outline-offset: 2px; border-radius: 6px; }
.xs-more ul { margin: 0 0 6px; padding-left: 18px; color: var(--ink-2); }
.xs-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; }
.xs-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--teal-text); font-weight: 650; }

/* ---------- the focused flow ---------- */
body.page-fx { --top-h: 0px; }
body.page-fx .topbar, body.page-fx .site-foot, body.page-fx .blf, body.page-fx .cbl-tabs { display: none !important; }
.fx { min-height: 100dvh; }
.fx-top { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; min-height: 56px; padding: 6px 0; }
.fx-title { justify-self: center; font: 750 16px/1 var(--font); color: var(--ink); }
.fx-x { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; color: var(--ink-2); }
.fx-x:hover { background: var(--paper-2); color: var(--ink); }
.fx-x:focus-visible, .fx .btn:focus-visible { outline: 3px solid var(--teal-text); outline-offset: 2px; }
.fx-bar { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; justify-content: center; padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--paper) 70%, transparent); }
.fx-bar[hidden] { display: none; }
.fx-big { width: min(528px, calc(100vw - 32px)); min-height: 56px; justify-content: center; font-size: 18px; }
.fx-h { margin: 22px 0 10px; font-size: 18px; }
.fx-h1 { margin: 0; font-size: clamp(32px, 8vw, 44px); line-height: 1.05; }
.fx .coach.is-hero { --coach-w: clamp(96px, 26vw, 132px); flex-direction: column-reverse; align-items: center; gap: 6px; margin: 0; }
.fx .coach.is-hero .coach-tail { display: none; }
.fx .coach.is-hero .coach-say { position: relative; margin: 0 0 10px; max-width: 32ch; text-align: center; }

.fx-seq { display: flex; justify-content: center; gap: 10px; margin: 0; padding: 0; list-style: none; }
.fx-q { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; color: var(--ink-3); box-shadow: inset 0 0 0 1.5px var(--rule-2); pointer-events: none; }
.fx-q svg { width: 15px; height: 15px; }
.fx-q.is-cur { color: var(--teal-text); box-shadow: inset 0 0 0 2.5px var(--teal-text); }
.fx-q.is-ok { background: var(--teal); color: var(--teal-ink); box-shadow: none; }
.fx-q.is-help { background: var(--teal-tint); color: var(--teal-text); box-shadow: inset 0 0 0 1.5px var(--teal); }
.fx-q.is-again { background: var(--warn-bg); color: var(--warn-ink); box-shadow: inset 0 0 0 1.5px var(--warn-ink); }
.fx-mk { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--teal); color: var(--teal-ink); flex: none; }
.fx-mk svg { width: 15px; height: 15px; }

/* the board: one choice of three, filled when picked */
.xb { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; width: 100%; max-width: 420px; padding: 4px; border-radius: 14px; background: var(--paper-2); }
.xb button { min-height: 44px; border: 0; border-radius: 10px; background: none; color: var(--ink-2); font: 700 15px/1 var(--font); cursor: pointer; }
.xb button[aria-checked="true"] { background: var(--teal); color: var(--teal-ink); }
.xb button:focus-visible { outline: 3px solid var(--teal-text); outline-offset: 1px; }

/* ---------- /gcse/ ---------- */
/* the bottom padding: the pinned bar (56px button + 26px) + the safe area + 16px, so nothing ends under it */
.xg { max-width: 760px; margin: 0 auto; padding: 0 16px calc(98px + env(safe-area-inset-bottom)); }
.xg-hero { display: flex; justify-content: center; margin: 4px 0 14px; }
.xg .xb { margin: 0 auto; }
/* rows that always fill: the tiles grow, so a last tile on its own spans the row instead of sitting orphaned */
.xg-tiles { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.xg-tiles > li { flex: 1 1 140px; display: flex; }
.xg-tile { position: relative; display: grid; justify-items: center; align-content: start; gap: 4px; width: 100%; min-height: 104px; padding: 12px 6px 10px; border: 0; border-radius: var(--r1);
  background: var(--paper-2); color: var(--ink); text-align: center; cursor: pointer; }
.xg-tile:hover { background: var(--key-2-hover); }
.xg-tile:focus-visible { outline: 3px solid var(--teal-text); outline-offset: 2px; }
.xg-tile.is-open { box-shadow: inset 0 0 0 2px var(--teal-text); }
.xg-ring { width: 34px; height: 34px; border-radius: 50%; background: conic-gradient(var(--teal) calc(var(--f) * 360deg), var(--paper-3) 0); -webkit-mask: radial-gradient(circle, transparent 10px, #000 11px); mask: radial-gradient(circle, transparent 10px, #000 11px); }
.xg-tile.is-full .xg-ring { -webkit-mask: none; mask: none; background: var(--teal); }
.xg-code { font: 750 14px/1 var(--mono); color: var(--ink); }
.xg-name { font: 600 12.5px/1.2 var(--font); color: var(--ink-3); }
.xg-detail { margin: 10px 0 0; padding: 12px 14px; border-radius: var(--r1); background: var(--paper-0); box-shadow: var(--shadow); }
.xg-dh { margin: 0 0 6px; }
.xg-detail ul { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.xg-detail a, .xg-steps a { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); text-decoration: none; }
.xg-dot { width: 14px; height: 14px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--rule-2); }
.is-done > a .xg-dot { background: var(--teal); box-shadow: none; }
.is-next > a .xg-dot { box-shadow: inset 0 0 0 3px var(--teal-text); }
.xg-prac { display: flex; align-items: center; gap: 14px; margin: 18px 0 0; padding: 14px; border-radius: var(--r2); background: var(--paper-0); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
.xg-prac:focus-visible { outline: 3px solid var(--teal-text); outline-offset: 2px; }
.xg-prac-art { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 12px; background: var(--slab); color: var(--slab-ink); font: 700 14px/1 var(--mono); }
.xg-prac-art span:nth-child(3) { color: var(--t-python); }
.xg-prac-t { display: grid; gap: 3px; font-weight: 750; }
.xg-prac-t span { color: var(--ink-3); font-weight: 550; font-size: 14px; }
.xg-steps { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.xg-steps a { padding: 4px 8px; border-radius: 12px; }
.xg-steps a:hover { background: var(--paper-2); }
.xg-steps a:focus-visible { outline: 3px solid var(--teal-text); outline-offset: 1px; }
.xg-st { display: grid; gap: 2px; flex: 1; min-width: 0; }
.xg-st b { font-weight: 650; overflow-wrap: anywhere; }
.xg-st span { color: var(--ink-3); font-size: 13.5px; }
.xg-codes { color: var(--ink-3); font: 600 12.5px/1 var(--mono); white-space: nowrap; }
.is-next > a { background: var(--teal-tint); }
@media (max-width: 420px) { .xg-codes { display: none; } }

/* ---------- /gcse/practice/ ---------- */
.xp .env { padding-bottom: 0; }
.xp .env-text { display: flex; flex-direction: column; min-height: 100dvh; padding: 0 16px calc(96px + env(safe-area-inset-bottom)); }
.xp.is-intro .env, .xp.is-result .env, .xp.is-trace .env { display: block; }
.xp.is-intro .env-code, .xp.is-result .env-code, .xp.is-trace .env-code { display: none; }
.xp.is-intro .env-text, .xp.is-result .env-text, .xp.is-trace .env-text { max-width: 640px; margin: 0 auto; }
.fx-screen { display: flex; flex-direction: column; flex: 1; }
.fx-screen[hidden] { display: none; }
.xp-intro, .xp-result { align-items: center; justify-content: center; gap: 18px; text-align: center; padding-bottom: 6vh; }
.fx-hero { display: flex; justify-content: center; width: 100%; }
.xp-item { gap: 6px; padding-top: 8px; }
.xp-item .sk-stage { display: inline-flex; align-items: center; gap: 6px; }
.xp-ask { margin: 0; color: var(--ink-2); }
.xp-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.xp-acts .btn { min-height: 44px; }
.xp-answer { margin-top: 10px; }
.xp-ah { margin: 0 0 4px; font-weight: 700; color: var(--teal-text); }
.xt { width: 100%; border-collapse: separate; border-spacing: 4px; margin: 6px -4px 0; }
.xt th { padding: 6px 4px; border-radius: 8px; background: var(--paper-2); color: var(--ink); font: 700 14px/1 var(--mono); }
.xt td { padding: 0; }
.xt-in { width: 100%; min-width: 0; height: 44px; padding: 0 8px; border: 1.5px solid var(--rule-2); border-radius: 10px; background: var(--paper-0); color: var(--ink); font: 600 16px/1 var(--mono); text-align: center; }
.xt-in:focus-visible { outline: 3px solid var(--teal-text); outline-offset: 1px; }
.xt-in.is-ok { border-color: var(--teal); background: var(--teal-tint); }
.xt-in.is-no { border-color: var(--warn-ink); background: var(--warn-bg); }
.xt-in.is-shown { border-color: var(--rule-2); background: var(--paper-2); }
.xp-res { display: grid; gap: 6px; width: 100%; margin: 0; padding: 0; list-style: none; text-align: start; }
.xp-res li { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 10px; border-radius: 12px; background: var(--paper-2); }
.xp-res .is-help .fx-mk { background: var(--teal-tint); color: var(--teal-text); box-shadow: inset 0 0 0 1.5px var(--teal); }
.xp-res .is-again .fx-mk { background: var(--warn-bg); color: var(--warn-ink); box-shadow: inset 0 0 0 1.5px var(--warn-ink); }
.xp-rt { flex: 1; font-weight: 650; }
.xp-rl { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; color: var(--teal-text); font-weight: 650; }
.xp-result:focus { outline: none; }
@media (max-width: 899.98px) { .xp.is-translate .env-text { min-height: 0; padding-bottom: 12px; } }
@media (min-width: 900px) { .xp.is-item .env-text { padding-bottom: 32px; } .fx-bar-item { position: static; justify-content: start; padding: 16px 0 0; background: none; } .fx-bar-item .fx-big { width: auto; min-width: 220px; } }

/* phones: room under the editor for the pinned Next */
@media (max-width: 899.98px) { .xp.is-translate .env { padding-bottom: calc(96px + env(safe-area-inset-bottom)); } }

/* the bubble's tail: two filled triangles (the outline, then the bubble), no one-sided border */
.fx .coach.is-hero .coach-say::before { content: ""; position: absolute; left: 50%; width: 18px; height: 10px; transform: translateX(-50%); clip-path: polygon(0 0, 100% 0, 50% 100%); bottom: -10px; background: var(--outline); }
.fx .coach.is-hero .coach-say::after { content: ""; position: absolute; left: 50%; transform: translateX(-50%); clip-path: polygon(0 0, 100% 0, 50% 100%); bottom: -7px; width: 14px; height: 8px; background: var(--bub-bg); }

/* a heading or panel focused by script (tabindex -1, for screen readers) shows no ring */
.fx [tabindex="-1"]:focus, .fx [tabindex="-1"]:focus-visible { outline: none; }
