/*
 * Python IDE: the question and fact panel on the task page (includes/items.php, py_item_panel_html; question.js).
 * The rules below the first block are the Woodham lab's question.css, word for word, so a question looks the same in
 * both. Text follows the text size in Settings (--lab-text) and code follows the editor (--lab-font, on the chosen
 * Background, --lab-bg). Status colours always come with a tick or a cross, so colour is never the only sign.
 */
/* the IDE's own: a fact, the way on, and the "not available" lines under a short answer */
.q-panel .q-kind { margin: 0 0 .5rem; color: var(--text-secondary); font-size: .8em; letter-spacing: .05em; text-transform: uppercase; } /* what the item is: Key knowledge, Understanding check */
.q-fact { margin: 0 0 .8rem; }
/* the course introduction: two short lists side by side */
.intro-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .8rem; margin: 0 0 .2rem; }
.intro-cols section { background: var(--bg-tertiary); border: 1px solid var(--border-color); border-radius: 8px; padding: .7rem 1rem .8rem; }
.intro-cols h2 { margin: 0 0 .4rem; color: var(--text-secondary); font-size: .8em; font-weight: 400; letter-spacing: .05em; text-transform: uppercase; }
.intro-cols ul { margin: 0; padding-left: 1.2em; }
.intro-cols li { margin: .2rem 0; }
.q-fact p { margin: .35rem 0 .6rem; }
.q-fact .q-concept { margin: .7rem 0 .15rem; font-size: 1em; font-weight: 400; }
.q-fact .q-concept code { margin-right: .35rem; font-size: 1em; font-weight: 700; background: var(--bg-tertiary); white-space: pre-wrap; }   /* a chip never runs its lines together */
.q-code.can-copy { user-select: text; -webkit-user-select: text; }
.q-panel .next-row { margin: .9rem 0 .1rem; }
.q-panel .check-out { margin: .7rem 0 0; }
.q-result[hidden] { display: none; }
/* a right answer: the reveal and assess engine's summary (its own rules and sizes, on the IDE's colours) */
.q-panel .summary-phase { background: var(--bg-card); border: 2px solid var(--border-color); padding: 30px; border-radius: 12px; }
.q-panel .summary-title { color: var(--text-primary); font-size: 24px; margin: 0 0 25px; text-align: center; }
.q-panel .summary-title:focus { outline: none; }
.q-panel .summary-score { text-align: center; font-size: 48px; font-weight: bold; color: #22c55e; margin: 20px 0; }
.q-panel .summary-detail { margin: 20px 0 0; padding: 15px; background: var(--bg-secondary); color: var(--text-primary); border-radius: 10px; border: 1px solid var(--border-color); }
.q-panel .summary-question-text { font-weight: 500; margin-bottom: 8px; }
.q-panel .summary-detail .q-code { margin: 0 0 8px; }
.q-panel .summary-answer { color: var(--text-muted); font-size: 14px; }
.q-panel .summary-result { font-weight: bold; margin-top: 8px; }
.q-panel .summary-result.correct { color: #22c55e; }
.q-panel .summary-detail.correct { border-left: 4px solid #22c55e; }
/* a short answer: not marked on the free levels, in the engine's amber for an answer waiting for marking */
.q-panel .summary-score.is-pending { font-size: 32px; color: #f39c12; }
.q-panel .summary-detail.pending { border-left: 4px solid #f39c12; }
.q-panel .summary-marking { margin-top: 10px; font-size: 15px; }
/* the feedback on every task (the place after the last item), D's mockup: a ring with the score, "Nice work", then
   one row for each item: an icon, Q and its name, the answer under it, and how it went on the right */
.q-panel.q-feedback { padding: 2rem 1.5rem 1.5rem; overflow: visible; flex: none; } /* no scroll of its own: the page scrolls */
.fb-top { text-align: center; padding-bottom: 1.4rem; }
.fb-ring { position: relative; width: 150px; height: 150px; margin: 0 auto 1.1rem; }
.fb-ring svg { width: 100%; height: 100%; display: block; }
.fb-ring circle { fill: none; stroke-width: 8; }
.fb-ring-track { stroke: var(--border-color); }
.fb-ring-fill { stroke: #4ade80; stroke-linecap: round; }
.fb-ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; }
.fb-ring-text strong { font-size: 2.3rem; font-weight: 600; }
.fb-ring-text span { font-size: .95rem; color: #4ade80; }
.q-panel .fb-title { margin: 0; font-size: 1.9rem; font-weight: 600; }
.q-panel .fb-sub { margin: .2rem 0 0; color: var(--text-secondary); }
/* a Topic test's results: what the sitting just ended earned, one line (includes/leaderboard.php, py_lb_moment_html) */
.fb-moment { display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem; margin: .9rem 0 0; }
.fb-moment span { padding: .2rem .85rem; border: 1px solid #D4A017; border-radius: 999px; color: var(--text-primary); font-weight: 700; }
.fb-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border-color); }
.fb-row { display: flex; align-items: center; gap: .9rem; padding: .85rem .3rem; border-bottom: 1px solid var(--border-color); }
.fb-icon { flex: none; width: 2.5rem; height: 2.5rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.fb-icon .fb-slot { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; } /* fill the gaps: an empty slot */
.fb-icon .fb-pair { display: inline-flex; gap: 1px; font-size: .8rem; } /* true or false: a tick and a cross */
.fb-bolt { margin-right: .4rem; }
.fb-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fb-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1.1rem; }
.fb-q { color: var(--text-secondary); margin-right: .3rem; }
.fb-answer { color: var(--text-secondary); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-panel .fb-answer code { background: none; padding: 0; color: var(--text-primary); }
.fb-status { flex: none; min-width: 11.5rem; text-align: right; white-space: nowrap; font-weight: 600; } /* one right-aligned column */
.fb-tick { display: inline-block; width: 1.1rem; margin-left: .5rem; text-align: center; color: #4ade80; } /* after the words: one column of ticks */
.fb-row.is-read .fb-icon { background: rgba(74, 222, 128, .18); color: #4ade80; } /* read is done: green, as the other finished rows */
.fb-row.is-read .fb-status { color: #a5b4fc; }
.fb-row.is-correct .fb-icon { background: rgba(74, 222, 128, .18); color: #4ade80; }
.fb-row.is-correct .fb-status { color: #4ade80; }
.fb-row.is-incorrect .fb-icon { background: rgba(248, 113, 113, .18); color: #f87171; }
.fb-row.is-incorrect .fb-status { color: #f87171; }
.fb-row.is-pending .fb-icon { background: rgba(243, 156, 18, .18); color: #f39c12; }
.fb-row.is-pending .fb-status { color: #f39c12; }
.fb-row.is-todo { background: var(--bg-tertiary); border-radius: 10px; padding-left: .5rem; padding-right: .5rem; }
.fb-row.is-todo .fb-icon { border: 2px dashed var(--text-muted); color: var(--text-muted); }
.fb-row.is-todo .fb-name { color: var(--text-primary); }
.fb-do { flex: none; display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .9rem; border-radius: 8px; border: 1px solid var(--text-muted); color: var(--text-primary); text-decoration: none; font-weight: 600; }
.fb-do:hover, .fb-do:focus-visible { border-color: var(--text-primary); }
.q-feedback .next-row { justify-content: center; margin-top: 1.3rem; }
/* Page theme Light: the greens and the violet are darker, to read on a light page */
html.page-light .fb-ring-fill { stroke: #16a34a; }
html.page-light .fb-ring-text span, html.page-light .fb-tick, html.page-light .fb-row.is-correct .fb-status,
html.page-light .fb-row.is-correct .fb-icon, html.page-light .fb-row.is-read .fb-icon,
html.page-light .q-panel .summary-result.correct, html.page-light .q-panel .summary-score:not(.is-pending) { color: #15803d; }
html.page-light .fb-row.is-read .fb-status { color: #4f46e5; }
html.page-light .fb-row.is-incorrect .fb-status, html.page-light .fb-row.is-incorrect .fb-icon { color: #b91c1c; }
html.page-light .fb-row.is-pending .fb-status, html.page-light .fb-row.is-pending .fb-icon, html.page-light .q-panel .summary-score.is-pending { color: #b45309; }
.q-panel .summary-detail.incorrect { border-left: 4px solid #ef4444; }
.q-panel .summary-result.incorrect { color: #ef4444; }
.q-panel .summary-result.pending { color: #f39c12; }
.q-panel .summary-detail.todo { border-left: 4px solid var(--border-color); }
.q-panel .summary-result.todo { color: var(--text-muted); font-weight: 400; }
.q-panel .summary-feedback { margin-top: 12px; padding: 12px; background: rgba(59, 130, 246, .10); border-radius: 10px; color: var(--text-primary); font-size: 15px; line-height: 1.5; border-left: 3px solid #3b82f6; }
.q-panel .summary-phase + .next-row { justify-content: center; }
.q-panel button.lab-btn-run { cursor: pointer; }
/* the radio button takes the text's size, so it sits level with the first line of its option */
.q-opt input[type=radio] { font-size: inherit; }

/* ---- the Woodham lab's question.css ---- */
.q-panel {
    --q-green: var(--d-green, #2fb383); --q-amber: var(--d-amber, #d0903a); --q-red: var(--d-red, #c9475f); --q-accent: var(--neon-tools, #00ff88);
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 8px; padding: .9rem 1.1rem 1rem;
    font-size: var(--lab-text); line-height: 1.5; color: var(--text-primary); overflow: auto; min-height: 0;
    scrollbar-width: thin; scrollbar-color: rgba(148, 163, 184, .55) transparent;
}
.q-panel p { margin: .35rem 0; }
.q-prompt { margin: 0 0 .75rem; font-weight: 600; }
.q-prompt p { margin: 0; }
.q-panel code { background: var(--bg-tertiary); padding: .05rem .3rem; border-radius: 4px; font-family: Consolas, "Courier New", monospace; font-size: .95em; }

/* the question's code: the editor's look and size; it cannot be selected or copied */
.q-code { margin: 0 0 .85rem; padding: .55rem .75rem; border-radius: 8px; border: 1px solid rgba(0, 0, 0, .15); background: var(--lab-bg); color: #000000;
    font-family: Consolas, "Courier New", monospace; font-size: var(--lab-font); line-height: 1.45; overflow-x: auto; user-select: none; -webkit-user-select: none; }
.q-line { display: flex; min-height: 1.45em; }
.q-ln { flex: none; width: 2.2em; padding-right: .8em; text-align: right; color: #8a8a8a; }
.q-lc { min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.lab-bg-contrast .q-code { color: #ffffff; border-color: #555555; }
.lab-bg-contrast .q-ln { color: #c8c8c8; }
.lab-bg-dark .q-code { border-color: #3a4680; }
.lab-bg-dark .q-ln { color: #aab3d8; }

/* options: radio buttons to answer, then a list showing the answer */
.q-opts { list-style: none; margin: 0 0 .8rem; padding: 0; border: 0; min-width: 0; display: grid; gap: .45rem; }
.q-opt { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .6rem; padding: .55rem .8rem; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-tertiary); }
label.q-opt { cursor: pointer; }
label.q-opt:hover { border-color: var(--text-secondary); }
label.q-opt:has(input:checked) { border-color: var(--q-accent); box-shadow: inset 0 0 0 1px var(--q-accent); }
label.q-opt:has(input:focus-visible) { outline: 2px solid var(--q-accent); outline-offset: 2px; }
.q-opt input[type=radio] { flex: none; width: 1.05em; height: 1.05em; margin: .25em 0 0; accent-color: var(--q-accent); cursor: pointer; }
.q-otext { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.q-opt.is-code .q-otext, .q-answer.is-code { font-family: Consolas, "Courier New", monospace; font-size: var(--lab-font); white-space: pre-wrap; }
.q-opt > i { flex: none; width: 1.05em; margin-top: .25em; text-align: center; color: var(--text-secondary); }
.q-opt.is-chosen { border-color: var(--text-secondary); }
.q-opt.is-chosen.q-green { border-color: var(--q-green); background: rgba(47, 179, 131, .12); }
.q-opt.is-chosen.q-amber { border-color: var(--q-amber); background: rgba(208, 144, 58, .12); }
.q-opt.is-chosen.q-red { border-color: var(--q-red); background: rgba(201, 71, 95, .12); }
.q-opt.q-green > i, .q-opt.is-right > i { color: var(--q-green); }
.q-opt.q-amber > i { color: var(--q-amber); }
.q-opt.q-red > i { color: var(--q-red); }
.q-opt.is-right { border-color: var(--q-green); border-style: dashed; }
.q-reason { flex-basis: 100%; padding-left: 1.65em; color: var(--text-secondary); font-size: .92em; }
.q-chip { flex: none; padding: 0 .45rem; border-radius: 6px; font-size: .78em; border: 1px solid var(--border-color); color: var(--text-secondary); }

/* the short answer box */
.q-in { display: block; width: 100%; box-sizing: border-box; min-height: 6em; resize: vertical; padding: .55rem .7rem; border-radius: 8px; border: 1px solid var(--border-color);
    background: var(--bg-tertiary); color: var(--text-primary); font: inherit; line-height: 1.5; }
.q-in:focus { outline: 2px solid var(--q-accent); outline-offset: 1px; }
.q-actions { display: flex; align-items: center; gap: .7rem; margin-top: .6rem; }
.q-actions[hidden], .q-form[hidden] { display: none; }
.q-msg { color: var(--text-secondary); font-size: .85em; }
.q-status { color: var(--text-secondary); font-size: .92em; }

/* the result */
.q-verdict { display: flex; align-items: center; gap: .5rem; margin: .1rem 0 .6rem; font-weight: 700; }
.q-verdict:focus { outline: none; }
.q-verdict.q-green i { color: var(--q-green); }
.q-verdict.q-amber i { color: var(--q-amber); }
.q-verdict.q-red i { color: var(--q-red); }
.q-answer { margin: 0 0 .6rem; padding: .5rem .75rem; border-left: 3px solid var(--border-color); border-radius: 0 8px 8px 0; background: var(--bg-tertiary); overflow-wrap: anywhere; }
.q-points { list-style: none; margin: 0 0 .5rem; padding: 0; }
.q-points li { display: flex; align-items: baseline; gap: .55rem; margin: .2rem 0; }
.q-points li.ok i { color: var(--q-green); }
.q-points li.bad i { color: var(--q-red); }
.q-feedback { margin: .4rem 0 0; }
details.q-attempt { margin: 0 0 .85rem; padding: .45rem .75rem; border: 1px solid var(--border-color); border-radius: 8px; }
details.q-attempt summary { cursor: pointer; color: var(--text-secondary); font-size: .92em; }
details.q-attempt[open] summary { margin-bottom: .55rem; }

/* a teacher's view: the key, then the pupil's answers */
.q-lbl { margin: .7rem 0 .2rem; color: var(--text-secondary); font-size: .8em; letter-spacing: .05em; text-transform: uppercase; }
.q-model { padding: .5rem .75rem; border-radius: 8px; background: var(--bg-tertiary); }
.q-key-points { margin: .2rem 0 .4rem; padding-left: 1.4em; }
.q-attempts { margin-top: .9rem; padding-top: .6rem; border-top: 1px solid var(--border-color); }
.q-att { margin-bottom: .8rem; }
.q-att-head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 0 0 .35rem; font-weight: 600; }
.q-muted { color: var(--text-secondary); font-size: .9em; font-weight: 400; }
.q-tag { padding: .05rem .5rem; border-radius: 6px; border: 1px solid var(--border-color); color: var(--text-secondary); font-size: .8em; font-weight: 700; }
.q-tag.q-green { color: var(--q-green); border-color: var(--q-green); }
.q-tag.q-amber { color: var(--q-amber); border-color: var(--q-amber); }
.q-tag.q-red { color: var(--q-red); border-color: var(--q-red); }

/* Easy-read: the reading font, as in the instructions; code in the editor's Easy-read font */
.lab-dys .q-panel { font-family: "Atkinson Hyperlegible Next", system-ui, sans-serif; line-height: 1.8; letter-spacing: .03em; word-spacing: .12em; }
.lab-dys .q-code, .lab-dys .q-panel code, .lab-dys .q-opt.is-code .q-otext, .lab-dys .q-answer.is-code { font-family: "Atkinson Hyperlegible Mono", Consolas, "Courier New", monospace; letter-spacing: .04em; word-spacing: normal; }
.lab-dys .q-code { line-height: 1.8; }
.lab-dys .q-line { min-height: 1.8em; }

/* Predict, then run (includes/items.php, predict.js): what is typed, the prediction, then what it showed */
.pr-table { width: 100%; border-collapse: collapse; margin: .8rem 0; }
.pr-table th { text-align: left; font-size: .9rem; color: var(--text-secondary); padding: .3rem .5rem; border-bottom: 1px solid var(--border-color); }
.pr-table td { vertical-align: top; padding: .45rem .5rem; border-bottom: 1px solid var(--border-color); }
.pr-table td.pr-typed { white-space: nowrap; font-weight: 600; }
.pr-table .q-in.pr-guess { min-height: 3.2em; font-family: "Atkinson Hyperlegible Mono", Consolas, "Courier New", monospace; }
.pr-table .q-in.pr-guess[readonly] { opacity: .85; }
.pr-out { margin: 0; white-space: pre-wrap; font-family: "Atkinson Hyperlegible Mono", Consolas, "Courier New", monospace; }
.pr-did[hidden] { display: none; }
.pr-ask { display: block; font-weight: 700; margin: .6rem 0 .3rem; }
.pr-note { width: 100%; box-sizing: border-box; }
.pr-saved { color: var(--text-secondary); margin: .3rem 0 .6rem; }
.pr-noticed { margin: 0 0 .5rem; white-space: pre-wrap; }
/* Exit ticket: three, two, one */
.ex-part { border: 0; margin: 0 0 .9rem; padding: 0; }
.ex-head { font-size: 1rem; font-weight: 700; margin: .4rem 0 .4rem; padding: 0; }
.ex-part .q-in { min-height: 0; margin-bottom: .4rem; }
.ex-part textarea.q-in { min-height: 4em; }
.ex-list { margin: 0 0 .6rem 1.2rem; padding: 0; }
.q-said { white-space: pre-wrap; opacity: .85; margin: .4rem 0; }
.q-feedback { margin: .6rem 0; }
.q-actions .lab-btn { text-decoration: none; }
