/* qclew, the tool (/qclew; lens/qclew.js): a workspace, not a page of the site. lens/lens.js puts body.qclew-app on
   that page only, and everything here hangs under it, so the site's own look (washi.css, themes.css) is untouched
   elsewhere. The site's chrome is hidden; the site's tokens are remapped so the parts that stay (Ariadne's panel and
   face, the sign-in) take the workspace's look. Inspired by the Claude app: a quiet sidebar, one accent, plain
   borders, a composer that is a box with a button in it. Light and dark follow the site's theme unless the reader
   picks one in the status bar (body[data-qa-scheme]). */

body.qclew-app {
  --qa-side: 248px; --qa-panel: 400px;
  --qa-bg: #f4f3ee; --qa-surface: #ffffff; --qa-surface-2: #faf9f6; --qa-line: #e2e0d8; --qa-line-2: #ecebe5;
  --qa-ink: #1f1e1b; --qa-ink-2: #5d5b55; --qa-ink-3: #77756e;
  --qa-accent: #bd5a39; --qa-on-accent: #ffffff; --qa-accent-tint: #f7e9e3; --qa-hover: #ebe9e2; --qa-active: #e3e1d9; --qa-bubble: #ebe9e2;
  --qa-kw: #b4532f; --qa-kw2: #7d5a3a; --qa-str: #2f6b4f; --qa-num: #2d5f8c; --qa-q: #8a5a00; --qa-q-bg: #fff1c2; --qa-com: #8b8982; --qa-err: #b93b2e; --qa-err-bg: #fdecea;
  --qa-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --qa-serif: "Iowan Old Style", "Palatino Linotype", Charter, Georgia, serif;
  --qa-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  /* the site's tokens, remapped */
  --void: var(--qa-bg); --substrate: var(--qa-bg); --surface: var(--qa-surface); --surface-raised: var(--qa-surface);
  --hairline: var(--qa-line); --edge: var(--qa-line); --ring: var(--qa-accent);
  --ink: var(--qa-ink); --ink-2: var(--qa-ink-2); --ink-3: var(--qa-ink-3);
  --accent: var(--qa-accent); --on-accent: var(--qa-on-accent); --accent-tint: var(--qa-accent-tint); --accent-3-tint: var(--qa-accent-tint);
  --thread: var(--qa-accent); --thread-glow: var(--qa-accent-tint); --hypha: var(--qa-accent); --tension: var(--qa-err);
  --font-ui: var(--qa-sans); --font-serif: var(--qa-sans); --font-sans: var(--qa-sans); --font-mono: var(--qa-mono);
  --radius: 12px; --radius-sm: 8px; --shadow: none;
  font-family: var(--qa-sans); background: var(--qa-bg); color: var(--qa-ink); color-scheme: light;
}
body.qclew-app[data-qa-scheme="dark"] {
  --qa-bg: #262624; --qa-surface: #2f2f2d; --qa-surface-2: #2a2a28; --qa-line: #3f3f3b; --qa-line-2: #363633;
  --qa-ink: #ecece7; --qa-ink-2: #b9b8b1; --qa-ink-3: #93928b;
  --qa-accent: #d97757; --qa-on-accent: #1f1e1b; --qa-accent-tint: #44302a; --qa-hover: #383835; --qa-active: #41413d; --qa-bubble: #3a3a37;
  --qa-kw: #e8916f; --qa-kw2: #c9a88a; --qa-str: #9ccfae; --qa-num: #8fb8e3; --qa-q: #e6b94c; --qa-q-bg: #4a3d16; --qa-com: #8e8d86; --qa-err: #f08a7e; --qa-err-bg: #4a2a27;
  color-scheme: dark;
}
body.qclew-app :focus-visible { outline: 2px solid var(--qa-accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- the site's chrome goes; the workspace takes the window ---------- */
body.qclew-app .topbar, body.qclew-app #hyphae, body.qclew-app .site-foot, body.qclew-app .chapter-foot, body.qclew-app .ask-btn,
body.qclew-app .records-link, body.qclew-app #chapter-head, body.qclew-app #chapter-walk, body.qclew-app #chapter-primer, body.qclew-app #chapter-knot { display: none !important; }
body.qclew-app main#app { position: fixed; inset: 0; margin: 0; padding: 0; max-width: none; overflow: hidden; background: var(--qa-surface); }
body.qclew-app #journey-view { height: 100%; }
@media (min-width: 1000px) {
  body.qclew-app.ap-open main#app { right: var(--qa-panel); margin: 0; }
}

/* ---------- the frame: sidebar | main ---------- */
.qa { display: grid; grid-template-columns: auto minmax(0, 1fr); height: 100%; font-size: 14px; line-height: 1.5; }
.qa[data-side="closed"] .qa-side { display: none; }
.qa-spacer { flex: 1; }
.qa .vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.qa-ib { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--qa-ink-2); cursor: pointer; }
.qa-ib:hover { background: var(--qa-hover); color: var(--qa-ink); }
.qa-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--qa-line); border-radius: 8px; background: var(--qa-surface); color: var(--qa-ink); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.qa-btn:hover { background: var(--qa-hover); }
.qa-btn.primary { background: var(--qa-accent); border-color: var(--qa-accent); color: var(--qa-on-accent); }
.qa-btn.primary:hover { filter: brightness(1.06); }
.qa-btn:disabled { opacity: 0.5; cursor: default; }

/* the sidebar */
.qa-side { width: var(--qa-side); display: flex; flex-direction: column; min-height: 0; background: var(--qa-bg); border-right: 1px solid var(--qa-line); }
.qa-side-top { display: flex; align-items: center; justify-content: space-between; height: 48px; padding: 0 8px 0 16px; }
.qa-logo { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; color: var(--qa-ink); }
.qa-new, .qa-side-btn { display: flex; align-items: center; gap: 8px; margin: 2px 10px 6px; height: 34px; padding: 0 12px; border: 1px solid var(--qa-line); border-radius: 8px; background: var(--qa-surface); color: var(--qa-ink); font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; }
.qa-new:hover, .qa-side-btn:hover { background: var(--qa-hover); }
.qa-new span { font-size: 16px; line-height: 1; color: var(--qa-ink-2); }
.qa-nav { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 10px 10px; scrollbar-width: thin; }
.qa-nav h3 { margin: 14px 6px 4px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--qa-ink-3); }
.qa-list { list-style: none; margin: 0; padding: 0; }
.qa-item { display: block; width: 100%; padding: 6px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--qa-ink); font: inherit; font-size: 13.5px; text-align: left; text-decoration: none; cursor: pointer; }
.qa-item:hover { background: var(--qa-hover); }
.qa-item[aria-current="true"] { background: var(--qa-active); font-weight: 600; }
.qa-item-t { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qa-item-s { display: block; font-size: 12px; color: var(--qa-ink-3); }
.qa-mine-row { display: flex; align-items: center; gap: 2px; }
.qa-mine-row .qa-item { flex: 1; min-width: 0; }
.qa-del { width: 26px; height: 26px; font-size: 16px; opacity: 0; }
.qa-mine-row:hover .qa-del, .qa-del:focus-visible { opacity: 1; }
.qa-side-note { padding: 4px 8px; font-size: 12.5px; color: var(--qa-ink-3); line-height: 1.45; }
.qa-side-foot { display: flex; flex-direction: column; gap: 6px; padding: 10px 10px 12px; border-top: 1px solid var(--qa-line); }
.qa-side-who { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 8px; color: var(--qa-ink); font-size: 13px; font-weight: 500; text-decoration: none; }
.qa-side-who:hover { background: var(--qa-hover); }
.qa-av { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--qa-accent-tint); color: var(--qa-accent); font-size: 12px; font-weight: 700; }
.qa-who-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qa-side-back { padding: 0 6px; font-size: 12.5px; color: var(--qa-ink-3); text-decoration: none; }
.qa-side-back::before { content: "\2190  "; }
.qa-side-back:hover { color: var(--qa-ink); }
.qa-backdrop { display: none; }

/* the main column */
.qa-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--qa-surface); container-type: inline-size; container-name: work; }
.qa-top { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 10px; border-bottom: 1px solid var(--qa-line); }
.qa[data-side="open"] #qa-side-open { display: none; }
.qa-name { width: min(34ch, 40%); height: 32px; padding: 0 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--qa-ink); font: inherit; font-size: 14px; font-weight: 600; }
.qa-name:hover { background: var(--qa-hover); }
.qa-name:focus { background: var(--qa-surface); border-color: var(--qa-line); outline: none; }
.qa-name::placeholder { color: var(--qa-ink-3); font-weight: 500; opacity: 1; }
.qa-dirty { font-size: 12px; color: var(--qa-ink-3); }
.qa-ari { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 4px; margin-left: 4px; border: 1px solid var(--qa-line); border-radius: 999px; background: var(--qa-surface); color: var(--qa-ink); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.qa-ari img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.qa-ari:hover { background: var(--qa-hover); }
.qa-ari[aria-pressed="true"] { background: var(--qa-accent-tint); border-color: var(--qa-accent); }

/* the editor and the results, split */
.qa-work { --qa-split: 55%; flex: 1; min-height: 0; display: grid; grid-template-rows: minmax(140px, var(--qa-split)) 7px minmax(120px, 1fr); grid-template-columns: minmax(0, 1fr); }
.qa-split { background: var(--qa-line-2); cursor: row-resize; touch-action: none; }
.qa-split:hover, .qa-split:focus-visible { background: var(--qa-accent); outline: none; }
@container work (min-width: 1150px) {
  .qa-work { grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(320px, var(--qa-split)) 7px minmax(320px, 1fr); }
  .qa-split { cursor: col-resize; }
}

.qa-editor { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.qa-code { flex: 1; min-height: 0; display: flex; position: relative; }
.qa-ln, .qa-hl, .qa-box textarea { margin: 0; font-family: var(--qa-mono); font-size: 13.5px; line-height: 1.65; tab-size: 2; }
.qa-ln { flex: none; width: 46px; padding: 14px 10px 14px 0; overflow: hidden; text-align: right; color: var(--qa-ink-3); background: var(--qa-surface-2); border-right: 1px solid var(--qa-line-2); user-select: none; }
.qa-ln span.e { color: var(--qa-err); font-weight: 600; }
.qa-box { position: relative; flex: 1; min-width: 0; }
.qa-hl, .qa-box textarea { position: absolute; inset: 0; box-sizing: border-box; padding: 14px 16px; white-space: pre; overflow-wrap: normal; border: 0; }
.qa-hl { overflow: hidden; pointer-events: none; color: var(--qa-ink); }
.qa-box textarea { overflow: auto; resize: none; outline: none; background: transparent; color: transparent; caret-color: var(--qa-ink); }
.qa-box textarea::selection { background: color-mix(in srgb, var(--qa-accent) 24%, transparent); }
.qa-hl .k { color: var(--qa-kw); }
.qa-hl .k2 { color: var(--qa-kw2); }
.qa-hl .s { color: var(--qa-str); }
.qa-hl .n { color: var(--qa-num); }
.qa-hl .q { color: var(--qa-q); background: var(--qa-q-bg); border-radius: 3px; }
.qa-hl .c { color: var(--qa-com); font-style: italic; }
.qa-hl .ln.err { background: var(--qa-err-bg); box-shadow: 0 0 0 2px var(--qa-err-bg); border-radius: 2px; }
.qa-machines { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 7px 14px; border-top: 1px solid var(--qa-line-2); font-size: 12.5px; color: var(--qa-ink-2); }
.qa-machines-k { font-weight: 600; color: var(--qa-ink-3); }
.qa-m { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.qa-m input[type="checkbox"] { width: 14px; height: 14px; margin: 0; accent-color: var(--qa-accent); }
.qa-depth input { width: 5ch; height: 22px; padding: 0 2px 0 6px; border: 1px solid var(--qa-line); border-radius: 6px; background: var(--qa-surface); color: var(--qa-ink); font: inherit; font-size: 12.5px; }
.qa-machines-s { margin-left: auto; color: var(--qa-ink-3); }

.qa-results { min-height: 0; min-width: 0; overflow-y: auto; background: var(--qa-surface-2); scrollbar-width: thin; }
.qa-res-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 12px; padding: 8px 18px; background: var(--qa-surface-2); border-bottom: 1px solid var(--qa-line-2); font-size: 12px; }
.qa-res-title { font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--qa-ink-2); }
.qa-res-meta { margin-left: auto; color: var(--qa-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qa-res-body { padding: 4px 18px 28px; max-width: 780px; }
.qa-empty { padding: 10px 0; color: var(--qa-ink-2); font-size: 14px; line-height: 1.6; max-width: 640px; }
.qa-empty p { margin: 0 0 10px; }
.qa-empty-lede { font-size: 15.5px; color: var(--qa-ink); }
.qa-link { padding: 0; border: 0; background: none; color: var(--qa-accent); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.qa-link:hover { color: var(--qa-ink); }
.qa-keys { color: var(--qa-ink-3); font-size: 12.5px; }
.qa-keys kbd { display: inline-block; min-width: 1.2em; padding: 0 5px; border: 1px solid var(--qa-line); border-bottom-width: 2px; border-radius: 5px; background: var(--qa-surface); font-family: var(--qa-mono); font-size: 11px; text-align: center; }

/* the results' sections: the primer kit's classes (lens/primer.css, washi.css), restyled as cards */
body.qclew-app .qa-sec { margin: 12px 0 0; padding: 14px 16px; border: 1px solid var(--qa-line); border-radius: 12px; background: var(--qa-surface); }
body.qclew-app .qa-sec.qa-answer { border-left: 3px solid var(--qa-accent); }
body.qclew-app .qa-memo .pk-k + .pk-k, body.qclew-app .qa-memo .pk-read + .pk-k, body.qclew-app .qa-memo .pk-big + .pk-k { margin-top: 14px; }
body.qclew-app .qa-memo .pk-read { margin: 4px 0 0; }
body.qclew-app .qa-memo .qa-memo-q { margin-left: 14px; padding-left: 10px; border-left: 2px solid var(--qa-line); }
/* the decision board: who is in and who is out, as chips; a slot per row for an assign */
body.qclew-app .qa-dec { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0 4px; }
body.qclew-app .qa-dec-slots { grid-template-columns: 1fr; gap: 8px; }
body.qclew-app .qa-dec-head { display: block; margin-bottom: 6px; font-family: var(--qa-sans); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--qa-ink-3); }
body.qclew-app .qa-slot-cap { margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--qa-bg); font-weight: 500; text-transform: none; letter-spacing: 0; }
body.qclew-app .qa-slot-cap.is-full { background: var(--qa-accent-tint); color: var(--qa-accent); }
body.qclew-app .qa-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
body.qclew-app .qa-chip { padding: 5px 10px; border-radius: 8px; font-family: var(--qa-sans); font-size: 13.5px; font-weight: 500; line-height: 1.3; border: 1px solid var(--qa-line); background: var(--qa-bg); color: var(--qa-ink); }
body.qclew-app .qa-chip.is-in { border-color: var(--qa-accent); background: var(--qa-accent-tint); color: var(--qa-ink); }
body.qclew-app .qa-chip.is-out { color: var(--qa-ink-3); text-decoration: line-through; text-decoration-color: var(--qa-line); }
body.qclew-app .qa-chip-none { color: var(--qa-ink-3); font-style: italic; }
body.qclew-app .qa-chip.is-split { border-style: dashed; border-color: var(--qa-ink-3); }
body.qclew-app .qa-rb-n { font-weight: 400; color: var(--qa-ink-3); }
body.qclew-app .qa-chip.is-surer { border-style: dotted; }  /* the machine settled it; exact search leaves it open */
body.qclew-app .qa-robust { grid-column: 1 / -1; margin: 2px 0 10px 38px; padding: 8px 10px; border-left: 2px solid var(--qa-line); }
body.qclew-app .qa-robust .pk-small { margin: 0 0 6px; }
body.qclew-app .qa-rb { margin: 0; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
body.qclew-app .qa-robust .qa-memo-list { margin: 8px 0 0; }
/* the memo's lists: reasons as bullets, promises as ticks */
body.qclew-app .qa-memo-list { margin: 4px 0 0; padding-left: 18px; }
body.qclew-app .qa-memo-list li { margin: 3px 0; font-size: 14px; line-height: 1.5; color: var(--qa-ink-2); }
body.qclew-app .qa-memo-list.qa-check { list-style: none; padding-left: 0; }
body.qclew-app .qa-memo-list.qa-check li::before { content: "✓"; display: inline-block; width: 18px; color: var(--qa-accent); font-weight: 700; }
/* Ariadne's take */
body.qclew-app .qa-take { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 4px; }
body.qclew-app .qa-take-text { flex-basis: 100%; margin: 4px 0 0; padding: 10px 12px; border-left: 3px solid var(--qa-accent); background: var(--qa-bg); border-radius: 0 8px 8px 0; }
/* the quantum check: a hundred readings as dots, a tick or a cross */
body.qclew-app .qa-qc { display: grid; grid-template-columns: 28px 1fr; gap: 4px 10px; align-items: start; margin: 6px 0; }
body.qclew-app .qa-qc-mark { grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; background: var(--qa-bg); color: var(--qa-ink-3); }
body.qclew-app .qa-qc.is-ok .qa-qc-mark { background: var(--qa-accent-tint); color: var(--qa-accent); }
body.qclew-app .qa-qc.is-no .qa-qc-mark { background: var(--qa-bg); color: var(--qa-ink-2); }
body.qclew-app .qa-qc-body { font-size: 14px; line-height: 1.5; color: var(--qa-ink-2); }
body.qclew-app .qa-dots { display: grid; grid-template-columns: repeat(20, 9px); gap: 3px; margin-top: 2px; }
body.qclew-app .qa-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--qa-line); }
body.qclew-app .qa-dots i.on { background: var(--qa-accent); }
body.qclew-app .qa-engine { margin-top: 12px; }
body.qclew-app .qa-engine summary { cursor: pointer; font-family: var(--qa-sans); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--qa-ink-3); }
@media (max-width: 560px) { body.qclew-app .qa-dec { grid-template-columns: 1fr; } }
body.qclew-app .qa-sec .pk-k { display: block; margin: 0 0 8px; font-family: var(--qa-sans); font-size: 11.5px; font-weight: 600; font-variant: normal; letter-spacing: 0.06em; text-transform: uppercase; color: var(--qa-ink-3); }
body.qclew-app .pk-read, body.qclew-app .pk-qc-list, body.qclew-app .pk-errs { font-family: var(--qa-sans); font-size: 14px; line-height: 1.55; color: var(--qa-ink-2); }
body.qclew-app .pk-read { margin: 8px 0 0; }
body.qclew-app .pk-read:first-of-type { margin-top: 0; }
body.qclew-app .pk-big { margin: 6px 0 0; font-family: var(--qa-sans); font-size: 16px; line-height: 1.5; color: var(--qa-ink); }
body.qclew-app .pk-big b, body.qclew-app .pk-read b { font-weight: 600; color: var(--qa-ink); }
body.qclew-app .pk-small { margin: 8px 0 0; font-family: var(--qa-sans); font-size: 12.5px; line-height: 1.5; color: var(--qa-ink-3); }
body.qclew-app .pk-qc-list { margin: 6px 0 0; padding-left: 18px; }
body.qclew-app .pk-qc-list li, body.qclew-app .pk-errs li { margin-bottom: 4px; }
body.qclew-app .pk-errs { margin: 0; padding-left: 18px; color: var(--qa-ink); }
body.qclew-app .pk-errs b { color: var(--qa-err); font-weight: 600; }
body.qclew-app .pk-qc-warn { color: var(--qa-ink); }
body.qclew-app .pk-rb-never li { color: var(--qa-ink); font-weight: 500; }
body.qclew-app .pk-rb-qs { margin: 6px 0 10px; padding-left: 20px; }
body.qclew-app .pk-rb-q { margin-bottom: 10px; }
body.qclew-app .pk-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
body.qclew-app .pk-row .chip, body.qclew-app .chip { height: 30px; padding: 0 10px; border: 1px solid var(--qa-line); border-radius: 8px; background: var(--qa-surface); color: var(--qa-ink); font-family: var(--qa-sans); font-size: 13px; font-weight: 500; cursor: pointer; }
body.qclew-app .chip:hover { background: var(--qa-hover); border-color: var(--qa-line); color: var(--qa-ink); }
body.qclew-app .pk-num, body.qclew-app .pk-text { height: 30px; padding: 0 8px; border: 1px solid var(--qa-line); border-radius: 8px; background: var(--qa-surface); color: var(--qa-ink); font: inherit; font-size: 13px; }
body.qclew-app .pk-num { width: 7ch; }
body.qclew-app .pk-text { flex: 1 1 24ch; min-width: 0; }
body.qclew-app .pk-rb-teach { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--qa-line-2); }
body.qclew-app details.pk-qc { padding: 10px 16px; }
body.qclew-app details.pk-qc > summary { font-family: var(--qa-sans); font-size: 13px; font-weight: 500; color: var(--qa-ink-2); cursor: pointer; }
body.qclew-app details.pk-qc > summary:hover { color: var(--qa-ink); }
body.qclew-app .pk-qc-json { margin: 10px 0 0; padding: 10px 12px; max-height: 360px; overflow: auto; border: 1px solid var(--qa-line); border-radius: 8px; background: var(--qa-bg); font-family: var(--qa-mono); font-size: 12px; line-height: 1.5; }
body.qclew-app .pk-read code, body.qclew-app .pk-small code { padding: 0 4px; border-radius: 4px; background: var(--qa-bg); font-family: var(--qa-mono); font-size: 0.92em; }

/* the status bar */
.qa-status { display: flex; align-items: center; gap: 12px; height: 30px; padding: 0 6px 0 14px; border-top: 1px solid var(--qa-line); font-size: 12px; color: var(--qa-ink-2); }
.qa-status-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qa-pos { font-family: var(--qa-mono); font-size: 11.5px; color: var(--qa-ink-3); }
#qa-scheme { width: 26px; height: 26px; }

/* ---------- Ariadne's panel as the chat: docked, plain, with the composer as a box ---------- */
body.qclew-app .ariadne-panel { --ap-head: 64px; --ap-foot: 150px; top: 0; right: 0; bottom: 0; width: var(--qa-panel); border-radius: 0; border-left: 1px solid var(--qa-line); box-shadow: none; background: var(--qa-bg); }
body.qclew-app .ap-head { height: 64px; box-sizing: border-box; padding: 0 10px 0 16px; border-bottom: 1px solid var(--qa-line); }
body.qclew-app .ap-head img { width: 32px; height: 32px; box-shadow: none; }
body.qclew-app .ap-who h2 { font-size: 15px; font-weight: 600; }
body.qclew-app .ap-ctx { font-size: 12.5px; }
body.qclew-app .ap-close { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--qa-ink-2); }
body.qclew-app .ap-close:hover { background: var(--qa-hover); color: var(--qa-ink); }
body.qclew-app #ariadne-stage.ag-stage { --ag-face: clamp(96px, 16vh, 150px); padding-top: 10px; }
body.qclew-app .ag-face { border-radius: 14px; }
body.qclew-app .ag-face::after { border-radius: 14px; }
body.qclew-app .ag-ctl { padding: 6px 12px 2px; }
body.qclew-app .ag-btn { width: 28px; height: 28px; }
body.qclew-app .ag-speed { min-width: 32px; font-size: 11.5px; }
body.qclew-app .ap-log { padding: 8px 16px 12px; gap: 10px; }
body.qclew-app .ap-log::before { display: none; }
body.qclew-app .ap-mark { display: none; }
body.qclew-app .ap-msg { max-width: 100%; font-size: 14.5px; line-height: 1.55; }
body.qclew-app .ap-her { padding: 2px 2px; background: none; border-radius: 0; font-family: var(--qa-serif); font-size: 15.5px; color: var(--qa-ink); }
body.qclew-app .ap-me { padding: 9px 13px; background: var(--qa-bubble); color: var(--qa-ink); border-radius: 14px 14px 4px 14px; }
body.qclew-app .ap-her a { color: var(--qa-accent); }
body.qclew-app .ap-src a { min-height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; }
body.qclew-app .ap-fine { font-family: var(--qa-sans); font-size: 12px; }
body.qclew-app .ag-goto { font-size: 13px; padding: 3px 10px; }
body.qclew-app .ag-link { font-family: var(--qa-sans); font-size: 12.5px; }
body.qclew-app .ap-foot { gap: 8px; padding: 8px 0 12px; }
body.qclew-app .ap-chips { display: none; }
body.qclew-app .ap-form { padding: 0 14px; }
body.qclew-app .ap-row { align-items: center; gap: 6px; padding: 5px 5px 5px 14px; border: 1px solid var(--qa-line); border-radius: 14px; background: var(--qa-surface); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); }
body.qclew-app .ap-row:focus-within { border-color: var(--qa-accent); }
body.qclew-app .ap-row input { height: 36px; padding: 0; border: 0; border-radius: 0; background: transparent; font-size: 14.5px; }
body.qclew-app .ap-row input:focus { outline: none; }
body.qclew-app .ap-row button { width: 32px; height: 32px; border-radius: 9px; background: var(--qa-accent); color: var(--qa-on-accent); }
body.qclew-app .ap-row button svg { width: 16px; height: 16px; }
.qa-mode { padding: 0 14px; }
.qa-mode-pills { display: inline-flex; padding: 2px; border: 1px solid var(--qa-line); border-radius: 999px; background: var(--qa-surface); }
.qa-mode-pills button { height: 24px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; color: var(--qa-ink-2); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; }
.qa-mode-pills button[aria-checked="true"] { background: var(--qa-ink); color: var(--qa-bg); }
.qa-mode-note { margin: 6px 2px 0; font-size: 12.5px; line-height: 1.45; color: var(--qa-ink-3); }
.qa-mode-note[hidden] { display: none; }

/* ---------- narrower windows ---------- */
@media (max-width: 999px) {
  body.qclew-app .ariadne-panel { top: 8px; right: 8px; bottom: 8px; width: min(400px, calc(100vw - 16px)); border: 1px solid var(--qa-line); border-radius: 16px; box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.4); }
}
@media (max-width: 899px) {
  .qa { grid-template-columns: minmax(0, 1fr); }
  .qa[data-side="closed"] .qa-side, .qa-side { display: flex; position: fixed; top: 0; bottom: 0; left: 0; z-index: 31; width: min(300px, 85vw); transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: 0 0 0 1px var(--qa-line); }
  .qa[data-side="open"] .qa-side { transform: none; }
  .qa[data-side="open"] .qa-backdrop { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, 0.35); }
  .qa[data-side="open"] #qa-side-open { display: inline-grid; }
  .qa-top { padding: 0 6px; gap: 6px; }
  .qa-name { width: 40%; }
  .qa-machines-s { display: none; }
}
@media (max-width: 640px) {
  #qt-download, .qa-ari span, .qa-dirty { display: none; }
  .qa-ari { padding-right: 4px; }
  body.qclew-app .ariadne-panel { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: calc(100dvh - 16px); }
  .qa-res-body { padding: 4px 12px 24px; }
  .qa-status { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) { .qa-side { transition: none; } }

/* ---------- the brief (brief.py): the decision, then every item with its reason and a what-if ----------
   These base rules apply wherever the editor is drawn, Lesson 13 included; the app's look is layered under
   body.qclew-app further down. */
.qa-verdict { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em; text-transform: none; vertical-align: middle; color: var(--ink); background: var(--substrate); }
.qa-verdict-tie, .qa-verdict-close { background: var(--thread-glow, var(--accent-tint)); color: var(--thread, var(--accent)); }
.qa-why { list-style: none; margin: 8px 0 0; padding: 0; }
.qa-why-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 4px 10px; align-items: start; padding: 9px 0; border-top: 1px solid var(--hairline); }
.qa-why-row:first-child { border-top: 0; }
.qa-why-mark { display: inline-block; margin-top: 2px; padding: 1px 0; border-radius: 6px; text-align: center; font-family: var(--font-sans); font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.is-in .qa-why-mark { color: var(--thread, var(--accent)); background: var(--thread-glow, var(--accent-tint)); }
.is-out .qa-why-mark { color: var(--ink-3); background: var(--substrate); }
.qa-why-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 15px; line-height: 1.5; }
.qa-why-id b { font-weight: 600; color: var(--ink); }
.qa-why-w { margin-left: 8px; font-size: 12.5px; color: var(--ink-3); }
.qa-why-text { color: var(--ink-2); }
.is-out .qa-why-text { color: var(--ink-2); }
.qa-why-wi { font-size: 13px; color: var(--ink-3); }
.qa-why-act { margin-top: 2px; white-space: nowrap; }
.qa-why-no { font-size: 12.5px; color: var(--ink-3); }
.qa-whatif { margin: 8px 0 12px; padding: 12px 14px; border: 1px solid var(--thread, var(--accent)); border-radius: 12px; background: var(--thread-glow, var(--accent-tint)); }
.qa-whatif[hidden] { display: none; }
.qa-whatif .pk-k { display: flex; align-items: center; justify-content: space-between; }
.qa-whatif .pk-big { margin-top: 0; }
.qa-whatif-close { font-size: 12.5px; text-transform: none; letter-spacing: 0; }
@media (max-width: 640px) { .qa-why-row { grid-template-columns: 34px minmax(0, 1fr); } .qa-why-act { grid-column: 2; } }

body.qclew-app .qa-why-body { font-size: 14px; }
body.qclew-app .qa-why-row { border-top-color: var(--qa-line-2); }
body.qclew-app .qa-why-mark { font-family: var(--qa-sans); }
body.qclew-app .is-in .qa-why-mark { color: var(--qa-accent); background: var(--qa-accent-tint); }
body.qclew-app .is-out .qa-why-mark { color: var(--qa-ink-3); background: var(--qa-bg); }
body.qclew-app .qa-whatif { border-color: var(--qa-accent); background: var(--qa-accent-tint); }
body.qclew-app .qa-verdict { background: var(--qa-bg); color: var(--qa-ink-2); }
body.qclew-app .qa-verdict-tie, body.qclew-app .qa-verdict-close { background: var(--qa-accent-tint); color: var(--qa-accent); }
