/* brain.css — Cockpit Agents IA TAKEYS */

/* ═══ TAKEYS palette ═══
   Taupe #5a524f · Chocolat #5e433a · Olive #55553c
   Crème #f5ead8 · Céladon #8ba498 (signature)
*/

/* DARK */
:root[data-theme="dark"], :root {
  --bg: #2a2522;
  --bg-2: #221e1c;
  --bg-raised: #342e2a;
  --surface: #3a332f;
  --surface-2: #453c37;
  --surface-3: #4f4540;
  --border: rgba(245,234,216,0.09);
  --border-strong: rgba(245,234,216,0.18);
  --text: #f5ead8;
  --text-2: #d8cdb8;
  --muted: #9b8e7c;
  --brand: #8ba498;
  --brand-dim: rgba(139,164,152,0.16);
  --accent: #8ba498;
  --accent-2: #a5b8ae;
  --accent-line: rgba(139,164,152,0.32);
  --success: #9bb880;
  --warning: #d4b575;
  --danger: #c88878;
  --info: #8faec4;
  --c-data: #8faec4;
  --c-request: #d4b575;
  --c-alert: #c88878;
  --line-static: rgba(245,234,216,0.18);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.45);
  --grain-opacity: 0.14;
}

:root[data-theme="light"] {
  --bg: #f0e6d2;
  --bg-2: #e7dcc4;
  --bg-raised: #e8ddc4;
  --surface: #f5ead8;
  --surface-2: #ebdfc6;
  --surface-3: #ddd0b3;
  --border: rgba(51,43,38,0.10);
  --border-strong: rgba(51,43,38,0.22);
  --text: #2b2520;
  --text-2: #554a42;
  --muted: #8a7e6f;
  --brand: #5a524f;
  --brand-dim: rgba(90,82,79,0.10);
  --accent: #6e8a7e;
  --accent-2: #4d6e62;
  --accent-line: rgba(110,138,126,0.42);
  --success: #6e8a5a;
  --warning: #b8964a;
  --danger: #9e4a3d;
  --info: #5a7490;
  --c-data: #5a7490;
  --c-request: #b8964a;
  --c-alert: #9e4a3d;
  --line-static: rgba(45,36,30,0.18);
  --shadow-lg: 0 8px 32px rgba(45,36,30,0.16);
  --grain-opacity: 0.20;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body, #root { height: 100%; }
body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
  overflow: hidden;
}
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: var(--grain-opacity); mix-blend-mode: overlay;
}
.serif { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 500; letter-spacing: 0; }
.italic { font-style: italic; }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.85em; letter-spacing: 0.04em; }
button { font-family: inherit; cursor: pointer; }

/* ═══ Layout ═══ */
.brain {
  height: 100vh;
  display: grid;
  grid-template-rows: 56px 1fr;
  position: relative;
  z-index: 1;
}
.brain-main {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 360px;
  overflow: hidden;
  min-width: 0;
}
.brain-center {
  overflow-y: auto;
  padding: 20px 24px 32px;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

/* ═══ Topbar ═══ */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}
.topbar-l { display: flex; align-items: center; gap: 14px; }
.topbar-brand {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; color: var(--text);
}
.brand-mark-block {
  width: 24px; height: 24px;
  background: var(--brand);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.brand-mark-square {
  width: 6px; height: 6px;
  background: var(--bg);
  position: absolute; bottom: 3px; right: 3px;
}
.brand-wordmark {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700; letter-spacing: 0.18em; font-size: 12px;
}
.brand-section {
  color: var(--muted); font-size: 11px; letter-spacing: 0.16em;
}
.topbar-sep { color: var(--muted); }
.topbar-meta { color: var(--muted); font-size: 10.5px; }
.topbar-r { display: flex; align-items: center; gap: 8px; }
.topbar-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 7px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-2); font-size: 12px;
  transition: all .12s;
}
.topbar-btn:hover { background: var(--surface-2); color: var(--text); }
.topbar-btn.icon { width: 30px; height: 30px; padding: 0; justify-content: center; }
.kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; padding: 1px 5px; border-radius: 3px;
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--border);
}
.topbar-user-av {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
}

/* ═══ Agent Sidebar ═══ */
.agent-side {
  background: var(--bg-2);
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.agent-side-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 18px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.agent-side-title { font-size: 22px; line-height: 1; }
.agent-side-sub { font-size: 10px; color: var(--muted); margin-top: 4px; }
.btn-mini {
  padding: 4px 9px; font-size: 11px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-2); border-radius: 5px; transition: all .12s;
  font-family: inherit;
}
.btn-mini:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.btn-mini.primary { background: var(--brand); color: var(--bg); border-color: var(--brand); }
.btn-mini.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }

.agent-filter {
  display: flex; gap: 4px; padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.agent-filter button {
  flex: 1; padding: 5px 6px; font-size: 11px; border-radius: 5px;
  background: transparent; border: 1px solid transparent; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  transition: all .12s;
}
.agent-filter button:hover { color: var(--text-2); }
.agent-filter button.active {
  background: var(--surface); color: var(--text); border-color: var(--border);
}
.agent-filter-c {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  padding: 0 5px; border-radius: 8px;
  background: var(--surface-2); color: var(--muted);
}

.agent-list { list-style: none; padding: 6px 8px; flex: 1; }
.agent-row {
  display: grid; grid-template-columns: 36px 1fr auto;
  gap: 10px; align-items: center;
  padding: 9px 10px; border-radius: 7px;
  cursor: pointer; transition: all .12s;
  position: relative;
}
.agent-row:hover { background: var(--surface); }
.agent-row.active { background: var(--surface); }
.agent-row.active::before {
  content: ''; position: absolute; left: -8px; top: 8px; bottom: 8px; width: 2px;
  background: var(--accent); border-radius: 0 2px 2px 0;
}
.agent-row-glyph {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 500;
  border: 1px solid;
  position: relative;
}
.agent-row-pulse {
  position: absolute; bottom: -1px; right: -1px;
  width: 8px; height: 8px; border-radius: 50%;
  border: 2px solid var(--bg-2);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  50% { box-shadow: 0 0 0 4px transparent; opacity: 0.7; }
}
.brain-mark {
  width: 14px; height: 14px;
  border: 1.5px solid currentColor; border-radius: 50%;
  position: relative;
}
.brain-mark::after {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 4px; height: 4px; background: currentColor; border-radius: 50%;
  transform: translate(-50%, -50%);
}
.brain-mark-sm { width: 10px; height: 10px; border: 1.2px solid currentColor; border-radius: 50%; display: inline-block; }
.agent-row-body { min-width: 0; }
.agent-row-name { font-size: 15px; line-height: 1.2; }
.agent-row-role { font-size: 11px; color: var(--muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-row-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.agent-row-cost { color: var(--muted); font-size: 10px; }
.agent-row-badge {
  width: 16px; height: 16px; border-radius: 50%;
  font-size: 10px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.agent-row-badge.warn { background: var(--warning); color: var(--bg); }

.agent-side-foot {
  border-top: 1px solid var(--border);
  padding: 14px 16px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.agent-side-tot div:first-child { font-size: 9px; color: var(--muted); letter-spacing: 0.1em; }
.agent-side-tot div:last-child { font-size: 22px; line-height: 1.1; margin-top: 3px; }

/* ═══ Hero ═══ */
.brain-hero {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 24px; margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--border);
}
.brain-hero-h { font-size: 32px; line-height: 1.1; letter-spacing: -0.015em; }
.brain-hero-h em { color: var(--accent-2); font-style: italic; }
.brain-hero-sub { color: var(--muted); font-size: 10.5px; margin-top: 6px; letter-spacing: 0.12em; }
.brain-hero-actions { display: flex; gap: 8px; }
.btn-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-2); font-size: 12px; transition: all .12s;
}
.btn-pill:hover { border-color: var(--border-strong); color: var(--text); }
.btn-pill.ghost { background: transparent; }
.btn-pill .on { color: var(--text); font-weight: 500; }

/* ═══ Constellation ═══ */
.constellation {
  position: relative;
  width: 100%; height: 460px;
  background:
    radial-gradient(ellipse at center, var(--bg-raised) 0%, var(--bg) 70%),
    var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 18px;
}
.constellation-svg {
  display: block; width: 100%; height: 100%;
}
.constellation-svg .node {
  transition: transform .2s;
}
.constellation-svg .node:hover {
  transform: scale(1.03);
  transform-origin: center;
  transform-box: fill-box;
}
.constellation-legend {
  position: absolute; bottom: 14px; left: 16px;
  display: flex; gap: 14px;
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  letter-spacing: 0.06em;
}
.leg-data { color: var(--c-data); }
.leg-request { color: var(--c-request); }
.leg-alert { color: var(--c-alert); }

/* ═══ Decisions ═══ */
.brain-decisions {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin-bottom: 22px;
}
.dec-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--warning);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: all .12s;
}
.dec-card:hover { background: var(--surface-2); border-color: var(--border-strong); border-left-color: var(--warning); }
.dec-card-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.dec-card-glyph {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid; display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 16px; font-weight: 500;
}
.dec-card-name { font-size: 15px; line-height: 1; }
.dec-card-role { font-size: 9px; color: var(--muted); margin-top: 2px; letter-spacing: 0.12em; }
.dec-card-tag {
  margin-left: auto;
  font-size: 10px; font-family: 'JetBrains Mono', monospace;
  padding: 2px 7px; border-radius: 10px;
  background: rgba(212,181,117,0.15); color: var(--warning);
  border: 1px solid rgba(212,181,117,0.3);
}
.dec-card-text { font-size: 13px; color: var(--text-2); margin-bottom: 12px; line-height: 1.45; }
.dec-card-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ═══ Feed ═══ */
.brain-feed {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.brain-feed-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.brain-feed-tabs {
  display: inline-flex; gap: 1px; padding: 2px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px;
}
.brain-feed-tabs button {
  padding: 3px 10px; font-size: 11px; border-radius: 4px;
  background: transparent; border: none; color: var(--muted);
}
.brain-feed-tabs button.active { background: var(--surface); color: var(--text); }

.feed-timeline { max-height: 420px; overflow-y: auto; }
.feed-row {
  display: grid; grid-template-columns: 48px 8px 80px auto 1fr;
  gap: 10px; align-items: center;
  padding: 9px 16px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: all .12s;
}
.feed-row:last-child { border-bottom: none; }
.feed-row:hover, .feed-row.highlight { background: var(--surface-2); }
.feed-time { font-size: 11px; color: var(--muted); }
.feed-dot { width: 8px; height: 8px; border-radius: 50%; }
.feed-agent { font-size: 14px; }
.feed-text { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-row.feed-alert { border-left: 2px solid var(--c-alert); }
.feed-row.feed-request { border-left: 2px solid var(--c-request); }
.feed-row.feed-decision { border-left: 2px solid var(--accent); }

.kind-tag {
  font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
  padding: 1.5px 6px; border-radius: 8px;
  letter-spacing: 0.04em;
  border: 1px solid;
}
.kind-action { color: var(--muted); border-color: var(--border-strong); background: var(--surface-2); }
.kind-decision { color: var(--accent-2); border-color: var(--accent-line); background: var(--brand-dim); }
.kind-request { color: var(--c-request); border-color: rgba(212,181,117,0.32); background: rgba(212,181,117,0.10); }
.kind-alert { color: var(--c-alert); border-color: rgba(200,136,120,0.32); background: rgba(200,136,120,0.10); }

.feed-chat { padding: 14px 16px; max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.feed-bubble { display: flex; gap: 10px; }
.feed-bubble-glyph {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid; flex-shrink: 0;
  font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 15px; font-weight: 500;
}
.feed-bubble-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.feed-bubble-meta .serif { font-size: 14px; }
.feed-bubble-time { color: var(--muted); font-size: 10px; }
.feed-bubble-text {
  font-size: 13px; color: var(--text-2);
  background: var(--surface-2);
  padding: 8px 12px; border-radius: 10px 10px 10px 2px;
  line-height: 1.5;
  border: 1px solid var(--border);
}

/* ═══ Inspector ═══ */
.inspector {
  background: var(--bg-2);
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.ins-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px 12px;
}
.ins-head-mark {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ins-head-body { flex: 1; min-width: 0; }
.ins-name { font-size: 22px; line-height: 1; }
.ins-role { color: var(--muted); font-size: 10.5px; margin-top: 3px; }
.ins-brain-mark {
  width: 18px; height: 18px;
  border: 1.6px solid var(--brand); border-radius: 50%;
  position: relative;
}
.ins-brain-mark::after {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 6px; height: 6px; background: var(--brand); border-radius: 50%;
  transform: translate(-50%, -50%);
}

.status-pill {
  font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
  padding: 2px 8px; border-radius: 10px;
  letter-spacing: 0.06em;
  border: 1px solid;
}
.status-pill.success { color: var(--success); border-color: rgba(155,184,128,0.32); background: rgba(155,184,128,0.12); }
.status-pill.warning { color: var(--warning); border-color: rgba(212,181,117,0.32); background: rgba(212,181,117,0.12); }
.status-pill.danger { color: var(--danger); border-color: rgba(200,136,120,0.32); background: rgba(200,136,120,0.12); }
.status-pill.info { color: var(--info); border-color: rgba(143,174,196,0.32); background: rgba(143,174,196,0.12); }
.status-pill.muted { color: var(--muted); border-color: var(--border-strong); background: var(--surface); }
.status-pill.gold { color: var(--accent-2); border-color: var(--accent-line); background: var(--brand-dim); }

.ins-blurb { padding: 0 18px 14px; font-size: 12.5px; color: var(--text-2); line-height: 1.5; }

.ins-stats {
  margin: 0 18px 14px; padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.ins-stat { display: grid; grid-template-columns: 80px 1fr 40px; align-items: center; gap: 10px; margin-bottom: 12px; }
.ins-stat-label { font-size: 9.5px; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; }
.ins-stat-bar { height: 5px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.ins-stat-fill { height: 100%; border-radius: 3px; transition: width .4s; }
.ins-stat-val { font-size: 11px; color: var(--text); text-align: right; }
.ins-stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.ins-stat-num { font-size: 19px; line-height: 1; margin-top: 3px; }
.ins-stat-num .mono { color: var(--muted); font-size: 11px; }

.ins-tabs {
  display: flex; gap: 2px; padding: 0 18px 0;
  border-bottom: 1px solid var(--border);
}
.ins-tab {
  padding: 8px 12px; font-size: 11.5px;
  background: transparent; border: none;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  text-transform: lowercase;
  margin-bottom: -1px;
}
.ins-tab:hover { color: var(--text-2); }
.ins-tab.active { color: var(--text); border-bottom-color: var(--accent); }

.ins-body { flex: 1; padding: 14px 18px; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.ins-chat { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.ins-chat-msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; }
.ins-msg {
  font-size: 12.5px; line-height: 1.5;
  padding: 8px 11px; border-radius: 10px;
  max-width: 88%;
  white-space: pre-wrap;
}
.ins-msg.them {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 3px;
  align-self: flex-start;
}
.ins-msg.me {
  background: var(--brand); color: var(--bg);
  border-bottom-right-radius: 3px;
  align-self: flex-end;
}
.ins-input-wrap {
  display: grid; grid-template-columns: 1fr auto;
  gap: 6px; padding-top: 10px;
  border-top: 1px solid var(--border);
}
.ins-input {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; color: var(--text);
  font-family: inherit; font-size: 12.5px; resize: none;
  outline: none;
}
.ins-input:focus { border-color: var(--accent-line); }
.ins-input-actions { display: flex; flex-direction: column; gap: 4px; }

.ins-prompt-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.ins-prompt-label { color: var(--muted); font-size: 10px; letter-spacing: 0.1em; }
.ins-prompt-text {
  width: 100%; min-height: 200px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px;
  color: var(--text); font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px; line-height: 1.55; resize: vertical; outline: none;
}
.ins-prompt-text.editing { border-color: var(--accent-line); background: var(--bg); }
.ins-prompt-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 8px; }

.ins-tasks { list-style: none; }
.ins-task {
  display: grid; grid-template-columns: 24px 1fr auto;
  gap: 10px; align-items: center;
  padding: 9px 0; border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.ins-task:last-child { border-bottom: none; }
.ins-task-state {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--muted);
  font-size: 12px;
}
.ins-task.t-done .ins-task-state { background: rgba(155,184,128,0.20); color: var(--success); }
.ins-task.t-doing .ins-task-state { background: rgba(143,174,196,0.20); color: var(--info); }
.ins-task.t-review .ins-task-state { background: rgba(212,181,117,0.20); color: var(--warning); }
.ins-task.t-blocked .ins-task-state { background: rgba(200,136,120,0.20); color: var(--danger); }
.ins-task.t-done .ins-task-text { color: var(--muted); text-decoration: line-through; }
.ins-task-at { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--muted); }

.ins-integrations { display: flex; flex-wrap: wrap; gap: 6px; }
.ins-int-pill {
  font-size: 11.5px; padding: 4px 10px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-2);
}
.ins-int-note { width: 100%; margin-top: 10px; font-size: 10px; color: var(--muted); letter-spacing: 0.1em; }

/* ═══ CmdK ═══ */
.cmdk-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.45); backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 14vh;
  animation: fade .15s;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.cmdk {
  width: 640px; max-width: 92vw;
  background: var(--bg-raised); border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: rise .18s cubic-bezier(.2,.8,.2,1);
}
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.cmdk-input-wrap {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.cmdk-prefix { color: var(--accent-2); font-size: 12px; }
.cmdk-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-family: inherit; font-size: 15px;
}
.cmdk-input::placeholder { color: var(--muted); }
.cmdk-mic {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand); color: var(--bg); border: none;
}
.cmdk-list { list-style: none; padding: 6px; max-height: 340px; overflow-y: auto; }
.cmdk-item {
  padding: 10px 12px; border-radius: 7px; cursor: pointer;
  font-size: 13px; color: var(--text-2);
  transition: all .1s;
}
.cmdk-item:hover { background: var(--surface); color: var(--text); }
.cmdk-item .serif { font-size: 15px; color: var(--text); }
.cmdk-item-text { color: var(--muted); }
.cmdk-foot { padding: 10px 16px; border-top: 1px solid var(--border); font-size: 10px; color: var(--muted); }

/* ═══ Responsive ═══ */
@media (max-width: 1280px) {
  .brain-main { grid-template-columns: 220px 1fr 300px; }
  .brain-decisions { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .brain-main { grid-template-columns: 200px 1fr 280px; }
  .brain-hero-h { font-size: 26px; }
}
@media (max-width: 720px) {
  .brain-main { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; }
  .agent-side, .inspector { display: none; }
}

/* Scrollbars (subtle) */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* Typing animation */
.ins-typing { display: flex; align-items: center; gap: 3px; }
.ins-typing-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); opacity: 0.4;
  animation: typing-pulse 1.2s ease-in-out infinite;
}
.ins-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.ins-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-pulse {
  0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.1); }
}

/* Prompt textarea bigger */
.ins-prompt-text { min-height: 200px; font-size: 12.5px; line-height: 1.6; }
