/* Agentic Ontology Notebook Lab — light enterprise theme (starter DESIGN.md tokens + layer colours) */
:root {
  --font-sans: "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;
  --bg-primary: #ffffff; --bg-secondary: #f5f5f7; --bg-tertiary: #e8e8ed; --bg-glass: rgba(255,255,255,.88);
  --text: #1d1d1f; --muted: #6e6e73; --faint: #86868b;
  --accent: #0071e3; --accent-soft: rgba(0,113,227,.08);
  --pass: #16a34a; --warn: #d97706; --fail: #dc2626;
  --border: rgba(0,0,0,.08); --border-strong: rgba(0,0,0,.14);
  --r-sm: 10px; --r-md: 16px; --r-pill: 980px;
  --c-source: #94a3b8; --c-wiki: #0ea5e9; --c-semantic: #8b5cf6; --c-workflow: #f59e0b; --c-mcp: #10b981; --c-agent: #ef4444;
  --sidebar-w: 268px; --topbar-h: 52px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--font-sans); color: var(--text); background: var(--bg-secondary); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; padding-top: var(--topbar-h); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: var(--font-mono); }
code { font-size: 12.5px; background: rgba(0,0,0,.045); padding: 1px 5px; border-radius: 5px; }
pre { margin: 0; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.01em; }

/* ---------------------------------------------------------------- top bar (fixed) */
.topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 40; height: var(--topbar-h); display: flex; align-items: center; gap: 14px; padding: 0 18px;
  background: var(--bg-glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; white-space: nowrap; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand .glogo { width: 22px; height: 22px; fill: currentColor; flex: none; }
.brand small { font-weight: 500; color: var(--muted); font-size: 12px; }
.topbar .spacer { flex: 1 1 0; min-width: 8px; }
/* GOAL-260: topbar responsive — brand/chips shrink with ellipsis instead of being clipped off-screen */
.topbar { min-width: 0; overflow: hidden; }
.topbar [hidden], .chip[hidden] { display: none !important; }
.brand { min-width: 0; flex: 0 1 auto; overflow: hidden; }
.brand-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .chip { flex: 0 1 auto; min-width: 0; max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
.topbar .chip b { overflow: hidden; text-overflow: ellipsis; }
#chip-project { min-width: 170px; }
.topbar .lang-toggle { flex: none; }
@media (max-width: 1360px) { .brand small { display: none; } }
@media (max-width: 1180px) { .topbar { gap: 8px; padding: 0 12px; } #chip-model { display: none; } }
@media (max-width: 960px) { #chip-project { display: none; } .brand-name { font-size: 14px; } }
@media (max-width: 600px) { .brand-t { display: none; } }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pill); border: 1px solid var(--border); background: #fff; font-size: 12px; color: var(--muted); white-space: nowrap; }
.chip b { color: var(--text); font-weight: 600; }
.chip.click { cursor: pointer; }
.chip.click:hover { border-color: var(--border-strong); }
.lang-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: var(--r-pill); background: #fff; padding: 2px; gap: 2px; }
.lang-toggle button { border: 0; background: transparent; font: inherit; font-size: 11px; font-weight: 600; letter-spacing: .02em; color: var(--muted); padding: 2px 9px; border-radius: var(--r-pill); cursor: pointer; }
.lang-toggle button:hover { color: var(--text); }
.lang-toggle button.on { background: #0071e3; color: #fff; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bg-tertiary); display: inline-block; flex: none; }
.dot.ready { background: var(--pass); } .dot.creating, .dot.deleting, .dot.running { background: var(--warn); animation: pulse 1.1s infinite; }
.dot.error { background: var(--fail); } .dot.deleted, .dot.none { background: #c7c7cc; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------------------------------------------------------------- layout */
.layout { display: flex; min-height: calc(100vh - var(--topbar-h)); }
.sidebar { width: var(--sidebar-w); flex: none; position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto;
  border-right: 1px solid var(--border); background: #fbfbfd; padding: 14px 12px 24px; }
.side-label { font-size: 11px; font-weight: 700; color: var(--faint); letter-spacing: .06em; text-transform: uppercase; margin: 6px 8px 8px; }
.side-label .side-prog { float: right; font-weight: 600; color: var(--muted); letter-spacing: 0; text-transform: none; }
.nb-link { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 12px; color: var(--text); cursor: pointer; margin-bottom: 2px; border: 1px solid transparent; }
.nb-link:hover { background: #fff; border-color: var(--border); text-decoration: none; }
.nb-link.active { background: #fff; border-color: var(--border-strong); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.nb-num { width: 24px; height: 24px; border-radius: 8px; background: var(--bg-tertiary); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.nb-link.active .nb-num { background: var(--text); color: #fff; }
.nb-link.done .nb-num { background: var(--pass); color: #fff; }
.nb-title { font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.nb-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.nb-progress { height: 3px; border-radius: 3px; background: var(--bg-tertiary); margin-top: 6px; overflow: hidden; }
.nb-progress i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s; }
.session-box { margin-top: 16px; padding: 12px; border-radius: 14px; background: #fff; border: 1px solid var(--border); font-size: 12px; }
.session-box .row { display: flex; align-items: center; gap: 8px; margin: 5px 0; color: var(--muted); }
.session-box .row b { color: var(--text); font-weight: 600; }
.session-box .sid { font-family: var(--font-mono); font-size: 13px; color: var(--text); font-weight: 700; }
main { flex: 1; min-width: 0; padding: 24px 28px 80px; }
.page { max-width: 1180px; margin: 0 auto; }

/* ---------------------------------------------------------------- notebook header */
.nb-header { background: #fff; border: 1px solid var(--border); border-radius: var(--r-md); padding: 20px 22px; margin-bottom: 18px; }
.nb-header .eyebrow { font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: .02em; }
.nb-header h1 { font-size: 22px; margin: 4px 0 6px; }
.nb-header p { margin: 0; color: var(--muted); }
.io { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.io .arrow { color: var(--faint); }
.layer-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: var(--r-pill); border: 1px solid var(--border); background: #fff; }
.layer-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--lc, #999); }
.core-chip { font-family: var(--font-mono); font-size: 11.5px; padding: 2px 8px; border-radius: 6px; background: rgba(16,185,129,.09); color: #047857; border: 1px solid rgba(16,185,129,.25); }

/* ---------------------------------------------------------------- cells */
.cell { display: flex; gap: 0; background: #fff; border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: 14px; overflow: hidden; }
.cell.locked { opacity: .92; }
.cell-gutter { width: 64px; flex: none; padding: 16px 0 0; text-align: center; font-family: var(--font-mono); font-size: 12px; color: var(--faint); background: #fbfbfd; border-right: 1px solid var(--border); }
.cell-gutter .num { font-weight: 700; color: var(--text); font-size: 13px; }
.cell-gutter .exec { margin-top: 4px; }
.cell-body { flex: 1; min-width: 0; padding: 14px 18px 16px; }
.cell-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cell-head h3 { font-size: 15.5px; font-weight: 700; }
.kind-tag { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--bg-secondary); color: var(--muted); border: 1px solid var(--border); }
.kind-tag.run { color: #1d4ed8; background: rgba(29,78,216,.06); border-color: rgba(29,78,216,.18); }
.kind-tag.prompt { color: #7c3aed; background: rgba(124,58,237,.06); border-color: rgba(124,58,237,.2); }
/* GOAL-274: side checks (environment / MCP · Gate 0 · doc types) run by themselves and stay folded */
.kind-tag.auto { color: #475569; background: rgba(71,85,105,.06); border-color: rgba(71,85,105,.18); }
.cell.auto-cell .cell-head h3 { color: var(--muted); font-weight: 600; }
.auto-body > summary { cursor: pointer; font-size: 12px; color: var(--muted); margin-top: 6px; list-style: none; }
.auto-body > summary::before { content: "▸ "; }
.auto-body[open] > summary::before { content: "▾ "; }
.status-chip { margin-left: auto; font-size: 12px; padding: 2px 10px; border-radius: var(--r-pill); background: var(--bg-secondary); color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.status-chip.done { background: rgba(22,163,74,.09); color: #15803d; }
.status-chip.error { background: rgba(220,38,38,.08); color: #b91c1c; }
.status-chip.running { background: rgba(217,119,6,.1); color: #b45309; }
.status-chip.stale { background: rgba(217,119,6,.1); color: #b45309; }
.cell-desc { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.uses { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.use { font-size: 11.5px; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--border); background: #fafafa; color: var(--muted); }
.use b { color: var(--text); font-weight: 600; }
.use.live { border-color: rgba(16,185,129,.4); background: rgba(16,185,129,.07); color: #047857; }
.use.core { border-color: rgba(16,185,129,.25); background: #fff; color: #047857; font-family: var(--font-mono); }
.explain { font-size: 14px; }
.explain table { border-collapse: collapse; margin: 8px 0; font-size: 13px; }
.explain th, .explain td { border: 1px solid var(--border); padding: 5px 10px; text-align: left; }
.explain th { background: var(--bg-secondary); }
.explain blockquote { margin: 8px 0; padding: 6px 12px; border-left: 3px solid var(--c-mcp); background: rgba(16,185,129,.05); color: var(--muted); }
.explain p { margin: 6px 0; }
.explain ul, .explain ol { margin: 6px 0; padding-left: 20px; }

/* prompt editor */
.prompt-box { margin-top: 12px; border: 1px solid rgba(124,58,237,.22); border-radius: 12px; background: rgba(124,58,237,.025); }
.prompt-box > summary, .fixed > summary { cursor: pointer; padding: 9px 12px; font-size: 12.5px; font-weight: 700; color: #6d28d9; list-style: none; display: flex; gap: 8px; align-items: center; }
.prompt-box > summary::-webkit-details-marker, .fixed > summary::-webkit-details-marker { display: none; }
.prompt-box > summary::before, .fixed > summary::before { content: "▸"; font-size: 11px; transition: transform .15s; }
.prompt-box[open] > summary::before, .fixed[open] > summary::before { transform: rotate(90deg); }
.prompt-box .inner { padding: 0 12px 12px; }
.prompt-box textarea { width: 100%; min-height: 150px; resize: vertical; border: 1px solid var(--border-strong); border-radius: 10px; padding: 10px 12px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6; color: var(--text); background: #fff; }
.prompt-box textarea:focus { outline: 2px solid rgba(124,58,237,.35); border-color: transparent; }
.prompt-tools { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.prompt-tools .edited { color: #6d28d9; font-weight: 600; }
.fixed { margin-top: 8px; border: 1px dashed var(--border-strong); border-radius: 10px; background: #fff; }
.fixed > summary { color: var(--muted); font-weight: 600; }
.fixed .inner { padding: 0 12px 10px; font-size: 12.5px; color: var(--muted); }
.fixed pre { white-space: pre-wrap; font-size: 11.5px; background: var(--bg-secondary); padding: 8px 10px; border-radius: 8px; color: #334155; max-height: 260px; overflow: auto; }

/* params */
.params { margin-top: 12px; display: grid; gap: 8px; }
.params label { font-size: 12px; font-weight: 600; color: var(--muted); }
.params select, .params input[type=text], .params textarea.q { width: 100%; border: 1px solid var(--border-strong); border-radius: 10px; padding: 8px 10px; font-family: var(--font-sans); font-size: 13.5px; background: #fff; }
.params textarea.q { min-height: 54px; resize: vertical; }
.check-row { display: flex; align-items: flex-start; gap: 8px; padding: 6px 8px; border-radius: 8px; font-size: 13px; }
.check-row:hover { background: var(--bg-secondary); }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }

/* actions */
.cell-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.btn { border: 1px solid var(--border-strong); background: #fff; color: var(--text); border-radius: var(--r-pill); padding: 6px 14px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: var(--font-sans); display: inline-flex; gap: 6px; align-items: center; }
.btn:hover { border-color: rgba(0,0,0,.28); }
.btn.primary { background: var(--text); color: #fff; border-color: var(--text); }
.btn.primary:hover { background: #000; }
.btn.danger { color: var(--fail); border-color: rgba(220,38,38,.35); }
.btn.small { padding: 3px 10px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.prereq { font-size: 12px; color: var(--warn); }
.hint { font-size: 12px; color: var(--muted); }

/* execution timeline */
.exec { margin-top: 12px; border: 1px solid var(--border); border-radius: 12px; background: #fcfcfd; }
.exec-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border); cursor: pointer; }
.exec-head b { color: var(--text); }
.exec-head .stats { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.exec-body { max-height: 360px; overflow-y: auto; padding: 6px 0; }
.exec.collapsed .exec-body { display: none; }
.ev { display: grid; grid-template-columns: 14px 1fr auto; gap: 8px; padding: 5px 12px; font-size: 12.5px; align-items: start; }
.ev:hover { background: rgba(0,0,0,.02); }
.ev-t { font-family: var(--font-mono); font-size: 11px; color: var(--faint); }
.ev-ico { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; background: var(--lc, #cbd5e1); }
.ev-ico.log { background: transparent; border: 1.5px solid #cbd5e1; }
.ev-ico.warn { border-color: var(--warn); } .ev-ico.error { background: var(--fail); }
.ev-main b { font-weight: 600; }
.ev-sum { color: var(--muted); }
.ev-meta { color: var(--faint); font-size: 11.5px; margin-top: 1px; word-break: break-all; }
.ev-meta code { font-size: 11px; }
.ev-ms { font-family: var(--font-mono); font-size: 11px; color: var(--muted); white-space: nowrap; text-align: right; padding-top: 2px; }
.ev-ms b { font-weight: 600; color: var(--ink, #1d1d1f); }
.ev.running .ev-ico { animation: pulse 1s infinite; }
.ev.err .ev-sum { color: var(--fail); }
.mcp-badge { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 5px; margin-left: 6px; background: var(--bg-secondary); color: var(--muted); border: 1px solid var(--border); vertical-align: 1px; }
.mcp-badge.live { background: rgba(16,185,129,.12); color: #047857; border-color: rgba(16,185,129,.35); }
.mcp-badge.equiv { background: rgba(14,165,233,.08); color: #0369a1; border-color: rgba(14,165,233,.3); }
.mcp-badge.code { background: rgba(139,92,246,.08); color: #6d28d9; border-color: rgba(139,92,246,.28); }
.progress-bar { height: 4px; background: var(--bg-tertiary); }
.progress-bar i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.link-btn { border: none; background: none; color: var(--accent); cursor: pointer; font-size: 11.5px; padding: 0; font-family: var(--font-sans); }

/* output */
.output { margin-top: 14px; }
.output:empty { display: none; }
.err-box { border: 1px solid rgba(220,38,38,.3); background: rgba(220,38,38,.04); border-radius: 12px; padding: 12px 14px; color: #991b1b; font-size: 13px; }
.err-box .hint { color: #7f1d1d; margin-top: 4px; }
.ok-box { border: 1px solid rgba(22,163,74,.3); background: rgba(22,163,74,.05); border-radius: 12px; padding: 10px 14px; font-size: 13px; color: #166534; }
.warn-box { border: 1px solid rgba(217,119,6,.35); background: rgba(217,119,6,.05); border-radius: 12px; padding: 10px 14px; font-size: 13px; color: #92400e; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .grid3, .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.card { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: #fff; min-width: 0; }
.card h4 { font-size: 13.5px; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card .sub { font-size: 12px; color: var(--muted); }
.card .sub code { overflow-wrap: anywhere; word-break: break-all; }
.vsum { cursor: pointer; white-space: nowrap; }
.kpi { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.kpi small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.tag { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-secondary); color: var(--muted); white-space: nowrap; }
.tag.doc { background: rgba(14,165,233,.08); color: #0369a1; border-color: rgba(14,165,233,.3); }
.tag.data { background: rgba(100,116,139,.1); color: #334155; border-color: rgba(100,116,139,.3); }
.tag.hybrid { background: rgba(139,92,246,.09); color: #6d28d9; border-color: rgba(139,92,246,.3); }
.tag.ok, .tag.correct { background: rgba(22,163,74,.1); color: #15803d; border-color: rgba(22,163,74,.3); }
.tag.partial, .tag.warn { background: rgba(217,119,6,.1); color: #b45309; border-color: rgba(217,119,6,.3); }
.tag.fail, .tag.incorrect { background: rgba(220,38,38,.08); color: #b91c1c; border-color: rgba(220,38,38,.3); }
.tag.verified { background: rgba(22,163,74,.08); color: #15803d; border-color: rgba(22,163,74,.25); }
.tag.unverified { background: rgba(217,119,6,.08); color: #b45309; border-color: rgba(217,119,6,.25); }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; margin-top: 8px; }
table.tbl { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.tbl th { background: var(--bg-secondary); text-align: left; font-weight: 600; color: #3a3a3c; padding: 6px 9px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 6px 9px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl tr:last-child td { border-bottom: none; }
.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); font-size: 12px; }
.tbl td.muted { color: var(--muted); }
.code { background: #0f172a08; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-family: var(--font-mono); font-size: 12px; white-space: pre-wrap; word-break: break-word; color: #1e293b; max-height: 420px; overflow: auto; }
.code.gql { border-left: 3px solid var(--c-semantic); }
.answer { border: 1px solid var(--border); border-left: 4px solid var(--c-agent); border-radius: 12px; padding: 12px 16px; background: #fff; font-size: 14px; }
.answer .q { color: var(--muted); font-size: 12.5px; margin-bottom: 6px; }
.answer .a { white-space: pre-wrap; }
.ref-chip { display: inline-flex; font-family: var(--font-mono); font-size: 11.5px; padding: 1px 7px; border-radius: 6px; margin: 2px 4px 2px 0; border: 1px solid rgba(14,165,233,.35); color: #0369a1; background: rgba(14,165,233,.06); }
.ref-chip.con { border-color: rgba(139,92,246,.35); color: #6d28d9; background: rgba(139,92,246,.06); }
.ref-chip.graph { border-color: rgba(100,116,139,.35); color: #334155; background: rgba(100,116,139,.06); }
.section-title { font-size: 12px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; margin: 14px 0 6px; }
details.fold { border: 1px solid var(--border); border-radius: 10px; margin-top: 8px; background: #fff; }
details.fold > summary { cursor: pointer; padding: 8px 12px; font-size: 12.5px; font-weight: 600; }
details.fold > .inner { padding: 0 12px 12px; }
.wiki-browser { display: grid; grid-template-columns: 260px 1fr; gap: 12px; margin-top: 10px; min-height: 360px; }
.wiki-list { border: 1px solid var(--border); border-radius: 12px; overflow-y: auto; max-height: 560px; }
.wiki-list .grp { font-size: 11px; font-weight: 700; color: var(--faint); padding: 8px 10px 4px; text-transform: uppercase; }
.wiki-item { padding: 6px 10px; cursor: pointer; font-size: 12.5px; border-left: 3px solid transparent; }
.wiki-item:hover { background: var(--bg-secondary); }
.wiki-item.active { background: var(--accent-soft); border-left-color: var(--accent); }
.wiki-item code { font-size: 11px; }
.wiki-view { border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; overflow: auto; max-height: 560px; }
.wiki-view h1 { font-size: 17px; margin-bottom: 8px; } .wiki-view h2 { font-size: 14px; margin: 14px 0 6px; }
.wiki-view table { border-collapse: collapse; font-size: 12.5px; } .wiki-view td, .wiki-view th { border: 1px solid var(--border); padding: 4px 8px; }
.fm { font-size: 11.5px; background: var(--bg-secondary); border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; color: #475569; }
.viz { height: 440px; border: 1px solid var(--border); border-radius: 12px; background: #fff; margin-top: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend span { display: inline-flex; gap: 5px; align-items: center; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.bar { height: 8px; border-radius: 4px; background: var(--bg-tertiary); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px; }
.step { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-top: 8px; background: #fff; }
.step-head { display: flex; gap: 8px; align-items: center; font-size: 12.5px; }
.step-n { font-family: var(--font-mono); font-weight: 700; font-size: 11.5px; background: var(--bg-secondary); border-radius: 6px; padding: 1px 6px; }
.step .thought { color: var(--muted); font-size: 12.5px; margin: 4px 0 6px; }

/* overview */
.hero { background: radial-gradient(1200px 300px at 10% -20%, rgba(14,165,233,.12), transparent), radial-gradient(900px 300px at 90% -30%, rgba(139,92,246,.12), transparent), #fff;
  border: 1px solid var(--border); border-radius: 20px; padding: 28px 30px; margin-bottom: 18px; }
.hero h1 { font-size: 28px; line-height: 1.25; margin: 6px 0 10px; letter-spacing: -0.02em; }
.hero p { color: var(--muted); font-size: 15px; margin: 0 0 14px; max-width: 860px; }
.hero .eyebrow { font-size: 12.5px; font-weight: 700; color: var(--accent); }
.hero-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
.hero-list div { background: rgba(255,255,255,.8); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.hero-list b { display: block; margin-bottom: 2px; }
.ov-section { background: #fff; border: 1px solid var(--border); border-radius: var(--r-md); padding: 20px 22px; margin-bottom: 16px; }
.ov-section > h2 { font-size: 18px; margin-bottom: 4px; }
.ov-section > p.lead { color: var(--muted); margin: 0 0 14px; }
.idea { border: 1px solid var(--border); border-radius: 14px; padding: 14px; background: #fcfcfd; }
.idea .n { font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--faint); }
.idea h4 { font-size: 14.5px; margin: 4px 0 6px; }
.idea p { margin: 0; font-size: 13px; color: var(--muted); }
.example-q { margin-top: 12px; border: 1px dashed var(--border-strong); border-radius: 12px; padding: 12px 14px; font-size: 13px; background: #fff; }
.example-q .need { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.layers { display: flex; align-items: stretch; gap: 0; margin-top: 6px; overflow-x: auto; padding-bottom: 4px; }
.layer { flex: 1; min-width: 140px; border: 1px solid var(--border); border-top: 4px solid var(--lc); border-radius: 12px; padding: 10px 12px; background: #fff; }
.layer.dim { opacity: .5; }
.layer h4 { font-size: 13.5px; }
.layer p { margin: 4px 0 6px; font-size: 12px; color: var(--muted); }
.layer .nbs { display: flex; flex-wrap: wrap; gap: 4px; }
.layer .nbs span { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 5px; background: var(--bg-secondary); }
.arrow-sep { display: grid; place-items: center; color: var(--faint); padding: 0 4px; font-size: 16px; }
.paths { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.path { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.path b { font-weight: 700; }
.arch { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 12px; align-items: stretch; margin-top: 8px; }
.arch-col { border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; background: #fcfcfd; }
.arch-col h4 { font-size: 14px; margin-bottom: 2px; }
.arch-col .role { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.arch-item { border: 1px solid var(--border); background: #fff; border-radius: 9px; padding: 6px 9px; margin-top: 6px; font-size: 12px; }
.arch-item code { font-size: 11px; }
.arch-col.core { border-color: rgba(16,185,129,.35); background: rgba(16,185,129,.03); }
.mapping td:first-child { white-space: nowrap; font-weight: 600; }
.mapping td:nth-child(2) { white-space: nowrap; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; }
.footer-note { color: var(--faint); font-size: 12px; text-align: center; margin-top: 24px; }

/* ---------------------------------------------------------------- 0 · Overview (GOAL-223: purpose · why · methodology · process · flow · data) */
.ov-hero { background: radial-gradient(1100px 320px at 8% -30%, rgba(14,165,233,.10), transparent), radial-gradient(900px 300px at 92% -40%, rgba(139,92,246,.10), transparent), #fff;
  border: 1px solid var(--border); border-radius: 20px; padding: 26px 28px 22px; margin-bottom: 16px; }
.ov-hero .eyebrow { font-size: 12.5px; font-weight: 700; color: var(--accent); letter-spacing: .02em; }
.ov-hero h1 { font-size: 27px; line-height: 1.25; margin: 6px 0 10px; letter-spacing: -0.02em; }
.ov-hero > p { color: var(--muted); font-size: 14.5px; margin: 0 0 16px; max-width: 940px; }
.ov-hero > p b { color: var(--text); font-weight: 600; }
.ov-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 16px; }
.ov-facts > div { background: rgba(255,255,255,.88); border: 1px solid var(--border); border-radius: 12px; padding: 10px 13px; }
.ov-facts b { display: block; font-size: 13px; margin-bottom: 2px; }
.ov-facts span { font-size: 12.5px; color: var(--muted); }
.ov-why { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ov-card { border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; background: #fcfcfd; }
.ov-card.accent { background: rgba(139,92,246,.04); border-color: rgba(139,92,246,.28); }
.ov-card h4 { font-size: 14.5px; margin: 7px 0 6px; }
.ov-card p { margin: 0; font-size: 13px; color: var(--muted); }
.ov-k { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: #3a3a3c; letter-spacing: .02em; }
.ov-k::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--lc, #999); flex: none; }
.ov-example { margin-top: 12px; border: 1px dashed var(--border-strong); border-radius: 12px; padding: 12px 14px; background: #fff; }
.ov-example-k { font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }
.ov-example-q { font-size: 14px; font-weight: 600; margin: 4px 0 3px; }
.ov-example-a { font-size: 13px; color: var(--muted); }
.ov-example-a b { color: var(--text); margin-right: 4px; }
.ov-need { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ov-chain { display: flex; align-items: stretch; gap: 6px; overflow-x: auto; padding: 2px 0 6px; }
.ov-chain-item { flex: 1 1 0; min-width: 118px; display: flex; flex-direction: column; gap: 3px; border: 1px solid var(--border); border-top: 3px solid var(--lc); border-radius: 12px; padding: 9px 11px; background: #fff; color: var(--text); }
.ov-chain-item:hover { text-decoration: none; border-color: var(--border-strong); border-top-color: var(--lc); box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.ov-chain-item b { font-size: 13px; line-height: 1.3; }
.ov-chain-item > span:last-child { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.ov-chain-k { display: flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.ov-chain-k i { width: 7px; height: 7px; border-radius: 50%; background: var(--lc); }
.ov-chain-arrow { align-self: center; color: var(--faint); font-size: 14px; flex: none; }
.ov-paths { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.ov-path { border: 1px solid var(--border); border-radius: 12px; padding: 11px 13px; background: #fcfcfd; display: flex; flex-direction: column; gap: 4px; }
.ov-path b { font-size: 13.5px; }
.ov-path p { margin: 0; font-size: 12.5px; color: var(--muted); flex: 1; }
.ov-pill { align-self: flex-start; font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: #fff; background: #1d1d1f; border-radius: var(--r-pill); padding: 1px 9px; }
.ov-core { margin-top: 14px; border: 1px solid rgba(16,185,129,.30); background: rgba(16,185,129,.035); border-radius: 14px; padding: 12px 14px; }
.ov-core-h p { margin: 6px 0 10px; font-size: 13px; color: var(--muted); }
.ov-core-h p b { color: var(--text); }
.ov-core .tbl-wrap { background: #fff; border-radius: 10px; }
.ov-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px; }
.ov-step { display: flex; gap: 9px; align-items: flex-start; border: 1px solid var(--border); border-radius: 12px; padding: 10px 11px; background: #fff; color: var(--text); }
.ov-step:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.ov-step-n { flex: none; min-width: 24px; height: 24px; display: grid; place-items: center; border-radius: var(--r-pill); background: #1d1d1f; color: #fff; font-size: 12px; font-weight: 700; font-family: var(--font-mono); padding: 0 6px; }
.ov-step-b { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ov-step-b b { font-size: 13px; line-height: 1.3; }
.ov-step-sub { font-size: 11px; color: var(--faint); font-family: var(--font-mono); }
.ov-step-io { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.ov-step-io i { font-style: normal; color: var(--faint); margin: 0 3px; }
.ov-step-t { font-size: 11px; color: var(--faint); }
.ov-docs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.ov-doc { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: #fcfcfd; font-size: 13px; }
.ov-doc-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.ov-doc ol { margin: 6px 0 0; padding-left: 18px; font-size: 12px; color: var(--muted); }
.ov-cols { line-height: 1.9; }
.ov-cols code { font-size: 11px; }
.ov-cqs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ov-cq { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: #fff; display: flex; flex-direction: column; gap: 6px; }
.ov-cq-h { display: flex; align-items: center; gap: 6px; }
.ov-cq-h b { font-size: 16px; }
.ov-cq-q { font-size: 13px; font-weight: 600; }
.ov-cq-a { font-size: 12.5px; color: var(--muted); }
.ov-cq-a span { font-weight: 700; color: var(--text); margin-right: 6px; }
.ov-flow, .ov-tables { margin-top: 6px; }
/* GOAL-228 overview: whole flow on top · at-a-glance tiles · process rows · compact section headers */
.ov-top { padding: 22px 24px 18px; }
.ov-top-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 12px; }
.ov-top-title { min-width: 0; flex: 1 1 560px; }
.ov-top-head h1 { margin: 4px 0 6px; }
.ov-sub { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 0; max-width: 900px; }
.ov-top .cta { flex: none; }
.ov-glance { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.ov-glance > div { background: rgba(255,255,255,.92); border: 1px solid var(--border); border-radius: 12px; padding: 10px 13px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ov-glance-k { font-size: 11px; font-weight: 700; color: var(--accent); letter-spacing: .03em; }
.ov-glance b { font-size: 13.5px; line-height: 1.4; }
.ov-glance > div > span:last-child { font-size: 12px; color: var(--muted); line-height: 1.45; }
.ov-h { display: flex; align-items: baseline; gap: 6px 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ov-h h2 { font-size: 18px; margin: 0; }
.ov-h .hint { font-size: 12.5px; line-height: 1.5; }
.ov-rows { display: grid; gap: 6px; }
.ov-row { display: grid; grid-template-columns: 32px minmax(190px, 1fr) minmax(0, 2.2fr) 76px; align-items: center; gap: 14px; border: 1px solid var(--border); border-radius: 12px; padding: 9px 14px; background: #fff; color: var(--text); }
.ov-row:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.ov-row .ov-step-n { justify-self: start; }
.ov-row-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ov-row-t b { font-size: 13.5px; line-height: 1.35; }
.ov-row-s { font-size: 11.5px; color: var(--faint); }
.ov-row-io { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; color: var(--muted); line-height: 1.45; min-width: 0; }
.ov-row-io i { font-style: normal; color: var(--faint); }
.ov-row-m { font-size: 12px; color: var(--muted); text-align: right; white-space: nowrap; }
.ov-card .ov-fact { color: var(--text); font-weight: 500; margin-bottom: 4px; }
@media (max-width: 1100px) { .ov-why, .ov-paths, .ov-facts, .ov-cqs { grid-template-columns: 1fr; } .ov-glance { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .ov-row { grid-template-columns: 32px minmax(0, 1fr); } .ov-row-io, .ov-row-m { grid-column: 2; text-align: left; } }
/* 1 · Getting started */
.gs-intro { margin: 12px 0 14px; padding-left: 20px; display: grid; gap: 5px; font-size: 13.5px; color: #3a3a3c; }
.gs-intro li::marker { color: var(--accent); font-weight: 700; }

/* drawer */
.drawer { position: fixed; top: var(--topbar-h); right: 0; bottom: 0; width: min(720px, 92vw); background: #fff; border-left: 1px solid var(--border-strong);
  box-shadow: -12px 0 32px rgba(0,0,0,.08); transform: translateX(104%); transition: transform .2s ease; z-index: 40; display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.drawer-head h3 { font-size: 15px; }
.drawer-body { padding: 14px 16px; overflow-y: auto; flex: 1; font-size: 13px; }
.drawer-body .code { max-height: none; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 4px 12px; font-size: 12.5px; margin-bottom: 12px; }
.kv div:nth-child(odd) { color: var(--muted); }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; padding: 9px 16px; border-radius: var(--r-pill); font-size: 13px; z-index: 60; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }

/* ---------------------------------------------------------------- cell states (GOAL-213: calm tone)
   running = only the left gutter turns pale sky blue, the body stays white, a thin blue outline + progress bar.
   No moving stripes. done = green left edge. error = soft red outline. */
.cell { transition: border-color .25s, box-shadow .25s; position: relative; }
.cell.is-running { border-color: #bfdbfe; box-shadow: 0 0 0 3px rgba(59,130,246,.07); }
.cell.is-running .cell-gutter { background: #eef6ff; border-right-color: #dbeafe; }
.cell.is-running .cell-gutter .num { color: #1d4ed8; font-weight: 800; }
.cell.is-running .cell-gutter .exec { color: #2563eb; }
.cell.is-done { border-left: 4px solid var(--pass); }
.cell.is-error { border-color: rgba(220,38,38,.45); }
.cell.is-error .cell-gutter { background: #fef2f2; }
.cell.is-waiting .btn.primary { opacity: .7; }
.status-chip.running { background: #eff6ff; color: #1d4ed8; font-weight: 700; border: 1px solid #dbeafe; }
.status-chip.running .dot.running { background: #3b82f6; }
.status-chip.cancelled { background: #f8fafc; color: #475569; }
.spin { width: 12px; height: 12px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; display: inline-block; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn.primary:disabled { background: #9ca3af; border-color: #9ca3af; }
.runbar { margin: 10px 0 2px; padding: 9px 12px; border-radius: 10px; background: #fff; border: 1px solid #e2e8f0; }
.runbar[hidden] { display: none; }
.rb-top { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: 12.5px; color: #334155; }
.rb-top b { color: #0f172a; }
.rb-pulse { width: 8px; height: 8px; border-radius: 50%; background: #3b82f6; animation: pulse 1.6s ease-in-out infinite; }
.rb-step { color: #1e40af; background: #eff6ff; border-radius: 6px; padding: 1px 8px; max-width: 480px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-track { height: 6px; border-radius: 6px; background: #eef2f7; margin-top: 8px; overflow: hidden; }
.rb-track i { display: block; height: 100%; border-radius: 6px; background: #60a5fa; transition: width .9s linear; }
.rb-note { margin-top: 6px; font-size: 12px; color: #64748b; }
.rb-stop { margin-left: auto; font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid #cbd5e1; background: #fff; color: #334155; cursor: pointer; }
.rb-stop:hover { border-color: #ef4444; color: #b91c1c; }
.recover { margin-top: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid #e2e8f0; background: #f8fafc; font-size: 13px; }
.recover .r-msg { color: #334155; margin-bottom: 8px; }
.recover .r-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.recover .hint { font-size: 12px; }
.done-banner { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: #166534; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 999px; padding: 2px 10px; margin-left: 8px; }
.use.eta { border-style: dashed; color: var(--muted); }
.mcp-badge.api { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }

/* ---------------------------------------------------------------- graph shell: zoom (+ − fit) + right detail panel */
.gshell { position: relative; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; }
.gshell .gstage { position: relative; height: 100%; min-height: 0; }
.gshell .gcanvas { position: absolute; inset: 0; }
.gtools { position: absolute; top: 8px; right: 8px; display: flex; flex-direction: row; gap: 4px; z-index: 5; } /* graphs: + − fit top-right */
.gtools button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid #cbd5e1; background: rgba(255,255,255,.95); font-size: 15px; font-weight: 700; color: #334155; cursor: pointer; line-height: 1; }
.gtools button.fit { font-size: 10.5px; font-weight: 800; }
.gtools button:hover { border-color: #0071e3; color: #0071e3; }
/* detail panel: hidden until a node/edge is selected, then overlays the right side of the graph */
.gpanel { display: none; position: absolute; top: 8px; right: 8px; bottom: 8px; width: 300px; max-width: calc(100% - 60px); z-index: 6;
  border: 1px solid var(--border); border-radius: 12px; background: rgba(251,251,253,.98); box-shadow: 0 10px 30px rgba(15,23,42,.14);
  padding: 12px 14px; overflow: auto; font-size: 12.5px; box-sizing: border-box; }
.gshell.has-sel .gpanel { display: block; }
.gpanel .gp-close { position: sticky; top: 0; float: right; width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--border); background: #fff; cursor: pointer; font-size: 15px; line-height: 1; color: #475569; }
.gpanel .gp-close:hover { color: #0f172a; border-color: #94a3b8; }
.gpanel .gp-kind { font-size: 11px; font-weight: 800; letter-spacing: .03em; color: var(--accent); text-transform: uppercase; }
.gpanel h5 { margin: 4px 0 6px; font-size: 14px; line-height: 1.35; word-break: break-all; }
.gpanel .gp-kv { display: grid; grid-template-columns: 76px 1fr; gap: 4px 8px; margin: 8px 0; }
.gpanel .gp-kv > div:nth-child(odd) { color: var(--muted); }
.gpanel .gp-kv code, .gpanel li code { font-size: 11px; word-break: break-all; }
.gpanel ul { margin: 4px 0 8px; padding-left: 16px; }
.gpanel li { margin: 2px 0; }
.gpanel .gp-sec { margin-top: 10px; font-size: 11.5px; font-weight: 800; color: #334155; }
.gpanel .gp-body { white-space: pre-wrap; color: #334155; line-height: 1.55; max-height: 220px; overflow: auto; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 8px; margin-top: 4px; }
.gpanel .btn { margin-top: 8px; }
.flow .gshell { border: 0; border-radius: 0; }
.flow .gshell .gstage { overflow: hidden; cursor: grab; height: auto; }
.flow .gshell .gstage.dragging { cursor: grabbing; }
.flow .gshell svg { width: 100%; height: 100%; }
.flow .fe-hit { fill: none; stroke: transparent; stroke-width: 12; cursor: pointer; }
.flow .fe-hit:hover + .fe, .flow .fe.sel { stroke: #0071e3; stroke-width: 2.6; }
.flow .fn.sel .card { stroke: #0f172a; stroke-width: 2.4; }
.flow.overview { padding: 10px 10px 8px; }
.flow.overview .flow-svg { width: 100%; height: auto; display: block; }
.flow.overview .fn { cursor: pointer; }

/* ---------------------------------------------------------------- flow diagram */
.flow { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 8px 8px 6px; margin-top: 10px; }
.flow svg { width: 100%; height: auto; display: block; }
.flow .fh { font-size: 12.5px; font-weight: 800; fill: #0f172a; }
.flow .fp { font-size: 11px; font-weight: 800; }
.flow .fe { fill: none; stroke: #94a3b8; stroke-width: 1.6; }
.flow .fe.dash { stroke-dasharray: 5 4; }
.flow .fe.on { stroke: #0071e3; stroke-width: 2.4; }
.flow .fe.off { opacity: .22; }
.flow .fl { font-size: 10.5px; font-weight: 600; fill: #64748b; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.flow .fl.off { opacity: .25; }
.flow .fn { cursor: pointer; }
.flow .fn .card { fill: #fff; stroke: rgba(15,23,42,.12); stroke-width: 1; }
.flow .fn.dashed .card { stroke-dasharray: 5 3; stroke: #10b981; }
.flow .fn .bar { fill: var(--nc); }
.flow .fn .t1 { font-size: 12.5px; font-weight: 800; fill: #0f172a; }
.flow .fn .t2 { font-size: 11px; fill: #64748b; }
.flow .fn .st { fill: #e2e8f0; }
.flow .fn.done .st { fill: var(--pass); }
.flow .fn:hover .card, .flow .fn:focus .card { stroke: var(--nc); stroke-width: 1.8; }
.flow .fn.dim { opacity: .38; }
.flow .fn.hl .card { fill: #eff6ff; stroke: #0071e3; stroke-width: 2.2; }
.flow .fn.hl .t1 { fill: #0b4fb3; }
.flow .fn.run .card { fill: #eef6ff; stroke: #3b82f6; stroke-width: 2.2; stroke-dasharray: 6 3; }
.flow .fn.run .st { fill: #3b82f6; animation: pulse 1.6s ease-in-out infinite; }
.flow-legend { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: 11.5px; color: var(--muted); padding: 2px 6px 2px; }
.flow-legend i { display: inline-block; width: 14px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; border: 1.5px solid; }
.flow-legend .lg-hl { background: #eff6ff; border-color: #0071e3; }
.flow-legend .lg-run { background: #eef6ff; border: 1.5px dashed #3b82f6; }
.flow-legend .lg-done { background: var(--pass); border-color: var(--pass); border-radius: 50%; width: 10px; }
.flow-legend .lg-dash { background: #fff; border: 1.5px dashed #10b981; }
.flow-cap { margin-top: 14px; font-size: 12.5px; font-weight: 700; color: var(--text); }
.nb-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.nb-chip { display: block; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 9px 11px; color: var(--text); font-size: 13px; font-weight: 600; }
.nb-chip:hover { border-color: #0071e3; text-decoration: none; }
.nb-chip b { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--text); color: #fff; font-size: 11px; margin-right: 4px; }
.nb-chip span { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); margin-top: 3px; }

/* ---------------------------------------------------------------- stage guide */
.guide { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.g-item { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: #fbfbfd; }
.g-item.core { border-color: rgba(16,185,129,.35); background: rgba(16,185,129,.04); }
.g-k { font-size: 11.5px; font-weight: 800; color: var(--accent); letter-spacing: .02em; margin-bottom: 4px; }
.g-item.core .g-k { color: #047857; }
.g-v { font-size: 13px; color: #1f2937; line-height: 1.6; }
.g-v code { font-size: 11.5px; }
.svc { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border-strong); background: #fff; margin: 0 4px 4px 0; }
@media (max-width: 1100px) { .guide { grid-template-columns: 1fr 1fr; } .nb-strip { grid-template-columns: 1fr 1fr; } }

/* ---------------------------------------------------------------- Lab 2 · Workflow Agent (studio-style, GOAL-218) */
.wfa { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 12px; height: 640px; margin-top: 4px; }
.wfa.solo { grid-template-columns: minmax(0, 1fr); height: 600px; }
@media (max-width: 980px) { .wfa { grid-template-columns: 1fr; height: auto; } .wfa .wfa-pane { height: 560px; } .wfa-chat { max-height: 520px; } }
.wfa-chat { display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--line, #e5e7eb); border-radius: 12px; background: #fff; overflow: hidden; }
.wfa-chat-head { padding: 8px 12px; border-bottom: 1px solid var(--line, #e5e7eb); font-weight: 700; font-size: 13px; display: flex; justify-content: space-between; align-items: center; }
.wfa-msgs { flex: 1; overflow: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.wfa-msgs .chat-row { margin: 2px 0; }
.wfa-turn { display: flex; flex-direction: column; gap: 4px; }
.wfa-und { font-size: 11.5px; color: var(--muted, #6e6e73); }
.wfa-chip { display: inline-block; border: 1px solid var(--line, #e5e7eb); border-radius: 999px; padding: 0 7px; margin: 1px 2px; font-size: 11px; background: #f8fafc; }
.wfa-step { border: 1px solid var(--line, #e5e7eb); border-left: 3px solid var(--kc, #94a3b8); border-radius: 8px; padding: 5px 8px; font-size: 12px; background: #fff; animation: wfa-in .22s ease-out; }
.wfa-step code { font-size: 11px; }
.wfa-sd { color: var(--ink, #1d1d1f); }
.wfa-br { margin-top: 3px; font-size: 11.5px; color: #b45309; }
.wfa-kb { display: inline-block; font-size: 9px; font-weight: 800; letter-spacing: .3px; border: 1px solid; border-radius: 4px; padding: 0 4px; vertical-align: 1px; }
.wfa-pend { align-self: flex-start; background: #0f172a; color: #fff; font-size: 11.5px; font-weight: 700; border-radius: 8px; padding: 3px 9px; animation: wfa-bob 1.6s ease-in-out infinite; }
.wfa-pend code { color: #fde68a; background: transparent; }
.wfa-reply { border-top: 1px solid var(--line, #e5e7eb); padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.wfa-reply .chat-reply { display: flex; gap: 6px; margin: 0; }
.wfa-reply .chat-reply input { flex: 1; min-width: 0; }
.wfa-typing { align-self: flex-start; font-size: 12px; color: var(--muted); padding: 4px 2px 2px; }
.wfa-typing::after { content: " ●●●"; letter-spacing: 2px; color: #93c5fd; animation: wfaTyping 1.2s steps(4, end) infinite; }
@keyframes wfaTyping { 0% { opacity: .25; } 50% { opacity: 1; } 100% { opacity: .25; } }
.wfa-presets { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; max-height: 112px; overflow: auto; }
.wfa-preset { border: 1px solid #bfdbfe; background: #eff6ff; color: #1d4ed8; border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer; font-family: inherit; }
.wfa-preset small { margin-left: 5px; color: #64748b; font-size: 10.5px; }
.wfa-preset:hover { background: #dbeafe; border-color: #2563eb; }
.wfa-done { font-size: 12px; color: var(--muted, #6e6e73); }
.wfa-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; border: 1px solid var(--line, #e5e7eb); border-radius: 12px; overflow: hidden; background: #fff; }
.wfa-head { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line, #e5e7eb); flex-wrap: wrap; }
.wfa-title { flex: 1; min-width: 0; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wfa-tools { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.wfa-tools button { height: 26px; min-width: 26px; padding: 0 8px; border-radius: 7px; border: 1px solid #cbd5e1; background: #fff; font-size: 12px; font-weight: 600; color: #334155; cursor: pointer; font-family: inherit; }
.wfa-tools button.on { border-color: #2563eb; color: #1d4ed8; background: #eff6ff; }
.wfa-tools input[type=range] { width: 90px; }
.wfa-pct { font-family: var(--font-mono); font-size: 11px; color: #64748b; width: 36px; text-align: right; }
.wfa-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.wfa-tabs button { border: 1px solid #cbd5e1; background: #fff; border-radius: 7px; padding: 2px 8px; font-size: 12px; cursor: pointer; font-family: inherit; }
.wfa-tabs button.on { border-color: #f59e0b; background: #fffbeb; }
.wfa-chart { position: relative; flex: 1; min-height: 0; background-image: radial-gradient(#e2e8f0 1px, transparent 1px); background-size: 16px 16px; }
.wfa-chart > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.wfa-legend { position: absolute; left: 8px; bottom: 8px; display: flex; flex-wrap: wrap; gap: 4px 10px; max-width: 70%; background: rgba(255,255,255,.94); border: 1px solid var(--line, #e5e7eb); border-radius: 8px; padding: 5px 8px; font-size: 10.5px; color: #475569; }
.wfa-legend span { display: inline-flex; align-items: center; gap: 4px; }
.wfa-legend i { width: 12px; height: 9px; border: 1.5px solid; border-radius: 2px; display: inline-block; }
.wfa-legend i.dia { transform: rotate(45deg) scale(.8); }
.wfa-legend i.ln { height: 0; border-width: 2px 0 0; width: 14px; }
.wfa-legend i.cur { border-color: #2563eb; background: transparent; box-shadow: 0 0 6px rgba(37,99,235,.7); }
.wfa-detail { position: absolute; right: 8px; top: 8px; width: 300px; max-height: calc(100% - 16px); overflow: auto; background: #fff; border: 1px solid var(--line, #e5e7eb); border-radius: 10px; padding: 10px 12px; box-shadow: 0 6px 20px rgba(15,23,42,.12); font-size: 12px; }
.wfa-x { position: absolute; right: 6px; top: 4px; border: 0; background: transparent; font-size: 16px; cursor: pointer; color: #64748b; }
@keyframes wfa-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@keyframes wfa-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }

/* GOAL-237 Google sign-in gate */
body.auth-gate .sidebar { display: none; }
body.auth-gate .layout { grid-template-columns: 1fr; }
.login-card { max-width: 520px; margin: 12vh auto 0; padding: 32px 32px 24px; background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; box-shadow: 0 8px 30px rgba(15, 23, 42, .06); }
.login-card h1 { margin: 6px 0 10px; font-size: 24px; }
.login-card p { color: #475569; line-height: 1.6; }
.login-btn { display: inline-flex; align-items: center; gap: 10px; margin: 14px 0 6px; padding: 10px 18px; font-size: 15px; background: #fff; color: #1f2937; border: 1px solid #cbd5e1; }
.login-btn:hover { background: #f8fafc; }
.login-btn svg { width: 18px; height: 18px; }
.login-err { min-height: 20px; color: #dc2626; font-size: 13px; }
#chip-user b { margin-left: 6px; color: #0369a1; }

/* ---------------------------------------------------------------- Lab 3 · Context Graph (web/lab3.js) */
.cg-fbw, .cg-rvw { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 8px; }
.cg-fbrow, .cg-rvrow { border: 1px solid #e2e8f0; border-radius: 10px; padding: 8px 10px; background: #fff; }
.cg-fbq { font-size: 13px; line-height: 1.45; }
.cg-fbq .tag { margin-right: 4px; }
.cg-fba { font-size: 12px; margin: 4px 0; color: #475569; }
.cg-fbctl { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 4px 0; font-size: 13px; }
.cg-fbctl label { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-weight: 500; }
.cg-fbctl select, .cg-fbctl input[type="text"] { font-size: 12px; padding: 3px 6px; border: 1px solid #cbd5e1; border-radius: 6px; }
.cg-fbctl input[type="text"] { flex: 1; min-width: 160px; }
textarea.cg-fbc { min-height: 44px; font-size: 12px; }
.cg-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11px; color: #64748b; margin: 4px 0 8px; }
.cg-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }

/* quiet utility links at the bottom of the left sidebar (visible only on scroll) */
.side-quiet-tools {
  margin: 28px 6px 4px;
  padding-top: 10px;
  border-top: 1px dashed rgba(0, 0, 0, .06);
  display: flex;
  flex-direction: column;
  gap: 3px;
  opacity: .68;
  transition: opacity .15s;
}
.side-quiet-tools:hover { opacity: 1; }
.side-quiet-btn {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  font-family: var(--sans);
  color: var(--faint);
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color .12s, background .12s, border-color .12s;
}
.side-quiet-btn:hover {
  color: var(--muted);
  background: rgba(0, 0, 0, .03);
  border-color: var(--line);
}
.side-quiet-btn.active {
  color: var(--blue);
  background: var(--blue-bg);
  border-color: #bfdbfe;
  font-weight: 600;
}


/* ================================================================ GOAL-285 · REQ-5 / REQ-7 — calm enterprise alignment
   One palette (slate + indigo accents), 1px subtle borders, one modal / drawer header height (52px) with ✕ top-right,
   scrollable bodies and right-aligned footer actions. Undefined tokens used by older rules are defined here. */
:root { --ink-2: #334155; --slate-50: #f8fafc; --slate-100: #f1f5f9; --slate-200: #e2e8f0; --slate-300: #cbd5e1; --slate-500: #64748b;
  --indigo: #4f46e5; --indigo-600: #4338ca; --indigo-50: #eef2ff; --indigo-100: #e0e7ff;
  --line: rgba(0,0,0,.08); --sans: var(--font-sans); --blue: #1d4ed8; --blue-bg: #eff6ff; }
.answer { border-left: 3px solid var(--indigo); }                 /* was a saturated red agent stripe */
.toast { background: #1e293b; box-shadow: 0 8px 24px rgba(15,23,42,.18); }
.btn.sm { padding: 3px 10px; font-size: 12px; }                    /* used by the access-history drawer */
.section-title { color: var(--slate-500); }
.drawer-head { height: 52px; padding: 0 12px 0 18px; }
.drawer-head h3 { font-size: 15px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-head .spacer { display: none; }
#drawer-close, .modal-x { width: 30px; height: 30px; padding: 0; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid var(--slate-200);
  background: #fff; color: var(--slate-500); font-size: 13px; font-weight: 600; cursor: pointer; flex: none; }
#drawer-close:hover, .modal-x:hover { color: #0f172a; border-color: var(--slate-300); background: var(--slate-50); }
.drawer-body { line-height: 1.55; }
.kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.kpi-row .kpi { font-size: 12px; font-weight: 500; letter-spacing: 0; color: var(--muted); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px;
  background: #fff; display: flex; flex-direction: column; gap: 2px; }
.kpi-row .kpi b { font-size: 20px; font-weight: 700; color: var(--text); }
.gpanel .gp-close { width: 26px; height: 26px; border-color: var(--slate-200); }
.wfa-x { width: 26px; height: 26px; border: 1px solid var(--slate-200); border-radius: 7px; background: #fff; font-size: 13px; }
/* modal (openModal in app.js — PIN prompt etc.) */
.modal-back { position: fixed; inset: 0; z-index: 70; background: rgba(15,23,42,.32); display: grid; place-items: center; padding: 16px; }
.modal { background: #fff; border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: 0 20px 50px rgba(15,23,42,.22); display: flex; flex-direction: column; max-height: 86vh; }
.modal-head { height: 52px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 18px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 15px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-body { padding: 16px 18px; overflow: auto; font-size: 13.5px; line-height: 1.55; }
.modal-foot { flex: none; display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--slate-50); border-radius: 0 0 14px 14px; }
.modal-input { width: 100%; border: 1px solid var(--border-strong); border-radius: 10px; padding: 9px 12px; font-size: 15px; letter-spacing: .18em; font-family: var(--font-mono); }
.modal-input:focus { outline: 2px solid rgba(79,70,229,.28); border-color: transparent; }
.modal-err { min-height: 18px; margin-top: 6px; color: #b91c1c; font-size: 12.5px; }

/* ---------------------------------------------------------------- sentence feedback bar (web/cgfeedback.js) */
.cgf { margin-top: 12px; border: 1px solid var(--slate-200); border-radius: 12px; background: var(--slate-50); padding: 10px 12px; }
.cgf-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 10px; flex-wrap: wrap; margin-bottom: 6px; }
.cgf-title { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.cgf-arrow { font-weight: 600; color: var(--indigo-600); }
.cgf-meta { font-size: 11.5px; color: var(--slate-500); }
.cgf-meta code { font-size: 11px; }
.cgf-text { width: 100%; resize: vertical; min-height: 64px; border: 1px solid var(--slate-300); border-radius: 10px; padding: 9px 11px;
  font: 13.5px/1.55 var(--font-sans); background: #fff; color: var(--text); }
.cgf.compact .cgf-text { min-height: 48px; font-size: 13px; }
.cgf-text:focus { outline: 2px solid rgba(79,70,229,.2); border-color: #a5b4fc; }
.cgf-row { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin-top: 8px; }
.cgf-tags { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.cgf-thumb, .cgf-chip { border: 1px solid var(--slate-200); background: #fff; color: var(--slate-500); border-radius: 999px; padding: 2px 9px; font-size: 12px;
  line-height: 1.6; cursor: pointer; font-family: inherit; }
.cgf-thumb { padding: 1px 9px; font-size: 13px; }
.cgf-thumb:hover, .cgf-chip:hover { border-color: var(--slate-300); color: var(--ink-2); }
.cgf-thumb[aria-pressed="true"], .cgf-chip[aria-pressed="true"] { background: var(--indigo-50); border-color: #a5b4fc; color: var(--indigo-600); font-weight: 600; }
.cgf-sep { width: 1px; height: 16px; background: var(--slate-200); margin: 0 3px; }
.cgf-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.cgf-hint { font-size: 11.5px; color: var(--faint); }
.cgf-result { margin-top: 10px; }
.cgf-result[hidden] { display: none; }
.cgf-parsed { border: 1px solid var(--slate-200); background: #fff; border-radius: 10px; padding: 9px 11px; font-size: 12.5px; display: grid; gap: 6px; }
.cgf-parsed-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cgf-bq { margin-left: auto; font-size: 11px; border-radius: 999px; padding: 1px 8px; border: 1px solid var(--slate-200); color: var(--slate-500); background: var(--slate-50); }
.cgf-bq.written { color: #15803d; border-color: rgba(22,163,74,.3); background: rgba(22,163,74,.06); }
.cgf-bq.queued { color: #b45309; border-color: rgba(217,119,6,.3); background: rgba(217,119,6,.06); }
.cgf-bq.error { color: #b91c1c; border-color: rgba(220,38,38,.3); background: rgba(220,38,38,.05); }
.cgf-pills { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.cgf-pill { display: inline-flex; gap: 5px; align-items: center; border: 1px solid var(--slate-200); border-radius: 6px; padding: 1px 7px; font-size: 12px; background: var(--slate-50); color: var(--ink-2); }
.cgf-pill i { font-style: normal; color: var(--slate-500); font-size: 11px; }
.cgf-pill.info { border-color: #c7d2fe; background: var(--indigo-50); color: var(--indigo-600); }
.cgf-pill.ok { border-color: rgba(22,163,74,.3); background: rgba(22,163,74,.06); color: #15803d; }
.cgf-pill.warn { border-color: rgba(217,119,6,.3); background: rgba(217,119,6,.06); color: #b45309; }
.cgf-ent { font-family: var(--font-mono); font-size: 11px; padding: 1px 6px; border-radius: 5px; background: var(--slate-100); color: var(--ink-2); }
.cgf-cand { color: var(--ink-2); line-height: 1.5; }
.cgf-cand code { font-size: 11px; }
.cgf-k { font-size: 10.5px; font-weight: 700; color: var(--slate-500); margin-right: 4px; text-transform: uppercase; letter-spacing: .03em; }
.cgf-link a { font-weight: 600; color: var(--indigo-600); }
.cgf-warn { color: #92400e; font-size: 12.5px; }
.cgf-toast { position: fixed; bottom: 18px; left: 50%; transform: translate(-50%, 8px); display: flex; gap: 12px; align-items: center; background: #1e293b; color: #fff;
  padding: 10px 10px 10px 16px; border-radius: 12px; font-size: 13px; z-index: 61; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  box-shadow: 0 10px 30px rgba(15,23,42,.25); max-width: min(940px, 94vw); }
.cgf-toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.cgf-toast a { color: #c7d2fe; font-weight: 700; white-space: nowrap; }
.cgf-toast-x { border: 0; background: transparent; color: #94a3b8; cursor: pointer; font-size: 13px; padding: 2px 6px; }
.cgf-live-toggle { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.cg-fbrow .cgf-text { margin: 6px 0 4px; min-height: 52px; }
.cg-fbrow { background: #fff; }

/* ---------------------------------------------------------------- ⚡ 3-agent live feedback demo (Lab 3 C1 page) */
.cg-live { background: #fff; border: 1px solid var(--border); border-radius: var(--r-md); padding: 18px 20px; margin-bottom: 16px; scroll-margin-top: 70px; }
.cg-live-head { display: flex; justify-content: space-between; gap: 12px 18px; align-items: flex-start; flex-wrap: wrap; }
.cg-live-head > div:first-child { flex: 1 1 560px; min-width: 0; }
.cg-live-eyebrow { font-size: 11.5px; font-weight: 700; color: var(--indigo-600); letter-spacing: .03em; }
.cg-live h2 { font-size: 17px; margin: 3px 0 4px; }
.cg-live-head p { margin: 0; max-width: 920px; line-height: 1.55; }
.cg-live-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cgl-stages { display: flex; align-items: stretch; gap: 4px; margin: 14px 0 12px; overflow-x: auto; padding-bottom: 2px; }
.cgl-stage { flex: 1 1 0; min-width: 112px; border: 1px solid var(--slate-200); border-radius: 10px; padding: 7px 9px; background: #fff; display: flex; flex-direction: column; gap: 2px;
  transition: background .25s, border-color .25s, opacity .25s, box-shadow .25s; }
.cgl-n { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--slate-100); color: var(--slate-500); }
.cgl-t { font-size: 12.5px; font-weight: 700; color: var(--ink-2); line-height: 1.3; }
.cgl-note { font-size: 11px; color: var(--slate-500); font-family: var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cgl-stage.done { border-color: #c7d2fe; background: var(--indigo-50); }
.cgl-stage.done .cgl-n { background: var(--indigo); color: #fff; }
.cgl-stage.active { border-color: #fde68a; background: #fffbeb; }
.cgl-stage.active .cgl-n { background: #d97706; color: #fff; }
.cgl-stage.skip { opacity: .6; border-style: dashed; }
.cgl-stage.pre { opacity: .35; }
.cgl-stage.flash { box-shadow: 0 0 0 3px rgba(79,70,229,.16); }
.cgl-arrow { align-self: center; color: var(--slate-300); font-size: 16px; flex: none; }
.cgl-agents { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cgl-agent { border: 1px solid var(--slate-200); border-radius: 12px; padding: 10px 12px; background: var(--slate-50); min-width: 0; }
.cgl-agent.off { background: #fff; border-style: dashed; }
.cgl-agent-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.cgl-agent-h code { font-size: 11px; }
.cgl-q { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; font-weight: 600; }
.cgl-a { font-size: 12px; color: var(--slate-500); margin-top: 3px; line-height: 1.5; }
.cgl-fb > summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--indigo-600); margin-top: 6px; }
.cgl-fb .cgf { background: #fff; }
.cgl-main { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; }
.cgl-graph-wrap { display: flex; flex-direction: column; min-width: 0; }
.cgl-graph { height: 380px; border: 1px solid var(--slate-200); border-radius: 12px; background: #fff; }
.cgl-sub { font-size: 12px; font-weight: 700; color: var(--slate-500); margin: 0 0 6px; }
.cgl-insp { border: 1px solid var(--slate-200); border-radius: 12px; background: #fff; padding: 10px 12px; max-height: 420px; overflow: auto; font-size: 12.5px; margin-top: 23px; }
.cgl-sec { font-size: 12px; font-weight: 700; color: var(--ink-2); margin: 10px 0 4px; display: flex; align-items: center; gap: 6px; }
.cgl-tabs > .cgl-sec:first-child { margin-top: 0; }
.cgl-layer { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; color: #fff; background: var(--slate-500); border-radius: 5px; padding: 0 5px; }
.cgl-kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 3px 10px; }
.cgl-kv > div:nth-child(odd) { color: var(--slate-500); font-family: var(--font-mono); font-size: 11.5px; }
.cgl-kv > div:nth-child(even) { word-break: break-word; }
.cgl-events { margin: 0; padding-left: 16px; font-size: 12px; }
.cgl-events li { margin: 2px 0; }
.cgl-empty { color: var(--slate-500); font-size: 12.5px; padding: 18px; text-align: center; }
.cgl-recent { margin-top: 12px; }
.cgl-row { cursor: pointer; }
.cgl-row:hover td { background: var(--slate-50); }
.cgl-row.on td { background: var(--indigo-50); }
@media (max-width: 1100px) { .cgl-agents, .cgl-main { grid-template-columns: 1fr; } .cgl-insp { margin-top: 0; } }
/* 4-layer Context Graph diagram (explain cell c1.cg_arch) */
.cg4 { display: grid; gap: 6px; margin: 6px 0 4px; }
.cg4-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) minmax(180px, 280px); gap: 10px; align-items: stretch; }
.cg4-l { display: grid; place-items: center; border-radius: 10px; background: var(--lc); color: #fff; font-family: var(--font-mono); font-weight: 700; font-size: 13px; }
.cg4-b { border: 1px solid var(--slate-200); border-left: 3px solid var(--lc, var(--slate-300)); border-radius: 10px; padding: 8px 12px; background: #fff; display: flex; flex-direction: column; gap: 2px; }
.cg4-row:nth-child(1) .cg4-b { --lc: #64748b; } .cg4-row:nth-child(2) .cg4-b { --lc: #4f46e5; } .cg4-row:nth-child(3) .cg4-b { --lc: #0f766e; } .cg4-row:nth-child(4) .cg4-b { --lc: #1d4ed8; }
.cg4-b b { font-size: 13.5px; color: var(--ink-2); }
.cg4-b span { font-size: 12.5px; color: var(--slate-500); line-height: 1.5; }
.cg4-w { border: 1px dashed var(--slate-300); border-radius: 10px; padding: 8px 10px; display: flex; align-items: center; background: var(--slate-50); }
.cg4-w code { font-size: 11.5px; background: transparent; white-space: normal; }
.cg4-loop { font-size: 12.5px; color: var(--indigo-600); border: 1px dashed #c7d2fe; background: var(--indigo-50); border-radius: 10px; padding: 7px 12px; }
@media (max-width: 900px) { .cg4-row { grid-template-columns: 44px minmax(0, 1fr); } .cg4-w { grid-column: 2; } }
.explain pre { background: #0f172a08; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 12px; overflow: auto; max-height: 360px; }
/* GOAL-285 audit — small consistency fixes found on the notebook pages */
.cell-gutter .exec { border: 0; background: transparent; margin-top: 4px; border-radius: 0; }   /* "[ ]" exec counter: plain text, not a framed box */
.prompt-box { border-color: #c7d2fe; background: #fafbff; }
.prompt-box > summary { color: var(--indigo-600); }
.prompt-box textarea:focus { outline-color: rgba(79,70,229,.28); }
.prompt-tools .edited { color: var(--indigo-600); }
.kind-tag.prompt { color: var(--indigo-600); background: var(--indigo-50); border-color: #c7d2fe; }
.wfa-pend { animation: none; background: var(--ink-2); }                                          /* calm: no bobbing badge */
.status-chip { border: 1px solid transparent; }
.status-chip.done { border-color: rgba(22,163,74,.18); }
.status-chip.error { border-color: rgba(220,38,38,.18); }

/* GOAL-285 · REQ-11: 3-lab overview switcher (#ov · #w0 · #c0) + "🔍 Lab N overview" link in notebook headers */
.lab-switch { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; padding: 4px; background: #f1f5f9; border: 1px solid var(--border); border-radius: 12px; }
.lab-switch-tab { flex: 1 1 200px; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 9px; font-size: 13px; font-weight: 600; color: #475569; text-decoration: none; transition: background .15s, color .15s; }
.lab-switch-tab:hover { background: rgba(255,255,255,.7); color: var(--text); }
.lab-switch-tab.on { background: #fff; color: #3730a3; box-shadow: 0 1px 2px rgba(15,23,42,.08), 0 0 0 1px rgba(79,70,229,.18); }
.lab-switch-n { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 22px; padding: 0 6px; border-radius: 6px; background: #e2e8f0; color: #334155; font-size: 11.5px; font-weight: 700; }
.lab-switch-tab.on .lab-switch-n { background: #4f46e5; color: #fff; }
.flow-cap .lab-ov-link { float: right; margin-top: -3px; font-weight: 600; text-decoration: none; }
@media (max-width: 760px) { .flow-cap .lab-ov-link { float: none; display: inline-block; margin: 6px 0 0; } }

/* GOAL-288: starter studio · GitHub cross-links */
.ov-related { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: -4px 0 12px; padding: 8px 12px; border: 1px dashed var(--border-strong); border-radius: 10px; font-size: 12.5px; background: #fff; }
.ov-related-k { font-weight: 700; color: #475569; font-size: 11.5px; }
.ov-related a { color: #3730a3; text-decoration: none; font-weight: 600; }
.ov-related a:hover { text-decoration: underline; }
a.chip { text-decoration: none; color: inherit; }

/* GOAL-289: explanation vs. execution are visually distinct; overview explanations are collapsible reading cards */
.cell.explain-cell { background: #f8fafc; border-style: dashed; box-shadow: none; }
.cell.explain-cell .cell-gutter .num { font-size: 15px; }
.cell.explain-cell .kind-tag { background: #e2e8f0; color: #475569; }
.ov-reading .ov-read { border: 1px solid var(--border); border-radius: 12px; background: #f8fafc; margin-top: 10px; }
.ov-reading .ov-read > summary { cursor: pointer; padding: 12px 14px; font-weight: 650; list-style: none; display: flex; gap: 8px; align-items: center; }
.ov-reading .ov-read > summary::-webkit-details-marker { display: none; }
.ov-reading .ov-read > summary::after { content: "▾"; margin-left: auto; color: var(--muted); }
.ov-reading .ov-read:not([open]) > summary::after { content: "▸"; }
.ov-reading .ov-read > .explain { padding: 0 16px 14px; }
.ov-reading .kind-tag { background: #e2e8f0; color: #475569; }
.ov-start { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 18px 0 6px; padding: 14px 16px; border-radius: 12px; border: 1px solid rgba(79,70,229,.25); background: #eef2ff; }
.ov-start b { display: block; }
/* GOAL-289: the cell "Run all" is working on */
.cell.ra-focus { box-shadow: 0 0 0 2px rgba(79,70,229,.45), 0 8px 24px rgba(79,70,229,.10); }
