/* Python IDE task page layout. The starting point is the Woodham Year 9 task page (its page CSS, unchanged), so the
 * two look the same. Colours come from the --bg-*, --text-* and --border-color tokens in app.css. */
body { overflow: hidden; display: flex; flex-direction: column; height: 100vh; margin: 0; }
.settings-panel { position: absolute; top: calc(100% + .4rem); right: 0; z-index: 20; min-width: 20rem; padding: .8rem 1rem; border-radius: 8px; background: var(--bg-secondary); border: 1px solid var(--border-color); box-shadow: 0 10px 30px rgba(0, 0, 0, .45); font-size: .95rem; }
.settings-panel[hidden] { display: none; }
.settings-panel h2 { font-size: 1rem; margin: 0 0 .6rem; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-top: 1px solid var(--border-color); cursor: default; }
.settings-row .stepper { display: inline-flex; align-items: center; gap: .4rem; }
.settings-row .stepper button { width: 2rem; height: 2rem; font: inherit; font-weight: 700; border-radius: 10px; cursor: pointer; color: var(--text-primary); background: var(--bg-tertiary); border: 1px solid var(--border-color); }
.settings-row .stepper button:disabled { opacity: .4; cursor: default; }
.settings-row .stepper output { min-width: 2ch; text-align: center; font-weight: 700; }
.settings-row input[type=checkbox] { width: 1.2rem; height: 1.2rem; accent-color: #16a34a; cursor: pointer; }
.settings-row.stack { flex-direction: column; align-items: stretch; gap: .45rem; }
.bg-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.bg-name { opacity: .6; } /* the name of the colour chosen: the circles carry no words */
.swatches { display: flex; justify-content: flex-start; gap: .65rem; align-items: center; padding: .35rem .3rem .5rem; } /* one gap in both rows, so the circles line up */
.swatches button { width: 2.3rem; height: 2.3rem; padding: 0; border-radius: 50%; display: grid; place-items: center; font: inherit; font-size: 1rem; line-height: 1; cursor: pointer; color: #000000; border: 1px solid var(--border-color); }
.swatches button[aria-checked="true"] { box-shadow: 0 0 0 3px var(--bg-secondary), 0 0 0 5px #16a34a; }
.swatches button[aria-checked="true"]::before { content: "\2713"; } /* the choice does not rest on colour alone */
/* Page theme: the same circles, each the colour of its page */
.swatches [data-page="dark"] { background: #1b2a6b; color: #ffffff; } /* bluer than the page itself, so it does not read as the black of High contrast */
.swatches [data-page="light"] { background: #f3f5fb; }
.swatches [data-page="cream"] { background: #f5edcf; }
.swatches [data-page="yellow"] { background: #fbeea0; }
.swatches [data-page="blue"] { background: #d3e8f8; }
.swatches [data-page="contrast"] { background: #000000; color: #ffffff; }
html.page-contrast .swatches button { border-color: #ffffff; }
.swatches [data-bg="white"] { background: #ffffff; }
.swatches [data-bg="dark"] { background: #1b2a6b; color: #ffffff; }
.swatches [data-bg="cream"] { background: #fdf6d8; }
.swatches [data-bg="yellow"] { background: #fff3b0; }
.swatches [data-bg="blue"] { background: #dbeefb; }
.swatches [data-bg="contrast"] { background: #000000; color: #ffffff; }
.settings-row > .lab-btn { flex: 1; margin: .25rem 0 0; padding: .45rem .6rem; border-radius: 10px; font-weight: 700; text-align: center; } /* Restore defaults: the fill and border of the stepper buttons */
.brief { position: relative; }
.brief .speak-btn, .q-panel .speak-btn { float: right; margin: 0 0 .3rem .6rem; width: 2.1rem; height: 2.1rem; display: flex; align-items: center; justify-content: center; font-size: 1rem; border-radius: 6px; cursor: pointer; color: var(--text-primary); background: var(--bg-tertiary); border: 1px solid var(--border-color); }
.brief p .speak-btn { float: none; display: inline-flex; vertical-align: middle; margin: 0 0 0 .5rem; }
.brief .speak-btn[hidden], .q-panel .speak-btn[hidden] { display: none; }
/* Read aloud is a setting, off unless turned on (Settings): no speaker anywhere without it */
html:not(.lab-speak) .speak-btn { display: none !important; }
/* Show help: the button in the instructions (the page theme's own colours), the drawer over the output side */
.brief .help-btn { float: right; margin: 0 0 .3rem .6rem; height: 2.1rem; padding: 0 .7rem; display: flex; align-items: center; gap: .4rem; font: inherit; font-size: .9rem; font-weight: 600; border-radius: 6px; cursor: pointer; color: var(--text-primary); background: var(--bg-tertiary); border: 1px solid var(--border-color); }
.brief .help-btn:hover { border-color: var(--text-secondary); }
.brief .help-btn[aria-expanded="true"] { background: #22c55e; border-color: #22c55e; color: #052e16; } /* Help or Key knowledge open: lit green (D, 7 Oct 2026) */
.help-drawer { position: absolute; top: 0; right: 0; bottom: 0; z-index: 12; /* under Settings (20), over the Shell (8) and Maximise (5) */ width: min(30rem, 100%); display: flex; flex-direction: column; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 8px; box-shadow: -12px 0 32px rgba(0, 0, 0, .45); font-size: var(--lab-font); line-height: 1.45; font-family: Consolas, "Courier New", monospace; } /* the editor's size and spacing, so it draws like the code */
.help-drawer[hidden] { display: none; }
.help-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .7rem 1rem; border-bottom: 1px solid var(--border-color); }
.help-head h2 { margin: 0; font-size: 1em; font-weight: 600; display: flex; gap: .5rem; align-items: center; }
.help-head h2 i { color: #60a5fa; }
.help-x { background: none; border: 0; color: var(--text-secondary); font-size: 1.15em; cursor: pointer; padding: .2rem .4rem; }
.help-x:hover { color: var(--text-primary); }
.help-body { padding: .8rem 1rem 1rem; overflow: auto; scrollbar-width: thin; scrollbar-color: rgba(148, 163, 184, .55) transparent; }
.help-body code { font-family: Consolas, "Courier New", monospace; font-size: 1em; }
.help-lead { margin: 0 0 .8rem; color: var(--text-secondary); }
.help-body a.lab-btn { display: inline-flex; text-decoration: none; font-family: inherit; }   /* Sign up, in the signed-out demo's Help (D, 2 Nov 2026) */
details.help-part { border: 1px solid var(--border-color); border-radius: 8px; margin: 0 0 .5rem; background: var(--bg-tertiary); }
details.help-part summary { list-style: none; cursor: pointer; padding: .55rem .8rem; font-weight: 400; display: flex; gap: .55rem; align-items: center; }
details.help-part summary::-webkit-details-marker { display: none; }
details.help-part summary:focus { outline: none; }
details.help-part summary:focus-visible { outline: 2px solid #60a5fa; outline-offset: -2px; border-radius: 8px; }
/* the drawer uses the editor's font: IDLE's, or the dyslexia font when that setting is on */
/* like the editor (IDLE): the pupil's Background colour with dark text, not white text on the dark page, which reads as bold */
.help-drawer { background: var(--lab-bg); color: #1a1a1a; border-color: rgba(0, 0, 0, .18); }
.help-drawer .help-head { border-bottom-color: rgba(0, 0, 0, .12); }
.help-drawer .help-head h2 { font-weight: 400; }
.help-drawer .help-head h2 i { color: #2563eb; }
.help-drawer .help-x { color: #555555; }
.help-drawer .help-x:hover { color: #000000; }
.help-drawer .help-lead, .help-drawer .help-lbl { color: #555555; }
.help-drawer details.help-part { background: rgba(0, 0, 0, .035); border-color: rgba(0, 0, 0, .15); }
.help-drawer details.help-part summary i.chev { color: #555555; }
.help-drawer .help-n { background: rgba(0, 0, 0, .1); color: #1a1a1a; }
.help-drawer .help-code { border: 1px solid rgba(0, 0, 0, .15); }
.lab-bg-contrast .help-drawer { color: #ffffff; border-color: #555555; }
.lab-bg-contrast .help-drawer .help-head, .lab-bg-contrast .help-drawer details.help-part { border-color: #555555; }
.lab-bg-contrast .help-drawer details.help-part { background: #141414; }
.lab-bg-contrast .help-drawer .help-lead, .lab-bg-contrast .help-drawer .help-lbl, .lab-bg-contrast .help-drawer .help-x, .lab-bg-contrast .help-drawer details.help-part summary i.chev { color: #c8c8c8; }
.lab-bg-contrast .help-drawer .help-head h2 i { color: #9cc0ff; }
.lab-bg-contrast .help-drawer .help-n { background: #333333; color: #ffffff; }
.lab-bg-contrast .help-drawer .help-code { border-color: #555555; }
.lab-dys .help-drawer, .lab-dys .help-body code { font-family: "Atkinson Hyperlegible Mono", Consolas, "Courier New", monospace; }
/* The chevron sits at the right edge, pointing down when open (D, 5 Nov 2026): on the left it read as a shell prompt before a Syntax row's code. */
details.help-part summary i.chev { order: 99; margin-left: auto; font-size: .75em; color: var(--text-secondary); transition: transform .15s; }
details.help-part[open] summary i.chev { transform: rotate(90deg); }
.help-n { display: inline-flex; flex: none; width: 1.7em; height: 1.7em; border-radius: 999px; align-items: center; justify-content: center; font-size: .8em; font-weight: 700; background: var(--border-color); color: var(--text-primary); }
.help-n.g1, .help-gap.g1 { background: #fde68a; color: #1c1917; }
.help-n.g2, .help-gap.g2 { background: #a7f3d0; color: #1c1917; }
.help-n.g3, .help-gap.g3 { background: #bfdbfe; color: #1c1917; }
.help-in { padding: 0 .8rem .7rem; }
/* Syntax and Logic, beside Help (Woodham's, D, 30 Oct 2026) */
.help-tabs { display: flex; gap: .15rem; padding: .25rem .7rem 0; border-bottom: 1px solid rgba(21, 128, 61, .45); flex-shrink: 0; }
.help-tab { font: inherit; font-weight: 700; display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .7rem; margin-bottom: -1px; background: none; border: 0; border-bottom: 2px solid transparent; color: #555555; cursor: pointer; }
.help-tab[aria-selected="true"] { color: #15803d; border-bottom-color: #15803d; }
.help-tabs.icons-only .ht-label { display: none; }
.help-tab:focus-visible { outline: 2px solid #15803d; outline-offset: -2px; border-radius: 6px; }
.help-pane[hidden] { display: none; }
.help-group { margin: .5rem 0 .35rem; font-size: .8em; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #5f5f5f; }
.help-group:first-child { margin-top: 0; }
.help-syn { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .55rem; }
details.help-part summary:has(.help-syn) { align-items: baseline; }
.help-sym { flex: none; min-width: 7.5em; font-weight: 700; white-space: pre; }
.help-sym + span { flex: 1 1 8em; min-width: 0; }
.help-in .help-q + .help-code { margin-top: .5rem; }
.help-produces { margin: .45rem 0 .35rem; }
.help-code.help-output { color: #1d4ed8; }
ol.help-steps { list-style: none; margin: 0; padding: 0; counter-reset: helpstep; }
ol.help-steps li { counter-increment: helpstep; display: flex; gap: .7rem; align-items: baseline; margin: 0 0 .5rem; padding: .55rem .8rem; border: 1px solid rgba(0, 0, 0, .15); border-radius: 8px; background: rgba(0, 0, 0, .035); }
ol.help-steps li::before { content: counter(helpstep); flex: none; font-weight: 700; color: #5f5f5f; }
.help-step-ln { margin-left: auto; flex: none; font-size: .85em; color: #5f5f5f; white-space: nowrap; }
.lab-bg-contrast .help-tabs { border-bottom-color: rgba(126, 224, 126, .5); }
.lab-bg-contrast .help-tab, .lab-bg-contrast .help-group, .lab-bg-contrast .help-step-ln, .lab-bg-contrast ol.help-steps li::before { color: #c8c8c8; }
.lab-bg-contrast .help-tab[aria-selected="true"] { color: #7ee07e; border-bottom-color: #7ee07e; }
.lab-bg-contrast .help-code.help-output { color: #9cc0ff; }
.lab-bg-contrast ol.help-steps li { background: #141414; border-color: #555555; }
.lab-bg-dark ol.help-steps li { background: #0e1638; border-color: #3a4680; }
.lab-bg-dark .help-tab, .lab-bg-dark .help-group, .lab-bg-dark .help-step-ln, .lab-bg-dark ol.help-steps li::before { color: #aab3d8; }
.lab-bg-dark .help-tab[aria-selected="true"] { color: #7ee07e; }
.help-lbl { font-size: .85em; color: var(--text-secondary); margin: .1rem 0 .25rem; }
/* the code cannot be selected or copied */
.help-code { margin: 0; padding: .5rem .7rem; border-radius: 6px; background: var(--lab-bg); color: #000000; font-family: Consolas, "Courier New", monospace; font-size: var(--lab-font); white-space: pre-wrap; overflow-wrap: anywhere; user-select: none; -webkit-user-select: none; }
.lab-bg-contrast .help-code { color: #ffffff; border: 1px solid #555555; }
/* Background Dark: High contrast's rules with dark blues for its black and greys */
.lab-bg-dark .help-drawer, .lab-bg-dark .help-drawer .help-head, .lab-bg-dark .help-drawer details.help-part, .lab-bg-dark .help-drawer .help-code, .lab-bg-dark .help-code { border-color: #3a4680; }
.lab-bg-dark .help-drawer details.help-part { background: #0e1638; }
.lab-bg-dark .help-drawer .help-lead, .lab-bg-dark .help-drawer .help-lbl, .lab-bg-dark .help-drawer .help-x, .lab-bg-dark .help-drawer details.help-part summary i.chev { color: #aab3d8; }
.lab-bg-dark .help-drawer .help-n { background: #2a3670; }
.lab-dys .help-code { font-family: "Atkinson Hyperlegible Mono", Consolas, "Courier New", monospace; }
.help-ln { color: #8a8a8a; display: inline-block; min-width: 1.6em; }
.help-gap { border-radius: 3px; font-weight: 700; }
.help-q { margin: .55rem 0 .1rem; }
/* Request solution: under a Help step's question (solution.js); the notes for solutions sent, over the top of the page */
.sol { margin-top: .6rem; }
.sol .lab-btn, #solFree { font: inherit; font-size: .9em; }
.sol .help-q + .lab-btn { margin-top: .4rem; }
.sol-notes { position: fixed; top: 3.4rem; left: 50%; transform: translateX(-50%); z-index: 30; width: max-content; max-width: calc(100% - 2rem); font-size: .95rem; }
.sol-notes[hidden] { display: none; }
.sol-notes p { margin: 0 0 .4rem; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .5rem .5rem .5rem .9rem; border-radius: 8px; background: var(--bg-secondary); color: var(--text-primary); border: 1px solid var(--border-color); box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.help-stale { margin: 0 0 .8rem; padding: .5rem .7rem; border-radius: 6px; background: #fef3c7; color: #1c1917; border: 1px solid #f59e0b; }
.brief .speak-btn:hover, .brief .speak-btn.is-speaking, .q-panel .speak-btn:hover, .q-panel .speak-btn.is-speaking { border-color: var(--text-secondary); }
/* a question (question.css): its panel in the middle, in place of the editor and output; the panel scrolls itself */
/* one element, so the whole page scrolls, never a box inside it (D, 30 Oct 2026) */
body:has(.lab-main.q-main) { overflow: auto; height: auto; min-height: 100vh; }
.lab-main.q-main { grid-template-columns: minmax(0, 56rem); justify-content: center; flex: 1 0 auto; overflow: visible; min-height: 0; }
.lab-main.q-main .lab-left { overflow: visible; }
.q-main .q-panel { position: relative; }
.q-panel .speak-btn { position: absolute; top: .6rem; right: .7rem; float: none; margin: 0; } /* over the prompt's corner: the code below keeps its width */
.q-panel:has(> .speak-btn) .q-prompt { padding-right: 2.6rem; }
.split-pct { position: fixed; z-index: 30; transform: translate(-50%, -140%); padding: .25rem .55rem; border-radius: 6px; font-size: .85rem; font-weight: 700; white-space: nowrap; pointer-events: none; color: #ffffff; background: rgba(20, 24, 36, .92); border: 1px solid rgba(255, 255, 255, .35); }
.split-pct[hidden] { display: none; }
/* a pair's bar (pair.js): the partner, a dot when they are on this task, who has the keyboard */
.pair-bar { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem 1rem; padding: .35rem 1rem; border-bottom: 1px solid var(--border-color); background: var(--bg-secondary); color: var(--text-primary); flex-shrink: 0; font-size: .95rem; }
.pair-names { display: inline-flex; flex-wrap: wrap; gap: .3rem 1rem; font-weight: 700; }
.pair-who { display: inline-flex; align-items: center; gap: .45rem; }
.pair-who::before { content: ''; width: .6rem; height: .6rem; border-radius: 50%; background: var(--border-color); border: 1px solid var(--text-muted); }
.pair-who.on::before { background: #12a37a; border-color: #12a37a; }
#resetCode[hidden], #pairHold[hidden] { display: none; }
.tnav { display: flex; flex-direction: column; align-items: center; gap: .3rem; min-width: 0; }
.tnav-row { display: flex; align-items: center; gap: .6rem; min-width: 0; max-width: 100%; }
.tnav-arrow { color: var(--text-secondary); font-size: 1rem; padding: .25rem .35rem; }
span.tnav-arrow { opacity: .25; }
.tnav-bar { display: flex; flex-wrap: nowrap; gap: 3px; min-width: 0; overflow-x: auto; scrollbar-width: thin; padding: 2px; }   /* one row: the numbers scroll when they do not fit (bar.css) */
.tnav-bar .seg { flex: none; }
.tnav-bar .seg { width: 1.5rem; height: 1.45rem; display: flex; align-items: center; justify-content: center; border-radius: 4px; background: var(--border-color); color: var(--text-secondary); font-size: .72rem; font-weight: 600; font-variant-numeric: tabular-nums; text-decoration: none; }
.lab-top .tnav-bar .seg:hover { color: var(--text-primary); }
.tnav-bar .seg.is-edited { background: #94a3b8; color: #0f172a; }
.lab-top .tnav-bar .seg.is-edited:hover { color: #0f172a; }
.tnav-bar .seg.rag-green { background: #22c55e; color: #052e16; } .tnav-bar .seg.rag-amber { background: #f59e0b; color: #1c1917; } .tnav-bar .seg.rag-red { background: #ef4444; color: #fff; }
.lab-top .tnav-bar .seg.rag-green:hover, .lab-top .tnav-bar .seg.rag-amber:hover { color: #0f172a; }
.tnav-bar .seg.is-current { box-shadow: 0 0 0 1.5px var(--text-primary); }
.tnav-bar .seg:hover { filter: brightness(1.3); }
.lab-main { display: grid; grid-template-columns: minmax(0, var(--lab-split, 53.5%)) .75rem minmax(0, 1fr); padding: .75rem 1rem; flex: 1; min-height: 0; box-sizing: border-box; }
.lab-split { cursor: col-resize; touch-action: none; display: flex; align-items: center; justify-content: center; outline: none; }
.lab-split::before { content: ''; width: 4px; height: 3rem; border-radius: 2px; background: var(--border-color); }
.lab-split:hover::before, .lab-split.dragging::before, .lab-split:focus-visible::before { background: var(--text-secondary); }
body.lab-dragging { cursor: col-resize; user-select: none; }
.lab-left, .lab-right { display: flex; flex-direction: column; gap: .6rem; min-height: 0; }
.brief { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 8px; padding: .75rem 1rem; max-height: 35%; overflow: auto; flex-shrink: 0; font-size: var(--lab-text); }
.brief p { margin: .35rem 0; color: var(--text-primary); line-height: 1.5; }
.brief code { background: var(--bg-tertiary); padding: .05rem .3rem; border-radius: 4px; font-family: Consolas, "Courier New", monospace; }
.lab-editor { flex: 1; min-height: 0; }
.flow-wrap { flex: 1; min-height: 0; display: flex; gap: .6rem; }
.flow-wrap .lab-editor { flex: 1 1 50%; min-width: 0; }
.flow-col { flex: 1 1 50%; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: .4rem; }
.flow-col .lab-flow { flex: 1 1 0; }
.flow-run { flex: none; align-self: flex-end; max-width: 100%; max-height: 40%; overflow: auto; padding: .35rem .6rem; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-card); font-size: .85em; }
.fr-row { display: flex; gap: .6rem; align-items: baseline; }
.fr-row + .fr-row { margin-top: .2rem; }
.fr-lbl { flex: none; min-width: 3.2em; color: var(--text-secondary); }
.fr-out { min-width: 0; display: flex; flex-wrap: wrap; gap: .1rem .9rem; }
.fr-out strong { overflow-wrap: anywhere; }
.flow-col .lab-flow { padding-top: 1.7rem; } /* the Speed slider has its own strip above the chart, over no box */
/* Infinite's hand-drawn face, for the flowchart's text */
@font-face { font-family: 'Shantell Sans'; src: url(engine/shantell-sans-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Shantell Sans'; src: url(engine/shantell-sans-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }
.lab-flow { --fc-ink: var(--text-primary, #111827); --fc-paper: var(--bg-primary, #fff); flex: 1 1 50%; min-width: 0; min-height: 0; display: flex; gap: .5rem; overflow: auto; }
.lab-flow { position: relative; }
.flow-speed { position: absolute; top: .4rem; right: .6rem; display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--text-secondary, #555); }
.flow-speed input { width: 90px; }
.lab-flow svg { flex: 1 1 0; min-width: 0; height: 100%; max-height: 100%; }
.lab-flow .fc-on :is(rect, path, polygon, ellipse):not([fill="none"]) { fill: #3b82f6; fill-opacity: .3; }
.lab-flow .fc-now :is(rect, path, polygon, ellipse) { stroke-width: 3; }
.lab-flow .fc-bad :is(rect, path, polygon, ellipse):not([fill="none"]) { fill: #ef4444; fill-opacity: 1; }
.lab-flow .fc-bad :is(rect, path, polygon, ellipse) { stroke-width: 3; }
.lab-flow .fc-bad text { fill: #fff; }
.bar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: .6rem; align-items: center; flex-shrink: 0; }
.bar-side { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; min-width: 0; }
.bar-side.right { justify-content: flex-end; }
.bar:has(#share), .bar:has(#debug) { grid-template-columns: auto auto minmax(0, 1fr); } /* Run, Stop and Share, or Debug's buttons, stay on one line when the status shows */
.share-link { flex: 1; min-width: 0; max-width: 24rem; padding: .3rem .5rem; font: inherit; color: var(--text-primary); background: var(--bg-tertiary); border: 1px solid var(--border-color); border-radius: 6px; }
.share-link[hidden] { display: none; }
.out-bar { display: flex; justify-content: flex-end; }
.shell-btn { height: 2.1rem; display: inline-flex; align-items: center; gap: .4rem; padding: 0 .7rem; font: inherit; font-size: .9rem; font-weight: 600; border-radius: 6px; cursor: pointer; color: var(--text-primary); background: var(--bg-tertiary); border: 1px solid var(--border-color); }
.shell-btn:hover, .shell-btn[aria-pressed="true"] { border-color: var(--text-secondary); }
.shell-panel { position: absolute; inset: 0; z-index: 8; display: flex; flex-direction: column; gap: .4rem; background: var(--bg-primary); }
.shell-panel[hidden] { display: none; }
.shell-head { display: flex; align-items: center; justify-content: space-between; color: var(--text-secondary); font-weight: 600; font-size: .9rem; }
.shell-close { width: 2rem; height: 2rem; display: flex; align-items: center; justify-content: center; border-radius: 6px; cursor: pointer; color: var(--text-primary); background: var(--bg-tertiary); border: 1px solid var(--border-color); }
.shell-out { flex: 1; min-height: 0; cursor: text; }
.shell-out .shell-input { width: calc(100% - 5ch); }
.save-drawing { position: relative; }
.save-drawing[hidden] { display: none; }
.save-menu { position: absolute; bottom: calc(100% + .35rem); right: 0; z-index: 20; display: flex; flex-direction: column; min-width: 100%; padding: .3rem; border-radius: 8px; background: var(--bg-secondary); border: 1px solid var(--border-color); box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
.save-menu[hidden] { display: none; }
.save-menu button { font: inherit; font-weight: 600; text-align: left; padding: .45rem .8rem; border-radius: 6px; cursor: pointer; color: var(--text-primary); background: none; border: 0; }
.save-menu button:hover, .save-menu button:focus-visible { background: var(--bg-tertiary); }
.lab-status { color: var(--text-secondary); }
/* a pass on Check my work: the summary every check ends on, as a box over the page (task.js showDone). The summary's
   rules are the reveal and assess engine's, as on the question pages. */
dialog.done-box { width: min(640px, calc(100vw - 2rem)); padding: 0; border: 0; border-radius: 14px; background: var(--bg-card); color: var(--text-primary); box-shadow: 0 24px 60px rgba(0, 0, 0, .6); }
dialog.done-box::backdrop { background: rgba(6, 10, 24, .72); }
.done-box form { position: absolute; top: .7rem; right: .7rem; margin: 0; }
.done-x { width: 2.1rem; height: 2.1rem; border-radius: 50%; cursor: pointer; color: var(--text-primary); background: var(--bg-tertiary); border: 1px solid var(--border-color); }
.done-x:hover, .done-x:focus-visible { border-color: var(--text-secondary); }
.done-box .summary-phase { padding: 30px; }
.done-box .summary-title { font-size: 24px; margin: 0 0 25px; text-align: center; }
.done-box .summary-score { text-align: center; font-size: 48px; font-weight: bold; color: #22c55e; margin: 20px 0; }
.done-box .summary-detail { padding: 15px; background: var(--bg-secondary); border-radius: 10px; border: 1px solid var(--border-color); border-left: 4px solid #22c55e; }
.done-box .summary-question-text { font-weight: 500; margin-bottom: 8px; }
.done-box .summary-marking { font-size: 15px; }
.done-box .next-row { justify-content: center; margin: 1.3rem 0 0; }
.check-out { margin: .5rem 0 0; padding: .55rem .8rem; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-secondary); font-size: .95rem; flex-shrink: 0; }
.check-row { display: flex; gap: .55rem; align-items: baseline; margin: .15rem 0; }
.check-row i.ok { color: #22c55e; } .check-row i.bad { color: #ef4444; } .check-row i.wait { opacity: .45; } .check-row i.note, .check-row i.note + span { color: #f59e0b; }
/* the wrong words of the output (engine/check.js wrongHtml): red, bold and underlined, so not by colour alone */
.check-wrong { color: #f87171; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.next-row { display: flex; gap: .8rem; align-items: center; margin: .6rem 0 .1rem; font-weight: 700; }
.next-row a { text-decoration: none; }
details.attempt summary { cursor: pointer; font-size: .9rem; opacity: .85; }
.attempt-code { margin: .4rem 0 0; padding: .5rem .7rem; max-height: 14rem; overflow: auto; background: var(--bg-tertiary); border-radius: 6px; font-size: .82rem; }
.CodeMirror-hscrollbar, .CodeMirror-vscrollbar, .lab-console, .attempt-code { scrollbar-width: thin; scrollbar-color: rgba(148, 163, 184, .55) transparent; }
.lab-status.is-warn { background: #f59e0b; color: #1c1917; opacity: 1; font-weight: 700; padding: .1rem .55rem; border-radius: 999px; }
#saveRetry[hidden] { display: none; }
.lab-right .lab-console { flex: 1; min-height: 8rem; }
.lab-turtle { position: relative; }
.lab-turtle.is-used { flex-shrink: 0; max-height: 55%; overflow: auto; }
.lab-turtle .turtle-size { position: sticky; float: right; top: .4rem; margin: .4rem .4rem -3rem 0; z-index: 2; font: inherit; font-size: .85rem; font-weight: 600; padding: .3rem .7rem; border-radius: 6px; cursor: pointer; color: #ffffff; background: rgba(20, 24, 36, .8); border: 1px solid rgba(255, 255, 255, .35); }
.lab-vsplit { display: none; flex-shrink: 0; height: .75rem; margin: -.3rem 0; cursor: row-resize; touch-action: none; align-items: center; justify-content: center; outline: none; }
.lab-vsplit::before { content: ''; width: 3rem; height: 4px; border-radius: 2px; background: var(--border-color); }
.lab-vsplit:hover::before, .lab-vsplit.dragging::before, .lab-vsplit:focus-visible::before { background: var(--text-secondary); }
.lab-turtle.is-used + .lab-vsplit { display: flex; }
body.lab-vdragging { cursor: row-resize; user-select: none; }
.lab-right.turtle-sized .lab-turtle.is-used { height: var(--lab-turtle-h); max-height: none; min-height: 0; overflow: hidden; }
.lab-right.turtle-sized .lab-turtle.is-used canvas { width: 100%; height: 100%; object-fit: contain; }
.lab-right.turtle-max .lab-turtle.is-used + .lab-vsplit { display: none; }
.lab-right.turtle-max .lab-turtle.is-used { flex: 1; height: auto; max-height: none; min-height: 0; overflow: hidden; }
.lab-right.turtle-max .lab-turtle.is-used canvas { width: 100%; height: 100%; object-fit: contain; }
.lab-right.turtle-max .lab-turtle.is-used ~ .console-wrap { display: none; }
/* the output box sits in a wrap with its Read output speaker in the corner; the Shell's speaker is beside its close button */
.console-wrap { position: relative; flex: 1; min-height: 8rem; display: flex; flex-direction: column; }
.console-wrap .lab-console { min-height: 0; }
/* a task with files (D, 29 Oct 2026): the output pane's tabs, Console then each file, one shown at a time */
.out-tabs { display: flex; gap: .3rem; flex-wrap: wrap; padding: .35rem 0; flex-shrink: 0; }
.out-tab { font: inherit; font-size: .88rem; padding: .3rem .75rem; border-radius: 6px; cursor: pointer; color: var(--text-secondary); background: var(--bg-secondary); border: 1px solid var(--border-color); }
.out-tab.on { color: var(--text-primary); border-color: var(--text-secondary); font-weight: 700; }
.console-wrap .lab-console[hidden] { display: none; }
.file-view { flex: 1; white-space: pre; overflow: auto; }
.shell-tools { display: flex; align-items: center; gap: .4rem; }
.shell-tools .pane-reset { position: static; }
/* Teacher: maximise the code or the output side to the full width for demos */
.lab-editor, .lab-right { position: relative; }
.pane-max { position: absolute; top: .4rem; right: .4rem; z-index: 5; width: 2.1rem; height: 2.1rem; display: flex; align-items: center; justify-content: center; font-size: .95rem; border-radius: 6px; cursor: pointer; color: #ffffff; background: rgba(20, 24, 36, .8); border: 1px solid rgba(255, 255, 255, .35); }
.pane-max:hover { background: rgba(20, 24, 36, .95); }
.lab-editor .pane-max { right: 1.1rem; }
.pane-reset { position: absolute; top: .4rem; right: 1.1rem; z-index: 5; height: 2.1rem; padding: 0 .7rem; display: flex; align-items: center; gap: .4rem; font: inherit; font-size: .85rem; border-radius: 6px; cursor: pointer; color: #ffffff; background: rgba(20, 24, 36, .8); border: 1px solid rgba(255, 255, 255, .35); }
.pane-reset:hover { background: rgba(20, 24, 36, .95); }
.lock-badge { position: absolute; top: .4rem; right: 1.1rem; z-index: 5; height: 2.1rem; padding: 0 .75rem; display: flex; align-items: center; gap: .45rem; font-size: .85rem; font-weight: 600; border-radius: 6px; color: #ffffff; background: rgba(20, 24, 36, .85); border: 1px solid #f59e0b; }
.lock-badge.beside-max { right: 3.6rem; }
.lock-badge.lock-amber { border-color: #f59e0b; } .lock-badge.lock-green { border-color: #22c55e; } .lock-badge.lock-plain { border-color: rgba(255, 255, 255, .35); padding: 0; width: 2.1rem; justify-content: center; }
.lab-editor.is-locked .CodeMirror { filter: saturate(.75) brightness(.97); }
.pane-reset.beside-max { right: 3.6rem; }
/* the editor's corner: lock, Read code, Reset code, Maximise, side by side */
.lab-editor .pane-tools { position: absolute; top: .4rem; right: 1.1rem; z-index: 5; display: flex; align-items: center; gap: .4rem; }
.lab-editor .pane-tools > .pane-max, .lab-editor .pane-tools > .pane-reset, .lab-editor .pane-tools > .lock-badge { position: static; }
.pane-reset.speak-btn[hidden] { display: none; }
.pane-reset.speak-btn.is-speaking { border-color: #ffffff; }
.reset-ask { position: absolute; top: 2.9rem; right: 1.1rem; z-index: 6; max-width: 22rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .7rem .8rem; border-radius: 8px; background: var(--bg-secondary); border: 1px solid #ef4444; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); font-size: .92rem; }
.reset-ask span { flex-basis: 100%; }
.reset-ask[hidden] { display: none; } /* display:flex above would otherwise keep it on screen */
.lab-right.has-pane-max .lab-console { padding-right: 3rem; }
.lab-right.has-pane-max .lab-turtle .turtle-size { margin-right: 3rem; }
/* Key knowledge: a column on the left of the instructions and editor, never over them; its divider as the editor's */
.lab-main.kk-open { grid-template-columns: minmax(0, var(--lab-kk, 24%)) .75rem minmax(0, calc((100% - var(--lab-kk, 24%) - .75rem) * var(--lab-split-n, .535))) .75rem minmax(0, 1fr); }
.kk-col { display: flex; flex-direction: column; min-height: 0; gap: .4rem; }
.kk-col[hidden], .kk-split[hidden] { display: none; }
.kk-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-weight: 700; flex-shrink: 0; }
.kk-body { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: .6rem; font-size: var(--lab-text); }
.kk-body .q-panel { padding: .9rem 1rem .6rem; }
.lab-main.max-code .kk-col, .lab-main.max-code .kk-split, .lab-main.max-side .kk-col, .lab-main.max-side .kk-split { display: none; }
.lab-main.max-code, .lab-main.max-side { grid-template-columns: minmax(0, 1fr); }
.lab-main.max-code .lab-split, .lab-main.max-code .lab-right { display: none; }
.lab-main.max-side .lab-split, .lab-main.max-side .lab-left { display: none; }
@media (max-width: 900px) {
    body { overflow: auto; display: block; height: auto; }
    .lab-main, .lab-main.kk-open { grid-template-columns: 1fr; gap: .75rem; }
    .lab-split { display: none; }
    .lab-editor .CodeMirror { height: 50vh; }
    .flow-wrap { display: block; }
    .flow-col .lab-flow { height: 60vh; flex: none; }
    .flow-run { align-self: stretch; max-height: none; margin-top: .4rem; }
    .flow-wrap .lab-editor { max-width: 100%; }
    .lab-left { min-width: 0; }
    .lab-right .lab-console { height: 40vh; }
}

/* Page theme Light (html.page-light, app.css): the few places on the task page with a colour of their own.
   The code areas are light on a light page, so they take a thin edge to stand apart from it. */
html.page-light .lab-editor .CodeMirror, html.page-light .lab-console { border: 1px solid var(--border-color); }
html.page-light .why-btn { color: #2563eb; }
html.page-light .why-btn:hover, html.page-light .why-btn:focus-visible { color: #1e40af; }
html.page-light .check-row i.ok { color: #16a34a; } html.page-light .check-row i.bad { color: #dc2626; } html.page-light .check-row i.note, html.page-light .check-row i.note + span { color: #b45309; }
html.page-light .check-wrong { color: #b91c1c; }

/* Debug (engine/debug.js): the line about to run, the name that just changed, and the Variables panel. A bar as well as
   a tint, so neither rests on colour alone. The one tint reads on all six Python themes. */
.lab-btn.dbg-step[hidden] { display: none; }
.dbg-line, .dbg-vars td.dbg-changed { background: rgba(34, 197, 94, .22); box-shadow: inset 4px 0 0 #16a34a; }
.dbg-vars { flex: 0 1 auto; min-height: 5rem; max-height: 40%; overflow: auto; padding: .4rem .75rem .6rem; border-radius: 8px; background: var(--lab-bg); color: #000000; font-family: Consolas, "Courier New", monospace; font-size: var(--lab-font); line-height: 1.45; scrollbar-width: thin; scrollbar-color: rgba(148, 163, 184, .55) transparent; }
.dbg-vars[hidden] { display: none; }
.dbg-vars h2 { margin: 0 0 .15rem; font: inherit; font-weight: 700; }
.dbg-vars table { width: 100%; border-collapse: collapse; }
.dbg-vars th { text-align: left; font-weight: 400; color: #555555; }
.dbg-vars th, .dbg-vars td { padding: .05rem 1rem .05rem .5rem; vertical-align: top; white-space: nowrap; }
.dbg-vars th:last-child, .dbg-vars td:last-child { width: 100%; padding-right: 0; white-space: normal; overflow-wrap: anywhere; }
html.page-light .dbg-vars { border: 1px solid var(--border-color); }
.lab-bg-contrast .dbg-vars { color: #ffffff; border: 1px solid #555555; }
.lab-bg-contrast .dbg-vars th { color: #c8c8c8; }
.lab-bg-dark .dbg-vars { border-color: #3a4680; }
.lab-bg-dark .dbg-vars th { color: #aab3d8; }
.lab-dys .dbg-vars { font-family: "Atkinson Hyperlegible Mono", Consolas, "Courier New", monospace; line-height: 1.8; letter-spacing: .04em; }

.fix-bar { margin: .5rem 0; }
.tnav-bar .seg.rag-red { background: #ef4444; color: #fff; }
.seg-end { display: inline-flex; align-items: center; justify-content: center; }
.after-a { margin-top: .6rem; }
.aa-h { font-weight: 700; margin: .4rem 0; }
.after-a textarea { width: 100%; font: inherit; padding: .5rem; border-radius: 6px; border: 1px solid var(--border-color); background: var(--bg-tertiary); color: var(--text-primary); }
.aa-bar { display: flex; align-items: center; gap: .75rem; margin-top: .4rem; }
.aa-when { font-size: .85rem; opacity: .8; margin: 0; }

/* A trace table task (engine/trace.js): the program, then the table in the flowchart's look, each on its own space */
.lab-main.q-main.tr-main { grid-template-columns: minmax(0, 76rem); }
.tr-wrap { display: flex; gap: 1rem; align-items: flex-start; margin: .8rem 0; }
.tr-code { flex: 1 1 42%; min-width: 0; position: sticky; top: .5rem; margin: 0; padding: .6rem 0; overflow-x: auto; border-radius: 8px; border: 1px solid var(--border-color); background: var(--lab-bg); font-family: Consolas, "Courier New", monospace; font-size: var(--lab-font); color: #000; }
.lab-bg-contrast .tr-code, .lab-bg-dark .tr-code { color: #fff; }
.tr-line { display: flex; gap: .8rem; padding: .05rem .8rem .05rem 0; white-space: pre; }
.tr-line > span:first-child { flex: none; width: 2.2rem; text-align: right; color: #8a8a8a; user-select: none; -webkit-user-select: none; }
.q-panel .tr-code .tr-line code { font: inherit; background: none; border: 0; padding: 0; color: inherit; }
.tr-line.tr-now { background: rgba(59, 130, 246, .28); }
.lab-flow.tr-table { flex: 1 1 58%; display: block; position: relative; overflow-x: auto; min-height: 0; }
.tr-sheet { position: relative; }
/* a Sort and search item's list above its grid (engine/sort.js, D 22 Nov 2026) */
.sr-list { display: flex; flex-wrap: wrap; gap: .35rem; margin: .8rem 0 0; }
.sr-list[hidden] { display: none; }
.sr-item { display: inline-flex; flex-direction: column; align-items: center; min-width: 2.6rem; padding: .35rem .5rem .2rem; border: 2px solid currentColor; border-radius: 6px; }
.sr-item b { font-size: 1.05rem; }
.sr-item small { font-size: .75rem; opacity: .7; }
.sr-item.on { background: #1F5F9C; border-color: #1F5F9C; color: #fff; }
.tr-table svg { display: block; width: 100%; height: auto; max-height: none; flex: none; }
.tr-table g.tr-hide text { visibility: hidden; }
.tr-in { position: absolute; box-sizing: border-box; margin: 0; padding: 0 2px; border: 0; border-radius: 3px; background: transparent; color: var(--fc-ink); font-family: "Shantell Sans", sans-serif; text-align: center; min-width: 0; }
.tr-in:focus { outline: 2px solid #2563eb; outline-offset: -2px; }
.tr-in.tr-bad { outline: 2px solid #dc2626; outline-offset: -2px; }
.tr-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: .4rem; }
.tr-help { margin-top: .6rem; }
@media (max-width: 800px) { .tr-wrap { flex-direction: column; align-items: stretch; } .tr-code, .lab-flow.tr-table { flex: none; width: 100%; } .tr-code { position: static; } .tr-sheet { min-width: 22rem; } }
/* a refused paste (task.js): one quiet toast at the foot of the page */
.paste-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; padding: 8px 14px; border-radius: 8px; background: var(--text-primary); color: var(--bg-secondary); font-size: .95rem; opacity: 0; pointer-events: none; transition: opacity 200ms; }
.paste-toast.on { opacity: 1; }
