/* Quantum Studio. Every colour and face comes from the host's design tokens
   (tokens.css standing alone; the site's own inside the site), so it follows
   the host's theme. Syntax colours are the Studio's, taken from the palette. */
.qs {
  --qs-kw: var(--accent-text, #d4a574);
  --qs-type: var(--accent-text-hover, #e0bd95);
  --qs-gate: var(--info-text, #7aa0ff);
  --qs-num: var(--warn-text, #f0a020);
  --qs-str: var(--std-text, #10b981);
  /* Whose hand: the reader, a model, an outside agent, the engine, the start. */
  --qs-hand-person: var(--accent-text, #d4a574);
  --qs-hand-assistant: var(--info-text, #7aa0ff);
  --qs-hand-agent: var(--std-text, #10b981);
  --qs-hand-engine: var(--text-secondary, #9aa0a6);
  --qs-hand-origin: var(--border-subtle, #5a5f66);
  --qs-gap: 12px;
  --qs-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: var(--qs-gap);
  min-height: min(100vh, 1100px);
  color: var(--text-primary);
  background: var(--bg-base);
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 14px;
}
.qs *, .qs *::before, .qs *::after { box-sizing: border-box; }
.qs h1, .qs h2 { margin: 0; text-wrap: balance; }
.qs-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--qs-radius); background: var(--bg-surface); }
.qs-brand { display: flex; align-items: baseline; gap: 8px; margin-right: auto; }
.qs-update { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--qs-radius); background: var(--bg-surface); color: var(--info-text); }
.qs-update[hidden] { display: none; }
.qs-update-text { flex: 1 1 240px; overflow-wrap: anywhere; }
.qs-brand .qs-title { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: 0.01em; }
.qs-mark { font-family: var(--font-mono, ui-monospace, monospace); color: var(--accent-text); font-size: 14px; }
.qs-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--qs-gap); flex: 1; min-height: 0; }
.qs-side { display: flex; flex-direction: column; gap: var(--qs-gap); min-width: 0; }
.qs-pane { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--border); border-radius: var(--qs-radius); background: var(--bg-surface); overflow: hidden; }
.qs-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.qs-head h2 { font-size: 11px; font-family: var(--font-mono, ui-monospace, monospace); font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-secondary); }
.qs-grow { flex: 1; }
.qs-program { min-height: 520px; }
.qs-editor { flex: 1; min-height: 260px; overflow: auto; }
.qs-editor .cm-editor { height: 100%; }
.qs-editor .cm-editor.cm-focused { outline: 2px solid var(--focus-ring, var(--accent)); outline-offset: -2px; }
.qs-shows { margin: 0; padding: 0 12px; font-size: 12px; color: var(--text-secondary); line-height: 1.45; }
.qs-shows:not(:empty) { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.qs-job { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); }
.qs-row { display: flex; flex-wrap: wrap; gap: 8px; }
.qs-field { display: flex; flex-direction: column; gap: 3px; flex: 1 1 120px; min-width: 0; font-size: 10px; font-family: var(--font-mono, ui-monospace, monospace); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.qs-input, .qs-select { width: 100%; min-height: 32px; padding: 5px 8px; border: 1px solid var(--border-subtle); border-radius: 6px; background: var(--bg-base); color: var(--text-primary); font: 12px var(--font-mono, ui-monospace, monospace); letter-spacing: 0; text-transform: none; }
.qs-select { width: auto; }
.qs-noise summary { cursor: pointer; font: 11px var(--font-mono, ui-monospace, monospace); color: var(--text-secondary); padding: 4px 0; }
.qs-noise .qs-row { padding-top: 6px; }
.qs-btn { min-height: 32px; padding: 5px 12px; border: 1px solid var(--border-subtle); border-radius: 6px; background: var(--bg-base); color: var(--text-primary); font: 12px var(--font-mono, ui-monospace, monospace); cursor: pointer; white-space: nowrap; }
.qs-btn:hover:not(:disabled) { border-color: var(--accent); }
.qs-btn:disabled { opacity: 0.5; cursor: default; }
.qs-btn.qs-small { min-height: 26px; padding: 2px 9px; font-size: 11px; }
.qs-primary { background: var(--accent-fill, var(--accent)); border-color: var(--accent-fill, var(--accent)); color: var(--on-accent, #0c0a09); font-weight: 650; }
.qs-primary:hover:not(:disabled) { background: var(--accent-fill-hover, var(--accent)); }
.qs-where { display: inline-flex; border: 1px solid var(--border-subtle); border-radius: 6px; overflow: hidden; }
.qs-seg { min-height: 32px; padding: 5px 11px; border: 0; background: var(--bg-base); color: var(--text-secondary); font: 12px var(--font-mono, ui-monospace, monospace); cursor: pointer; }
.qs-seg + .qs-seg { border-left: 1px solid var(--border-subtle); }
.qs-seg.on { background: color-mix(in srgb, var(--accent) 18%, var(--bg-base)); color: var(--text-primary); }
.qs-seg:disabled { opacity: 0.45; cursor: default; }
.qs-dialog { max-width: 32rem; padding: 16px 18px; border: 1px solid var(--border-subtle); border-radius: 8px; background: var(--bg-base); color: var(--text-primary); font: 13px/1.5 var(--font-sans, system-ui, sans-serif); }
.qs-dialog h2 { margin: 0 0 8px; font-size: 15px; }
.qs-dialog .qs-row { justify-content: flex-end; margin-top: 12px; }
.qs-dialog::backdrop { background: rgb(0 0 0 / 0.45); }
.qs :focus-visible { outline: 2px solid var(--focus-ring, var(--accent)); outline-offset: 2px; }
.qs-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border-subtle); font: 11px var(--font-mono, ui-monospace, monospace); color: var(--text-secondary); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.qs-badge.ok { color: var(--ok-text); border-color: color-mix(in srgb, var(--ok-text) 40%, transparent); }
.qs-badge.bad { color: var(--bad-text); border-color: color-mix(in srgb, var(--bad-text) 40%, transparent); }
.qs-badge.run { color: var(--info-text); border-color: color-mix(in srgb, var(--info-text) 40%, transparent); }
.qs-verdict { display: inline; }
.qs-level { font-weight: 600; }
.qs-circuit { margin: 0; padding: 10px 12px; min-height: 120px; max-height: 320px; overflow: auto; font: 12px/1.35 var(--font-mono, ui-monospace, monospace); color: var(--text-primary); background: var(--bg-base); white-space: pre; }
.qs-circuit.stale { color: var(--bad-text); white-space: pre-wrap; }
.qs-circuit[hidden], .qs-diagram[hidden] { display: none; }
.qs-diagram { min-height: 120px; max-height: 360px; overflow: auto; padding: 6px 4px; background: var(--bg-base); }
.qs-diagram.stale .qs-note { color: var(--bad-text); padding: 6px 8px; }
.qs-legend { margin: 0; padding: 0 12px 8px; }
.qs-legend:empty { display: none; }
.qc { display: block; font-family: var(--font-mono, ui-monospace, monospace); }
.qc-wire { stroke: var(--border-subtle); stroke-width: 1.5; }
.qc-name { fill: var(--text-muted); font-size: 11px; }
.qc-join { stroke: var(--text-secondary); stroke-width: 1.5; }
.qc-box { fill: var(--bg-surface); stroke: var(--accent); stroke-width: 1.3; }
.qc-cond .qc-box { stroke-dasharray: 3 2; }
.qc-label { fill: var(--text-primary); font-size: 12px; }
.qc-sub { fill: var(--text-muted); font-size: 9px; }
.qc-dot { fill: var(--text-primary); }
.qc-ring { fill: var(--bg-surface); stroke: var(--text-primary); stroke-width: 1.5; }
.qc-stroke { stroke: var(--text-primary); stroke-width: 1.5; }
.qc-meter { fill: none; stroke: var(--info-text, var(--accent)); stroke-width: 1.4; }
.qc-item:hover .qc-box, .qc-item:hover .qc-ring { stroke-width: 2.2; }
.qs-note { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono, ui-monospace, monospace); overflow-wrap: anywhere; }
.qs-result { padding: 10px 12px; display: flex; flex-direction: column; gap: 12px; overflow: auto; }
.qs-empty { margin: 0; color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.qs-block { display: flex; flex-direction: column; gap: 5px; }
.qs-k { font: 10px var(--font-mono, ui-monospace, monospace); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }
.qs-method { font-weight: 650; }
.qs-why { color: var(--text-secondary); font-size: 12px; line-height: 1.5; }
.qs-warn { margin: 4px 0 0; color: var(--warn-text); font-size: 12px; }
/* A chart the engine drew (engine::chart): it scales to its box, its rows in a table under it. */
.wq-chart-box { max-width: 720px; min-width: 0; }
.wq-chart-box svg.wq-chart { display: block; width: 100%; max-width: 100%; height: auto; }
.wq-chart-box[data-state="drawing"] { min-height: 48px; }
.wq-chart-data { margin-top: 4px; }
.wq-chart-data > summary { cursor: pointer; font-size: 12px; color: var(--text-secondary); }
.wq-chart-data table caption { text-align: start; font-size: 12px; color: var(--text-secondary); padding: 2px 0; }
.wq-chart-refused { margin: 0 0 4px; }
.wq-chart-table-wrap { max-width: 100%; overflow-x: auto; }
.qs-bars { display: flex; flex-direction: column; gap: 3px; }
.qs-bar { display: grid; grid-template-columns: minmax(3ch, max-content) 1fr auto; gap: 8px; align-items: center; font: 12px var(--font-mono, ui-monospace, monospace); font-variant-numeric: tabular-nums; }
.qs-track { height: 10px; border-radius: 3px; background: color-mix(in srgb, var(--text-muted) 15%, transparent); overflow: hidden; }
.qs-fill { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.qs-n { color: var(--text-secondary); }
.qs-table { width: 100%; border-collapse: collapse; font: 12px var(--font-mono, ui-monospace, monospace); font-variant-numeric: tabular-nums; }
.qs-table th, .qs-table td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
.qs-table th { color: var(--text-secondary); font-weight: 500; }
.qs-table thead th { color: var(--text-muted); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
.qs-table .num { text-align: right; }
.qs-table .mono { color: var(--text-primary); }
.qs-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.qs-hist { max-height: 260px; }
.qs-history { list-style: none; margin: 0; padding: 4px; overflow: auto; }
.qs-hitem { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 6px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--text-primary); text-align: left; cursor: pointer; font: inherit; }
.qs-hitem:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.qs-htitle { font: 12px var(--font-mono, ui-monospace, monospace); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qs-history > li.qs-note { padding: 8px; }
.qs-foot { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 4px 2px; font: 11px var(--font-mono, ui-monospace, monospace); color: var(--text-muted); }
.qs-status { margin-left: auto; color: var(--text-secondary); overflow-wrap: anywhere; }
.qs-status.ok { color: var(--ok-text); }
.qs-status.bad { color: var(--bad-text); }
.qs-ai { min-height: 200px; }
.qs-ai-settings { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.qs-ai-settings[hidden] { display: none; }
.qs-ai-quick { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 12px 0; }
.qs-ai-log { list-style: none; margin: 0; padding: 8px 12px; display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow: auto; }
.qs-ai-log > li { font-size: 13px; line-height: 1.5; }
.qs-ai-log p { margin: 0; }
.qs-ai-user { align-self: flex-end; max-width: 85%; padding: 6px 10px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 14%, var(--bg-base)); }
.qs-ai-answer { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-base); }
.qs-ai-text { white-space: pre-wrap; }
.qs-ai-tool { font-size: 12px; color: var(--text-secondary); }
.qs-ai-tool summary { cursor: pointer; font-family: var(--font-mono, ui-monospace, monospace); font-size: 11px; color: var(--text-muted); }
.qs-ai-error { color: var(--bad-text); }
.qs-ai-unsourced { font-size: 12px; color: var(--warn-text); }
.qs-ai-code { margin: 0; padding: 8px 10px; border-radius: 6px; background: var(--bg-surface); border: 1px solid var(--border); font: 12px/1.4 var(--font-mono, ui-monospace, monospace); overflow: auto; white-space: pre; }
.qs-ai-proposal { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 4px; }
.qs-ai-ask { display: flex; gap: 8px; align-items: flex-end; padding: 8px 12px 12px; border-top: 1px solid var(--border); }
.qs-ai-input { min-height: 40px; resize: vertical; font-family: var(--font-sans, system-ui, sans-serif); font-size: 13px; }
/* The critique, under the diagram: chips of measures, then the smells. */
.qs-critique { display: flex; flex-direction: column; gap: 6px; padding: 8px 12px 10px; border-top: 1px solid var(--border); }
.qs-chips { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.qs-chip { display: inline-flex; align-items: baseline; gap: 3px; padding: 2px 8px; border-radius: 6px; background: color-mix(in srgb, var(--text-muted) 10%, transparent); font: 11px var(--font-mono, ui-monospace, monospace); font-variant-numeric: tabular-nums; color: var(--text-secondary); white-space: nowrap; }
.qs-chip b { color: var(--text-primary); font-weight: 600; }
.qs-delta { color: var(--info-text); }
.qs-model { border: 1px dashed var(--border-subtle); background: transparent; cursor: help; }
.qs-smells { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.qs-smell { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "text acts" "where acts"; column-gap: 8px; padding: 6px 8px; border-radius: 6px; border: 1px solid color-mix(in srgb, var(--warn-text) 30%, var(--border)); background: color-mix(in srgb, var(--warn-text) 6%, var(--bg-base)); font-size: 12px; line-height: 1.4; }
.qs-smell:hover, .qs-smell:focus-within { border-color: var(--warn-text); }
.qs-smell-text { grid-area: text; color: var(--text-primary); }
.qs-smell-where { grid-area: where; }
.qs-smell-acts { grid-area: acts; display: flex; gap: 4px; align-items: center; }
.qc-flag .qc-box, .qc-flag .qc-ring { stroke: var(--warn-text); stroke-dasharray: 4 2; }
.qc-wire.qc-flag { stroke: color-mix(in srgb, var(--warn-text) 55%, var(--border-subtle)); stroke-dasharray: 5 3; }
.qc-smell .qc-box, .qc-smell .qc-ring { stroke: var(--warn-text); stroke-width: 2.6; stroke-dasharray: none; fill: color-mix(in srgb, var(--warn-text) 16%, var(--bg-surface)); }
.qc-wire.qc-smell { stroke: var(--warn-text); stroke-width: 2.5; stroke-dasharray: none; }
.qc-name.qc-smell { fill: var(--warn-text); font-weight: 650; }
/* The classical-shortcut lens. */
.qs-shortcuts { display: flex; flex-direction: column; gap: 6px; padding: 8px 12px 10px; border-top: 1px solid var(--border); }
.qs-shortcuts-head { display: flex; align-items: center; gap: 6px; }
.qs-shortcuts-body:empty { display: none; }
.qs-shortcuts-body { display: flex; flex-direction: column; gap: 6px; }
.qs-shortcuts-body .qs-why, .qs-shortcuts-body .qs-note { margin: 0; }
.qs-scroll { overflow-x: auto; }
.qs-routes tr.off { color: var(--text-muted); }
.qs-routes tr.off th { color: var(--text-muted); }
.qs-routes tr.best th, .qs-routes tr.best td { color: var(--ok-text); font-weight: 600; }
.qs-shortcuts.stale .qs-routes, .qs-shortcuts.stale #qs-shortcuts-summary { opacity: 0.55; }
.qs-passes { width: 100%; border-collapse: collapse; font: 12px var(--font-mono, ui-monospace, monospace); font-variant-numeric: tabular-nums; }
.qs-passes th, .qs-passes td { text-align: left; padding: 3px 6px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.qs-passes thead th { color: var(--text-muted); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 500; }
.qs-passes .num { text-align: right; }
.qs-passes tr.off td, .qs-passes tr.off th { color: var(--text-muted); }
.qs-passes tr.on th .qs-btn { border-color: var(--accent); color: var(--accent); }
.qs-compile .qs-shortcuts-head { flex-wrap: wrap; }
.qs-compile .qs-small-input { width: auto; min-height: 26px; padding: 2px 6px; }
.qs-compile #qs-compile-eps { width: 7ch; }
.qs-inline { display: inline-flex; align-items: center; gap: 4px; font: 12px var(--font-mono, ui-monospace, monospace); color: var(--text-secondary); }
.qs-compile-diagram { max-height: 320px; overflow: auto; }
.qs-compile.stale .qs-passes, .qs-compile.stale #qs-compile-summary, .qs-compile.stale .qs-compile-diagram { opacity: 0.55; }
.qs-estimate .qs-shortcuts-head { flex-wrap: wrap; }
.qs-estimate .qs-small-input { width: auto; min-height: 26px; padding: 2px 6px; }
.qs-estimate #qs-estimate-budget { width: 7ch; }
.qs-frontier-figure { max-width: 560px; }
.qs-frontier { width: 100%; height: auto; display: block; font: 10px var(--font-mono, ui-monospace, monospace); }
.qs-frontier-grid line { stroke: var(--border-subtle, var(--border)); stroke-width: 1; }
.qs-frontier-tick { fill: var(--text-muted); }
.qs-frontier-axis { fill: var(--text-secondary); font-size: 11px; }
.qs-frontier-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.qs-frontier-hit { fill: transparent; }
.qs-frontier-dot { fill: var(--accent); stroke: var(--bg-surface); stroke-width: 2; }
.qs-frontier-point { cursor: pointer; outline: none; }
.qs-frontier-point:hover .qs-frontier-dot, .qs-frontier-point:focus-visible .qs-frontier-dot { stroke: var(--focus-ring, var(--accent)); }
.qs-frontier-point.head .qs-frontier-dot { stroke: var(--text-primary); }
.qs-frontier-label { fill: var(--text-secondary); font-size: 11px; }
#qs-frontier-table tr.on th, #qs-frontier-table tr.on td { background: color-mix(in srgb, var(--accent) 14%, transparent); }
#qs-frontier-table tr.head th { font-weight: 600; }
.qs-estimate.stale #qs-estimate-summary, .qs-estimate.stale .qs-frontier-figure, .qs-estimate.stale #qs-frontier-table { opacity: 0.55; }
.qs-stale-note { color: var(--warn-text) !important; }
/* Alternatives: the atlas, then a card for each. */
.qs-alt-aim { padding: 8px 12px 0; }
.qs-alt > .qs-note { padding: 6px 12px 0; margin: 0; }
.qs-alt-body { display: flex; flex-direction: column; gap: 8px; padding: 8px 12px 12px; }
.qs-alt-body:empty { display: none; }
.qs-atlas { width: 100%; max-width: 420px; height: auto; font-family: var(--font-mono, ui-monospace, monospace); }
.qs-atlas .qs-gridline { stroke: color-mix(in srgb, var(--text-muted) 18%, transparent); stroke-width: 1; }
.qs-atlas .qs-tick { fill: var(--text-muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.qs-atlas .qs-axis { fill: var(--text-secondary); font-size: 9px; }
.qs-atlas .qs-ring { fill: none; stroke: var(--text-primary); stroke-width: 2; }
.qs-atlas .qs-dot { fill: var(--accent); stroke: var(--bg-surface); stroke-width: 2; }
.qs-atlas .qs-hit { fill: transparent; }
.qs-atlas .qs-pt { cursor: pointer; outline: none; }
.qs-atlas .qs-pt:hover .qs-dot, .qs-atlas .qs-pt:focus-visible .qs-dot { r: 7; stroke: var(--text-primary); }
.qs-atlas .qs-pt-n { fill: var(--text-primary); }
.qs-cands { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.qs-cand { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-base); }
.qs-cand.on, .qs-cand:focus { border-color: var(--accent); outline: none; }
.qs-cand-head { display: flex; align-items: baseline; gap: 8px; }
.qs-cand-n { flex: none; width: 18px; height: 18px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--on-accent, #0c0a09); font: 600 10px var(--font-mono, ui-monospace, monospace); }
.qs-cand-title { flex: 1; min-width: 0; font-size: 12px; line-height: 1.4; }
.qs-cand-facts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.qs-cand-src summary { cursor: pointer; font: 11px var(--font-mono, ui-monospace, monospace); color: var(--text-muted); }
.qs-cand-src pre { margin-top: 4px; max-height: 220px; }
/* A generator's inputs, under the editor. */
.qs-inputs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 12px; border-top: 1px solid var(--border); font: 12px var(--font-mono, ui-monospace, monospace); color: var(--text-secondary); }
.qs-inputs[hidden] { display: none; }
.qs-inputs-fields { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.qs-inputs-one { display: inline-flex; align-items: center; gap: 4px; color: var(--text-primary); }
.qs-inputs-one .qs-input { width: 72px; min-height: 26px; }
.qs-inputs .qs-note { margin: 0; }
/* The Workbench: the specification, the archive's map, an entry, the log. */
.qs-wb-spec { padding: 8px 12px 0; }
.qs-wb-spec summary { cursor: pointer; font: 12px var(--font-mono, ui-monospace, monospace); color: var(--text-secondary); }
.qs-wb-form { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; }
.qs-wb-form > label { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); align-items: center; gap: 8px; font: 12px var(--font-mono, ui-monospace, monospace); color: var(--text-secondary); }
.qs-wb-form > label:last-child { grid-template-columns: 9.5em auto auto auto; justify-content: start; }
.qs-wb-cost { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font: 12px var(--font-mono, ui-monospace, monospace); color: var(--text-secondary); }
.qs-wb-cost > span { flex-basis: 100%; }
.qs-wb-cost label { display: inline-flex; align-items: center; gap: 4px; }
.qs-wb-w { width: 64px; min-height: 26px; }
.qs-wb-acts { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 0; }
.qs-wb-acts[hidden] { display: none; }
.qs-wb > .qs-note { padding: 6px 12px 0; margin: 0; font-variant-numeric: tabular-nums; }
.qs-wb-mapbox { padding: 6px 12px 0; }
.qs-wb-mapbox:empty, .qs-wb-entry:empty, .qs-wb-log:empty { display: none; }
.qs-atlas .qs-wb-best .qs-dot { fill: var(--ok-text); }
.qs-atlas .qs-wb-model .qs-dot { fill: var(--info-text); }
.qs-atlas .qs-wb-mutate .qs-dot { fill: var(--text-muted); }
.qs-atlas .qs-sel .qs-dot, .qs-atlas .qs-sel .qs-ring { stroke: var(--text-primary); stroke-width: 2.5; }
.qs-wb-entry { display: flex; flex-direction: column; gap: 6px; margin: 8px 12px 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-base); }
.qs-wb-entry details summary { cursor: pointer; font: 11px var(--font-mono, ui-monospace, monospace); color: var(--text-muted); }
.qs-wb-entry pre { margin-top: 4px; max-height: 260px; }
.qs-wb-note { margin: 0; font-size: 12px; color: var(--text-secondary); }
.qs-wb-chain { display: flex; flex-wrap: wrap; gap: 4px; }
.qs-wb-chain .qs-chip { border: 0; cursor: pointer; }
.qs-wb-chain .qs-chip:hover, .qs-wb-chain .qs-chip:focus-visible { color: var(--text-primary); outline: 1px solid var(--accent); }
.qs-wb-log { margin: 8px 12px 12px; padding: 0 0 0 18px; display: flex; flex-direction: column; gap: 3px; font: 11px/1.4 var(--font-mono, ui-monospace, monospace); color: var(--text-secondary); }
.qs-wb-log li.ok { color: var(--ok-text); }
.qs-wb-log li.bad { color: var(--bad-text); }
.qs-wb-log li.find { color: var(--accent-text); }
.qs-wb-log li .qs-wb-try { margin-left: 4px; font-family: var(--font-sans); }
.qs-wb-novelty { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.qs-wb-novelty:empty { display: none; }
.qs-wb-novelty .qs-note { margin: 0; flex-basis: 100%; }

/* What is new: a known result by a different route, an aberration, an entry far from the known. */
.qs-badge.find { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.qs-cand.find { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); }
.qs-novelty { max-width: 100%; }
.qs-found-list { list-style: none; margin: 0; padding: 8px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.qs-found > .qs-empty { padding: 8px 12px 12px; }
.qs-found-list:empty { display: none; }
.qs-found-item { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-base); }
.qs-found-item.saved { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); }
.qs-found-item .qs-note { margin: 0; }
.qs-found-item .qs-input { flex: 1 1 160px; min-width: 0; }
/* Versions: who made each change, and whose hand each line and gate is in. */
.qs-hand-person { --qs-hand: var(--qs-hand-person); }
.qs-hand-assistant { --qs-hand: var(--qs-hand-assistant); }
.qs-hand-agent { --qs-hand: var(--qs-hand-agent); }
.qs-hand-engine { --qs-hand: var(--qs-hand-engine); }
.qs-hand-origin { --qs-hand: var(--qs-hand-origin); }
.qs-hand-assistant_then_person { --qs-hand: var(--qs-hand-person); --qs-hand-was: var(--qs-hand-assistant); }
.qs-hand-agent_then_person { --qs-hand: var(--qs-hand-person); --qs-hand-was: var(--qs-hand-agent); }
.qs-hand-gutter .cm-gutterElement { padding: 0 3px 0 2px; display: flex; align-items: stretch; }
.qs-hand { display: block; width: 4px; min-height: 1.2em; border-radius: 2px; background: var(--qs-hand); }
.qs-hand.qs-hand-assistant_then_person, .qs-hand.qs-hand-agent_then_person { background: linear-gradient(var(--qs-hand-was) 0 50%, var(--qs-hand) 50% 100%); }
.qs-by-hand .qc-item .qc-box, .qs-by-hand .qc-item .qc-ring { stroke-width: 2.2; }
.qs-by-hand .qc-by-person .qc-box, .qs-by-hand .qc-by-person .qc-ring { stroke: var(--qs-hand-person); }
.qs-by-hand .qc-by-assistant .qc-box, .qs-by-hand .qc-by-assistant .qc-ring { stroke: var(--qs-hand-assistant); }
.qs-by-hand .qc-by-agent .qc-box, .qs-by-hand .qc-by-agent .qc-ring { stroke: var(--qs-hand-agent); }
.qs-by-hand .qc-by-engine .qc-box, .qs-by-hand .qc-by-engine .qc-ring { stroke: var(--qs-hand-engine); }
.qs-by-hand .qc-by-origin .qc-box, .qs-by-hand .qc-by-origin .qc-ring { stroke: var(--qs-hand-origin); }
.qs-by-hand .qc-by-assistant_then_person .qc-box, .qs-by-hand .qc-by-assistant_then_person .qc-ring { stroke: var(--qs-hand-person); stroke-dasharray: 3 2; }
.qs-by-hand .qc-by-agent_then_person .qc-box, .qs-by-hand .qc-by-agent_then_person .qc-ring { stroke: var(--qs-hand-person); stroke-dasharray: 3 2; }
.qs-vs { max-height: 520px; }
.qs-vs-intro { margin: 0; padding: 6px 12px 0; }
.qs-vs-share { padding: 6px 12px 0; display: flex; flex-direction: column; gap: 4px; }
.qs-vs-share:empty { display: none; }
.qs-vs-sum { margin: 0; font: 12px var(--font-mono, ui-monospace, monospace); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.qs-vs-bar { display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden; }
.qs-vs-seg { display: block; min-width: 3px; background: var(--qs-hand); }
.qs-vs-seg.qs-hand-assistant_then_person, .qs-vs-seg.qs-hand-agent_then_person { background: repeating-linear-gradient(135deg, var(--qs-hand) 0 4px, var(--qs-hand-was) 4px 8px); }
.qs-vs-who { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.qs-vs-who li { display: inline-flex; align-items: center; gap: 6px; }
.qs-vs-key { width: 9px; height: 9px; border-radius: 2px; background: var(--qs-hand); }
.qs-vs-key.qs-hand-assistant_then_person, .qs-vs-key.qs-hand-agent_then_person { background: linear-gradient(135deg, var(--qs-hand-was) 0 50%, var(--qs-hand) 50% 100%); }
.qs-vs-lines { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 0 6px; margin: 8px 12px 0; overflow: auto; max-height: 240px; }
.qs-vs-svg { display: block; }
.qs-vs-edge { fill: none; stroke: var(--border-subtle); stroke-width: 1.6; }
.qs-vs-dot { fill: var(--bg-surface); stroke-width: 2.2; }
.qs-vs-dot.qs-by-person { stroke: var(--qs-hand-person); }
.qs-vs-dot.qs-by-assistant { stroke: var(--qs-hand-assistant); }
.qs-vs-dot.qs-by-agent { stroke: var(--qs-hand-agent); }
.qs-vs-dot.qs-by-engine { stroke: var(--qs-hand-engine); }
.qs-vs-dot.qs-by-origin { stroke: var(--qs-hand-origin); }
.qs-vs-dot.qs-vs-here { fill: currentColor; color: var(--accent); }
.qs-vs-list { list-style: none; margin: 0; padding: 0; }
.qs-vs-list li { height: 30px; }
.qs-vs-item { display: flex; align-items: baseline; gap: 8px; width: 100%; height: 30px; padding: 0 6px; border: 0; border-radius: 6px; background: none; color: var(--text-primary); text-align: left; cursor: pointer; font: inherit; white-space: nowrap; overflow: hidden; }
.qs-vs-item > span { line-height: 30px; overflow: hidden; text-overflow: ellipsis; }
.qs-vs-item:hover, .qs-vs-list li.on .qs-vs-item { background: var(--bg-base); }
.qs-vs-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.qs-vs-id { font: 600 12px var(--font-mono, ui-monospace, monospace); color: var(--text-secondary); }
.qs-vs-list li.here .qs-vs-id { color: var(--accent-text); }
.qs-vs-by { font-size: 13px; }
.qs-vs-detail { margin: 8px 12px 12px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-base); display: flex; flex-direction: column; gap: 6px; }
.qs-vs-detail:empty { display: none; }
.qs-vs-detail p { margin: 0; }
.qs-vs-what { font-size: 13px; }
.qs-review { margin: 0 12px 8px; padding: 8px 10px; border: 1px solid var(--qs-hand-assistant); border-radius: 8px; background: color-mix(in srgb, var(--qs-hand-assistant) 7%, var(--bg-base)); display: flex; flex-direction: column; gap: 8px; }
.qs-review[hidden] { display: none; }
.qs-review-head, .qs-review-note { margin: 0; }
.qs-review-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow: auto; }
.qs-review-list li { display: flex; flex-direction: column; gap: 3px; }
.qs-diff { margin: 0; padding: 6px 8px; border-radius: 6px; background: var(--bg-surface); font: 12px/1.45 var(--font-mono, ui-monospace, monospace); white-space: pre-wrap; overflow-x: auto; }
.qs-diff .qs-del { color: var(--bad-text); }
.qs-diff .qs-add { color: var(--ok-text); }
.qs-editor.qs-locked { opacity: 0.72; }

/* The reader's rules for proposals: held lines, held gates, blocked changes. */
.qs-held-line { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--qs-hand-person) 9%, transparent) 0 6px, transparent 6px 12px); }
.qc-held .qc-box, .qc-held .qc-ring { stroke-dasharray: 2 2; }
.qc-held .qc-box { fill: color-mix(in srgb, var(--qs-hand-person) 10%, var(--bg-surface)); }
.qs-rules { margin: 0 12px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-base); }
.qs-rules > summary { display: flex; align-items: center; gap: 8px; padding: 6px 10px; cursor: pointer; font: 12px var(--font-mono, ui-monospace, monospace); color: var(--text-secondary); }
.qs-rules > summary .qs-badge:empty { display: none; }
.qs-rules-body { display: flex; flex-direction: column; gap: 8px; padding: 0 10px 10px; }
.qs-rules-body .qs-note { margin: 0; }
.qs-chip-x { margin-left: 4px; border: 0; background: none; color: inherit; cursor: pointer; font: inherit; }
.qs-chip-x:focus-visible { outline: 2px solid var(--accent); }
.qs-review-list li.qs-blocked pre { opacity: 0.6; }
.qs-blocked-why { margin: 0; font-size: 12px; color: var(--bad-text); }

/* Predict first. */
.qs-check { display: inline-flex; align-items: center; gap: 6px; font: 12px var(--font-mono, ui-monospace, monospace); color: var(--text-secondary); cursor: pointer; }
.qs-check input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
.qs-predict { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px dashed var(--accent); border-radius: 8px; }
.qs-predict .qs-why { margin: 0; }
.qs-predicted { padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 7%, var(--bg-base)); }
.qs-predicted .qs-why, .qs-predicted .qs-note { margin: 0; }
/* The assistant's modes, and the hint it offers but never sends. */
.qs-ai-modes { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 12px 0; }
.qs-ai-modes .qs-select { width: 100%; }
.qs-stuck { border-style: dashed; border-color: var(--info-text); color: var(--info-text); }
@media (max-width: 900px) {
  .qs-grid { grid-template-columns: minmax(0, 1fr); }
  .qs-program { min-height: 0; }
  .qs-editor { min-height: 240px; max-height: 60vh; }
  .qs-brand { margin-right: 0; flex-basis: 100%; }
  .qs-status { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .qs * { transition: none !important; } }

/* Your taste: choices between programs the engine proves equal, a ranking with typicality beside it. */
.qs-taste { margin: 8px 12px 0; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-base); }
.qs-taste > summary { display: flex; align-items: center; gap: 8px; padding: 6px 10px; cursor: pointer; font: 12px var(--font-mono, ui-monospace, monospace); color: var(--text-secondary); }
.qs-taste > summary .qs-badge:empty { display: none; }
.qs-taste-body { display: flex; flex-direction: column; gap: 8px; padding: 0 10px 10px; }
.qs-taste-body .qs-note { margin: 0; }
.qs-taste-name { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.qs-taste-name .qs-input { width: 9em; }
.qs-taste-dial { display: flex; align-items: center; gap: 8px; font: 11px var(--font-mono, ui-monospace, monospace); color: var(--text-muted); }
.qs-taste-dial input { flex: 1; min-width: 0; accent-color: var(--accent); }
.qs-taste-pair:empty, .qs-taste-ranked:empty { display: none; }
.qs-taste-pair, .qs-taste-ranked { display: flex; flex-direction: column; gap: 6px; }
.qs-taste-sides { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.qs-taste-side { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 8px; border: 1px solid var(--border); border-radius: 8px; }
.qs-taste-side pre { margin: 0; max-height: 220px; }
.qs-taste-list { margin: 0; padding: 0 0 0 20px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.qs-taste-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.qs-taste-list .qs-chip { border: 0; cursor: pointer; }
.qs-taste-list .qs-chip:hover, .qs-taste-list .qs-chip:focus-visible { color: var(--text-primary); outline: 1px solid var(--accent); }
.qs-taste-typ { display: inline-flex; align-items: center; gap: 6px; font: 11px var(--font-mono, ui-monospace, monospace); font-variant-numeric: tabular-nums; color: var(--text-secondary); }
.qs-taste-bar { width: 48px; height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--accent) calc(var(--t) * 100%), var(--border) 0); }

/* The rewrite lens, and how an alternative is reached. */
.qs-rewrite-list { margin: 0; padding: 0 0 0 20px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.qs-rewrite-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 2px 4px; border-radius: 6px; }
.qs-rewrite-list li:hover, .qs-rewrite-list li:focus-within { background: color-mix(in srgb, var(--accent) 10%, transparent); outline: none; }
.qs-rewrite-why { flex: 1 1 220px; min-width: 0; color: var(--text-primary); }
.qs-rewrites.stale .qs-rewrite-list { opacity: 0.55; }
.qc-rewrite .qc-box, .qc-rewrite .qc-ring { stroke: var(--accent); stroke-width: 2.6; stroke-dasharray: none; fill: color-mix(in srgb, var(--accent) 18%, var(--bg-surface)); }
.qc-name.qc-rewrite { fill: var(--accent-text); font-weight: 650; }
.qs-chain summary { cursor: pointer; font: 11px var(--font-mono, ui-monospace, monospace); color: var(--text-muted); }
.qs-chain ol { margin: 4px 0 0; padding-left: 20px; font-size: 12px; color: var(--text-secondary); }
.qs-chain .qs-note { margin: 4px 0 0; }

/* Your own way: convergence on the model's proposals, and a while on one's own. */
.qs-converge { display: flex; flex-direction: column; gap: 6px; padding: 8px 12px 10px; border-top: 1px solid var(--border); }
.qs-converge .qs-note { margin: 0; }
.qs-converge.converging { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.qs-converge .qs-badge[hidden] { display: none; }

/* Features turned off, by the reader or by the condition of a study they take part in. */
.qs-off-critique #qs-critique,
.qs-off-alternatives .qs-alt,
.qs-off-workbench .qs-wb,
.qs-off-rules #qs-rules,
.qs-off-shortcuts #qs-shortcuts-panel,
.qs-off-novelty .qs-found, .qs-off-novelty .qs-novelty, .qs-off-novelty #qs-wb-novelty,
.qs-off-taste #qs-taste,
.qs-off-rewrites #qs-rewrites-panel, .qs-off-rewrites .qs-chain,
.qs-off-convergence #qs-converge-box,
.qs-off-predict_first label[for="qs-predict-first"] { display: none !important; }

/* The study, and your own record. */
.qs-study-body { display: flex; flex-direction: column; gap: 8px; padding: 8px 12px 12px; }
.qs-study-body .qs-note, .qs-study-body .qs-check { margin: 0; }
.qs-study-body [hidden] { display: none !important; }
.qs-study-offer:empty, .qs-study-out:empty { display: none; }
.qs-study-offer { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--border)); border-radius: 8px; }
.qs-study-name { font-size: 0.95rem; font-weight: 650; }
.qs-study-hyp { margin: 0; padding-left: 20px; font-size: 12px; color: var(--text-secondary); }
.qs-study-out { display: flex; flex-direction: column; gap: 6px; }
.qs-own { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.qs-own li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.qs-study-task { margin: 0; font-size: 12px; color: var(--text-primary); }
.qs-probe-answer { width: 100%; font: 12px/1.5 var(--font-mono, ui-monospace, monospace); resize: vertical; }
.qs-study-measures th { font-weight: 400; color: var(--text-secondary); text-align: left; }
.qs-study-flags summary { cursor: pointer; font: 12px var(--font-mono, ui-monospace, monospace); color: var(--text-secondary); }
.qs-flags { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 12px; }

/* Step through: the engine's debugger, and the state at each step. */
.qs-debug .qs-dbg-empty { margin: 0; padding: 10px 12px; }
.qs-dbg-body { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px 12px; }
.qs-dbg-body[hidden] { display: none; }
.qs-dbg-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.qs-dbg-controls input[type=range] { flex: 1; min-width: 120px; accent-color: var(--accent); }
.qs-dbg-next { margin: 0; font-size: 13px; }
.qs-dbg-body > .qs-note { margin: 0; }
.qs-dbg-part { border-top: 1px solid var(--border); padding-top: 6px; }
.qs-dbg-part > summary { cursor: pointer; font: 11px var(--font-mono, ui-monospace, monospace); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); }
.qs-dbg-part[hidden] { display: none; }
.qs-dbg-box { margin-top: 6px; overflow-x: auto; }
.qs-dbg-qubits { display: flex; flex-wrap: wrap; gap: 10px; }
.qs-dbg-qubit { margin: 0; display: flex; flex-direction: column; gap: 2px; align-items: center; min-width: 0; }
.qs-dbg-qubit figcaption { font-size: 12px; text-align: center; display: flex; flex-direction: column; }
.qs-dbg-pics { display: flex; align-items: center; gap: 4px; }
.qs-disk-edge { fill: none; stroke: var(--border-subtle); stroke-width: 1.2; }
.qs-disk-fill { fill: color-mix(in srgb, var(--accent) 55%, transparent); }
.qs-disk-hand { stroke: var(--text-primary); stroke-width: 1.6; stroke-linecap: round; }
.qs-disk-ring { fill: none; stroke: var(--info-text, var(--accent)); stroke-width: 2.4; stroke-linecap: round; }
.qs-bloch-edge { fill: color-mix(in srgb, var(--text-muted) 6%, transparent); stroke: var(--border-subtle); stroke-width: 1.2; }
.qs-bloch-equator { fill: none; stroke: var(--border-subtle); stroke-dasharray: 3 2; }
.qs-bloch-axis { stroke: var(--border-subtle); stroke-width: 0.8; }
.qs-bloch-label { fill: var(--text-muted); font-size: 9px; font-family: var(--font-mono, ui-monospace, monospace); }
.qs-bloch-vector { stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; }
.qs-bloch-tip { fill: var(--accent); }
.qs-dbg-amps .qs-table td, .qs-dbg-amps .qs-table th { padding: 2px 8px; }
.qs-dbg-amps .qs-disk { display: block; }
.qs-dbg-pick { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0; }
.qs-dbg-rho { border-collapse: collapse; font: 11px var(--font-mono, ui-monospace, monospace); font-variant-numeric: tabular-nums; }
.qs-dbg-rho th { color: var(--text-muted); font-weight: 400; padding: 2px 6px; }
.qs-dbg-rho td { padding: 3px 6px; text-align: center; background: color-mix(in srgb, var(--accent) calc(var(--qs-mag, 0) * 60%), transparent); }
.qs-dbg-overlay .qs-track { position: relative; }
.qs-ideal { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: var(--text-primary); }
.qs-dbg-tree ul { list-style: none; margin: 4px 0 0; padding-left: 16px; border-left: 1px solid var(--border); }
.qs-dbg-tree ul.qs-dbg-root { padding-left: 0; border-left: 0; }
.qs-dbg-tree li { margin: 3px 0; }
.qs-dbg-node { font: 12px var(--font-mono, ui-monospace, monospace); color: var(--text-secondary); }
.qs-dbg-branch.on { outline: 2px solid var(--accent); }
.qc-step .qc-box, .qc-step .qc-ring { stroke: var(--ok-text, var(--accent)); stroke-width: 2.8; stroke-dasharray: none; }

/* Editing by the drawing. */
.qs-palette { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 12px 0; }
.qs-gate-chip { border: 1px solid var(--border); cursor: grab; }
.qs-gate-chip[aria-pressed=true] { outline: 2px solid var(--accent); }
.qs-gate-chip:focus-visible { outline: 2px solid var(--accent); }
.qc-item[data-op] { cursor: grab; }
.qc-item[data-op]:focus-visible { outline: none; }
.qc-item[data-op]:focus-visible .qc-box, .qc-item[data-op]:focus-visible .qc-ring, .qc-selected .qc-box, .qc-selected .qc-ring { stroke: var(--accent); stroke-width: 2.8; }
.qc-dragging { opacity: 0.7; cursor: grabbing; }

/* Read by a screen reader, not shown. */
.qs-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Device targets: the coupling map, each pair and qubit in one of five bins of one hue
   by the device's own quantiles (an ordinal ramp: light to dark here, dark to light in
   the dark scheme, so the poorest stands out on either), the chosen layout ringed. */
.qs-device .qs-row { align-items: flex-end; }
.qs-dev-ctl { display: flex; gap: 10px; padding-top: 4px; }
.qs-dev-ctl .qs-field { flex: 0 1 220px; }
.qs-dev-map { overflow-x: auto; max-width: 100%; padding: 6px 0; }
.qs-dev-svg { display: block; max-width: 100%; height: auto; }
.qs-dev-pair { stroke-width: 3; stroke-linecap: round; }
.qs-dev-pair.qs-dev-b4 { stroke-width: 5.5; }
.qs-dev-pair.qs-dev-none { stroke: var(--border-subtle); stroke-dasharray: 3 3; }
.qs-dev-dot { stroke: var(--bg-surface); stroke-width: 2; }
.qs-dev-dot.qs-dev-none { fill: var(--bg-elevated); stroke: var(--border-subtle); stroke-dasharray: 2 2; }
.qs-dev-n { font: 9px var(--font-mono, ui-monospace, monospace); pointer-events: none; }
.qs-dev-ring { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.qs-dev-ring2 { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 3 2; }
.qs-dev-l { fill: var(--accent-text); font: 600 10px var(--font-mono, ui-monospace, monospace); }
.qs-dev-q:hover .qs-dev-dot { stroke: var(--text-primary); }
.qs-dev-legend { display: grid; gap: 4px; }
.qs-dev-key { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font: 10px var(--font-mono, ui-monospace, monospace); color: var(--text-secondary); }
.qs-dev-key .qs-k { flex: 1 0 100%; }
.qs-dev-sw { display: inline-flex; align-items: center; gap: 4px; }
.qs-dev-sw i { display: inline-block; width: 14px; height: 8px; border-radius: 2px; }
.qs-dev-table summary { cursor: pointer; font: 11px var(--font-mono, ui-monospace, monospace); color: var(--text-secondary); padding: 4px 0; }
/* Dark by default, as the tokens are; the light scheme takes the ramp the other way. */
:root, [data-theme="dark"] { --qs-dev-0: #184f95; --qs-dev-1: #256abf; --qs-dev-2: #3987e5; --qs-dev-3: #6da7ec; --qs-dev-4: #9ec5f4; --qs-dev-ink-lo: #fafaf9; --qs-dev-ink-hi: #0c0a09; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { --qs-dev-0: #86b6ef; --qs-dev-1: #5598e7; --qs-dev-2: #2a78d6; --qs-dev-3: #1c5cab; --qs-dev-4: #104281; --qs-dev-ink-lo: #0c0a09; --qs-dev-ink-hi: #fafaf9; }
}
[data-theme="light"] { --qs-dev-0: #86b6ef; --qs-dev-1: #5598e7; --qs-dev-2: #2a78d6; --qs-dev-3: #1c5cab; --qs-dev-4: #104281; --qs-dev-ink-lo: #0c0a09; --qs-dev-ink-hi: #fafaf9; }
.qs-dev-b0 { fill: var(--qs-dev-0); stroke: var(--qs-dev-0); background: var(--qs-dev-0); }
.qs-dev-b1 { fill: var(--qs-dev-1); stroke: var(--qs-dev-1); background: var(--qs-dev-1); }
.qs-dev-b2 { fill: var(--qs-dev-2); stroke: var(--qs-dev-2); background: var(--qs-dev-2); }
.qs-dev-b3 { fill: var(--qs-dev-3); stroke: var(--qs-dev-3); background: var(--qs-dev-3); }
.qs-dev-b4 { fill: var(--qs-dev-4); stroke: var(--qs-dev-4); background: var(--qs-dev-4); }
.qs-dev-dot.qs-dev-b0, .qs-dev-dot.qs-dev-b1, .qs-dev-dot.qs-dev-b2, .qs-dev-dot.qs-dev-b3, .qs-dev-dot.qs-dev-b4 { stroke: var(--bg-surface); }
.qs-dev-ink0, .qs-dev-ink1 { fill: var(--qs-dev-ink-lo); }
.qs-dev-ink2, .qs-dev-ink3, .qs-dev-ink4 { fill: var(--qs-dev-ink-hi); }
.qs-dev-inkn { fill: var(--text-secondary); }

/* The error-correction pane: the code's checks as faces (a colour code's in its
   three colours), violated checks lit, qubits flipped, corrected, in the
   residual or in the certificate's witness; the threshold plot's series. */
.qs-qec .qs-shortcuts-head { flex-wrap: wrap; }
.qs-qec .qs-small-input { width: auto; min-height: 26px; padding: 2px 6px; }
.qs-qec-lattice { max-width: 560px; max-height: none; overflow: visible; }
.qs-qec-svg { width: 100%; height: auto; display: block; }
.qs-qec-face { fill: color-mix(in srgb, var(--text-secondary) 10%, transparent); stroke: var(--border-subtle); stroke-width: 0.04; }
.qs-qec-face.c0 { fill: color-mix(in srgb, var(--bad-text) 16%, transparent); }
.qs-qec-face.c1 { fill: color-mix(in srgb, var(--std-text) 16%, transparent); }
.qs-qec-face.c2 { fill: color-mix(in srgb, var(--info-text) 16%, transparent); }
.qs-qec-face.on { fill: color-mix(in srgb, var(--warn-text) 55%, transparent); stroke: var(--warn-text); }
.qs-qec-edge { stroke: color-mix(in srgb, var(--text-secondary) 35%, transparent); stroke-width: 0.16; stroke-linecap: round; }
.qs-qec-edge.on { stroke: var(--warn-text); }
.qs-qec-qubit { cursor: pointer; outline: none; }
.qs-qec-hit { fill: transparent; }
.qs-qec-dot { fill: var(--bg-surface); stroke: var(--text-secondary); stroke-width: 0.05; }
.qs-qec-qubit.err .qs-qec-dot { fill: var(--bad-text); stroke: var(--bad-text); }
.qs-qec-qubit.fix .qs-qec-dot { stroke: var(--ok-text); stroke-width: 0.12; }
.qs-qec-qubit.res .qs-qec-dot { fill: var(--warn-text); }
.qs-qec-wit { fill: none; stroke: var(--accent); stroke-width: 0.07; stroke-dasharray: 0.1 0.06; }
.qs-qec-qubit:focus-visible .qs-qec-dot, .qs-qec-qubit:hover .qs-qec-dot { stroke: var(--focus-ring, var(--accent)); }
.qs-qec-line { fill: none; stroke-width: 2; stroke-linejoin: round; }
.qs-qec-plot .qs-qec-dot { stroke-width: 1.5; }
.qs-qec-plot .qs-qec-series .qs-qec-dot { fill: inherit; stroke: var(--bg-surface); }
.qs-qec-series.s0 { stroke: var(--accent); fill: var(--accent); }
.qs-qec-series.s1 { stroke: var(--info-text); fill: var(--info-text); }
.qs-qec-series.s2 { stroke: var(--std-text); fill: var(--std-text); }
.qs-qec-series.s3 { stroke: var(--warn-text); fill: var(--warn-text); }
.qs-qec-line.qs-qec-series { fill: none; }
.qs-qec-legend { stroke: none; font-size: 11px; }
.qs-qec-details > summary { cursor: pointer; list-style: none; }
.qs-qec-details > summary::-webkit-details-marker { display: none; }
.qs-qec-details > summary::before { content: '▸'; color: var(--text-muted); margin-right: 6px; }
.qs-qec-details[open] > summary::before { content: '▾'; }

/* The pulse pane: each frame a lane, plays as their envelopes, captures hatched. */
.qs-pulse .qs-shortcuts-head { flex-wrap: wrap; }
.qs-pulse .qs-small-input { width: 5em; min-height: 26px; padding: 2px 6px; }
.qs-pulse-timeline { max-width: 760px; max-height: none; overflow: visible; }
.qs-pulse-svg { width: 100%; height: auto; display: block; font: 10px var(--font-mono, ui-monospace, monospace); }
.qs-pulse-base { stroke: var(--border-subtle, var(--border)); stroke-width: 1; }
.qs-pulse-frame { fill: var(--text-primary, currentColor); font-weight: 600; }
.qs-pulse-port, .qs-pulse-axis text, .qs-pulse-call-label { fill: var(--text-muted, currentColor); }
.qs-pulse-axis line { stroke: var(--border-subtle, var(--border)); }
.qs-pulse-box { fill: color-mix(in srgb, var(--info-text) 10%, transparent); stroke: none; }
.qs-pulse-lane.measure .qs-pulse-box { fill: color-mix(in srgb, var(--text-secondary) 10%, transparent); }
.qs-pulse-env { fill: none; stroke: var(--info-text); stroke-width: 1.4; stroke-linejoin: round; }
.qs-pulse-lane.measure .qs-pulse-env { stroke: var(--text-secondary); }
.qs-pulse-cap { fill: color-mix(in srgb, var(--warn-text) 22%, transparent); stroke: var(--warn-text); stroke-width: 1; stroke-dasharray: 3 2; }
.qs-pulse-barrier { stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: 2 2; }
.qs-pulse-tick { fill: var(--std-text); }
.qs-pulse-bracket { fill: none; stroke: var(--text-secondary); stroke-width: 1; }
.qs-pulse-details > summary { list-style: none; cursor: pointer; }
.qs-pulse-details > summary::-webkit-details-marker { display: none; }
.qs-pulse-details > summary::before { content: '▸'; color: var(--text-muted); margin-right: 6px; }
.qs-pulse-details[open] > summary::before { content: '▾'; }
/* Answer views: an answer in the answer view layer, each view drawn as its statement arrives. */
.qs-answers > summary { cursor: pointer; font-weight: 600; }
.qs-answers .qs-row { align-items: flex-end; }
.qs-av-input { width: 100%; box-sizing: border-box; font: 12px var(--font-mono, ui-monospace, monospace); }
.qs-av { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.qs-av-shell { display: flex; flex-direction: column; gap: 10px; }
.qs-av-card { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.qs-av-card[data-state="dropped"], .qs-av-card[data-state="refused"] { border-color: color-mix(in srgb, var(--bad-text) 40%, var(--border)); }
.qs-av-what { color: var(--text-secondary); }
.qs-av-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.qs-av-circuit, .qs-av-live { overflow-x: auto; max-width: 100%; }
.qs-av-bloch { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.qs-av-diags { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-secondary); }
.qs-av-diag.warning { color: var(--text-muted); }
.qs-ai-proposal.qs-set-aside { opacity: 0.6; }
.qs-tel { font-size: 12px; margin: 4px 0; }
.qs-tel > summary { cursor: pointer; color: var(--text-secondary); }
/* The course: the lessons beside the lesson, its exercise checked by the engine. */
.qs-course[hidden] { display: none; }
.qs-course-body { display: grid; grid-template-columns: minmax(180px, 240px) minmax(0, 1fr); gap: 0; min-height: 0; }
.qs-course-list { padding: 8px 10px; border-right: 1px solid var(--border); max-height: 640px; overflow: auto; }
.qs-course-unit { margin-bottom: 8px; }
.qs-course-unit ol { margin: 4px 0 0; padding: 0; list-style: none; }
.qs-course-item { display: block; width: 100%; text-align: left; padding: 4px 6px; border: 0; border-radius: 5px; background: none; color: var(--text-primary); font: 12px var(--font-sans, system-ui, sans-serif); cursor: pointer; overflow-wrap: anywhere; }
.qs-course-item:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.qs-course-item[aria-current="true"] { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.qs-course-mark { display: inline-block; width: 1.1em; color: var(--text-muted); }
.qs-course-item.done .qs-course-mark { color: var(--ok-text, var(--std-text, #10b981)); }
.qs-course-lesson { padding: 10px 14px 12px; min-width: 0; line-height: 1.55; }
.qs-course-title { margin: 2px 0 6px; font-size: 16px; }
.qs-course-text p, .qs-course-text li { margin: 0 0 8px; }
.qs-course-text h3, .qs-course-text h4, .qs-course-text h5 { margin: 12px 0 6px; font-size: 13px; }
.qs-course-text code, .qs-course-exercise code { font-family: var(--font-mono, ui-monospace, monospace); font-size: 12px; }
.qs-code { margin: 0 0 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-base); overflow-x: auto; font-size: 12px; }
.qs-course-exercise { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--border-subtle); border-radius: 8px; background: var(--bg-base); }
.qs-course-task { margin: 4px 0 6px; font-weight: 600; }
.qs-course-must, .qs-course-cases, .qs-course-rules, .qs-course-wrong ul { margin: 4px 0 8px; padding-left: 18px; font-size: 12px; }
.qs-course-cases, .qs-course-rules { list-style: none; padding-left: 0; }
.qs-course-rules li.bad, .qs-course-cases li.bad { color: var(--bad-text, #f87171); }
.qs-course-result p { margin: 8px 0 4px; }
.qs-course-hints { margin: 8px 0 4px; padding-left: 18px; font-size: 12px; }
.qs-course-wrong, .qs-course-asked { margin-top: 8px; padding: 8px 10px; border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); border-radius: 4px; font-size: 12px; overflow-wrap: anywhere; }
.qs-course-engine { display: block; color: var(--text-secondary); font-family: var(--font-mono, ui-monospace, monospace); font-size: 11px; }
.qs-course-nav { justify-content: space-between; margin-top: 10px; }
#qs-course-companion { padding: 6px 14px 10px; margin: 0; border-top: 1px solid var(--border); }
.qs-course-side { min-width: 0; border-right: 1px solid var(--border); }
.qs-course-side .qs-course-list { border-right: 0; }
.qs-course-extras { padding: 8px 10px 12px; border-top: 1px solid var(--border-subtle); font-size: 12px; }
.qs-course-extras .qs-k { margin-top: 8px; }
.qs-course-extras ul, .qs-course-extras ol { margin: 4px 0; padding: 0; list-style: none; }
.qs-course-extras li.ok { color: var(--ok-text, var(--std-text, #10b981)); }
.qs-course-assess { margin: 2px 0 0; padding: 0; list-style: none; }
.qs-course-task { font-style: italic; }
.qs-course-question { margin: 0 0 8px; padding: 6px 10px; border-left: 3px solid var(--accent); font-style: italic; color: var(--text-secondary); }
.qs-course-beside { margin-top: 8px; padding: 8px 10px; border: 1px dashed var(--border); border-radius: 6px; font-size: 12px; overflow-wrap: anywhere; }
.qs-course-diagnosis { margin: 8px 0 0; padding: 6px 10px; border-radius: 6px; border: 1px solid var(--border); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.qs-course-diagnosis.found { border-color: color-mix(in srgb, var(--warn-text) 45%, var(--border)); background: color-mix(in srgb, var(--warn-text) 6%, var(--bg-base)); }
.qs-course-beside p { margin: 4px 0; }
.qs-course-beside-lines { margin: 4px 0 0; padding-left: 16px; font-family: var(--font-mono, ui-monospace, monospace); font-size: 11px; }
.qs-course-file { display: none; }
.qs-course-credential-of { min-height: 26px; padding: 2px 6px; max-width: 100%; }
#qs-course-record-out { overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .qs-course-body { grid-template-columns: minmax(0, 1fr); }
  .qs-course-list { border-right: 0; border-bottom: 1px solid var(--border); max-height: 220px; }
  .qs-course-side { border-right: 0; border-bottom: 1px solid var(--border); }
}

/* The Notebook pane, and the page a notebook is exported as (notebook-page.js): cells
   down the page, each with its source and the output the engine gave it. build.mjs
   writes these rules after studio.css in dist/studio.css, and into the exported page.
   Every colour is a token; a cell's state is a word on its badge and a colour on its
   edge, never the colour alone. */
.qs-nb[hidden] { display: none; }
.qs-nb { color-scheme: light dark; }
.qs-nb > .qs-head { flex-wrap: wrap; row-gap: 6px; }
.qs-nb .qs-select { flex: 0 1 auto; min-width: 0; max-width: 100%; }
.qs-nb-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.qs-nb-title { flex: 1 1 100%; width: 100%; min-height: 36px; font: 600 15px var(--font-sans, system-ui, sans-serif); }
.qs-nb-actions { align-items: center; }
.qs-nb-status { margin: 0; padding: 8px 12px 0; font-size: 12px; color: var(--text-secondary); }
.qs-nb-status:empty { display: none; }
.qs-nb-status.ok { color: var(--ok-text); }
.qs-nb-status.bad { color: var(--bad-text); }
.qs-nb-status.run { color: var(--info-text); }
.qs-nb-cells { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 12px; list-style: none; }
.qs-nb-cell { --edge: var(--border-subtle); min-width: 0; border: 1px solid var(--border); border-left: 3px solid var(--edge); border-radius: var(--qs-radius, 8px); background: var(--bg-base); }
.qs-nb-cell[data-state="fresh"] { --edge: color-mix(in srgb, var(--ok-text) 55%, var(--border)); }
.qs-nb-cell[data-state="stale"], .qs-nb-cell[data-state="waiting"], .qs-nb-cell[data-state="running"] { --edge: color-mix(in srgb, var(--info-text) 70%, var(--border)); }
.qs-nb-cell[data-state="blocked"], .qs-nb-cell[data-state="refused"], .qs-nb-cell[data-state="unread"] { --edge: color-mix(in srgb, var(--bad-text) 70%, var(--border)); }
.qs-nb-cell[data-kind="text"] { --edge: var(--border); }
.qs-nb-cell-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 6px 10px; border-bottom: 1px solid var(--border); }
.qs-nb-kind { padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-text); font: 600 12px var(--font-sans, system-ui, sans-serif); }
.qs-nb-id { width: 16ch; min-height: 28px; padding: 3px 6px; font-size: 13px; }
.qs-nb-id[aria-invalid="true"], .qs-nb-src[aria-invalid="true"], .qs-nb-inputs[aria-invalid="true"] { border-color: var(--bad-text); }
.qs-nb-id-text { font: 13px var(--font-mono, ui-monospace, monospace); color: var(--text-secondary); }
.qs-nb-state { font-size: 12px; }
.qs-nb-cell[data-state="running"] .qs-nb-state { border-style: dashed; }
.qs-nb-tools { display: inline-flex; gap: 4px; margin-left: auto; }
.qs-nb-move, .qs-nb-delete { min-width: 28px; }
.qs-nb-cell[data-kind="view"] .qs-field { flex: 1 1 160px; }
.qs-nb-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; min-width: 0; }
.qs-nb-cell[data-kind="text"] .qs-nb-body { grid-template-columns: minmax(0, 1fr); }
.qs-nb-source, .qs-nb-output { min-width: 0; padding: 10px 12px; }
.qs-nb-output { border-left: 1px solid var(--border); background: var(--bg-surface); }
.qs-nb-source { display: flex; flex-direction: column; gap: 8px; }
.qs-nb-src { display: block; width: 100%; min-height: 88px; resize: vertical; font: 13px/1.5 var(--font-mono, ui-monospace, monospace); white-space: pre; overflow: auto; tab-size: 2; }
.qs-nb-md-src { white-space: pre-wrap; }
.qs-nb-md { max-width: 72ch; font: 15px/1.6 var(--font-sans, system-ui, sans-serif); color: var(--text-primary); text-wrap: pretty; }
.qs-nb-md p, .qs-nb-md li { margin: 0 0 8px; }
.qs-nb-md h3, .qs-nb-md h4, .qs-nb-md h5 { margin: 4px 0 8px; font-size: 18px; line-height: 1.3; text-wrap: balance; }
.qs-nb-md code { font: 13px var(--font-mono, ui-monospace, monospace); }
.qs-nb-md ul, .qs-nb-md ol { margin: 0 0 8px; padding-left: 20px; }
.qs-nb-edit > summary { cursor: pointer; font-size: 12px; color: var(--text-secondary); }
.qs-nb-edit[open] > summary { margin-bottom: 6px; }
.qs-nb-out { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: 13px; line-height: 1.5; }
.qs-nb-out.empty .qs-note, .qs-nb-why { font-size: 12px; }
.qs-nb-why { margin: 0; padding: 0 12px 8px; color: var(--text-secondary); }
.qs-nb-why[hidden] { display: none; }
.qs-nb-line { margin: 0; overflow-wrap: anywhere; }
.qs-nb-line.bad, .qs-nb-check.bad, .qs-nb-verified[data-valid="false"] { color: var(--bad-text); }
.qs-nb-check.ok, .qs-nb-verified[data-valid="true"] { color: var(--ok-text); }
.qs-nb-check[hidden] { display: none; }
.qs-nb-mono { font: 13px var(--font-mono, ui-monospace, monospace); font-variant-numeric: tabular-nums; }
.qs-nb-receipt, .qs-nb-energy { font: 12px var(--font-mono, ui-monospace, monospace); color: var(--text-secondary); }
.qs-nb-verdict { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.qs-nb-verified { font-size: 12px; }
.qs-nb-checks { display: flex; flex-direction: column; gap: 4px; }
.qs-nb-json > summary { cursor: pointer; font-size: 12px; color: var(--text-secondary); }
.qs-nb-json pre { max-height: 280px; margin: 6px 0 0; white-space: pre; }
.qs-nb-view { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.qs-nb-view-title { margin: 0; font-weight: 600; font-size: 13px; }
.qs-nb-bars { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.qs-nb-bar { display: grid; grid-template-columns: minmax(3ch, max-content) minmax(40px, 1fr) minmax(6ch, max-content); align-items: center; gap: 8px; font: 13px var(--font-mono, ui-monospace, monospace); font-variant-numeric: tabular-nums; }
.qs-nb-bar-track { height: 14px; border-radius: 3px; background: color-mix(in srgb, var(--text-primary) 8%, transparent); overflow: hidden; }
.qs-nb-bar-fill { display: block; height: 100%; min-width: 1px; background: var(--accent-fill, var(--accent)); }
.qs-nb-bar-n { text-align: right; color: var(--text-secondary); }
.qs-nb-table-wrap { max-width: 100%; overflow-x: auto; }
.qs-nb-table { font-size: 12px; }
.qs-nb-add { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 12px 12px; }
.qs-nb-add .qs-note { font-size: 12px; margin-right: 2px; }
#qs-nb-kept { margin: 0; padding: 0 12px 10px; font-size: 12px; }
.qs-nb-program { margin: 0; max-height: 360px; }
/* The exported page: the notebook alone, read at a comfortable width. */
.qs-nb-cell > .qs-nb-check { margin: 0; padding: 6px 12px 8px; border-top: 1px solid var(--border); }
.qs-nb-page .qs-nb-cell[data-kind="view"] .qs-nb-body { grid-template-columns: minmax(0, 1fr); }
.qs-nb-page .qs-nb-cell[data-kind="view"] .qs-nb-output { border-left: 0; border-top: 1px solid var(--border); }
.qs-nb-view-src { margin: 0; font-size: 12px; }
.qs-nb-page { max-width: 1280px; margin: 0 auto; padding: 16px; }
.qs-nb-about { margin: 0; padding: 10px 12px 0; font-size: 13px; line-height: 1.5; color: var(--text-secondary); }
#wq-engine { margin: 0; padding: 6px 12px 0; font-size: 12px; }
#wq-engine.bad { color: var(--bad-text); }
@media (max-width: 900px) {
  .qs-nb-body { grid-template-columns: minmax(0, 1fr); }
  .qs-nb-output { border-left: 0; border-top: 1px solid var(--border); }
  .qs-nb-cells { padding: 10px 8px; }
  .qs-nb-id { width: 10ch; }
}
