/* Bob Labs · tensorcash chat — the one stylesheet of every page (the two
   showcase demo pages excepted: they ship their own).
   1. tokens   — from the "Bob Labs" design system (tokens.json). Dark first;
                 light follows the system setting, and the header switch
                 (data-theme on <html>, saved as localStorage "tc-theme")
                 overrides both ways.
   2. fonts    — Inter and JetBrains Mono, self-hosted (static/fonts, OFL):
                 no third-party request.
   3. components (bl-*) — the design system's components/bundle.css, as is.
   4. app      — the shell, then one section per page family. */

/* ── 1. tokens ───────────────────────────────────────────────────────── */
:root {
  color-scheme: dark;
  --bg: #07090d;
  --surface: #0b0f15;
  --raised: #11161e;
  --hover: #171d27;
  --user: #0f1d22;
  --line: #1b222c;
  --edge: #5c6678;
  --fg: #e7ecf3;
  --muted: #8590a3;
  --faint: #4f5868;
  --accent: #5eead4;
  --accent-hover: #99f6e4;
  --accent-2: #60a5fa;
  --on-accent: #06121a;
  --accent-soft: #5eead41f;
  --ok: #4ade80;
  --ok-soft: #4ade801f;
  --warn: #fbbf24;
  --warn-soft: #fbbf241f;
  --danger: #f87171;
  --danger-soft: #f871711f;
  --scrim: #000000b3;
  --veil: #07090dd9;
  --grid: #94a3b80b;
  --grid-strong: #94a3b814;
  --shadow-pop: 0 16px 40px -12px #000000e6, 0 0 0 1px #1b222c;
  --focus-ring: 0 0 0 2px #07090d, 0 0 0 4px #5eead4;
  /* the terminal player and live terminal stay dark in both themes */
  --term-bg: #0b0f15;
  --term-fg: #d7dde6;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;
  --font-sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f4f6f8;
    --surface: #fafbfc;
    --raised: #ffffff;
    --hover: #eaeef2;
    --user: #e2f1ee;
    --line: #dde3ea;
    --edge: #7b8696;
    --fg: #0b1220;
    --muted: #556072;
    --faint: #98a2b0;
    --accent: #0f766e;
    --accent-hover: #115e59;
    --accent-2: #2563eb;
    --on-accent: #ffffff;
    --accent-soft: #0f766e1a;
    --ok: #11743a;
    --ok-soft: #11743a1a;
    --warn: #a14a06;
    --warn-soft: #a14a061a;
    --danger: #b91c1c;
    --danger-soft: #b91c1c14;
    --scrim: #0b122059;
    --veil: #f4f6f8d9;
    --grid: #0b12200a;
    --grid-strong: #0b122012;
    --shadow-pop: 0 12px 32px -10px #0b122040, 0 0 0 1px #dde3ea;
    --focus-ring: 0 0 0 2px #f4f6f8, 0 0 0 4px #0f766e;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #fafbfc;
  --raised: #ffffff;
  --hover: #eaeef2;
  --user: #e2f1ee;
  --line: #dde3ea;
  --edge: #7b8696;
  --fg: #0b1220;
  --muted: #556072;
  --faint: #98a2b0;
  --accent: #0f766e;
  --accent-hover: #115e59;
  --accent-2: #2563eb;
  --on-accent: #ffffff;
  --accent-soft: #0f766e1a;
  --ok: #11743a;
  --ok-soft: #11743a1a;
  --warn: #a14a06;
  --warn-soft: #a14a061a;
  --danger: #b91c1c;
  --danger-soft: #b91c1c14;
  --scrim: #0b122059;
  --veil: #f4f6f8d9;
  --grid: #0b12200a;
  --grid-strong: #0b122012;
  --shadow-pop: 0 12px 32px -10px #0b122040, 0 0 0 1px #dde3ea;
  --focus-ring: 0 0 0 2px #f4f6f8, 0 0 0 4px #0f766e;
}

/* ── 2. fonts (latin + latin-ext, as boblabs.eu) ─────────────────────── */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url("fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 500; font-display: swap;
  src: url("fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 500; font-display: swap;
  src: url("fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ── 3. components ───────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 15px/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: inherit; }
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }

/* ── type helpers ─────────────────────────────────────────────────────── */
.bl-label { font: 500 11px/16px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.bl-tag { font: 400 13px/20px var(--font-mono); letter-spacing: .01em; color: var(--muted); }
.bl-muted { color: var(--muted); }
.bl-mono { font-family: var(--font-mono); }
.bl-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bl-icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.bl-icon-sm { width: 14px; height: 14px; }

/* ── brand ────────────────────────────────────────────────────────────── */
.bl-lockup { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none;
  font: 600 16px/1 var(--font-sans); letter-spacing: .01em; white-space: nowrap; }
.bl-lockup svg { display: block; width: 26px; height: 26px; flex: none; }
.bl-lockup .labs { background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.bl-lockup .app { margin-left: 2px; padding-left: 10px; border-left: 1px solid var(--line);
  font: 500 11px/16px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* the TensorCash pill: the api.tensorcash.boblabs.eu button, the only place the TensorCash mark appears */
.bl-eco { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--edge); border-radius: 999px;
  padding: 8px 16px 8px 14px; font: 600 13.5px/1 var(--font-sans); color: var(--muted); text-decoration: none;
  white-space: nowrap; transition: border-color .2s ease, color .2s ease; }
.bl-eco img { display: block; width: 13px; height: 16px; }
.bl-eco:hover, .bl-eco:focus-visible { border-color: var(--accent); color: var(--accent); }
.bl-eco .ext { width: 12px; height: 12px; }
.bl-eco-sm { padding: 6px 12px 6px 10px; font-size: 12.5px; }
.bl-indie { font: 400 11.5px/16px var(--font-mono); letter-spacing: .02em; color: var(--muted); }

/* ── app header ───────────────────────────────────────────────────────── */
.bl-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; gap: 20px;
  min-height: 56px; padding-block: 8px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: var(--veil); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); }
.bl-header .end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.bl-nav { display: flex; align-items: center; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.bl-nav a { padding: 6px 11px; border-radius: 999px; font: 500 13.5px/20px var(--font-sans); color: var(--muted);
  text-decoration: none; white-space: nowrap; transition: color .2s ease, background-color .2s ease; }
.bl-nav a:hover { color: var(--fg); background: var(--hover); }
.bl-nav a[aria-current="page"] { color: var(--fg); background: var(--raised); box-shadow: inset 0 0 0 1px var(--line); }
.bl-live { display: inline-flex; align-items: center; gap: 8px; font: 400 12px/1 var(--font-mono); color: var(--muted); white-space: nowrap; }
.bl-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.bl-live.off::before { background: var(--faint); box-shadow: none; }

/* theme switch: the boblabs.eu swarm toggle */
.bl-switch { display: inline-flex; align-items: center; gap: 8px; padding: 8px; border: 0; background: none; cursor: pointer;
  font: 500 11px/1 var(--font-mono); letter-spacing: .08em; color: var(--muted); transition: color .2s ease; }
.bl-switch:hover { color: var(--fg); }
.bl-switch .track { position: relative; width: 22px; height: 12px; border: 1px solid var(--edge); border-radius: 999px; transition: border-color .25s ease; }
.bl-switch .knob { position: absolute; top: 2px; left: 2px; width: 6px; height: 6px; border-radius: 50%; background: var(--muted);
  transition: transform .25s cubic-bezier(.2,.7,.2,1), background-color .25s ease; }
.bl-switch[aria-checked="true"] .track { border-color: var(--accent); }
.bl-switch[aria-checked="true"] .knob { transform: translateX(10px); background: var(--accent); }

/* ── actions ──────────────────────────────────────────────────────────── */
.bl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 16px;
  border: 1px solid var(--edge); border-radius: 999px; background: transparent; color: var(--fg);
  font: 500 14px/1 var(--font-sans); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: border-color .2s ease, color .2s ease, background-color .2s ease; }
.bl-btn:hover { border-color: var(--accent); color: var(--accent); }
.bl-btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.bl-btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.bl-btn-quiet { border-color: transparent; color: var(--muted); }
.bl-btn-quiet:hover { border-color: transparent; background: var(--hover); color: var(--fg); }
.bl-btn-danger { border-color: var(--danger); color: var(--danger); }
.bl-btn-danger:hover { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.bl-btn-sm { height: 28px; padding: 0 12px; font-size: 13px; gap: 6px; }
.bl-btn-lg { height: 44px; padding: 0 22px; font-size: 15px; }
.bl-btn-icon { width: 36px; padding: 0; }
.bl-btn-icon.bl-btn-sm { width: 28px; }
.bl-btn:disabled, .bl-btn[aria-disabled="true"] { opacity: .45; cursor: default; pointer-events: none; }
.bl-link { border: 0; padding: 0; background: none; font: inherit; color: var(--muted); text-decoration: underline;
  text-underline-offset: 3px; cursor: pointer; }
.bl-link:hover { color: var(--accent); }

/* arrow link: the boblabs.eu contact link, the underline draws in on hover */
.bl-arrow { display: inline-flex; align-items: center; gap: 10px; font: 400 14px/1.4 var(--font-mono); color: var(--fg); text-decoration: none; }
.bl-arrow .arr { color: var(--faint); transition: color .2s ease, transform .2s ease; }
.bl-arrow .txt { padding-bottom: 2px; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 1px no-repeat; transition: background-size .3s ease; }
.bl-arrow:hover .arr, .bl-arrow:focus-visible .arr { color: var(--accent); transform: translateX(3px); }
.bl-arrow:hover .txt, .bl-arrow:focus-visible .txt { background-size: 100% 1px; }

.bl-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid var(--line);
  border-radius: 999px; background: transparent; color: var(--muted); font: 400 12px/1 var(--font-mono); white-space: nowrap;
  cursor: pointer; transition: border-color .2s ease, color .2s ease, background-color .2s ease; }
.bl-chip:hover { color: var(--fg); border-color: var(--edge); }
.bl-chip.on, .bl-chip[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.bl-chip .bl-icon { width: 14px; height: 14px; }

.bl-seg { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 999px; }
.bl-seg button { height: 24px; padding: 0 10px; border: 0; border-radius: 999px; background: none; color: var(--muted);
  font: 500 11px/1 var(--font-mono); letter-spacing: .04em; cursor: pointer; }
.bl-seg button[aria-pressed="true"] { background: var(--raised); color: var(--fg); box-shadow: inset 0 0 0 1px var(--edge); }

/* ── forms ────────────────────────────────────────────────────────────── */
.bl-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bl-field > label { font: 500 11px/16px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.bl-input, .bl-select, .bl-textarea { width: 100%; min-height: 38px; padding: 8px 12px; border: 1px solid var(--edge);
  border-radius: 10px; background: var(--raised); color: var(--fg); font: 400 14px/20px var(--font-sans);
  transition: border-color .2s ease, box-shadow .2s ease; }
.bl-textarea { resize: vertical; }
.bl-input::placeholder, .bl-textarea::placeholder { color: var(--muted); }
.bl-input:focus, .bl-select:focus, .bl-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bl-selectwrap { position: relative; display: inline-flex; min-width: 0; }
.bl-selectwrap::after { content: ""; position: absolute; right: 13px; top: 50%; width: 6px; height: 6px; pointer-events: none;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: translateY(-70%) rotate(45deg); }
.bl-select { appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer; }
.bl-select-pill { min-height: 28px; height: 28px; padding: 0 28px 0 12px; border-radius: 999px; border-color: var(--line);
  background: transparent; color: var(--muted); font: 400 12px/1 var(--font-mono); text-overflow: ellipsis; }
.bl-selectwrap:has(.bl-select-pill) { align-self: flex-start; max-width: 200px; }
.bl-selectwrap:has(.bl-select-pill)::after { right: 11px; width: 5px; height: 5px; }
.bl-help { font-size: 12.5px; line-height: 18px; color: var(--muted); }
.bl-error { font-size: 12.5px; line-height: 18px; color: var(--danger); }
.bl-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.bl-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }

/* ── surfaces ─────────────────────────────────────────────────────────── */
.bl-card { background: var(--raised); border: 1px solid var(--line); border-radius: 14px; padding: 16px; min-width: 0; }
.bl-card-link { display: flex; flex-direction: column; gap: 6px; text-align: left; color: inherit; text-decoration: none;
  font: inherit; cursor: pointer; transition: border-color .2s ease; }
.bl-card-link:hover { border-color: var(--edge); }
.bl-card .name { font-weight: 600; }
.bl-card .meta { font: 400 12px/16px var(--font-mono); color: var(--accent); }
.bl-card .desc { color: var(--muted); font-size: 13.5px; line-height: 1.5; overflow-wrap: break-word; }
.bl-card-add { align-items: center; justify-content: center; border-style: dashed; color: var(--muted); min-height: 96px; }
.bl-card-add:hover { color: var(--accent); border-color: var(--accent); }
.bl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px; }

.bl-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: 12px; }
.bl-stat { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--raised); border: 1px solid var(--line); border-radius: 14px; }
.bl-stat .v { font: 600 28px/32px var(--font-sans); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bl-stat .v small { font: 400 13px/1 var(--font-mono); letter-spacing: 0; color: var(--muted); }
.bl-stat .s { font-size: 12.5px; line-height: 18px; color: var(--muted); }
.bl-stat-accent .v { color: var(--accent); }

.bl-tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--raised); }
.bl-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.bl-table th { padding: 10px 14px; text-align: left; white-space: nowrap; background: var(--surface); border-bottom: 1px solid var(--line);
  font: 500 11px/16px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.bl-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.bl-table tbody tr:last-child td { border-bottom: 0; }
.bl-table tbody tr:hover { background: var(--hover); }
.bl-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.bl-table .mono { font-family: var(--font-mono); font-size: 12.5px; }

.bl-badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border: 1px solid var(--line);
  border-radius: 999px; color: var(--muted); font: 500 11px/1 var(--font-mono); letter-spacing: .06em; white-space: nowrap; text-decoration: none; }
.bl-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.bl-badge-accent { border-color: transparent; background: var(--accent-soft); color: var(--accent); }
.bl-badge-ok { border-color: transparent; background: var(--ok-soft); color: var(--ok); }
.bl-badge-warn { border-color: transparent; background: var(--warn-soft); color: var(--warn); }
.bl-badge-danger { border-color: transparent; background: var(--danger-soft); color: var(--danger); }
.bl-badge-dashed { border-style: dashed; border-color: var(--warn); color: var(--warn); }
a.bl-badge:hover { text-decoration: underline; text-underline-offset: 2px; }

.bl-codebox { display: flex; align-items: center; gap: 8px; max-width: 100%; padding: 6px 6px 6px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); font: 400 13px/20px var(--font-mono); }
.bl-codebox code { flex: 1; min-width: 0; overflow-wrap: anywhere; font: inherit; }
.bl-copy { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px; border: 0; border-radius: 6px;
  background: none; color: var(--muted); font: 500 11px/1 var(--font-mono); letter-spacing: .04em; cursor: pointer; white-space: nowrap; }
.bl-copy:hover { background: var(--hover); color: var(--fg); }
.bl-copy.done { color: var(--ok); }

.bl-notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--warn-soft);
  color: var(--fg); font-size: 13px; line-height: 1.5; }
.bl-notice > .bl-icon { margin-top: 1px; color: var(--warn); }
.bl-notice-danger { background: var(--danger-soft); }
.bl-notice-danger > .bl-icon { color: var(--danger); }
.bl-notice-info { background: var(--accent-soft); }
.bl-notice-info > .bl-icon { color: var(--accent); }

.bl-scrim { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: var(--scrim); }
.bl-scrim[hidden] { display: none; }
.bl-modal { width: min(440px, 100%); max-height: calc(100dvh - 32px); overflow: auto; display: flex; flex-direction: column; gap: 14px;
  padding: 24px; background: var(--raised); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-pop); }
.bl-modal h2 { margin: 0; font: 600 18px/1.3 var(--font-sans); letter-spacing: -.01em; }
.bl-modal .lead { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.bl-modal .actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; }
.bl-modal .actions .bl-link { margin-right: auto; }

/* ── page layout ──────────────────────────────────────────────────────── */
.bl-page { max-width: 1080px; margin: 0 auto; padding-block: 32px 64px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.bl-pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.bl-pagehead h1 { margin: 0; font: 500 26px/1.2 var(--font-sans); letter-spacing: -.02em; text-wrap: balance; }
.bl-pagehead p { margin: 6px 0 0; max-width: 62ch; color: var(--muted); }
.bl-section { display: flex; flex-direction: column; gap: 12px; margin-top: 32px; }
.bl-section > h2 { margin: 0; padding-bottom: 8px; border-bottom: 1px solid var(--line);
  font: 500 11px/16px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.bl-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding-block: 16px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  border-top: 1px solid var(--line); font: 400 12px/18px var(--font-mono); color: var(--muted); }
.bl-footer .indie { flex: 1 1 320px; min-width: 0; }
.bl-footer nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.bl-footer a { color: var(--muted); text-decoration: none; }
.bl-footer a:hover { color: var(--fg); }

/* ── sidebar and lists ────────────────────────────────────────────────── */
.bl-side { display: flex; flex-direction: column; gap: 12px; min-height: 0; padding: 14px 10px; background: var(--surface); border-right: 1px solid var(--line); }
.bl-group { display: flex; flex-direction: column; gap: 1px; }
.bl-sechead { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 4px 4px 10px; }
.bl-sechead a { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: var(--muted); }
.bl-sechead a:hover { color: var(--accent); background: var(--hover); }
.bl-row { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 4px 0 10px; border-radius: 8px; color: var(--muted);
  font: 400 13.5px/1.3 var(--font-sans); text-decoration: none; cursor: pointer; }
.bl-row .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-row .n { font: 400 11.5px/1 var(--font-mono); color: var(--muted); }
.bl-row:hover { background: var(--hover); color: var(--fg); }
.bl-row.on, .bl-row[aria-current="true"] { background: var(--raised); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line); }
.bl-row .live { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: bl-pulse 1.4s ease-in-out infinite; }
.bl-row .acts { display: none; }
.bl-row:hover .acts, .bl-row.on .acts { display: flex; }
.bl-row .acts button { display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.bl-row .acts button:hover { background: var(--hover); color: var(--fg); }
.bl-row.off .t { text-decoration: line-through; opacity: .6; }
.bl-row-empty { padding: 4px 10px; color: var(--muted); font-size: 12.5px; font-style: italic; }

/* ── chat ─────────────────────────────────────────────────────────────── */
.bl-thread { display: flex; flex-direction: column; gap: 24px; width: 100%; max-width: 760px; margin: 0 auto; padding-block: 24px; }
.bl-msg { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.bl-msg-user { align-self: flex-end; max-width: min(80%, 620px); padding: 10px 16px; border-radius: 18px 18px 4px 18px;
  background: var(--user); color: var(--fg); white-space: pre-wrap; overflow-wrap: break-word; font: 400 15px/1.6 var(--font-sans); }
.bl-msg-bot { align-self: stretch; }
.bl-msg-head { display: flex; align-items: center; gap: 8px; font: 500 12px/16px var(--font-mono); color: var(--muted); }
.bl-msg-head .who { color: var(--fg); }
.bl-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font: 400 12px/16px var(--font-mono); color: var(--muted); }
.bl-byline .acts { display: flex; gap: 2px; margin-left: auto; }
.bl-msg-err { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 14px; border: 1px dashed var(--danger);
  border-radius: 12px; color: var(--danger); font-size: 14px; }
.bl-sys { text-align: center; font: 400 12px/16px var(--font-mono); color: var(--muted); }
.bl-cursor::after { content: ""; display: inline-block; width: .5em; height: 1.05em; margin-left: 2px; vertical-align: -.15em;
  background: var(--accent); opacity: .85; animation: bl-blink 1.1s steps(1) infinite; }

.bl-think { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.bl-think summary { display: flex; align-items: center; gap: 8px; padding: 8px 12px; list-style: none; cursor: pointer; user-select: none;
  font: 400 12.5px/16px var(--font-mono); color: var(--muted); }
.bl-think summary::-webkit-details-marker { display: none; }
.bl-think summary::before { content: ""; width: 7px; height: 7px; flex: none; transform: rotate(45deg); background: var(--accent); }
.bl-think.live summary::before { animation: bl-pulse 1.2s ease-in-out infinite; }
.bl-think summary .chev { margin-left: auto; transition: transform .2s ease; }
.bl-think[open] summary { border-bottom: 1px solid var(--line); }
.bl-think[open] summary .chev { transform: rotate(180deg); }
.bl-think .body { max-height: 16em; overflow: auto; padding: 10px 14px; color: var(--muted); font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; }

.bl-tools { display: flex; flex-direction: column; gap: 6px; }
.bl-toolrun { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font: 400 12.5px/18px var(--font-mono); color: var(--muted); }
.bl-toolrun summary { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 10px; list-style: none; cursor: pointer; }
.bl-toolrun summary::-webkit-details-marker { display: none; }
.bl-toolrun .st { display: grid; place-items: center; width: 16px; height: 16px; flex: none; }
.bl-toolrun .st .bl-icon { width: 14px; height: 14px; }
.bl-toolrun .name { color: var(--fg); white-space: nowrap; }
.bl-toolrun .arg { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-toolrun .time { flex: none; }
.bl-toolrun pre { margin: 0; max-height: 9em; overflow: auto; padding: 8px 10px; border-top: 1px solid var(--line); white-space: pre-wrap; font: inherit; }
.bl-toolrun.ok .st { color: var(--ok); }
.bl-toolrun.failed { color: var(--danger); }
.bl-toolrun.failed .st { color: var(--danger); }
.bl-spin { width: 12px; height: 12px; border: 1.5px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: bl-spin .8s linear infinite; }

.bl-composer { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 760px; margin: 0 auto; padding: 10px 10px 8px 14px;
  border: 1px solid var(--edge); border-radius: 18px; background: var(--raised); transition: border-color .2s ease, box-shadow .2s ease; }
.bl-composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bl-composer textarea { width: 100%; max-height: 200px; padding: 4px 0; border: 0; outline: none; resize: none; background: none;
  color: var(--fg); font: 400 15px/1.55 var(--font-sans); }
.bl-composer textarea::placeholder { color: var(--muted); }
.bl-composer .controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.bl-composer .send { display: grid; place-items: center; width: 34px; height: 34px; margin-left: auto; border: 0; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); cursor: pointer; transition: background-color .2s ease; }
.bl-composer .send:hover { background: var(--accent-hover); }
.bl-composer .send:disabled { background: var(--hover); color: var(--muted); cursor: default; }
.bl-price { font: 400 11.5px/1 var(--font-mono); color: var(--muted); white-space: nowrap; }
.bl-composer-note { margin: 8px 0 0; text-align: center; font: 400 11.5px/16px var(--font-mono); color: var(--muted); }
.bl-jump { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--edge); border-radius: 999px;
  background: var(--raised); color: var(--fg); font: 500 12px/1 var(--font-sans); box-shadow: var(--shadow-pop); cursor: pointer; }

/* markdown answers */
.bl-md { color: var(--fg); font: 400 15px/1.65 var(--font-sans); overflow-wrap: break-word; min-width: 0; }
.bl-md > :first-child { margin-top: 0; }
.bl-md > :last-child { margin-bottom: 0; }
.bl-md p { margin: 0 0 .8em; }
.bl-md h1, .bl-md h2, .bl-md h3, .bl-md h4 { margin: 1.4em 0 .5em; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; text-wrap: balance; }
.bl-md h1 { font-size: 20px; }
.bl-md h2 { font-size: 18px; }
.bl-md h3, .bl-md h4 { font-size: 16px; }
.bl-md ul, .bl-md ol { margin: 0 0 .8em; padding-left: 1.4em; }
.bl-md li { margin: .25em 0; }
.bl-md li::marker { color: var(--muted); }
.bl-md a { color: var(--accent); text-underline-offset: 2px; }
.bl-md strong { font-weight: 600; }
.bl-md :not(pre) > code { padding: .1em .35em; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); font: 400 .86em var(--font-mono); }
.bl-md blockquote { margin: 0 0 .8em; padding: .1em 0 .1em 1em; border-left: 2px solid var(--edge); color: var(--muted); }
.bl-md hr { margin: 1.4em 0; border: 0; border-top: 1px solid var(--line); }
.bl-md .tbl { margin: 0 0 .9em; overflow-x: auto; }
.bl-md table { border-collapse: collapse; font-size: 14px; }
.bl-md th, .bl-md td { padding: 6px 12px; border: 1px solid var(--line); text-align: left; }
.bl-md th { background: var(--surface); font-weight: 600; }
.bl-code { margin: 0 0 .9em; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.bl-code .bar { display: flex; align-items: center; justify-content: space-between; height: 34px; padding: 0 4px 0 12px; border-bottom: 1px solid var(--line);
  font: 500 11px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.bl-code pre { margin: 0; padding: 12px 14px; overflow-x: auto; font: 400 13px/20px var(--font-mono); color: var(--fg); tab-size: 4; }

/* signed-out landing */
.bl-hero { position: relative; isolation: isolate; display: flex; flex-direction: column; gap: 20px; width: 100%; max-width: 760px; margin: 0 auto; padding-block: 48px 32px; }
.bl-hero h1 { margin: 0; max-width: 22ch; font: 500 clamp(28px, 5vw, 40px)/1.15 var(--font-sans); letter-spacing: -.022em; text-wrap: balance; }
.bl-hero .bl-tag { max-width: 60ch; margin: 0; }
.bl-hero .credit { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.bl-hero .credit b { font: 500 44px/1 var(--font-mono); letter-spacing: -.03em; color: var(--accent); font-variant-numeric: tabular-nums; }
.bl-hero .cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.bl-gridbg { position: absolute; inset: -24px -12vw 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    linear-gradient(var(--grid-strong) 1px, transparent 1px), linear-gradient(90deg, var(--grid-strong) 1px, transparent 1px);
  background-size: 40px 40px, 40px 40px, 200px 200px, 200px 200px; background-position: center;
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 0%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse at 50% 40%, #000 0%, #000 30%, transparent 75%); }
.bl-feats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 1px; overflow: hidden;
  border: 1px solid var(--line); border-radius: 14px; background: var(--line); }
.bl-feat { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; background: var(--surface); }
.bl-feat b { display: flex; align-items: center; gap: 8px; font: 600 14px/20px var(--font-sans); }
.bl-feat b .bl-icon { color: var(--accent); }
.bl-feat span { color: var(--muted); font-size: 13px; line-height: 1.5; }
.bl-feat code { font: 400 12px var(--font-mono); }
.bl-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; width: 100%; max-width: 760px; margin: 0 auto; padding-block: 12vh 24px; }
.bl-empty h2 { margin: 0; font: 500 26px/1.25 var(--font-sans); letter-spacing: -.02em; }
.bl-prompts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 8px; width: 100%; }
.bl-prompt { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--fg);
  font: 400 13.5px/1.45 var(--font-sans); text-align: left; cursor: pointer; transition: border-color .2s ease; }
.bl-prompt:hover { border-color: var(--edge); }
.bl-prompt span { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; }

/* memory calendar */
.bl-cal { max-width: 640px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--raised); }
.bl-cal .head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px;
  font: 500 13px/1 var(--font-mono); }
.bl-cal .head .nav { display: flex; align-items: center; gap: 4px; }
.bl-cal .grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.bl-cal .dow { padding: 4px 0; text-align: center; font: 500 10.5px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.bl-cal .day { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 44px; padding: 6px 2px; border: 0; border-radius: 8px;
  background: none; color: var(--muted); font: 400 12px/1 var(--font-mono); }
.bl-cal .day.has { color: var(--fg); cursor: pointer; }
.bl-cal .day.has::after { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.bl-cal .day.has:hover { background: var(--hover); }
.bl-cal .day.today { box-shadow: inset 0 0 0 1px var(--edge); }
.bl-cal .day.on { background: var(--accent); color: var(--on-accent); }
.bl-cal .day.on::after { background: var(--on-accent); }

/* ── motion ───────────────────────────────────────────────────────────── */
.bl-rise { animation: bl-rise .9s cubic-bezier(.2,.7,.2,1) both; }
@keyframes bl-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes bl-blink { 50% { opacity: 0; } }
@keyframes bl-pulse { 50% { opacity: .35; } }
@keyframes bl-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .bl-rise, .bl-cursor::after, .bl-think.live summary::before, .bl-row .live { animation: none; }
  .bl-spin { animation-duration: 2.4s; }
}


/* ── 4. app ──────────────────────────────────────────────────────────── */

/* base: every page is a column — header, the page, the footer */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; width: 100%; }
[hidden] { display: none !important; }
img, video, canvas { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
code, kbd, pre { font-family: var(--font-mono); }
h1, h2, h3 { text-wrap: balance; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--edge); }

/* ── shell: header ───────────────────────────────────────────────────── */
.bl-lockup img { display: block; width: 26px; height: 26px; flex: none; }
.bl-lockup:focus-visible { border-radius: 6px; }
.bl-sitenav { display: contents; }
.bl-sitenav .bl-indie { display: none; margin: 0; }
.bl-menubtn { display: none; margin-left: -8px; }
.bl-account { max-width: 220px; }
.bl-account .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.bl-account[aria-current="page"] { border-color: var(--accent); color: var(--accent); }
.bl-eco .bl-sr { position: absolute; }
/* signed out, the builder pages leave the nav (they need an account) */
body:not(.signed-in) .bl-nav [data-signed-in] { display: none; }

@media (max-width: 1359px) {
  .bl-header .bl-live { display: none; }
}
/* narrow: the bar keeps the menu button, the lockup and the account; the
   nav, the status, the TensorCash pill and the switch move to a drawer */
@media (max-width: 1179px) {
  .bl-header { gap: 10px; background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .bl-menubtn { display: inline-flex; }
  .bl-account { margin-left: auto; }
  .bl-sitenav { display: none; }
  body.nav-open .bl-header { z-index: 45; }
  body.nav-open:not([data-drawer]) .bl-sitenav {
    position: fixed; z-index: 45; top: 0; bottom: 0; left: 0; width: min(320px, 86vw);
    display: flex; flex-direction: column; gap: 18px; overflow-y: auto;
    padding: calc(16px + env(safe-area-inset-top, 0px)) 14px calc(16px + env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px));
    background: var(--surface); border-right: 1px solid var(--line); box-shadow: var(--shadow-pop);
    animation: bl-drawer .22s cubic-bezier(.2,.7,.2,1) both;
  }
  body.nav-open .bl-sitenav .bl-nav { flex-direction: column; align-items: stretch; gap: 2px; overflow: visible; }
  body.nav-open .bl-sitenav .bl-nav a { padding: 9px 12px; border-radius: 8px; font-size: 14.5px; }
  body.nav-open .bl-sitenav .end { margin-left: 0; flex-wrap: wrap; justify-content: space-between; gap: 12px;
    padding-top: 14px; border-top: 1px solid var(--line); }
  body.nav-open .bl-sitenav .bl-live { display: inline-flex; width: 100%; }
  body.nav-open .bl-sitenav .bl-indie { display: block; }
}
@media (max-width: 480px) {
  .bl-lockup { gap: 8px; font-size: 15px; }
  .bl-lockup .app { padding-left: 8px; font-size: 10px; letter-spacing: .05em; }
  .bl-account { width: 32px; padding: 0; }
  .bl-account .t { display: none; }
}
.bl-drawer-scrim { position: fixed; inset: 0; z-index: 40; background: var(--scrim); animation: bl-fade .2s ease both; }
@keyframes bl-drawer { from { transform: translateX(-16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bl-fade { from { opacity: 0; } }

/* ── shell: footer and page frame ────────────────────────────────────── */
.bl-footer { flex: none; }
.bl-footer .indie { margin: 0; }
.bl-page { width: 100%; }
.bl-pagehead .bl-label { display: block; margin-bottom: 6px; }
.bl-pagenote { margin: 40px 0 0; font: 400 12px/18px var(--font-mono); color: var(--muted); }
.bl-signin { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px; border: 1px dashed var(--edge);
  border-radius: 14px; color: var(--muted); }
.bl-signin p { margin: 0; flex: 1 1 280px; }
.bl-page a:not([class]) { color: var(--accent); text-underline-offset: 2px; }
.bl-page code:not([class]) { padding: .1em .35em; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); font-size: .86em; }
.bl-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* rows that are buttons, or carry their title as a button (keyboard reach) */
button.bl-row { width: 100%; border: 0; background: none; text-align: left; font: 400 13.5px/1.3 var(--font-sans); }
.bl-row > button.t { align-self: stretch; padding: 0; border: 0; background: none; color: inherit; font: inherit;
  text-align: left; cursor: pointer; }
/* modals: an explicit column, so the modal's min(440px, 100%) resolves
   against the screen and never its own content (it overflowed on phones) */
.bl-scrim { grid-template-columns: minmax(0, 1fr); justify-items: center; overflow-y: auto; }
/* a table with no rows yet leaves no empty frame behind */
.bl-tablewrap:has(> table:empty) { display: none; }
/* phones: stat tiles two by two, the first one (the headline) full width */
@media (max-width: 480px) {
  .bl-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .bl-stats > .bl-stat { padding: 12px; }
  .bl-stats > .bl-stat:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
  .bl-stat .v { font-size: 22px; line-height: 28px; overflow-wrap: anywhere; }
  .bl-pagehead h1 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .bl-sitenav, .bl-drawer-scrim { animation: none !important; }
}


/* ── chat (/) ─────────────────────────────────────────────────────────
   Signed in: conversations | the thread + composer | your builders, in one
   viewport. Signed out: the landing (#landing) in a normal scrolling page.
   Without accounts (anonymous chat): the thread column alone. */
body.chat-page:not(.gated-out) { height: 100vh; height: 100dvh; overflow: hidden; }
body.chat-page:not(.gated-out) > .bl-footer { display: none; }
body.chat-page:not(.auth-known) .bl-chat,
body.chat-page:not(.auth-known) #landing { visibility: hidden; }
body.chat-page.gated-out .bl-chat { display: none; }
body.chat-page:not(.gated-out) #landing { display: none; }

.bl-chat { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
body.authed .bl-chat { grid-template-columns: 272px minmax(0, 1fr) 248px; }
body.authed.side-closed .bl-chat { grid-template-columns: minmax(0, 1fr) 248px; }
#panel, #rightpanel { display: none; }
body.authed #panel { display: flex; }
body.authed.side-closed #panel { display: none; }
body.authed #rightpanel { display: flex; }
@media (max-width: 1279px) {
  body.authed .bl-chat { grid-template-columns: 272px minmax(0, 1fr); }
  body.authed.side-closed .bl-chat { grid-template-columns: minmax(0, 1fr); }
  body.authed #rightpanel { display: none; }
}

/* left: conversations */
#panel { flex-direction: column; gap: 10px; min-height: 0; overflow: hidden; }
#panel .bl-side-top, #panel .bl-side-nav, #panel .bl-side-foot { display: none; }
#panel .bl-side-head { display: flex; align-items: center; gap: 6px; }
#panel .bl-side-head #newchat { flex: 1; justify-content: flex-start; }
#panel .bl-field { padding: 0 2px; }
#sessions { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
#sessions .bl-sechead:first-child { padding-top: 4px; }
#sessions .bl-row .n { flex: none; }
#sideopen { display: none; position: absolute; top: 12px; left: 12px; z-index: 2; }
body.authed.side-closed #sideopen { display: inline-flex; }

/* right: your builders */
#rightpanel { flex-direction: column; gap: 1px; min-height: 0; overflow-y: auto; padding: 6px 10px 16px;
  border-left: 1px solid var(--line); background: var(--bg); }
#rightpanel .bl-sechead:first-child { padding-top: 8px; }
#rightpanel .bl-row[aria-disabled="true"] { cursor: default; }
#rightpanel .bl-row[aria-disabled="true"]:hover { background: none; color: var(--muted); }
#usagelist .bal .t { color: var(--accent); }

/* centre: the thread and the composer */
.bl-chat-main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
#log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 24px;
  padding-block: 28px 24px; padding-inline: max(20px, calc((100% - 760px) / 2)); }
#log > .bl-msg-user { max-width: min(80%, 620px); }
#log .bl-msg-bot { gap: 12px; }
#log .bl-msg-bot .bl-md:empty { display: none; }
#log .bl-msg-bot.streaming .bl-md:empty { display: block; }
#log .bl-msg-bot.streaming .bl-md > :last-child::after,
#log .bl-msg-bot.streaming .bl-md:empty::after {
  content: ""; display: inline-block; width: .5em; height: 1.05em; margin-left: 2px; vertical-align: -.15em;
  background: var(--accent); opacity: .85; animation: bl-blink 1.1s steps(1) infinite; }
#log .bl-msg-bot.streaming .bl-md > .bl-code:last-child::after,
#log .bl-msg-bot.streaming .bl-md > .tbl:last-child::after { display: none; }
#log .bl-byline .acts { opacity: 0; transition: opacity .2s ease; }
#log .bl-msg-bot:hover .bl-byline .acts, #log .bl-byline .acts:focus-within { opacity: 1; }
@media (hover: none) { #log .bl-byline .acts { opacity: 1; } }
#log .bl-byline .partial { color: var(--warn); }
#log .bl-sys { margin: -8px 0; }
#log .bl-sys.queued { color: var(--accent); }
#log .bl-msg-err .bl-btn { flex: none; }
.bl-toolrun pre { color: var(--muted); }
.bl-think .body { margin: 0; }

#empty { flex: 1; min-height: 0; overflow-y: auto; padding-inline: max(20px, calc((100% - 760px) / 2)); }
#empty .bl-empty { padding-block: 10vh 24px; max-width: none; }
#empty .bl-empty h2 { text-wrap: balance; }

.bl-composerwrap { position: relative; flex: none; padding: 8px max(20px, calc((100% - 760px) / 2)) 14px;
  padding-bottom: max(14px, env(safe-area-inset-bottom, 0px)); }
#jump { position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); z-index: 3; }
#jump .bl-icon { width: 14px; height: 14px; }
.bl-composer { max-width: none; }
.bl-composer .bl-chip .bl-icon { width: 14px; height: 14px; }
.bl-composer .bl-selectwrap:has(> select[hidden]) { display: none; }
.bl-composer .bl-select-pill { max-width: 190px; }
#agent.on { border-color: var(--accent); color: var(--accent); }
.bl-composer-note { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 8px; }
.bl-composer-note .bl-link { font: inherit; }
@media (max-width: 600px) {
  .bl-composer .bl-select-pill { max-width: 130px; }
  .bl-composer-note .indie { display: none; }
  #log { gap: 20px; padding-top: 20px; }
}

/* narrow: the conversations panel is the drawer (the header's menu button) */
@media (max-width: 1179px) {
  body.authed .bl-chat, body.authed.side-closed .bl-chat { grid-template-columns: minmax(0, 1fr); }
  body.authed #panel, body.authed.side-closed #panel { display: none; }
  #sidetoggle, body.authed.side-closed #sideopen { display: none; }
  body.authed.nav-open #panel {
    display: flex; position: fixed; z-index: 45; top: 0; bottom: 0; left: 0; width: min(320px, 86vw);
    padding: calc(12px + env(safe-area-inset-top, 0px)) 12px calc(16px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
    box-shadow: var(--shadow-pop); animation: bl-drawer .22s cubic-bezier(.2,.7,.2,1) both; }
  #panel .bl-side-top { display: flex; align-items: center; justify-content: space-between; }
  #panel .bl-side-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; }
  #panel .bl-side-foot { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
  #panel .bl-side-foot > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  #sessions { border-top: 1px solid var(--line); }
}

/* signed out: the landing */
#landing { flex: 1 0 auto; width: 100%; padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
  /* the hero's grid bleeds sideways by design; it must not widen the page */
  overflow-x: hidden; overflow-x: clip; }
#landing .bl-table td { white-space: normal; }
#landing .bl-hero { max-width: 980px; padding-block: 72px 40px; }
#landing .bl-hero .bl-cursor { margin-left: 0; }
#landing .bl-hero .bonus { font: 500 12.5px/18px var(--font-mono); color: var(--accent); }
#landing .bl-hero .note { margin: 0; font-size: 14px; color: var(--muted); }
#landing .bl-feats { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
button.bl-arrow { padding: 0; border: 0; background: none; cursor: pointer; }
#landing .more { max-width: 980px; margin: 0 auto; display: flex; flex-direction: column; gap: 32px; padding-bottom: 56px; }
#landing .cards2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px; }
#landing .cards2 > .bl-card { display: flex; flex-direction: column; gap: 12px; padding: 20px; }
#landing .cards2 p { margin: 0; }
#landing .bl-tablewrap { border: 0; background: none; }
#landing .bl-table td:first-child { white-space: normal; }
@media (max-width: 600px) { #landing .bl-hero { padding-block: 40px 28px; } }

/* modals on the chat page */
.bl-modal .bl-field + .bl-field { margin-top: -2px; }
.bl-modal .toollist { max-height: 55vh; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.bl-modal-wide { width: min(560px, 100%); }
.bl-modal .err:empty { display: none; }
.bl-check-row { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.bl-check-row input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }

/* the tool pickers (chat modals and the agent builder) */
.toolgroup { border: 1px solid var(--line); border-radius: 10px; margin: 0 0 8px; background: var(--surface); }
.toolgroup summary { display: flex; gap: 8px; align-items: center; padding: 9px 12px; cursor: pointer; list-style: none; user-select: none; }
.toolgroup summary::-webkit-details-marker { display: none; }
.toolgroup summary::after { content: ""; width: 6px; height: 6px; margin-left: 4px; border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); transition: transform .2s ease; }
.toolgroup[open] summary::after { transform: rotate(45deg); }
.toolgroup summary .tname { font: 500 13px/1.3 var(--font-mono); color: var(--fg); }
.toolgroup summary .tcount { margin-left: auto; font: 400 11.5px/1 var(--font-mono); color: var(--muted); }
.toolgroup .toolrow { border-top: 1px solid var(--line); padding-inline: 12px; }
.toolrow { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: baseline; padding: 8px 0; cursor: pointer; }
.toolrow input[type=checkbox] { width: 16px; height: 16px; margin: 0; align-self: center; accent-color: var(--accent); }
.toolrow .tname { font: 400 13px/1.4 var(--font-mono); color: var(--fg); overflow-wrap: anywhere; }
.toolrow .tdesc { grid-column: 2; color: var(--muted); font-size: 12.5px; line-height: 1.45; }

/* lab files and the file preview */
.fileslist { display: flex; flex-direction: column; max-height: 50vh; overflow-y: auto; }
.filerow { display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.filerow .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-mono); font-size: 12.5px; }
.filerow .fsize { font: 400 11.5px/1 var(--font-mono); color: var(--muted); }
.previewbody { max-height: 70vh; overflow: auto; text-align: center; }
.previewbody .nvbody { max-height: none; text-align: left; }
.previewbody img { max-width: 100%; max-height: 66vh; }
.previewbody iframe { width: 100%; height: 66vh; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.previewbody video { max-width: 100%; max-height: 66vh; border-radius: 8px; }
.previewbody audio { width: 100%; }
.nvbody { margin: 0; white-space: pre-wrap; overflow-wrap: break-word; font: 400 13px/1.55 var(--font-mono); color: var(--fg);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; max-height: 24em; overflow-y: auto; }


/* ── page families: builders, memory, account, admin ──────────────────── */
.bl-page-wide { max-width: 1240px; }
.bl-stats .bl-stat .s + .s { margin-top: -2px; }
.bl-error:empty { display: none; }
.bl-error, .bl-help { margin: 0; }
.bl-error.ok, .bl-help.ok { color: var(--ok); }
.bl-help.ok:empty { display: none; }
.bl-subhead { margin: 8px 0 0; font: 600 14px/1.3 var(--font-sans); text-transform: capitalize; }
.bl-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 16px; }
.bl-grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.bl-field:has(> .bl-selectwrap > select[hidden]), .bl-selectwrap:has(> select[hidden]) { display: none; }
.bl-check .bl-help { margin-left: 4px; }
.bl-notice a { color: var(--accent); }
.bl-notice + .bl-notice, .bl-signin + .bl-notice { margin-top: 12px; }

/* builder pages: the form above the cards */
.bl-form { display: flex; flex-direction: column; gap: 16px; max-width: 760px; margin-bottom: 24px; padding: 20px; }
.bl-form h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font: 600 18px/1.3 var(--font-sans); letter-spacing: -.01em; }
.bl-form .bl-row-actions .push { margin-left: auto; }
.bl-form .toollist { max-height: 46vh; overflow-y: auto; }
.bl-team { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.bl-team .toolrow { padding-inline: 12px; }
.bl-team .toolrow + .toolrow { border-top: 1px solid var(--line); }
#aglist:not(:empty) { margin-top: 4px; }
.bl-cards > .bl-row-empty { grid-column: 1 / -1; }
.bl-card .meta { overflow-wrap: anywhere; }
.bl-card-link:focus-visible { outline-offset: 3px; }

/* mcp: catalog cards hold their own connect controls */
.bl-mcp { display: flex; flex-direction: column; gap: 8px; }
.bl-mcp .bl-input { margin-top: 2px; }
.bl-mcp .bl-row-actions { margin-top: 2px; }
.bl-catalog { display: flex; flex-direction: column; gap: 12px; }

/* memory */
.bl-memforms { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 16px; align-items: start; }
.bl-memforms .bl-form { max-width: none; margin: 0; }
.bl-field label .count { text-transform: none; letter-spacing: 0; color: var(--faint); }
.bl-notes { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 820px) { .bl-notes { grid-template-columns: minmax(0, 1fr); } }
.bl-notelist { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.bl-notetools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bl-notetools .bl-input { flex: 1 1 220px; }
.bl-noteview { display: flex; flex-direction: column; gap: 12px; }
.bl-noteview h3 { margin: 0; font: 600 16px/1.3 var(--font-sans); }
#notelist { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }

.cal { padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--raised); }
.calhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.calnav { display: flex; align-items: center; gap: 4px; font: 500 13px/1 var(--font-mono); }
.calnav #calmonth { min-width: 9.5em; text-align: center; }
.bl-seg button.on { background: var(--raised); color: var(--fg); box-shadow: inset 0 0 0 1px var(--edge); }
.calgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.caldow { padding: 4px 0; text-align: center; font: 500 10.5px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.calday { display: flex; flex-direction: column; align-items: stretch; gap: 2px; min-height: 44px; padding: 5px 3px; overflow: hidden;
  border: 0; border-radius: 8px; background: none; color: var(--faint); font: 400 12px/1 var(--font-mono); text-align: center; cursor: default; }
.calday .dnum { display: block; }
.calday.has { color: var(--fg); cursor: pointer; }
.calday.has:hover { background: var(--hover); }
.calday.on { background: var(--accent); color: var(--on-accent); }
.dtitle { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 400 9.5px/1.45 var(--font-mono); color: var(--accent); }
.dtitle.dim { color: var(--faint); }
.calday.on .dtitle { color: var(--on-accent); }
.calweek { display: flex; flex-direction: column; gap: 2px; }
.calwkrow { display: flex; align-items: flex-start; gap: 10px; padding: 6px 8px; border-radius: 8px; }
.calwkrow.on { background: var(--accent-soft); }
.calwkday { min-width: 70px; padding: 0; border: 0; background: none; color: var(--muted); font: 400 12px/1.4 var(--font-mono); text-align: left; cursor: pointer; }
.calwkday:hover { color: var(--accent); }
.calwktitles { flex: 1; min-width: 0; }
.calwktitles .dtitle { font-size: 11.5px; }
.calyear { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.calmon { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: none; text-align: left; cursor: pointer; }
.calmon .dnum { font: 400 12px/1 var(--font-mono); color: var(--muted); }
.calmon.has .dnum { color: var(--fg); }
.calmon:hover { border-color: var(--edge); }

/* account */
.bl-addr { max-width: 640px; }
.bl-addr code { font-size: 13.5px; }
.depmin { color: var(--accent); font-weight: 600; }
.bl-apihow { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.bl-apihow > summary { padding: 10px 14px; cursor: pointer; list-style: none; font: 400 12.5px/1.4 var(--font-mono); color: var(--muted); }
.bl-apihow > summary::-webkit-details-marker { display: none; }
.bl-apihow > summary::before { content: "+ "; color: var(--accent); }
.bl-apihow[open] > summary::before { content: "− "; }
.bl-apihow > summary:hover { color: var(--fg); }
.bl-apihow[open] > summary { border-bottom: 1px solid var(--line); }
.bl-apihow > .bl-code { margin: 12px 14px; }
.bl-apihow > .bl-help { margin: 0 14px 14px; }
.bl-codebox .keyraw { font-size: 13px; }

/* tables built row by row (no tbody): the same look as bl-table's tbody rows */
.bl-table tr:last-child td { border-bottom: 0; }
.bl-table tr:has(td):hover { background: var(--hover); }
.bl-table td a { color: var(--accent); text-underline-offset: 2px; }
.bl-table td .bl-badge { height: 20px; }
.bl-table td .bl-link { font-size: 13px; }

/* admin */
.statrow { display: flex; flex-wrap: wrap; gap: 6px; }
.statsub { font: 400 12px/1.5 var(--font-mono); color: var(--muted); text-transform: none; letter-spacing: 0; }
.err { color: var(--danger); }
.dot { font-size: 9px; color: var(--faint); margin-right: 6px; }
.dot.on { color: var(--ok); }
.bl-chartcard { padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--raised); }
.bl-chartcard canvas { display: block; width: 100%; height: 72px; }
.chartgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 0 20px; }
.bl-h2row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.bl-h2row .bl-selectwrap { align-self: center; }
#payresult { max-height: 22em; }


/* ── miners, miner, showcase runs ─────────────────────────────────────── */
.bl-pagehead .bl-label a { color: inherit; text-decoration: none; }
.bl-pagehead .bl-label a:hover { color: var(--accent); }
.bl-split { display: flex; flex-wrap: wrap; gap: 0 24px; align-items: flex-start; }
.bl-split > .bl-split-main { flex: 999 1 600px; min-width: 0; }
.bl-split > .bl-split-side { flex: 1 1 300px; min-width: 0; }
.bl-split2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); gap: 0 32px; }
.bl-prose { max-width: 820px; }
.notes { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 8px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.small { margin: 0; font: 400 12px/1.5 var(--font-mono); color: var(--muted); }
.small a, #hero-note a, #live-note a { color: var(--accent); }
.mono { font-family: var(--font-mono); }
.bl-table th.num, .bl-table td.num, .bl-table .r { text-align: right; font-variant-numeric: tabular-nums; }
.bl-table td.mono, .bl-table td.a { font-family: var(--font-mono); font-size: 12.5px; }
.bl-table td.t { white-space: normal; min-width: 180px; }
.bl-table td.t .bl-badge { margin-left: 6px; }

/* miners: the leaderboard */
.bl-board td.rank { width: 1%; font-family: var(--font-mono); color: var(--muted); }
.bl-board tr.top td.rank { color: var(--accent); font-weight: 600; }
.bl-board a.addr { font-family: var(--font-mono); font-size: 12.5px; color: var(--fg); text-decoration: none; }
.bl-board a.addr:hover { color: var(--accent); text-decoration: underline; }
.mine { color: var(--ok); }
a.mine { text-underline-offset: 2px; }
@media (max-width: 640px) {
  .bl-board .opt { display: none; }
  .bl-board td.ac { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; }
}

/* miner: one address */
.bl-addrhead { font-family: var(--font-mono) !important; font-size: clamp(15px, 3.4vw, 22px) !important; letter-spacing: 0 !important;
  overflow-wrap: anywhere; }
.bl-minerstatus { height: 28px; padding: 0 12px; }
.bl-minerstatus::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.bl-minerstatus.busy::before { animation: bl-pulse 1.2s ease-in-out infinite; }
.bl-onboard { display: flex; flex-direction: column; gap: 12px; padding: 20px; max-width: 70ch; margin-bottom: 20px; }
.bl-onboard h2 { margin: 0; font: 600 18px/1.3 var(--font-sans); }
.bl-onboard p { margin: 0; color: var(--muted); line-height: 1.6; }
#midle { margin-bottom: 20px; }
#midle a, #mbad code { color: var(--accent); }
#mdash > .bl-error { margin-bottom: 16px; }

/* showcase: run status, tiles, links, start values, proofs */
.bl-runmeta { font-family: var(--font-mono); font-size: 13px !important; }
.bl-runstatus { height: 28px; padding: 0 12px; white-space: normal; text-align: left; }
.bl-runstatus:empty { display: none; }
.bl-runstatus.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor;
  animation: bl-pulse 1.4s ease-in-out infinite; }
.bl-runtiles { grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
.bl-runtiles .bl-stat .v { font-size: 24px; line-height: 30px; overflow-wrap: anywhere; }
.bl-runtiles .bl-stat a { font: 400 12px/1.6 var(--font-mono); color: var(--accent); }
.bl-demo { margin-bottom: 20px; }
.bl-demo b { color: var(--warn); }
.links { display: flex; flex-direction: column; gap: 10px; }
.links a { display: inline-flex; align-self: flex-start; font: 400 14px/1.4 var(--font-mono); color: var(--fg); text-decoration: none;
  padding-bottom: 2px; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 1px no-repeat; transition: background-size .3s ease; }
.links a::before { content: "→"; margin-right: 10px; color: var(--faint); transition: color .2s ease; }
.links a:hover { background-size: 100% 1px; }
.links a:hover::before { color: var(--accent); }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 4px 0 0; padding: 14px 16px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-family: var(--font-mono); font-size: 12.5px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.bl-reqs tr.proofs td { white-space: normal; background: var(--surface); padding-top: 4px; }
.bl-reqs tr.proofs:hover { background: none; }
.bl-reqs tr.proofs summary { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font: 500 11.5px/1 var(--font-mono); cursor: pointer; list-style: none; }
.bl-reqs tr.proofs summary::-webkit-details-marker { display: none; }
.bl-reqs tr.proofs summary::after { content: ""; width: 5px; height: 5px; border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.bl-reqs tr.proofs details[open] summary::after { transform: rotate(-135deg) translate(-1px, -1px); }
.bl-reqs .tablewrap { overflow-x: auto; margin-top: 10px; }
.bl-reqs .tablewrap table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.bl-reqs .tablewrap th { padding: 6px 10px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line);
  font: 500 10.5px/16px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: none; }
.bl-reqs .tablewrap td { padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.bl-reqs .tablewrap tr:last-child td { border-bottom: 0; }
.hash { font-family: var(--font-mono); font-size: 11.5px; }
.hash a, .bl-reqs td a { color: var(--accent); text-underline-offset: 2px; }
.v-green { color: var(--ok); font: 600 11.5px/1 var(--font-mono); letter-spacing: .04em; }
.v-green a { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--ok-soft);
  color: var(--ok); text-decoration: none; }
.v-green a:hover { text-decoration: underline; text-underline-offset: 2px; }
.v-pending { color: var(--muted); font: 400 12px/1 var(--font-mono); }
.v-red { color: var(--danger); font-weight: 600; }
.v-amber { color: var(--warn); }
#formulas { display: flex; flex-direction: column; gap: 6px; }
.formula { padding: 10px 12px; overflow-x: auto; white-space: pre-wrap; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); font: 400 12.5px/1.6 var(--font-mono); color: var(--fg); }

/* the live card: a running agent's terminal and window meter */
.bl-livecard { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; padding: 20px; border-color: var(--accent); }
.bl-livecard h2 { margin: 0; font: 600 18px/1.3 var(--font-sans); }
.tlive { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.tframe { position: relative; overflow: hidden; border-radius: 10px; background: var(--term-bg); border: 1px solid var(--line); }
.tframe iframe { display: block; border: 0; transform-origin: 0 0; background: var(--term-bg); }
.mgrid { display: grid; grid-template-columns: repeat(32, 1fr); gap: 2px; max-width: 640px; margin: 8px 0 12px; }
.mgrid i { aspect-ratio: 1; border-radius: 2px; background: var(--line); }
.mgrid i.f { background: var(--accent); }
.mgrid i.f.due { animation: tcpulse 1s ease-in-out infinite; }
.mgrid i.t { background: repeating-linear-gradient(45deg, var(--muted) 0 2px, transparent 2px 4px); }
@keyframes tcpulse { 50% { opacity: .45; } }
.minfo { font: 400 12.5px/1.5 var(--font-mono); color: var(--fg); }
.mstrip { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.mrow { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.mlab { width: 34px; font: 400 11px/1 var(--font-mono); color: var(--muted); }
.mrow i.w { display: inline-block; width: 11px; height: 11px; border-radius: 2px; background: var(--accent); }
.mrow i.w.vgreen { background: var(--ok); }
.mrow i.w.vamber { background: var(--warn); }
.mrow i.w.vred { background: var(--danger); }
.mrow i.w.vpending, .mrow i.w.vnone, .mrow i.w.verror { background: var(--accent); opacity: .55; }
.mrow i.w.vblock { outline: 2px solid var(--warn); outline-offset: 1px; }
.mrow i.w.est { background: transparent; border: 1px dashed var(--accent); }
.mrow i.w.miss { background: transparent; border: 1px solid var(--muted); }
.mrow i.w.tail { background: transparent; border: 1px dotted var(--muted); }
.mlegend { margin-top: 8px; }

/* the replay player (xterm, vendored): dark in both themes */
.bl-replay { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.bl-replay > .bl-btn { align-self: flex-start; }
.replay-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.replay-bar .bl-btn.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.replay-bar .bl-price { margin-left: auto; }
.replay-screen { overflow: hidden; padding: 6px; border-radius: 10px; background: var(--term-bg); }
.replay-pre { max-height: 520px; overflow: auto; margin: 0; padding: 12px; border-radius: 10px; background: var(--term-bg); color: var(--term-fg);
  font: 400 12px/1.5 var(--font-mono); white-space: pre-wrap; }
