/* ======================================================================
   LITMUS — shared app shell for dramaturg.html (chat) and reality.html (feed)
   Minimal, editorial, app-like. Extends the corpus's own paper/ink/vermillion
   palette (see /styles.css :root) rather than replacing it — this file only
   restyles the two Litmus screens, scoped under body.litmus so every other
   page on the site is untouched.
   ====================================================================== */

body.litmus {
  /* Litmus's own palette — minimal grayscale, not the book's warm cream+vermillion.
     --brand is ink itself (black buttons/links, no color as decoration); --acid/--neutral/--base
     stay reserved for the three-tier claim system (speculative/exploratory/established)
     and true alert states (offline, stop, delete) — the only places color carries meaning. */
  --paper: #f5f5f3;
  --paper-2: #eaeae7;
  --ink: #131315;
  --ink-soft: #38383d;
  --muted: #74747a;
  --faint: #b8b8bd;
  --surface: #ffffff;
  --border: rgba(19,19,21,.09);
  --shadow-sm: 0 1px 2px rgba(19,19,21,.06);
  --shadow-md: 0 14px 30px -10px rgba(19,19,21,.2);
  --shadow-lg: 0 -8px 24px rgba(19,19,21,.12);
  --r-lg: 20px; --r-md: 14px; --r-pill: 999px;
  --acid: #e2300c;              /* speculative / alert — reserved, not a general accent */
  --neutral: #1f8a70;           /* exploratory — teal */
  --base: #2f5fa8;              /* established — blue */
  --brand: var(--ink);          /* Litmus's own accent — plain ink, no added color */
  --brand-ink: #ffffff;
  --sans: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  background: var(--paper);
  background-image: none;
}
body.litmus .ruler-gutter,
body.litmus > #measure,
body.litmus > .topbar,
body.litmus .colophon { display: none; }
/* the book site reserves 36px on every <main> for that hidden ruler-gutter —
   Litmus doesn't use it, and the leftover asymmetric padding was quietly
   shifting the whole page (grid, dock, everything) left of true center. */
body.litmus main { padding-left: 0; }

body.litmus a { color: var(--brand); text-underline-offset: 2px; }
body.litmus a:hover { color: var(--ink-soft); }

/* ---- app shell ---------------------------------------------------- */
.litmus-shell {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
.litmus-top {
  flex: 0 0 auto; height: 60px; display: flex; align-items: center; gap: 10px;
  padding: 0 max(16px, env(safe-area-inset-left)) 0 max(18px, env(safe-area-inset-left));
  border-bottom: 1px solid transparent;
}
.litmus-mark { flex: 0 0 auto; }
body.litmus a.litmus-word {
  font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 21px;
  color: var(--ink); text-decoration: none; letter-spacing: -0.005em;
}
.litmus-spacer { flex: 1; }
.litmus-iconbtn {
  width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; color: var(--ink-soft); flex: 0 0 auto; background: none; border: none; cursor: pointer;
}
.litmus-iconbtn:hover { background: var(--paper-2); }
.litmus-iconbtn svg { width: 19px; height: 19px; }


/* ---- tier language everywhere on Litmus screens -------------------- */
body.litmus .tierflag {
  font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: 0;
  text-transform: none; padding: 1px 7px; border-radius: var(--r-pill); background: var(--paper-2);
}
body.litmus .tierflag.t-established { color: var(--base); background: rgba(47,95,168,.1); }
body.litmus .tierflag.t-exploratory { color: var(--neutral); background: rgba(138,79,196,.1); }
body.litmus .tierflag.t-speculative { color: var(--acid); background: rgba(226,48,12,.1); }
body.litmus .tierflag.t-unverifiable { color: var(--muted); background: var(--paper-2); }

.litmus-tierbar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--paper-2); margin-bottom: 2px; }
#out .litmus-tierbar, #out .litmus-legend { margin-left: 2px; margin-right: 2px; }
#out .litmus-legend { margin-bottom: 14px; }
.litmus-tierbar span { display: block; height: 100%; }
.litmus-tierbar .e { background: var(--base); }
.litmus-tierbar .x { background: var(--neutral); }
.litmus-tierbar .s { background: var(--acid); }
.litmus-tierbar .u { background: var(--faint); }
.litmus-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.litmus-legend span { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--ink-soft); }
.litmus-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.litmus-legend i.e { background: var(--base); } .litmus-legend i.x { background: var(--neutral); }
.litmus-legend i.s { background: var(--acid); } .litmus-legend i.u { background: var(--faint); }

/* ---- soft buttons/pills used across both screens ------------------- */
.litmus-pillbtn {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--sans);
  font-size: 13px; font-weight: 700; padding: 10px 16px; border-radius: var(--r-pill);
  background: var(--brand); color: var(--brand-ink); border: none; cursor: pointer;
}
.litmus-pillbtn:disabled { opacity: .55; cursor: default; }
.litmus-ghostbtn {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--sans);
  font-size: 12.5px; font-weight: 700; padding: 8px 13px; border-radius: var(--r-pill);
  background: var(--paper-2); color: var(--ink-soft); border: none; cursor: pointer;
}

/* ====================================================================
   CHAT SHELL (dramaturg.html) — restyles the existing .ws-* structure.
   Extra specificity (body.litmus …) wins over /styles.css without !important.
   ==================================================================== */
body.litmus.agentic { background: var(--paper); }
body.litmus .ws-shell { background: var(--paper); }

/* no top bar at all — the mission header sits directly at the top of the page */
body.litmus .ws-topbar, body.litmus .ws-stop { display: none; }

/* ---- hovering dock: just the one chat bar, floats over the scrolling grid,
   detached from the document flow — never pushed around by content, and the
   grid can scroll fully clear beneath it (see #log padding-bottom). ---- */
body.litmus .litmus-dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  padding: 0 max(14px, env(safe-area-inset-left)) max(10px, env(safe-area-inset-bottom));
  pointer-events: none; /* the dock box spans the full width even though the composer inside it
    is centered — without this, its empty padding silently ate clicks meant for whatever sits
    underneath it (the settings button in the sidebar footer, at the same bottom-left corner). */
}
body.litmus .litmus-dock > * { pointer-events: auto; }

/* ---- jump-to-latest: appears above the composer while the AI writes, only
   when the reader scrolled up and the follow paused itself ---- */
body.litmus .followbtn {
  display: block; margin: 0 auto 8px;
  font-family: var(--sans); font-size: 12px; font-weight: 700;
  color: var(--ink-soft); background: var(--surface);
  border: none; border-radius: var(--r-pill); padding: 8px 14px;
  box-shadow: var(--shadow-md); cursor: pointer;
}
body.litmus .followbtn[hidden] { display: none; }
body.litmus .followbtn:hover { color: var(--brand-ink); background: var(--brand); }

/* ---- single toggle: the pill mark. No chevron, no second glyph.
   Kept as display:none guard in case any cached markup still renders it. ---- */
body.litmus .rail-collapse { display: none !important; }

/* ---- drawer hero: the pill is the toggle, always visible.
   Open: [pill] Litmus. Collapsed: [pill] centered on the rail axis. ---- */
body.litmus .lbb-hero {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; margin: 14px 12px 12px; padding: 0 4px;
  border: none; background: none; cursor: pointer; text-align: left; border-radius: 10px;
}
body.litmus .lbb-hero:focus-visible { outline: 2px solid var(--ink-soft); outline-offset: 2px; }
body.litmus .lbb-hero b { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 30px; line-height: 1; transform: translateY(5.5px); color: var(--ink); transition: color .1s ease; }
body.litmus .lbb-hero:hover b { color: var(--brand); }
body.litmus .lbb-hero .lbb-mark { display: flex; line-height: 0; color: var(--ink); flex: 0 0 auto; }
body.litmus .lbb-hero .lit-mark { display: block; }
body.litmus .lbb-hero .lit-mark-fill { transform-box: fill-box; }
body.litmus:not(.nav-open) .lbb-hero .lbb-word { display: none; }
body.litmus:not(.nav-open) .lbb-hero { justify-content: center; margin: 14px 0 12px; padding: 0; }
/* the mark reacts: hover diffuses the field — color as behavior, never as
   permanent branding. While a run executes, the wave hides and the
   full-interior field shows instead: the whole pill interior becomes the
   gradient (no liquid level, no fill line), clipped by the pill silhouette,
   with the black stroke painted above it in the DOM. */
body.litmus .lbb-hero:hover .lit-mark-fill { fill: url(#litmarkreact); }
body.litmus .lbb-hero .lit-mark-field { display: none; }
body.litmus[data-run="executing"] .lit-mark-fill { display: none; }
body.litmus[data-run="executing"] .lit-mark-field { display: block; }
@media (prefers-reduced-motion: reduce) {
  body.litmus[data-run="executing"] .lit-mark-fill { animation: none; }
}

/* ---- settings lives in the sidebar footer — a restrained icon button,
   anchored to the rail's bottom on the same center axis ---- */
body.litmus .ws-rail-footer { position: relative; margin: 6px 6px 14px; display: flex; }
body.litmus .lbb-settings {
  display: flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  margin-left: 8px;
  color: var(--ink-soft); background: var(--surface); border: none; border-radius: 50%; padding: 0; cursor: pointer;
}
body.litmus:not(.nav-open) .ws-rail-footer { justify-content: center; margin: 6px 0 14px; }
body.litmus:not(.nav-open) .lbb-settings { margin-left: 0; }
/* rail + panel sit above the floating composer where they overlap */
body.litmus .ws-rail { z-index: 30; }
body.litmus .lbb-settings svg { width: 19px; height: 19px; }
/* styles.css's generic #toolsbtn::before ("⊕ ", in the base site's red) is meant for
   the plain-text "⊕ tools" button on other workstation surfaces — both reuse the id,
   so it leaks onto Litmus's icon-only settings button unless killed here. */
body.litmus #toolsbtn::before { content: none; }
body.litmus .lbb-settings:hover, body.litmus .lbb-settings[aria-expanded="true"] { color: var(--brand-ink); background: var(--brand); }
/* the settings dropdown: tool chips, then a divider, then auto + run-local as plain rows.
   Viewport-fixed (the rail clips anything inside itself with overflow:hidden).
   Anchored bottom-left above the gear in BOTH states — same screen spot whether
   the drawer is open or collapsed. Open drawer is 270px, so left:12px +
   230px width sits inside it, never outside past "New conversation". */
body.litmus .toolspanel {
  position: fixed; top: auto; right: auto; bottom: 64px; left: 12px; width: 230px; height: auto;
  /* styles.css's generic .toolspanel (a different, top-right dropdown) sets
     min-width:300px — wider than this footer ever is, so it pushed the panel
     past the sidebar's own right edge unless killed here too. */
  min-width: 0; margin: 0;
  display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; max-height: 60vh; overflow-y: auto;
}
body.litmus.nav-open .toolspanel { left: 12px; }
@media (max-width: 720px) {
  body.litmus .toolspanel, body.litmus.nav-open .toolspanel { left: 12px; width: min(230px, calc(100vw - 24px)); }
}
body.litmus .toolschips { display: flex; flex-direction: column; gap: 2px; }
body.litmus .toolschips .chip.tool { width: 100%; text-align: left; border-radius: var(--r-md); }
body.litmus .settingsdiv { height: 1px; background: var(--border); margin: 6px 4px; }
body.litmus .settingsrow {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  font-family: var(--sans); font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
  background: none; border: none; border-radius: var(--r-md); padding: 8px 8px; cursor: pointer;
}
body.litmus .settingsrow:hover { background: var(--paper-2); }
body.litmus .localtoggle .localdot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
body.litmus .localtoggle .localdot[data-state="online"] { background: #2c9e5b; }
body.litmus .localtoggle .localdot[data-state="offline"] { background: var(--acid); }

/* ---- side dashboard (recent chats) — starts open, stays open through whatever
   happens in the conversation (new chat, loading a past one — nothing closes it
   automatically anymore); the toggle is the only thing that opens or closes it.
   On desktop it pushes the content over rather than sitting on top of it, so it
   can never cover the chat bubbles/grid; on narrow screens there's no room to
   push, so it overlays instead — never dimmed either way, it's a persistent
   panel, not a modal. Simple and legible throughout so nothing here falls back
   to the dark workstation theme in styles.css. ---- */
/* Collapsed = a true 68px icon rail (mark / + / settings on one center axis),
   not a squeezed drawer. Open = the 270px drawer. Nothing else changes width. */
body.litmus .ws-rail { background: var(--paper-2); border-right: 1px solid var(--border); padding-top: 4px; top: 0; width: 68px !important; }
body.litmus.nav-open .ws-rail { width: 270px !important; }
body.litmus .ws-rail ~ .ws-scrim ~ .ws-center { margin-left: 0 !important; transition: margin-left .35s cubic-bezier(.16,1,.3,1); }
body.litmus .litmus-dock { transition: left .35s cubic-bezier(.16,1,.3,1); }
@media (min-width: 721px) {
  /* collapsed rail (68px) or open drawer (270px) — the canvas glides, never jumps */
  body.litmus .ws-rail ~ .ws-scrim ~ .ws-center { margin-left: 68px !important; }
  body.litmus .litmus-dock { left: 68px; }
  body.litmus.nav-open .ws-rail ~ .ws-scrim ~ .ws-center { margin-left: 270px !important; }
  body.litmus.nav-open .litmus-dock { left: 270px; }
}
@media (max-width: 720px) {
  /* no room to push on phones: closed means gone, open means overlay.
     Cap the overlay width so the drawer can never swallow a very narrow
     viewport whole (arcade iframes included). */
  body.litmus .ws-rail { width: 0 !important; }
  body.litmus.nav-open .ws-rail { width: min(270px, 88vw) !important; }
}
/* narrow screens start closed, so the pill toggle inside the drawer is
   unreachable — a floating opener (same pill glyph) appears top-left only
   while closed. It shares the drawer's quiet material, never a loud CTA. */
body.litmus .rail-fab { display: none; }
@media (max-width: 720px) {
  body.litmus:not(.nav-open) .rail-fab {
    display: flex; position: fixed; top: 12px; left: 12px; z-index: 35;
    align-items: center; justify-content: center; width: 44px; height: 44px;
    border-radius: 50%; background: var(--surface); color: var(--ink);
    border: none; box-shadow: var(--shadow-md); cursor: pointer;
  }
  body.litmus:not(.nav-open) .rail-fab:hover { background: var(--brand); color: var(--brand-ink); }
  body.litmus:not(.nav-open) .rail-fab:focus-visible { outline: 2px solid var(--ink-soft); outline-offset: 2px; }
}
/* a persistent panel shouldn't block the page behind it — the scrim only
   catches tap-outside-to-close on narrow screens, where the open sidebar
   genuinely overlaps the content; on desktop it does nothing at all. */
@media (max-width: 720px) {
  body.litmus.nav-open .ws-scrim {
    display: block; position: fixed; inset: 0; background: transparent; z-index: 15;
  }
  /* the base site's phone composer rule sets min-height:3rem (~2 lines) — Litmus's
     composer should start as small as the pill allows, growing only as you type */
  body.litmus .sayrow #say { min-height: 0; }
}
/* new conversation: quiet text + plus, never the loudest black on screen —
   the user's own messages keep that role. Collapsed: just the ＋, centered. */
body.litmus .ws-new {
  display: flex; align-items: center; gap: 9px; width: calc(100% - 24px); margin: 2px 12px 12px;
  background: none; border: none; color: var(--ink-soft); border-radius: var(--r-md);
  font-family: var(--sans); font-size: 13px; font-weight: 600; padding: 9px 10px; cursor: pointer; text-align: left;
}
body.litmus .ws-new .plus { font-size: 15px; font-weight: 400; line-height: 1; flex: 0 0 auto; }
body.litmus .ws-new:hover { background: var(--surface); color: var(--ink); }
/* collapsed: a quiet 40px round button on the rail axis, label gone */
body.litmus:not(.nav-open) .ws-new {
  justify-content: center; align-items: center; margin: 2px auto 12px; padding: 0;
  width: 40px; height: 40px; border-radius: 50%;
}
body.litmus:not(.nav-open) .ws-new .lbl { display: none; }
body.litmus .ws-rail-label { font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--muted); text-transform: uppercase; padding: 0 12px 6px; }
body.litmus .hist-empty { font-family: var(--sans); font-size: 12px; line-height: 1.5; color: var(--muted); padding: 4px 12px; }
/* history as typography, not cards: title over timestamp, hairline between rows.
   The live conversation gets a small black dot + stronger text — no pill. */
body.litmus .hist-row { position: relative; display: flex; align-items: stretch; margin: 0 12px; background: none; border-bottom: 1px solid rgba(19,19,21,.07); }
body.litmus .hist-row:last-child { border-bottom: none; }
body.litmus .hist-row:hover { background: none; }
body.litmus .hist-it {
  flex: 1; min-width: 0; text-align: left; border: 0; background: none; cursor: pointer;
  padding: 10px 4px 10px 16px; font-family: var(--sans); color: var(--ink-soft);
}
body.litmus .hist-it:hover, body.litmus .hist-row:hover .hist-it { background: none; color: var(--ink); }
body.litmus .hist-it b { display: block; font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; }
body.litmus .hist-it time { display: block; font-family: var(--sans); font-size: 11px; color: var(--muted); margin-top: 2px; }
body.litmus .hist-row.is-active .hist-it b { color: var(--ink); font-weight: 700; }
body.litmus .hist-row.is-active::before {
  content: ""; position: absolute; left: 2px; top: 50%; width: 6px; height: 6px;
  border-radius: 50%; background: var(--ink); transform: translateY(-50%);
}
/* collapsed rail shows mark + ＋ + settings only — the list fades out fast
   so titles never visibly squish while the drawer glides shut. */
body.litmus .ws-hist, body.litmus .ws-rail-label { transition: opacity .16s ease, visibility .16s ease; }
body.litmus:not(.nav-open) .ws-hist, body.litmus:not(.nav-open) .ws-rail-label { opacity: 0; visibility: hidden; }
body.litmus.nav-open .ws-hist, body.litmus.nav-open .ws-rail-label { transition-delay: .12s; }

/* recent-chat row menu — opened by double-click, positioned at the click point */
body.litmus .histmenu {
  position: fixed; z-index: 40; width: 140px;
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-md); padding: 6px;
  display: flex; flex-direction: column; gap: 2px;
}
body.litmus .histmenu[hidden] { display: none; }
body.litmus .histmenu-opt {
  display: block; width: 100%; text-align: left;
  font-family: var(--sans); font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
  background: none; border: none; border-radius: var(--r-md); padding: 8px 9px; cursor: pointer;
}
body.litmus .histmenu-opt:hover { background: var(--paper-2); color: var(--acid); }


/* #log, not .log — body.pandora #log in styles.css sets a lopsided
   padding-right (0.25rem) that a class selector can't outrank */
/* composer is fixed: the feed needs composer height + clearance below it,
   or the last row slides permanently underneath the input. */
body.litmus #log { padding: 16px max(16px, env(safe-area-inset-left)) 200px; gap: 20px; }
/* the base site's fresh (pre-first-message) state makes #log content-sized for a
   centered welcome — Litmus has no welcome content, so that leaves a thread
   taller than the viewport with nothing scrollable around it (dead trackpad).
   On Litmus the thread is always the bounded internal scroller. */
body.litmus.fresh #log { flex: 1 1 auto; }
/* ---- app lock: only the message column scrolls. The shell is already a fixed
   100dvh column with #log as its internal scroller — pin the page itself so the
   sidebar + floating composer stay put and the thread moves behind them. ---- */
body.litmus.agentic { overflow: hidden; height: 100dvh; }
/* ---- the scroller as infrastructure: a near-invisible 8px rail, transparent
   track, rounded low-opacity thumb. It deepens while scrolling or on hover,
   then fades back when idle (see the is-scrolling class in learn.js). Native
   scrolling, keyboard, and assistive tech are untouched — only the paint. ---- */
body.litmus #log, body.litmus .ws-hist {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  overscroll-behavior: contain;
}
body.litmus #log::-webkit-scrollbar, body.litmus .ws-hist::-webkit-scrollbar { width: 8px; }
body.litmus #log::-webkit-scrollbar-track, body.litmus .ws-hist::-webkit-scrollbar-track { background: transparent; }
body.litmus #log::-webkit-scrollbar-button, body.litmus .ws-hist::-webkit-scrollbar-button { display: none; }
body.litmus #log::-webkit-scrollbar-thumb, body.litmus .ws-hist::-webkit-scrollbar-thumb {
  background: rgba(19,19,21,.08);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
body.litmus #log:hover::-webkit-scrollbar-thumb, body.litmus .ws-hist:hover::-webkit-scrollbar-thumb { background: rgba(19,19,21,.2); background-clip: padding-box; }
body.litmus #log.is-scrolling::-webkit-scrollbar-thumb { background: rgba(19,19,21,.32); background-clip: padding-box; }
body.litmus #log:hover, body.litmus #log.is-scrolling,
body.litmus .ws-hist:hover { scrollbar-color: rgba(19,19,21,.28) transparent; }
@media (prefers-reduced-motion: reduce) {
  body.litmus #log::-webkit-scrollbar-thumb, body.litmus .ws-hist::-webkit-scrollbar-thumb { background: rgba(19,19,21,.2); background-clip: padding-box; }
}
body.litmus .turn { max-width: 88%; align-self: flex-start; gap: 4px; }
body.litmus .turn .who {
  font-family: var(--sans); font-size: 10px; font-weight: 700; letter-spacing: .03em;
  text-transform: uppercase; color: var(--muted); padding-left: 3px;
}
body.litmus .turn.you {
  /* width:fit-content is load-bearing: .ubody's overflow-wrap:anywhere (needed so a
     genuinely long unbroken string can still wrap) makes Chrome's shrink-to-fit sizing
     collapse toward min-content — one character — without it, turning "hey" into a
     three-line stack instead of a normal one-line bubble. */
  /* the user's vessel: same physical language as Litmus's, mirrored — the tight
     corner sits bottom-right since this one docks right. Stays visually quieter
     than the answer (smaller measure) so the response keeps center of gravity. */
  align-self: flex-end; width: fit-content; max-width: min(560px, 82%); background: var(--ink); color: var(--paper);
  font-size: clamp(20px, 1.35vw, 23px);
  padding: 18px 28px; border-radius: 42px 42px 14px 42px;
  box-shadow: 0 1px 2px rgba(19,19,21,.12), 0 18px 34px -24px rgba(19,19,21,.5);
  interpolate-size: allow-keywords;
  transition: border-radius .55s cubic-bezier(.22,1,.36,1), transform .25s ease, box-shadow .25s ease;
}
body.litmus .turn.you.is-long { border-radius: 30px 30px 12px 30px; }
body.litmus .turn.you:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 3px rgba(19,19,21,.12), 0 24px 44px -24px rgba(19,19,21,.55);
}
body.litmus .turn.you.lit-enter { animation: lit-vessel-in .5s cubic-bezier(.22,1.05,.36,1) both; }
body.litmus .turn.you .who { display: none; }
/* max-width:none is load-bearing: the base .ubody rule sets max-width:82% on this
   element too, inside a parent that's itself sized to fit this element's content —
   a circular percentage reference Chrome resolves by collapsing the box toward
   one character per line ("hey" rendering as three stacked letters). The visual
   82% cap on the bubble already lives on .turn.you; .ubody doesn't need its own. */
body.litmus .turn.you .ubody { max-width: none; font-family: var(--serif); font-size: 1em; line-height: 1.28; letter-spacing: -0.015em; white-space: pre-wrap; overflow-wrap: anywhere; }
body.litmus .turn.you .uimg { border-radius: var(--r-md); margin-bottom: 8px; max-width: 100%; }

/* ---- the vessel: a living bubble that reshapes around whatever the model says.
   Content-hugging (no fixed min-height), asymmetric silhouette, physical motion.
   Newsfeed / reality turns below opt back out to full-width transparent shells. ---- */
body.litmus .turn.dram {
  align-self: flex-start;
  width: fit-content;   max-width: min(720px, 100%); min-width: 0;
  background: #fcfcfa;
  border: 1px solid rgba(19,19,21,.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9),
    0 1px 2px rgba(19,19,21,.06),
    0 18px 34px -22px rgba(19,19,21,.28);
  /* one shared geometry system: 23px desktop editorial chat, not quote cards.
     The bubble physically fits the thought, from a "hi" pebble to a full mass. */
  font-size: clamp(20px, 1.35vw, 23px);
  padding: 28px 30px 26px;
  border-radius: 42px 42px 42px 14px;
  interpolate-size: allow-keywords;
  transition: height .5s cubic-bezier(.22,1.05,.36,1),
    width .5s cubic-bezier(.22,1.05,.36,1),
    border-radius .55s cubic-bezier(.22,1,.36,1),
    transform .25s ease, box-shadow .25s ease, background .3s ease;
}
body.litmus .turn.dram.is-long { border-radius: 30px 30px 30px 12px; }
/* long thoughts step down a touch so paragraphs stay readable at this measure */
body.litmus .turn.dram.is-long, body.litmus .turn.you.is-long { font-size: clamp(19px, 1.3vw, 22px); }
body.litmus .is-long .reality, body.litmus .is-long .ubody { line-height: 1.4; }
body.litmus .turn.dram:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9),
    0 2px 3px rgba(19,19,21,.06),
    0 24px 44px -22px rgba(19,19,21,.32);
}
/* entry: compressed/blurred/transparent -> measured size, then text resolves */
@keyframes lit-vessel-in {
  from { opacity: 0; transform: scaleY(.92) scaleX(.985) translateY(8px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
body.litmus .turn.dram.lit-enter { animation: lit-vessel-in .55s cubic-bezier(.22,1.05,.36,1) both; }
@keyframes lit-text-resolve {
  from { opacity: 0; filter: blur(5px); transform: translateY(4px); }
  to { opacity: 1; filter: blur(0); transform: none; }
}
body.litmus .turn.dram.lit-enter .lit-body { animation: lit-text-resolve .5s ease .12s both; }
/* morphing between answers: container reshapes, text fades out/in */
body.litmus .turn.dram.lit-morph { transition: height .55s cubic-bezier(.22,1.05,.36,1), width .55s cubic-bezier(.22,1.05,.36,1), border-radius .55s cubic-bezier(.22,1,.36,1), transform .25s ease, box-shadow .25s ease; }
body.litmus .turn.dram .lit-body.lit-swap-out { opacity: 0; filter: blur(4px); transform: translateY(-5px); transition: opacity .18s ease, filter .18s ease, transform .18s ease; }
body.litmus .turn.dram .lit-body.lit-swap-in { animation: lit-text-resolve .45s ease both; }
/* top row: metadata left, copy glyph right */
body.litmus .turn.dram .lit-top {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin: 0 0 .4em; min-height: 22px;
}
body.litmus .turn.dram .who {
  font-family: var(--sans); font-size: 10px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: #a3a3a9; padding-left: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color .3s ease;
}
body.litmus .turn.dram .who.is-thinking { animation: think-pulse 1.4s ease-in-out infinite; }
body.litmus .turn.dram .lit-copy {
  position: relative; flex: 0 0 auto;
  display: grid; place-items: center; width: 30px; height: 30px; margin-right: -8px;
  background: none; border: none; border-radius: 8px; cursor: pointer;
  color: var(--ink-soft); opacity: .35;
  transition: opacity .2s ease, background .15s ease, color .15s ease, transform .12s ease;
}
body.litmus .turn.dram:hover .lit-copy { opacity: 1; }
body.litmus .turn.dram .lit-copy:hover { background: var(--paper-2); }
body.litmus .turn.dram .lit-copy:active { transform: scale(.9); }
body.litmus .turn.dram .lit-copy:focus-visible { outline: 2px solid var(--ink-soft); outline-offset: 2px; opacity: 1; }
body.litmus .turn.dram .lit-copy svg { width: 18px; height: 18px; display: block; }
body.litmus .turn.dram .lit-copy::after {
  content: attr(data-tip); position: absolute; top: calc(100% + 6px); right: 0;
  font-family: var(--sans); font-size: 10.5px; font-weight: 700; letter-spacing: 0;
  color: var(--brand-ink); background: var(--ink); border-radius: 6px; padding: 3px 8px;
  white-space: nowrap; opacity: 0; transform: translateY(-3px); pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}
body.litmus .turn.dram .lit-copy:hover::after, body.litmus .turn.dram .lit-copy:focus-visible::after { opacity: 1; transform: none; }
body.litmus .turn.system {
  align-self: center; max-width: 92%; background: var(--paper-2); padding: 9px 13px; border-radius: 14px 14px 14px 6px;
}
body.litmus .turn.system .sysbody { font-family: var(--sans); font-size: 12px; color: var(--ink-soft); }

/* the answer is the visual center of gravity: editorial serif, dominant size */
body.litmus .turn.dram .reality {
  font-family: "Newsreader", Georgia, serif; font-weight: 400;
  font-size: 1em; line-height: 1.28; letter-spacing: -0.015em;
  color: var(--ink);
}
body.litmus .turn.dram .reality p { margin: 0 0 .45em; }
body.litmus .turn.dram .reality p:last-child { margin-bottom: 0; }
body.litmus .turn.dram .reality h3 { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 1em; color: var(--ink); border-bottom: none; margin: .6em 0 .2em; padding-bottom: 0; }
body.litmus .turn.dram .reality strong { color: var(--ink); }
body.litmus .thinking { font-family: var(--sans); font-size: 13px; color: var(--muted); }
/* two typefaces on Litmus screens: serif + sans. These two summaries inherit
   Space Mono from the base site — pull them into sans like everything else. */
body.litmus .thinkblock summary,
body.litmus .sources summary { font-family: var(--sans); }
body.litmus .bymodel { font-family: var(--sans); font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .14em; font-weight: 500; }

body.litmus .ansbar { margin-top: 12px; display: flex; align-items: center; gap: 10px; }
/* legacy pill kept for non-vessel surfaces only — the vessel uses .lit-copy */
body.litmus .ans-act {
  font-family: var(--sans); font-size: 11.5px; font-weight: 700; color: var(--ink-soft);
  background: var(--paper-2); border: none; border-radius: var(--r-pill); padding: 5px 11px; cursor: pointer;
}
body.litmus .turn.dram .ans-act { display: none; }
body.litmus .routed { font-family: var(--sans); font-size: 10px; letter-spacing: .04em; color: var(--faint); }
body.litmus .finish-note { font-family: var(--sans); font-size: 12px; border-radius: var(--r-md); border-left: none; margin-top: 8px; }
body.litmus .finish-note::before { content: ""; }
@media (prefers-reduced-motion: reduce) {
  body.litmus .turn.dram, body.litmus .turn.dram.lit-enter, body.litmus .turn.dram.lit-enter .lit-body,
  body.litmus .turn.you, body.litmus .turn.you.lit-enter { animation: none; transition: none; }
}

body.litmus .chips { padding: 0 max(16px, env(safe-area-inset-left)); }
body.litmus .chip {
  font-family: var(--sans); font-size: 12.5px; font-weight: 600; border: none;
  background: var(--paper-2); color: var(--ink-soft); border-radius: var(--r-pill); padding: 8px 13px;
}
body.litmus .toolspanel { background: var(--surface); box-shadow: var(--shadow-md); border-radius: var(--r-lg); padding: 8px; }
body.litmus .toolspanel .chip.tool:hover { color: var(--brand); border-color: transparent; background: var(--paper-2); }

/* ---- the news dashboard: a real grid of rows and columns, not a chat bubble ---- */
/* the news front page is not a chat bubble in any state — loading, empty,
   error, or loaded. It always holds the full centered column so toggling
   topics never flashes it between the left rail and the center. */
body.litmus .turn.dram.news-turn {
  max-width: 100%; align-self: stretch; width: 100%;
  background: none; box-shadow: none; border: none; padding: 0; border-radius: 0; margin-bottom: 4px;
  display: flex; flex-direction: column;
  transition: none;
}
body.litmus .turn.dram.news-turn:hover { transform: none; box-shadow: none; }
body.litmus .turn.dram.news-turn > .who { display: none; }
body.litmus .turn.dram.news-turn .thinking,
body.litmus .turn.dram.news-turn > .reality {
  width: 100%; max-width: 680px; margin: 12px auto; text-align: center;
}
/* ---- the front page: a review desk, not a dashboard. An editorial header with
   a point of view, publication-section categories, and stories set at different
   weights — one lead, three standards, one text-only. ---- */
body.litmus .lit-fronthead { text-align: center; max-width: 680px; margin: 8px auto 4px; padding: 0 2px; }
body.litmus .fh-eyebrow {
  font-family: var(--sans); font-size: 10px; font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase; color: var(--faint);
}
body.litmus .fh-title {
  font-family: var(--serif); font-style: normal; font-weight: 500;
  font-size: clamp(32px, 5vw, 46px); line-height: 1.05; letter-spacing: -0.01em;
  color: var(--ink); margin: 4px 0 6px;
}
body.litmus .fh-sub { font-family: var(--sans); font-style: normal; font-size: 15px; color: var(--muted); margin: 0; }
/* categories as publication sections: plain mono text, active marked by a thin
   rule — never a capsule. */
body.litmus .turn.dram.news-turn .topicpicker { flex: 0 0 auto; max-width: 680px; margin: 0 auto 16px; padding: 0 2px; justify-content: center; }
body.litmus .newsfeed {
  display: grid; grid-template-columns: repeat(2, minmax(220px, 320px)); gap: 16px;
  justify-content: center; max-width: 680px; margin: 0 auto;
  grid-auto-flow: dense; /* variants span rows; dense packing leaves no holes */
}
@media (max-width: 540px) {
  body.litmus .newsfeed { grid-template-columns: minmax(0, 320px); }
}
/* cards inherit the vessel: soft asymmetric geometry, one tighter corner.
   Weights differ — composition over widgets. Grid children must be allowed
   to shrink, or a long headline sizes the card instead of wrapping in it. */
body.litmus .newsfeed > * { min-width: 0; max-width: 100%; }
body.litmus .newscard {
  display: flex; flex-direction: column; height: 380px; border: none; cursor: pointer;
  background: #fcfcfa; border-radius: 26px 26px 26px 10px; box-shadow: var(--shadow-sm); overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}
body.litmus .newscard:hover { transform: translateY(-2px); box-shadow: 0 2px 3px rgba(19,19,21,.06), 0 24px 44px -22px rgba(19,19,21,.32); }
body.litmus .newscard.lead {
  grid-column: 1 / -1; flex-direction: row; height: auto; min-height: 250px;
  min-width: 0; max-width: 100%;
  border-radius: 30px 30px 30px 12px;
}
/* the text column must shrink (56%) so the headline wraps instead of
   sizing the card into a single clipped line. */
body.litmus .newscard.lead .nc-img { flex: 0 0 44%; max-width: 44%; min-width: 0; min-height: 250px; }
body.litmus .newscard.lead .nc-body { flex: 1 1 0; min-width: 0; justify-content: center; padding: 26px 28px; }
/* logo-only lead: restrained visual, never stretched for empty space */
body.litmus .newscard.lead:not(:has(.nc-photo)) { min-height: 0; }
body.litmus .newscard.lead:not(:has(.nc-photo)) .nc-img { min-height: 200px; }
body.litmus .newscard.lead .nc-title { font-size: clamp(22px, 2.6vw, 28px); line-height: 1.2; -webkit-line-clamp: 4; }
body.litmus .newscard.textonly { height: auto; min-height: 0; }
/* logo-only standard card (no photo): restrained visual, card hugs content —
   never a tall empty field with a floating mark. Photo cards keep 380px. */
body.litmus .newscard:not(.textonly):not(.lead):not(:has(.nc-photo)) { height: auto; min-height: 0; }
body.litmus .newscard:not(.textonly):not(.lead):not(:has(.nc-photo)) .nc-img { flex: 0 0 190px; min-height: 190px; }
body.litmus .newscard.textonly .nc-body { padding: 22px 24px 20px; }
body.litmus .newscard.textonly .nc-title { font-size: 18px; }
/* the picture is the commission: cropped, never stretched. No logos, no marks,
   no slugs on the image — the outlet lives in the metadata below. A faint
   wash (warm/cold/tobacco) sits over the photo; never a gradient as subject. */
body.litmus .newscard .nc-img { position: relative; flex: 1 1 auto; min-height: 220px; overflow: hidden; border-radius: 0; border-bottom: none; background-color: var(--paper-2); }
body.litmus .nc-photo { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
body.litmus .nc-wash { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
body.litmus .ed-wash-warm .nc-wash { background: linear-gradient(180deg, rgba(217,164,65,.10), rgba(19,19,21,.12)); }
body.litmus .ed-wash-cold .nc-wash { background: linear-gradient(180deg, rgba(47,95,168,.10), rgba(19,19,21,.14)); }
body.litmus .ed-wash-tobacco .nc-wash { background: linear-gradient(100deg, rgba(120,40,20,.16), transparent 55%); }
body.litmus .ed-wash-none .nc-wash { background: linear-gradient(180deg, transparent 70%, rgba(19,19,21,.10)); }
body.litmus .ed-crop-left .nc-photo { object-position: 20% 50%; }
body.litmus .ed-crop-center .nc-photo { object-position: 50% 40%; }
body.litmus .ed-crop-right .nc-photo { object-position: 80% 50%; }
body.litmus .ed-mono .nc-photo { filter: grayscale(1) contrast(1.05); }
body.litmus .nc-credit { position: absolute; z-index: 2; right: 8px; bottom: 6px; font-family: var(--sans); font-size: 9px; font-weight: 600; letter-spacing: .04em; color: rgba(255,255,255,.85); text-shadow: 0 1px 4px rgba(0,0,0,.5); }
/* the deck crossfades (260ms) instead of flashing white between sections */
body.litmus .newsfeed { transition: opacity .26s ease; }
body.litmus .newsfeed.is-swapping { opacity: 0; }
body.litmus .newsfeed.is-in { animation: news-in .26s ease both; }
@keyframes news-in { from { opacity: 0; } to { opacity: 1; } }
/* uneven weights: panoramic spans, tall runs portrait, field sets small in room */
body.litmus .newscard.ed-pano { grid-column: 1 / -1; height: 300px; }
body.litmus .newscard.ed-pano.textonly { height: auto; min-height: 0; }
body.litmus .newscard.ed-pano .nc-img { min-height: 170px; }
body.litmus .newscard.ed-tall { height: 440px; }
body.litmus .newscard.ed-tall .nc-img { min-height: 280px; }
body.litmus .newscard.ed-field .nc-img { min-height: 150px; flex: 0 0 150px; margin: 14px 14px 0; border-radius: 14px 14px 14px 4px; }
@media (max-width: 540px) {
  body.litmus .newscard.ed-pano, body.litmus .newscard.ed-tall { height: 380px; }
}
body.litmus .nc-body { display: flex; flex-direction: column; flex: 0 0 auto; min-width: 0; max-width: 100%; padding: 14px 18px 16px; }
body.litmus .nc-meta { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
body.litmus .nc-cat {
  font-family: var(--sans); font-size: 9.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
}
body.litmus .nc-src { font-family: var(--sans); font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--muted); }
body.litmus .nc-title {
  font-family: var(--serif); font-weight: 500; font-size: 17px; line-height: 1.32; letter-spacing: -0.008em; color: var(--ink); margin: 0 0 12px;
  min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: break-word;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
body.litmus .nc-sum { font-family: var(--serif); font-size: 14.5px; line-height: 1.55; color: var(--ink-soft); margin: 0 0 12px; }
body.litmus .nc-actions { margin-top: auto; display: flex; align-items: baseline; gap: 14px; }
/* one action with a point of view — editorial, not a pill. Original ↗ just cites. */
body.litmus .nc-btn {
  font-family: var(--serif); font-style: italic; font-size: 15.5px; font-weight: 500;
  border: none; background: none; color: var(--ink); padding: 2px 0; cursor: pointer;
  text-underline-offset: 3px;
}
body.litmus .nc-btn:hover { text-decoration: underline; }
body.litmus .nc-link { font-family: var(--sans); font-size: 11px; font-weight: 700; color: var(--muted); }
body.litmus .nc-link:hover { color: var(--brand); }
@media (max-width: 540px) {
  body.litmus .newscard.lead { flex-direction: column; }
  body.litmus .newscard.lead .nc-img { flex: 1 1 auto; min-width: 0; max-width: 100%; min-height: 180px; }
  body.litmus .newscard.lead .nc-body { padding: 18px 20px; }
}
/* on the front page the composer is the bridge between browse and ask — give it
   a touch more presence than in conversation, without raising its voice. */
body.litmus.fresh .ws-composer {
  border: 1px solid rgba(19,19,21,.14);
  box-shadow: 0 18px 40px -12px rgba(19,19,21,.3);
}

/* "start the litmus test" lands as its own turn, same width as the grid/composer —
   not squeezed into the newscard. The outer .turn goes full-width/transparent
   (same trick as the newsfeed turn) so the inner card can center independently. */
body.litmus .turn.dram.reality-turn {
  max-width: 100%; width: 100%; align-self: stretch; background: none; box-shadow: none; border: none; padding: 0; border-radius: 0;
  transition: none;
}
body.litmus .turn.dram.reality-turn:hover { transform: none; box-shadow: none; }
body.litmus .reality-card {
  max-width: 680px; margin: 0 auto; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 14px 16px 16px;
}
body.litmus .reality-card > .who { display: block; margin-bottom: 6px; }
body.litmus .reality-card .ansbar { margin-top: 10px; }

/* ====================================================================
   CLAIM TRACE — a dense editorial audit trail, not a report.
   One compact unit per claim (number + claim + verdict line + finding +
   evidence stub), full reasoning one toggle away. Thin rules, no cards.
   Shared by the thread turn, the stage artifact, and /reality.html.
   ==================================================================== */
body.litmus .ct-list {
  position: relative;
  border-bottom: 1px solid var(--border);
  margin: 4px 0 6px;
}
body.litmus .ct-list::before {
  content: ""; position: absolute; left: 7px; top: 20px; bottom: 20px;
  width: 1px; background: var(--border);
}
body.litmus .ct-item {
  position: relative;
  display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px;
  padding: 13px 0 12px;
  border-top: 1px solid var(--border);
}
body.litmus .ct-item:first-child { border-top: none; }
body.litmus .ct-num {
  font-family: var(--sans); font-size: 11px; font-weight: 500; letter-spacing: .08em;
  color: var(--muted); padding-top: 5px;
  background: transparent;
}
body.litmus .ct-main { min-width: 0; }
body.litmus .ct-head {
  display: block; width: 100%; text-align: left;
  background: none; border: none; padding: 0; margin: 0;
  font: inherit; color: inherit; cursor: pointer;
}
body.litmus .ct-head:focus-visible { outline: 2px solid var(--ink-soft); outline-offset: 3px; border-radius: 4px; }
body.litmus .ct-claim {
  display: block;
  font-family: var(--serif); font-weight: 500; font-size: 20px; line-height: 1.3;
  letter-spacing: -0.008em; color: var(--ink); text-wrap: balance;
}
body.litmus .ct-meta {
  display: block; margin-top: 5px;
  font-family: var(--sans); font-size: 10.5px; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
body.litmus .ct-meta b { color: var(--ink); font-weight: 700; }
body.litmus .ct-find {
  display: block; margin-top: 6px;
  font-family: var(--serif); font-size: 15.5px; line-height: 1.5; color: var(--ink-soft);
}
body.litmus .ct-ev {
  display: flex; align-items: baseline; gap: 6px; margin-top: 6px;
  font-family: var(--sans); font-size: 12.5px; line-height: 1.5; color: var(--muted);
}
body.litmus .ct-evlabel { flex: 0 0 auto; font-weight: 600; color: var(--ink-soft); }
body.litmus .ct-evtext { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.litmus .ct-toggle {
  flex: 0 0 auto; margin-left: auto; padding-left: 12px;
  font-weight: 600; color: var(--ink-soft); white-space: nowrap;
}
body.litmus .ct-head:hover .ct-toggle { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
body.litmus .ct-detail {
  margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 12px;
}
body.litmus .ct-detail[hidden] { display: none; }
body.litmus .ct-cols { display: grid; grid-template-columns: 1.15fr 1fr; gap: 22px; }
body.litmus .ct-k2 {
  font-family: var(--sans); font-size: 10px; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 6px;
}
body.litmus .ct-prose { font-family: var(--serif); font-size: 14.5px; line-height: 1.6; color: var(--ink-soft); }
body.litmus .ct-prose p { margin: 0 0 .6em; }
body.litmus .ct-prose p:last-child { margin-bottom: 0; }
body.litmus .ct-prose a { color: var(--ink); text-underline-offset: 2px; }
body.litmus .ct-prose strong { color: var(--ink); }
body.litmus .ct-foot {
  margin: 12px 0 0;
  font-family: var(--sans); font-size: 11px; font-weight: 500; color: var(--muted);
}
body.litmus .ct-fallback .ct-k { margin-bottom: 2px; }
@media (max-width: 640px) {
  body.litmus .ct-cols { grid-template-columns: 1fr; }
  body.litmus .ct-claim { font-size: 18px; }
  body.litmus .ct-evtext { white-space: normal; }
  body.litmus .ct-ev { flex-wrap: wrap; }
  body.litmus .ct-toggle { margin-left: 0; padding-left: 0; }
}

/* ====================================================================
   THE LITMUS TEST STAGE — the homepage dissolves around the submitted
   card, which flies to center and is rebuilt as an editorial artifact.
   The artifact's archetype (ax-*) is chosen by the analysis via the
   litmus-signals block, never at random. One restrained palette plus a
   single reaction color (--react) per archetype.
   ==================================================================== */

/* ---- dissolve: chrome goes first (600ms), the thread lingers ~150ms
   behind the surviving clone, then goes too. Nothing here is clickable
   while testing — the stage owns all pointer events. ---- */
body.litmus .ws-rail,
body.litmus .litmus-dock,
body.litmus .lit-fronthead,
body.litmus .topicpicker,
body.litmus .chips,
body.litmus .followbtn,
body.litmus .rail-fab {
  transition: opacity .65s ease, filter .65s ease, transform .65s ease;
}
body.litmus #log { transition: opacity .6s ease .15s, filter .6s ease .15s, transform .6s ease .15s; }
body.litmus.is-testing .ws-rail,
body.litmus.is-testing .litmus-dock,
body.litmus.is-testing .lit-fronthead,
body.litmus.is-testing .topicpicker,
body.litmus.is-testing .chips,
body.litmus.is-testing .followbtn,
body.litmus.is-testing .rail-fab,
body.litmus.is-testing #log {
  opacity: 0; filter: blur(8px); transform: translateY(12px) scale(.995);
  pointer-events: none;
}
body.litmus.is-testing .ws-center { pointer-events: none; }

/* ---- the stage: a nearly-empty viewport the artifact is built on ---- */
body.litmus .lit-stage {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(245,245,243,0);
  transition: background .7s ease;
  overflow: hidden;
}
body.litmus .lit-stage.is-on { background: rgba(245,245,243,.985); }
body.litmus .lit-stage[hidden] { display: none; }
body.litmus .lit-stage-scroll {
  position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: max(5vh, 32px) 16px 120px;
}
body.litmus .lit-stage-cardwrap {
  width: min(880px, 94vw); margin: 0 auto; min-height: 40vh;
}

/* ---- the surviving clone: pinned at the source card, glides to center ---- */
body.litmus .lit-clone {
  position: fixed; z-index: 81;
  transition: left .6s cubic-bezier(.22,1,.36,1), top .6s cubic-bezier(.22,1,.36,1),
    width .6s cubic-bezier(.22,1,.36,1), opacity .3s ease;
}
body.litmus .lit-clone-card {
  background: #fcfcfa; border: 1px solid rgba(19,19,21,.07); border-radius: 26px 26px 26px 10px;
  box-shadow: 0 1px 2px rgba(19,19,21,.06), 0 24px 48px -20px rgba(19,19,21,.3);
  padding: 22px 24px;
}
body.litmus .lit-clone-src {
  font-family: var(--sans); font-size: 10px; font-weight: 700; letter-spacing: .04em;
  color: var(--muted); margin: 0 0 6px;
}
body.litmus .lit-clone-title {
  font-family: var(--serif); font-weight: 500; font-size: 19px; line-height: 1.3;
  letter-spacing: -0.008em; color: var(--ink); margin: 0 0 10px;
}

/* ---- the artifact: one component, seven compositions ---- */
body.litmus .litx {
  --react: #3a3a40;
  background: #fcfcfa;
  border: 1px solid rgba(19,19,21,.07);
  border-radius: 30px 30px 30px 12px;
  box-shadow: 0 1px 2px rgba(19,19,21,.06), 0 30px 60px -28px rgba(19,19,21,.35);
  padding: clamp(26px, 4.5vw, 54px);
  display: flex; flex-direction: column; gap: clamp(22px, 3.5vw, 36px);
  color: var(--ink);
}
body.litmus .litx .lx-eyebrow {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  font-family: var(--sans); font-size: 11px; font-weight: 500;
  letter-spacing: .2em; text-transform: uppercase; color: var(--ink);
  border-bottom: 2px solid var(--react);
  padding-bottom: 12px;
}
body.litmus .litx .lx-arch { color: var(--react); }
body.litmus .litx .lx-k {
  font-family: var(--sans); font-size: 10px; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 10px;
}
body.litmus .litx .lx-body {
  font-family: var(--serif); font-size: 16.5px; line-height: 1.6; color: var(--ink-soft);
}
body.litmus .litx .lx-body p { margin: 0 0 .7em; }
body.litmus .litx .lx-body p:last-child { margin-bottom: 0; }
body.litmus .litx .lx-body strong { color: var(--ink); }
body.litmus .litx .lx-body h3 {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: 1.05em; color: var(--ink); margin: 1em 0 .3em;
}
body.litmus .litx .lx-body ul, body.litmus .litx .lx-body ol { margin: 0 0 .8em; padding-left: 1.3em; }
body.litmus .litx .lx-body li { margin-bottom: .35em; }
body.litmus .litx .lx-body blockquote {
  margin: .9em 0; padding-left: 16px; border-left: 2px solid var(--react);
  font-style: italic; color: var(--ink);
}
body.litmus .litx .lx-body .ct-k {
  font-family: var(--sans); font-size: 10px; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
  margin: 14px 0 2px;
}
body.litmus .litx .lx-headline {
  font-family: var(--serif); font-weight: 500; letter-spacing: -0.015em;
  font-size: clamp(30px, 4.6vw, 48px); line-height: 1.08; color: var(--ink);
  margin: 0 0 8px; text-wrap: balance;
}
body.litmus .litx .lx-srcmeta {
  font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: .05em;
  color: var(--muted); margin: 0;
}
body.litmus .litx .lx-claim .lx-body { font-size: 18px; color: var(--ink-soft); }
body.litmus .litx .lx-duel { display: flex; flex-direction: column; gap: clamp(22px, 3.5vw, 36px); }
body.litmus .litx .lx-lang {
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 18px 0;
}
body.litmus .litx .lx-lang .lx-body { font-size: 15px; }
body.litmus .litx .lx-read {
  border-top: 2px solid var(--ink); padding-top: 22px;
}
body.litmus .litx .lx-read .lx-body { font-size: 19px; line-height: 1.55; color: var(--ink); }
body.litmus .litx .lx-chain {
  list-style: none; margin: 0 0 16px; padding: 0;
  display: grid; gap: 0; border-top: 1px solid var(--border);
}
body.litmus .litx .lx-chain li {
  display: flex; align-items: baseline; gap: 12px;
  padding: 10px 2px; border-bottom: 1px solid var(--border);
  font-family: var(--sans); font-size: 13px; font-weight: 600;
}
body.litmus .litx .lx-chain .lx-n { color: var(--react); font-size: 11px; font-weight: 500; letter-spacing: .1em; flex: 0 0 auto; }
body.litmus .litx .lx-chain a { color: var(--ink-soft); text-decoration: none; overflow-wrap: anywhere; }
body.litmus .litx .lx-chain a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
body.litmus .litx .lx-void {
  border: 1.5px dashed var(--react); border-radius: 18px;
  min-height: 180px; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 32px 24px;
  font-family: var(--serif); font-style: italic; font-size: 17px; line-height: 1.5;
  color: var(--muted); opacity: .85;
}
body.litmus .litx .lx-method { border: none; margin: 0; }
body.litmus .litx .lx-method summary {
  font-family: var(--sans); font-size: 12px; font-weight: 600; color: var(--ink-soft);
  cursor: pointer; list-style: none;
}
body.litmus .litx .lx-method summary::-webkit-details-marker { display: none; }
body.litmus .litx .lx-method summary:hover { color: var(--ink); }
body.litmus .litx .lit-method { margin-top: 10px; }
body.litmus .litx .lit-method summary { font-family: var(--sans); font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; }
body.litmus .litx .lit-method p { font-family: var(--sans); font-size: 12.5px; line-height: 1.65; color: var(--muted); }

/* ---- staged construction: each section resolves in on its own beat ---- */
body.litmus .litx .lx { opacity: 0; }
body.litmus .lit-stage.is-built .litx .lx {
  animation: lx-in .55s cubic-bezier(.22,1,.36,1) both;
  animation-delay: var(--d, 0ms);
}
@keyframes lx-in {
  from { opacity: 0; transform: translateY(10px); filter: blur(4px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

/* ---- archetype: CONTRADICTION — two claims face each other ---- */
body.litmus .litx.ax-contradiction .lx-duel {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  border: 1px solid var(--border); border-radius: 18px; overflow: hidden;
}
body.litmus .litx.ax-contradiction .lx-holds { padding: 22px 22px 24px; background: rgba(255,255,255,.5); }
body.litmus .litx.ax-contradiction .lx-doesnt {
  padding: 22px 22px 24px; border-left: 2px solid var(--react);
  background: rgba(106,77,159,.045);
}
body.litmus .litx.ax-contradiction .lx-doesnt .lx-body { text-decoration: none; }
body.litmus .litx.ax-contradiction .lx-claim .lx-body strong { text-decoration: underline; text-decoration-color: var(--react); text-underline-offset: 3px; }

/* ---- archetype: MISSING PIECE — the absence is the composition ---- */
body.litmus .litx.ax-missing-piece .lx-missing .lx-body { opacity: .62; }
body.litmus .litx.ax-missing-piece .lx-claim { max-width: 34ch; }

/* ---- archetype: HOUSE OF CARDS — a loud claim over thinning support ---- */
body.litmus .litx.ax-house-of-cards .lx-headline { font-size: clamp(38px, 6vw, 64px); }
body.litmus .litx.ax-house-of-cards .lx-holds { border-left: 3px solid var(--react); padding-left: 18px; }
body.litmus .litx.ax-house-of-cards .lx-holds .lx-body { font-size: 14.5px; }
body.litmus .litx.ax-house-of-cards .lx-doesnt .lx-body,
body.litmus .litx.ax-house-of-cards .lx-missing .lx-body { font-size: 15px; }
body.litmus .litx.ax-house-of-cards .lx-sources .lx-body { opacity: .7; font-size: 13.5px; }

/* ---- archetype: SOLID — restrained, almost beautifully boring ---- */
body.litmus .litx.ax-solid { gap: clamp(26px, 4vw, 42px); }
body.litmus .litx.ax-solid .lx-headline { font-size: clamp(28px, 3.6vw, 40px); }
body.litmus .litx.ax-solid .lx-claim,
body.litmus .litx.ax-solid .lx-read { max-width: 60ch; margin: 0 auto; text-align: left; width: 100%; }
body.litmus .litx.ax-solid .lx-duel { max-width: 60ch; margin: 0 auto; width: 100%; }

/* ---- archetype: SPIN — enormous rhetoric, small substance ---- */
body.litmus .litx.ax-spin .lx-headline {
  font-size: clamp(44px, 7.5vw, 84px); line-height: 1.0; letter-spacing: -0.02em;
}
body.litmus .litx.ax-spin .lx-claim .lx-body { font-size: 20px; border-left: 3px solid var(--react); padding-left: 18px; }
body.litmus .litx.ax-spin .lx-holds .lx-body,
body.litmus .litx.ax-spin .lx-doesnt .lx-body { font-size: 14px; max-width: 62ch; }
body.litmus .litx.ax-spin .lx-k { color: var(--react); }

/* ---- archetype: SOURCE TRAIL — the evidence chain is the backbone ---- */
body.litmus .litx.ax-source-trail .lx-trace { order: 5; border: 1px solid var(--border); border-radius: 18px; padding: 22px; }
body.litmus .litx.ax-source-trail .lx-sources { border-top: 3px solid var(--react); padding-top: 20px; }
body.litmus .litx.ax-source-trail .lx-chain li { font-size: 14px; padding: 12px 2px; }

/* ---- archetype: COMPLICATED — numbered readings coexist ---- */
body.litmus .litx.ax-complicated { counter-reset: lxread; }
body.litmus .litx.ax-complicated .lx-holds,
body.litmus .litx.ax-complicated .lx-doesnt,
body.litmus .litx.ax-complicated .lx-missing { position: relative; padding-left: 44px; }
body.litmus .litx.ax-complicated .lx-holds::before,
body.litmus .litx.ax-complicated .lx-doesnt::before,
body.litmus .litx.ax-complicated .lx-missing::before {
  counter-increment: lxread; content: "0" counter(lxread);
  position: absolute; left: 0; top: 2px;
  font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--react);
}

/* ---- quiet edge controls: the analysis is the interface now ---- */
body.litmus .lit-stage-controls {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  width: min(880px, 94vw); margin: 28px auto 0;
  animation: lx-in .55s ease 1.85s both;
}
body.litmus .lit-stage-controls[hidden] { display: none; }
body.litmus .lit-ctl {
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  color: var(--ink-soft); background: rgba(255,255,255,.7);
  border: 1px solid rgba(19,19,21,.12); border-radius: 999px;
  padding: 9px 18px; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
body.litmus .lit-ctl:hover { background: var(--ink); color: #f5f5f3; border-color: var(--ink); }
body.litmus .lit-ctl:focus-visible { outline: 2px solid var(--ink-soft); outline-offset: 2px; }
body.litmus .lit-clone-card .ansbar { margin-top: 12px; }

@media (max-width: 640px) {
  body.litmus .litx.ax-contradiction .lx-duel { grid-template-columns: 1fr; }
  body.litmus .litx.ax-contradiction .lx-doesnt { border-left: none; border-top: 2px solid var(--react); }
  body.litmus .litx { border-radius: 22px 22px 22px 10px; }
  body.litmus .lit-stage-scroll { padding: max(4vh, 20px) 10px 110px; }
}
@media (prefers-reduced-motion: reduce) {
  body.litmus .ws-rail, body.litmus .litmus-dock, body.litmus .lit-fronthead,
  body.litmus .topicpicker, body.litmus .chips, body.litmus .followbtn, body.litmus #log,
  body.litmus .lit-stage, body.litmus .lit-clone { transition: none; }
  body.litmus .lit-stage.is-built .litx .lx, body.litmus .lit-stage-controls { animation: none; opacity: 1; }
  body.litmus .litx .lx { opacity: 1; }
}
/* the test record: stages resolve faint → definite as the test completes
   (staggered, no progress-bar theater), then the numbered eyebrow opens
   the result. Monochrome throughout — color stays reserved for the tiers. */
body.litmus .lit-test-eyebrow {
  font-family: var(--sans); font-size: 11px; font-weight: 500;
  letter-spacing: .2em; text-transform: uppercase; color: var(--ink); margin: 2px 0 10px;
}
body.litmus .lit-stages {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px;
  font-family: var(--sans); font-size: 10px; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase; color: var(--faint); margin: 2px 0 12px;
}
body.litmus .lit-stages i { font-style: normal; opacity: .55; }
body.litmus .lit-stages span { transition: color .7s ease; }
body.litmus .lit-stages span:nth-child(3) { transition-delay: .12s; }
body.litmus .lit-stages span:nth-child(5) { transition-delay: .24s; }
body.litmus .lit-stages span:nth-child(7) { transition-delay: .36s; }
body.litmus .lit-stages span:nth-child(9) { transition-delay: .48s; }
body.litmus .lit-stages.is-done { color: var(--ink); }
body.litmus .lit-stages.is-done span { color: var(--ink); }
body.litmus .lit-stages.is-done i { color: var(--muted); opacity: 1; }
/* claim-trace keys: quiet labels above each → line */
body.litmus .reality .ct-k {
  font-family: var(--sans); font-size: 10px; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 14px 0 2px;
}

body.litmus .ws-composer, body.litmus .sayrow {
  width: 100%; max-width: 680px; margin: 0 auto;
  background: var(--surface); border-radius: var(--r-pill); box-shadow: var(--shadow-md);
  border: none; padding: 6px 6px 6px 14px;
}
/* the base site's focus ring is the ruler's red — minimal/grayscale here instead */
body.litmus .ws-composer:focus-within {
  border-color: transparent; box-shadow: var(--shadow-md), 0 0 0 3px rgba(19,19,21,.16);
}
/* the composer is roman, always — typed text must never inherit italics */
body.litmus #say { font-family: var(--serif); font-style: normal; font-size: 15.5px; font-synthesis: none; }
body.litmus #say::placeholder { font-style: normal; opacity: 1; }
/* send: a plain circle — no arrow, no label. the only feedback is a press-down
   (scale + flattened shadow) while held, and a color swap once it's really "stop". */
body.litmus #send.run {
  background: var(--brand); border-radius: 50%; border: none; width: 38px; height: 38px; padding: 0;
  margin-right: 6px;
  box-shadow: 0 2px 6px rgba(19,19,21,.25); transition: transform .08s ease, box-shadow .08s ease, background .15s ease;
}
body.litmus #send.run:active { transform: scale(.9); box-shadow: 0 1px 2px rgba(19,19,21,.2); }
body.litmus #send.run.stopping { background: var(--acid); }

/* the "+" — opens a small menu of things to add, rather than being "add image" itself */
body.litmus .attach-wrap { position: relative; flex: 0 0 auto; align-self: stretch; display: flex; }
body.litmus #clip.clip {
  display: grid; place-items: center; width: 34px; height: 34px; align-self: center;
  background: var(--paper-2); border-radius: 50%; border: none; color: var(--ink-soft); cursor: pointer; padding: 0;
  transition: transform .08s ease, background .15s ease;
}
body.litmus #clip.clip svg { width: 16px; height: 16px; }
body.litmus #clip.clip:hover { background: var(--brand); color: var(--brand-ink); }
body.litmus #clip.clip:active { transform: scale(.9); }
body.litmus #clip.clip[aria-expanded="true"] { background: var(--brand); color: var(--brand-ink); transform: rotate(45deg); }
body.litmus .attachmenu {
  position: absolute; left: -10px; bottom: calc(100% + 10px); width: 168px;
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-md); padding: 6px;
  display: flex; flex-direction: column; gap: 2px;
}
body.litmus .attachmenu[hidden] { display: none; }
body.litmus .attach-opt {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  font-family: var(--sans); font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
  background: none; border: none; border-radius: var(--r-md); padding: 8px 9px; cursor: pointer;
}
body.litmus .attach-opt svg { width: 17px; height: 17px; flex: 0 0 auto; color: var(--muted); }
body.litmus .attach-opt:hover { background: var(--paper-2); }
body.litmus .attach-opt:hover svg { color: var(--brand); }
/* placed objects: material on the desk, above the instruction field. Small,
   quiet cards — thumbnail or glyph, name, one line of real metadata, a ×. */
body.litmus .attach {
  width: 100%; max-width: 680px; margin: 0 auto 8px; padding: 0 2px;
  display: flex; flex-wrap: wrap; gap: 8px;
}
body.litmus .attach[hidden] { display: none; }
body.litmus .att-card {
  position: relative; display: inline-flex; align-items: center; gap: 9px; max-width: 100%;
  background: var(--surface); border: none; border-radius: var(--r-md); box-shadow: var(--shadow-sm);
  padding: 7px 30px 7px 7px; font-family: var(--sans); text-align: left;
}
body.litmus button.att-card { cursor: pointer; }
body.litmus button.att-card:hover { box-shadow: var(--shadow-md); }
body.litmus .att-thumb { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; display: block; flex: 0 0 auto; background: var(--paper-2); }
body.litmus .att-thumb-empty { border: none; }
body.litmus .att-doc {
  width: 34px; height: 34px; border-radius: 8px; flex: 0 0 auto;
  display: grid; place-items: center; background: var(--paper-2); color: var(--ink-soft);
  font-size: 15px; font-weight: 700;
}
body.litmus .att-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
body.litmus .att-body b {
  font-size: 12px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px;
}
body.litmus .att-body i { font-style: normal; font-size: 11px; font-weight: 500; color: var(--muted); white-space: nowrap; }
body.litmus .att-x {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; border: none; background: none; color: var(--muted);
  font-size: 14px; line-height: 1; cursor: pointer; padding: 0;
}
body.litmus .att-x:hover { background: var(--paper-2); color: var(--ink); }
body.litmus .att-card:focus-visible, body.litmus .att-x:focus-visible,
body.litmus .attach-opt:focus-visible, body.litmus #clip.clip:focus-visible {
  outline: 2px solid var(--ink-soft); outline-offset: 2px;
}
/* drag-over: a thin honest outline, nothing glowing */
body.litmus .ws-composer.is-drop { box-shadow: var(--shadow-md), 0 0 0 2px var(--ink-soft); }
/* attached-text inspector: the same quiet card language, enlarged */
body.litmus .atteditor {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: rgba(19,19,21,.4); padding: 16px;
}
body.litmus .atteditor[hidden] { display: none; }
body.litmus .atteditor-card {
  width: 100%; max-width: 560px; max-height: 80vh; display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-md); padding: 16px;
}
body.litmus .atteditor-head { display: flex; align-items: baseline; gap: 10px; }
body.litmus .atteditor-head b { font-family: var(--sans); font-size: 13px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.litmus .atteditor-head span { font-family: var(--sans); font-size: 11.5px; font-weight: 500; color: var(--muted); flex: 0 0 auto; }
body.litmus #atteditor-text {
  border: none; background: var(--paper-2); border-radius: var(--r-md); font-family: var(--serif);
  font-size: 14px; line-height: 1.55; color: var(--ink-soft); padding: 12px 14px; width: 100%; resize: vertical;
}
body.litmus .atteditor-foot { display: flex; align-items: center; gap: 8px; }
body.litmus .atteditor-sp { flex: 1; }
body.litmus .atteditor-save {
  font-family: var(--sans); font-size: 12.5px; font-weight: 700; border: none; cursor: pointer;
  background: var(--brand); color: var(--brand-ink); border-radius: var(--r-pill); padding: 8px 16px;
}
body.litmus .atteditor-ghost {
  font-family: var(--sans); font-size: 12.5px; font-weight: 700; border: none; cursor: pointer;
  background: var(--paper-2); color: var(--ink-soft); border-radius: var(--r-pill); padding: 8px 16px;
}
body.litmus .atteditor-danger {
  font-family: var(--sans); font-size: 12.5px; font-weight: 700; border: none; cursor: pointer;
  background: none; color: var(--muted); border-radius: var(--r-pill); padding: 8px 10px;
}
body.litmus .atteditor-danger:hover { color: var(--acid); }
@media (max-width: 720px) {
  body.litmus .att-body b { max-width: 150px; }
}
/* the base site's phone composer (max-width: 640px in styles.css) wraps
   .sayrow and stretches .run full-width — Litmus keeps its single-row pill
   composer with the fixed 38px send orb at every width. */
@media (max-width: 640px) {
  body.litmus .sayrow { flex-wrap: nowrap; }
  body.litmus .sayrow #say { flex: 1 1 auto; }
  body.litmus #send.run { flex: 0 0 auto; width: 38px; height: 38px; }
}

/* no right inspector on the litmus screens — the side dashboard is the only rail */
body.litmus .ws-inspector, body.litmus #inspect-toggle { display: none; }
body.litmus .ws-grid { grid-template-columns: 0 1fr !important; }
body.litmus .has-inspector .ws-grid { grid-template-columns: 0 1fr !important; }

/* ====================================================================
   FEED SHELL (reality.html) — restyles the real, working feed/reality-check
   markup (feedgrid/feeditem/results/ledger), not invented markup.
   ==================================================================== */
.litmus-main { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.litmus-section { max-width: 640px; margin: 0 auto; padding: 4px 18px 32px; }
/* CRD Audit: vertically center the instrument in the page. Auto margins (not
   align-items) so an overflowing viewport still scrolls to the top instead of
   clipping — the standard fix for the flex-centering overflow bug. */
body.audit-page .litmus-main { display: flex; flex-direction: column; }
body.audit-page .litmus-section { margin: auto; }
body.litmus .head { margin-bottom: 4px; }
body.litmus .head .kicker { display: none; }
body.litmus .head h1 { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 26px; margin: 0; }
body.litmus .antihype { font-family: var(--sans); font-size: 12.5px; color: var(--muted); margin: 2px 0 0; }
body.litmus .lede { font-family: var(--serif); font-weight: 400; font-size: 15.5px; line-height: 1.5; color: var(--ink-soft); margin: 14px 0; }
body.litmus .privacy {
  font-family: var(--sans); font-size: 11.5px; line-height: 1.6; color: var(--muted); text-transform: none;
  background: var(--paper-2); border-left: none; border-radius: var(--r-md); padding: 11px 14px; margin: 0 0 22px;
}

body.litmus .feedwrap { margin-bottom: 22px; }
body.litmus .feedwrap.ledger { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 20px; }
body.litmus .feedhead {
  font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  color: var(--muted); border-bottom: none; padding-bottom: 0; margin-bottom: 10px;
}
body.litmus .feedhead button {
  font-family: var(--sans); font-size: 11px; font-weight: 700; border: none; background: var(--paper-2);
  color: var(--ink-soft); border-radius: var(--r-pill); padding: 5px 11px;
}
body.litmus .feedgrid, body.litmus .ledgergrid { background: none; border: none; gap: 10px; }
body.litmus .feeditem, body.litmus .ledgeritem {
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 13px 14px 14px; gap: 8px;
}
body.litmus .feeditem .cardmark, body.litmus .ledgeritem .cardmark {
  margin: -13px -14px 8px; border-radius: var(--r-lg) var(--r-lg) 0 0; border-bottom: none; background: var(--paper-2);
}
body.litmus .feeditem .src { font-family: var(--sans); font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
body.litmus .feeditem h4 { font-family: var(--serif); font-weight: 600; font-size: 15px; }
body.litmus .feeditem .when, body.litmus .ledgeritem .when { font-family: var(--sans); color: var(--muted); }
body.litmus .cardbtns .mini {
  font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: 0; text-transform: none;
  border: 1.5px solid transparent; background: var(--paper-2); color: var(--ink-soft); padding: 6px 11px; border-radius: var(--r-pill);
}
body.litmus .cardbtns .runmini { background: var(--brand); color: var(--brand-ink); }
body.litmus .ledgeritem .lmeta { font-family: var(--sans); font-size: 10px; }
body.litmus .ledgeritem .lsrc { color: var(--brand); text-transform: none; font-weight: 700; }
body.litmus .ledgeritem .lstory { font-family: var(--serif); font-weight: 600; }
body.litmus .ledgeritem .lverdict { font-family: var(--serif); }

body.litmus .examples { margin: 0 0 14px; }
body.litmus .examples span { font-family: var(--sans); font-size: 11.5px; color: var(--muted); text-transform: none; letter-spacing: 0; font-weight: 600; }
body.litmus .examples button {
  font-family: var(--sans); font-size: 11.5px; font-weight: 700; text-transform: none; letter-spacing: 0;
  border: none; background: var(--paper-2); color: var(--ink-soft); border-radius: var(--r-pill); padding: 6px 12px;
}

/* topic picker: publication sections — plain mono text, the active section marked
   by a thin rule. Hover is a whisper of ink. Shared with reality.html's picker. */
body.litmus .topicpicker { display: flex; flex-wrap: wrap; gap: 2px 4px; margin: 0 0 14px; }
body.litmus .topicchip {
  position: relative;
  font-family: var(--sans); font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .1em;
  border: none; background: none; color: var(--muted); border-radius: 0; padding: 6px 8px 8px; cursor: pointer;
}
body.litmus .topicchip:hover { color: var(--ink); background: none; }
body.litmus .topicchip.is-on { background: none; color: var(--ink); }
body.litmus .topicchip.is-on::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: 3px; height: 2px;
  background: var(--ink); border-radius: 2px;
}

body.litmus .field { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 15px 16px; margin: 0 0 14px; }
body.litmus .field .fk { font-family: var(--sans); font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
body.litmus #story, body.litmus #copy, body.litmus #arch {
  border: none; background: var(--paper-2); border-radius: var(--r-md); font-family: var(--serif);
  font-size: 15px; line-height: 1.5; padding: 12px 14px; width: 100%;
}
body.litmus .field select, body.litmus #model {
  border: none; background: var(--paper-2); border-radius: var(--r-pill); font-family: var(--sans);
  font-size: 12.5px; font-weight: 700; padding: 8px 13px; width: auto;
}
body.litmus .remember { font-family: var(--sans); font-size: 12px; color: var(--muted); text-transform: none; }
body.litmus #run.run {
  font-family: var(--sans); font-size: 13.5px; font-weight: 700; text-transform: none; letter-spacing: 0;
  border: none; background: var(--brand); color: var(--brand-ink); border-radius: var(--r-pill); padding: 12px 20px; margin-top: 4px;
}

body.litmus #out.results, body.litmus #results.results { margin-top: 4px; }
body.litmus #out.results:not(:empty), body.litmus #results.results:not(:empty) {
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 16px 17px; margin-bottom: 20px;
}
body.litmus .verdictmark { border: none; border-radius: var(--r-md); margin-bottom: 12px; }
body.litmus .verdict {
  font-family: var(--serif); border: none; background: var(--paper-2); border-radius: var(--r-md); padding: 12px 14px;
}
body.litmus .verdict strong { font-size: 16px; }
body.litmus .verdict span { font-family: var(--sans); text-transform: none; letter-spacing: 0; }
body.litmus .verdict.v-fires { background: rgba(226,48,12,.08); }
body.litmus .discipline { font-family: var(--sans); font-size: 11.5px; color: var(--muted); border-top: none; margin-top: 14px; padding-top: 0; }
body.litmus .empty { font-family: var(--sans); font-size: 12.5px; color: var(--muted); }

@media (min-width: 860px) {
  .litmus-section { max-width: 720px; }
}

/* ====================================================================
   AUDIT SHELL (audit.html) — restyles the real, working CRD-audit output
   (twofields/results/tier/finding/badge), not invented markup. Reuses the
   feed-shell's card/pill/typography language above instead of duplicating it.
   ==================================================================== */
body.litmus .twofields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
body.litmus .twofields .field { margin: 0; }
@media (max-width: 760px) { body.litmus .twofields { grid-template-columns: 1fr; } }

body.litmus .section-h {
  font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 17px; color: var(--ink);
  border-bottom: none; text-transform: none; letter-spacing: 0; margin: 22px 0 12px; padding-bottom: 0;
}
body.litmus .section-h em { font-style: normal; color: var(--muted); font-family: var(--sans); font-size: 12px; }

body.litmus .tier { margin: 18px 0; }
body.litmus .tier h3 {
  font-family: var(--sans); font-size: 12px; font-weight: 700; text-transform: none; letter-spacing: 0;
  display: flex; align-items: baseline; gap: 8px; margin: 0 0 10px;
}
body.litmus .tier h3 em { font-style: normal; color: var(--muted); font-family: var(--sans); }
body.litmus .badge {
  font-family: var(--sans); font-size: 10.5px; font-weight: 700; letter-spacing: 0;
  border-radius: var(--r-pill); padding: 3px 9px; color: var(--brand-ink);
}
/* reuses the three-tier claim palette: fires~speculative, partial~exploratory, check~unverifiable, clear~established */
body.litmus .tier-fires .badge { background: var(--acid); }
body.litmus .tier-partial .badge { background: var(--neutral); }
body.litmus .tier-check .badge { background: var(--faint); color: var(--ink-soft); }
body.litmus .tier-clear .badge { background: var(--base); }

body.litmus .finding {
  border: none; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  padding: 14px 15px; margin-bottom: 10px;
}
body.litmus .finding.billf { border-left: 3px solid var(--acid); }
body.litmus .finding p { font-family: var(--serif); font-size: 14.5px; line-height: 1.5; color: var(--ink-soft); margin: 0 0 10px; }
body.litmus .finding p:last-child { margin-bottom: 0; }
body.litmus .finding .k {
  display: block; font-family: var(--sans); font-size: 10px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 4px;
}
body.litmus .finding .probe { font-family: var(--sans); font-size: 12px; font-weight: 700; text-transform: none; letter-spacing: 0; color: var(--ink); }
body.litmus .finding mark { background: rgba(226,48,12,.16); color: var(--ink); border-radius: 3px; padding: 0 2px; }
body.litmus .finding .ev blockquote {
  font-family: var(--sans); font-size: 12.5px; line-height: 1.5; margin: 6px 0 0;
  padding: 8px 10px; background: var(--paper-2); border-left: none; border-radius: var(--r-md);
}

/* ====================================================================
   WALK SHELL (learn.html) — restyles the real, working onboarding walk
   (game/gamebar/mascot/progress/stage/screen/tiers/gamefoot), not invented
   markup. Recolors the same shapes rather than replacing the game; scoped
   to .walkgame so it never touches the chat/feed/audit shells above.
   ==================================================================== */
body.litmus.walkgame { background: var(--paper); }
body.litmus.walkgame .game { font-family: var(--sans); }

body.litmus.walkgame .mascot svg path, body.litmus.walkgame .mascot svg line { stroke: var(--ink-soft); }
body.litmus.walkgame .mascot .eye { fill: var(--ink); }

body.litmus.walkgame .progress { border: none; background: var(--paper-2); height: 8px; }
body.litmus.walkgame .pbar { background: var(--brand); }

body.litmus.walkgame .big { font-family: var(--serif); font-style: italic; font-weight: 500; color: var(--ink); letter-spacing: 0; }
body.litmus.walkgame .big.book { color: var(--base); font-style: italic; }
body.litmus.walkgame .big b { color: var(--ink); font-weight: 600; }
body.litmus.walkgame .line { font-family: var(--serif); color: var(--ink-soft); }
body.litmus.walkgame .line.sub { font-family: var(--sans); font-size: 12.5px; color: var(--muted); }
body.litmus.walkgame .line b { color: var(--ink); }
body.litmus.walkgame .line a, body.litmus.walkgame .finlinks a { color: var(--brand); }

body.litmus.walkgame .unit-no { font-family: var(--sans); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-size: 12px; }
body.litmus.walkgame .unit-title { font-family: var(--serif); font-style: italic; font-weight: 500; color: var(--ink); letter-spacing: 0; text-transform: none; }

body.litmus.walkgame .tile { border: none; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 12px 14px; }
body.litmus.walkgame .tile b { font-family: var(--sans); font-size: 11.5px; letter-spacing: .02em; }
body.litmus.walkgame .tile p { font-family: var(--serif); color: var(--ink-soft); }
/* the tile text is literally "GREEN"/"YELLOW"/"RED" (a traffic-light metaphor,
   not the established/exploratory/speculative tags) — the dots stay true
   green/yellow/red, just toned to sit quietly in the ink/paper palette. */
body.litmus.walkgame .tile.g .dot { background: #2c9e5b; } body.litmus.walkgame .tile.g b { color: #2c9e5b; }
body.litmus.walkgame .tile.y .dot { background: #a8791f; } body.litmus.walkgame .tile.y b { color: #a8791f; }
body.litmus.walkgame .tile.r .dot { background: var(--acid); } body.litmus.walkgame .tile.r b { color: var(--acid); }

body.litmus.walkgame .gamefoot { border-top: none; }
body.litmus.walkgame .gback {
  font-family: var(--sans); font-size: 16px; border: none; background: var(--paper-2); color: var(--ink-soft);
  border-radius: 50%; width: 38px; height: 38px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
}
body.litmus.walkgame .gback:hover { border-color: transparent; background: var(--brand); color: var(--brand-ink); }
body.litmus.walkgame .cont {
  font-family: var(--sans); font-weight: 700; font-size: 13.5px; text-transform: none; letter-spacing: 0;
  border: none; background: var(--brand); color: var(--brand-ink); border-radius: var(--r-pill); padding: 12px 22px; box-shadow: none;
}
body.litmus.walkgame .cont:hover { background: var(--ink-soft); box-shadow: none; }
body.litmus.walkgame .cont:active { transform: none; box-shadow: none; }

/* ====================================================================
   COVER SHELL (/corpus, build.mjs's `cover` page) — restyles the real
   home/index markup (cover/issueline/title/statement/contents/dept/
   items/features/facecell), not invented markup. Same recolor-the-
   existing-shapes approach as the walk shell; scoped to .corpus-cover
   so nothing here touches book-reader pages, which reuse .cover for an
   unrelated element (the book's own title page).
   ==================================================================== */
body.litmus.corpus-cover { background: var(--paper); }
body.litmus.corpus-cover .cover, body.litmus.corpus-cover .contents { max-width: 760px; }

body.litmus.corpus-cover .issueline {
  font-family: var(--sans); font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: none;
  color: var(--muted); border-top: none; border-bottom: none; padding: 0; margin-bottom: 28px;
}
body.litmus.corpus-cover .issueline .dot { color: var(--faint); }

body.litmus.corpus-cover .cover h1.title {
  font-family: var(--serif); font-style: italic; font-weight: 500; color: var(--ink); letter-spacing: 0;
  font-size: clamp(2.4rem, 7vw, 4.2rem); line-height: 1.02;
}
/* no decorative color on the ampersand/long-division mark — Litmus reserves
   color for the tier language only (see the palette comment up top) */
body.litmus.corpus-cover .cover h1.title .amp { color: var(--ink); font-style: italic; font-weight: 500; }
body.litmus.corpus-cover .cover h1.title .longdiv { border-top-color: var(--ink-soft); }
body.litmus.corpus-cover .cover h1.title .longdiv::before { color: var(--ink-soft); font-family: var(--serif); }

body.litmus.corpus-cover .cover .statement { font-family: var(--serif); color: var(--ink-soft); }
body.litmus.corpus-cover .cover .statement .thesis { font-family: var(--serif); font-style: italic; font-weight: 600; color: var(--ink); }
body.litmus.corpus-cover .cover .by { font-family: var(--sans); color: var(--muted); }
body.litmus.corpus-cover .cover .by a { color: var(--ink); }
body.litmus.corpus-cover .cover .enter { font-family: var(--sans); font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--ink-soft); }
body.litmus.corpus-cover .cover .enter a { color: var(--ink-soft); }
body.litmus.corpus-cover .cover .enter a:hover { color: var(--brand); }

body.litmus.corpus-cover .dept-head { border-bottom: 1px solid var(--border); }
body.litmus.corpus-cover .dept-head .no { font-family: var(--sans); font-weight: 700; font-size: 13px; color: var(--faint); }
body.litmus.corpus-cover .dept-head h2 { font-family: var(--serif); font-style: italic; font-weight: 500; letter-spacing: 0; color: var(--ink); }
body.litmus.corpus-cover .dept-head .gloss { font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: none; color: var(--muted); }

body.litmus.corpus-cover .primer-lead { font-family: var(--serif); font-size: 17px; line-height: 1.5; color: var(--ink); }
body.litmus.corpus-cover .primer-body p { font-family: var(--serif); line-height: 1.6; color: var(--ink-soft); }
body.litmus.corpus-cover .primer-body strong { color: var(--ink); }
body.litmus.corpus-cover .primer-body em { color: var(--ink); }
body.litmus.corpus-cover .primer-doors {
  font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
  margin: 22px 0 12px;
}

body.litmus.corpus-cover .items {
  background: none; border: none; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}
body.litmus.corpus-cover .item {
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 16px 17px 18px; transition: box-shadow .15s ease;
}
body.litmus.corpus-cover .item:hover { background: var(--surface); box-shadow: var(--shadow-md); }
body.litmus.corpus-cover .item:hover h3 { color: var(--brand); }
body.litmus.corpus-cover .item .kicker { font-family: var(--sans); font-size: 10.5px; font-weight: 700; letter-spacing: .03em; text-transform: none; color: var(--muted); }
body.litmus.corpus-cover .item h3 { font-family: var(--serif); font-style: italic; font-weight: 500; letter-spacing: 0; color: var(--ink); }
body.litmus.corpus-cover .item p { font-family: var(--sans); color: var(--muted); }

body.litmus.corpus-cover .features { gap: 12px; }
body.litmus.corpus-cover .feature {
  background: var(--surface); border: none; border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 26px 24px 28px; transition: box-shadow .15s ease;
}
body.litmus.corpus-cover .feature:hover { background: var(--surface); border-color: transparent; box-shadow: var(--shadow-md); }
body.litmus.corpus-cover .feature:hover h3 { color: var(--brand); }
body.litmus.corpus-cover .feature .kicker { font-family: var(--sans); font-size: 10.5px; font-weight: 700; letter-spacing: .03em; text-transform: none; color: var(--muted); }
body.litmus.corpus-cover .feature h3 { font-family: var(--serif); font-style: italic; font-weight: 500; letter-spacing: 0; color: var(--ink); }
body.litmus.corpus-cover .feature p { font-family: var(--sans); color: var(--muted); }
body.litmus.corpus-cover .feature .read { font-family: var(--sans); font-size: 11.5px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--ink-soft); }

body.litmus.corpus-cover .facecell { background: var(--paper-2); border-radius: var(--r-lg); }
body.litmus.corpus-cover .facecell .face { font-family: var(--serif); font-style: italic; color: var(--ink); letter-spacing: 0; }
body.litmus.corpus-cover .facecell .facenote { font-family: var(--sans); color: var(--muted); }

/* ====================================================================
   THINKING SPECTRUM — color as behavior, never as permanent branding.
   Idle Litmus stays monochrome (ink / editorial serif). While the model
   is working, the send orb + the litmus pill become one living object:
   a beautiful rainbow gradient flowing slowly through them (Instagram /
   Gemini moment), then settling back to black. No spinner, no sparkles —
   the color itself is the loading indicator.
   Targets:
     dramaturg chat  — #send.run via body[data-run="executing"] or .is-thinking
     news cards      — .nc-btn.is-thinking ("performing the litmus test…")
     stage clone     — .lit-clone-card while body.is-testing
     reality page    — #run.run + .runmini via .is-thinking
     sidebar pill    — .lit-mark-fill gradient stops while executing
   ==================================================================== */
body.litmus {
  --lit-red: #ff3b30;
  --lit-orange: #ff9500;
  --lit-yellow: #ffd60a;
  --lit-green: #30d158;
  --lit-cyan: #32d7ff;
  --lit-blue: #0a84ff;
  --lit-indigo: #5e5ce6;
  --lit-violet: #bf5af2;
  --lit-pink: #ff2d95;
}

/* Thinking controls become living color fields (see chroma.js). Two
   full-surface layers per control, crossfaded every beat — complete fields
   dissolve into each other, never one gradient morphing or one rainbow
   sliding across. Layers sit exactly at inset 0 with the parent's radius
   and overflow hidden: the silhouette is the mask, and no color may spill
   past it — no negative inset, no blur, no glow, no shadow. */
body.litmus .is-chroma {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  color: #fff;
  border-color: transparent;
  box-shadow: none;
  animation: chromaBreath 1200ms ease-in-out infinite;
}

.chroma-layer {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transform: scale(1.05);
  transition:
    opacity 1120ms ease,
    transform 1200ms cubic-bezier(.22, 1, .36, 1);
  will-change: opacity, transform;
}

.chroma-layer.isCurrent {
  opacity: 1;
  transform: scale(1);
}

.chroma-content {
  position: relative;
  z-index: 1;
}

/* the object stays still — only the light pulses, rest → bloom → settle */
@keyframes chromaBreath {
  0%, 100% {
    filter: saturate(1) brightness(1);
  }
  50% {
    filter: saturate(1.14) brightness(1.075);
  }
}

/* idle pill is an editorial italic link; thinking materializes the machine */
body.litmus .nc-btn.is-thinking {
  display: inline-flex;
  align-items: center;
  font-family: var(--sans);
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  padding: 12px 18px;
  border-radius: var(--r-pill);
}

/* the surviving clone gets engine layers from JS while the homepage
   dissolves — same material, no separate treatment. */

/* finishing needs no paint of its own: the engine fades its layers out over
   ~1.2s and dismantles them, so the control settles back to restrained
   black/ink by itself. */


/* the sidebar pill joins in: while executing, the wave hides and the
   full-interior field shows (see the .lit-mark-field swap above) — the whole
   pill interior becomes the gradient, stroke crisp above it. Only the
   gradient stops move, smooth and slow like the orb. */
body.litmus[data-run="executing"] #litmarkreact stop:first-child {
  animation: lit-stop-a 6s linear infinite;
}
body.litmus[data-run="executing"] #litmarkreact stop:last-child {
  animation: lit-stop-b 6s linear infinite;
}
@keyframes lit-stop-a {
  0% { stop-color: #ff3b30; }
  20% { stop-color: #bf5af2; }
  40% { stop-color: #0a84ff; }
  60% { stop-color: #30d158; }
  80% { stop-color: #ff9500; }
  100% { stop-color: #ff3b30; }
}
@keyframes lit-stop-b {
  0% { stop-color: #0a84ff; }
  20% { stop-color: #30d158; }
  40% { stop-color: #ffd60a; }
  60% { stop-color: #ff2d95; }
  80% { stop-color: #bf5af2; }
  100% { stop-color: #0a84ff; }
}

@media (prefers-reduced-motion: reduce) {
  body.litmus .is-chroma {
    animation: none;
  }
  .chroma-layer {
    transition: opacity 300ms ease;
    transform: none;
  }
  body.litmus[data-run="executing"] .lit-mark-fill {
    animation: none;
    fill: url(#litmarkreact);
  }
  body.litmus[data-run="executing"] #litmarkreact stop:first-child,
  body.litmus[data-run="executing"] #litmarkreact stop:last-child {
    animation: none;
  }
}

/* ====================================================================
   RESPONSIVE LAYOUT — container-aware first, viewport as fallback.
   Litmus runs standalone AND inside the arcade portfolio's embedded
   iframe, where the browser window can be far wider than the space
   Litmus actually gets. Viewport media queries alone report the window,
   so the shell below declares itself a query container: internal layout
   responds to its own real width in both contexts.

   Three tiers (each expressed as a viewport query for standalone AND a
   container query for embedded — container rules come later so they win
   when the two disagree, i.e. a narrow iframe in a wide window):
     desktop  >1024px : icon rail (68px) or drawer (270px) pushes content
     tablet   600–1024: sidebar becomes an overlay drawer, content full width
     mobile    ≤600px : top bar, overlay drawer, single column, scroll topics
   No transform:scale fitting anywhere — regions reflow, never shrink-fit.
   ==================================================================== */
body.litmus .ws-shell { container: litmus / inline-size; }

/* ---- container-relative type: the same clamps as above, but keyed to
   the shell's own width (cqw) instead of the window (vw). The vw line
   stays first as the fallback for engines without container units. ---- */
body.litmus .turn.you { font-size: clamp(20px, 1.35vw, 23px); font-size: clamp(20px, 1.35cqw, 23px); }
body.litmus .turn.dram { font-size: clamp(20px, 1.35vw, 23px); font-size: clamp(20px, 1.35cqw, 23px); }
body.litmus .turn.dram.is-long, body.litmus .turn.you.is-long { font-size: clamp(19px, 1.3vw, 22px); font-size: clamp(19px, 1.3cqw, 22px); }
body.litmus .fh-title { font-size: clamp(32px, 5vw, 46px); font-size: clamp(32px, 5cqw, 46px); }
body.litmus .newscard.lead .nc-title { font-size: clamp(22px, 2.6vw, 28px); font-size: clamp(22px, 2.6cqw, 28px); }
body.litmus .litx .lx-headline { font-size: clamp(30px, 4.6vw, 48px); font-size: clamp(30px, 4.6cqw, 48px); }
body.litmus .litx.ax-house-of-cards .lx-headline { font-size: clamp(38px, 6vw, 64px); font-size: clamp(38px, 6cqw, 64px); }
body.litmus .litx.ax-spin .lx-headline { font-size: clamp(44px, 7.5vw, 84px); font-size: clamp(44px, 7.5cqw, 84px); }
body.litmus .litx.ax-solid .lx-headline { font-size: clamp(28px, 3.6vw, 40px); font-size: clamp(28px, 3.6cqw, 40px); }

/* ---- shrink-chain guards: every flex/grid child between the shell and
   the text must be allowed to shrink, or long content sizes the layout
   instead of wrapping inside it. ---- */
body.litmus .ws-center { min-width: 0; }
body.litmus .screen, body.litmus .pandora-chat-root { min-width: 0; max-width: 100%; }
body.litmus #log { min-width: 0; overflow-x: clip; }
body.litmus .turn { min-width: 0; }
body.litmus .ws-composer, body.litmus .sayrow { min-width: 0; box-sizing: border-box; width: min(680px, 100%); }
body.litmus .sayrow #say, body.litmus .ws-composer #say { min-width: 0; flex: 1 1 auto; max-height: 168px; }
body.litmus .attach-wrap, body.litmus #clip.clip, body.litmus #send.run { flex: 0 0 auto; }
body.litmus .litmus-dock { box-sizing: border-box; }
body.litmus .turn.dram .reality { overflow-wrap: break-word; }
body.litmus .turn.dram .reality img { max-width: 100%; height: auto; }
body.litmus .turn.dram .reality a { overflow-wrap: anywhere; }
/* while the on-screen keyboard is up the shell already tracks the visual
   viewport (--app-h); docking absolutely then keeps the composer glued to
   the shell's bottom (above the keyboard) instead of the layout viewport's
   (behind the keyboard). At rest it stays fixed as before. */
body.litmus.kb-open .litmus-dock { position: absolute; }

/* ---- mobile top bar: quiet wordmark + menu toggle, phones only.
   Hidden everywhere else — desktop keeps the rail/drawer chrome. ---- */
body.litmus .litmus-mbar {
  display: none; position: fixed; top: 0; left: 0; right: 0; z-index: 34;
  align-items: center; gap: 10px;
  min-height: 52px; padding: env(safe-area-inset-top, 0px) 12px 6px;
  background: var(--paper); border-bottom: 1px solid var(--border);
}
body.litmus .mbar-btn {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface); color: var(--ink); border: none;
  box-shadow: var(--shadow-sm); cursor: pointer; flex: 0 0 auto;
}
body.litmus .mbar-btn:hover { background: var(--brand); color: var(--brand-ink); }
body.litmus .mbar-btn:focus-visible { outline: 2px solid var(--ink-soft); outline-offset: 2px; }
body.litmus .mbar-word {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: 21px; letter-spacing: -0.005em; color: var(--ink);
}

/* ---- tablet / embedded arcade (viewport fallback for standalone) ---- */
@media (max-width: 1024px) and (min-width: 601px) {
  body.litmus:not(.nav-open) .rail-fab {
    display: flex; position: fixed; top: max(12px, env(safe-area-inset-top, 0px)); left: max(12px, env(safe-area-inset-left, 0px)); z-index: 35;
    align-items: center; justify-content: center; width: 44px; height: 44px;
    border-radius: 50%; background: var(--surface); color: var(--ink);
    border: none; box-shadow: var(--shadow-md); cursor: pointer;
  }
}
/* ---- tablet / embedded arcade (container truth for the iframe) ----
   Same overlay-drawer treatment the phone query below the old 720px line
   gets — extended to the full 600–1024 band so an 800px arcade screen
   never pays the 270px push-drawer tax. Later in source than the desktop
   push rules, so these win when viewport and container disagree. ---- */
@container litmus (max-width: 1024px) {
  body.litmus .ws-rail { width: 0 !important; }
  body.litmus.nav-open .ws-rail { width: min(270px, 88vw) !important; }
  body.litmus .ws-rail ~ .ws-scrim ~ .ws-center { margin-left: 0 !important; }
  body.litmus .litmus-dock { left: 0; }
  body.litmus.nav-open .ws-scrim {
    display: block; position: fixed; inset: 0; background: transparent; z-index: 15;
  }
  body.litmus .sayrow #say { min-height: 0; }
  body.litmus.agentic .pandora-chat-root { padding: 0 1rem 1rem; }
  body.litmus #log { padding-left: 14px; padding-right: 14px; }
}
/* floating opener for the tablet band (phones get the top bar instead) */
@container litmus (max-width: 1024px) and (min-width: 601px) {
  body.litmus:not(.nav-open) .rail-fab {
    display: flex; position: fixed; top: max(12px, env(safe-area-inset-top, 0px)); left: max(12px, env(safe-area-inset-left, 0px)); z-index: 35;
    align-items: center; justify-content: center; width: 44px; height: 44px;
    border-radius: 50%; background: var(--surface); color: var(--ink);
    border: none; box-shadow: var(--shadow-md); cursor: pointer;
  }
  body.litmus:not(.nav-open) .rail-fab:hover { background: var(--brand); color: var(--brand-ink); }
  body.litmus:not(.nav-open) .rail-fab:focus-visible { outline: 2px solid var(--ink-soft); outline-offset: 2px; }
}
/* ---- desktop push layout, container truth for wide iframes ----
   Mirrors the min-width:721px viewport block: rail/drawer push the canvas
   instead of covering it. Harmless standalone (container ≈ window there). */
@container litmus (min-width: 1025px) {
  body.litmus .ws-rail ~ .ws-scrim ~ .ws-center { margin-left: 68px !important; }
  body.litmus .litmus-dock { left: 68px; }
  body.litmus.nav-open .ws-rail ~ .ws-scrim ~ .ws-center { margin-left: 270px !important; }
  body.litmus.nav-open .litmus-dock { left: 270px; }
}

/* ---- narrow grids follow the container, not the window ---- */
@container litmus (max-width: 560px) {
  body.litmus .newsfeed { grid-template-columns: minmax(0, 1fr); }
  body.litmus .newscard.ed-pano, body.litmus .newscard.ed-tall { height: 380px; }
  body.litmus .newscard.lead { flex-direction: column; }
  body.litmus .newscard.lead .nc-img { flex: 1 1 auto; min-width: 0; max-width: 100%; min-height: 180px; }
  body.litmus .newscard.lead .nc-body { padding: 18px 20px; }
  body.litmus .ct-cols { grid-template-columns: 1fr; }
  body.litmus .ct-claim { font-size: 18px; }
  body.litmus .litx.ax-contradiction .lx-duel { grid-template-columns: 1fr; }
  body.litmus .litx.ax-contradiction .lx-doesnt { border-left: none; border-top: 2px solid var(--react); }
  body.litmus .litx { border-radius: 22px 22px 22px 10px; }
  body.litmus .lit-stage-scroll { padding: max(4vh, 20px) 10px 110px; }
}

/* ---- mobile ≤600px: genuinely phone-first (viewport fallback) ---- */
@media (max-width: 600px) {
  body.litmus .litmus-mbar { display: flex; }
  body.litmus:not(.nav-open) .rail-fab { display: none; }
  body.litmus.nav-open .ws-rail { z-index: 40; }
  body.litmus.nav-open .ws-scrim { z-index: 33; }
  body.litmus #log { padding: calc(60px + env(safe-area-inset-top, 0px)) 14px 220px; }
  body.litmus .turn.dram, body.litmus .turn.you { font-size: 19px; }
  body.litmus .turn.dram { padding: 22px 20px 20px; border-radius: 28px 28px 28px 12px; }
  body.litmus .turn.you { padding: 14px 20px; }
  body.litmus .turn { max-width: 94%; }
  body.litmus .turn.dram.news-turn { max-width: 100%; }
  body.litmus .fh-title { font-size: 32px; }
  body.litmus .lit-fronthead { margin-top: 4px; }
  body.litmus .topicpicker {
    flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto;
    margin-bottom: 14px; padding-bottom: 8px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  body.litmus .topicpicker::-webkit-scrollbar { display: none; }
  body.litmus .topicchip { flex: 0 0 auto; padding: 10px 10px 12px; }
  body.litmus .topicchip:focus-visible { outline: 2px solid var(--ink-soft); outline-offset: 1px; border-radius: 4px; }
  body.litmus .chips { display: flex; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
  body.litmus .chips::-webkit-scrollbar { display: none; }
  body.litmus .chip { flex: 0 0 auto; }
  body.litmus #send.run { width: 44px; height: 44px; }
  body.litmus #clip.clip { width: 40px; height: 40px; }
  body.litmus #clip.clip svg { width: 18px; height: 18px; }
  body.litmus .followbtn { padding: 10px 18px; }
  body.litmus .nc-btn { padding: 10px 0; }
  body.litmus .att-x { width: 28px; height: 28px; font-size: 16px; }
  body.litmus .litmus-dock { padding-bottom: max(10px, env(safe-area-inset-bottom, 0px)); }
  body.litmus .reality-card { padding: 14px 14px 16px; }
  body.litmus .lit-stage-cardwrap { width: min(880px, calc(100vw - 20px)); }
  body.litmus .atteditor { padding: 12px; }
  body.litmus .atteditor-card { max-height: calc(100dvh - 24px); }
  body.litmus .localsetup-card { width: min(480px, calc(100vw - 32px)); }
}
/* ---- mobile ≤600px: container truth for narrow iframes ---- */
@container litmus (max-width: 600px) {
  body.litmus .litmus-mbar { display: flex; }
  body.litmus:not(.nav-open) .rail-fab { display: none; }
  body.litmus.nav-open .ws-rail { z-index: 40; }
  body.litmus.nav-open .ws-scrim { z-index: 33; }
  body.litmus #log { padding: calc(60px + env(safe-area-inset-top, 0px)) 14px 220px; }
  body.litmus .turn.dram, body.litmus .turn.you { font-size: 19px; }
  body.litmus .turn.dram { padding: 22px 20px 20px; border-radius: 28px 28px 28px 12px; }
  body.litmus .turn.you { padding: 14px 20px; }
  body.litmus .turn { max-width: 94%; }
  body.litmus .turn.dram.news-turn { max-width: 100%; }
  body.litmus .fh-title { font-size: 32px; }
  body.litmus .lit-fronthead { margin-top: 4px; }
  body.litmus .topicpicker {
    flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto;
    margin-bottom: 14px; padding-bottom: 8px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  body.litmus .topicpicker::-webkit-scrollbar { display: none; }
  body.litmus .topicchip { flex: 0 0 auto; padding: 10px 10px 12px; }
  body.litmus .topicchip:focus-visible { outline: 2px solid var(--ink-soft); outline-offset: 1px; border-radius: 4px; }
  body.litmus .chips { display: flex; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
  body.litmus .chips::-webkit-scrollbar { display: none; }
  body.litmus .chip { flex: 0 0 auto; }
  body.litmus #send.run { width: 44px; height: 44px; }
  body.litmus #clip.clip { width: 40px; height: 40px; }
  body.litmus #clip.clip svg { width: 18px; height: 18px; }
  body.litmus .followbtn { padding: 10px 18px; }
  body.litmus .nc-btn { padding: 10px 0; }
  body.litmus .att-x { width: 28px; height: 28px; font-size: 16px; }
  body.litmus .litmus-dock { padding-bottom: max(10px, env(safe-area-inset-bottom, 0px)); }
  body.litmus .reality-card { padding: 14px 14px 16px; }
  body.litmus .lit-stage-cardwrap { width: min(880px, calc(100vw - 20px)); }
  body.litmus .atteditor { padding: 12px; }
  body.litmus .atteditor-card { max-height: calc(100dvh - 24px); }
  body.litmus .localsetup-card { width: min(480px, calc(100vw - 32px)); }
}

/* Article feed: the grid itself decides when two readable columns fit. */
body.litmus .newsfeed {
  container-type: inline-size;
  width: 100%;
  max-width: 680px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-flow: row;
  align-items: start;
}
body.litmus .newscard,
body.litmus .newscard.lead,
body.litmus .newscard.ed-pano,
body.litmus .newscard.ed-tall {
  grid-column: auto;
  height: auto;
  min-height: 0;
  flex-direction: column;
  width: 100%;
}
body.litmus .newscard .nc-img,
body.litmus .newscard.lead .nc-img {
  flex: none;
  width: 100%;
  max-width: none;
  min-height: 0;
  aspect-ratio: 16 / 10;
}
body.litmus .newscard .nc-body,
body.litmus .newscard.lead .nc-body { flex: none; padding: 18px 20px 20px; }
body.litmus .newscard .nc-title { display: block; overflow: visible; }
body.litmus .newscard .nc-actions { margin-top: 0; flex-wrap: wrap; }
@container litmus (max-width: 760px) {
  body.litmus .newsfeed { grid-template-columns: minmax(0, 1fr); }
}

/* An odd deck gets one full-width lead, then complete two-card rows. */
body.litmus .newsfeed > .newscard:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
@container litmus (max-width: 760px) {
  body.litmus .newsfeed > .newscard:first-child:nth-last-child(odd) { grid-column: auto; }
}
