/* Problem workspace (tools/templates/challenge.mjs, assets/challenge.mjs, assets/problem-bench.mjs).
   A tool page in the lesson pages' type and colours: the statement on the left, the editor and
   the run on the right. Runs open on evidence: a checks grid, the change since the last run,
   per-design results for Verify problems, and a timeline that starts at the first difference
   with the log underneath, tied to the cursor. Token colours only. */

.problem-page { --code-font: 14px; --left-pane: 42%; display: flex; flex-direction: column; height: 100dvh; }
.problem-page .site-header { flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Zero-specificity resets, so component rules always win. */
:where(.problem-page) :where(button, input, select, textarea) { font: inherit; }
:where(.problem-page) :where(button) { cursor: pointer; color: inherit; }
:where(.problem-page) :where(button:disabled) { opacity: .5; cursor: default; }

/* ---------- problem heading ---------- */
.problem-head { flex: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 14px var(--gutter) 12px; border-bottom: var(--bw) solid var(--rule); }
.problem-head-main { min-width: 0; }
.problem-crumbs { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: var(--fs-sm); color: var(--muted); }
.problem-crumbs a { color: var(--ink-2); text-decoration: none; }
.problem-crumbs a:hover { color: var(--ink); text-decoration: underline; }
.problem-head h1 { font-size: clamp(26px, 2.4vw, 32px); line-height: 1.1; margin: 4px 0 8px; }
.problem-id { color: var(--muted); font: 600 .62em var(--mono); vertical-align: .18em; margin-right: 6px; }
.problem-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 0; font-size: var(--fs-sm); color: var(--ink-2); }
.problem-badges .difficulty { font-weight: 700; }
.difficulty-1, .difficulty-2 { color: var(--good); } .difficulty-3 { color: var(--warn); }
.difficulty-4 { color: var(--bad); } .difficulty-5 { color: var(--ink); }
.engine-badge { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.solved-status { color: var(--good); font-weight: 700; }
.solved-status:empty { display: none; }
.problem-navigation { flex: none; display: flex; gap: 4px; align-items: center; color: var(--muted); font: 500 13px var(--mono); }
.problem-navigation a, .problem-navigation .disabled { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-ctl); font-size: 22px; line-height: 1; color: var(--ink); text-decoration: none; }
.problem-navigation a:hover { background: var(--paper-2); }
.problem-navigation .disabled { opacity: .3; }

/* ---------- the split workspace ---------- */
.workspace { flex: 1 1 0; display: grid; grid-template-columns: minmax(320px, var(--left-pane)) 10px minmax(380px, 1fr); min-height: 560px; padding: 12px var(--gutter) 12px; overflow: hidden; }
.problem-pane, .editor-card, .test-card { background: var(--card); border: var(--bw) solid var(--rule); border-radius: var(--r-ctl); min-width: 0; overflow: hidden; }
.problem-pane { display: flex; flex-direction: column; min-height: 0; }
.pane-tabs, .console-tabs { display: flex; align-items: stretch; gap: 4px; flex: none; min-height: 44px; padding: 0 10px; overflow-x: auto; scrollbar-width: thin; border-bottom: var(--bw) solid var(--rule); }
.pane-tabs button, .console-tabs [role=tab] { border: 0; background: transparent; padding: 0 10px; color: var(--muted); font: 600 var(--fs-sm) var(--sans); white-space: nowrap; box-shadow: inset 0 -2px 0 transparent; }
.pane-tabs button:hover, .console-tabs [role=tab]:hover { color: var(--ink); }
.pane-tabs button[aria-selected=true], .console-tabs [role=tab][aria-selected=true] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.pane-content { overflow-y: auto; min-height: 0; padding: 20px 24px 40px; scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; }
[role=tabpanel]:focus { outline: none; }
[role=tabpanel]:focus-visible { outline: none; box-shadow: inset 3px 0 0 var(--focus); }

/* Statement: the lesson reading style at workspace size. */
.pane-content h2 { font: 700 19px/1.3 var(--sans); letter-spacing: 0; word-spacing: 0; margin: 28px 0 8px; }
.pane-content .pane-title { font: 650 var(--fs-xl)/1.1 var(--display); font-stretch: var(--display-stretch); margin: 0 0 12px; }
.pane-content h3 { font: 700 15px/1.4 var(--sans); margin: 0; }
.pane-content p, .pane-content li { font-size: 16px; line-height: 1.62; overflow-wrap: anywhere; }
.pane-content p { margin: 10px 0; }
.pane-content ul { padding-left: 20px; }
.pane-content li { margin: 6px 0; }
.pane-content .problem-lead { margin-top: 0; font-size: var(--fs-md); line-height: 1.5; color: var(--ink); }
.signals-table td, .signals-table th { padding: 6px 10px; font-size: 14px; }
.pane-content .example-note { color: var(--muted); font-size: var(--fs-sm); }
.example { margin: 14px 0 22px; }
.example-heading { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.example-heading > span { font-size: var(--fs-sm); color: var(--muted); }
.example-io { margin: 0; border: var(--bw) solid var(--rule); border-radius: var(--r-ctl); background: var(--paper); }
.example-io > div { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px; padding: 8px 12px; }
.example-io > div + div { border-top: var(--bw) solid var(--rule); }
.example-io dt { font-size: 13px; font-weight: 700; color: var(--muted); padding-top: 2px; }
.example-io dd { margin: 0; }
.example-io pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 13.5px/1.6 var(--mono); }
.pane-content .example-explanation { font-size: 15px; color: var(--ink-2); margin: 8px 0 2px; }
.example-open { padding-left: 0 !important; }
.full-spec { border: var(--bw) solid var(--rule); border-radius: var(--r-ctl); margin: 16px 0; padding: 0 14px; }
.full-spec > summary { font-weight: 700; padding: 10px 0; }
.full-spec p { font-size: 15px; }
.full-spec .spec-note { border-left: 3px solid var(--rule-strong); padding: 4px 10px; }
.spec-code { margin: 10px 0; }
.spec-code figcaption { color: var(--muted); font-size: var(--fs-sm); margin-bottom: 4px; }
.spec-code pre { overflow: auto; background: var(--screen); color: var(--screen-ink); border-radius: var(--r-ctl); padding: 10px 12px; font: 13px/1.55 var(--mono); }
.spec-table { overflow-x: auto; margin: 10px 0; }
.spec-table table, .field-diff table, .fault-matrix { border-collapse: collapse; width: 100%; font-size: 14px; }
.spec-table th, .spec-table td, .field-diff th, .field-diff td, .fault-matrix th, .fault-matrix td { border-bottom: var(--bw) solid var(--rule); padding: 6px 8px; text-align: left; vertical-align: top; }
.spec-table thead th, .field-diff thead th, .fault-matrix thead th { color: var(--muted); font: 700 13px var(--sans); border-bottom: var(--bw) solid var(--rule-strong); }
.hint { border-bottom: var(--bw) solid var(--rule); padding: 10px 0; }
.hint summary { font-weight: 600; }
.hint p { color: var(--ink-2); }
.judge-note { margin-top: 28px; padding: 14px 16px; border-radius: var(--r-ctl); background: var(--paper-2); }
.pane-content .judge-note p { font-size: var(--fs-sm); color: var(--ink-2); margin: 4px 0; }
.path-link { display: inline-block; margin-top: 6px; font-size: var(--fs-sm); }
.solution-walkthrough { padding-left: 22px; }
.solution-walkthrough p { color: var(--ink-2); margin: 4px 0 14px; }
.solution-source { background: var(--screen); color: var(--screen-ink); padding: 14px 16px; border-radius: var(--r-ctl); overflow: auto; font: 13px/1.65 var(--mono); tab-size: 2; }
.solution-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.small-note { font-size: var(--fs-sm) !important; color: var(--muted); }
.submission-entry { padding: 12px 0; border-bottom: var(--bw) solid var(--rule); }
.submission-entry summary { display: flex; justify-content: space-between; gap: 12px; }
.submission-entry p { font-size: var(--fs-sm); color: var(--muted); }
.submission-entry pre { overflow: auto; max-height: 280px; font: 12.5px/1.6 var(--mono); padding: 12px; background: var(--screen); color: var(--screen-ink); border-radius: var(--r-ctl); }
.empty-history { color: var(--muted); }

.workspace-divider { cursor: col-resize; display: flex; align-items: center; justify-content: center; touch-action: none; }
.workspace-divider span { width: 3px; height: 40px; border-radius: var(--r-pill); background: var(--rule); }
.workspace-divider:hover span, .workspace-divider:focus-visible span { background: var(--accent); }
.workspace-divider:focus-visible { outline: none; }

/* ---------- editor ---------- */
.coding-pane { display: grid; grid-template-rows: minmax(220px, 1fr) minmax(260px, 1.05fr) auto; gap: 10px; min-width: 0; min-height: 0; }
/* The timeline gets the room while it is open; the editor keeps a few lines. */
.coding-pane[data-console="waves"] { grid-template-rows: minmax(250px, .8fr) minmax(320px, 1.4fr) auto; }
.editor-card { display: flex; flex-direction: column; min-height: 0; background: var(--screen); border-color: var(--screen-rule); color: var(--screen-ink); }
.editor-card-header { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 8px 0 14px; border-bottom: var(--bw) solid var(--screen-rule); font: 600 var(--fs-sm) var(--sans); }
.language-badge { margin-left: 8px; font: 500 12px var(--mono); color: var(--screen-muted); }
.editor-card-header #save-status { margin-left: auto; font: 500 12px var(--sans); color: var(--screen-muted); }
.editor-tools { display: flex; gap: 2px; align-items: center; }
.icon-control { display: inline-grid; place-items: center; min-width: 32px; min-height: 32px; background: transparent; border: 0; border-radius: var(--r-ctl); color: inherit; font-size: 14px; }
.icon-control:hover { background: color-mix(in srgb, currentColor 12%, transparent); }
.text-button { border: 0; background: transparent; color: var(--link); padding: 6px; font: 600 var(--fs-sm) var(--sans); }
.editor-card .text-button { color: var(--screen-ink); }
.text-button:hover:not(:disabled) { text-decoration: underline; }
.code-surface { position: relative; display: flex; flex: 1; min-height: 0; overflow: hidden; }
.line-numbers { flex: none; width: 52px; overflow: hidden; text-align: right; margin: 0; padding: 14px 10px 14px 0; font: var(--code-font)/1.7 var(--mono); color: var(--screen-muted); user-select: none; border-right: var(--bw) solid var(--screen-rule); }
.line-numbers span { position: relative; }
.line-numbers .mark-check::before, .line-numbers .mark-error::before { content: ''; position: absolute; left: -16px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; }
.line-numbers .mark-check::before { background: var(--ch-sva); background: var(--scope-sva); }
.line-numbers .mark-error { color: var(--hot); font-weight: 700; }
.line-numbers .mark-error::before { background: var(--hot); border-radius: 1px; }
.code-layer { position: relative; flex: 1; min-width: 0; overflow: hidden; }
.code-highlight, #code-editor { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; border: 0; padding: 14px 18px 14px 12px; font: var(--code-font)/1.7 var(--mono); letter-spacing: 0; white-space: pre; tab-size: 2; text-align: left; font-variant-ligatures: none; }
.code-highlight { visibility: hidden; pointer-events: none; overflow: hidden; background: var(--screen); color: var(--screen-ink); }
#code-editor { resize: none; background: var(--screen); color: var(--screen-ink); caret-color: var(--screen-ink); outline: none; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--screen-rule) transparent; }
#code-editor:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }
.editor-ready .code-highlight { visibility: visible; }
.editor-ready #code-editor { background: transparent; color: transparent; }
#code-editor::selection { background: color-mix(in srgb, var(--syn-kw) 32%, transparent); }
.syntax-comment { color: var(--syn-com); font-style: italic; } .syntax-keyword { color: var(--syn-kw); } .syntax-number { color: var(--syn-num); }
.syntax-string { color: var(--syn-str); } .syntax-system { color: var(--syn-sys); } .syntax-macro { color: var(--syn-mac); }
.editor-bottom { display: flex; align-items: center; gap: 14px; flex: none; flex-wrap: wrap; min-height: 32px; padding: 3px 14px; border-top: var(--bw) solid var(--screen-rule); color: var(--screen-muted); font: 500 12px var(--sans); }
.editor-bottom #editor-instructions { margin-left: auto; }
#editor-marks .text-button { color: var(--hot); font-size: 12.5px; padding: 2px 0; }

/* ---------- console: testcase, results, timeline ---------- */
.test-card { display: flex; flex-direction: column; min-height: 0; }
.console-status { margin-left: auto; display: flex; align-items: center; gap: 14px; padding-left: 12px; color: var(--ink-2); font-size: 13px; white-space: nowrap; }
#test-status { overflow: hidden; text-overflow: ellipsis; max-width: 42ch; }
.capture-control { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.capture-control input { accent-color: var(--accent); margin: 0; width: 15px; height: 15px; }
.console-body { flex: 1; min-height: 0; overflow: hidden; }
.test-content { overflow: auto; padding: 14px 16px; min-height: 0; scrollbar-width: thin; }
.console-body > .test-content { height: 100%; }
.test-intro, .console-note { font-size: var(--fs-sm); color: var(--muted); }
.console-note { margin: 10px 0 0; }
.sample-picker { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.sample-picker button { min-height: 32px; border: var(--bw) solid var(--rule); border-radius: var(--r-ctl); padding: 0 12px; font: 600 13px var(--sans); color: var(--ink-2); background: var(--card); }
.sample-picker button[aria-pressed=true] { border-color: var(--ink); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.sample-detail h3 { font: 700 15px var(--sans); margin: 0; }
.sample-detail dl { margin: 10px 0; }
.sample-detail dt { font-size: 13px; font-weight: 700; color: var(--muted); margin: 10px 0 4px; }
.sample-detail dd { margin: 0; }
.sample-detail pre { margin: 0; background: var(--paper); border: var(--bw) solid var(--rule); border-radius: var(--r-ctl); padding: 8px 12px; white-space: pre-wrap; overflow-wrap: anywhere; font: 13.5px/1.6 var(--mono); }
.sample-detail > p { font-size: var(--fs-sm); color: var(--ink-2); }

/* Results: verdict, change since the last run, checks grid, then the details. */
.result-overview { font: 650 var(--fs-xl)/1.1 var(--display); font-stretch: var(--display-stretch); margin-bottom: 10px; }
.result-overview small { display: block; font: 400 var(--fs-sm) var(--sans); color: var(--ink-2); margin-top: 4px; }
.pass { color: var(--good) !important; }
.fail { color: var(--bad) !important; }
.run-summary { margin-bottom: 14px; }
.run-delta { margin: 0 0 12px; font-size: var(--fs-sm); }
.run-delta.pass, .run-delta.fail { font-weight: 600; }
.block-title { font: 700 13px var(--sans); color: var(--ink-2); margin: 0 0 6px; }
.checks-grid { display: flex; flex-wrap: wrap; gap: 3px; max-height: 172px; overflow: auto; padding: 2px; }
.check-cell { width: 14px; height: 14px; padding: 0; border: 0; border-radius: 2px; }
.pass-cell { background: color-mix(in srgb, var(--good) 55%, transparent); }
.fail-cell { background: var(--bad); }
.check-cell:hover { outline: 2px solid var(--ink); outline-offset: 1px; }
.check-cell:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.checks-legend { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.case-result { border: var(--bw) solid var(--rule); border-radius: var(--r-ctl); margin: 8px 0; }
.case-result summary { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: var(--fs-sm); }
.case-result summary span { margin-left: auto; font-size: 13px; white-space: nowrap; }
.case-result dl { padding: 0 12px 8px; margin: 0; font-size: 13.5px; }
.case-result dt { color: var(--muted); margin: 8px 0 3px; }
.case-result dd { margin: 0; font: 13.5px/1.6 var(--mono); overflow-wrap: anywhere; }
.case-wave-link { margin: 0 8px 8px; }
.more-results { color: var(--muted); font-size: var(--fs-sm); margin: 10px 0; }
.compiler-output { margin-top: 12px; font-size: var(--fs-sm); }
.compiler-output summary { color: var(--ink-2); font-weight: 600; }
.compiler-lines { display: grid; gap: 2px; margin: 8px 0; }
.compiler-line { text-align: left; border: 0; background: none; padding: 4px 6px; border-radius: var(--r-chip); color: var(--bad); font: 13px/1.45 var(--mono); }
.compiler-line:hover { background: var(--bad-soft); text-decoration: underline; }
.compiler-output pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 12.5px/1.6 var(--mono); max-height: 240px; overflow: auto; background: var(--screen); color: var(--screen-ink); padding: 10px; border-radius: var(--r-ctl); }
.field-diff { padding: 0 12px 10px; }
.field-diff td, .field-diff tbody th { font-family: var(--mono); font-weight: 400; overflow-wrap: anywhere; }
.field-diff tbody th { white-space: nowrap; }
.field-diff tr.field-mismatch { background: var(--bad-soft); }
.field-diff tr.field-mismatch th { box-shadow: inset 3px 0 0 var(--bad); }
.raw-hex { margin-top: 6px; font-size: 13px; }
.raw-hex summary { color: var(--muted); }
.raw-hex pre { margin: 6px 0 0; font: 12.5px/1.6 var(--mono); overflow-wrap: anywhere; white-space: pre-wrap; }
/* Verify problems: one row per hidden design. */
.fault-matrix-wrap { margin: 8px 0; }
.fault-matrix caption { text-align: left; font: 700 13px var(--sans); color: var(--ink-2); padding: 4px 0 6px; }
.fault-matrix tbody th strong { display: block; }
.fault-matrix small { display: block; color: var(--muted); font-weight: 400; margin-top: 3px; line-height: 1.45; }
.fault-matrix .matrix-times { color: var(--ink-2); }
.fault-matrix .field-diff { padding: 6px 0 0; }
.fault-matrix .case-wave-link { margin: 4px 0 0; padding-left: 0; }
.matrix-verdict { display: inline-block; font-weight: 700; white-space: nowrap; }
.matrix-caught .matrix-verdict, .matrix-clean .matrix-verdict, .matrix-legal .matrix-verdict { color: var(--good); }
.matrix-missed .matrix-verdict, .matrix-false-alarm .matrix-verdict, .matrix-illegal .matrix-verdict, .matrix-no-result .matrix-verdict { color: var(--bad); }
.fault-matrix > tbody > tr:is(.matrix-missed, .matrix-false-alarm, .matrix-illegal) > th { box-shadow: inset 3px 0 0 var(--bad); }
.fault-matrix > tbody > tr:is(.matrix-false-alarm, .matrix-illegal) > * { border-bottom: 0; }
.fault-matrix > tbody > tr.matrix-detail > td { padding-top: 0; }

/* Timeline: controls, the viewer (assets/v3/wave.css), then the log tied to the cursor. */
.wave-content { padding: 10px 12px !important; }
.wave-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 180px; text-align: center; gap: 8px; padding: 12px 24px; color: var(--muted); }
.wave-empty > svg { width: 110px; height: 40px; stroke: var(--rule-strong); stroke-width: 2; fill: none; }
.wave-empty strong { color: var(--ink); font-size: 16px; }
.wave-empty p { max-width: 420px; font-size: var(--fs-sm); margin: 0; }
.wave-empty > span { font: 13px var(--mono); color: var(--ink-2); }
.wave-selection { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 6px; font-size: var(--fs-sm); color: var(--ink-2); }
.wave-selection label { white-space: nowrap; font-weight: 600; }
.wave-selection select { flex: 1 1 160px; min-width: 0; max-width: 100%; min-height: 34px; border: var(--bw) solid var(--rule-strong); border-radius: var(--r-ctl); background: var(--card); color: var(--ink); padding: 0 8px; }
.wave-selection select:disabled { opacity: .55; }
.wave-context { font-size: var(--fs-sm); margin: 4px 0 8px; }
.assertion-lanes:empty { display: none; }
.results-log-block { margin: 14px 0; }
.results-log { max-height: 260px; }
.log-strip { margin-top: 8px; max-height: 150px; overflow: auto; border: var(--bw) solid var(--rule); border-radius: var(--r-ctl); font: 12.5px/1.5 var(--mono); }
.log-line { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; width: 100%; padding: 2px 10px; border: 0; background: none; text-align: left; color: var(--ink-2); font: inherit; }
button.log-line:hover { background: var(--paper-2); }
.log-line[aria-current] { background: var(--accent-soft); color: var(--ink); box-shadow: inset 3px 0 0 var(--accent); }
.log-time { color: var(--muted); text-align: right; }
.log-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.log-pass .log-text { color: var(--good); } .log-fail .log-text { color: var(--bad); }

/* Debug problems: failing-run panel and the two diagnosis steps. */
.debug-panel { border: var(--bw) solid var(--rule); border-radius: var(--r-ctl); padding: 4px 14px 12px; margin: 16px 0; }
.debug-panel h3 { margin: 14px 0 6px; }
.debug-log { max-height: 200px; min-height: 2.5em; margin: 0; }
.debug-wave { min-height: 60px; }
.debug-form fieldset { border: var(--bw) solid var(--rule); border-radius: var(--r-ctl); margin: 12px 0; padding: 8px 12px; }
.debug-form legend { font-weight: 700; padding: 0 4px; }
.debug-form label { display: inline-flex; align-items: center; gap: 6px; margin: 4px 14px 4px 0; font-size: var(--fs-sm); }
.debug-form input[type=number], .debug-form select { min-height: 36px; padding: 0 8px; border: var(--bw) solid var(--rule-strong); border-radius: var(--r-ctl); background: var(--card); color: var(--ink); }
.debug-form input[type=number] { width: 6em; }
.debug-form .debug-cause { display: flex; align-items: flex-start; gap: 8px; margin: 6px 0; }
.debug-form .debug-cause input { margin-top: 4px; accent-color: var(--accent); }
.debug-result p { margin: 6px 0; font-size: var(--fs-sm); }

/* Run bar. */
.run-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.action-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 18px; border: var(--bw) solid var(--rule-strong); border-radius: var(--r-ctl); background: var(--card); color: var(--ink); font: 700 var(--fs-sm) var(--sans); white-space: nowrap; }
.action-button:hover:not(:disabled) { border-color: var(--ink); }
.submit-button { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.submit-button:hover:not(:disabled) { filter: brightness(1.07); border-color: var(--accent); }
.browser-engine { margin-left: auto; display: flex; align-items: center; gap: 6px; font: 500 12.5px var(--mono); color: var(--muted); }
.browser-engine > span { width: 7px; height: 7px; border-radius: 50%; background: var(--good); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .browser-engine { display: none; }
  .run-toolbar > #run-samples { margin-left: auto; }
  .pane-content { padding: 18px; }
  #test-status { max-width: 26ch; }
}
@media (max-width: 760px) {
  .problem-page { height: auto; }
  .problem-head { align-items: flex-start; flex-direction: column; gap: 6px; padding-top: 12px; }
  .problem-navigation { align-self: flex-end; margin: -4px 0 -6px; }
  .workspace { flex: none; min-height: 0; grid-template-columns: minmax(0, 1fr); overflow: visible; gap: 10px; padding: 8px var(--gutter); }
  .workspace-divider { display: none; }
  .problem-pane { max-height: 70dvh; min-height: 340px; }
  .coding-pane { grid-template-rows: 420px auto auto; }
  .test-card { min-height: 360px; }
  .console-tabs { flex-wrap: wrap; padding-bottom: 0; }
  .console-status { width: 100%; margin: 0; padding: 6px 4px 8px; justify-content: space-between; border-top: var(--bw) solid var(--rule); white-space: normal; }
  #test-status { max-width: none; }
  .console-body { overflow: visible; }
  .console-body > .test-content { height: auto; max-height: none; }
  .run-toolbar { position: sticky; bottom: 0; z-index: 2; padding: 10px 0; background: var(--paper); border-top: var(--bw) solid var(--rule); }
  .pane-content { padding: 16px; }
  .example-io > div { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-width: 420px) {
  .editor-bottom #editor-instructions, .language-badge, .run-toolbar > #download-code { display: none; }
  .action-button { padding: 0 12px; }
  .pane-tabs button, .console-tabs [role=tab] { padding: 0 8px; }
}
@media print {
  .site-header, .workspace-divider, .coding-pane, .pane-tabs { display: none; }
  .workspace { display: block; height: auto; overflow: visible; }
  .problem-pane, .pane-content { overflow: visible; max-height: none; border: 0; }
}

/* ---- the skill rating on a problem (assets/challenge.mjs; docs/rating-plan.md) ---- */
.rating-note { margin: 8px 0 0; padding: 9px 13px; border-radius: 10px; font: 600 14px/1.45 var(--sans); color: var(--ink);
  background: color-mix(in srgb, var(--accent) 10%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.rating-note.up { background: color-mix(in srgb, var(--good) 14%, var(--card)); border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.rating-note.down { background: color-mix(in srgb, var(--bad) 12%, var(--card)); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.rating-note a { color: var(--link); }
.solution-gate { margin: 18px; padding: 20px 22px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, var(--card)); }
.solution-gate-title { margin: 0 0 6px; font: 650 18px var(--display); color: var(--ink); }
.solution-gate p { margin: 0 0 10px; color: var(--ink-2); line-height: 1.5; }
.solution-gate-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px !important; }
.solution-gate-note { min-height: 1.2em; font-size: 13.5px; color: var(--muted); }
