/* SmartSQL — single stylesheet. Dark by default; [data-theme="light"] overrides tokens. */

:root, [data-theme="dark"] {
  --bg: #0a0b0e;
  --sidebar: #0d0f13;
  --surface: #121419;
  --surface-2: #181b21;
  --surface-3: #1f232b;
  --border: #22262e;
  --border-2: #2e333d;
  --text: #e8eaef;
  --text-2: #a4aab7;
  --text-3: #6e7584;
  --accent: #7c8cff;
  --accent-2: #b07cff;
  --accent-bg: rgba(124, 140, 255, .13);
  --accent-ring: rgba(124, 140, 255, .35);
  --green: #3ecf8e;
  --green-bg: rgba(62, 207, 142, .12);
  --amber: #f2b33d;
  --amber-bg: rgba(242, 179, 61, .12);
  --red: #ff6b70;
  --red-bg: rgba(255, 107, 112, .12);
  --blue: #52a8ff;
  --blue-bg: rgba(82, 168, 255, .12);
  --purple: #c08bff;
  --purple-bg: rgba(192, 139, 255, .13);
  --cyan: #4fd1e0;
  --code-bg: #0c0e12;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --hl-k: #8f9dff; --hl-f: #e39cff; --hl-s: #9fdc8b; --hl-n: #f7b871; --hl-c: #5c6576;
  --hl-tbl: #5fd4e6; --hl-col: #c3cbff; --hl-v: #ff9f9f; --hl-o: #8b93a7; --hl-t: #f0c674;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f5f6f8;
  --sidebar: #fafafb;
  --surface: #ffffff;
  --surface-2: #f3f4f7;
  --surface-3: #e9ebf0;
  --border: #e3e5ea;
  --border-2: #d2d6de;
  --text: #13151a;
  --text-2: #4b5260;
  --text-3: #868d9b;
  --accent: #5563f0;
  --accent-2: #8b4df0;
  --accent-bg: rgba(85, 99, 240, .09);
  --accent-ring: rgba(85, 99, 240, .28);
  --green: #108a5a;
  --green-bg: rgba(16, 138, 90, .09);
  --amber: #a86605;
  --amber-bg: rgba(214, 140, 20, .12);
  --red: #d93a40;
  --red-bg: rgba(217, 58, 64, .08);
  --blue: #1f6fd1;
  --blue-bg: rgba(31, 111, 209, .09);
  --purple: #8a3ccf;
  --purple-bg: rgba(138, 60, 207, .09);
  --cyan: #0b7d90;
  --code-bg: #f8f9fb;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 18px rgba(16, 24, 40, .07);
  --hl-k: #4a3fd1; --hl-f: #a1309f; --hl-s: #18794a; --hl-n: #b05000; --hl-c: #8e95a3;
  --hl-tbl: #087489; --hl-col: #3245b0; --hl-v: #c03535; --hl-o: #6a7181; --hl-t: #9a6700;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI Variable Text", "Segoe UI Variable", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
.mono, code, kbd, pre, .code, textarea.editor-ta { font-variant-ligatures: none; font-feature-settings: "calt" 0, "liga" 0; }
.mono, code, kbd, pre, .code { font-family: "Cascadia Code", "Cascadia Mono", Consolas, ui-monospace, "SF Mono", Menlo, monospace; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent-ring); }
[hidden] { display: none !important; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.pad { padding: 10px; }
.spacer { flex: 1 1 auto; }
.row { display: flex; align-items: center; }
.gap { gap: 8px; }
.ic { flex: none; }
kbd {
  font-size: 11px; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--border-2);
  border-bottom-width: 2px; background: var(--surface-2); color: var(--text-2);
}

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: 264px minmax(0, 1fr); height: 100vh; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.view { flex: 1 1 auto; overflow: auto; position: relative; outline: none; }

.sidebar {
  background: var(--sidebar); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; min-height: 0; padding: 14px 10px 0;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 14px; }
.brand-name { font-weight: 650; font-size: 15.5px; letter-spacing: -.01em; }
.brand-ver { font-size: 11px; color: var(--text-3); font-family: "Cascadia Code", Consolas, monospace; margin-top: 2px; }
.new-q { width: 100%; justify-content: flex-start; height: 36px; }
.new-q kbd { margin-left: auto; background: rgba(255, 255, 255, .15); color: #fff; border-color: rgba(255, 255, 255, .25); }
.nav { display: flex; flex-direction: column; gap: 1px; margin: 12px 0 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px;
  color: var(--text-2); font-weight: 500;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--surface-3); color: var(--text); }
.nav-item.active .ic { color: var(--accent); }
.side-section {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); font-weight: 600;
  padding: 14px 6px 6px 10px; border-top: 1px solid var(--border); margin-top: 8px;
}
.run-list { flex: 1 1 auto; overflow: auto; margin: 0 -6px; padding: 0 6px 10px; }
.run-item {
  display: flex; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text-2);
  border: 1px solid transparent;
}
.run-item:hover { background: var(--surface-2); text-decoration: none; }
.run-item.active { background: var(--surface-3); border-color: var(--border-2); }
.ri-main { display: flex; flex-direction: column; min-width: 0; gap: 3px; }
.ri-q {
  color: var(--text); font-size: 13px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ri-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 11.5px; color: var(--text-3); }
.ri-ans { font-family: "Cascadia Code", Consolas, monospace; color: var(--text-2); font-size: 11px; }
.ri-st.s-review { color: var(--amber); }
.ri-st.s-running { color: var(--blue); }
.ri-st.s-failed { color: var(--red); }
.vbadge { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 600; padding: 0 6px; border-radius: 99px; }
.vbadge.ok { color: var(--green); background: var(--green-bg); }
.vbadge.err { color: var(--red); background: var(--red-bg); }
.vbadge.warn { color: var(--amber); background: var(--amber-bg); }
.sdot { width: 8px; height: 8px; border-radius: 50%; flex: none; margin-top: 6px; background: var(--text-3); }
.sdot.s-completed { background: var(--green); }
.sdot.s-failed { background: var(--red); }
.sdot.s-rejected { background: transparent; border: 1.5px solid var(--text-3); }
.sdot.s-running { background: var(--blue); box-shadow: 0 0 0 0 var(--blue); animation: ping 1.6s infinite; }
.sdot.s-review { background: var(--amber); box-shadow: 0 0 0 0 var(--amber); animation: ping 1.6s infinite; }
.side-foot { padding: 10px 8px 10px 18px; border-top: 1px solid var(--border); font-size: 12px; margin: 0 -10px; }
.demo-foot { color: var(--amber); display: inline-flex; align-items: center; gap: 6px; }

.topbar {
  height: 52px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 18px 0 24px; border-bottom: 1px solid var(--border); background: var(--bg);
}
.tb-left { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.tb-title { font-weight: 600; font-size: 14px; white-space: nowrap; }
.tb-crumb { color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.chip-stat {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 12px; white-space: nowrap;
}
.chip-stat .ic { color: var(--text-3); }
.ss-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.ss-live .ss-dot { background: var(--green); animation: ping 1.6s infinite; }
.ss-live { color: var(--green); }
.ss-connecting .ss-dot, .ss-reconnecting .ss-dot { background: var(--amber); animation: blink 1s infinite; }
.ss-reconnecting { color: var(--amber); }
.ss-error .ss-dot { background: var(--red); }
.ss-error { color: var(--red); }
.db-badge {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 6px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .06em; white-space: nowrap; border: 1px solid;
}
.db-badge.synthetic {
  color: var(--amber); border-color: color-mix(in srgb, var(--amber) 55%, transparent);
  background: repeating-linear-gradient(-45deg, var(--amber-bg) 0 6px, transparent 6px 12px);
}
.db-badge.live { color: var(--red); border-color: color-mix(in srgb, var(--red) 55%, transparent); background: var(--red-bg); }
.db-badge.other { color: var(--text-2); border-color: var(--border-2); }
.db-sub { font-weight: 500; letter-spacing: 0; opacity: .8; font-family: "Cascadia Code", Consolas, monospace; font-size: 11px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }

.demo-banner {
  display: flex; align-items: center; gap: 10px; padding: 6px 18px 6px 24px; font-size: 12.5px;
  border-bottom: 1px solid var(--border); color: var(--text-2);
  background: linear-gradient(90deg, var(--accent-bg), transparent 70%);
}
.demo-banner > * { flex: none; white-space: nowrap; }
.demo-banner > .demo-msg { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.demo-banner > .spacer { flex: 1 1 auto; }
.demo-tag { background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 4px; letter-spacing: .08em; }

/* ---------- buttons / inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; padding: 0 12px;
  border-radius: 8px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text);
  font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s, filter .12s;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:focus-visible, .icon-btn:focus-visible, .chip:focus-visible, .step:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 92%, #fff), var(--accent)); border-color: transparent; color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 1px 2px rgba(0,0,0,.25); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn.secondary { background: var(--surface-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn.ghost.on { background: var(--accent-bg); color: var(--accent); }
.btn.danger-ghost { background: transparent; border-color: transparent; color: var(--red); }
.btn.danger-ghost:hover:not(:disabled) { background: var(--red-bg); }
.btn.danger { background: var(--red); border-color: transparent; color: #fff; }
.btn.link { background: none; border: 0; color: var(--accent); height: auto; padding: 0 4px; }
.btn.link:hover { text-decoration: underline; background: none; }
.btn.sm { height: 26px; padding: 0 8px; font-size: 12px; gap: 5px; }
.diffstat { display: inline-flex; gap: 4px; font-family: "Cascadia Code", Consolas, monospace; font-size: 11px; }
.diffstat .add { color: var(--green); font-weight: 600; }
.diffstat .del { color: var(--red); font-weight: 600; }

.input, .select {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 8px;
  padding: 8px 10px; color: var(--text); font: inherit; font-size: 13.5px; outline: none;
  transition: border-color .12s, box-shadow .12s;
}
textarea.input { resize: vertical; line-height: 1.45; }
.input:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.input.sm { padding: 4px 8px; font-size: 12.5px; width: 200px; }
.select { width: auto; padding: 4px 8px; font-size: 12.5px; cursor: pointer; }
.shake { animation: shake .35s; border-color: var(--red) !important; }
.fld { display: flex; flex-direction: column; gap: 5px; }
.fld > span { font-size: 12px; color: var(--text-3); font-weight: 600; }

.seg { display: inline-flex; border: 1px solid var(--border-2); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg-btn { border: 0; background: transparent; color: var(--text-2); padding: 4px 10px; font-size: 12px; cursor: pointer; text-transform: capitalize; }
.seg-btn + .seg-btn { border-left: 1px solid var(--border); }
.seg-btn:hover { background: var(--surface-2); }
.seg-btn.on { background: var(--accent-bg); color: var(--accent); font-weight: 600; }
.seg.tiny .seg-btn { padding: 2px 8px; font-size: 11.5px; text-transform: none; }

/* badges & pills */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 99px; font-size: 11px; font-weight: 600;
  border: 1px solid var(--border-2); color: var(--text-2); background: var(--surface-2); white-space: nowrap; line-height: 17px;
}
.badge.ok, .badge.status-verified { color: var(--green); background: var(--green-bg); border-color: transparent; }
.badge.warn, .badge.status-draft { color: var(--amber); background: var(--amber-bg); border-color: transparent; }
.badge.err, .badge.status-rejected { color: var(--red); background: var(--red-bg); border-color: transparent; }
.badge.accent, .badge.status-proposed { color: var(--accent); background: var(--accent-bg); border-color: transparent; }
.badge.status-deprecated, .badge.muted-b { color: var(--text-3); background: transparent; }
.badge.src { font-family: "Cascadia Code", Consolas, monospace; font-weight: 500; font-size: 10.5px; }
.badge.phi { color: var(--red); background: var(--red-bg); border-color: transparent; }
.badge.kind-fact, .badge.kind-lab { color: var(--blue); background: var(--blue-bg); border-color: transparent; }
.badge.kind-dim, .badge.kind-diagnosis { color: var(--purple); background: var(--purple-bg); border-color: transparent; }
.badge.kind-bridge, .badge.kind-medication { color: var(--cyan); border-color: transparent; background: color-mix(in srgb, var(--cyan) 12%, transparent); }
.badge.kind-procedure, .badge.kind-encounter { color: var(--green); background: var(--green-bg); border-color: transparent; }
.badge.pulse { animation: glow 2s infinite; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 2px 10px; border-radius: 99px; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.st-running { color: var(--blue); background: var(--blue-bg); }
.pill.st-running::before { animation: blink 1.2s infinite; }
.pill.st-review { color: var(--amber); background: var(--amber-bg); }
.pill.st-review::before { animation: blink 1.2s infinite; }
.pill.st-completed { color: var(--green); background: var(--green-bg); }
.pill.st-rejected { color: var(--text-2); background: var(--surface-3); }
.pill.st-failed { color: var(--red); background: var(--red-bg); }

/* spinners & animation */
.spin {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: .25; } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 50%, transparent); } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 0 var(--accent-ring); } 50% { box-shadow: 0 0 0 4px transparent; } }
@keyframes caret { 50% { opacity: 0; } }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes flash { 0% { background: var(--accent-bg); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { *, *::before { animation-duration: 0s !important; transition: none !important; } }

/* ---------- ask hero ---------- */
.ask-hero { max-width: 820px; margin: 0 auto; padding: 11vh 32px 60px; }
.hero-title h1 {
  font-size: 32px; letter-spacing: -.025em; margin: 0 0 8px; font-weight: 700;
  background: linear-gradient(100deg, var(--text) 30%, var(--accent) 75%, var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-title p { color: var(--text-2); font-size: 15px; margin: 0 0 22px; }
.composer {
  border: 1px solid var(--border-2); border-radius: 14px; background: var(--surface); padding: 14px 14px 10px;
  box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s;
}
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring), var(--shadow); }
.composer-input {
  width: 100%; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 16.5px; line-height: 1.5;
  resize: none; outline: none; min-height: 76px; padding: 2px 4px;
}
.composer-input::placeholder { color: var(--text-3); }
.composer-bar { display: flex; align-items: center; gap: 10px; padding-top: 8px; }
.composer-hint { color: var(--text-3); font-size: 12px; }
.model-pick { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); }
.model-pick .select { background: transparent; border-color: var(--border); }
.send-btn { padding: 0 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 13px; cursor: pointer; text-align: left;
}
.chip .ic { color: var(--accent); }
.chip:hover { border-color: var(--accent); color: var(--text); }
.hero-pipeline { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; margin-top: 56px; color: var(--text-3); font-size: 12px; }
.hp-step { padding: 3px 10px; border: 1px solid var(--border); border-radius: 99px; }
.hp-sep { display: inline-flex; opacity: .6; }

/* ---------- run ---------- */
.run { max-width: 1060px; margin: 0 auto; padding: 22px 32px 40px; min-height: 100%; }
.run-head { padding: 4px 0 10px; }
.run-head-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.run-meta { display: flex; align-items: center; gap: 14px; color: var(--text-3); font-size: 12px; flex-wrap: wrap; }
.meta-item { display: inline-flex; align-items: center; gap: 5px; }
.meta-id {
  display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; color: var(--text-3); cursor: pointer;
  font-family: "Cascadia Code", Consolas, monospace; font-size: 11.5px; padding: 0;
}
.meta-id:hover { color: var(--text); }
.run-q { font-size: 21px; font-weight: 600; letter-spacing: -.015em; line-height: 1.35; margin: 10px 0 6px; }
.run-now { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; min-height: 20px; }
.run-now b { font-weight: 600; color: var(--text); }
.now-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: blink 1s infinite; }
.now-dot.waiting { background: var(--amber); }

.stepper-wrap {
  position: sticky; top: 0; z-index: 5; margin: 0 -32px; padding: 12px 32px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.stepper { display: flex; align-items: flex-start; }
.step {
  flex: 0 0 auto; width: 66px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: 0; background: transparent; padding: 0; cursor: pointer; color: var(--text-3);
}
.step-dot {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--border-2); background: var(--surface); font-size: 11px; font-weight: 600; transition: all .2s;
}
.step-label { font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.step-sub { font-size: 10.5px; min-height: 14px; font-family: "Cascadia Code", Consolas, monospace; white-space: nowrap; color: var(--text-3); }
.step:hover .step-label { color: var(--text); }
.step.active { color: var(--accent); }
.step.active .step-dot { border-color: var(--accent); background: var(--accent-bg); box-shadow: 0 0 0 4px var(--accent-bg); }
.step.active .step-label { color: var(--text); }
.step.active .spin { width: 13px; height: 13px; }
.step.done .step-dot { border-color: var(--green); background: var(--green-bg); color: var(--green); }
.step.done .step-label { color: var(--text-2); }
.step.error .step-dot { border-color: var(--red); background: var(--red-bg); color: var(--red); }
.step.error .step-label, .step.error .step-sub { color: var(--red); }
.step.retry .step-dot { border-color: var(--amber); background: var(--amber-bg); color: var(--amber); }
.step.retry .step-sub { color: var(--amber); }
.step.waiting .step-dot { border-color: var(--amber); background: var(--amber-bg); color: var(--amber); animation: ping 1.6s infinite; }
.step.waiting .step-label, .step.waiting .step-sub { color: var(--amber); }
.step.skipped .step-dot { border-style: dashed; opacity: .6; }
.step.skipped .step-label { opacity: .6; }
.step-conn { flex: 1 1 0; min-width: 10px; height: 2px; background: var(--border-2); margin-top: 12px; border-radius: 2px; position: relative; transition: background .3s; }
.step-conn.filled { background: linear-gradient(90deg, var(--green), color-mix(in srgb, var(--green) 60%, var(--border-2))); }
.loop-badge {
  position: absolute; left: 50%; top: -11px; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 3px; font-size: 10px; font-weight: 600; white-space: nowrap;
  color: var(--amber); background: var(--amber-bg); border-radius: 99px; padding: 0 6px; line-height: 16px;
}

.feed { padding-top: 14px; }
.sec { position: relative; padding: 4px 0 6px 28px; animation: rise .25s ease-out; border-radius: 10px; }
.sec::before { content: ""; position: absolute; left: 6.5px; top: 22px; bottom: -6px; width: 2px; background: var(--border); }
.sec:last-child::before { display: none; }
.sec.flash { animation: flash 1.2s ease-out; }
.sec-head { display: flex; align-items: center; gap: 8px; min-height: 30px; }
.sec-dot {
  position: absolute; left: 0; top: 11px; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid var(--border-2); background: var(--bg);
}
.sec.active .sec-dot { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-bg); }
.sec.active .sec-dot::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; background: var(--accent); animation: blink 1s infinite; }
.sec.st-done .sec-dot { border-color: var(--green); background: var(--green); box-shadow: inset 0 0 0 2px var(--bg); }
.sec.st-error .sec-dot { border-color: var(--red); background: var(--red); box-shadow: inset 0 0 0 2px var(--bg); }
.sec.st-skipped .sec-dot { border-style: dashed; }
.sec-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-2); }
.sec.active .sec-title { color: var(--accent); }
.sec.st-error .sec-title { color: var(--red); }
.sec-summary { color: var(--text-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sec-time { color: var(--text-3); font-size: 11px; white-space: nowrap; }
.sec-body { padding: 2px 0 8px; min-width: 0; }
.pass-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0 10px; color: var(--accent); font-size: 12px; font-weight: 600; }
.pass-divider::before, .pass-divider::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--accent-ring), transparent); }
.pass-divider span { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; background: var(--accent-bg); }

/* streams */
.think { margin: 6px 0; border-left: 2px solid var(--border-2); padding: 0 0 0 12px; color: var(--text-3); }
.think summary {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 12px; color: var(--text-3);
  list-style: none; user-select: none; padding: 2px 0;
}
.think summary::-webkit-details-marker { display: none; }
.think summary:hover { color: var(--text-2); }
.think-title { font-weight: 600; }
.think-meta { font-family: "Cascadia Code", Consolas, monospace; font-size: 11px; opacity: .8; }
.think-body { white-space: pre-wrap; font-size: 13px; line-height: 1.55; padding: 4px 0 6px; font-style: italic; overflow-wrap: anywhere; }
.stream { margin: 8px 0; }
.stream-text { white-space: pre-wrap; font: inherit; font-size: 14.5px; line-height: 1.6; color: var(--text); margin: 0; overflow-wrap: anywhere; }
.stream-json {
  margin: 0; white-space: pre-wrap; font-size: 12px; line-height: 1.55; color: var(--text-2); overflow-wrap: anywhere;
  background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
}
.stream-sql pre { position: relative; }
.stream-label {
  display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 600; color: var(--accent);
  margin: 0 0 6px; text-transform: uppercase; letter-spacing: .06em;
}
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); animation: blink 1s infinite; }
.caret {
  display: inline-block; width: 7px; height: 1.05em; background: var(--accent); margin-left: 1px;
  vertical-align: text-bottom; animation: caret 1s steps(1) infinite; border-radius: 1px;
}
.think .caret { background: var(--text-3); }
details.raw { margin-top: 12px; }
details.raw summary { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 12px; cursor: pointer; list-style: none; }
details.raw summary::-webkit-details-marker { display: none; }
details.raw pre { margin-top: 8px; }

/* tool chips */
.tool { margin: 6px 0; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); overflow: hidden; animation: rise .2s ease-out; }
.tool-head {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px 10px; border: 0; background: transparent;
  cursor: pointer; font-size: 12.5px; color: var(--text-2); text-align: left; min-width: 0;
}
.tool-head:hover { background: var(--surface-2); }
.tool-state { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--accent); }
.tool-state .spin { width: 11px; height: 11px; }
.tool.ok .tool-state { color: var(--green); background: var(--green-bg); }
.tool.fail .tool-state { color: var(--red); background: var(--red-bg); }
.tool.fail { border-color: color-mix(in srgb, var(--red) 40%, var(--border)); }
.tool-name { font-family: "Cascadia Code", Consolas, monospace; color: var(--accent); font-weight: 600; white-space: nowrap; flex: none; }
.tool-args { font-family: "Cascadia Code", Consolas, monospace; color: var(--text-3); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 40px; max-width: 42%; }
.tool-sum { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; min-width: 0; }
.tool-sum:not(:empty)::before { content: "→ "; color: var(--text-3); }
.tool-ms { font-family: "Cascadia Code", Consolas, monospace; font-size: 11px; color: var(--text-3); flex: none; }
.tool-chev { display: inline-flex; color: var(--text-3); transition: transform .15s; flex: none; }
.tool.open .tool-chev { transform: rotate(90deg); }
.tool-body { border-top: 1px solid var(--border); padding: 8px 12px 12px; background: var(--surface); }
.tool-sec-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); margin: 6px 0 5px; }
pre.json {
  margin: 0; font-size: 12px; line-height: 1.5; background: var(--code-bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 11px; overflow: auto; max-height: 300px; color: var(--text-2); white-space: pre;
}

/* cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin: 10px 0; animation: rise .25s ease-out; min-width: 0; }
.card-head { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-bottom: 1px solid var(--border); min-height: 44px; flex-wrap: wrap; }
.card-icon { display: inline-flex; color: var(--accent); }
.card-title { font-weight: 600; font-size: 13.5px; }
.card-sub { color: var(--text-3); font-size: 12px; }
.card-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card-body { padding: 14px; min-width: 0; }
.block { margin-top: 16px; }
.block:first-child { margin-top: 0; }
.block-label {
  display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .07em; margin-bottom: 8px;
}

/* spec */
.restated {
  font-size: 15px; line-height: 1.5; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--accent-bg);
  border-radius: 4px 8px 8px 4px;
}
.kv-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.kv { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; min-width: 0; }
.kv .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); font-weight: 700; }
.kv .v { font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.crit { display: inline-flex; align-items: stretch; border: 1px solid var(--border-2); border-radius: 7px; overflow: hidden; font-size: 12.5px; background: var(--surface-2); }
.crit > span { padding: 3px 8px; }
.crit-kind { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; display: flex; align-items: center; color: var(--text-2); background: var(--surface-3); }
.crit-diagnosis .crit-kind { color: var(--purple); background: var(--purple-bg); }
.crit-lab .crit-kind { color: var(--blue); background: var(--blue-bg); }
.crit-procedure .crit-kind, .crit-encounter .crit-kind { color: var(--green); background: var(--green-bg); }
.crit-medication .crit-kind { color: var(--cyan); background: color-mix(in srgb, var(--cyan) 12%, transparent); }
.crit-demographic .crit-kind { color: var(--amber); background: var(--amber-bg); }
.crit-concept { font-weight: 600; }
.crit-detail { color: var(--text-2); font-family: "Cascadia Code", Consolas, monospace; font-size: 11.5px; display: flex; align-items: center; border-left: 1px solid var(--border); }
.crit-op { font-family: "Cascadia Code", Consolas, monospace; font-size: 11.5px; color: var(--amber); border-left: 1px solid var(--border); display: flex; align-items: center; }
.ambig-list { display: grid; gap: 8px; }
.ambig { border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent); background: var(--amber-bg); border-radius: 9px; padding: 9px 12px; }
.ambig-q { color: var(--text-2); font-size: 13px; }
.ambig-a { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; font-weight: 600; font-size: 13.5px; }
.ambig-tag { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--bg); background: var(--amber); padding: 1px 6px; border-radius: 4px; font-weight: 700; flex: none; }

/* plan graph */
.graph-scroll { overflow-x: auto; padding: 4px 0 2px; }
.plan-graph { display: block; height: auto; width: 100%; margin: 0 auto; }
.plan-graph .node .box { fill: var(--surface-2); stroke: var(--border-2); stroke-width: 1; }
.plan-graph .node.role-base .box { stroke: var(--accent); stroke-width: 1.5; }
.plan-graph .node .stripe { fill: var(--text-3); }
.plan-graph .node.role-base .stripe { fill: var(--accent); }
.plan-graph .node.role-filter .stripe { fill: var(--purple); }
.plan-graph .node:hover .box { stroke: var(--accent); }
.plan-graph .nname { font: 600 12px "Cascadia Code", Consolas, monospace; fill: var(--text); }
.plan-graph .nsub { font: 10.5px "Segoe UI Variable Text", system-ui, sans-serif; fill: var(--text-3); }
.edge { fill: none; stroke: var(--text-3); }
.edge.unverified { stroke-dasharray: 6 5; }
.edge.conf-high { stroke: var(--green); }
.edge.conf-good { stroke: var(--blue); }
.edge.conf-med { stroke: var(--amber); }
.edge.conf-low { stroke: var(--red); }
.graph-legend line.edge { stroke-width: 2; }
.elabel rect { fill: var(--surface); stroke: var(--border-2); }
.elabel.conf-high rect { stroke: color-mix(in srgb, var(--green) 50%, transparent); }
.elabel.conf-good rect { stroke: color-mix(in srgb, var(--blue) 50%, transparent); }
.elabel.conf-med rect { stroke: color-mix(in srgb, var(--amber) 60%, transparent); }
.elabel.conf-low rect { stroke: color-mix(in srgb, var(--red) 60%, transparent); }
.elabel text { font: 10.5px "Cascadia Code", Consolas, monospace; fill: var(--text-2); }
.graph-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 11.5px; color: var(--text-3); margin: 8px 0 12px; }
.lg-item { display: inline-flex; align-items: center; gap: 6px; }
.lg-sep { width: 1px; height: 14px; background: var(--border-2); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.sw.conf-high { background: var(--green); } .sw.conf-good { background: var(--blue); } .sw.conf-med { background: var(--amber); } .sw.conf-low { background: var(--red); }
.conf { position: relative; display: inline-block; width: 74px; height: 18px; border-radius: 4px; background: var(--surface-3); overflow: hidden; vertical-align: middle; flex: none; }
.conf i { position: absolute; left: 0; top: 0; bottom: 0; opacity: .35; }
.conf b { position: relative; font: 600 11px/18px "Cascadia Code", Consolas, monospace; padding-left: 6px; }
.conf.conf-high i { background: var(--green); } .conf.conf-high b { color: var(--green); }
.conf.conf-good i { background: var(--blue); } .conf.conf-good b { color: var(--blue); }
.conf.conf-med i { background: var(--amber); } .conf.conf-med b { color: var(--amber); }
.conf.conf-low i { background: var(--red); } .conf.conf-low b { color: var(--red); }
.filter-list, .assume-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.filter-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; font-size: 13px; }
.filter-list code, code.sqlish { font-size: 12px; background: var(--code-bg); border: 1px solid var(--border); padding: 1px 7px; border-radius: 5px; }
.assume-list li { position: relative; padding-left: 18px; font-size: 13px; color: var(--text-2); }
.assume-list li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: .7; }
td.sqlish { font-size: 11.5px; }

/* code */
pre.code {
  margin: 0; font-size: 12.5px; line-height: 1.62; background: var(--code-bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; overflow: auto; color: var(--text); tab-size: 2; max-height: 560px;
}
pre.code .line { display: block; white-space: pre; min-height: 1.62em; }
pre.code.ln .line::before {
  content: attr(data-n); display: inline-block; width: 2.6ch; margin-right: 16px; text-align: right;
  color: var(--text-3); opacity: .55; user-select: none;
}
pre.code.diff .line::before { content: attr(data-op); display: inline-block; width: 1.5ch; margin-right: 12px; color: var(--text-3); user-select: none; }
pre.code.diff .line.add { background: var(--green-bg); }
pre.code.diff .line.add::before { color: var(--green); }
pre.code.diff .line.del { background: var(--red-bg); opacity: .85; }
pre.code.diff .line.del::before { color: var(--red); }
pre.code.diff .line { margin: 0 -14px; padding: 0 14px; }
pre.code.stream { white-space: pre-wrap; }
.hl-k { color: var(--hl-k); font-weight: 600; }
.hl-f { color: var(--hl-f); }
.hl-s { color: var(--hl-s); }
.hl-n { color: var(--hl-n); }
.hl-c { color: var(--hl-c); font-style: italic; }
.hl-tbl { color: var(--hl-tbl); }
.hl-col { color: var(--hl-col); }
.hl-v { color: var(--hl-v); }
.hl-o { color: var(--hl-o); }
.hl-t { color: var(--hl-t); }
.hl-p { color: var(--text-3); }

.editor { position: relative; background: var(--code-bg); border: 1px solid var(--border-2); border-radius: 10px; transition: border-color .12s, box-shadow .12s; }
.editor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.editor.disabled { opacity: .7; }
.editor-hl, .editor-ta {
  margin: 0; padding: 12px 14px; border: 0; font-family: "Cascadia Code", "Cascadia Mono", Consolas, ui-monospace, monospace;
  font-size: 12.5px; line-height: 1.62; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2; letter-spacing: 0;
}
.editor pre.editor-hl { position: absolute; inset: 0; overflow: hidden; background: transparent; border-radius: 10px; max-height: none; pointer-events: none; }
.editor-ta {
  position: relative; display: block; width: 100%; resize: none; background: transparent; color: transparent;
  caret-color: var(--text); outline: none; overflow: hidden; min-height: 80px;
}
.editor-ta::selection { background: var(--accent-ring); color: transparent; }

/* validation */
.val-card.is-fail { border-color: color-mix(in srgb, var(--red) 40%, var(--border)); }
.val-card.is-fail .card-icon { color: var(--red); }
.val-card.is-ok .card-icon { color: var(--green); }
.issues { list-style: none; margin: 0; padding: 0; }
.issue { display: flex; align-items: flex-start; gap: 9px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.issue:last-child { border-bottom: 0; }
.lvl { display: inline-flex; margin-top: 1px; }
.lvl-error { color: var(--red); } .lvl-warn, .lvl-warning { color: var(--amber); } .lvl-info { color: var(--blue); }
.issue-code { font-size: 11px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 0 6px; white-space: nowrap; margin-top: 1px; }
.issue-msg { flex: 1; line-height: 1.45; }

/* funnel */
.funnel { display: grid; gap: 6px; }
.f-row { display: grid; grid-template-columns: minmax(200px, 1.4fr) minmax(120px, 2fr) 74px 66px; gap: 12px; align-items: center; }
.f-label { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.f-idx { width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); font-size: 10.5px; font-weight: 700; flex: none; }
.f-lt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.f-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-step { font-size: 10.5px; color: var(--text-3); }
.f-track { height: 22px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.f-bar { height: 100%; border-radius: 6px; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 75%, transparent), var(--accent)); transition: width .7s cubic-bezier(.2, .8, .2, 1); }
.f-row.last .f-bar { background: linear-gradient(90deg, color-mix(in srgb, var(--green) 70%, transparent), var(--green)); }
.f-count { text-align: right; font-family: "Cascadia Code", Consolas, monospace; font-weight: 600; font-variant-numeric: tabular-nums; }
.f-row.last .f-count { color: var(--green); }
.f-delta { text-align: right; font-size: 11.5px; font-family: "Cascadia Code", Consolas, monospace; color: var(--text-3); }
.f-delta .neg { color: var(--text-3); }
.f-delta .pos { color: var(--amber); }
.funnel.compact .f-row { grid-template-columns: minmax(160px, 1.2fr) minmax(100px, 2fr) 70px 62px; }
.funnel.compact .f-track { height: 14px; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.checks li { display: flex; align-items: baseline; gap: 9px; padding: 5px 0; font-size: 13px; }
.chk-ic { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; flex: none; align-self: center; }
.checks li.ok .chk-ic { color: var(--green); background: var(--green-bg); }
.checks li.fail .chk-ic { color: var(--red); background: var(--red-bg); }
.chk-name { font-weight: 600; flex: none; }
.chk-msg { color: var(--text-2); }

/* review */
.review-card { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.review-card.awaiting { box-shadow: 0 0 0 3px var(--accent-bg), var(--shadow); }
.review-card .card-head { background: linear-gradient(90deg, var(--accent-bg), transparent 60%); border-radius: 12px 12px 0 0; }
.prose { font-size: 14px; line-height: 1.6; }
.prose p { margin: 0 0 .7em; }
.prose p:last-child { margin-bottom: 0; }
.prose ul, .prose ol { margin: .3em 0 .7em; padding-left: 1.3em; }
.prose li { margin: .15em 0; }
.prose code { font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); padding: 0 5px; border-radius: 4px; }
.prose strong { font-weight: 650; }
.prose h3, .prose h4, .prose h5, .prose h6 { margin: .8em 0 .35em; font-size: 14px; }
.prose blockquote { margin: .5em 0; padding: 2px 12px; border-left: 3px solid var(--border-2); color: var(--text-2); }
.prose pre.code { margin: .5em 0; }
.definition { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; font-size: 14.5px; }
.review-actions { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.review-actions .btn.primary { height: 36px; padding: 0 16px; font-size: 13.5px; }
.kbd-hint { color: var(--text-3); font-size: 12px; max-width: 300px; text-align: right; }
.review-panel { margin-top: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; display: grid; gap: 8px; }
.panel-label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.review-status { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 12px; border-radius: 8px; font-weight: 600; font-size: 13px; background: var(--surface-2); }
.review-status.ok { color: var(--green); background: var(--green-bg); }
.review-status.err { color: var(--red); background: var(--red-bg); }
.review-status.accent { color: var(--accent); background: var(--accent-bg); }

/* result */
.result-card { border-color: color-mix(in srgb, var(--green) 35%, var(--border)); }
.result-card .card-icon { color: var(--green); }
.answer { padding: 14px 6px 8px; }
.answer-num {
  font-size: 60px; font-weight: 700; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums;
  background: linear-gradient(120deg, var(--text), var(--green)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.answer-label { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-2); font-weight: 700; margin-top: 8px; }
.answer-q { color: var(--text-3); font-size: 13px; margin-top: 4px; }
.trunc { margin-top: 8px; display: flex; align-items: center; gap: 4px; }

/* tables */
.table-wrap { overflow: auto; max-height: 460px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.table-wrap.mini { max-height: 260px; margin-top: 10px; }
.table-wrap.tall { max-height: 560px; border: 0; border-radius: 0 0 12px 12px; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl th {
  position: sticky; top: 0; z-index: 1; background: var(--surface-2); text-align: left; font-size: 11px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-3); font-weight: 700; padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.tbl td { padding: 7px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; font-family: "Cascadia Code", Consolas, monospace; white-space: nowrap; }
.tbl td.null { color: var(--text-3); font-style: italic; font-size: 11.5px; }
.table-wrap.mini .tbl { font-size: 12px; }
.table-wrap.mini .tbl td, .table-wrap.mini .tbl th { padding: 5px 10px; }
.tbl.joins td { vertical-align: middle; }
.tbl.joins td:first-child { white-space: nowrap; }

/* feedback */
.feedback { margin-top: 12px; border: 1px dashed var(--border-2); border-radius: 12px; padding: 12px 14px; background: var(--surface); }
.fb-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fb-choices { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fb-q { font-weight: 600; color: var(--text-2); margin-right: 4px; }
.fb-btn.sel.fb-correct { background: var(--green-bg); color: var(--green); border-color: var(--green); }
.fb-btn.sel.fb-incorrect { background: var(--red-bg); color: var(--red); border-color: var(--red); }
.fb-btn.sel.fb-unsure { background: var(--amber-bg); color: var(--amber); border-color: var(--amber); }
.fb-form { display: grid; gap: 8px; margin-top: 12px; }
.fb-extra { display: grid; gap: 8px; }
.fb-sql summary { cursor: pointer; color: var(--text-2); font-size: 12.5px; margin-bottom: 6px; }
.fb-saved { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.verdict { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-weight: 600; font-size: 12.5px; }
.verdict.v-correct { color: var(--green); background: var(--green-bg); }
.verdict.v-incorrect { color: var(--red); background: var(--red-bg); }
.verdict.v-unsure { color: var(--amber); background: var(--amber-bg); }
.gold-form { display: grid; grid-template-columns: 1fr 200px; gap: 10px; margin-top: 12px; align-items: end; }
.gold-form .row { grid-column: 1 / -1; }
.ok-line { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; color: var(--green); font-size: 13px; }

.err-card { border: 1px solid color-mix(in srgb, var(--red) 45%, transparent); background: var(--red-bg); border-radius: 10px; padding: 11px 14px; margin: 8px 0; animation: rise .25s; }
.err-head { display: flex; align-items: center; gap: 8px; color: var(--red); font-weight: 650; font-size: 13.5px; }
.err-msg { margin-top: 5px; white-space: pre-wrap; font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
.err-inline { display: flex; gap: 6px; align-items: center; color: var(--red); font-size: 12.5px; padding: 10px; }
.done-line { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; padding: 6px 0; }
.done-line.st-completed { color: var(--green); }
.done-line.st-rejected { color: var(--text-2); }
.done-line.st-failed { color: var(--red); }
.unknown-ev { font-size: 12px; color: var(--text-3); padding: 4px 0; }

.live-pill {
  position: sticky; bottom: 18px; z-index: 6; display: flex; align-items: center; gap: 6px; margin: 0 auto; width: max-content;
  border: 0; border-radius: 99px; padding: 7px 14px; background: var(--accent); color: #fff; font-size: 12.5px; font-weight: 600;
  cursor: pointer; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); animation: rise .2s;
}

/* ---------- pages ---------- */
.page { max-width: 1120px; margin: 0 auto; padding: 26px 32px 80px; }
.page.wide { max-width: 1440px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -.015em; font-weight: 650; }
.page-head p { margin: 0; max-width: 70ch; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--text-3); padding: 48px; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 64px 20px; color: var(--text-3); }
.empty h3 { margin: 6px 0 0; color: var(--text); font-size: 15px; }
.empty p { margin: 0 0 10px; max-width: 60ch; }
.empty.small { padding: 30px; }
.boot { height: 100%; display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; }
.boot .logo { animation: blink 1.4s infinite; }

/* gold */
.score-card { display: flex; align-items: center; gap: 18px; padding: 14px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); margin-bottom: 14px; }
.score-num { font-size: 30px; font-weight: 700; font-family: "Cascadia Code", Consolas, monospace; min-width: 84px; letter-spacing: -.02em; }
.score-text { flex: 1; display: grid; gap: 8px; }
.score-title { font-weight: 600; color: var(--text-2); }
.progress { display: flex; height: 6px; background: var(--surface-3); border-radius: 6px; overflow: hidden; max-width: 460px; }
.progress i { display: block; height: 100%; transition: width .4s; }
.progress i.pass { background: var(--green); }
.progress i.fail { background: var(--red); }
.add-gold { margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 240px; gap: 12px; }
.span2 { grid-column: 1 / -1; }
.gold-table .table-wrap { max-height: none; }
.tbl.gold td { vertical-align: middle; }
.gq { font-size: 13.5px; }
.gtags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 4px; }
.gtags:empty { display: none; }
.w-status { width: 92px; }
.w-link { width: 48px; text-align: right; }
.gstat { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; }
.gstat.pass { color: var(--green); background: var(--green-bg); }
.gstat.fail { color: var(--red); background: var(--red-bg); }
.gstat.running { color: var(--accent); background: var(--accent-bg); }
.gstat.running .spin { width: 10px; height: 10px; }
.gstat.none { color: var(--text-3); }
td.bad { color: var(--red); }
tr.is-running td { background: color-mix(in srgb, var(--accent-bg) 50%, transparent); }
tr.sql-row td { background: var(--code-bg); padding: 10px 12px; }

/* schema */
.schema-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.schema-side {
  position: sticky; top: 0; max-height: calc(100vh - 150px); overflow: auto; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); padding: 10px;
}
.search-box { display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--surface-2); color: var(--text-3); }
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.search-box .input { border: 0; background: transparent; box-shadow: none; padding: 8px 0; }
.search-box.grow { flex: 1 1 260px; }
.search-results.busy { opacity: .6; }
.side-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 700; padding: 12px 6px 5px; }
.sr-item { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 7px; color: var(--text-2); }
.sr-item:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.sr-item.active { background: var(--accent-bg); color: var(--text); }
.sr-item.active .ic { color: var(--accent); }
.sr-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sr-name { font-family: "Cascadia Code", Consolas, monospace; font-size: 12.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-desc { font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-score { width: 30px; height: 4px; background: var(--surface-3); border-radius: 4px; overflow: hidden; flex: none; }
.sr-score i { display: block; height: 100%; background: var(--accent); }
.td-head { margin-bottom: 6px; }
.td-title { display: flex; align-items: center; gap: 10px; color: var(--accent); }
.td-title h2 { margin: 0; font-size: 20px; color: var(--text); overflow-wrap: anywhere; }
.td-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px; }
.td-desc { color: var(--text-2); margin: 8px 0; max-width: 80ch; }
.td-gran { display: inline-flex; gap: 8px; font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--border); padding: 4px 10px; border-radius: 7px; }
.td-gran .k { color: var(--text-3); font-weight: 600; }
.tbl.cols .colname, .tbl.cols td:nth-child(2), .tbl.cols td:nth-child(3) { white-space: nowrap; }
.tbl.cols td.desc { color: var(--text-2); font-size: 12.5px; min-width: 200px; }
.pk { color: var(--amber); display: inline-flex; margin-right: 5px; vertical-align: -1px; }
.edge-list { display: flex; flex-direction: column; }
.edge-row { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--border); font-size: 13px; min-width: 0; }
.edge-row > * { flex: none; }
.edge-row > .spacer { flex: 1 1 auto; }
.edge-row .e-other { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.edge-row .e-extra { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-tbl { color: var(--text-2); font-family: "Cascadia Code", Consolas, monospace; }
.edge-row:last-child { border-bottom: 0; }
.e-mine { color: var(--text); }
.e-arrow { color: var(--green); letter-spacing: -2px; }
.edge-row.unverified .e-arrow { color: var(--amber); }
.e-other { font-weight: 600; }
.e-extra { font-size: 11.5px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 5px; }

/* knowledge */
.kn-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.tab { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 0; border-radius: 7px; background: transparent; color: var(--text-2); cursor: pointer; font-size: 13px; font-weight: 500; }
.tab.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tab .count { font-size: 11px; background: var(--surface-3); padding: 0 6px; border-radius: 99px; color: var(--text-3); }
.concept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.concept { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 13px 15px; position: relative; overflow: hidden; }
.concept::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--border-2); }
.concept.st-verified::before { background: var(--green); }
.concept.st-draft::before { background: var(--amber); }
.concept.st-proposed::before { background: var(--accent); }
.concept-head { display: flex; align-items: center; gap: 6px; }
.concept-name { font-weight: 650; font-size: 14.5px; }
.concept-id { margin-top: 2px; }
.concept-desc { color: var(--text-2); font-size: 13px; margin: 8px 0; line-height: 1.5; }
.codes { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.codepill { font-size: 11px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 0 6px; color: var(--text-2); }
.notes { display: grid; gap: 10px; }
.note { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.note summary { display: flex; align-items: center; gap: 8px; padding: 12px 16px; cursor: pointer; font-weight: 600; list-style: none; }
.note summary::-webkit-details-marker { display: none; }
.note summary .ic { color: var(--text-3); transition: transform .15s; }
.note[open] summary .ic { transform: rotate(90deg); }
.note .prose { padding: 0 18px 14px 38px; color: var(--text-2); }

/* toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 50; pointer-events: none; }
.toast {
  background: var(--surface-3); color: var(--text); border: 1px solid var(--border-2); border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 10px 14px; box-shadow: var(--shadow); font-size: 13px; max-width: 420px;
  opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s;
}
.toast.in { opacity: 1; transform: none; }
.toast-ok { border-left-color: var(--green); }
.toast-error { border-left-color: var(--red); }

/* ---------- LLM call chips (run view) ---------- */
.llm-chip {
  display: inline-flex; align-items: center; gap: 7px; margin: 5px 0 2px; padding: 1px 9px 1px 6px; border-radius: 6px;
  border: 1px dashed var(--border-2); color: var(--text-3); font: 11px/18px "Cascadia Code", Consolas, monospace; max-width: 100%;
}
.llm-chip + .stream, .llm-chip + .think { margin-top: 2px; }
.llm-ic { display: inline-grid; place-items: center; width: 12px; color: var(--accent); }
.llm-ic .spin { width: 10px; height: 10px; }
.llm-n { color: var(--text-2); font-weight: 600; }
.llm-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.llm-chip.pending { border-color: color-mix(in srgb, var(--accent) 45%, var(--border-2)); }
.llm-chip.fail { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.llm-q { color: var(--amber); font-weight: 600; }

/* ---------- activity dock ---------- */
.dock { flex: none; position: relative; border-top: 1px solid var(--border); background: var(--sidebar); min-width: 0; }
.dk-handle { position: absolute; left: 0; right: 0; top: -4px; height: 8px; cursor: ns-resize; z-index: 8; }
.dock:not(.open) .dk-handle { display: none; }
body.dragging, body.dragging * { cursor: ns-resize !important; user-select: none !important; }
.dk-bar {
  display: flex; align-items: center; gap: 9px; width: 100%; height: 34px; padding: 0 14px 0 20px; border: 0; background: transparent;
  color: var(--text-2); font-size: 12.5px; cursor: pointer; text-align: left; min-width: 0;
}
.dk-bar:hover { background: var(--surface); }
.dk-title { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); flex: none; }
.dk-dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--text-3); flex: none; }
.dk-dot.on { border: 0; background: var(--green); animation: ping 1.6s infinite; color: var(--green); }
.dk-dot.on.st-wait, .dk-dot.on.st-review { background: var(--amber); color: var(--amber); }
.dk-dot.on.st-prompt, .dk-dot.on.st-tool { background: var(--blue); color: var(--blue); }
.dk-status { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; white-space: nowrap; flex: 0 1 auto; }
.dk-status b { color: var(--text); font-weight: 600; font-family: "Cascadia Code", Consolas, monospace; font-size: 12px; }
.dk-status .sep { color: var(--text-3); }
.dk-q { color: var(--text-3); overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dk-st.st-gen { color: var(--green); }
.dk-st.st-wait, .dk-st.st-review { color: var(--amber); font-weight: 600; }
.dk-st.st-prompt, .dk-st.st-tool { color: var(--blue); }
.dk-st.st-fin { color: var(--text-3); }
.dk-count { font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-bg); padding: 0 8px; border-radius: 99px; line-height: 18px; flex: none; }
.dk-models { font-family: "Cascadia Code", Consolas, monospace; font-size: 11px; color: var(--text-3); white-space: nowrap; flex: none; }
.dk-stream { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); flex: none; }
.dk-stream.ss-live { background: var(--green); }
.dk-stream.ss-connecting, .dk-stream.ss-reconnecting { background: var(--amber); animation: blink 1s infinite; }
.dk-stream.ss-error { background: var(--red); }
.dk-chev { display: inline-flex; color: var(--text-3); transition: transform .2s; flex: none; transform: rotate(180deg); }
.dock.open .dk-chev { transform: none; }
.dk-body { display: grid; grid-template-columns: 290px minmax(0, 1fr); overflow: hidden; transition: height .2s ease; border-top: 1px solid var(--border); }
.dock:not(.open) .dk-body { border-top: 0; }
body.dragging .dk-body { transition: none; }
.dk-side { overflow: auto; padding: 4px 10px 12px 14px; border-right: 1px solid var(--border); min-width: 0; }
.dk-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); padding: 10px 2px 5px; }
.dk-empty { padding: 4px 2px; }
.dk-run { padding: 7px 9px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; margin-bottom: 3px; }
.dk-run:hover { background: var(--surface-2); }
.dk-run.sel { background: var(--surface-3); border-color: var(--border-2); }
.dk-run.fin { opacity: .65; }
.dk-run-top { display: flex; align-items: center; gap: 7px; min-width: 0; }
.dk-run-q { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--text); }
.dk-open { display: inline-flex; color: var(--text-3); flex: none; }
.dk-open:hover { color: var(--accent); }
.dk-run-meta { display: flex; flex-wrap: wrap; gap: 2px 8px; font-size: 11.5px; color: var(--text-3); margin-top: 3px; padding-left: 2px; }
.src { font-size: 9.5px; font-weight: 800; letter-spacing: .06em; padding: 0 5px; border-radius: 4px; line-height: 16px; flex: none; background: var(--surface-3); color: var(--text-2); }
.src-ui { background: var(--accent-bg); color: var(--accent); }
.src-eval { background: var(--purple-bg); color: var(--purple); }
.src-cli { background: color-mix(in srgb, var(--cyan) 14%, transparent); color: var(--cyan); }
.dk-model { display: flex; align-items: center; gap: 6px; font-size: 11.5px; padding: 3px 2px; min-width: 0; }
.dk-model .mono { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-model .muted { white-space: nowrap; }
.dk-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.dk-con-head { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-bottom: 1px solid var(--border); min-width: 0; }
.dk-select { max-width: 280px; min-width: 0; }
.dk-con-q { color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 0 1 auto; }
.dk-console {
  flex: 1; overflow: auto; padding: 8px 14px 12px; font: 11.5px/1.55 "Cascadia Code", "Cascadia Mono", Consolas, monospace;
  background: var(--code-bg); color: var(--text-2); font-variant-ligatures: none; min-height: 0;
}
.c-line { display: flex; gap: 8px; align-items: baseline; padding: 1px 0; min-width: 0; }
.c-ts { color: var(--text-3); opacity: .7; flex: none; }
.c-head { color: var(--text); flex: none; font-weight: 600; }
.c-rest { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.c-stage .c-head { color: var(--accent); }
.c-stage-done .c-head { color: var(--green); }
.c-llm .c-head, .c-llm-end .c-head { color: var(--purple); }
.c-tool .c-head, .c-tool-res .c-head { color: var(--blue); }
.c-run .c-head { color: var(--accent); }
.c-ok .c-head { color: var(--green); }
.c-warn .c-head, .c-rest.c-warn { color: var(--amber); }
.c-err .c-head, .c-err .c-rest { color: var(--red); }
.c-think { white-space: pre-wrap; color: var(--text-3); font-style: italic; padding: 2px 0 2px 10px; border-left: 2px solid var(--border-2); margin: 2px 0 2px 66px; overflow-wrap: anywhere; }
.c-content { white-space: pre-wrap; color: var(--text); padding: 2px 0 2px 10px; border-left: 2px solid var(--accent-ring); margin: 2px 0 2px 66px; overflow-wrap: anywhere; }

/* ---------- cohorts & analysis ---------- */
.ic.flip { transform: rotate(180deg); }
.nowrap { white-space: nowrap; }
.colgroups { display: grid; gap: 8px; }
.colgroup { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.cg-label { flex: none; width: 118px; display: inline-flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding-top: 3px; }
.cg-label b { font-weight: 600; color: var(--text-3); font-family: "Cascadia Code", Consolas, monospace; }
.cg-chips { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.colchip { display: inline-flex; align-items: center; gap: 4px; font: 11.5px/18px "Cascadia Code", Consolas, monospace; padding: 0 7px; border-radius: 5px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); }
.colchip.kind-key { border-left: 3px solid var(--text-3); }
.colchip.kind-demographic { border-left: 3px solid var(--purple); }
.colchip.kind-outcome { border-left: 3px solid var(--amber); }
.colchip.kind-lab { border-left: 3px solid var(--blue); }
.colchip.kind-note { border-left: 3px solid var(--cyan); }
.colchip.phi .ic, .th-lock .ic { color: var(--red); }
.th-lock { display: inline-flex; margin-right: 4px; vertical-align: -1px; }
.badge.kind-note { color: var(--cyan); background: color-mix(in srgb, var(--cyan) 12%, transparent); border-color: transparent; }
.badge.kindb-key { color: var(--text-2); }
.badge.kindb-demographic { color: var(--purple); background: var(--purple-bg); border-color: transparent; }
.badge.kindb-outcome { color: var(--amber); background: var(--amber-bg); border-color: transparent; }
.badge.kindb-lab { color: var(--blue); background: var(--blue-bg); border-color: transparent; }
.badge.kindb-note { color: var(--cyan); background: color-mix(in srgb, var(--cyan) 12%, transparent); border-color: transparent; }

.ptable { min-width: 0; }
.ptable.busy .ptable-wrap { opacity: .6; }
.pt-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.pt-search { width: 300px; max-width: 100%; }
.pt-search .input { padding: 6px 0; font-size: 13px; width: 100%; }
.pt-range { margin-right: 4px; white-space: nowrap; }
.ptable-wrap { max-height: 560px; }
.ptable-wrap.compact { max-height: 340px; }
.tbl.wide td { white-space: nowrap; }
.tbl.wide th { text-transform: none; letter-spacing: 0; font: 600 11.5px "Cascadia Code", Consolas, monospace; color: var(--text-2); }
.tbl.wide th.kind-demographic { box-shadow: inset 0 2px 0 var(--purple); }
.tbl.wide th.kind-outcome { box-shadow: inset 0 2px 0 var(--amber); }
.tbl.wide th.kind-lab { box-shadow: inset 0 2px 0 var(--blue); }
.tbl.wide th.kind-note { box-shadow: inset 0 2px 0 var(--cyan); }
.tbl.wide th.kind-key { box-shadow: inset 0 2px 0 var(--text-3); }
.cell { display: inline-block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.tbl.wide td.open .cell { white-space: normal; max-width: 480px; overflow-wrap: anywhere; }
.tbl.wide td:has(.cell[title]) { cursor: zoom-in; }
.tbl.wide td.open { cursor: zoom-out; }
.tbl.wide td.null { color: var(--text-3); }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.sel td { background: var(--accent-bg) !important; }

.export-group { display: inline-flex; align-items: center; border: 1px solid var(--border-2); border-radius: 8px; overflow: hidden; background: var(--surface); }
.eg-label { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--text-3); padding: 0 8px 0 9px; border-right: 1px solid var(--border); height: 26px; }
.export-group .btn { border-radius: 0; height: 26px; }
.export-group .btn .muted { font-size: 10.5px; }

.analyze-box { border: 1px solid var(--border-2); border-radius: 12px; background: var(--surface); padding: 10px 12px; transition: border-color .15s, box-shadow .15s; }
.analyze-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.analyze-box.prominent { border-color: color-mix(in srgb, var(--accent) 45%, var(--border-2)); background: linear-gradient(180deg, var(--accent-bg), var(--surface) 70%); }
.an-row { display: flex; align-items: center; gap: 10px; }
.an-ic { display: inline-flex; color: var(--accent); flex: none; }
.an-input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 14.5px; resize: none; outline: none; padding: 6px 0; line-height: 1.45; }
.an-input::placeholder { color: var(--text-3); }
.chips.small { margin-top: 8px; gap: 6px; }
.chips.small .chip { padding: 4px 10px; font-size: 12px; }

.cohort-card { border-color: color-mix(in srgb, var(--green) 40%, var(--border)); }
.cohort-card .card-icon { color: var(--green); }
.cohort-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 7px 14px; min-width: 96px; }
.stat-v { font: 700 19px/1.2 "Cascadia Code", Consolas, monospace; letter-spacing: -.01em; }
.stat-l { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); font-weight: 700; }
.kv-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 0; margin-bottom: 10px; }
.kv.span2 { grid-column: span 2; }
.incl { display: grid; gap: 7px; }
.incl-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; align-items: center; }
.incl-k { font-size: 12px; font-weight: 600; color: var(--text-3); }
.incl-v { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.incl-note { margin-top: 10px; display: flex; align-items: center; gap: 4px; }
.enrich-list { display: grid; gap: 5px; margin: 6px 0; }
.enrich-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 13px; min-width: 0; }
.en-ic { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--accent); }
.en-ic .spin { width: 10px; height: 10px; }
.enrich-row.st-done .en-ic { color: var(--green); background: var(--green-bg); }
.enrich-row.st-error .en-ic { color: var(--red); background: var(--red-bg); }
.en-name { font-family: "Cascadia Code", Consolas, monospace; font-weight: 600; flex: none; }
.en-sum { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.en-meta { color: var(--text-3); font-size: 11.5px; flex: none; }
.result-card.quiet { border-color: var(--border); }
.result-card.quiet .card-icon { color: var(--accent); }

/* analysis */
.run.analysis { padding: 0; max-width: none; min-height: 0; }
.run.analysis .stepper-wrap { margin: 0; padding: 10px 0; }
.run.analysis .run-q { font-size: 17px; margin-top: 8px; }
.console-out { margin: 0 0 8px; font: 12px/1.5 "Cascadia Code", Consolas, monospace; background: var(--code-bg); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; max-height: 260px; overflow: auto; white-space: pre-wrap; color: var(--text-2); }
.console-out.err { color: var(--red); background: var(--red-bg); border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.exec-card.is-fail { border-color: color-mix(in srgb, var(--red) 40%, var(--border)); }
.exec-card.is-fail .card-icon { color: var(--red); }
.exec-card.is-ok .card-icon { color: var(--green); }
.figure-wrap { background: #fff; border-radius: 8px; padding: 8px; text-align: center; cursor: zoom-in; border: 1px solid var(--border); }
.figure-wrap img { max-width: 100%; max-height: 480px; height: auto; display: inline-block; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; min-width: 0; }
.tile-v { font: 700 22px/1.2 "Cascadia Code", Consolas, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile.text .tile-v { font-size: 15px; line-height: 1.6; }
.tile-l { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.tile-l::first-letter { text-transform: uppercase; }
.summary-card { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.summary-note { margin-top: 10px; display: flex; align-items: center; gap: 4px; }
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .72); display: grid; place-items: center; padding: 24px; animation: rise .15s; }
.lb-inner { background: var(--surface); border: 1px solid var(--border-2); border-radius: 12px; max-width: 94vw; max-height: 94vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow); }
.lb-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 16px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 13px; }
.lb-inner img { max-width: 92vw; max-height: 84vh; object-fit: contain; background: #fff; display: block; }

/* cohort pages */
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); font-size: 12.5px; margin-bottom: 10px; }
.back-link:hover { color: var(--text); text-decoration: none; }
.cohort-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ch-main { min-width: 0; flex: 1 1 420px; }
.ch-q { font-size: 19px; font-weight: 600; letter-spacing: -.01em; line-height: 1.4; margin: 0 0 6px; }
.ch-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cohort-page .cohort-stats { margin: 16px 0 12px; }
.ch-def { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; }
.ch-def summary { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 600; font-size: 13px; }
.ch-def[open] summary { margin-bottom: 10px; }
.cohort-tabs { margin-bottom: 14px; }
.btn.armed { background: var(--red); color: #fff; }
.notes-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 14px; align-items: start; }
.note-viewer { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; min-height: 360px; position: sticky; top: 8px; max-height: calc(100vh - 170px); overflow: auto; }
.nv-head { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
.nv-type { font-weight: 650; font-size: 15px; }
.nv-text { white-space: pre-wrap; padding: 16px 20px 24px; font-size: 14px; line-height: 1.65; max-width: 82ch; overflow-wrap: anywhere; }
.mini-bar { display: inline-block; width: 56px; height: 6px; background: var(--surface-3); border-radius: 4px; overflow: hidden; margin-right: 8px; vertical-align: middle; }
.mini-bar i { display: block; height: 100%; background: var(--accent); }
.tbl.profile td { vertical-align: middle; }
.topvals { display: grid; gap: 2px; min-width: 190px; }
.prof-sub { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-family: system-ui, sans-serif; }
.tv { display: grid; grid-template-columns: 96px minmax(36px, 1fr) 30px; gap: 6px; align-items: center; font-size: 12px; }
.tv-v { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-bar { height: 6px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.tv-bar i { display: block; height: 100%; background: var(--accent); opacity: .8; }
.tv-c { text-align: right; color: var(--text-3); }
.an-split { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 18px; align-items: start; margin-top: 14px; }
.an-list { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 6px; position: sticky; top: 8px; max-height: calc(100vh - 150px); overflow: auto; }
.an-item { display: flex; gap: 10px; width: 100%; padding: 7px; border-radius: 8px; border: 1px solid transparent; background: transparent; text-align: left; cursor: pointer; color: var(--text-2); }
.an-item:hover { background: var(--surface-2); }
.an-item.sel { background: var(--surface-3); border-color: var(--border-2); }
.an-thumb { width: 52px; height: 38px; object-fit: cover; border-radius: 6px; background: #fff; flex: none; border: 1px solid var(--border); }
.an-thumb.ph { display: grid; place-items: center; background: var(--surface-2); color: var(--text-3); }
.an-item-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.an-item-q { font-size: 12.5px; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.an-item-meta { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-3); }
.an-item-meta .sdot { margin-top: 0; width: 6px; height: 6px; }
.an-pane { min-width: 0; }
.loading.small { padding: 16px; }
.src-analysis { background: var(--green-bg); color: var(--green); }


/* analysis round 2: plan, files, follow-ups, richer tiles */
.aplan-card { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.aplan-card .card-head { background: linear-gradient(90deg, var(--accent-bg), transparent 60%); border-radius: 12px 12px 0 0; }
.aplan p { margin: 0 0 .6em; }
.aplan strong:first-child { color: var(--accent); }
.recipe { font: 600 11px/18px "Cascadia Code", Consolas, monospace; padding: 0 8px; border-radius: 99px; background: var(--purple-bg); color: var(--purple); }
.file-card { border-color: color-mix(in srgb, var(--amber) 35%, var(--border)); }
.file-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; flex-wrap: wrap; }
.file-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--amber-bg); color: var(--amber); flex: none; }
.file-main { flex: 1 1 260px; min-width: 0; display: grid; gap: 2px; }
.file-name { font-weight: 600; font-size: 13.5px; overflow-wrap: anywhere; }
.file-meta { color: var(--text-2); font-size: 12.5px; overflow-wrap: anywhere; }
.file-note { display: inline-flex; align-items: center; gap: 5px; color: var(--text-3); font-size: 11.5px; }
.file-note .ic { color: var(--red); }
.parent-link { display: flex; align-items: center; gap: 6px; font-size: 12.5px; margin: -2px 0 6px; min-width: 0; color: var(--text-3); }
.parent-link a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.followup { margin: 18px 0 8px 28px; }
.followup .analyze-box { background: var(--surface); }
.tile.paired .tile-v { color: var(--text); }
.tile-base { font: 11.5px "Cascadia Code", Consolas, monospace; color: var(--text-2); margin-top: 2px; }
.tile-base.better { color: var(--green); }
.tile-base.worse { color: var(--amber); }
.tile.wide { grid-column: 1 / -1; cursor: pointer; }
.tile.wide .tile-l { margin: 0 0 3px; }
.tile-long { font-size: 13px; line-height: 1.5; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.tile.wide.open .tile-long { -webkit-line-clamp: unset; display: block; }
.an-item.child { border-left: 2px solid var(--border-2); border-radius: 0 8px 8px 0; }
.fu-tag { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; margin-right: 5px; }


/* ---------- skills ---------- */
.kw-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.kw { font-size: 11px; padding: 0 7px; line-height: 18px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); }
.fb-save { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; flex-wrap: wrap; }
.fb-save input { width: 15px; height: 15px; accent-color: var(--accent); }
.fb-learned:empty { display: none; }
.fb-learned { margin-top: 10px; }
.saving-line { display: flex; align-items: center; gap: 9px; color: var(--accent); font-size: 13px; font-weight: 600; padding: 9px 12px; border-radius: 8px; background: var(--accent-bg); }
.learned-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); border-radius: 10px; background: linear-gradient(90deg, var(--accent-bg), transparent 70%); flex-wrap: wrap; }
.lc-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-bg); color: var(--accent); flex: none; }
.lc-main { flex: 1 1 240px; min-width: 0; }
.lc-top { display: flex; align-items: center; gap: 8px; }
.lc-kind { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); }
.lc-title { font-weight: 600; font-size: 13.5px; margin-top: 2px; overflow-wrap: anywhere; }
.analysis-fb { margin: 16px 0 0 28px; }
.skill-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; line-height: 20px; padding: 0 8px; border-radius: 99px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text-2); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.skill-chip:hover { text-decoration: none; border-color: var(--accent); color: var(--text); }
.skill-chip.skill-recipe { background: var(--purple-bg); border-color: transparent; color: var(--purple); }
.skill-chip.skill-pattern { background: var(--blue-bg); border-color: transparent; color: var(--blue); }
.sc-label { font-family: inherit; opacity: .85; }
.adapted { margin-bottom: 12px; }
.skill-explainer { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: 10px; background: var(--accent-bg); color: var(--text-2); font-size: 13px; line-height: 1.5; margin-bottom: 18px; }
.skill-explainer .ic { color: var(--accent); margin-top: 2px; }
.skill-section { margin-bottom: 22px; }
.skill-sec-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--accent); }
.skill-sec-head h2 { font-size: 15px; margin: 0; color: var(--text); font-weight: 650; }
.skill-sec-head .count { font-size: 11px; background: var(--surface-3); padding: 0 7px; border-radius: 99px; color: var(--text-3); }
.skill-list { display: grid; gap: 10px; }
.skill { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 15px; position: relative; overflow: hidden; min-width: 0; }
.skill::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--border-2); }
.skill.st-verified::before { background: var(--green); }
.skill.st-draft::before { background: var(--amber); }
.skill.st-rejected { opacity: .7; }
.skill.st-rejected::before { background: var(--red); }
.skill.flash { animation: flash 1.6s ease-out; }
.skill-head { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.skill-ic { display: inline-flex; color: var(--accent); }
.skill-title { font-weight: 650; font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.origin { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 0 7px; line-height: 17px; border-radius: 4px; }
.origin.learned { color: var(--purple); background: var(--purple-bg); }
.origin.builtin { color: var(--text-3); background: var(--surface-3); }
.skill-id { margin-top: 2px; overflow-wrap: anywhere; }
.skill-text { font-size: 13px; color: var(--text-2); margin-top: 8px; }
.skill-code { margin-top: 8px; }
.skill-code summary { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); font-weight: 600; margin-bottom: 6px; }
.skill-src { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--text-2); min-width: 0; flex-wrap: wrap; }
.skill-src a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60ch; }
.skill-actions { display: flex; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); flex-wrap: wrap; }
.badge.status-rejected { color: var(--red); background: var(--red-bg); border-color: transparent; }


/* ---------- settings ---------- */
.settings-page { max-width: 860px; }
.settings { display: grid; gap: 14px; }
.set-card { margin: 0; }
.set-body { padding: 4px 16px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.set-row:last-child { border-bottom: 0; }
.set-text { flex: 1 1 280px; min-width: 0; }
.set-title { font-weight: 600; font-size: 13.5px; }
.set-hint { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.set-control { flex: none; display: flex; align-items: center; gap: 8px; }
.set-control .select { min-width: 200px; padding: 6px 10px; font-size: 13px; }
.seg.seg-lg .seg-btn { padding: 6px 12px; font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; text-transform: none; }
.about-grid { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 10px 16px; padding: 12px 0; font-size: 13px; align-items: center; }
.about-kv { display: contents; }
.about-kv .k { color: var(--text-3); font-weight: 600; font-size: 12px; }
.about-kv .v { min-width: 0; overflow-wrap: anywhere; }
.model-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-stat.on { border-color: var(--accent); color: var(--accent); }
.side-foot { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; }
.side-foot .settings-link { margin: 0 -2px 0 -10px; }
.foot-mode { padding-left: 2px; }

/* compact density */
html[data-density="compact"] body { font-size: 13px; }
html[data-density="compact"] .card-body { padding: 10px 12px; }
html[data-density="compact"] .card-head { min-height: 38px; padding: 6px 12px; }
html[data-density="compact"] .card { margin: 7px 0; }
html[data-density="compact"] .sec { padding-bottom: 2px; }
html[data-density="compact"] .tbl td { padding: 5px 10px; }
html[data-density="compact"] .tbl th { padding: 6px 10px; }
html[data-density="compact"] .run-item { padding: 6px 10px; }
html[data-density="compact"] .nav-item { padding: 5px 10px; }
html[data-density="compact"] .page { padding-top: 18px; }
html[data-density="compact"] pre.code { font-size: 12px; line-height: 1.5; }
html[data-density="compact"] .stepper-wrap { padding-top: 8px; padding-bottom: 6px; }


/* ---------- knowledge graph ---------- */
.graph-page .tabs { margin-bottom: 14px; }
.gx-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.gx-picker { position: relative; width: 300px; max-width: 100%; }
.gx-picker .search-box .input { padding: 7px 0; }
.gx-results { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20; background: var(--surface); border: 1px solid var(--border-2); border-radius: 10px; box-shadow: var(--shadow); padding: 4px; max-height: 320px; overflow: auto; }
.gx-res { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left; border: 0; background: transparent; padding: 6px 8px; border-radius: 7px; cursor: pointer; color: var(--text); }
.gx-res .ic { display: none; }
.gx-res:hover { background: var(--surface-2); }
.gx-res .mono { font-size: 12.5px; }
.gx-res-d { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.gx-ctl { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.gx-ctl > span:first-child { color: var(--text-3); font-weight: 600; }
.gx-ctl.check { cursor: pointer; }
.gx-ctl input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; }
.gx-range { width: 110px; accent-color: var(--accent); }
.gx-conf-v { width: 3ch; }
.gx-main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.gx-canvas-col { min-width: 0; }
.gx-stage { position: relative; height: 560px; border: 1px solid var(--border); border-radius: 12px; background: radial-gradient(circle at 50% 45%, var(--surface), var(--bg) 75%); overflow: hidden; }
.gx-stage.busy::after { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 40%, transparent); }
.gx-svg { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; user-select: none; }
.gx-svg:active { cursor: grabbing; }
.gx-zoom { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 4px; }
.gx-zoom .icon-btn { background: var(--surface); border-color: var(--border); }
.gx-edge { stroke: var(--text-3); fill: none; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.gx-hit { vector-effect: non-scaling-stroke; }
.gx-edge.w-strong { stroke-width: 2.6; }
.gx-edge.w-normal { stroke-width: 1.5; }
.gx-edge.w-weak { stroke-width: 1.3; stroke-dasharray: 5 4; }
.gx-edge.far { opacity: .32; }
.gx-stage:has(.gx-node:hover) .gx-edge.far { opacity: .2; }
.gx-edge.rejected { stroke: var(--red) !important; stroke-dasharray: 2 4; opacity: .55; }
.gx-edge.sel { stroke: var(--accent) !important; stroke-width: 4; opacity: 1; }
.gx-hit { stroke: transparent; stroke-width: 12; cursor: pointer; }
.gx-hit:hover { stroke: var(--accent-ring); }
.src-dictionary { stroke: color-mix(in srgb, var(--text-3) 85%, var(--blue)); }
.src-er_diagram { stroke: var(--blue); }
.src-instance_extract { stroke: var(--cyan); }
.src-probe_verified { stroke: var(--green); }
.src-learned { stroke: var(--purple); }
.src-human { stroke: var(--amber); }
.src-name_inferred { stroke: #e07ab0; }
.gx-node { cursor: pointer; }
.gx-node > :is(circle, rect, polygon) { stroke: var(--bg); stroke-width: 1.5; transition: filter .15s; }
.gx-node:hover > :is(circle, rect, polygon), .gx-node.dragging > :is(circle, rect, polygon) { filter: brightness(1.2); }
.gx-node.hub > :is(circle, rect, polygon) { stroke: var(--text-3); stroke-dasharray: 2 2; }
.gx-node.center > :is(circle, rect, polygon) { stroke: var(--text); stroke-width: 2.5; }
.gx-node.sel > :is(circle, rect, polygon) { stroke: var(--accent); stroke-width: 3; }
.gx-node:focus { outline: none; }
.gx-node:focus-visible > :is(circle, rect, polygon) { stroke: var(--accent); stroke-width: 3; }
.gk-fact > :is(circle, rect, polygon), svg.gk-fact :is(circle, rect, polygon) { fill: var(--accent); }
.gk-dim > :is(circle, rect, polygon), svg.gk-dim :is(circle, rect, polygon) { fill: var(--purple); }
.gk-bridge > :is(circle, rect, polygon), svg.gk-bridge :is(circle, rect, polygon) { fill: var(--cyan); }
.gk-datamart > :is(circle, rect, polygon), svg.gk-datamart :is(circle, rect, polygon) { fill: var(--amber); }
.gk-other > :is(circle, rect, polygon), svg.gk-other :is(circle, rect, polygon) { fill: var(--text-3); }
.gx-node .lbl { font: var(--lbl, 10.5px) "Cascadia Code", Consolas, monospace; fill: var(--text-2); paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
.gx-node.center .lbl, .gx-node.sel .lbl { fill: var(--text); font-weight: 700; }
.gx-node .lbl-hidden { opacity: 0; }
.gx-node:hover .lbl-hidden, .gx-node.sel .lbl-hidden { opacity: 1; }
.gx-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 11.5px; color: var(--text-3); }
.gx-leg-group { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.gx-leg-t { font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 10.5px; }
.gx-shape { flex: none; }
.gx-side { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px; max-height: 640px; overflow: auto; min-width: 0; position: sticky; top: 8px; }
.gx-side-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; color: var(--text-3); padding: 24px 6px; font-size: 13px; }
.gx-quick { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.gx-side-head { display: flex; align-items: center; gap: 9px; min-width: 0; color: var(--accent); }
.gx-side-head h3 { margin: 0; font-size: 14px; color: var(--text); overflow-wrap: anywhere; min-width: 0; }
.gx-badges { display: flex; gap: 6px; margin: 8px 0; flex-wrap: wrap; }
.gx-kv { display: grid; gap: 4px; font-size: 12.5px; }
.gx-kv .k { color: var(--text-3); font-weight: 600; margin-right: 6px; }
.gx-desc { color: var(--text-2); font-size: 13px; line-height: 1.5; margin: 10px 0; }
.gx-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.gx-pathnote { margin-top: 10px; }
.gx-edge-card { border: 1px solid var(--border); border-radius: 10px; padding: 10px; margin-top: 10px; background: var(--surface-2); min-width: 0; }
.gx-edge-card.is-rejected { border-color: color-mix(in srgb, var(--red) 40%, var(--border)); }
.gx-on { display: block; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11.5px; padding: 6px 8px !important; }
.gx-edge-meta { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.src-badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; padding: 0 8px; line-height: 18px; border-radius: 99px; border: 1px solid currentColor; }
.src-badge.src-dictionary { color: var(--text-2); }
.src-badge.src-er_diagram { color: var(--blue); }
.src-badge.src-instance_extract { color: var(--cyan); }
.src-badge.src-probe_verified { color: var(--green); }
.src-badge.src-learned { color: var(--purple); }
.src-badge.src-human { color: var(--amber); }
.src-badge.src-name_inferred { color: #e07ab0; }
.gx-evidence { margin-top: 8px; }
.gx-evidence summary { cursor: pointer; font-size: 12px; color: var(--text-2); }
.gx-evidence pre { margin-top: 6px; max-height: 200px; }
.gx-check:empty { display: none; }
.gx-check { margin-top: 8px; }
.gx-check-res { border-radius: 8px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--border); display: grid; gap: 3px; }
.gx-check-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gx-path-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.gx-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 32px; }
.gx-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 4px; border: 1px solid var(--border-2); border-radius: 99px; background: var(--surface); font-size: 12.5px; }
.gx-chip-n { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; }
.gx-chip .icon-btn { width: 22px; height: 22px; }
.gx-note { display: flex; gap: 8px; align-items: center; padding: 9px 12px; border-radius: 8px; background: var(--amber-bg); color: var(--text-2); font-size: 13px; margin-bottom: 10px; }
.gx-note .ic { color: var(--amber); }
.gx-path-out .tbl.joins td:first-child { white-space: normal; min-width: 180px; }
.gx-path-out .tbl.joins td.sqlish { min-width: 260px; }
.gx-alts summary { cursor: pointer; font-size: 12px; color: var(--accent); }
.gx-alts ul { margin: 6px 0 0; padding-left: 16px; display: grid; gap: 4px; }
.gx-ov-wrap { position: relative; height: 620px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: radial-gradient(circle at 50% 45%, var(--surface), var(--bg) 80%); }
.gx-canvas { display: block; touch-action: none; cursor: grab; }
.gx-canvas:active { cursor: grabbing; }
.gx-ov-loading { position: absolute; inset: 0; }
.gx-ov-err { position: absolute; left: 12px; top: 12px; }
.gx-tip { position: absolute; pointer-events: none; background: var(--surface-3); border: 1px solid var(--border-2); border-radius: 8px; padding: 5px 9px; font-size: 12px; box-shadow: var(--shadow); white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.gx-find { width: 260px; }
.gx-find .input { padding: 7px 0; }
.gx-ov-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 11.5px; color: var(--text-2); }
.lg-btn { border: 0; background: transparent; cursor: pointer; color: inherit; font: inherit; padding: 2px 4px; border-radius: 6px; display: inline-flex; align-items: center; gap: 6px; }
.lg-btn:hover { background: var(--surface-2); }
.gx-ov-help { margin-top: 6px; }

/* ---------- phenotypes (js/views/phenotypes.js) ---------- */
.pill.st-planning { color: var(--accent); background: var(--accent-bg); }
.pill.st-planning::before { animation: blink 1.2s infinite; }
.pill.st-queued { color: var(--text-2); background: var(--surface-3); }
.pill.st-paused { color: var(--amber); background: var(--amber-bg); }
.pill.st-cancelled { color: var(--text-3); background: var(--surface-3); }
.src-phenotype { background: color-mix(in srgb, var(--purple) 16%, transparent); color: var(--purple); }

/* Ask: mode toggle */
.mode-seg .seg-btn { display: inline-flex; align-items: center; gap: 5px; text-transform: none; padding: 4px 10px; white-space: nowrap; }
.ph-def .seg-btn, .ph-ev .seg-btn { text-transform: none; }
.mode-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; color: var(--text-2); font-size: 12.5px; line-height: 1.5; }
.mode-note .ic { color: var(--purple); margin-top: 2px; }
.ask-hero.mode-phenotype .composer { border-color: color-mix(in srgb, var(--purple) 45%, var(--border-2)); }
.ask-hero.mode-phenotype .composer:focus-within { border-color: var(--purple); box-shadow: 0 0 0 4px color-mix(in srgb, var(--purple) 22%, transparent), var(--shadow); }
.ask-hero.mode-phenotype .mode-seg .seg-btn.on { color: var(--purple); background: var(--purple-bg); }
.composer-bar { flex-wrap: wrap; }

/* list page */
.ph-sec-label { display: flex; align-items: center; gap: 7px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; color: var(--text-3); margin: 26px 0 8px; }
.ph-sec-note { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 4px; }
.ph-new { border: 1px solid color-mix(in srgb, var(--purple) 35%, var(--border-2)); border-radius: 12px; padding: 12px 14px; background: linear-gradient(180deg, var(--purple-bg), var(--surface) 75%); }
.ph-new:focus-within { border-color: var(--purple); box-shadow: 0 0 0 3px color-mix(in srgb, var(--purple) 20%, transparent); }
.ph-new-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ph-new-head .ic { color: var(--purple); }
.ph-new-input { width: 100%; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 15px; line-height: 1.5; resize: none; outline: none; padding: 8px 0 4px; min-height: 52px; }
.ph-new-input::placeholder { color: var(--text-3); }
.ph-new-bar { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.ph-new-bar .chips { margin-top: 0; }
.ph-jobs td { vertical-align: middle; }
.ph-jobs .gq { font-weight: 500; }
.ph-jobs-wrap { max-height: none; }
.ph-prog-cell { min-width: 150px; }
.ph-prog-mini { display: flex; align-items: center; gap: 8px; }
.ph-prog-mini .ph-bar { flex: 1; min-width: 80px; }
.ph-bar { display: block; height: 6px; background: var(--surface-3); border-radius: 6px; overflow: hidden; position: relative; }
.ph-bar i { display: block; height: 100%; background: var(--accent); border-radius: 6px; transition: width .6s ease; }
.ph-bar.live i { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.ph-bar.live i::after { content: ""; display: block; height: 100%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent); animation: ph-sheen 1.8s linear infinite; }
.ph-bar.paused i, .ph-bar.queued i { background: var(--amber); }
.ph-bar.done i { background: var(--green); }
@keyframes ph-sheen { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.ph-lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.ph-lib-item { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; display: grid; gap: 8px; min-width: 0; }
.ph-lib-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ph-lib-title { font-size: 13.5px; }
.ph-lib-crit { display: grid; gap: 4px; }
.ph-lib-c { display: flex; align-items: center; gap: 6px; font-size: 12.5px; min-width: 0; }
.ph-lib-c > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-lib-c.off { opacity: .5; }
.ph-lib-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ph-lib-meta a { display: inline-flex; align-items: center; gap: 3px; }

/* job page */
.ph-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ph-head-main { flex: 1 1 520px; min-width: 0; }
.ph-q { margin-top: 8px; }
.ph-title { margin: -2px 0 6px; font-size: 13px; }
.ph-now { flex-wrap: wrap; row-gap: 2px; }
.ph-now .ok-ic { color: var(--green); }
.ph-now .err-ic { color: var(--red); }
.ph-errors { margin-top: 6px; }
.ph-errors .err-inline { padding: 4px 0; }
.ph-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; padding-top: 2px; }
.ph-save { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 2px; padding: 10px 12px; border: 1px solid var(--border-2); border-radius: 10px; background: var(--surface); }
.ph-save > .ic { color: var(--accent); }
.ph-save-out { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; width: 100%; }
.ph-save-out:empty { display: none; }
.ph-rail { margin-top: 12px; margin-bottom: 4px; }
.ph-stepper .step { width: 76px; }
.ph-planlog { margin: 10px 0; border: 1px dashed var(--border-2); border-radius: 10px; background: var(--surface); }
.ph-planlog summary { cursor: pointer; padding: 8px 12px; display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.ph-planlog summary .ic { color: var(--accent); }
.ph-plan-pre { margin: 0; padding: 8px 12px 12px; max-height: 220px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 1.55; color: var(--text-2); border-top: 1px solid var(--border); }
.ph-llm-live { display: inline-flex; align-items: center; gap: 5px; margin-left: 6px; font-size: 11.5px; color: var(--accent); font-weight: 600; }
.ph-llm-live .spin { width: 10px; height: 10px; }
.ph-panel { scroll-margin-top: 96px; }
.ph-panel-head { cursor: pointer; user-select: none; border-radius: 12px 12px 0 0; }
.ph-panel-head:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.ph-panel-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ph-chev { display: inline-flex; color: var(--text-3); transition: transform .2s; }
.ph-panel.collapsed .ph-chev { transform: rotate(-90deg); }
.ph-panel.collapsed > .card-body { display: none; }
.ph-panel.collapsed > .card-head { border-bottom-color: transparent; border-radius: 12px; }
.ph-note { display: flex; align-items: flex-start; gap: 4px; margin: 0 0 10px; line-height: 1.5; }
.ph-note .ic { margin-top: 2px; }
.ph-twrap { max-height: 420px; }
.ph-twrap .tbl { font-size: 12.5px; }
.ph-twrap .tbl td, .ph-twrap .tbl th { padding: 6px 10px; }
.nowrap { white-space: nowrap; }

/* kind / role / method chips */
.badge.ph-kind { text-transform: lowercase; border-color: transparent; gap: 4px; }
.badge.ph-kind-measurement { color: var(--blue); background: var(--blue-bg); }
.badge.ph-kind-text { color: var(--purple); background: var(--purple-bg); }
.badge.ph-kind-structured { color: var(--cyan); background: color-mix(in srgb, var(--cyan) 12%, transparent); }
.ph-role { display: inline-block; font-size: 11px; font-weight: 600; padding: 0 7px; border-radius: 99px; line-height: 18px; white-space: nowrap; }
.ph-role.role-candidate { color: var(--green); background: var(--green-bg); }
.ph-role.role-near_miss { color: var(--amber); background: var(--amber-bg); }
.ph-role.role-velocity { color: var(--blue); background: var(--blue-bg); }
.ph-method { display: inline-block; font: 600 10.5px/17px "Cascadia Code", Consolas, monospace; padding: 0 6px; border-radius: 4px; text-transform: uppercase; background: var(--surface-3); color: var(--text-2); }
.ph-method.m-sql { color: var(--cyan); background: color-mix(in srgb, var(--cyan) 12%, transparent); }
.ph-method.m-rule { color: var(--blue); background: var(--blue-bg); }
.ph-method.m-llm { color: var(--purple); background: var(--purple-bg); }
.ph-method.m-human { color: var(--amber); background: var(--amber-bg); }
.ph-lab { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 0 8px; border-radius: 99px; line-height: 19px; white-space: nowrap; }
.ph-lab.pos { color: var(--green); background: var(--green-bg); }
.ph-lab.neg { color: var(--text-2); background: var(--surface-3); }

/* discovery */
.ph-concept h3 { display: flex; align-items: center; gap: 7px; font-size: 14px; margin: 18px 0 6px; }
.ph-concept:first-of-type h3 { margin-top: 4px; }
.ph-concept h3 .ic { color: var(--accent); }
.ph-dtable { margin: 6px 0 12px; }
.ph-dlabel { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-bottom: 5px; }
.ph-mname { font-weight: 500; white-space: nowrap; }
.ph-meas tr.role-row-near_miss td { color: var(--text-3); }
.ph-meas tr.role-row-near_miss .ph-mname { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--amber) 60%, transparent); }
.ph-nt { display: inline-flex; width: 52px; height: 6px; border-radius: 4px; overflow: hidden; background: var(--surface-3); vertical-align: middle; margin-right: 6px; }
.ph-nt i { display: block; height: 100%; }
.ph-nt i.n { background: var(--blue); }
.ph-nt i.t { background: var(--amber); }
.ph-in { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; font-weight: 700; }
.ph-in.yes { color: var(--green); }
.ph-in.vel { color: var(--blue); }
.ph-in.ex { color: var(--amber); }
.ph-types { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ph-type { display: inline-flex; gap: 5px; font-size: 11.5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 0 6px; white-space: nowrap; }
.ph-type b { font-family: "Cascadia Code", Consolas, monospace; font-weight: 500; color: var(--text-3); }
.ph-values { display: grid; gap: 4px; }
.ph-value { display: flex; align-items: baseline; gap: 4px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); flex-wrap: wrap; }

/* definition editor */
.ph-def-top { display: grid; grid-template-columns: minmax(0, 1.4fr) auto auto; gap: 12px 18px; align-items: start; margin-bottom: 14px; }
.ph-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ph-field.grow { flex: 1 1 260px; }
.ph-field-l { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.ph-field-h { font-size: 11.5px; color: var(--text-3); line-height: 1.4; }
.ph-field .input.sm, .ph-field .select { width: auto; }
.ph-w-title { width: 100% !important; font-size: 13.5px !important; font-weight: 600; }
.ph-w-num { width: 84px !important; }
.ph-w-unit { width: 80px !important; }
.ph-crits { display: grid; gap: 12px; }
.ph-crit { border: 1px solid var(--border); border-left: 3px solid var(--border-2); border-radius: 10px; padding: 10px 12px 12px; background: var(--surface); min-width: 0; transition: opacity .2s; }
.ph-crit.kind-measurement { border-left-color: var(--blue); }
.ph-crit.kind-text { border-left-color: var(--purple); }
.ph-crit.kind-structured { border-left-color: var(--cyan); }
.ph-crit.off { background: var(--surface-2); }
.ph-crit.off > :not(.ph-crit-head) { opacity: .5; }
.ph-crit-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ph-crit-label { flex: 1 1 260px; font-weight: 600; font-size: 13.5px !important; width: auto !important; }
.ph-rationale { display: flex; gap: 6px; align-items: flex-start; color: var(--text-2); font-size: 12.5px; margin: 8px 0 2px; line-height: 1.5; }
.ph-rationale .ic { color: var(--accent); margin-top: 3px; }
.ph-crit-body { display: grid; gap: 12px; margin-top: 10px; min-width: 0; }
.ph-row { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: flex-start; }
.ph-thr { gap: 6px; }
.ph-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; flex-wrap: wrap; align-self: flex-end; padding-bottom: 4px; }
.ph-check input { accent-color: var(--accent); width: 15px; height: 15px; }
.ph-names { display: grid; gap: 10px; }
.ph-ngroup { display: grid; gap: 4px; }
.ph-nhead { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--green); }
.ph-nhead b { font-family: "Cascadia Code", Consolas, monospace; font-size: 11px; background: var(--surface-3); color: var(--text-2); padding: 0 6px; border-radius: 99px; }
.ph-nhead.ex { color: var(--amber); }
.ph-nhead.vel { color: var(--blue); }
.ph-nhead .muted { font-weight: 400; }
.ph-nlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 3px 10px; }
.ph-nrow { display: flex; align-items: baseline; gap: 7px; padding: 3px 6px; border-radius: 6px; font-size: 13px; cursor: pointer; min-width: 0; flex-wrap: wrap; }
.ph-nrow:hover { background: var(--surface-2); }
.ph-nrow input { accent-color: var(--accent); flex: none; position: relative; top: 2px; }
.ph-nrow.ex .ph-nname { color: var(--text-2); }
.ph-nrow.vel.unchecked .ph-nname { color: var(--text-3); }
.ph-nname { font-weight: 500; }
.ph-nstat { font: 11px "Cascadia Code", Consolas, monospace; color: var(--text-3); }
.ph-reason { font-size: 11.5px; color: var(--amber); font-style: italic; }
.ph-find { display: grid; gap: 8px; padding-top: 4px; border-top: 1px dashed var(--border); }
.ph-find .row { padding-top: 8px; flex-wrap: wrap; }
.ph-find-in { width: 340px !important; max-width: 100%; }
.ph-find-out:empty { display: none; }
.ph-chips { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; min-height: 32px; padding: 4px 6px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--surface-2); cursor: text; min-width: 0; }
.ph-chips:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.ph-chips.ro { border-color: transparent; background: transparent; padding-left: 0; cursor: default; }
.ph-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; padding: 1px 4px 1px 8px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); max-width: 100%; }
.ph-chips.ro .ph-chip { padding-right: 8px; }
.ph-chips.mono .ph-chip-t { font-family: "Cascadia Code", Consolas, monospace; font-size: 11.5px; overflow-wrap: anywhere; }
.ph-chip.bad { border-color: var(--red); color: var(--red); background: var(--red-bg); }
.ph-chip-x { border: 0; background: transparent; color: var(--text-3); cursor: pointer; display: inline-flex; padding: 2px; border-radius: 4px; }
.ph-chip-x:hover { color: var(--red); background: var(--red-bg); }
.ph-chip-in { flex: 1 1 120px; min-width: 100px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 12.5px; outline: none; padding: 3px 2px; }
.ph-label { padding-left: 2px; }
.ph-label-t { border: 0; background: transparent; color: inherit; font: inherit; font-size: 12.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; padding: 0 4px 0 4px; }
.ph-label-t:disabled { cursor: default; }
.ph-label.pos { border-color: color-mix(in srgb, var(--green) 50%, transparent); background: var(--green-bg); color: var(--green); font-weight: 600; }
.ph-instr { width: 100%; font-size: 13px; }
.err-inline.warn { color: var(--amber); padding: 4px 0; }
.ph-def-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.ph-def-foot.ro { color: var(--text-3); }
.ph-def-err { display: grid; }
.ph-def-err:empty { display: none; }
.ph-def-err .err-inline { padding: 2px 0; }
.ph-def.ro .input:disabled, .ph-def.ro .select:disabled { opacity: 1; background: transparent; border-color: transparent; color: var(--text); padding-left: 0; appearance: none; -webkit-appearance: none; cursor: default; box-shadow: none; }
.ph-def.ro textarea.input:disabled { border-color: var(--border); padding-left: 10px; background: var(--surface-2); resize: none; }
.ph-def.ro .seg-btn:disabled { cursor: default; opacity: .8; }
.ph-def.ro .seg-btn.on:disabled { opacity: 1; }
.ph-def .editor { border: 1px solid var(--border-2); border-radius: 8px; }
.ph-switch { position: relative; display: inline-flex; width: 32px; height: 18px; flex: none; cursor: pointer; }
.ph-switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.ph-switch-ui { width: 100%; height: 100%; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--border-2); position: relative; transition: background .15s; }
.ph-switch-ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--text-3); transition: transform .15s, background .15s; }
.ph-switch input:checked + .ph-switch-ui { background: var(--accent); border-color: var(--accent); }
.ph-switch input:checked + .ph-switch-ui::after { transform: translateX(14px); background: #fff; }
.ph-switch input:focus-visible + .ph-switch-ui { outline: 2px solid var(--accent); outline-offset: 2px; }
.ph-switch input:disabled, .ph-switch input:disabled + .ph-switch-ui { cursor: default; opacity: .75; }

/* progress */
.ph-banner { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 12px; font-size: 13px; flex-wrap: wrap; }
.ph-banner.warn { background: var(--amber-bg); border-color: color-mix(in srgb, var(--amber) 35%, transparent); }
.ph-banner.warn > .ic { color: var(--amber); }
.ph-ptiles .stat { min-width: 120px; }
.ph-prows { display: grid; gap: 6px; }
.ph-prow {
  display: grid; grid-template-columns: minmax(180px, 1.5fr) minmax(150px, 1fr) minmax(170px, 1.3fr) minmax(220px, 1.5fr) minmax(150px, 1fr);
  gap: 6px 14px; align-items: center; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
}
.ph-prow.ph-done { background: color-mix(in srgb, var(--green-bg) 50%, var(--surface)); }
.ph-prow.paused { border-color: color-mix(in srgb, var(--amber) 40%, var(--border)); }
.ph-pc-label { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ph-pc-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 13px; }
.ph-pc-phase { display: grid; gap: 2px; }
.ph-phase { font-size: 12.5px; font-weight: 600; color: var(--blue); }
.ph-prow.ph-done .ph-phase { color: var(--green); }
.ph-prow.ph-pending .ph-phase, .ph-prow.ph-waiting .ph-phase { color: var(--text-3); }
.ph-prow.paused .ph-phase { color: var(--amber); }
.ph-trail { display: flex; align-items: center; gap: 3px; font-size: 10.5px; flex-wrap: wrap; }
.ph-tstep { color: var(--text-3); }
.ph-tstep.done { color: var(--green); }
.ph-tstep.cur { color: var(--text); font-weight: 700; }
.ph-tsep { color: var(--text-3); opacity: .6; }
.ph-pc-bar { display: grid; gap: 3px; }
.ph-counts { color: var(--text-2); }
.ph-pc-nums { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 12px; color: var(--text-3); }
.ph-pc-nums b { font-family: "Cascadia Code", Consolas, monospace; color: var(--text); font-weight: 600; }
.ph-pc-nums .ph-pts b { color: var(--green); }
.ph-pc-eta { font-size: 12px; text-align: right; white-space: nowrap; }

/* result + overlap */
.ph-res-top { display: flex; gap: 22px; align-items: stretch; flex-wrap: wrap; margin-bottom: 14px; }
.ph-big { padding: 4px 18px 4px 0; border-right: 1px solid var(--border); }
.ph-big-v { font: 700 40px/1.1 "Cascadia Code", Consolas, monospace; letter-spacing: -.03em; color: var(--green); }
.ph-big-l { font-size: 12px; color: var(--text-3); }
.ph-insight { flex: 1 1 360px; display: grid; gap: 4px; align-content: center; font-size: 13px; }
.ph-insight-h { font-size: 15.5px; display: flex; gap: 8px; align-items: flex-start; line-height: 1.45; }
.ph-insight-h .ic { color: var(--purple); margin-top: 4px; }
.ph-insight-h b { color: var(--purple); }
.ph-overlap { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.ph-ov-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.ph-ov-tile { border-radius: 10px; padding: 10px 14px; border: 1px solid transparent; text-align: center; }
.ph-ov-tile.s { background: var(--blue-bg); border-color: color-mix(in srgb, var(--blue) 30%, transparent); color: var(--blue); }
.ph-ov-tile.b { background: var(--green-bg); border-color: color-mix(in srgb, var(--green) 30%, transparent); color: var(--green); }
.ph-ov-tile.t { background: var(--purple-bg); border-color: color-mix(in srgb, var(--purple) 30%, transparent); color: var(--purple); }
.ph-ov-tv { font: 700 30px/1.15 "Cascadia Code", Consolas, monospace; letter-spacing: -.02em; }
.ph-ov-tl { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.ph-ov-bar { display: flex; height: 34px; border-radius: 8px; overflow: hidden; gap: 2px; }
.ph-ov-seg { flex-basis: 0; min-width: 42px; display: flex; align-items: center; justify-content: center; gap: 6px; color: #fff; font-size: 12px; white-space: nowrap; overflow: hidden; padding: 0 6px; }
.ph-ov-seg.s { background: var(--blue); }
.ph-ov-seg.b { background: var(--green); }
.ph-ov-seg.t { background: var(--purple); }
.ph-ov-n { font: 700 13px "Cascadia Code", Consolas, monospace; }
.ph-ov-l { opacity: .9; overflow: hidden; text-overflow: ellipsis; }
.ph-upset { display: grid; gap: 4px; }
.ph-up-row { display: grid; grid-template-columns: calc(var(--n, 2) * 30px + 8px) minmax(160px, 2fr) minmax(0, 3fr); gap: 12px; align-items: center; font-size: 12.5px; }
.ph-up-row.head { color: var(--text-3); }
.ph-up-dots { display: flex; gap: 8px; padding-left: 4px; }
.ph-up-id { width: 22px; text-align: center; font-size: 11px; }
.ph-up-dot { width: 14px; height: 14px; margin: 0 4px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--border-2); }
.ph-up-dot.on { background: var(--text); border-color: var(--text); }
.ph-up-bar { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ph-up-bar i { display: block; height: 14px; border-radius: 4px; min-width: 3px; flex: none; max-width: 75%; }
.ph-up-bar i.k-s { background: var(--blue); }
.ph-up-bar i.k-b { background: var(--green); }
.ph-up-bar i.k-t { background: var(--purple); }
.ph-up-name { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-up-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; }

/* evidence */
.ph-phi { display: flex; align-items: flex-start; gap: 8px; padding: 9px 12px; border-radius: 10px; background: var(--red-bg); border: 1px solid color-mix(in srgb, var(--red) 30%, transparent); color: var(--text-2); font-size: 12.5px; margin-bottom: 10px; line-height: 1.5; }
.ph-phi > .ic { color: var(--red); margin-top: 2px; }
.ph-phi b { color: var(--red); }
.ph-ev.busy .ph-ev-wrap { opacity: .6; }
.ph-ev-bar .select { width: auto; max-width: 260px; }
.ph-ev-wrap { max-height: 640px; }
.ph-ev-t { font-size: 12.5px; }
.ph-ev-t td { padding: 7px 10px; }
.ph-ev-nv { margin-bottom: 2px; }
.ph-ev-snip { min-width: 320px; max-width: 560px; }
.ph-snip { font-size: 12.5px; line-height: 1.5; color: var(--text); }
.ph-snip.clamp .ph-snip-t { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ph-snip.clamp.open .ph-snip-t { display: block; }
.ph-more { padding: 0; font-size: 11.5px; height: auto; }
mark.ph-hit { background: color-mix(in srgb, var(--amber) 32%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; box-shadow: 0 1px 0 color-mix(in srgb, var(--amber) 70%, transparent); }

/* validation */
.ph-val-bar { flex-wrap: wrap; margin-bottom: 12px; }
.ph-val-bar .select { width: auto; }
.ph-val-bar .kbd-hint { max-width: none; text-align: left; }
.ph-adj { border: 1px solid var(--border-2); border-radius: 12px; padding: 14px 16px; background: var(--surface); display: grid; gap: 12px; animation: rise .2s ease-out; }
.ph-adj.done { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ph-adj.done > .ic { color: var(--green); }
.ph-adj-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ph-adj-dots { display: flex; flex-wrap: wrap; gap: 3px; }
.ph-adj-dot { width: 9px; height: 9px; border-radius: 3px; background: var(--surface-3); border: 1px solid var(--border-2); }
.ph-adj-dot.cur { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-ring); }
.ph-adj-dot.agree { background: var(--green); border-color: var(--green); }
.ph-adj-dot.disagree { background: var(--red); border-color: var(--red); }
.ph-adj-dot.unsure { background: var(--amber); border-color: var(--amber); }
.ph-adj-q { font-size: 14px; }
.ph-adj-instr summary { cursor: pointer; font-size: 12px; color: var(--text-2); }
.ph-adj-instr div { margin-top: 4px; color: var(--text-2); line-height: 1.5; }
.ph-adj-ev { border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 10px 10px 0; padding: 12px 14px; display: grid; gap: 8px; }
.ph-adj-snip { font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.ph-adj-meas { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.ph-adj-mv { font-size: 24px; font-weight: 700; }
.ph-adj-btns { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ph-adj-btn { height: 36px; padding: 0 14px; }
.ph-adj-btn kbd { margin-left: 4px; }
.ph-adj-btn.adj-positive:hover:not(:disabled), .ph-adj-btn.adj-positive.sel { background: var(--green-bg); color: var(--green); border-color: var(--green); }
.ph-adj-btn.adj-negative:hover:not(:disabled), .ph-adj-btn.adj-negative.sel { background: var(--red-bg); color: var(--red); border-color: var(--red); }
.ph-adj-btn.adj-unsure:hover:not(:disabled), .ph-adj-btn.adj-unsure.sel { background: var(--amber-bg); color: var(--amber); border-color: var(--amber); }
.ph-adj-btn.sel:disabled { opacity: 1; }
.ph-adj-note { flex: 1 1 200px; width: auto !important; }
.ph-adj-reveal { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); animation: rise .2s ease-out; }
.ph-adj-reveal.agree { border-color: color-mix(in srgb, var(--green) 40%, transparent); }
.ph-adj-reveal.disagree { border-color: color-mix(in srgb, var(--red) 40%, transparent); background: var(--red-bg); }
.ph-adj-nav { display: flex; align-items: center; gap: 8px; }
.flip-ic .ic { transform: rotate(180deg); }
.ph-vstats { margin-top: 14px; }

@media (max-width: 1180px) {
  .ph-prow { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.2fr); }
  .ph-pc-nums { grid-column: 1 / 3; }
  .ph-pc-eta { text-align: right; }
  .ph-def-top { grid-template-columns: minmax(0, 1fr) auto; }
  .ph-def-top > :first-child { grid-column: 1 / -1; }
  .ph-stepper .step { width: 62px; }
}
@media (max-width: 760px) {
  .ph-prow { grid-template-columns: minmax(0, 1fr); }
  .ph-pc-nums { grid-column: auto; }
  .ph-pc-eta { text-align: left; }
  .ph-def-top { grid-template-columns: minmax(0, 1fr); }
  .ph-ov-tiles { grid-template-columns: minmax(0, 1fr); }
  .ph-up-row { grid-template-columns: calc(var(--n, 2) * 30px + 8px) minmax(0, 1fr); }
  .ph-up-name { grid-column: 1 / -1; }
  .ph-big { border-right: 0; padding-right: 0; }
  .ph-ov-l { display: none; }
  .ph-stepper .step { width: 48px; }
  .ph-stepper .step-sub { display: none; }
  .ph-nlist { grid-template-columns: minmax(0, 1fr); }
  .ph-lib { grid-template-columns: minmax(0, 1fr); }
  .ph-ev-snip { min-width: 240px; }
  .page.ph-page, .page.ph-job { padding-left: 16px; padding-right: 16px; }
  .stepper-wrap.ph-rail { margin: 0 -16px; padding-left: 16px; padding-right: 16px; overflow-x: auto; }
}

/* ---------- narrower screens ---------- */
@media (max-width: 1320px) {
  .chip-stat .muted, .db-sub { display: none; }
  .schema-grid { grid-template-columns: 260px minmax(0, 1fr); }
}
@media (max-width: 1180px) {
  .gx-main { grid-template-columns: minmax(0, 1fr) 260px; }
  .gx-stage { height: 500px; }
  .gx-picker { width: 240px; }
  .an-split { grid-template-columns: 210px minmax(0, 1fr); gap: 12px; }
  .notes-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .kv-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .incl-row { grid-template-columns: 100px minmax(0, 1fr); }
  .cg-label { width: 100px; }
  .dk-body { grid-template-columns: 240px minmax(0, 1fr); }
  .dk-models { display: none; }
  .c-think, .c-content { margin-left: 0; }
  .app { grid-template-columns: 236px minmax(0, 1fr); }
  .run { padding-left: 24px; padding-right: 24px; }
  .stepper-wrap { margin: 0 -24px; padding-left: 24px; padding-right: 24px; }
  .step { width: 58px; }
  .step-label { font-size: 11px; }
  .kv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page { padding-left: 24px; padding-right: 24px; }
  .kbd-hint { display: none; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .schema-grid { grid-template-columns: 1fr; }
  .schema-side { position: static; max-height: 320px; }
}

/* phenotype: clarifying questions + learned wording */
.ph-questions { display: grid; gap: 8px; padding: 10px 12px; margin: 4px 0 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.ph-q { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ph-q-t { min-width: 0; flex: 1 1 320px; }
.ph-vocab-note { display: grid; gap: 4px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-size: 13px; }
.ph-vocab-note .ph-types { display: inline-flex; flex-wrap: wrap; gap: 4px; }

/* registry rules */
.rule-row { display: block; color: inherit; text-decoration: none; }
.rule-row:hover { border-color: var(--accent); }
.rule-sub, .rule-body { padding: 8px 14px 12px; }
.rule-body > * + * { margin-top: 6px; }
.rule-quote { margin: 6px 0 0; padding: 6px 10px; border-left: 3px solid var(--accent); background: var(--surface-2); font-size: 12.5px; color: var(--text-2); }
.rule-quote.missing { border-left-color: var(--red); color: var(--red); }
.rule-h { margin: 22px 0 4px; font-size: 15px; }
.rule-warn { border-color: var(--amber); }
.rule-warn ul { margin: 8px 0 12px; padding-left: 32px; }
.rule-q.answered { opacity: .8; }
.rule-q .input { flex: 1; min-width: 0; }
.rule-form { display: grid; gap: 8px; padding: 12px 14px; }
.rule-log { max-height: 220px; overflow: auto; font-size: 12px; background: var(--surface-2); padding: 8px; border-radius: 8px; margin: 0; white-space: pre-wrap; }

/* refine box */
.refine-box { margin-top: 14px; padding: 10px 12px; border: 1px dashed var(--border); border-radius: 10px; display: grid; gap: 6px; }
.refine-box .input { flex: 1; min-width: 0; }

/* dashboards */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; margin-top: 14px; }
.dash-body { padding: 10px 14px 14px; display: grid; gap: 10px; }
.dash-fig { width: 100%; border-radius: 8px; background: #fff; }
.dash-values { display: flex; flex-wrap: wrap; gap: 8px; }
.dash-val { padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; min-width: 90px; }
.dv-num { font-size: 18px; font-weight: 650; }
.dash-sum { font-size: 13px; }
@media (max-width: 560px) { .dash-grid { grid-template-columns: 1fr; } }

/* models tab */
.mdl-gate { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.mdl-kv { display: grid; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; min-width: 120px; }
.mdl-v { font-size: 17px; font-weight: 650; }
.card-head .spacer { flex: 1; }

/* data map */
.dm-toolbar { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.dm-toolbar .input { max-width: 360px; }
.dm-concept { margin-bottom: 14px; }
.dm-places { display: grid; gap: 0; }
.dm-place { padding: 10px 16px; border-top: 1px solid var(--border); display: grid; gap: 6px; }
.dm-place-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dm-verdict { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.dm-good { color: var(--green); background: var(--green-bg); }
.dm-mid { color: var(--blue); background: var(--blue-bg); }
.dm-low { color: var(--text-3); background: var(--surface-3); }
.dm-bad { color: var(--red); background: var(--red-bg); }
.dm-stats { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--text-2); }
.dm-stats b { color: var(--text); font-weight: 650; }
.dm-items { display: flex; flex-wrap: wrap; gap: 6px; }
.dm-item { display: inline-flex; align-items: center; gap: 4px; font: 12px/1.4 var(--mono, ui-monospace, monospace); padding: 2px 8px;
  border: 1px solid var(--border-2); border-radius: 6px; background: var(--surface-2); color: var(--text-2); cursor: pointer; }
.dm-item:hover { border-color: var(--accent); color: var(--text); }
.dm-item-rejected { text-decoration: line-through; color: var(--red); border-color: var(--red-bg); }
.dm-item-preferred { color: var(--green); border-color: var(--green); }
.dm-gap { display: flex; align-items: center; gap: 6px; color: var(--amber); }
.dm-cov { display: flex; align-items: flex-end; gap: 4px; height: 64px; padding-top: 14px; }
.dm-bar { position: relative; width: 26px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.dm-bar-fill { background: var(--accent); border-radius: 3px 3px 0 0; opacity: .75; }
.dm-bar-y { font-size: 10px; color: var(--text-3); text-align: center; }
.dm-bar-v { position: absolute; top: -13px; width: 100%; font-size: 9.5px; color: var(--text-3); text-align: center; }

/* add values */
.av-req { width: 100%; resize: vertical; }
.av-row { display: flex; justify-content: flex-end; margin-top: 8px; }
.av-qs { display: grid; gap: 14px; margin-bottom: 12px; }
.av-q { display: grid; gap: 4px; }
.av-q-text { display: flex; gap: 6px; align-items: flex-start; }
.av-q-text .ic { color: var(--accent); margin-top: 2px; flex: none; }
.av-opts { display: flex; flex-wrap: wrap; gap: 6px 14px; padding-left: 20px; }
.av-opt { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; }
.av-def { font-size: 10.5px; color: var(--text-3); border: 1px solid var(--border-2); border-radius: 4px; padding: 0 4px; }
.av-notes { margin: 10px 0 4px; padding-left: 18px; color: var(--text-2); display: grid; gap: 3px; }

/* vocabulary */
.vc-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 10px 0; }
@media (max-width: 820px) { .vc-cols { grid-template-columns: 1fr; } }
.vc-h { font-weight: 600; font-size: 12.5px; color: var(--text-2); margin: 10px 0 4px; }
.vc-list { margin: 0; padding-left: 20px; display: grid; gap: 2px; font-size: 13px; }
.vc-site { margin-bottom: 6px; }
.vc-cert { color: var(--green); }
.vc-teach { width: 100%; resize: vertical; }
.vc-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.vc-chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* login (shown only when the app is reached through a proxy) */
body.is-login #sidebar, body.is-login #topbar, body.is-login #dock, body.is-login #banner { display: none; }
.login-wrap { min-height: 80vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(380px, 100%); padding: 24px; display: grid; gap: 12px; }
.login-head { display: flex; align-items: center; gap: 10px; }
.login-head h2 { margin: 0; font-size: 20px; }
.login-card .input { width: 100%; }
