/*! Claude Basic 0.6.0 (v0.6.0) — styles. Built from src/; do not edit this file. */
/* ── src/css/tokens.css ── */
/* ════════════════════════════════════════════════════════════════════════════
   Claude Basic — tokens
   Three layers (SURVEY.md §6). Components read ONLY the semantic layer (--cb-*
   roles below); a theme is nothing but a re-mapping of that layer. If a component
   ever reaches for a raw hex, a theme can no longer move it — that is the bug.

     1. primitives      — fixed facts (identity colours, scales). Never themed.
     2. semantic roles  — surface / text / status / data / shape / type / motion.
     3. component knobs — defined in terms of (2), e.g. --cb-heat-*.

   Identity colours (Twitch purple, a project's Peacock colour, UW purple) are
   PRIMITIVES on purpose: "Course Management is purple" must stay true in every
   theme. Themes may change what surrounds them, never their hue.
   ════════════════════════════════════════════════════════════════════════════ */

:root {
  /* ── 1. primitives: identity (fixed across themes) ─────────────────────── */
  --cb-id-twitch:  #9146ff;
  --cb-id-twitch-soft: #b48bff;
  --cb-id-youtube: #ff3d3d;
  --cb-id-files:   #3d7bff;
  --cb-id-screen:  #1fb6a6;
  --cb-id-music:   #b48bff;
  --cb-id-ambient: #5a6272;
  --cb-id-viewers: #ff6f88;   /* the live viewer-count pink */
  --cb-id-uw:      #4b2e83;
  --cb-id-uw-soft: #8b6fb0;
  --cb-id-walk:    #2f8f4e;
  --cb-id-drive:   #4f9dff;
  --cb-id-fly:     #c77dff;

  /* ── 1. primitives: scales ─────────────────────────────────────────────── */
  --cb-space-1: 4px;  --cb-space-2: 8px;  --cb-space-3: 12px;
  --cb-space-4: 16px; --cb-space-5: 24px; --cb-space-6: 32px;

  /* ── 2. semantic: Claude Basic (the default theme) ─────────────────────────
     Reconciled 2026-10-08 from Pulse (#0f1115 bg, 10px cards, soft blue) and the
     Media Dashboard (#14161a bg, 14px cards, the role-separated token set). */
  color-scheme: dark;

  /* surfaces, darkest → lightest. --cb-surface-3 and --cb-border share a value
     today but are different jobs (button fill vs hairline): keep them separate so
     a theme can move one alone. */
  --cb-bg:          #111317;   /* page */
  --cb-sunken:      #16191f;   /* strips that sit BELOW the page surface */
  --cb-surface:     #1a1d24;   /* cards, panels, hero */
  --cb-surface-2:   #222731;   /* chips, inputs, raised bits inside a card */
  --cb-surface-3:   #2a2f39;   /* button fills */
  --cb-surface-3-hover: #333a47;
  --cb-border:      #2a2f39;
  --cb-border-2:    #3a404b;   /* hover / emphasis */
  --cb-overlay:     rgb(0 0 0 / .62);
  --cb-shadow:      0 18px 48px rgb(0 0 0 / .5);
  --cb-shadow-sm:   0 6px 20px rgb(0 0 0 / .4);

  /* text, brightest → dimmest */
  --cb-text:    #e6e9ef;
  --cb-text-2:  #cdd2da;
  --cb-text-3:  #b0b6c0;
  --cb-muted:   #8b93a7;
  --cb-muted-2: #6f7683;
  --cb-on-accent: #ffffff;     /* text on a filled accent/status button */

  /* accent: --cb-accent for lines/text/rings, --cb-accent-fill for filled
     buttons (the soft blue is too light to carry white text). */
  --cb-accent:      #6ea8fe;
  --cb-accent-fill: #2b6cf6;
  --cb-accent-soft: rgb(110 168 254 / .16);
  --cb-focus:       rgb(110 168 254 / .45);

  /* status trio — the health lamp's vocabulary, reused for anything that is
     fine / working on it / broken. */
  --cb-ok:   #36d36b;  --cb-ok-dim:   #3f8f5f;  --cb-ok-soft:   rgb(54 211 107 / .15);
  --cb-warn: #e8b339;  --cb-warn-dim: #b8913a;  --cb-warn-soft: rgb(232 179 57 / .15);
  --cb-bad:  #e0697e;  --cb-bad-dim:  #c2384a;  --cb-bad-soft:  rgb(224 105 126 / .15);
  --cb-info: var(--cb-accent);  --cb-info-soft: var(--cb-accent-soft);

  /* distinct jobs that merely LOOK like the colours above */
  --cb-gold:  #e8c34a;   /* favourites, scrub marks */
  --cb-glow:  #e0a94a;   /* change-glow: "this just moved" */
  --cb-seam:  #5fd07a;   /* "capture began" / data-regime seams */
  --cb-now:   #ffffff;   /* the now-line */

  /* data surfaces */
  --cb-cell-empty: #1c2029;  /* heat cell with no activity */
  --cb-grid:       #262b34;  /* chart gridlines */
  --cb-axis:       var(--cb-muted);
  --cb-track:      #20242c;  /* empty bar/rail track */

  /* shape — card vs bar differ on purpose: a bar reads as a strip, a card as a surface */
  --cb-radius-card: 12px;
  --cb-radius-bar:  10px;
  --cb-radius-ctl:  8px;
  --cb-radius-chip: 999px;
  --cb-radius-cell: 2px;
  --cb-border-w:    1px;

  /* density */
  --cb-pad-card: 16px;
  --cb-pad-ctl:  8px 14px;
  --cb-gap:      14px;
  --cb-row-pad:  9px 11px;

  /* type */
  --cb-font-ui:    system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --cb-font-head:  var(--cb-font-ui);
  --cb-font-mono:  ui-monospace, "Cascadia Mono", Consolas, monospace;
  --cb-font-size:  15px;
  --cb-head-weight: 700;
  --cb-label-case: uppercase;      /* section labels — Phosphor and Paper change this */
  --cb-label-track: .06em;

  /* motion */
  --cb-dur-fast:  .12s;
  --cb-dur:       .2s;
  --cb-dur-flash: 1.6s;

  /* ── 3. component knobs ───────────────────────────────────────────────────
     Heat ramp: share of the series colour mixed into the empty-cell colour.
     Mixing (not opacity) is what lets the same ramp work on a light theme. */
  --cb-heat-1: 28%;
  --cb-heat-2: 50%;
  --cb-heat-3: 72%;
  --cb-heat-4: 100%;
  /* provenance encodings (see provenance.css) */
  --cb-ghost-opacity: .35;
  --cb-hatch: rgb(0 0 0 / .38);

  /* sim layer (sim.css / sim.js). Series colours are for lines that carry no
     identity colour of their own: categorical, so none of them means good or bad
     the way ok/warn/bad do. The ramp is the histogram heatmap's three stops: an
     empty cell, the chart's colour, then text. On dark themes that runs dark →
     colour → near-white; on Paper it inverts without a special case. */
  --cb-series-1: #6ea8fe; --cb-series-2: #e8b339; --cb-series-3: #ff6f88;
  --cb-series-4: #1fb6a6; --cb-series-5: #b48bff; --cb-series-6: #8fc27e;
  --cb-ramp-lo:  var(--cb-cell-empty);
  --cb-ramp-mid: var(--cb-accent);
  --cb-ramp-hi:  var(--cb-text);
}

/* ── Phosphor — terminal-native: mono everything, near-black, square, dense ── */
:root[data-theme="phosphor"] {
  color-scheme: dark;
  --cb-bg: #040704; --cb-sunken: #060a06; --cb-surface: #08100a; --cb-surface-2: #0d180f;
  --cb-surface-3: #12210f; --cb-surface-3-hover: #1a2e17;
  --cb-border: #1b3a1f; --cb-border-2: #2c5c31;
  --cb-overlay: rgb(0 0 0 / .78); --cb-shadow: 0 0 0 1px #2c5c31; --cb-shadow-sm: 0 0 0 1px #1b3a1f;
  --cb-text: #b9f6c4; --cb-text-2: #9be3a8; --cb-text-3: #7fc98d; --cb-muted: #5d9a68; --cb-muted-2: #3f7349;
  --cb-on-accent: #031006;
  --cb-accent: #39ff88; --cb-accent-fill: #39ff88; --cb-accent-soft: rgb(57 255 136 / .12); --cb-focus: rgb(57 255 136 / .4);
  --cb-ok: #39ff88; --cb-ok-dim: #22a85a; --cb-ok-soft: rgb(57 255 136 / .12);
  --cb-warn: #ffb000; --cb-warn-dim: #b37c00; --cb-warn-soft: rgb(255 176 0 / .14);
  --cb-bad: #ff5f56; --cb-bad-dim: #c23b33; --cb-bad-soft: rgb(255 95 86 / .14);
  --cb-gold: #ffd84d; --cb-glow: #ffb000; --cb-seam: #39ff88; --cb-now: #b9f6c4;
  --cb-cell-empty: #0b160d; --cb-grid: #12241a; --cb-track: #0b160d;
  --cb-radius-card: 0; --cb-radius-bar: 0; --cb-radius-ctl: 0; --cb-radius-chip: 2px; --cb-radius-cell: 0;
  --cb-pad-card: 12px; --cb-pad-ctl: 5px 10px; --cb-gap: 10px; --cb-row-pad: 6px 9px;
  --cb-font-ui: var(--cb-font-mono); --cb-font-head: var(--cb-font-mono);
  --cb-font-size: 14px; --cb-head-weight: 600; --cb-label-case: lowercase; --cb-label-track: 0;
  --cb-hatch: rgb(0 0 0 / .55);
  --cb-series-1: #39ff88; --cb-series-2: #ffb000; --cb-series-3: #ff5f56;
  --cb-series-4: #4fd6ff; --cb-series-5: #d08bff; --cb-series-6: #e6f5a0;
}

/* ── Paper — light, warm, serif heads, hairlines. Print and teaching handouts. ── */
:root[data-theme="paper"] {
  color-scheme: light;
  --cb-bg: #f5f1e8; --cb-sunken: #ece6d9; --cb-surface: #fffdf8; --cb-surface-2: #f3eee3;
  --cb-surface-3: #e9e2d3; --cb-surface-3-hover: #ded5c3;
  --cb-border: #ddd5c4; --cb-border-2: #bfb49e;
  --cb-overlay: rgb(40 32 20 / .35); --cb-shadow: 0 12px 32px rgb(60 45 20 / .16); --cb-shadow-sm: 0 4px 14px rgb(60 45 20 / .12);
  --cb-text: #1f1c17; --cb-text-2: #38332b; --cb-text-3: #4f483d; --cb-muted: #756c5d; --cb-muted-2: #9a907f;
  --cb-on-accent: #ffffff;
  --cb-accent: #2756a8; --cb-accent-fill: #2756a8; --cb-accent-soft: rgb(39 86 168 / .1); --cb-focus: rgb(39 86 168 / .3);
  --cb-ok: #2f7d45; --cb-ok-dim: #2f7d45; --cb-ok-soft: rgb(47 125 69 / .12);
  --cb-warn: #a8701a; --cb-warn-dim: #a8701a; --cb-warn-soft: rgb(168 112 26 / .13);
  --cb-bad: #b0344a; --cb-bad-dim: #b0344a; --cb-bad-soft: rgb(176 52 74 / .1);
  --cb-gold: #b8890f; --cb-glow: #d9901c; --cb-seam: #2f7d45; --cb-now: #b0344a;
  --cb-cell-empty: #ebe5d8; --cb-grid: #e3dccd; --cb-track: #ebe5d8;
  --cb-radius-card: 6px; --cb-radius-bar: 4px; --cb-radius-ctl: 4px; --cb-radius-cell: 1px;
  --cb-font-head: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --cb-label-case: none; --cb-label-track: .01em;
  --cb-hatch: rgb(255 255 255 / .55);
  /* darker series so a 1.5px line holds up on cream */
  --cb-series-1: #2756a8; --cb-series-2: #a8701a; --cb-series-3: #b0344a;
  --cb-series-4: #1d7f74; --cb-series-5: #6b4bb0; --cb-series-6: #4f7d2f;
}

/* ── Clay — warm dark, terracotta accent, softer corners. The "ours" variant. ── */
:root[data-theme="clay"] {
  color-scheme: dark;
  --cb-bg: #191513; --cb-sunken: #1d1816; --cb-surface: #241e1b; --cb-surface-2: #2e2622;
  --cb-surface-3: #372d28; --cb-surface-3-hover: #443830;
  --cb-border: #3a302a; --cb-border-2: #54453c;
  --cb-text: #f2e9df; --cb-text-2: #e1d5c8; --cb-text-3: #cbbcad; --cb-muted: #a8988a; --cb-muted-2: #85776b;
  --cb-accent: #e08a68; --cb-accent-fill: #c96442; --cb-accent-soft: rgb(224 138 104 / .15); --cb-focus: rgb(224 138 104 / .4);
  --cb-ok: #8fc27e; --cb-ok-dim: #6b9a5c; --cb-ok-soft: rgb(143 194 126 / .14);
  --cb-warn: #e5b85c; --cb-warn-dim: #b8913f; --cb-warn-soft: rgb(229 184 92 / .14);
  --cb-bad: #e8776a; --cb-bad-dim: #c2503f; --cb-bad-soft: rgb(232 119 106 / .14);
  --cb-gold: #ecc25a; --cb-glow: #f0b45a; --cb-seam: #8fc27e; --cb-now: #f2e9df;
  --cb-cell-empty: #2a221e; --cb-grid: #342a25; --cb-track: #2a221e;
  --cb-radius-card: 18px; --cb-radius-bar: 14px; --cb-radius-ctl: 12px; --cb-radius-cell: 3px;
  --cb-pad-card: 18px;
  --cb-font-head: ui-serif, "Iowan Old Style", Georgia, serif;
  --cb-label-track: .08em;
  /* the terracotta accent sits 5th, not 1st: next to --cb-bad it can't be told apart */
  --cb-series-1: #e5b85c; --cb-series-2: #6fb3c4; --cb-series-3: #8fc27e;
  --cb-series-4: #c9a0dc; --cb-series-5: #e08a68; --cb-series-6: #d9c8b4;
}

/* ── src/css/base.css ── */
/* ════════════════════════════════════════════════════════════════════════════
   base — the minimum a page needs to look like Claude Basic. Deliberately thin:
   it styles the document, not the app's own elements, so adopting the kit never
   silently restyles a button the app hasn't converted yet.
   ════════════════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cb-bg);
  color: var(--cb-text);
  font: var(--cb-font-size)/1.5 var(--cb-font-ui);
}
a { color: var(--cb-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--cb-focus); outline-offset: 2px; }
::selection { background: var(--cb-accent-soft); }

/* numbers line up in every table, timer and stat */
.cb-num, .cb-table td.num, .cb-table th.num { font-variant-numeric: tabular-nums; }

/* thin scrollbars that sit inside the surface instead of fighting it */
* { scrollbar-width: thin; scrollbar-color: var(--cb-border-2) transparent; }

/* page container */
.cb-wrap { max-width: 1880px; width: 94%; margin: 0 auto; padding: 24px 24px 64px; }
@media (max-width: 700px) { .cb-wrap { width: 100%; padding: 16px 16px 48px; } }

.cb-muted { color: var(--cb-muted); }
.cb-dim   { color: var(--cb-muted-2); }
.cb-mono  { font-family: var(--cb-font-mono); }
.cb-sr    { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cb-scroll-x { overflow-x: auto; padding-bottom: 4px; }

/* ── src/css/components.css ── */
/* ════════════════════════════════════════════════════════════════════════════
   components — the CSS-only half of the kit. Every class is cb- prefixed so it
   can live beside an app's legacy classes during a migration. Variants are
   modifier classes (.cb-btn.primary), tones are shared words across components:
   ok · warn · bad · info · accent · neutral.
   ════════════════════════════════════════════════════════════════════════════ */

/* ── headings ─────────────────────────────────────────────────────────────── */
.cb-title { font: var(--cb-head-weight) 22px/1.25 var(--cb-font-head); margin: 0 0 2px; letter-spacing: -.005em; }
.cb-title .cb-dot { color: var(--cb-accent); }          /* "Pulse." — the house signature */
.cb-sub { color: var(--cb-muted); font-size: 13px; margin-bottom: 20px; }
.cb-section {
  font: 600 13px/1.3 var(--cb-font-ui); text-transform: var(--cb-label-case);
  letter-spacing: var(--cb-label-track); color: var(--cb-muted); margin: 28px 0 10px;
}
/* the subtitle after a section label: was an inline <span style> ~25× in Pulse */
.cb-section small, .cb-label small { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: inherit; color: var(--cb-muted-2); }
.cb-section small::before, .cb-label small::before { content: "· "; }

/* ── card / panel ─────────────────────────────────────────────────────────── */
.cb-card {
  background: var(--cb-surface); border: var(--cb-border-w) solid var(--cb-border);
  border-radius: var(--cb-radius-card); padding: var(--cb-pad-card); margin-bottom: var(--cb-gap);
}
.cb-card.flush { padding: 0; overflow: hidden; }
.cb-card.accent { border-top: 2px solid var(--cb-card-accent, var(--cb-accent)); }
.cb-card.inset { background: var(--cb-sunken); }
.cb-label {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  color: var(--cb-muted); font-size: 12px; font-weight: 600;
  text-transform: var(--cb-label-case); letter-spacing: var(--cb-label-track); margin: 0 0 12px;
}
.cb-label .cb-actions { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; }
.cb-grid { display: grid; gap: var(--cb-gap); grid-template-columns: repeat(auto-fill, minmax(var(--cb-min, 280px), 1fr)); }
.cb-split { display: flex; gap: var(--cb-gap); flex-wrap: wrap; align-items: flex-start; }
.cb-split > * { flex: 1 1 var(--cb-min, 360px); min-width: 0; }

/* ── buttons ──────────────────────────────────────────────────────────────── */
.cb-btn {
  font: 600 13px/1.2 var(--cb-font-ui); border: var(--cb-border-w) solid transparent;
  border-radius: var(--cb-radius-ctl); padding: var(--cb-pad-ctl); cursor: pointer;
  background: var(--cb-surface-3); color: var(--cb-text);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background var(--cb-dur-fast), color var(--cb-dur-fast), border-color var(--cb-dur-fast), filter var(--cb-dur-fast);
  white-space: nowrap;
}
.cb-btn:hover { background: var(--cb-surface-3-hover); }
.cb-btn:active { filter: brightness(.9); }
.cb-btn:disabled { opacity: .45; cursor: default; filter: none; }
.cb-btn.primary { background: var(--cb-accent-fill); color: var(--cb-on-accent); }
.cb-btn.primary:hover { filter: brightness(1.12); }
.cb-btn.brand { background: var(--cb-brand, var(--cb-accent-fill)); color: #fff; }
.cb-btn.danger { background: var(--cb-bad-dim); color: #fff; }
/* ghost: the quiet bordered control (Pulse .cbtn ×3, Media .pref-x) */
.cb-btn.ghost { background: transparent; color: var(--cb-muted); border-color: var(--cb-border-2); }
.cb-btn.ghost:hover { color: var(--cb-text); border-color: var(--cb-muted); background: transparent; }
.cb-btn.ghost.danger:hover { color: #fff; background: var(--cb-bad-dim); border-color: var(--cb-bad-dim); }
.cb-btn.sm { font-size: 11px; padding: 2px 8px; border-radius: calc(var(--cb-radius-ctl) * .6); font-weight: 500; }
.cb-btn.lg { font-size: 15px; padding: 12px 20px; }
.cb-btn.icon { padding: 6px; min-width: 30px; }
.cb-btn.round { border-radius: var(--cb-radius-chip); }
.cb-btn.done { color: var(--cb-ok); }                    /* copy-feedback tick state */
/* a button that reads as inline text */
.cb-linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--cb-muted); cursor: pointer; text-decoration: underline dotted; }
.cb-linkbtn:hover { color: var(--cb-text-2); }

/* ── segmented control / tabs / pills / link-toggle ───────────────────────── */
.cb-seg { display: inline-flex; gap: 2px; padding: 2px; background: var(--cb-sunken); border: var(--cb-border-w) solid var(--cb-border); border-radius: var(--cb-radius-ctl); }
.cb-seg > button { font: 600 12px/1 var(--cb-font-ui); border: 0; background: transparent; color: var(--cb-muted); padding: 7px 11px; border-radius: calc(var(--cb-radius-ctl) - 2px); cursor: pointer; }
.cb-seg > button:hover { color: var(--cb-text); }
.cb-seg > button.on, .cb-seg > button[aria-pressed="true"] { background: var(--cb-seg-on, var(--cb-accent-fill)); color: var(--cb-on-accent); }

.cb-tabs { display: flex; align-items: center; gap: 4px; border-bottom: var(--cb-border-w) solid var(--cb-border); }
.cb-tab { background: transparent; color: var(--cb-muted); border: 0; border-bottom: 2px solid transparent; border-radius: var(--cb-radius-ctl) var(--cb-radius-ctl) 0 0; padding: 10px 18px; font: 600 14px var(--cb-font-ui); cursor: pointer; }
.cb-tab:hover { color: var(--cb-text); background: var(--cb-surface); }
.cb-tab.active, .cb-tab[aria-selected="true"] { color: var(--cb-text); border-bottom-color: var(--cb-tab-on, var(--cb-accent)); background: var(--cb-surface); }

.cb-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.cb-pill { background: var(--cb-surface-2); color: var(--cb-muted); border: var(--cb-border-w) solid var(--cb-border); border-radius: var(--cb-radius-chip); padding: 4px 12px; font-size: 12px; cursor: pointer; }
.cb-pill:hover { background: var(--cb-surface-3); color: var(--cb-text-2); }
.cb-pill.active { background: var(--cb-pill-on, var(--cb-accent-fill)); border-color: transparent; color: var(--cb-on-accent); }
.cb-pill b { font-weight: 600; opacity: .75; margin-left: 4px; }

/* "View: All · Work · Research" — links; the active item is a span */
.cb-toggles { font-size: 13px; color: var(--cb-muted); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.cb-toggles > .on { color: var(--cb-text); font-weight: 600; }

/* prev / next navigation (Pulse day + week nav were byte-identical twins) */
.cb-nav { display: flex; align-items: center; gap: 16px; font-size: 13px; margin-bottom: 4px; }
.cb-nav .spacer { flex: 1; }
.cb-nav .off { color: var(--cb-border-2); pointer-events: none; }

/* top-right corner bar: holds the jump, the theme picker, the palette hint. Children
   lose their own fixed positioning so they compose in a row. */
.cb-topbar {
  position: fixed; top: 8px; right: 10px; z-index: 50; display: flex; align-items: center; gap: 10px;
  /* backed, so it never overprints page text once the page scrolls under it */
  padding: 4px 6px 4px 10px; border-radius: var(--cb-radius-ctl);
  background: color-mix(in srgb, var(--cb-bg) 88%, transparent); backdrop-filter: blur(4px);
  border: var(--cb-border-w) solid var(--cb-border);
}
.cb-topbar > .cb-jump { position: static; }
/* fixed "⌖ Today" jump (on its own; inside .cb-topbar it flows) */
.cb-jump { position: fixed; top: 10px; right: 12px; z-index: 50; font-size: 12px; padding: 3px 11px; border: var(--cb-border-w) solid var(--cb-border-2); border-radius: var(--cb-radius-ctl); background: var(--cb-surface); color: var(--cb-text-2); opacity: .85; }
.cb-jump:hover { opacity: 1; color: var(--cb-text); text-decoration: none; border-color: var(--cb-muted); }

/* ── form controls ────────────────────────────────────────────────────────── */
.cb-input, .cb-select {
  background: var(--cb-bg); color: var(--cb-text); border: var(--cb-border-w) solid var(--cb-border);
  border-radius: var(--cb-radius-ctl); padding: 9px 12px; font: inherit; min-width: 0;
  transition: border-color var(--cb-dur-fast), box-shadow var(--cb-dur-fast);
}
.cb-input::placeholder { color: var(--cb-muted-2); }
.cb-input:focus, .cb-select:focus { outline: none; border-color: var(--cb-accent); box-shadow: 0 0 0 3px var(--cb-accent-soft); }
.cb-select.sm { padding: 1px 4px; font-size: 11px; background: transparent; color: var(--cb-muted); }
.cb-select option { background: var(--cb-surface); color: var(--cb-text); }
.cb-field { display: flex; gap: 8px; }
.cb-field > .cb-input { flex: 1; }
.cb-search { position: relative; display: flex; }
.cb-search > .cb-input { flex: 1; padding-left: 36px; }
.cb-search::before { content: "⌕"; position: absolute; left: 12px; top: 50%; transform: translateY(-52%); color: var(--cb-muted); font-size: 17px; pointer-events: none; }

/* switch: <label class="cb-switch"><input type="checkbox"><span></span> Label</label> */
.cb-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--cb-text-2); cursor: pointer; user-select: none; }
.cb-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.cb-switch > span { width: 32px; height: 18px; border-radius: 999px; background: var(--cb-surface-3); border: var(--cb-border-w) solid var(--cb-border-2); position: relative; flex: none; transition: background var(--cb-dur); }
.cb-switch > span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--cb-muted); transition: transform var(--cb-dur), background var(--cb-dur); }
.cb-switch input:checked + span { background: var(--cb-switch-on, var(--cb-accent-fill)); border-color: transparent; }
.cb-switch input:checked + span::after { transform: translateX(14px); background: #fff; }
.cb-switch input:focus-visible + span { outline: 2px solid var(--cb-focus); outline-offset: 2px; }

/* range slider (+ .cb-bubble, positioned by CB.sliderBubble) */
.cb-range { accent-color: var(--cb-range, var(--cb-accent)); cursor: pointer; }
.cb-bubble {
  position: absolute; bottom: calc(100% + 6px); transform: translateX(-50%); z-index: 5;
  background: var(--cb-bg); border: var(--cb-border-w) solid var(--cb-border-2); color: var(--cb-text);
  font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 6px; white-space: nowrap;
  pointer-events: none; font-variant-numeric: tabular-nums;
}
.cb-bubble::after { content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 5px solid transparent; border-top-color: var(--cb-border-2); }

/* ── badges · chips · tags ────────────────────────────────────────────────── */
/* One component in tones × shapes, replacing Pulse .cbadge/.pill2/.coff and
   Media .chip/.hchip/.badge/.subtag. */
.cb-badge {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; vertical-align: middle;
  font-size: 11px; font-weight: 600; line-height: 1.5; padding: 1px 8px; border-radius: var(--cb-radius-chip);
  background: var(--cb-surface-2); color: var(--cb-text-2);
}
.cb-badge.ok     { background: var(--cb-ok-soft);   color: var(--cb-ok); }
.cb-badge.warn   { background: var(--cb-warn-soft); color: var(--cb-warn); }
.cb-badge.bad    { background: var(--cb-bad-soft);  color: var(--cb-bad); }
.cb-badge.info   { background: var(--cb-info-soft); color: var(--cb-info); }
.cb-badge.accent { background: var(--cb-accent-fill); color: var(--cb-on-accent); }
.cb-badge.neutral{ background: var(--cb-surface-3); color: var(--cb-muted); }
/* identity-coloured: style="--c: <hex>" */
.cb-badge.id     { background: color-mix(in srgb, var(--c) 18%, transparent); color: color-mix(in srgb, var(--c) 70%, var(--cb-text)); }
.cb-badge.solid  { background: var(--c, var(--cb-accent-fill)); color: #fff; }
.cb-badge.outline{ background: transparent; border: var(--cb-border-w) solid currentColor; padding: 0 7px; }
.cb-badge.tag    { border-radius: 5px; text-transform: uppercase; letter-spacing: .06em; font-size: 10px; font-weight: 700; padding: 2px 7px; }
.cb-badge.lg     { font-size: 13px; padding: 3px 10px; }
.cb-badge svg    { width: 13px; height: 13px; flex: none; }
.cb-badge > .trunc { overflow: hidden; text-overflow: ellipsis; max-width: 24em; }
button.cb-badge  { border: 0; cursor: pointer; font-family: inherit; }
button.cb-badge:hover { filter: brightness(1.2); }

/* ── status: live dot · lamp · status strip · status bar · banner ─────────── */
.cb-live { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--cb-live, var(--cb-ok)); box-shadow: 0 0 8px var(--cb-live, var(--cb-ok)); flex: none; animation: cb-breathe 2s ease-in-out infinite; }
.cb-live.idle { background: var(--cb-muted-2); box-shadow: none; animation: none; }
@keyframes cb-breathe { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* the health lamp — one dot, severity straight off the system that knows */
.cb-lamp { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--cb-ok-dim); box-shadow: 0 0 5px var(--cb-ok-dim); }
.cb-lamp.ok   { background: var(--cb-ok);   box-shadow: 0 0 6px var(--cb-ok); }
.cb-lamp.busy { background: var(--cb-warn); box-shadow: 0 0 6px var(--cb-warn); animation: cb-breathe 1.4s ease-in-out infinite; }
.cb-lamp.bad  { background: var(--cb-bad);  box-shadow: 0 0 7px var(--cb-bad);  animation: cb-breathe 1.1s ease-in-out infinite; }
.cb-lamp.off  { background: var(--cb-muted-2); box-shadow: none; }

/* status strip: lamp + text + quiet repair action (Media .pipestatus) */
.cb-status { display: flex; align-items: center; gap: 8px; padding: 5px 10px; font-size: 12px; color: var(--cb-muted); border-left: 3px solid var(--cb-border-2); background: var(--cb-sunken); border-radius: 4px; }
.cb-status .text { flex: 1; min-width: 0; }
.cb-status.ok   { border-left-color: var(--cb-ok-dim); }
.cb-status.busy { color: var(--cb-warn); border-left-color: var(--cb-warn); }
.cb-status.bad  { color: var(--cb-bad); border-left-color: var(--cb-bad-dim); }
.cb-status .cb-btn { opacity: .65; }
.cb-status .cb-btn:hover, .cb-status.bad .cb-btn { opacity: 1; }

/* status bar: a row of lamps, each a subsystem */
.cb-statusbar { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 12px; color: var(--cb-muted); padding: 6px 12px; background: var(--cb-sunken); border: var(--cb-border-w) solid var(--cb-border); border-radius: var(--cb-radius-bar); }
.cb-statusbar > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.cb-statusbar b { color: var(--cb-text-2); font-weight: 600; }
.cb-statusbar .bad b { color: var(--cb-bad); }

/* banner: something needs attention at page level (Pulse smoke-test failure) */
.cb-banner { border: var(--cb-border-w) solid var(--cb-border-2); border-left-width: 3px; border-radius: var(--cb-radius-ctl); padding: 10px 14px; margin-bottom: var(--cb-gap); background: var(--cb-surface); }
.cb-banner.bad  { background: var(--cb-bad-soft);  border-color: var(--cb-bad-dim); }
.cb-banner.warn { background: var(--cb-warn-soft); border-color: var(--cb-warn-dim); }
.cb-banner.ok   { background: var(--cb-ok-soft);   border-color: var(--cb-ok-dim); }
.cb-banner .head { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.cb-banner.bad .head { color: var(--cb-bad); }
.cb-banner pre, .cb-banner .detail { font: 12px/1.45 var(--cb-font-mono); color: var(--cb-text-2); margin: 6px 0 0; white-space: pre-wrap; }

/* ── toast (CB.toast) ─────────────────────────────────────────────────────── */
.cb-toasts { position: fixed; right: 16px; bottom: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.cb-toast {
  background: var(--cb-surface); border: var(--cb-border-w) solid var(--cb-border-2); border-left: 3px solid var(--cb-accent);
  border-radius: var(--cb-radius-ctl); padding: 10px 14px; color: var(--cb-text); font-size: 13px; box-shadow: var(--cb-shadow-sm);
  opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s;
}
.cb-toast.show { opacity: 1; transform: none; }
.cb-toast.ok   { border-left-color: var(--cb-ok); }
.cb-toast.warn { border-left-color: var(--cb-warn); }
.cb-toast.bad  { border-left-color: var(--cb-bad); background: color-mix(in srgb, var(--cb-bad) 8%, var(--cb-surface)); }
.cb-toast .tt { font-weight: 600; display: block; margin-bottom: 2px; }
.cb-toast .ts { color: var(--cb-muted); font-size: 12px; word-break: break-word; }

/* ── tooltip (CB.tip) ─────────────────────────────────────────────────────── */
.cb-tip {
  position: fixed; z-index: 10000; pointer-events: none; max-width: 320px;
  background: var(--cb-bg); color: var(--cb-text); border: var(--cb-border-w) solid var(--cb-border-2);
  border-radius: 6px; padding: 5px 9px; font: 12px/1.4 var(--cb-font-ui); box-shadow: var(--cb-shadow-sm);
  opacity: 0; transition: opacity var(--cb-dur-fast); white-space: pre-line;
}
.cb-tip.show { opacity: 1; }
.cb-tip b { font-weight: 600; }

/* ── modal: <dialog class="cb-modal"> (native: Esc + focus handled for free) ── */
.cb-modal { background: var(--cb-surface); color: var(--cb-text); border: var(--cb-border-w) solid var(--cb-border-2); border-radius: var(--cb-radius-card); padding: 0; width: min(1100px, calc(100% - 32px)); max-height: 86vh; box-shadow: var(--cb-shadow); }
.cb-modal::backdrop { background: var(--cb-overlay); }
.cb-modal > header { display: flex; align-items: center; gap: 12px; padding: 14px var(--cb-pad-card); border-bottom: var(--cb-border-w) solid var(--cb-border); }
.cb-modal > header h3 { margin: 0; font: 700 17px var(--cb-font-head); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-modal > .body { padding: 12px var(--cb-pad-card) var(--cb-pad-card); overflow-y: auto; max-height: calc(86vh - 60px); }

/* ── table ────────────────────────────────────────────────────────────────── */
.cb-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cb-table th, .cb-table td { text-align: left; padding: 7px 10px; border-top: var(--cb-border-w) solid var(--cb-border); vertical-align: middle; }
.cb-table tr:first-child > * { border-top: 0; }
.cb-table th { color: var(--cb-muted); font-weight: 600; font-size: 11px; text-transform: var(--cb-label-case); letter-spacing: .04em; }
.cb-table .num { text-align: right; white-space: nowrap; }
.cb-table .time { white-space: nowrap; color: var(--cb-muted); width: 1%; font-variant-numeric: tabular-nums; }
.cb-table .tight { width: 1%; white-space: nowrap; }
.cb-table .actions { text-align: right; white-space: nowrap; width: 1%; }
.cb-table .actions > * + * { margin-left: 4px; }
.cb-table.hover tbody tr:hover { background: var(--cb-surface-2); }

/* ── list rows (Media .file-row, hand-built ×10) ──────────────────────────── */
.cb-list { display: flex; flex-direction: column; gap: 4px; }
.cb-list.boxed { border: var(--cb-border-w) solid var(--cb-border); border-radius: var(--cb-radius-ctl); padding: 6px; background: var(--cb-bg); overflow-y: auto; }
/* fill: N rows share the column height exactly — no dead space, no scrollbar */
.cb-list.fill { overflow: hidden; }
.cb-list.fill > .cb-row { flex: 1 1 0; min-height: 0; overflow: hidden; }
.cb-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; color: var(--cb-text);
  background: var(--cb-surface-3); padding: var(--cb-row-pad); border: 0; border-left: 3px solid transparent;
  border-radius: var(--cb-radius-ctl); font: 500 14px var(--cb-font-ui); cursor: pointer;
}
.cb-row:hover { border-left-color: var(--cb-row-c, var(--cb-accent)); background: color-mix(in srgb, var(--cb-row-c, var(--cb-accent)) 9%, var(--cb-surface-3)); }
.cb-row.marked { border-left-color: var(--cb-row-c, var(--cb-accent)); background: color-mix(in srgb, var(--cb-row-c, var(--cb-accent)) 12%, var(--cb-surface-3)); }
.cb-row > .icon { flex: none; width: 1.3em; text-align: center; }
.cb-row > .thumb { flex: none; width: 64px; height: 36px; object-fit: cover; border-radius: 4px; background: #000; }
.cb-row > .thumb.lg { width: 100px; height: 56px; border-radius: 6px; }
.cb-row > .main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cb-row .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-row .meta { font-size: 11px; color: var(--cb-muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 400; }
.cb-row > .side { flex: none; font-size: 11px; color: var(--cb-muted); }
.cb-row > .cb-btn { flex: none; }
/* a row that only displays (no click target): no pointer, no hover accent */
.cb-row.static { cursor: default; }
.cb-row.static:hover { border-left-color: transparent; background: var(--cb-surface-3); }
/* a link-row: date · summary · total (Pulse recent-days) */
.cb-linkrow { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: var(--cb-border-w) solid var(--cb-border); }
.cb-linkrow:first-child { border-top: 0; }
.cb-linkrow .mid { color: var(--cb-muted); font-size: 13px; flex: 1; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── bars: meter · ledger · progress · stacked ───────────────────────────── */
/* meter row: the bar is a background layer, so the row stays one line at any width.
   style="--v:.42; --c:#9146ff" */
.cb-meter { position: relative; display: flex; align-items: center; gap: 8px; padding: 3px 7px; border-radius: 3px; background: var(--cb-cell-empty); overflow: hidden; font-size: 12px; }
.cb-meter::before { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--v, 0) * 100%); background: color-mix(in srgb, var(--c, var(--cb-accent)) 30%, transparent); border-radius: inherit; }
.cb-meter > * { position: relative; }
.cb-meter > .name { flex: 1; min-width: 0; color: var(--cb-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-meter > .val { flex: none; color: var(--cb-muted); font-variant-numeric: tabular-nums; font-size: 11px; }

/* ledger: outer = total on a SHARED scale; inner = the honest core inside it.
   style="--outer:.62; --inner:.35; --c:#6ea8fe". Smaller rows visibly leave space. */
.cb-ledger { position: relative; height: 18px; border-radius: 4px; background: var(--cb-track); overflow: hidden; min-width: 80px; }
.cb-ledger > i, .cb-ledger::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; border-radius: 4px; }
.cb-ledger::before { width: calc(var(--outer, 0) * 100%); background: var(--c, var(--cb-accent)); opacity: .4; }
.cb-ledger > i { width: calc(var(--inner, 0) * 100%); background: var(--c, var(--cb-accent)); opacity: .95; }
.cb-ledger > span { position: absolute; left: 8px; top: 0; line-height: 18px; font-size: 11px; color: #fff; text-shadow: 0 1px 2px rgb(0 0 0 / .6); }

/* progress rail with optional partial segment: style="--v:.6; --p:.15" */
.cb-progress { display: flex; height: var(--h, 4px); border-radius: 3px; background: var(--cb-track); overflow: hidden; }
.cb-progress::before { content: ""; width: calc(var(--v, 0) * 100%); background: var(--c, var(--cb-ok)); }
.cb-progress::after { content: ""; width: calc(var(--p, 0) * 100%); background: var(--c2, var(--cb-warn)); opacity: .8; }

/* 100% stacked bar: <div class="cb-stack"><span style="--w:.4;--c:#..."></span>…</div> */
.cb-stack { display: flex; height: 22px; border-radius: 5px; overflow: hidden; background: var(--cb-track); }
.cb-stack > span { flex: 0 0 calc(var(--w, 0) * 100%); background: var(--c); }
.cb-stack > span:hover { filter: brightness(1.2); }

/* ── legend ───────────────────────────────────────────────────────────────── */
.cb-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; margin-top: 10px; align-items: center; }
.cb-legend .head { color: var(--cb-muted-2); font-size: 12px; }
.cb-key { display: inline-flex; align-items: center; gap: 6px; color: var(--cb-text-2); }
.cb-key b { color: var(--cb-muted); font-weight: 500; }
.cb-swatch { display: inline-block; width: 11px; height: 11px; border-radius: 3px; background: var(--c); flex: none; vertical-align: -1px; }
.cb-swatch.dot { border-radius: 50%; }
.cb-swatch.line { height: 3px; border-radius: 2px; width: 14px; }

/* ── stat tile ───────────────────────────────────────────────────────────── */
.cb-stats { display: grid; gap: var(--cb-gap); grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.cb-stat { background: var(--cb-surface); border: var(--cb-border-w) solid var(--cb-border); border-radius: var(--cb-radius-card); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cb-stat .k { font-size: 11px; font-weight: 600; color: var(--cb-muted); text-transform: var(--cb-label-case); letter-spacing: var(--cb-label-track); }
.cb-stat .v { font: var(--cb-head-weight) 26px/1.15 var(--cb-font-head); font-variant-numeric: tabular-nums; color: var(--cb-text); }
.cb-stat .v small { font-size: 14px; font-weight: 500; color: var(--cb-muted); margin-left: 2px; }
.cb-stat .d { font-size: 12px; color: var(--cb-muted); font-variant-numeric: tabular-nums; }
.cb-stat .d.up::before   { content: "▲ "; color: var(--cb-ok); }
.cb-stat .d.down::before { content: "▼ "; color: var(--cb-bad); }
.cb-stat .d.up.bad-up::before { color: var(--cb-bad); }        /* when more is worse */
.cb-stat .d.down.good-down::before { color: var(--cb-ok); }
/* neutral: the change is information, not a verdict (Pulse: fewer focused hours is not
   "bad" — attention is not work). Arrows stay, colour goes. */
.cb-stat .d.neutral::before { color: var(--cb-muted) !important; }
.cb-stat cb-sparkline { margin-top: 6px; }

/* ── streak ──────────────────────────────────────────────────────────────── */
.cb-streak { display: inline-flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; }
.cb-streak .n { font: 700 20px var(--cb-font-head); color: var(--cb-glow); }
.cb-streak .u { font-size: 12px; color: var(--cb-muted); }
.cb-streak .best { font-size: 11px; color: var(--cb-muted-2); }
.cb-streak.cold .n { color: var(--cb-muted); }

/* ── avatar · avatar stack ───────────────────────────────────────────────── */
.cb-avatar { width: var(--s, 28px); height: var(--s, 28px); border-radius: 50%; object-fit: cover; background: var(--c, var(--cb-surface-3)); flex: none; display: inline-grid; place-items: center; font-size: calc(var(--s, 28px) * .42); font-weight: 700; color: #fff; border: 2px solid var(--cb-surface); overflow: hidden; }
.cb-avatar.live { box-shadow: 0 0 0 2px var(--cb-bad); }
.cb-avatars { display: inline-flex; align-items: center; }
.cb-avatars > * + * { margin-left: calc(var(--s, 28px) * -.32); }
.cb-avatars > .more { background: var(--cb-surface-3); color: var(--cb-text-2); font-size: 11px; }

/* ── film strip (Up next) ─────────────────────────────────────────────────── */
.cb-film { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
.cb-frame { flex: 0 0 var(--w, 200px); scroll-snap-align: start; position: relative; border-radius: var(--cb-radius-ctl); overflow: hidden; background: var(--cb-surface-2); border: var(--cb-border-w) solid var(--cb-border); cursor: pointer; }
.cb-frame:hover { border-color: var(--cb-accent); }
.cb-frame > img, .cb-frame > .ph, .cb-frame > .media { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; background: #000; }
/* .media wraps the thumbnail so overlays (cb-dur, corner actions) anchor to the image,
   not to the whole frame-with-caption */
.cb-frame > .media { position: relative; overflow: hidden; }
.cb-frame > .media > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cb-frame .acts { position: absolute; top: 5px; right: 5px; display: flex; gap: 4px; }
.cb-frame > .ph { display: grid; place-items: center; color: var(--cb-muted); font-size: 22px; }
.cb-frame > .cap { padding: 6px 8px; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-frame > .n { position: absolute; top: 6px; left: 6px; background: rgb(0 0 0 / .78); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px; }
.cb-frame.now { border-color: var(--cb-accent); box-shadow: 0 0 0 1px var(--cb-accent); }
/* runtime badge over a thumbnail */
.cb-dur { position: absolute; right: 5px; bottom: 5px; background: rgb(0 0 0 / .82); color: #fff; font-size: 11px; font-weight: 600; padding: 1px 5px; border-radius: 4px; font-variant-numeric: tabular-nums; pointer-events: none; }
.cb-dur.live { background: var(--cb-bad-dim); letter-spacing: .04em; }

/* ── hype meter: chat-rate / activity level. style="--v:.7" ──────────────── */
.cb-hype { display: inline-flex; gap: 2px; align-items: flex-end; height: 16px; }
.cb-hype > i { width: 4px; border-radius: 1px; background: var(--cb-surface-3); }
.cb-hype > i.on { background: var(--cb-hype-c, var(--cb-warn)); }
.cb-hype > i.on.hot { background: var(--cb-bad); }

/* ── empty · skeleton · kbd · code ───────────────────────────────────────── */
.cb-empty { color: var(--cb-muted); font-size: 13px; padding: 14px 4px; text-align: center; }
.cb-empty.left { text-align: left; }
.cb-empty .big { display: block; font-size: 22px; opacity: .55; margin-bottom: 4px; }
.cb-skel { display: block; border-radius: 4px; background: linear-gradient(90deg, var(--cb-surface-2) 0%, var(--cb-surface-3) 50%, var(--cb-surface-2) 100%); background-size: 200% 100%; animation: cb-shimmer 1.3s linear infinite; height: var(--h, 12px); margin: 6px 0; }
@keyframes cb-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.cb-kbd { font: 600 11px var(--cb-font-mono); padding: 1px 5px; border-radius: 4px; border: var(--cb-border-w) solid var(--cb-border-2); border-bottom-width: 2px; background: var(--cb-surface-2); color: var(--cb-text-2); }
.cb-code { font: 1.6rem var(--cb-font-mono); letter-spacing: .15em; background: var(--cb-bg); padding: 10px 14px; border-radius: var(--cb-radius-ctl); display: inline-block; margin: 8px 0; border: var(--cb-border-w) solid var(--cb-border); }
.cb-crumb { font-family: var(--cb-font-mono); font-size: 12px; color: var(--cb-muted); }

/* ── prose (markdown narrative) ──────────────────────────────────────────── */
.cb-prose { max-width: 90ch; }
.cb-prose h2 { color: var(--cb-text); text-transform: none; letter-spacing: 0; font: 600 16px var(--cb-font-head); margin: 18px 0 6px; }
.cb-prose h3 { font-size: 14px; margin: 14px 0 4px; }
.cb-prose p { margin: 6px 0; }
.cb-prose ul { margin: 6px 0 6px 18px; padding: 0; }
.cb-prose code { background: var(--cb-surface-2); padding: 1px 5px; border-radius: 4px; font: 13px var(--cb-font-mono); }

/* ── vital signs card (composition: badge + streak + spark + mini heatmap) ── */
.cb-vitals { display: grid; gap: 8px 16px; grid-template-columns: 1fr auto; align-items: center; }
.cb-vitals .who { display: flex; align-items: center; gap: 8px; font: 700 16px var(--cb-font-head); min-width: 0; }
.cb-vitals .who .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-vitals .nums { display: flex; gap: 14px; font-size: 12px; color: var(--cb-muted); flex-wrap: wrap; }
.cb-vitals .nums b { color: var(--cb-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.cb-vitals .full { grid-column: 1 / -1; }

/* ── command palette (CB.palette) ────────────────────────────────────────── */
.cb-palette { position: fixed; inset: 0; z-index: 10001; background: var(--cb-overlay); display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; }
.cb-palette[hidden] { display: none; }
.cb-palette .box { width: min(640px, calc(100% - 32px)); background: var(--cb-surface); border: var(--cb-border-w) solid var(--cb-border-2); border-radius: var(--cb-radius-card); box-shadow: var(--cb-shadow); overflow: hidden; }
.cb-palette input { width: 100%; border: 0; border-bottom: var(--cb-border-w) solid var(--cb-border); background: transparent; color: var(--cb-text); font: 16px var(--cb-font-ui); padding: 14px 16px; outline: none; }
.cb-palette ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.cb-palette li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--cb-radius-ctl); cursor: pointer; font-size: 14px; }
.cb-palette li .grp { margin-left: auto; font-size: 11px; color: var(--cb-muted-2); }
.cb-palette li.sel { background: var(--cb-accent-soft); }
.cb-palette li mark { background: none; color: var(--cb-accent); font-weight: 700; }
.cb-palette .foot { display: flex; gap: 14px; padding: 7px 14px; font-size: 11px; color: var(--cb-muted-2); border-top: var(--cb-border-w) solid var(--cb-border); }

/* ── theme picker (CB.theme.picker) ─────────────────────────────────────── */
.cb-themes { display: inline-flex; gap: 6px; }
.cb-themes button { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--cb-border-2); cursor: pointer; padding: 0; }
.cb-themes button.on { border-color: var(--cb-text); }

/* ── popover (CB.popover / data-popover="id") ──────────────────────────────────
   Native [popover] lives in the top layer and the UA centres it (inset:0; margin:auto);
   we place it beside its opener instead, so reset both. */
.cb-popover {
  position: fixed; inset: auto; margin: 0; z-index: 10002;
  background: var(--cb-surface); color: var(--cb-text); border: var(--cb-border-w) solid var(--cb-border-2);
  border-radius: var(--cb-radius-card); box-shadow: var(--cb-shadow-sm); padding: 10px 12px;
  max-width: min(360px, calc(100vw - 16px)); max-height: 70vh; overflow: auto; font-size: 13px;
}
.cb-popover:not([popover]):not(.open) { display: none; }   /* the no-Popover-API fallback */
.cb-popover > .head { font-size: 11px; font-weight: 600; color: var(--cb-muted); text-transform: var(--cb-label-case); letter-spacing: .05em; margin-bottom: 6px; }
.cb-popover dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; }
.cb-popover dt { color: var(--cb-muted); }
.cb-popover dd { margin: 0; font-variant-numeric: tabular-nums; }
/* a menu inside a popover: full-width rows, ↑/↓ move between them */
.cb-menu { display: flex; flex-direction: column; margin: -4px -6px; }
.cb-menu > button, .cb-menu > a {
  all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--cb-radius-ctl);
  color: var(--cb-text-2); cursor: pointer; font-size: 13px;
}
.cb-menu > button:hover, .cb-menu > a:hover, .cb-menu > :focus-visible { background: var(--cb-surface-2); color: var(--cb-text); }
.cb-menu > .danger { color: var(--cb-bad); }
.cb-menu > hr { border: 0; border-top: var(--cb-border-w) solid var(--cb-border); margin: 4px 0; }
.cb-menu .hint { margin-left: auto; color: var(--cb-muted-2); font-size: 11px; }

/* ── disclosure: <details class="cb-disclosure"> (CB.render.disclosure) ────── */
.cb-disclosure > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 6px 0;
  font-size: 13px; color: var(--cb-text-2); user-select: none;
}
.cb-disclosure > summary::-webkit-details-marker { display: none; }
.cb-disclosure > summary::before {
  content: ""; flex: none; border: 4px solid transparent; border-left: 6px solid var(--cb-muted);
  margin-right: -2px; transform-origin: 3px 4px; transition: transform var(--cb-dur-fast);
}
.cb-disclosure[open] > summary::before { transform: rotate(90deg); }
.cb-disclosure > summary:hover { color: var(--cb-text); }
.cb-disclosure > summary:focus-visible { outline: 2px solid var(--cb-focus); outline-offset: 2px; border-radius: var(--cb-radius-ctl); }
.cb-disclosure > summary .count { font-size: 11px; padding: 0 6px; border-radius: var(--cb-radius-chip); background: var(--cb-surface-2); color: var(--cb-muted); font-variant-numeric: tabular-nums; }
.cb-disclosure > summary .note { color: var(--cb-muted-2); font-size: 12px; }
.cb-disclosure > .body { padding: 4px 0 2px; }

/* ── src/css/provenance.css ── */
/* ════════════════════════════════════════════════════════════════════════════
   provenance — how sure is this mark? (SURVEY.md §5)

   Pulse's founding rule is attention ≠ work: it drafts, it never decides. So the
   UI must be able to say HOW it knows each thing, and say it the same way in
   every component. One grammar, seven states:

     observed      measured directly            solid fill            (default)
     inferred      interpreted / drafted        hatched fill
     planned       intended, not done           dashed outline, no fill
     extrapolated  projected beyond the data    ghost (≈35% opacity)
     confirmed     a human checked it           solid + corner tick
     corrected     a human changed it           solid + ✎ mark
     contradicted  planned; evidence says no    red dashed outline
     optimistic    sent, not yet acknowledged   solid + slow shimmer
     changed       moved since you last looked  amber glow, fading

   HTML: add .cb-p-<state> to any filled element (it reads --c for its colour).
   SVG:  CB.prov.attrs(state, colour) returns the attributes; the hatch pattern
         lives in one shared <defs> injected by CB on load.
   ════════════════════════════════════════════════════════════════════════════ */

.cb-p-observed { background-color: var(--c, var(--cb-accent)); }
.cb-p-inferred {
  background-color: var(--c, var(--cb-accent));
  background-image: repeating-linear-gradient(135deg, transparent 0 3px, var(--cb-hatch) 3px 5.5px);
}
.cb-p-planned {
  background: transparent !important;
  outline: 1.5px dashed color-mix(in srgb, var(--c, var(--cb-muted)) 85%, var(--cb-text));
  outline-offset: -1.5px;
}
.cb-p-contradicted {
  background: var(--cb-bad-soft) !important;
  outline: 1.5px dashed var(--cb-bad); outline-offset: -1.5px;
}
.cb-p-extrapolated { background-color: var(--c, var(--cb-accent)); opacity: var(--cb-ghost-opacity); }
.cb-p-confirmed { background-color: var(--c, var(--cb-accent)); position: relative; }
.cb-p-confirmed::after {
  content: ""; position: absolute; top: 0; right: 0; width: 0; height: 0;
  border-top: 7px solid var(--cb-ok); border-left: 7px solid transparent;
}
.cb-p-corrected { background-color: var(--c, var(--cb-accent)); position: relative; }
.cb-p-corrected::after { content: "✎"; position: absolute; top: -1px; right: 2px; font-size: 10px; color: #fff; text-shadow: 0 0 2px #000; }
.cb-p-optimistic {
  background-color: var(--c, var(--cb-accent));
  background-image: linear-gradient(100deg, transparent 30%, rgb(255 255 255 / .22) 50%, transparent 70%);
  background-size: 250% 100%; animation: cb-optimistic 1.6s linear infinite;
}
@keyframes cb-optimistic { from { background-position: 120% 0; } to { background-position: -120% 0; } }

/* change-glow: CB.flash(el) / CB.liveSwap() add it; it removes itself */
.cb-flash { animation: cb-flash var(--cb-dur-flash) ease-out; }
@keyframes cb-flash {
  0%   { background-color: color-mix(in srgb, var(--cb-glow) 55%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cb-glow) 25%, transparent); }
  100% { background-color: transparent; box-shadow: 0 0 0 3px transparent; }
}
.cb-flash-text { animation: cb-flash-text 1.2s ease-out; }
@keyframes cb-flash-text { 0% { color: var(--cb-glow); } }

/* the legend chip for a provenance state */
.cb-prov-key { display: inline-block; width: 18px; height: 11px; border-radius: 2px; vertical-align: -1px; --c: var(--cb-muted); }

/* SVG: shimmer for optimistic marks; dashed planned marks get vector-effect so the
   dash survives viewBox scaling */
.cb-svg-optimistic { animation: cb-breathe 1.4s ease-in-out infinite; }
.cb-svg-planned { vector-effect: non-scaling-stroke; }
@media (prefers-reduced-motion: reduce) {
  .cb-p-optimistic, .cb-svg-optimistic, .cb-flash, .cb-live, .cb-lamp, .cb-skel { animation: none !important; }
}

/* ── src/css/charts.css ── */
/* ════════════════════════════════════════════════════════════════════════════
   charts — shared styling for the cb-* chart elements. The renderers emit SVG
   that reads every colour through CSS (style="fill:var(...)" or a class here),
   so a theme swap repaints a chart without re-rendering it.
   ════════════════════════════════════════════════════════════════════════════ */
cb-year-heatmap, cb-rhythm-grid, cb-day-timeline, cb-week-strip, cb-quarter-strip,
cb-stacked-bars, cb-sparkline, cb-day-ring, cb-ridgeline, cb-week-grid, cb-lifelines,
cb-switch-stripe, cb-dial { display: block; min-width: 0; }
cb-sparkline { display: inline-block; vertical-align: middle; }
cb-time-ago { font-variant-numeric: tabular-nums; }

.cb-svg { display: block; overflow: visible; font-family: var(--cb-font-ui); }
.cb-svg text { fill: var(--cb-axis); font-size: 10px; }
.cb-svg text.strong { fill: var(--cb-text); font-weight: 600; }
.cb-svg text.big { fill: var(--cb-text); font: var(--cb-head-weight) 20px var(--cb-font-head); }
.cb-svg .grid { stroke: var(--cb-grid); stroke-width: 1; }
.cb-svg .empty { fill: var(--cb-cell-empty); }
.cb-svg .track { fill: var(--cb-track); }
.cb-svg .seam { stroke: var(--cb-seam); stroke-dasharray: 2 2; opacity: .7; }
.cb-svg .now { stroke: var(--cb-now); stroke-width: 2; filter: drop-shadow(0 0 3px var(--cb-now)); }
.cb-svg .band { fill: var(--cb-muted); opacity: .13; }
.cb-svg .pin { fill: var(--cb-gold); }
.cb-svg .pinline { stroke: var(--cb-gold); stroke-dasharray: 1 2; opacity: .8; }
.cb-svg .outline { fill: none; stroke: var(--cb-text); stroke-width: 1.5; }
.cb-svg [data-tip] { cursor: crosshair; }
.cb-svg [data-tip]:hover { filter: brightness(1.25); }

/* readout line under a chart that mirrors the hovered mark (Pulse #dvro) */
.cb-readout { font-size: 12px; color: var(--cb-muted); min-height: 1.5em; margin-top: 6px; white-space: pre-line; }

/* heatmap legend (Less ▢▢▢▢ More) */
.cb-heatlegend { display: flex; gap: 4px; align-items: center; justify-content: flex-end; font-size: 10px; color: var(--cb-muted); margin-top: 4px; }
.cb-heatlegend i { width: 9px; height: 9px; border-radius: var(--cb-radius-cell); display: inline-block; }

/* lane labels for the day timeline */
.cb-lanes-axis { display: flex; justify-content: space-between; font-size: 10px; color: var(--cb-muted-2); font-variant-numeric: tabular-nums; margin-top: 3px; }

/* the dial (sleep timer) — an input */
cb-dial { width: var(--size, 140px); user-select: none; touch-action: none; }
cb-dial .knob { fill: var(--cb-text); }
cb-dial .arc { fill: none; stroke: var(--cb-dial-c, var(--cb-accent)); stroke-linecap: round; }
cb-dial .ring { fill: none; stroke: var(--cb-track); }
cb-dial:focus-visible { outline: 2px solid var(--cb-focus); outline-offset: 4px; border-radius: 50%; }

/* heat cells take their corner radius from the theme (CSS rx: SVG2 geometry property) */
.cb-svg .cell { rx: var(--cb-radius-cell); }
.cb-svg .bar  { rx: 1px; }

/* ── rhythm grid (CSS grid so day columns stretch to the card) ─────────────── */
.cb-rhythm { display: grid; grid-template-columns: 3em repeat(7, 1fr); gap: 2px; width: 100%; align-items: center; }
.cb-rhythm .d { font-size: 10px; color: var(--cb-muted); text-align: center; padding-bottom: 2px; }
.cb-rhythm .h { font-size: 9px; color: var(--cb-muted); text-align: right; padding-right: 5px; line-height: 1; font-variant-numeric: tabular-nums; }
.cb-rhythm .c { height: var(--ch, 14px); border-radius: var(--cb-radius-cell); }

/* ── day timeline: lanes ──────────────────────────────────────────────────── */
.cb-tl { display: grid; grid-template-columns: 1fr; gap: 0 10px; }
.cb-tl.labelled { grid-template-columns: var(--lw, 84px) 1fr; }
.cb-tl-labels { display: flex; flex-direction: column; gap: 4px; }
.cb-tl-labels > div { display: flex; align-items: center; justify-content: flex-end; font-size: 12px; color: var(--cb-muted); text-align: right; line-height: 1.1; }
.cb-tl-body { min-width: 0; }
.cb-tl-lanes { position: relative; display: flex; flex-direction: column; gap: 4px; }
.cb-lane {
  position: relative; width: 100%; overflow: hidden; border-radius: 6px;
  background-color: var(--cb-sunken); border: var(--cb-border-w) solid var(--cb-border);
  /* a faint gridline every 3h; --gl = 3h as a share of the lane's span */
  background-image: repeating-linear-gradient(90deg, transparent 0 calc(var(--gl, 12.5%) - 1px), var(--cb-grid) calc(var(--gl, 12.5%) - 1px) var(--gl, 12.5%));
}
.cb-lane.mini { border-radius: 3px; flex: 1; min-width: 0; }
.cb-lane.thin { border-radius: 3px; }
.cb-lane.columns { background-color: transparent; border-color: transparent; }
.cb-tl-seg { position: absolute; min-width: 1px; background-color: var(--c); }
.cb-lane.events .cb-tl-seg { border-radius: 4px; }
.cb-tl-seg:hover { filter: brightness(1.25); z-index: 1; }
.cb-tl-seg > .lbl {
  position: absolute; inset: 0; padding: 3px 6px 0; font-size: 10.5px; font-weight: 600; color: var(--ink, #fff);
  text-shadow: 0 1px 2px var(--ink-shadow, rgb(0 0 0 / .65)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
.cb-lane.events .cb-tl-seg > .lbl { padding-top: 1px; line-height: 14px; }
.cb-tl-seg.cb-p-planned > .lbl { color: var(--cb-text-2); text-shadow: none; }
.cb-tl-col { position: absolute; top: 0; bottom: 0; display: flex; flex-direction: column-reverse; padding: 0 .5px; }
.cb-tl-col > i { display: block; background-color: var(--c); min-height: 0; }
.cb-tl-now { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--cb-now); box-shadow: 0 0 6px var(--cb-now); z-index: 2; }
.cb-tl-pin { position: absolute; top: -6px; bottom: -2px; width: 0; border-left: 1px dashed var(--cb-gold); z-index: 2; }
.cb-tl-pin::before { content: ""; position: absolute; top: 0; left: -5px; border: 5px solid transparent; border-top: 7px solid var(--cb-gold); }
.cb-tl-axis { position: relative; height: 14px; margin-top: 3px; font-size: 10px; color: var(--cb-muted-2); font-variant-numeric: tabular-nums; }
.cb-tl-axis > span { position: absolute; transform: translateX(-50%); }
.cb-tl-axis > span:first-child { transform: none; }
.cb-tl-axis > span:last-child { transform: translateX(-100%); }

/* ── week strip ───────────────────────────────────────────────────────────── */
.cb-weekstrip { display: flex; flex-direction: column; gap: 6px; }
.cb-ws-row { display: grid; grid-template-columns: var(--lw, 84px) 1fr var(--tw, 66px); gap: 12px; align-items: center; }
.cb-ws-label { font-size: 13px; color: var(--cb-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-ws-days { display: flex; gap: 2px; min-width: 0; }
.cb-ws-total { text-align: right; font-size: 12px; color: var(--cb-muted); font-variant-numeric: tabular-nums; }

/* ── quarter-hour strip ───────────────────────────────────────────────────── */
.cb-qstrip { display: grid; gap: 1px; height: var(--qh, 18px); }
.cb-qstrip > i { display: block; background-color: var(--c); border-radius: 1px; }
.cb-qstrip > i.e { background: var(--cb-cell-empty); }
.cb-qstrip > i.e.tick { background: color-mix(in srgb, var(--cb-cell-empty) 70%, var(--cb-muted-2)); }

/* ── week grid: plan vs actual ────────────────────────────────────────────── */
.cb-weekgrid { display: grid; grid-template-columns: 3.4em repeat(var(--n, 7), 1fr); gap: 0 4px; }
.cb-wg-head { font-size: 12px; font-weight: 600; color: var(--cb-muted); text-align: center; padding: 4px 0 6px; }
.cb-wg-head.today { color: var(--cb-accent); }
.cb-wg-times { position: relative; }
.cb-wg-times > span { position: absolute; right: 6px; transform: translateY(-50%); font-size: 9px; color: var(--cb-muted-2); font-variant-numeric: tabular-nums; }
.cb-wg-times > span:first-child { transform: none; }
.cb-wg-col {
  position: relative; border-radius: 6px; background-color: var(--cb-sunken);
  background-image: repeating-linear-gradient(180deg, var(--cb-grid) 0 1px, transparent 1px var(--hh, 34px));
}
.cb-wg-col.today { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cb-accent) 45%, transparent); }
/* the plan sits ABOVE the actual blocks (its dashed frame and label stay readable where work
   landed inside it) but lets the pointer through, except on its label, so both keep tooltips */
.cb-wg-plan { position: absolute; left: 2px; right: 2px; border: 1.5px dashed var(--c, var(--cb-muted)); border-radius: 5px; overflow: hidden; z-index: 1; pointer-events: none; }
.cb-wg-plan > span { pointer-events: auto; text-shadow: 0 0 3px var(--cb-sunken), 0 0 2px var(--cb-sunken); }
.cb-wg-plan.confirmed { --c: var(--cb-ok); background: color-mix(in srgb, var(--cb-ok) 6%, transparent); }
.cb-wg-plan.contradicted { --c: var(--cb-bad); background: color-mix(in srgb, var(--cb-bad) 6%, transparent); }
.cb-wg-plan > span { position: relative; display: inline-block; max-width: 100%; font-size: 10px; line-height: 1.2; padding: 2px 4px; color: var(--cb-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-wg-act { position: absolute; left: 32%; right: 4px; border-radius: 3px; background-color: var(--c); opacity: .9; }
.cb-wg-act:hover { opacity: 1; filter: brightness(1.15); }
.cb-wg-now { position: absolute; left: -2px; right: -2px; height: 2px; background: var(--cb-now); box-shadow: 0 0 6px var(--cb-now); z-index: 2; }

/* ── lifelines ───────────────────────────────────────────────────────────── */
.cb-lifelines { display: grid; grid-template-columns: var(--lw, 170px) 1fr 5.5em; gap: 4px 12px; align-items: center; }
.cb-ll-months { position: relative; height: 14px; font-size: 10px; color: var(--cb-muted-2); }
.cb-ll-months > span { position: absolute; }
.cb-ll-label { font-size: 13px; color: var(--cb-text-2); display: flex; align-items: center; gap: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cb-ll-track { display: grid; grid-template-columns: repeat(var(--n, 52), 1fr); gap: 1px; height: 14px; background: linear-gradient(var(--cb-track), var(--cb-track)) center / 100% 2px no-repeat; }
.cb-ll-track > i { display: block; border-radius: 2px; }
.cb-ll-last { font-size: 11px; color: var(--cb-muted); text-align: right; white-space: nowrap; }

/* ── v0.3.0: pins carry a tone (--pc), several per spot, and may link ──────────
   A pin is declared context (a log entry, an incident), never a measurement, so it
   is drawn as a marker beside the data and never changes the data's own marks. */
.cb-svg .pin.multi { stroke: var(--cb-surface); stroke-width: 1.2px; }
.cb-svg a .pin, .cb-svg a .cell, .cb-svg a .dot { cursor: pointer; }
.cb-tl-pin { border-left-color: var(--pc, var(--cb-gold)); }
.cb-tl-pin::before { border-top-color: var(--pc, var(--cb-gold)); }
.cb-tl-pin.multi::before { border-width: 6px; border-top-width: 8px; left: -6px; }
/* a pin INSIDE a lane box (lanes clip their overflow): full-height rule + a notch at the top */
.cb-pin-mark { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1.5px solid var(--pc, var(--cb-gold)); z-index: 2; }
.cb-pin-mark::before { content: ""; position: absolute; top: 0; left: -4.5px; border: 4px solid transparent; border-top: 5px solid var(--pc, var(--cb-gold)); }
.cb-pin-mark.multi { border-left-width: 2.5px; }
a.cb-tl-pin, a.cb-pin-mark, a.cb-tl-seg { cursor: pointer; text-decoration: none; }
a.cb-tl-seg:hover { filter: brightness(1.35); }

/* the window that matters (8–18), shaded behind a lane's marks */
.cb-tl-band { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--cb-text) 6%, transparent);
  box-shadow: inset 1px 0 0 color-mix(in srgb, var(--cb-muted) 35%, transparent), inset -1px 0 0 color-mix(in srgb, var(--cb-muted) 35%, transparent); pointer-events: none; }

/* week strip rows with several stacked lanes (a thin plan above the actuals) */
.cb-ws-lanes { position: relative; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cb-lane.ws { border-radius: 3px; }

/* ── keyboard access: a chart is one tab stop; arrows step through its marks ── */
.cb-kb:focus { outline: none; }
.cb-kb:focus-visible { outline: 2px solid var(--cb-focus); outline-offset: 4px; border-radius: var(--cb-radius-ctl); }
.cb-kfocus { outline: 2px solid var(--cb-text); outline-offset: 1px; z-index: 3; position: relative; }
.cb-tl-seg.cb-kfocus, .cb-tl-pin.cb-kfocus, .cb-pin-mark.cb-kfocus { position: absolute; }
.cb-svg .cb-kfocus { outline: none; stroke: var(--cb-text); stroke-width: 2px; paint-order: stroke; }
/* text only a screen reader hears (the stepped mark's tip) */
.cb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* v0.3.1: a legend key for pins ({label, pin:true, tone} in CB.render.legend) */
.cb-pin-key { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--pc, var(--cb-gold)); margin-right: 6px; vertical-align: 0; }

/* ── src/css/sim.css ── */
/* ════════════════════════════════════════════════════════════════════════════
   sim — the live-view layer for agent-based sims (DEVPLAN Stage S1).
   The page rules come from Chris's critique of EvoEco (2026-11-03):
     · the world and the graphs get the screen; controls sit UNDER the world,
       never in a column on the left
     · reports are lines, not numbers; time is a dial; legends are marks + names
   The charts paint canvases (sim.js), so only their frames, heads and keys are
   styled here; the colours inside a canvas are resolved from these same tokens.
   ════════════════════════════════════════════════════════════════════════════ */

/* ── page layout: <div class="cb-sim"> stage | charts </div> ───────────────── */
.cb-sim {
  display: grid; gap: var(--cb-gap); align-items: start;
  grid-template-columns: minmax(0, max-content) minmax(320px, 1fr);
  padding: var(--cb-gap);
}
/* a world wider than half the window: charts drop under it instead of squeezing */
@media (max-width: 1100px) { .cb-sim { grid-template-columns: minmax(0, 1fr); } }

.cb-sim-stage { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
/* The world sets the stage's width. The bar and the control strip wrap to fit under
   it: without this, their unwrapped width widens the column and squeezes the charts. */
.cb-sim-bar, .cb-sim-controls { contain: inline-size; }
.cb-sim-world { position: relative; line-height: 0; }
.cb-sim-world canvas {
  display: block; max-width: 100%; height: auto;
  border-radius: var(--cb-radius-card); background: var(--cb-sunken);
}
/* the row right under the world: the clock, then the key to what's drawn */
.cb-sim-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cb-sim-bar .cb-legend { margin-top: 0; }

/* ── control strip (CB.sim.controls) ──────────────────────────────────────── */
.cb-sim-controls {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 18px;
  padding: 10px 12px; background: var(--cb-surface);
  border: var(--cb-border-w) solid var(--cb-border); border-radius: var(--cb-radius-card);
}
.cb-sim-ctl { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--cb-muted); min-width: 120px; }
.cb-sim-ctl .k { display: flex; justify-content: space-between; gap: 8px; }
/* a parameter's value is a setting, not a report: shown, but quiet and steady */
.cb-sim-ctl output { color: var(--cb-text-2); font-variant-numeric: tabular-nums; }
.cb-sim-ctl .cb-range { width: 100%; }
.cb-sim-ctl.switch { min-width: 0; justify-content: flex-end; padding-bottom: 2px; }
.cb-sim-controls .btns { display: flex; gap: 8px; margin-left: auto; }

/* ── chart grid and the chart frames ──────────────────────────────────────── */
.cb-sim-charts { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); min-width: 0; }
/* a group of charts that read together (gene × population) */
.cb-sim-charts > .cb-sim-group { grid-column: 1 / -1; display: grid; gap: 10px; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); }
.cb-sim-charts > .cb-sim-group > .cb-label { grid-column: 1 / -1; margin: 4px 0 -4px; }
.cb-sim-charts .wide { grid-column: 1 / -1; }

cb-sim-series, cb-sim-histmap {
  display: block; min-width: 0;
  background: var(--cb-surface); border: var(--cb-border-w) solid var(--cb-border);
  border-radius: var(--cb-radius-card); padding: 8px 10px 6px;
}
cb-sim-series[flush], cb-sim-histmap[flush] { background: none; border: 0; padding: 0; }
cb-sim-clock { display: inline-block; line-height: 0; }

.cb-sim-head { display: flex; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; margin-bottom: 4px; line-height: 1.3; }
.cb-sim-title { font-size: 12px; font-weight: 600; color: var(--cb-text-2); }
.cb-sim-head .cb-legend { margin: 0; gap: 2px 10px; font-size: 11px; }
.cb-sim-canvas { display: block; width: 100%; cursor: crosshair; }

/* legend marks: drawn like the world draws them (CB.render.simLegend) */
.cb-mark { flex: none; overflow: visible; }
/* filled marks get a hairline edge: a world's white dot must still show on Paper */
.cb-mark .f { stroke: var(--cb-border-2); stroke-width: .75; }
