/* ───────────────────────── HARNESS · ai-tech dark theme ───────────────────────── */
:root {
  --bg: #070b14;
  --panel: rgba(148, 163, 214, 0.055);
  --panel-solid: #0d1322;
  --border: rgba(148, 163, 214, 0.14);
  --border-hot: rgba(103, 232, 249, 0.5);
  --text: #e6ecff;
  --muted: #8b96b8;
  --accent-a: #22d3ee;
  --accent-b: #a78bfa;
  --accent-c: #f472b6;
  --grad: linear-gradient(100deg, var(--accent-a), var(--accent-b) 55%, var(--accent-c));
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, monospace;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 "Segoe UI", system-ui, -apple-system, sans-serif;
  overflow: hidden;
}

/* ── backdrop fx ── */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(148,163,214,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,163,214,.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 75%);
}
.bg-glow {
  position: fixed; z-index: 0; pointer-events: none;
  width: 900px; height: 500px; left: 50%; top: -260px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(34,211,238,.14), rgba(167,139,250,.09) 55%, transparent);
  filter: blur(30px);
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 12px; font-weight: 400; }
.error { color: #fb7185; font-size: 13px; }
.spacer { flex: 1; }

/* ── panels ── */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
}

/* ── topbar ── */
.topbar {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 11, 20, .7);
  backdrop-filter: blur(12px);
}
.wordmark {
  font-family: var(--mono);
  font-size: 19px; font-weight: 700; letter-spacing: .12em;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  white-space: nowrap;
}
.tagline { color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }

.mode-switch {
  display: flex; gap: 2px; padding: 3px;
  border: 1px solid var(--border); border-radius: 999px;
  background: rgba(0,0,0,.3);
}
.mode-btn {
  border: 0; background: transparent; color: var(--muted);
  font: 600 13px/1 inherit; padding: 7px 16px; border-radius: 999px; cursor: pointer;
  transition: all .15s;
}
.mode-btn.active { background: var(--grad); color: #06090f; }

.icon-btn {
  border: 1px solid var(--border); background: transparent; color: var(--muted);
  width: 34px; height: 34px; border-radius: 10px; cursor: pointer; font-size: 16px;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-hot); }

/* ── layout ── */
.layout {
  position: relative; z-index: 1;
  display: flex; height: calc(100vh - 59px);
}
.sidebar {
  width: 320px; flex: 0 0 320px;
  padding: 16px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
  border-right: 1px solid var(--border);
}
.sidebar.collapsed { display: none; }
.sidebar .panel { padding: 14px; }
.sidebar h2 {
  margin: 0 0 10px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); display: flex; align-items: center; gap: 8px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 8px var(--accent-a); }

/* ── model cards ── */
.model-list { display: flex; flex-direction: column; gap: 7px; }
.model-list.scroll { max-height: 260px; overflow-y: auto; margin-top: 8px; }
.model-card {
  display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 9px 11px; border-radius: 11px; cursor: pointer;
  border: 1px solid var(--border); background: rgba(0,0,0,.25); color: var(--text);
  transition: border-color .15s, background .15s;
  width: 100%;
}
.model-card:hover { border-color: var(--border-hot); }
.model-card.selected {
  border-color: transparent;
  background:
    linear-gradient(var(--panel-solid), var(--panel-solid)) padding-box,
    var(--grad) border-box;
  box-shadow: 0 0 14px rgba(34, 211, 238, .12);
}
.model-avatar {
  flex: 0 0 30px; width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  font: 700 13px var(--mono); color: #06090f;
  background: var(--grad);
}
.model-card .m-name { font-weight: 600; font-size: 13.5px; line-height: 1.25; }
.model-card .m-sub { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.model-card .m-check { margin-left: auto; color: var(--accent-a); font-size: 15px; visibility: hidden; }
.model-card.selected .m-check { visibility: visible; }
.loading-row { color: var(--muted); font-size: 13px; display: flex; gap: 8px; align-items: center; padding: 6px 2px; }

.all-models summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-top: 10px; }
.all-models summary:hover { color: var(--text); }

/* ── fields ── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.field b { color: var(--accent-a); font-family: var(--mono); }
textarea, input[type="search"], input[type="password"], input[type="text"] {
  background: rgba(0,0,0,.35); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); padding: 9px 11px; font: inherit; font-size: 13.5px;
  outline: none; resize: vertical; width: 100%;
}
textarea:focus, input:focus { border-color: var(--border-hot); }
input[type="range"] { accent-color: var(--accent-b); width: 100%; }

.btn-primary {
  border: 0; border-radius: 10px; cursor: pointer;
  background: var(--grad); color: #06090f; font: 700 14px/1 inherit;
  padding: 10px 18px;
  transition: filter .15s, transform .05s;
}
.btn-primary:hover { filter: brightness(1.12); }
.btn-primary:active { transform: scale(.97); }
.btn-primary:disabled { filter: grayscale(.7) brightness(.6); cursor: not-allowed; }
.btn-ghost {
  border: 1px solid var(--border); background: transparent; color: var(--muted);
  border-radius: 10px; padding: 9px 14px; cursor: pointer; font: 600 13px/1 inherit; width: 100%;
}
.btn-ghost:hover { color: #fb7185; border-color: rgba(251,113,133,.5); }

/* ── main / transcript ── */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.transcript { flex: 1; overflow-y: auto; padding: 26px 26px 10px; scroll-behavior: smooth; }

.empty-state { max-width: 640px; margin: 8vh auto 0; text-align: center; }
.empty-mark {
  font-size: 54px; line-height: 1;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px rgba(167,139,250,.45));
}
.empty-state h1 { font-size: 26px; margin: 18px 0 10px; }
.empty-state p { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 22px; }
.chip {
  border: 1px solid var(--border); background: var(--panel); color: var(--muted);
  border-radius: 999px; padding: 8px 15px; cursor: pointer; font: 500 13px/1.3 inherit;
}
.chip:hover { color: var(--text); border-color: var(--border-hot); }

/* ── turns ── */
.turn { max-width: 980px; margin: 0 auto 22px; }
.turn-user {
  display: flex; justify-content: flex-end;
}
.turn-user .bubble {
  background: linear-gradient(120deg, rgba(34,211,238,.16), rgba(167,139,250,.16));
  border: 1px solid rgba(167,139,250,.35);
  border-radius: 16px 16px 4px 16px;
  padding: 11px 16px; max-width: 78%; white-space: pre-wrap; overflow-wrap: break-word;
}
.responses { display: grid; gap: 12px; margin-top: 12px; }
.responses.cols-2 { grid-template-columns: 1fr 1fr; }
.responses.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

.response { padding: 0; overflow: hidden; min-width: 0; }
.response-head {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 14px; border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,.25);
  font-family: var(--mono); font-size: 12px;
}
.response-head .m-id { font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent-a);
  box-shadow: 0 0 8px var(--accent-a); animation: pulse 1.1s infinite;
}
.live-dot.done { background: #34d399; box-shadow: none; animation: none; }
.live-dot.err { background: #fb7185; box-shadow: none; animation: none; }
@keyframes pulse { 50% { opacity: .35; } }

.response-body { padding: 13px 16px; overflow-wrap: break-word; min-height: 34px; }
.response-body .cursor {
  display: inline-block; width: 8px; height: 15px; margin-left: 2px; vertical-align: -2px;
  background: var(--accent-a); animation: pulse .8s infinite;
}
.response-stats {
  display: flex; flex-wrap: wrap; gap: 14px;
  padding: 8px 14px; border-top: 1px solid var(--border);
  font-family: var(--mono); font-size: 11px; color: var(--muted);
}
.response-stats b { color: var(--accent-a); font-weight: 600; }

/* markdown-ish rendering */
.response-body p { margin: 0 0 10px; }
.response-body p:last-child { margin-bottom: 0; }
.response-body h1, .response-body h2, .response-body h3 { font-size: 15.5px; margin: 14px 0 6px; }
.response-body ul, .response-body ol { margin: 6px 0 10px; padding-left: 22px; }
.response-body li { margin: 3px 0; }
.response-body code {
  font-family: var(--mono); font-size: 12.5px;
  background: rgba(34,211,238,.1); border: 1px solid rgba(34,211,238,.18);
  padding: 1px 5px; border-radius: 5px;
}
.response-body pre {
  background: #060a12; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; overflow-x: auto; margin: 10px 0;
}
.response-body pre code { background: none; border: 0; padding: 0; font-size: 12.5px; }
.response-body blockquote {
  margin: 8px 0; padding: 4px 14px; border-left: 3px solid var(--accent-b); color: var(--muted);
}
.response-body a { color: var(--accent-a); }

/* ── composer ── */
.composer { padding: 10px 26px 8px; max-width: 1030px; margin: 0 auto; width: 100%; }
.composer-inner {
  display: flex; align-items: flex-end; gap: 10px; padding: 10px 12px;
  border-color: var(--border);
}
.composer-inner:focus-within { border-color: var(--border-hot); box-shadow: 0 0 20px rgba(34,211,238,.08); }
.composer textarea {
  flex: 1; border: 0; background: transparent; padding: 6px 4px; max-height: 180px;
  resize: none;
}
.composer textarea:focus { border: 0; }
.btn-primary.send { border-radius: 11px; padding: 10px 16px; font-size: 15px; }
.btn-stop {
  border: 1px solid rgba(251,113,133,.5); background: rgba(251,113,133,.12); color: #fb7185;
  border-radius: 11px; padding: 10px 14px; cursor: pointer; font-size: 13px;
}
.composer-meta { display: flex; justify-content: space-between; gap: 12px; padding: 7px 6px 0; flex-wrap: wrap; }

/* ── generated media in responses ── */
.gen-media { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.gen-media img {
  max-width: 100%; border-radius: 10px; border: 1px solid var(--border);
  background: #060a12;
}
.gen-media audio, .gen-media video { width: 100%; border-radius: 10px; }

/* ── composer attachments ── */
.icon-btn.attach { flex: 0 0 auto; align-self: flex-end; margin-bottom: 2px; font-size: 14px; }
.attach-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 7px; }
.attach-chips:empty { display: none; }
.attach-chip {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--panel);
  padding: 4px 8px; font: 11px var(--mono); color: var(--muted); max-width: 220px;
}
.attach-chip img { width: 26px; height: 26px; object-fit: cover; border-radius: 5px; }
.attach-chip .a-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-chip button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 12px; padding: 0; }
.attach-chip button:hover { color: #fb7185; }
.bubble .b-atts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bubble .b-atts img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.bubble .b-atts .b-file { font: 11px var(--mono); color: var(--muted); border: 1px solid var(--border); border-radius: 7px; padding: 4px 8px; }

/* modality badges on model cards */
.m-mods { margin-left: 4px; font-size: 11px; }

/* ── gate ── */
.gate {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: rgba(4, 6, 12, .88); backdrop-filter: blur(8px);
}
.gate-card { width: min(92vw, 380px); padding: 30px; text-align: center; display: flex; flex-direction: column; gap: 14px; }

/* ── spinner ── */
.spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--accent-a);
  animation: spin .8s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── mode-scoped visibility (body[data-mode] set by app.js) ──
   .agent-only = agent-family panels (agent + code); heroes are per-mode;
   .chat-only = playground-mode elements. */
.agent-only, .chat-only, .agent-hero, .code-hero { display: none; }
body[data-mode="agent"] .agent-only, body[data-mode="code"] .agent-only { display: block; }
body[data-mode="agent"] .agent-hero { display: block; }
body[data-mode="agent"] button.agent-hero { display: inline-block; }
body[data-mode="code"] .code-hero { display: block; }
body[data-mode="code"] button.code-hero { display: inline-block; }
body[data-mode="playground"] .chat-only { display: block; }
body[data-mode="playground"] button.chat-only { display: inline-block; }
label.chat-only { display: none; }
body[data-mode="playground"] label.chat-only { display: flex; }
body[data-mode="agent"] label.switch-row, body[data-mode="code"] label.switch-row { display: flex; }

/* ── project panel ── */
.proj-row { display: flex; gap: 8px; align-items: center; }
.proj-row select, .proj-row input[type="text"] { flex: 1; min-width: 0; }
.proj-row .code-btn { flex: 0 0 auto; padding: 8px 12px; }
.budget-bar {
  height: 7px; border-radius: 99px; background: rgba(148,163,214,.12);
  overflow: hidden; margin: 12px 0 8px;
}
.budget-bar i { display: block; height: 100%; width: 0; background: var(--grad); border-radius: 99px; transition: width .4s; }
.budget-bar i.over { background: linear-gradient(90deg, #fb7185, #f43f5e); }
.proj-budget { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cap-label { display: flex; align-items: center; gap: 3px; font-family: var(--mono); }
.cap-label input {
  width: 64px; padding: 4px 7px; font: 12px var(--mono);
  background: rgba(0,0,0,.35); border: 1px solid var(--border); border-radius: 7px; color: var(--text);
}
.proj-memory { margin-top: 10px; }
.proj-memory summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.proj-memory summary:hover { color: var(--text); }
.mem-list { display: flex; flex-direction: column; gap: 5px; margin: 8px 0; max-height: 170px; overflow-y: auto; }
.mem-note {
  display: flex; gap: 8px; align-items: baseline;
  font-size: 12px; color: var(--muted); line-height: 1.4;
  padding: 6px 9px; border: 1px solid var(--border); border-radius: 8px; background: rgba(0,0,0,.25);
}
.mem-note .m-text { flex: 1; overflow-wrap: break-word; min-width: 0; }
.mem-note .m-del { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 12px; padding: 0; }
.mem-note .m-del:hover { color: #fb7185; }
.proj-memory #memForm { margin-top: 4px; }
.proj-memory #memForm input { font-size: 12px; padding: 7px 9px; }

/* remembered-note chip in the agent flow */
.mem-chip {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 12px; max-width: 100%;
  border: 1px solid rgba(167,139,250,.4); border-radius: 999px; padding: 6px 14px;
  background: rgba(167,139,250,.1); color: var(--accent-b);
}
.mem-chip .note { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* history entries loaded from a project */
.turn.history { opacity: .82; }
.history-tag {
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 6px;
}

select {
  background: rgba(0,0,0,.35); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); padding: 9px 11px; font: inherit; font-size: 13.5px; width: 100%;
  outline: none;
}
select:focus { border-color: var(--border-hot); }
select option { background: var(--panel-solid); }

/* ── tools list ── */
.tools-list { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.tool-row { display: flex; align-items: baseline; gap: 8px; color: var(--muted); }
.tool-row .t-name { font-family: var(--mono); color: var(--text); font-size: 12px; white-space: nowrap; }
.tool-row .t-dot { width: 6px; height: 6px; border-radius: 50%; background: #34d399; flex: 0 0 6px; align-self: center; }
.tool-row .t-desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── agent timeline ── */
.agent-flow {
  margin-top: 14px; padding-left: 20px; position: relative;
  display: flex; flex-direction: column; gap: 12px;
}
.agent-flow::before {
  content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px;
  background: linear-gradient(180deg, var(--accent-a), var(--accent-b), transparent);
  opacity: .45;
}
.flow-item { position: relative; }
.flow-item::before {
  content: ""; position: absolute; left: -19px; top: 9px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--panel-solid); border: 2px solid var(--accent-b);
}
.flow-item.narration { color: var(--muted); font-size: 14px; }
.flow-item.narration .response-body { padding: 2px 0; }
.flow-item.narration::before { border-color: var(--accent-a); }

.delegation .response-head .m-role {
  margin-left: auto; color: var(--accent-b); letter-spacing: .08em; text-transform: uppercase; font-size: 10px;
}
.delegation .d-instructions {
  padding: 8px 14px; font-size: 12px; color: var(--muted); border-bottom: 1px dashed var(--border);
  font-family: var(--mono); white-space: pre-wrap;
}
.eval-chip {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 12px;
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px;
  background: rgba(0,0,0,.3); color: var(--muted); max-width: 100%;
}
.eval-chip .score { font-weight: 700; }
.eval-chip.good .score { color: #34d399; }
.eval-chip.mid .score { color: #fbbf24; }
.eval-chip.bad .score { color: #fb7185; }
.eval-chip .decision { text-transform: uppercase; letter-spacing: .08em; font-size: 10px; }
.eval-chip.bad .decision, .eval-chip.mid .decision { color: #fbbf24; }
.eval-chip .critique { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.toolcard { font-size: 12.5px; }
.toolcard summary {
  cursor: pointer; padding: 9px 14px; font-family: var(--mono); font-size: 12px;
  display: flex; align-items: center; gap: 9px; list-style: none;
}
.toolcard summary::-webkit-details-marker { display: none; }
.toolcard .t-body { padding: 8px 14px 12px; color: var(--muted); font-family: var(--mono); font-size: 11.5px; white-space: pre-wrap; overflow-wrap: break-word; max-height: 200px; overflow-y: auto; }
.tool-badge { color: var(--accent-a); }
.tool-badge.err { color: #fb7185; }

.final-card {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--panel-solid), var(--panel-solid)) padding-box,
    var(--grad) border-box;
  border-radius: var(--radius);
  box-shadow: 0 0 30px rgba(167,139,250,.14);
}
.final-card .response-head { background: rgba(167,139,250,.08); }
.final-card .response-head .m-id { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.flow-item.final-item::before { background: var(--accent-c); border-color: var(--accent-c); }

.agent-summary {
  font-family: var(--mono); font-size: 11.5px; color: var(--muted);
  display: flex; gap: 16px; flex-wrap: wrap; padding: 4px 2px;
}
.agent-summary b { color: var(--accent-a); font-weight: 600; }

/* ── Allanon's Choice toggle ── */
.switch-row {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 12px; color: var(--muted); line-height: 1.45;
  padding: 8px 10px; margin-bottom: 10px;
  border: 1px solid var(--border); border-radius: 10px; background: rgba(0,0,0,.25);
  cursor: pointer;
}
.switch-row b { color: var(--text); }
.switch-row input { accent-color: var(--accent-b); margin-top: 2px; flex: 0 0 auto; }
.switch-row:has(input:checked) {
  border-color: transparent;
  background:
    linear-gradient(var(--panel-solid), var(--panel-solid)) padding-box,
    var(--grad) border-box;
}
#modelPickers.dimmed { opacity: .35; pointer-events: none; filter: saturate(.4); }

.btn-ghost.cool:hover { color: var(--accent-a); border-color: rgba(34,211,238,.5); }

/* ── ledger overlay ── */
.ledger-card {
  width: min(94vw, 680px); max-height: 84vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.ledger-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.ledger-body { overflow-y: auto; padding: 14px 18px 20px; }
.ledger-cat {
  font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent-a); margin: 16px 0 8px;
}
.ledger-cat:first-child { margin-top: 2px; }
.ledger-row {
  display: grid; grid-template-columns: 26px 1fr 90px 54px 46px; gap: 10px; align-items: center;
  padding: 6px 4px; border-bottom: 1px solid rgba(148,163,214,.07);
  font-size: 12.5px;
}
.ledger-row .rank { font-family: var(--mono); color: var(--muted); font-size: 11px; }
.ledger-row .rank.gold { color: #fbbf24; }
.ledger-row .lr-model { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger-row .lr-model .sub { color: var(--muted); font-family: var(--mono); font-size: 10.5px; }
.lr-bar { height: 7px; border-radius: 99px; background: rgba(148,163,214,.12); overflow: hidden; }
.lr-bar i { display: block; height: 100%; background: var(--grad); border-radius: 99px; }
.lr-score { font-family: var(--mono); font-size: 12px; color: var(--accent-a); text-align: right; }
.lr-n { font-family: var(--mono); font-size: 10.5px; color: var(--muted); text-align: right; }
.ledger-recent { margin-top: 20px; }
.ledger-verdict {
  display: flex; gap: 10px; align-items: baseline;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  padding: 4px 0; border-bottom: 1px solid rgba(148,163,214,.06);
}
.ledger-verdict .v-score { flex: 0 0 38px; font-weight: 700; }
.ledger-verdict .v-score.good { color: #34d399; }
.ledger-verdict .v-score.mid { color: #fbbf24; }
.ledger-verdict .v-score.bad { color: #fb7185; }
.ledger-verdict .v-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger-empty { color: var(--muted); text-align: center; padding: 30px 10px; }

/* ── code-block toolbar (copy / open in workbench) ── */
.code-toolbar {
  display: flex; align-items: center; gap: 8px;
  margin: 10px 0 -6px;
  font-family: var(--mono); font-size: 10.5px;
}
.code-lang { color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.code-btn {
  border: 1px solid var(--border); background: rgba(0,0,0,.3); color: var(--muted);
  border-radius: 7px; padding: 3px 10px; cursor: pointer;
  font: 600 11px var(--mono); letter-spacing: .04em;
  transition: color .15s, border-color .15s;
}
.code-btn:hover { color: var(--text); border-color: var(--border-hot); }
.code-btn.accent { color: var(--accent-a); border-color: rgba(34,211,238,.4); }
.code-btn.accent:hover { color: #06090f; background: var(--grad); border-color: transparent; }

/* ── workbench (code + preview) ── */
.workbench {
  flex: 0 0 46%; min-width: 400px; max-width: 720px;
  display: flex; flex-direction: column;
  border-left: 1px solid var(--border);
  background: rgba(5, 8, 15, .75); backdrop-filter: blur(12px);
}
.wb-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.wb-title {
  font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .06em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 30%;
}
.wb-tabs {
  display: flex; gap: 2px; padding: 2px;
  border: 1px solid var(--border); border-radius: 999px; background: rgba(0,0,0,.3);
}
.wb-tab {
  border: 0; background: transparent; color: var(--muted);
  font: 600 11.5px var(--mono); padding: 5px 13px; border-radius: 999px; cursor: pointer;
}
.workbench[data-tab="code"] .wb-tab[data-tab="code"],
.workbench[data-tab="preview"] .wb-tab[data-tab="preview"] { background: var(--grad); color: #06090f; }

.wb-body { flex: 1; display: flex; min-height: 0; position: relative; }
.wb-code {
  flex: 1; border: 0; border-radius: 0; resize: none;
  background: #060a12; color: var(--text);
  font: 12.5px/1.55 var(--mono); padding: 14px 16px;
  white-space: pre; overflow: auto; tab-size: 2;
}
.wb-code:focus { border: 0; outline: none; }
.wb-preview { flex: 1; display: none; flex-direction: column; min-width: 0; background: #fff; }
.workbench[data-tab="preview"] .wb-preview { display: flex; }
.workbench[data-tab="preview"] .wb-code { display: none; }
.wb-preview iframe { flex: 1; border: 0; width: 100%; background: #fff; }
.wb-console {
  flex: 0 0 auto; max-height: 130px; overflow-y: auto;
  background: #060a12; border-top: 1px solid var(--border);
  font: 11px/1.5 var(--mono); padding: 6px 12px;
}
.wb-console .c-line { color: var(--muted); white-space: pre-wrap; overflow-wrap: break-word; }
.wb-console .c-line.error { color: #fb7185; }
.wb-console .c-line.warn { color: #fbbf24; }
.wb-console .c-line::before { content: "▸ "; color: var(--accent-a); }

@media (max-width: 1100px) {
  .workbench {
    position: fixed; z-index: 30; top: 59px; right: 0; bottom: 0;
    width: min(96vw, 560px); min-width: 0; max-width: none;
    box-shadow: -14px 0 44px rgba(0,0,0,.65);
  }
}

/* ── scrollbars ── */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(148,163,214,.18); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148,163,214,.32); }

/* ── responsive ── */
@media (max-width: 960px) {
  .responses.cols-2, .responses.cols-3 { grid-template-columns: 1fr; }
  .tagline { display: none; }
}
@media (max-width: 760px) {
  .sidebar {
    position: fixed; z-index: 20; top: 59px; bottom: 0; left: 0;
    background: var(--bg); width: min(86vw, 330px);
    box-shadow: 12px 0 40px rgba(0,0,0,.6);
  }
  .transcript { padding: 16px 12px 6px; }
  .composer { padding: 8px 12px 6px; }
}
