/* Hallmark · macrostructure: Workbench · genre: atmospheric · theme: existing Institution kits
 * pre-emit critique: P5 H5 E4 S5 R5 V4 · contrast: pass · responsive: pass · Agent Playlist test
 */
/* ============================================================
   Institution OS — Stenson Law demo
   Interface kits: Animation Studio (default), OS, JADE — dark
   Exact token authority: /kit/lib/*-tokens.json
   Product layout and behavior remain Institution-owned.
   ============================================================ */

@font-face {
  font-family: "Outfit";
  src: url("assets/fonts/outfit-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("assets/fonts/jetbrains-mono-latin.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Relay Sans";
  src: url("assets/fonts/relay-sans/RelaySans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Relay Sans";
  src: url("assets/fonts/relay-sans/RelaySans-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Relay Sans";
  src: url("assets/fonts/relay-sans/RelaySans-Semibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Relay Sans";
  src: url("assets/fonts/relay-sans/RelaySans-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root,
:root[data-kit="animation"] {
  color-scheme: dark;
  --background: oklch(0.15683 0.01057 285.12);
  --foreground: oklch(0.94481 0.00802 286.25);
  --card: oklch(0.20452 0.01782 284.72);
  --card-foreground: oklch(0.94481 0.00802 286.25);
  --popover: oklch(0.24539 0.02460 284.44);
  --popover-foreground: oklch(0.94481 0.00802 286.25);
  --primary: oklch(0.71998 0.17231 303.07);
  --primary-foreground: oklch(0.15683 0.01057 285.12);
  --secondary: oklch(0.24539 0.02460 284.44);
  --secondary-foreground: oklch(1 0 0 / 0.72);
  --muted: oklch(0.17650 0.01438 284.83);
  --muted-foreground: oklch(1 0 0 / 0.56);
  --accent: oklch(0.24539 0.02460 284.44);
  --accent-foreground: oklch(0.94481 0.00802 286.25);
  --destructive: oklch(0.71161 0.18122 22.84);
  --destructive-foreground: oklch(0.15683 0.01057 285.12);
  --positive: oklch(0.86280 0.15184 159.40);
  --positive-foreground: oklch(0.15683 0.01057 285.12);
  --border: oklch(1 0 0 / 0.07);
  --input: oklch(0.24539 0.02460 284.44);
  --ring: oklch(0.71998 0.17231 303.07);
  --overlay: oklch(0.15683 0.01057 285.12);
  --plane-1: oklch(0.17650 0.01438 284.83);
  --plane-2: oklch(0.20452 0.01782 284.72);
  --plane-3: oklch(0.24539 0.02460 284.44);
  --plane-pressed: oklch(0.16788 0.01665 284.46);
  --ink-faint: oklch(1 0 0 / 0.36);
  --sidebar: oklch(0.17650 0.01438 284.83);
  --info: oklch(0.75854 0.1238 260.18);
  --warning: oklch(0.88878 0.16396 93.4);
  --success: oklch(0.8628 0.15184 159.4);
  --danger: oklch(0.71161 0.18122 22.84);
  --radius-control: 0.5625rem;
  --radius-card: 0.75rem;
  --radius-sheet: 1rem;
  --shadow-control: inset 0 0 0 1px oklch(1 0 0 / 0.07);
  --shadow-panel: 0 18px 46px -18px oklch(0 0 0 / 0.9), inset 0 0 0 1px oklch(1 0 0 / 0.07);
  --shadow-inset: inset 0 1px 0 oklch(1 0 0 / 0.07);
  --font-ui: "Outfit", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --body-size: 14px;
  --body-leading: 1.45;
  --body-letter: -0.008em;
  --dur-micro: 120ms;
  --dur-short: 180ms;
  --dur-fade: 280ms;
  --dur-pop: 360ms;
  --dur-rise: 420ms;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --theme-color: oklch(0.15683 0.01057 285.12);
}

:root[data-kit="os"] {
  color-scheme: dark;
  --background: oklch(0.26092 0.00759 274.66);
  --foreground: oklch(0.94 0.008 275);
  --card: oklch(0.29007 0.00917 276.80);
  --card-foreground: oklch(0.94 0.008 275);
  --popover: oklch(0.32204 0.00893 276.86);
  --popover-foreground: oklch(0.94 0.008 275);
  --primary: oklch(0.60713 0.19791 259.58);
  --primary-foreground: oklch(0.16 0.03 258);
  --secondary: oklch(0.32204 0.00893 276.86);
  --secondary-foreground: oklch(0.82 0.010 276);
  --muted: oklch(0.24415 0.00772 274.63);
  --muted-foreground: oklch(0.70 0.010 276);
  --accent: oklch(0.37 0.07 259);
  --accent-foreground: oklch(0.94 0.008 275);
  --destructive: oklch(0.69345 0.19653 26.69);
  --destructive-foreground: oklch(0.20 0.03 27);
  --positive: oklch(0.71859 0.18300 148.48);
  --positive-foreground: oklch(0.18 0.035 148);
  --border: oklch(0.48 0.010 276);
  --input: oklch(0.24415 0.00772 274.63);
  --ring: oklch(0.72 0.15 259);
  --overlay: oklch(0.15 0.008 275);
  --plane-1: oklch(0.24415 0.00772 274.63);
  --plane-2: oklch(0.29007 0.00917 276.80);
  --plane-3: oklch(0.32204 0.00893 276.86);
  --plane-pressed: oklch(0.36173 0.01207 279.31);
  --ink-faint: oklch(0.60 0.010 276);
  --sidebar: oklch(0.24415 0.00772 274.63);
  --info: oklch(0.67136 0.14020 250.20);
  --warning: oklch(0.80681 0.14687 87.42);
  --success: oklch(0.71859 0.18300 148.48);
  --danger: oklch(0.69345 0.19653 26.69);
  --radius-control: 0.5625rem;
  --radius-card: 0.75rem;
  --radius-sheet: 1rem;
  --shadow-control: none;
  --shadow-panel: 0 20px 60px oklch(0.10 0.006 275 / 0.58), 0 2px 10px oklch(0.10 0.006 275 / 0.36);
  --shadow-inset: inset 0 1px 2px oklch(0.10 0.006 275 / 0.42);
  --font-ui: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --body-size: 15px;
  --body-leading: 1.5;
  --body-letter: 0;
  --dur-micro: 120ms;
  --dur-short: 180ms;
  --dur-fade: 180ms;
  --dur-pop: 180ms;
  --dur-rise: 240ms;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-drawer: cubic-bezier(0.22, 1, 0.36, 1);
  --theme-color: oklch(0.26092 0.00759 274.66);
}

:root[data-kit="jade"] {
  color-scheme: dark;
  --background: oklch(0.18905 0.00940 184.09);
  --foreground: oklch(0.95379 0.00594 170.44);
  --card: oklch(0.24331 0.01213 178.37);
  --card-foreground: oklch(0.95379 0.00594 170.44);
  --popover: oklch(0.26744 0.01318 180.25);
  --popover-foreground: oklch(0.95379 0.00594 170.44);
  --primary: oklch(0.80630 0.14727 177.61);
  --primary-foreground: oklch(0.26113 0.04314 179.94);
  --secondary: oklch(0.26744 0.01318 180.25);
  --secondary-foreground: oklch(0.77386 0.01190 176.20);
  --muted: oklch(0.16721 0.00817 181.79);
  --muted-foreground: oklch(0.61006 0.01367 177.73);
  --accent: oklch(0.32342 0.04351 178.87);
  --accent-foreground: oklch(0.95379 0.00594 170.44);
  --destructive: oklch(0.68 0.17 22.77);
  --destructive-foreground: oklch(0.95379 0.00594 170.44);
  --positive: oklch(0.72 0.14 161.10);
  --positive-foreground: oklch(0.14052 0.00596 174.67);
  --border: oklch(0.95379 0.00594 170.44 / 0.07);
  --input: oklch(0.14052 0.00596 174.67);
  --ring: oklch(0.80630 0.14727 177.61);
  --overlay: oklch(0.14052 0.00596 174.67);
  --plane-1: oklch(0.18905 0.00940 184.09);
  --plane-2: oklch(0.16721 0.00817 181.79);
  --plane-3: oklch(0.14052 0.00596 174.67);
  --plane-pressed: oklch(0.14052 0.00596 174.67);
  --ink-faint: oklch(0.47582 0.01332 175.82);
  --sidebar: oklch(0.16721 0.00817 181.79);
  --info: oklch(0.72 0.1 230);
  --warning: oklch(0.78 0.12 90);
  --success: oklch(0.72 0.14 161.10);
  --danger: oklch(0.68 0.17 22.77);
  --radius-control: 1rem;
  --radius-card: 1.25rem;
  --radius-sheet: 1.5rem;
  --shadow-control: inset 0 1px 0 oklch(0.95379 0.00594 170.44 / 0.07), inset 0 -1px 0 oklch(0.95379 0.00594 170.44 / 0.07), 0 1px 2px oklch(0.08 0.006 178 / 0.34), 0 3px 8px oklch(0.08 0.006 178 / 0.34);
  --shadow-panel: inset 0 1px 0 oklch(0.95379 0.00594 170.44 / 0.07), inset 0 -1px 0 oklch(0.95379 0.00594 170.44 / 0.07), 0 2px 4px oklch(0.08 0.006 178 / 0.34), 0 8px 20px oklch(0.08 0.006 178 / 0.58);
  --shadow-inset: inset 0 2px 4px oklch(0.08 0.006 178 / 0.58), inset 0 4px 10px oklch(0.08 0.006 178 / 0.34), inset 0 -1px 0 oklch(0.95379 0.00594 170.44 / 0.05);
  --font-ui: "Relay Sans", ui-sans-serif, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --body-size: 15px;
  --body-leading: 1.5;
  --body-letter: 0;
  --dur-micro: 120ms;
  --dur-short: 180ms;
  --dur-fade: 180ms;
  --dur-pop: 180ms;
  --dur-rise: 360ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --ease-drawer: cubic-bezier(0.2, 0, 0, 1);
  --theme-color: oklch(0.18905 0.00940 184.09);
}

:root {
  --primary-soft: color-mix(in oklch, var(--primary) 13%, transparent);
  --info-soft: color-mix(in oklch, var(--info) 13%, transparent);
  --warning-soft: color-mix(in oklch, var(--warning) 12%, transparent);
  --success-soft: color-mix(in oklch, var(--success) 12%, transparent);
  --danger-soft: color-mix(in oklch, var(--danger) 13%, transparent);
  --border-strong: color-mix(in oklch, var(--foreground) 13%, transparent);
  --hover: color-mix(in oklch, var(--foreground) 5.5%, transparent);
  --hover-soft: color-mix(in oklch, var(--foreground) 3.5%, transparent);
  --ink-strong: color-mix(in oklch, var(--foreground) 88%, transparent);
  --ink-soft: color-mix(in oklch, var(--foreground) 82%, transparent);
  --ink-readable: color-mix(in oklch, var(--foreground) 75%, transparent);
  --selection: color-mix(in oklch, var(--primary) 35%, transparent);
  --shadow-pop: var(--shadow-panel);

  /* Layout */
  --topbar-h: 90px;
  --rail-w: 292px;
  --inspector-w: 324px;
  --control-h: 44px;
  --control-sm: 44px;
}

* { box-sizing: border-box; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
html, body { height: 100%; }
html { overflow-x: clip; }
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-ui);
  font-size: var(--body-size);
  line-height: var(--body-leading);
  letter-spacing: var(--body-letter);
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overflow-y: hidden;
}
@media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 1.5dppx) {
  body { -webkit-font-smoothing: antialiased; }
}
::selection { background: var(--selection); }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: var(--radius-control); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
svg { width: 1em; height: 1em; flex: none; }
input, textarea, select { font: inherit; color: inherit; }
b, strong { font-weight: 600; }
a { color: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: color-mix(in oklch, var(--foreground) 12%, transparent); border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: color-mix(in oklch, var(--foreground) 22%, transparent); border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- keyframes ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes pop  { from { opacity: 0; transform: scale(0.975); } to { opacity: 1; transform: none; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes typing-bounce { 0%,80%,100% { transform: none; opacity: .4; } 40% { transform: translateY(-3px); opacity: 1; } }
@keyframes bar-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes modal-pop { from { opacity: 0; transform: translate(-50%, -50%) scale(0.975); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes centerx-pop { from { opacity: 0; transform: translateX(-50%) scale(0.985); } to { opacity: 1; transform: translateX(-50%) scale(1); } }
@keyframes centerx-in { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

.rise { animation: rise var(--dur-rise) var(--ease) both; }
.pop  { animation: pop var(--dur-pop) var(--ease) both; }
.fade { animation: fadein var(--dur-fade) var(--ease) both; }
[data-stagger] > * { animation: rise var(--dur-rise) var(--ease) both; }
[data-stagger] > *:nth-child(1) { animation-delay: 0ms; }
[data-stagger] > *:nth-child(2) { animation-delay: 40ms; }
[data-stagger] > *:nth-child(3) { animation-delay: 80ms; }
[data-stagger] > *:nth-child(4) { animation-delay: 120ms; }
[data-stagger] > *:nth-child(5) { animation-delay: 160ms; }
[data-stagger] > *:nth-child(6) { animation-delay: 200ms; }
[data-stagger] > *:nth-child(7) { animation-delay: 240ms; }
[data-stagger] > *:nth-child(8) { animation-delay: 280ms; }
[data-stagger] > *:nth-child(n+9) { animation-delay: 320ms; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- app frame ---------- */
#app {
  display: grid;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--inspector-w);
  grid-template-areas: "topbar topbar topbar" "rail main inspector";
  height: 100vh;
  height: 100dvh;
}
#app.no-inspector { grid-template-columns: var(--rail-w) minmax(0, 1fr) 0; }
#app.no-inspector #inspector { display: none; }

/* ---------- topbar ---------- */
#topbar {
  grid-area: topbar;
  min-width: 0;
  display: flex; align-items: center; gap: 12px;
  position: relative;
  padding: 0 14px 30px;
  background: var(--sidebar);
  border-bottom: 1px solid var(--border);
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-glyph {
  width: 34px; height: 34px; border-radius: var(--radius-control);
  background: var(--primary); color: var(--primary-foreground);
  display: grid; place-items: center; flex: none;
}
.brand-glyph svg { width: 18px; height: 18px; }
.brand-name { font-weight: 700; font-size: 14px; letter-spacing: -0.01em; white-space: nowrap; }
.brand-sub { font-family: var(--font-mono); font-size: 10px; color: var(--muted-foreground); white-space: nowrap; }

.switcher {
  display: flex; align-items: center; gap: 8px;
  height: var(--control-h); padding: 0 10px 0 12px;
  border-radius: var(--radius-control);
  background: var(--plane-2); box-shadow: var(--shadow-control);
  transition: background var(--dur-micro) var(--ease);
  max-width: 240px;
}
.switcher:hover { background: var(--plane-3); }
.switcher b { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.switcher .chev { color: var(--muted-foreground); flex: none; }
.switcher-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); flex: none; }

.topbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.topbar-add-bot { flex: none; }
.demo-chip {
  font-family: var(--font-mono); font-size: 10px; color: var(--muted-foreground);
  border: 1px dashed var(--border-strong); border-radius: 999px; padding: 4px 10px;
  white-space: nowrap;
}
.icon-btn {
  width: var(--control-h); height: var(--control-h);
  display: grid; place-items: center;
  border-radius: var(--radius-control);
  color: var(--muted-foreground);
  transition: background var(--dur-micro) var(--ease), color var(--dur-micro) var(--ease);
  position: relative;
}
.icon-btn:hover { background: var(--plane-3); color: var(--foreground); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn .bubble {
  position: absolute; top: 6px; right: 6px;
  min-width: 15px; height: 15px; padding: 0 4px; border-radius: 999px;
  background: var(--primary); color: var(--primary-foreground);
  font-size: 9.5px; font-weight: 800; line-height: 15px; font-family: var(--font-mono);
}
.avatar-btn {
  width: var(--control-h); height: var(--control-h); border-radius: 50%;
  background: var(--primary);
  color: var(--primary-foreground); font-weight: 800; font-size: 12px;
  display: grid; place-items: center;
  box-shadow: var(--shadow-control);
}

/* ---------- omnibar ---------- */
#omni-wrap { flex: 1; display: flex; justify-content: center; min-width: 0; position: relative; }
#omnibar {
  width: min(620px, 100%);
  height: var(--control-h);
  display: flex; align-items: center; gap: 8px;
  background: var(--plane-2);
  border-radius: var(--radius-control);
  box-shadow: var(--shadow-control);
  padding: 0 6px 0 12px;
  transition: box-shadow var(--dur-short) var(--ease), background var(--dur-short) var(--ease);
}
#omnibar:focus-within { background: var(--plane-3); box-shadow: inset 0 0 0 1.5px var(--primary); }
#omnibar .spark { color: var(--primary); flex: none; }
#omnibar .spark svg { width: 16px; height: 16px; }
#omni-dev-mode {
  display: none; height: 26px; padding: 0 7px; flex: none;
  border-radius: 7px; background: var(--primary-soft); color: var(--primary);
  box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--primary) 48%, transparent);
  font-family: var(--font-mono); font-size: 9px; font-weight: 800; letter-spacing: .08em;
}
html.dev-mode-active #omni-dev-mode { display: inline-grid; place-items: center; }
html.dev-mode-active #omnibar {
  box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--primary) 64%, transparent), var(--shadow-control);
}
html.dev-mode-active #omnibar:focus-within { box-shadow: inset 0 0 0 1.5px var(--primary), var(--shadow-control); }
#omni-context {
  max-width: 150px; height: 30px; padding: 0 8px 0 10px;
  display: flex; align-items: center; gap: 5px; flex: none;
  border-radius: calc(var(--radius-control) - 2px);
  background: var(--plane-1); color: var(--muted-foreground);
  box-shadow: inset 0 0 0 1px var(--border);
  font-size: 10.5px; font-weight: 750;
  transition: color var(--dur-micro) var(--ease), background var(--dur-micro) var(--ease), box-shadow var(--dur-micro) var(--ease);
}
#omni-context:hover, #omni-context[aria-expanded="true"] { color: var(--foreground); background: var(--accent); }
#omni-context[aria-expanded="true"] { box-shadow: inset 0 0 0 1px var(--primary); }
#omni-context-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#omni-context svg { width: 12px; height: 12px; flex: none; }
#omni-input { flex: 1; background: transparent; border: 0; outline: 0; font-size: 13.5px; min-width: 0; }
#omni-input::placeholder { color: var(--ink-faint); }
.kbd {
  font-family: var(--font-mono); font-size: 10px; color: var(--muted-foreground);
  border: 1px solid var(--border-strong); border-radius: 6px; padding: 2px 6px;
  background: var(--plane-1); flex: none;
}
#omni-send {
  height: var(--control-h); padding: 0 14px; border-radius: var(--radius-control); flex: none;
  background: var(--primary); color: var(--primary-foreground);
  font-weight: 800; font-size: 12px;
  display: grid; place-items: center;
  transition: transform var(--dur-micro) var(--ease), opacity var(--dur-micro) var(--ease);
}
#omni-send:active { transform: translateY(1px); }
#omni-routing-controls {
  position: absolute; left: 50%; bottom: 5px; transform: translateX(-50%);
  width: min(620px, calc(100vw - 32px)); height: 25px;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  z-index: 2;
}
#omni-routing-controls label {
  min-width: 0; flex: 1 1 0; height: 25px; padding: 0 6px 0 8px;
  display: flex; align-items: center; gap: 5px;
  border-radius: calc(var(--radius-control) - 3px);
  color: var(--muted-foreground); background: var(--plane-1);
  box-shadow: inset 0 0 0 1px var(--border);
}
#omni-routing-controls label:focus-within { color: var(--foreground); box-shadow: inset 0 0 0 1px var(--primary); }
#omni-routing-controls label > span { flex: none; font-family: var(--font-mono); font-size: 8.5px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
#omni-routing-controls select {
  width: 100%; min-width: 0; height: 23px; padding: 0 2px;
  border: 0; outline: 0; background: transparent; color: var(--foreground);
  font-size: 10.5px; font-weight: 650; text-overflow: ellipsis;
}
#omni-routing-controls select option { color: var(--foreground); background: var(--popover); }
#omni-routing-controls label.is-selected { background: var(--primary-soft); color: var(--primary); box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--primary) 42%, transparent); }

/* omnibar overlay (palette + answers) */
#omni-panel {
  position: fixed;
  top: calc(var(--topbar-h) + 8px);
  left: 50%; transform: translateX(-50%);
  width: min(680px, calc(100vw - 32px));
  max-height: min(620px, calc(100dvh - var(--topbar-h) - 32px));
  overflow: auto;
  background: var(--popover);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-pop);
  z-index: 60;
  animation: centerx-pop var(--dur-pop) var(--ease) both;
}
#omni-panel .section-label { padding: 12px 14px 6px; }
.omni-context-block {
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  background: color-mix(in oklch, var(--plane-1) 72%, transparent);
}
.omni-context-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.omni-context-line .section-label { padding: 0; flex: none; }
.omni-context-summary { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted-foreground); font-size: 11px; }
.omni-scope-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.omni-scope-chip {
  min-height: 26px; padding: 4px 8px; display: inline-flex; align-items: center; gap: 5px;
  border-radius: 999px; background: var(--plane-2); color: var(--muted-foreground);
  box-shadow: inset 0 0 0 1px var(--border); font-size: 10.5px; font-weight: 700;
}
.omni-scope-chip svg { width: 12px; height: 12px; }
.omni-scope-chip.locked { color: var(--foreground); cursor: default; }
.omni-scope-chip[aria-pressed="true"] { color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--primary) 42%, transparent); }
.omni-scope-chip[aria-pressed="false"] { opacity: .58; text-decoration: line-through; }
.omni-scope-chip.contextual { color: var(--foreground); }
.omni-scope-chip.dev { color: var(--primary); background: var(--primary-soft); }
.omni-scope-chip.boundary { color: var(--muted-foreground); border-style: dashed; }
.omni-dev-context { background: color-mix(in oklch, var(--primary-soft) 32%, var(--plane-1)); }
.omni-dev-entry { margin: 0 8px 8px; width: calc(100% - 16px); border-radius: var(--radius-control); background: var(--plane-1); box-shadow: inset 0 0 0 1px var(--border); }
.omni-dev-entry > svg, .omni-dev-exit > svg { color: var(--primary); }
.omni-dev-intro { display: flex; align-items: flex-start; gap: 10px; padding: 14px 14px 8px; }
.omni-dev-intro .preview-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: none; border-radius: var(--radius-control); color: var(--primary); background: var(--primary-soft); }
.omni-dev-intro .preview-icon svg { width: 17px; height: 17px; }
.omni-dev-intro b { display: block; margin-top: 3px; font-size: 13px; }
.omni-dev-intro p { margin: 4px 0 0; color: var(--muted-foreground); font-size: 11.5px; line-height: 1.45; }
.omni-dev-exit { margin-top: 2px; border-top: 1px solid var(--border); color: var(--muted-foreground); }
.omni-command-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 4px 8px 10px; gap: 4px; }
.omni-command-grid .omni-sug { border-radius: var(--radius-control); padding: 9px 10px; }
.omni-command-kind { min-width: 52px; font-family: var(--font-mono); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--primary); }
.section-label {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--muted-foreground);
}
.omni-sug {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 9px 14px; font-size: 13.5px;
  transition: background var(--dur-micro) var(--ease);
}
.omni-sug:hover, .omni-sug.active { background: var(--hover); }
.omni-sug svg { width: 15px; height: 15px; color: var(--muted-foreground); flex: none; }
.omni-sug .hint { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--ink-faint); }

.ai-answer { padding: 16px 18px 14px; }
.ai-answer.is-compact .ai-body {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
  overflow: hidden; max-height: 4.8em;
}
.ai-answer.is-compact > .ai-rows,
.ai-answer.is-compact > .ai-actions,
.ai-answer.is-compact > .ai-sources { display: none; }
.ai-answer-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.ai-answer-head .who { font-weight: 800; font-size: 12px; }
.ai-answer-head .spark { color: var(--primary); display: grid; }
.ai-answer-head .spark svg { width: 14px; height: 14px; }
.ai-answer-head time { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--ink-faint); }
.ai-body { font-size: 13.5px; white-space: pre-wrap; }
.ai-body b, .chat-msg b { font-weight: 700; }
.caret { display: inline-block; width: 7px; height: 15px; background: var(--primary); vertical-align: -2px; margin-left: 2px; animation: blink 0.9s steps(1) infinite; border-radius: 2px; }
.ai-rows { margin-top: 12px; display: grid; gap: 6px; }
.ai-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--plane-2); border-radius: var(--radius-control);
  padding: 9px 12px; box-shadow: var(--shadow-control);
  font-size: 13px;
  transition: background var(--dur-micro) var(--ease), transform var(--dur-micro) var(--ease);
}
.ai-row:hover { background: var(--accent); }
.ai-row .grow { flex: 1; min-width: 0; }
.ai-row .t { font-weight: 700; }
.ai-row .s { color: var(--muted-foreground); font-size: 12px; }
.ai-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.ai-sources { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.omni-result-bar { display: flex; align-items: center; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.omni-result-bar .result-label { margin-right: auto; color: var(--muted-foreground); font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; }
.omni-result-bar .btn svg { width: 13px; height: 13px; }

.omni-preview { padding: 14px 16px 16px; }
.omni-preview-head { display: flex; align-items: flex-start; gap: 10px; }
.omni-preview-head .preview-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: none; border-radius: var(--radius-control); color: var(--primary); background: var(--primary-soft); }
.omni-preview-head .preview-icon svg { width: 17px; height: 17px; }
.omni-preview-head h3 { margin: 1px 0 3px; font-size: 14px; }
.omni-preview-head p { margin: 0; color: var(--muted-foreground); font-size: 11.5px; line-height: 1.45; }
.omni-preview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.omni-preview-card { padding: 10px 11px; border-radius: var(--radius-control); background: var(--plane-1); box-shadow: inset 0 0 0 1px var(--border); }
.omni-preview-card .section-label { padding: 0 0 6px; }
.omni-preview-card ul { margin: 0; padding-left: 16px; color: var(--muted-foreground); font-size: 11.5px; line-height: 1.5; }
.omni-preview-card li + li { margin-top: 3px; }
.omni-approval-line { display: flex; gap: 8px; align-items: center; margin-top: 10px; padding: 9px 10px; border-radius: var(--radius-control); background: var(--plane-2); font-size: 11.5px; }
.omni-approval-line svg { width: 15px; height: 15px; color: var(--primary); flex: none; }
.omni-preview-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.omni-preview-actions .spacer { flex: 1; }
.data-plan-summary { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.data-plan-limits { margin-top: 8px; }
.data-plan-boundary { background: var(--plane-2); }
.data-result-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.data-result-summary > div { padding: 11px 12px; border-radius: var(--radius-control); background: var(--plane-1); box-shadow: inset 0 0 0 1px var(--border); }
.data-result-summary span { display: block; color: var(--muted-foreground); font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; letter-spacing: .07em; }
.data-result-summary strong { display: block; margin-top: 5px; font-size: 19px; letter-spacing: -.02em; }
.data-result-layout { display: grid; grid-template-columns: 1.25fr .75fr; gap: 10px; margin-top: 10px; }
.data-result-section { padding: 11px 12px; border-radius: var(--radius-control); background: var(--plane-1); box-shadow: inset 0 0 0 1px var(--border); }
.data-result-section > .section-label { padding: 0 0 7px; }
.result-check { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--border); }
.result-check:first-of-type { border-top: 0; }
.result-check-icon { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; color: var(--muted-foreground); background: var(--plane-3); }
.result-check-icon.pass { color: var(--success); }
.result-check-icon.warn { color: var(--warning); }
.result-check-icon svg { width: 13px; height: 13px; }
.result-check b, .result-check small { display: block; }
.result-check b { font-size: 11.5px; }
.result-check small { margin-top: 1px; color: var(--muted-foreground); font-size: 10px; }
.result-check strong { font-family: var(--font-mono); font-size: 11px; }
.result-state p { margin: 9px 0 0; color: var(--muted-foreground); font-size: 11.5px; line-height: 1.5; }
.result-table-wrap { overflow-x: auto; border-radius: var(--radius-control); box-shadow: inset 0 0 0 1px var(--border); }
.result-table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 11.5px; }
.result-table th { padding: 8px 10px; color: var(--muted-foreground); font-family: var(--font-mono); font-size: 9px; text-align: left; text-transform: uppercase; letter-spacing: .06em; background: var(--plane-1); }
.result-table td { padding: 9px 10px; border-top: 1px solid var(--border); vertical-align: top; }
.result-table td b, .result-table td small { display: block; }
.result-table td small { margin-top: 3px; color: var(--muted-foreground); font-size: 9.5px; line-height: 1.35; }
.result-row-excluded { opacity: .67; }
.data-result-boundaries { margin-top: 10px; }

/* Blank Institution onboarding */
.rail-empty-state {
  margin: 10px 8px; padding: 14px 12px;
  border: 1px dashed var(--border); border-radius: var(--radius-md);
  color: var(--muted-foreground); font-size: 11.5px; line-height: 1.5; text-align: center;
}
.blank-institution-view { max-width: 1180px; }
.blank-onboarding { overflow: visible; }
.starter-template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.starter-template-card {
  min-width: 0; min-height: 92px; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: start; gap: 11px;
  padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--plane-2); color: var(--foreground); text-align: left; cursor: pointer;
}
.starter-template-card:hover { background: var(--plane-3); border-color: var(--border-strong); }
.starter-template-card.selected { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--primary) 38%, transparent); }
.starter-template-card > span:nth-child(2) { min-width: 0; display: grid; gap: 5px; }
.starter-template-card b { font-size: 13px; }
.starter-template-card small { color: var(--muted-foreground); font-size: 11px; line-height: 1.45; }
.starter-template-card em { color: var(--ink-faint); font-family: var(--font-mono); font-size: 9px; font-style: normal; text-transform: uppercase; }
.starter-core-spaces { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.starter-authority { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.starter-choice { min-width: 0; display: grid; gap: 5px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--plane-2); color: var(--foreground); text-align: left; cursor: pointer; }
.starter-choice:hover { background: var(--plane-3); }
.starter-choice.selected { border-color: var(--primary); background: var(--primary-soft); }
.starter-choice b, .starter-pack b { font-size: 11.5px; }
.starter-choice small, .starter-pack small { color: var(--muted-foreground); font-size: 10.5px; line-height: 1.4; }
.starter-packs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.starter-pack { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 9px; align-items: start; padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--plane-2); cursor: pointer; }
.starter-pack:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.starter-pack input { margin-top: 2px; accent-color: var(--primary); }
.starter-pack span { min-width: 0; display: grid; gap: 3px; }
.blank-prompt { max-width: 720px; }
.blank-prompt h2 { margin: 0; font-size: clamp(21px, 2.2vw, 30px); letter-spacing: -.025em; }
.blank-prompt p { margin: 8px 0 0; color: var(--muted-foreground); font-size: 13px; line-height: 1.6; }
.audience-picker { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.blank-field { display: grid; gap: 7px; margin-top: 16px; }
.blank-field > span { color: var(--foreground); font-size: 12px; font-weight: 650; }
.blank-field small { color: var(--muted-foreground); font-weight: 400; }
.blank-field textarea { min-height: 82px; }
.agent-package-file { padding: 10px 12px; cursor: pointer; }
.agent-package-preview { margin-top: 16px; }
.blank-setup-actions { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.blank-setup-actions > span { color: var(--muted-foreground); font-size: 11px; line-height: 1.45; }
.blank-setup-actions .btn { margin-left: auto; flex: none; }
.blank-next-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 14px; margin-top: 14px; }
.blank-step { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--border-subtle); }
.blank-step:last-child { border-bottom: 0; }
.blank-step > b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: var(--plane-3); color: var(--primary); font-family: var(--font-mono); font-size: 10px; }
.blank-step span { display: grid; gap: 3px; }
.blank-step strong { font-size: 12.5px; }
.blank-step small { color: var(--muted-foreground); font-size: 11.5px; line-height: 1.45; }
.shared-brain-actions { display: flex; align-items: center; gap: 7px; }
.blank-institution-view > .shared-brain-panel { margin-top: 14px; }
.shared-brain-actions .spacer { flex: 1; }
.brain-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.modal input.draft-box, .modal select.draft-box {
  width: 100%; min-height: var(--control-lg); border: 0; outline: none;
  color: var(--foreground); font-family: var(--font-ui); white-space: normal;
}
.modal select.draft-box { appearance: auto; padding-block: 10px; }
.brain-current { padding: 14px; border-radius: var(--radius-card); background: var(--plane-1); box-shadow: var(--shadow-control); }
.brain-current p { margin: 7px 0 0; color: var(--foreground); font-size: 14px; line-height: 1.6; }
.brain-history { display: grid; gap: 8px; margin-top: 8px; }
.brain-history-entry { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 11px 12px; border-radius: var(--radius-md); background: var(--plane-1); box-shadow: var(--shadow-control); }
.brain-history-entry b { font-size: 11.5px; }
.brain-history-entry > span { color: var(--muted-foreground); font: 9.5px var(--font-mono); }
.brain-history-entry p, .brain-history-entry small { grid-column: 1 / -1; margin: 0; }
.brain-history-entry p { color: var(--ink-readable); font-size: 12.5px; line-height: 1.5; }
.brain-history-entry small { color: var(--muted-foreground); font-size: 10.5px; line-height: 1.4; }
.brain-correction-note { min-height: 78px !important; }
.brain-search-results { display: grid; gap: 2px; margin-top: 12px; }
.accountability-panel .panel-foot { display: flex; align-items: center; gap: 8px; }
.accountability-panel .panel-foot .spacer { flex: 1; }
.accountability-skill-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.accountability-skill-grid > div { display: grid; gap: 4px; padding: 10px 11px; border-radius: var(--radius-control); background: var(--plane-1); box-shadow: var(--shadow-control); }
.accountability-skill-grid b { font-size: 11.5px; }
.accountability-skill-grid small { color: var(--muted-foreground); font-size: 10.5px; line-height: 1.45; }
.foundry-entry {
  display: flex; align-items: center; gap: 24px; justify-content: space-between;
  margin-top: 14px; padding: 18px 20px;
}
.foundry-entry > div { max-width: 760px; }
.foundry-entry h2 { margin: 5px 0 6px; font-size: 18px; }
.foundry-entry p, .foundry-lede { margin: 0; color: var(--muted-foreground); font-size: 12.5px; line-height: 1.55; }
.foundry-view { max-width: 1220px; }
.foundry-stepper {
  display: grid; grid-template-columns: repeat(6, minmax(92px, 1fr)); gap: 5px;
  margin-top: 16px; padding: 5px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--plane-2);
}
.foundry-step {
  display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px;
  border: 0; border-radius: calc(var(--radius-md) - 4px); background: transparent;
  color: var(--muted-foreground); cursor: pointer;
}
.foundry-step:hover:not(:disabled) { background: var(--plane-3); color: var(--foreground); }
.foundry-step:disabled { cursor: not-allowed; opacity: .38; }
.foundry-step > span { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 7px; background: var(--plane-3); font: 9px var(--font-mono); }
.foundry-step > span svg { width: 12px; height: 12px; }
.foundry-step b { font-size: 11px; }
.foundry-step.active { color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--primary) 42%, transparent); }
.foundry-step.complete > span { color: var(--success); }
.foundry-stage { display: grid; gap: 14px; }
.foundry-record blockquote, .foundry-trial blockquote {
  margin: 7px 0 18px; padding: 12px 14px; border-left: 2px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--plane-3);
  color: var(--foreground); font-size: 13px; line-height: 1.55;
}
.foundry-record p { color: var(--muted-foreground); font-size: 12.5px; line-height: 1.55; }
.foundry-interpret-grid, .foundry-detail-grid, .foundry-review-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px;
}
.foundry-interpret-grid > .panel { height: fit-content; }
.foundry-interpret-grid textarea { min-height: 76px; }
.foundry-actions {
  position: sticky; bottom: 10px; z-index: 8; display: flex; align-items: center; gap: 8px;
  padding: 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  background: color-mix(in oklab, var(--plane-2) 92%, transparent); box-shadow: var(--shadow-lg); backdrop-filter: blur(18px);
}
.foundry-actions [data-action="back"] svg { transform: rotate(180deg); }
.foundry-actions .spacer { flex: 1; }
.foundry-candidate-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.foundry-candidate-choice {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 82px;
  padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--plane-2);
  color: var(--foreground); text-align: left; cursor: pointer;
}
.foundry-candidate-choice:hover { border-color: var(--border-strong); background: var(--plane-3); }
.foundry-candidate-choice.selected { border-color: var(--primary); box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--primary) 42%, transparent); background: var(--primary-soft); }
.foundry-candidate-choice > span:first-child { display: grid; gap: 5px; }
.foundry-candidate-choice b { font-size: 13px; }
.foundry-candidate-choice small { color: var(--muted-foreground); font-size: 11.5px; line-height: 1.4; }
.foundry-list-card { display: grid; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--border-subtle); }
.foundry-list-card b { font-size: 12.5px; }
.foundry-list-card small { color: var(--muted-foreground); font-size: 11.5px; line-height: 1.45; }
.foundry-chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.foundry-section-gap { margin-top: 18px; }
.foundry-role-card { display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--border-subtle); }
.foundry-role-card:last-child { border-bottom: 0; }
.foundry-role-card > span:last-child { display: grid; gap: 3px; }
.foundry-role-card b { font-size: 12.5px; }
.foundry-role-card small { color: var(--muted-foreground); font-size: 10.5px; }
.foundry-role-card em { color: var(--ink-readable); font-size: 11.5px; line-height: 1.45; font-style: normal; }
.foundry-responsibility-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.foundry-responsibility-list > div { display: flex; gap: 8px; padding: 10px 11px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--plane-3); }
.foundry-responsibility-list svg { width: 15px; height: 15px; color: var(--success); }
.foundry-responsibility-list p { display: grid; gap: 4px; margin: 0; }
.foundry-responsibility-list b { font-size: 11.5px; line-height: 1.4; }
.foundry-responsibility-list small { color: var(--muted-foreground); font-size: 10.5px; }
.foundry-detail-grid ul, .foundry-authority-card ul, .foundry-review-grid ul { margin: 7px 0 0; padding-left: 17px; color: var(--muted-foreground); font-size: 11.5px; line-height: 1.65; }
.foundry-authority-list { display: grid; gap: 14px; }
.trust-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.foundry-empty-value { color: var(--muted-foreground); font-size: 11.5px; line-height: 1.5; }
.foundry-behavior-steps { display: grid; gap: 8px; margin: 8px 0 0; padding-left: 22px; }
.foundry-behavior-steps li { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--plane-3); color: var(--ink-readable); font-size: 12px; line-height: 1.5; }
.foundry-launch-counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.foundry-launch-counts > div { display: grid; gap: 3px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--plane-3); }
.foundry-launch-counts strong { font-size: 20px; }
.foundry-launch-counts span { color: var(--muted-foreground); font-size: 10px; }
.custom-pulse { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--plane-2); }
.custom-pulse > span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: var(--success); background: var(--success-soft); }
.custom-pulse svg { width: 17px; height: 17px; }
.custom-pulse > div { display: grid; gap: 3px; }
.custom-pulse b { font-size: 12.5px; }
.custom-pulse small { color: var(--muted-foreground); font-size: 11px; }
.result-modal .modal-foot { flex-wrap: wrap; }

/* Outcome Workspace is a derived view over existing goals, work, and results. */
.outcome-next {
  display: flex; align-items: center; gap: 18px; margin-bottom: 12px; padding: 16px 18px;
  border-radius: var(--radius-card); background: var(--plane-2); box-shadow: var(--shadow-control);
}
.outcome-next > div { min-width: 0; }
.outcome-next h2 { margin: 3px 0 5px; font-size: 19px; letter-spacing: -0.025em; }
.outcome-next p { margin: 0; color: var(--muted-foreground); font-size: 12px; line-height: 1.5; }
.outcome-next .btn { margin-left: auto; flex: none; }
.outcome-contract {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px;
  margin-bottom: 14px; overflow: hidden; border-radius: var(--radius-card); box-shadow: var(--shadow-control);
  background: var(--border);
}
.outcome-contract > div { display: grid; align-content: start; gap: 5px; min-width: 0; padding: 13px 14px; background: var(--plane-2); }
.outcome-contract span { color: var(--muted-foreground); font: 9.5px var(--font-mono); text-transform: uppercase; letter-spacing: .08em; }
.outcome-contract b { font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.outcome-contract small { color: var(--muted-foreground); font-size: 10px; }
.outcome-grid .panel-body { min-height: 74px; }
.outcome-trail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 12px; }
.operations-grid { align-items: start; }
.operations-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.routine-chain { display: grid; grid-template-columns: minmax(0,1fr) 24px minmax(0,1fr) 24px minmax(0,1fr) 24px minmax(0,1fr); align-items: center; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--plane-2); }
.routine-chain > div { min-width: 0; display: grid; gap: 4px; }
.routine-chain span { color: var(--muted-foreground); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }
.routine-chain b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.routine-chain i { display: grid; place-items: center; color: var(--ink-faint); }
.routine-chain svg { width: 14px; height: 14px; }
.work-lifecycle { display: grid; grid-template-columns: minmax(0,1fr) 22px minmax(0,1fr) 22px minmax(0,1fr) 22px minmax(0,1fr) 22px minmax(0,1fr); align-items: center; gap: 6px; }
.work-lifecycle > div { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 10px; border-radius: var(--radius-control); background: var(--plane-1); box-shadow: inset 0 0 0 1px var(--border); color: var(--muted-foreground); }
.work-lifecycle > div > span { display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 7px; background: var(--plane-3); font: 9px var(--font-mono); }
.work-lifecycle > div > b { overflow: hidden; text-overflow: ellipsis; font-size: 11px; white-space: nowrap; }
.work-lifecycle > div.done { color: var(--ink-readable); }
.work-lifecycle > div.done > span { color: var(--success); background: var(--success-soft); }
.work-lifecycle > div.current { color: var(--foreground); box-shadow: inset 0 0 0 1.5px var(--primary); }
.work-lifecycle > div.current > span { color: var(--primary); background: var(--primary-soft); }
.work-lifecycle > i { display: grid; place-items: center; color: var(--ink-faint); }
.work-lifecycle > i svg { width: 13px; height: 13px; }
.work-route-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.work-route-summary > div { display: grid; align-content: start; gap: 4px; min-width: 0; padding: 11px 12px; border-radius: var(--radius-control); background: var(--plane-1); box-shadow: inset 0 0 0 1px var(--border); }
.work-route-summary span { color: var(--muted-foreground); font: 9px var(--font-mono); text-transform: uppercase; letter-spacing: .07em; }
.work-route-summary b { font-size: 11.5px; line-height: 1.45; overflow-wrap: anywhere; }
.work-route-summary small { color: var(--muted-foreground); font-size: 10px; }
.operations-grid .row.active { background: var(--primary-soft); }

/* Your Turn keeps every human interruption in one quiet queue. */
.your-turn-view { max-width: 1180px; }
.your-turn-grid { grid-template-columns: minmax(250px, .72fr) minmax(0, 1.55fr); align-items: start; }
.your-turn-grid > .panel:first-child { position: sticky; top: 16px; }
.your-turn-grid .your-turn-detail { grid-column: auto; }
.your-turn-detail h2 { margin: 7px 0 6px; font-size: 21px; letter-spacing: -.025em; }
.your-turn-detail .panel-head .chip { margin-left: auto; }
.your-turn-detail .panel-foot { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.your-turn-detail .panel-foot .spacer { flex: 1; }
.your-turn-detail .omni-preview-card p { margin: 7px 0 0; color: var(--ink-readable); font-size: 12px; line-height: 1.55; }

/* Dev Mode can change density without changing the design system. */
html[data-density="compact"] .view { padding-top: 18px; }
html[data-density="compact"] .panel-grid { gap: 10px; }
html[data-density="compact"] .panel-head { min-height: 42px; padding-block: 8px; }
html[data-density="compact"] .row { padding-block: 7px; }
html[data-density="compact"] .panel-body.padded { padding: 10px 12px 12px; }
html[data-density="compact"] .view-head { margin-bottom: 14px; }

/* ---------- left rail ---------- */
#rail {
  grid-area: rail;
  position: relative;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  min-height: 0;
  z-index: 30;
}
.rail-tabs { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; padding: 12px 12px 8px; }
.rail-tab {
  display: grid; place-items: center; gap: 3px;
  padding: 9px 4px 7px;
  border-radius: var(--radius-control);
  color: var(--muted-foreground);
  font-size: 11px; font-weight: 700;
  box-shadow: var(--shadow-control);
  background: var(--plane-2);
  transition: background var(--dur-micro) var(--ease), color var(--dur-micro) var(--ease), box-shadow var(--dur-micro) var(--ease);
}
.rail-tab svg { width: 17px; height: 17px; }
.rail-tab:hover { color: var(--foreground); background: var(--plane-3); }
.rail-tab.active { color: var(--foreground); background: var(--plane-3); box-shadow: inset 0 0 0 1.5px var(--primary); }
.rail-search { margin: 4px 12px 8px; position: relative; }
.rail-search input {
  width: 100%; height: var(--control-h);
  background: var(--plane-2); border: 0; border-radius: var(--radius-control);
  box-shadow: var(--shadow-control);
  padding: 0 10px 0 32px; font-size: 12.5px; outline: 0;
}
.rail-search input:focus { box-shadow: inset 0 0 0 1.5px var(--primary); }
.rail-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--ink-faint); pointer-events: none; }
#rail-body { flex: 1; overflow-y: auto; padding: 2px 8px 12px; min-height: 0; }
.rail-foot {
  padding: 10px 14px; border-top: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-faint);
  display: flex; align-items: center; gap: 6px;
}
.rail-foot .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }

.rail-group {
  margin: 0 2px 8px;
  background: var(--plane-2);
  border-radius: 11px;
  padding: 5px 6px 6px;
  box-shadow: var(--shadow-control);
}
.rail-group > .section-label { padding: 5px 8px 4px; display: flex; align-items: center; }
.rail-actions { margin: 2px 2px 8px; display: grid; gap: 6px; }
.group-toggle {
  width: 100%; text-align: left; gap: 6px; cursor: pointer;
  min-height: var(--control-sm); border-radius: var(--radius-control);
  transition: color var(--dur-micro) var(--ease), background var(--dur-micro) var(--ease);
}
.group-toggle:hover { color: var(--foreground); background: var(--hover-soft); }
.group-toggle .chev { transition: transform var(--dur-short) var(--ease); }
.group-toggle .chev svg { width: 11px; height: 11px; }
.group-toggle.open .chev { transform: rotate(90deg); }
.group-toggle .gcount { margin-left: auto; font-size: 9.5px; background: var(--plane-3); border-radius: 999px; padding: 1px 7px; }
.tree-row, .rail-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left;
  min-height: var(--control-sm); padding: 6px 8px; border-radius: var(--radius-control);
  font-size: 13px;
  color: var(--ink-readable);
  transition: background var(--dur-micro) var(--ease), color var(--dur-micro) var(--ease);
  position: relative;
}
.tree-row:hover, .rail-item:hover { background: var(--hover); color: var(--foreground); }
.tree-row.active, .rail-item.active { background: var(--primary-soft); color: var(--foreground); }

.tree-row svg, .rail-item svg { width: 15px; height: 15px; color: var(--muted-foreground); flex: none; }
.tree-row.active svg, .rail-item.active svg { color: var(--primary); }
.tree-row .lbl, .rail-item .lbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 400; color: var(--ink-readable); }
.rail-item .lbl b { font-weight: 500; color: var(--ink-strong); }
.tree-row.active .lbl, .rail-item.active .lbl { color: var(--foreground); }
.tree-folder { font-weight: 600; color: var(--foreground); }
.tree-folder .lbl { font-weight: 600; color: var(--foreground); }
.tree-folder .chev { transition: transform var(--dur-short) var(--ease); color: var(--muted-foreground); }
.tree-folder.open .chev { transform: rotate(90deg); }
.tree-children { overflow: hidden; padding-left: 14px; }
.rail-item .meta { font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-faint); flex: none; }
.rail-item .mini-badge {
  flex: none; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  background: var(--primary); color: var(--primary-foreground);
  font-size: 9.5px; font-weight: 800; line-height: 16px; text-align: center; font-family: var(--font-mono);
}
.rail-item .dot-status { width: 7px; height: 7px; border-radius: 50%; flex: none; }

/* avatars */
.avv { border-radius: 50%; display: grid; place-items: center; font-weight: 800; flex: none; position: relative; }
.avv.human { background: var(--secondary); color: var(--secondary-foreground); }
.avv.agent { background: var(--plane-3); box-shadow: inset 0 0 0 1.5px var(--primary); color: var(--primary); }
.avv.s28 { width: 28px; height: 28px; font-size: 10px; }
.avv.s34 { width: 34px; height: 34px; font-size: 12px; }
.avv.s44 { width: 44px; height: 44px; font-size: 15px; }
.avv .ai-tick {
  position: absolute; right: -3px; bottom: -3px;
  font-size: 7px; font-weight: 800; font-family: var(--font-mono);
  background: var(--primary); color: var(--primary-foreground);
  border-radius: 4px; padding: 1px 3px; line-height: 1.2;
  border: 2px solid var(--sidebar);
}

/* ---------- main ---------- */
#main {
  grid-area: main;
  overflow-y: auto;
  min-width: 0;
  scroll-behavior: smooth;
}
.view { padding: 26px 30px 60px; max-width: 1120px; margin: 0 auto; }
.view-head { margin-bottom: 18px; }
.view-head h1 { margin: 0 0 4px; font-size: 26px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.view-head .sub { color: var(--muted-foreground); font-size: 13px; }
.view-head .crumbs { font-family: var(--font-mono); font-size: 10px; color: var(--ink-faint); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.view-head .crumbs a { text-decoration: none; color: var(--muted-foreground); }
.view-head .crumbs a:hover { color: var(--foreground); }
.head-row { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.head-row .spacer { flex: 1; }

/* greeting (home) */
.greeting h1 { font-size: 30px; }
.stat-strip { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 22px; }
.stat-chip {
  display: flex; align-items: center; gap: 9px;
  min-height: var(--control-sm);
  background: var(--plane-2); border-radius: var(--radius-control);
  box-shadow: var(--shadow-control);
  padding: 9px 13px;
  transition: background var(--dur-micro) var(--ease), transform var(--dur-micro) var(--ease);
  text-align: left;
}
.stat-chip:hover { background: var(--plane-3); transform: translateY(-1px); }
.stat-chip b { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.stat-chip span { font-size: 11px; color: var(--muted-foreground); line-height: 1.2; }
.stat-chip.warn b { color: var(--warning); }
.stat-chip.danger b { color: var(--danger); }
.stat-chip.accent b { color: var(--primary); }

/* panel grid */
.panel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.panel { background: var(--card); border-radius: var(--radius-card); box-shadow: var(--shadow-control); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.panel.span2 { grid-column: span 2; }
.panel-head {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 16px 9px;
}
.panel-head h3 { margin: 0; min-width: 0; font-size: 16.5px; font-weight: 600; letter-spacing: -0.022em; display: flex; align-items: center; gap: 8px; }
.panel-head h3 svg { display: none; }
.panel-head .count {
  font-family: var(--font-mono); font-size: 10px; color: var(--muted-foreground);
  background: var(--plane-3); padding: 2px 7px; border-radius: 999px;
}
.panel-head .tools { margin-left: auto; display: flex; gap: 2px; }
.panel-head .tools .icon-btn { width: var(--control-sm); height: var(--control-sm); border-radius: var(--radius-control); margin-block: -9px; }
.panel-head .tools .icon-btn svg { width: 13px; height: 13px; }
.panel-body { padding: 4px 8px 10px; }
.panel-body.padded { padding: 4px 14px 14px; }
.panel-foot { padding: 8px 14px 12px; margin-top: auto; }
.panel-foot a, .link-quiet { font-size: 12px; font-weight: 700; color: var(--primary); text-decoration: none; cursor: pointer; }
.panel-foot a:hover, .link-quiet:hover { text-decoration: underline; }

/* list rows in panels */
.row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 8px 8px; border-radius: 9px;
  transition: background var(--dur-micro) var(--ease);
}
.row:hover { background: var(--hover-soft); }
button.row { min-height: var(--control-sm); }
.row .num {
  width: 22px; height: 22px; flex: none; border-radius: 7px;
  display: grid; place-items: center;
  background: var(--plane-3); font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  color: var(--muted-foreground);
}
.row .ic { width: 22px; height: 22px; flex: none; display: grid; place-items: center; }
.row .ic svg { width: 15px; height: 15px; color: var(--ink-faint); }
.row .ic.warn svg { color: var(--warning); }
.row .ic.danger svg { color: var(--danger); }
.row .ic.ok svg { color: var(--ink-faint); }
.row .ic.accent svg { color: var(--ink-faint); }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-size: 13px; font-weight: 500; line-height: 1.3; }
.row .s { font-size: 11.5px; color: var(--muted-foreground); line-height: 1.35; margin-top: 1px; }
.row .end { flex: none; display: flex; align-items: center; gap: 6px; }

/* chips */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 450;
  font-family: var(--font-mono);
  padding: 2.5px 8px; border-radius: 999px;
  background: var(--plane-3); color: var(--muted-foreground);
  white-space: nowrap;
}
.chip.ok { background: var(--success-soft); color: var(--success); }
.chip.warn { background: var(--warning-soft); color: var(--warning); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.info { background: var(--info-soft); color: var(--info); }
.chip.accent { background: var(--primary-soft); color: var(--primary); }
.chip.muted { opacity: 0.7; }
.chip .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
button.chip { min-height: var(--control-sm); padding-inline: 12px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: var(--control-h); padding: 0 16px;
  border-radius: var(--radius-control);
  font-weight: 650; font-size: 13px; letter-spacing: -0.008em;
  transition: transform var(--dur-micro) var(--ease), background var(--dur-micro) var(--ease), opacity var(--dur-micro) var(--ease), box-shadow var(--dur-micro) var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; }
.btn.primary { background: var(--primary); color: var(--primary-foreground); }
.btn.primary:hover { opacity: 0.92; }
.btn.outline { box-shadow: inset 0 0 0 1px var(--border-strong); color: var(--foreground); }
.btn.outline:hover { background: var(--plane-3); }
.btn.ghost { color: var(--muted-foreground); }
.btn.ghost:hover { background: var(--plane-3); color: var(--foreground); }
.btn.danger { background: var(--danger-soft); color: var(--danger); box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--danger) 36%, transparent); }
.btn.sm { height: var(--control-sm); padding: 0 12px; font-size: 12px; border-radius: var(--radius-control); }
.btn.xs { height: var(--control-sm); padding: 0 12px; font-size: 11px; border-radius: var(--radius-control); }

/* cards & tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-foreground);
  padding: 8px 10px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr.clickable { cursor: pointer; transition: background var(--dur-micro) var(--ease); }
table.data tr.clickable:hover { background: var(--hover-soft); }
table.data td .t { font-weight: 700; }
table.data td .s { color: var(--muted-foreground); font-size: 11.5px; }
.num-cell { font-family: var(--font-mono); font-size: 12px; white-space: nowrap; }

/* clocks */
.clock-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.clock {
  background: var(--card); border-radius: var(--radius-card); box-shadow: var(--shadow-control);
  padding: 13px 15px;
  position: relative; overflow: hidden;
}

.clock .k { font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted-foreground); display: flex; align-items: center; gap: 6px; }
.clock .v { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; margin: 5px 0 2px; }
.clock .d { font-size: 11.5px; color: var(--muted-foreground); line-height: 1.4; }

/* timeline */
.timeline { position: relative; margin: 4px 0 0; padding-left: 20px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1.5px; background: var(--border-strong); }
.tl-item { position: relative; padding: 0 0 14px; }
.tl-item::before {
  content: ""; position: absolute; left: -20px; top: 5px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--plane-3); box-shadow: 0 0 0 3px var(--card), inset 0 0 0 2px var(--tl-color, var(--muted-foreground));
}
.tl-item .d { font-family: var(--font-mono); font-size: 10px; color: var(--ink-faint); }
.tl-item .t { font-size: 13px; margin-top: 1px; }

/* kanban */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(210px, 1fr)); gap: 12px; overflow-x: auto; align-items: start; }
.kan-col { background: var(--plane-1); border-radius: var(--radius-card); padding: 10px; box-shadow: var(--shadow-control); min-width: 0; }
.kan-col > .section-label { display: flex; align-items: center; gap: 7px; padding: 2px 4px 10px; }
.kan-col > .section-label .n { margin-left: auto; background: var(--plane-3); border-radius: 999px; padding: 1px 7px; }
.kan-card {
  background: var(--card); border-radius: 10px; box-shadow: var(--shadow-control);
  padding: 11px 12px; margin-bottom: 8px;
  cursor: pointer;
  transition: transform var(--dur-micro) var(--ease), background var(--dur-micro) var(--ease);
  text-align: left; width: 100%;
}
.kan-card:hover { transform: translateY(-1px); background: var(--accent); }
.kan-card .t { font-weight: 550; font-size: 13px; }
.kan-card .s { font-size: 11.5px; color: var(--muted-foreground); margin-top: 3px; line-height: 1.4; }
.kan-card .foot { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* doc reader */
.doc-surface {
  background: var(--card); border-radius: var(--radius-card); box-shadow: var(--shadow-control);
  padding: 30px 36px 40px; max-width: 780px;
}
.doc-surface h2 { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; margin: 26px 0 10px; }
.doc-surface h2:first-child { margin-top: 0; }
.doc-surface h3 { font-size: 15px; font-weight: 800; margin: 20px 0 8px; }
.doc-surface p { margin: 0 0 12px; font-size: 14px; line-height: 1.62; color: var(--ink-soft); }
.doc-surface ul, .doc-surface ol { margin: 0 0 12px; padding-left: 20px; }
.doc-surface li { margin-bottom: 5px; font-size: 14px; line-height: 1.55; color: var(--ink-soft); }
.doc-surface blockquote {
  margin: 14px 0; padding: 12px 16px;
  background: var(--primary-soft); border-radius: 10px;
  font-size: 14.5px; font-weight: 600;
}
.doc-surface table { width: 100%; border-collapse: collapse; margin: 0 0 14px; font-size: 13px; }
.doc-surface th { text-align: left; font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-foreground); padding: 7px 10px; border-bottom: 1px solid var(--border-strong); }
.doc-surface td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.doc-surface code { font-family: var(--font-mono); font-size: 12px; background: var(--plane-3); border-radius: 5px; padding: 1.5px 5px; }
.doc-surface .todo { display: flex; gap: 8px; align-items: baseline; }

/* chat view */
.chat-shell { display: flex; flex-direction: column; height: calc(100dvh - var(--topbar-h)); }
.chat-scroll { flex: 1; overflow-y: auto; padding: 24px 30px 10px; }
.chat-inner { max-width: 780px; margin: 0 auto; }
.chat-msg { display: flex; gap: 12px; margin-bottom: 20px; }
.chat-msg .bubble-wrap { flex: 1; min-width: 0; }
.chat-msg .who-line { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; }
.chat-msg .who-line b { font-size: 12.5px; }
.chat-msg .who-line time { font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-faint); }
.chat-msg .txt { font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; color: var(--ink-strong); }
.chat-msg.me .txt { background: var(--primary-soft); border-radius: 12px; padding: 10px 14px; display: inline-block; }
.typing { display: inline-flex; gap: 4px; padding: 8px 2px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted-foreground); animation: typing-bounce 1.1s infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
.chat-compose { padding: 12px 30px 18px; }
.chat-compose-inner {
  max-width: 780px; margin: 0 auto;
  display: flex; align-items: flex-end; gap: 8px;
  background: var(--plane-2); border-radius: var(--radius-card);
  box-shadow: var(--shadow-control);
  padding: 8px 8px 8px 14px;
}
.chat-compose-inner:focus-within { box-shadow: inset 0 0 0 1.5px var(--primary); }
.chat-compose textarea {
  flex: 1; background: transparent; border: 0; outline: 0; resize: none;
  font-size: 13.5px; line-height: 1.5; max-height: 120px; padding: 6px 0;
}

/* agent profile */
.profile-head { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.profile-head .grow { flex: 1; min-width: 200px; }
.profile-head h1 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.025em; }
.profile-head .sub { color: var(--muted-foreground); font-size: 13px; margin-top: 2px; }
.trust-ladder { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.trust-step {
  padding: 10px 12px; border-radius: var(--radius-control);
  background: var(--plane-1); box-shadow: var(--shadow-control);
  opacity: 0.45;
}
.trust-step.reached { opacity: 0.8; }
.trust-step.current { opacity: 1; background: var(--primary-soft); box-shadow: inset 0 0 0 1.5px var(--primary); }
.trust-step b { display: block; font-size: 12.5px; }
.trust-step span { font-size: 10.5px; color: var(--muted-foreground); line-height: 1.3; display: block; margin-top: 2px; }
.contract-cols { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.contract-col { background: var(--plane-1); border-radius: var(--radius-card); padding: 12px 14px; box-shadow: var(--shadow-control); }
.contract-col ul { margin: 8px 0 0; padding: 0; list-style: none; }
.contract-col li { font-size: 12.5px; padding: 5px 0; border-bottom: 1px solid var(--border); color: var(--ink-soft); display: flex; gap: 8px; }
.contract-col li:last-child { border-bottom: 0; }
.contract-col li::before { content: "·"; color: var(--muted-foreground); }
.contract-col.never li::before { content: "✕"; color: var(--danger); font-size: 10px; padding-top: 2px; }
.contract-col.never .section-label { color: var(--danger); }

/* charts */
.bars { display: grid; gap: 9px; }
.bar-line { display: grid; grid-template-columns: 118px 1fr 74px; gap: 10px; align-items: center; font-size: 12px; }
.bar-line .n { color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 20px; background: var(--plane-1); border-radius: 6px; overflow: hidden; position: relative; }
.bar-fill { height: 100%; border-radius: 6px; background: var(--primary); transform-origin: left; animation: bar-grow 0.7s var(--ease) both; }
.bar-fill.good { background: var(--success); }
.bar-fill.bad { background: var(--danger); }
.bar-fill.mid { background: var(--warning); }
.bar-line .v { font-family: var(--font-mono); font-size: 11px; text-align: right; white-space: nowrap; }

/* ad mock cards */
.ad-mocks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ad-mock {
  text-align: left;
  border-radius: var(--radius-card); overflow: hidden; box-shadow: var(--shadow-control);
  background: linear-gradient(160deg, oklch(0.26 0.04 290), oklch(0.17 0.02 270));
  aspect-ratio: 4/5;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 14px; position: relative;
  transition: transform var(--dur-micro) var(--ease);
}
.ad-mock:hover { transform: translateY(-2px); }
.ad-mock.v2 { background: linear-gradient(160deg, oklch(0.3 0.09 303), oklch(0.16 0.03 290)); }
.ad-mock.v3 { background: linear-gradient(160deg, oklch(0.25 0.05 250), oklch(0.15 0.02 265)); }
.ad-mock .tag { position: absolute; top: 10px; left: 10px; }
.ad-mock h4 { margin: 0 0 4px; font-size: 17px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.ad-mock p { margin: 0 0 10px; font-size: 11px; color: oklch(1 0 0 / 0.75); }
.ad-mock .cta { align-self: flex-start; background: var(--foreground); color: var(--background); font-size: 11px; font-weight: 800; padding: 6px 12px; border-radius: 8px; }

/* ---------- inspector ---------- */
#inspector {
  grid-area: inspector;
  position: relative;
  background: var(--sidebar);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  min-height: 0;
  z-index: 30;
}
.insp-head { display: flex; align-items: center; gap: 4px; padding: 10px 10px 0; }
.insp-tab {
  min-height: var(--control-sm); padding: 7px 12px; border-radius: var(--radius-control);
  font-size: 12px; font-weight: 800; color: var(--muted-foreground);
  transition: background var(--dur-micro) var(--ease), color var(--dur-micro) var(--ease);
}
.insp-tab:hover { color: var(--foreground); background: var(--plane-3); }
.insp-tab.active { color: var(--foreground); background: var(--plane-3); }
.insp-head .icon-btn { margin-left: auto; width: var(--control-sm); height: var(--control-sm); }
#insp-body { flex: 1; overflow-y: auto; padding: 12px 14px 20px; min-height: 0; }
.insp-section {
  background: var(--plane-2);
  border-radius: 11px;
  padding: 8px 11px 10px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-control);
}
.insp-section > .section-label { margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted-foreground); flex: none; }
.kv .v { text-align: right; font-weight: 600; min-width: 0; }
.kv .v.mono { font-family: var(--font-mono); font-size: 11px; font-weight: 400; }
.insp-card { background: var(--plane-3); border-radius: var(--radius-card); box-shadow: var(--shadow-control); padding: 12px 13px; margin-bottom: 10px; }
.insp-card .t { font-weight: 700; font-size: 12.5px; line-height: 1.35; }
.insp-card .s { font-size: 11.5px; color: var(--muted-foreground); margin-top: 3px; line-height: 1.45; }
.flag-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; font-size: 12.5px; border-bottom: 1px solid var(--border); }
button.flag-row { min-height: var(--control-sm); width: 100%; text-align: left; }
.flag-row:last-child { border-bottom: 0; }
.flag-row svg { width: 13px; height: 13px; flex: none; }
.flag-row .grow { flex: 1; }
.flag-row.danger svg { color: var(--danger); }
.flag-row.warn svg { color: var(--warning); }
.flag-row.med svg { color: var(--ink-faint); }

/* browser widget */
.browser-frame { background: var(--plane-2); border-radius: var(--radius-card); box-shadow: var(--shadow-control); overflow: hidden; }
.browser-chrome { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.browser-chrome .lights { display: flex; gap: 4px; }
.browser-chrome .lights i { width: 8px; height: 8px; border-radius: 50%; background: var(--plane-3); }
.browser-url {
  flex: 1; font-family: var(--font-mono); font-size: 10px; color: var(--muted-foreground);
  background: var(--plane-1); border-radius: 6px; padding: 4px 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.browser-shot { max-height: 420px; overflow-y: auto; }
.browser-shot img { width: 100%; display: block; }

/* ---------- modal ---------- */
#modal-root { position: fixed; inset: 0; z-index: 80; display: none; }
#modal-root.open { display: block; }
.modal-scrim { position: absolute; inset: 0; background: var(--overlay); animation: fadein var(--dur-fade) var(--ease) both; }
.modal {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(660px, calc(100vw - 32px));
  max-height: calc(100dvh - 60px);
  background: var(--popover);
  border-radius: var(--radius-sheet);
  box-shadow: var(--shadow-pop);
  animation: modal-pop var(--dur-pop) var(--ease) both;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal-head { padding: 18px 22px 0; }
.modal-head .over { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted-foreground); display: flex; align-items: center; gap: 8px; }
.modal-head h2 { margin: 6px 0 2px; font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.modal-head .sub { font-size: 12.5px; color: var(--muted-foreground); line-height: 1.5; }
.modal-body { padding: 16px 22px; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; padding: 14px 22px 18px; border-top: 1px solid var(--border); align-items: center; }
.modal-foot .spacer { flex: 1; }
.draft-box {
  background: var(--plane-1); border-radius: var(--radius-card);
  box-shadow: var(--shadow-control);
  padding: 14px 16px; font-size: 13.5px; line-height: 1.6; white-space: pre-wrap;
  max-height: 240px; overflow-y: auto;
}
.modal textarea.draft-box { width: 100%; border: 0; outline: none; resize: vertical; font-family: var(--font-ui); color: var(--foreground); min-height: 140px; }
.src-list { display: grid; gap: 6px; margin-top: 8px; }
.src-line { display: flex; align-items: center; gap: 9px; font-size: 12.5px; }
.src-line svg { width: 13px; height: 13px; flex: none; }
.unc-line { display: flex; gap: 9px; font-size: 12.5px; color: var(--ink-readable); padding: 5px 0; }
.unc-line svg { width: 13px; height: 13px; flex: none; color: var(--warning); margin-top: 2px; }

.modal-x {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: var(--control-sm); height: var(--control-sm); border-radius: 50%;
  display: grid; place-items: center;
  background: var(--plane-3); color: var(--muted-foreground);
  transition: background var(--dur-micro) var(--ease), color var(--dur-micro) var(--ease);
}
.modal-x:hover { background: var(--danger-soft); color: var(--foreground); }
.modal-x svg { width: 14px; height: 14px; }

/* ---------- human-first onboarding ---------- */
.human-start-view { min-height: calc(100dvh - var(--topbar-h)); display: grid; place-items: center; padding: 28px; }
.human-start-card { width: min(620px, 100%); display: grid; justify-items: start; gap: 12px; padding: 30px; border-radius: var(--radius-sheet); background: var(--plane-1); box-shadow: var(--shadow-card); }
.human-start-card h1 { max-width: 520px; margin: 0; font-size: clamp(26px, 3vw, 38px); line-height: 1.08; letter-spacing: -.035em; }
.human-start-card p { max-width: 540px; margin: 0 0 8px; color: var(--muted-foreground); font-size: 14px; line-height: 1.6; }
.human-start-card > small { color: var(--ink-faint); font-size: 10px; }
.human-start-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: var(--primary-soft); color: var(--primary); }
.human-start-mark svg { width: 17px; height: 17px; }
.human-onboarding-scrim { background: var(--background); }
.human-onboarding-modal { width: min(1180px, calc(100vw - 40px)); height: min(790px, calc(100dvh - 40px)); max-height: calc(100dvh - 40px); background: var(--popover); }
.human-onboarding-head { min-height: 76px; padding: 14px 56px 14px 18px; display: flex; align-items: center; gap: 18px; border-bottom: 1px solid var(--border); background: var(--plane-1); }
.human-onboarding-head > div:first-child { display: flex; align-items: center; gap: 11px; min-width: 0; }
.human-onboarding-head > div:first-child > div { display: grid; gap: 2px; }
.human-onboarding-head b { font-size: 13px; }
.human-onboarding-head small { color: var(--muted-foreground); font-size: 10px; }
.human-onboarding-progress { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.human-onboarding-progress > span { margin-right: 3px; color: var(--muted-foreground); font: 9px var(--font-mono); white-space: nowrap; }
.human-onboarding-progress i { width: 18px; height: 4px; border-radius: 999px; background: var(--plane-3); transition: width var(--dur-micro) var(--ease), background var(--dur-micro) var(--ease); }
.human-onboarding-progress i.active { width: 28px; background: var(--primary); }
.human-save-later { flex: none; white-space: nowrap; }
.human-onboarding-tabs { display: none; }
.human-onboarding-body { min-height: 0; flex: 1; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr); overflow: hidden; }
.human-onboarding-conversation { min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; border-right: 1px solid var(--border); background: var(--popover); }
.human-onboarding-thread { min-height: 0; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 11px; }
.human-onboarding-composer { padding: 14px 16px 16px; border-top: 1px solid var(--border); background: var(--plane-1); }
.human-onboarding-composer > textarea,
.human-compose-row textarea,
.human-background-fields textarea,
.human-background-fields input { width: 100%; border: 0; outline: 0; resize: vertical; border-radius: var(--radius-control); background: var(--plane-2); color: var(--foreground); box-shadow: var(--shadow-control); font: 12.5px/1.5 var(--font-ui); }
.human-onboarding-composer > textarea,
.human-compose-row textarea { min-height: 54px; max-height: 116px; padding: 10px 12px; }
.human-onboarding-composer textarea:focus,
.human-background-fields input:focus { box-shadow: inset 0 0 0 1.5px var(--primary); }
.human-compose-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.human-compose-row .btn { min-height: 40px; }
.human-prompt-examples { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }
.human-prompt-examples button,
.human-source-row button,
.human-file-button,
.human-choice-row button { min-height: 32px; padding: 6px 9px; border-radius: var(--radius-control); background: var(--plane-2); color: var(--muted-foreground); box-shadow: inset 0 0 0 1px var(--border); font-size: 10px; cursor: pointer; }
.human-prompt-examples button:active,
.human-source-row button:active,
.human-file-button:active,
.human-choice-row button:active { transform: scale(.97); }
.human-source-row .selected,
.human-file-button.selected,
.human-choice-row button.selected { color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--primary) 48%, transparent); }
.human-background-toggle { display: flex; align-items: center; gap: 7px; margin: 8px 0 0; }
.human-background-toggle span { color: var(--ink-faint); font-size: 9px; }
.human-background-fields { display: none; margin-top: 9px; padding: 10px; border-radius: var(--radius-card); background: var(--plane-2); }
.human-background-fields.open { display: grid; gap: 8px; }
.human-source-row { display: flex; flex-wrap: wrap; gap: 6px; }
.human-file-button { position: relative; display: inline-flex; align-items: center; }
.human-file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.human-background-fields label { display: grid; gap: 4px; }
.human-background-fields label > span { color: var(--muted-foreground); font-size: 9.5px; }
.human-background-fields label > small { color: var(--ink-faint); font-size: 8.5px; }
.human-background-fields input,
.human-background-fields textarea { padding: 8px 9px; }
.human-file-selected { display: flex; align-items: center; gap: 8px; padding: 9px; border-radius: 8px; background: var(--plane-1); }
.human-file-selected svg { width: 14px; height: 14px; color: var(--primary); }
.human-file-selected span { display: grid; gap: 2px; }
.human-file-selected b { font-size: 10.5px; }
.human-file-selected small { color: var(--muted-foreground); font-size: 8.5px; }
.human-compose-actions,
.human-review-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.human-review-actions { margin-top: 0; }
.human-ready { display: flex; align-items: center; gap: 14px; margin-top: 10px; padding: 11px; border-radius: var(--radius-card); background: var(--primary-soft); }
.human-ready > div { display: grid; gap: 2px; min-width: 0; }
.human-ready b { font-size: 11.5px; }
.human-ready small { color: var(--muted-foreground); font-size: 9px; line-height: 1.4; }
.human-ready .btn { margin-left: auto; flex: none; }
.human-onboarding-setup { min-width: 0; min-height: 0; background: var(--plane-1); }
.human-onboarding-setup-scroll { height: 100%; overflow-y: auto; padding: 20px; }
.human-setup-empty { min-height: 100%; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 30px; color: var(--muted-foreground); text-align: center; }
.human-setup-empty svg { width: 22px; height: 22px; }
.human-setup-empty h2 { margin: 0; color: var(--foreground); font-size: 18px; }
.human-setup-empty p { max-width: 310px; margin: 0; font-size: 11px; line-height: 1.55; }
.human-setup-title { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.human-setup-title > div { display: grid; gap: 4px; min-width: 0; }
.human-setup-title h2 { margin: 0; font-size: 19px; letter-spacing: -.025em; }
.human-setup-title > .chip { margin-left: auto; flex: none; }
.human-setup-card { display: grid; gap: 6px; margin-bottom: 9px; padding: 12px; border-radius: var(--radius-card); background: var(--plane-2); box-shadow: var(--shadow-control); }
.human-setup-card > span { color: var(--ink-faint); font: 8.5px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.human-setup-card > b { font-size: 12px; line-height: 1.45; }
.human-setup-card > b,
.human-setup-bot p { min-width: 0; overflow-wrap: anywhere; }
.human-setup-card > small { color: var(--muted-foreground); font-size: 9px; line-height: 1.4; }
.human-setup-bot > div { display: flex; align-items: center; gap: 9px; }
.human-setup-bot p { display: grid; gap: 3px; margin: 0; }
.human-setup-bot p b { font-size: 11.5px; }
.human-setup-bot p small { color: var(--muted-foreground); font-size: 9px; line-height: 1.4; }
.human-choice-row { display: flex; flex-wrap: wrap; gap: 6px; }
.human-preview-boundary { box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--success) 28%, transparent); }
.make-useful-panel { margin-bottom: var(--gap); }
.make-useful-panel .panel-body > p { margin: 0 0 11px; color: var(--muted-foreground); font-size: 11px; line-height: 1.5; }
.make-useful-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.make-useful-actions .btn svg { width: 13px; height: 13px; }

@media (hover: hover) and (pointer: fine) {
  .human-prompt-examples button:hover,
  .human-source-row button:hover,
  .human-file-button:hover,
  .human-choice-row button:hover { color: var(--foreground); background: var(--plane-3); }
}

@media (max-width: 760px) {
  .human-onboarding-modal { inset: 8px; width: auto; height: auto; max-height: none; transform: none; animation: fadein var(--dur-fade) var(--ease) both; border-radius: var(--radius-sheet); }
  .human-onboarding-head { min-height: 68px; padding-left: 14px; }
  .human-onboarding-head > div:first-child > div { display: none; }
  .human-save-later { padding-inline: 7px; font-size: 9.5px; }
  .human-onboarding-progress i { width: 12px; }
  .human-onboarding-progress i.active { width: 20px; }
  .human-onboarding-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 5px; border-bottom: 1px solid var(--border); background: var(--plane-1); }
  .human-onboarding-tabs button { min-height: 34px; border-radius: var(--radius-control); color: var(--muted-foreground); font-size: 11px; }
  .human-onboarding-tabs button.active { background: var(--plane-3); color: var(--primary); box-shadow: var(--shadow-control); }
  .human-onboarding-body { display: block; }
  .human-onboarding-conversation,
  .human-onboarding-setup { height: 100%; border-right: 0; }
  .human-onboarding-setup { display: none; }
  .human-onboarding-modal.show-setup .human-onboarding-conversation { display: none; }
  .human-onboarding-modal.show-setup .human-onboarding-setup { display: block; }
  .human-onboarding-thread { padding: 16px; }
  .human-compose-row { grid-template-columns: 1fr; }
  .human-compose-row .btn { width: 100%; }
  .human-ready { align-items: stretch; flex-direction: column; }
  .human-ready .btn { width: 100%; margin-left: 0; }
  .human-start-view { padding: 16px; }
  .human-start-card { padding: 22px; }
}

/* ---------- conversational Bot builder ---------- */
.bot-builder-modal {
  width: min(1180px, calc(100vw - 40px));
  height: min(780px, calc(100dvh - 40px));
  max-height: calc(100dvh - 40px);
}
.bot-builder-head {
  min-height: 84px; padding: 16px 56px 14px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
}
.bot-builder-head > div { min-width: 0; }
.bot-builder-head > .chip { margin-left: auto; flex: none; }
.bot-builder-head h2 { margin-top: 3px; }
.bot-builder-body {
  min-height: 0; padding: 0; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(380px, .92fr);
}
.bot-builder-tabs { display: none; }
.bot-chat-panel, .bot-config-panel { min-width: 0; min-height: 0; background: var(--popover); }
.bot-chat-panel { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; border-right: 1px solid var(--border); }
.bot-panel-head {
  display: flex; align-items: center; gap: 9px; min-height: 54px; padding: 10px 16px;
  border-bottom: 1px solid var(--border); background: var(--plane-1);
}
.bot-panel-head > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--primary-soft); color: var(--primary); }
.bot-panel-head svg { width: 15px; height: 15px; }
.bot-panel-head div { display: grid; gap: 2px; }
.bot-panel-head b { font-size: 12.5px; }
.bot-panel-head small { color: var(--muted-foreground); font-size: 10px; }
.bot-thread { min-height: 0; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.bot-message { display: flex; gap: 8px; width: fit-content; max-width: 82%; font-size: 12.5px; line-height: 1.55; }
.bot-message > div { padding: 10px 12px; border-radius: 13px; background: var(--plane-2); box-shadow: var(--shadow-control); }
.bot-message.user { margin-left: auto; color: var(--primary-foreground); }
.bot-message.user > div { background: var(--primary); border-bottom-right-radius: 5px; }
.bot-message.assistant > div { border-bottom-left-radius: 5px; }
.bot-message-mark { width: 24px; height: 24px; display: grid; place-items: center; flex: none; margin-top: 2px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); }
.bot-message-mark svg { width: 12px; height: 12px; }
.bot-message.panel { align-self: center; max-width: 94%; color: var(--muted-foreground); font: 9.5px/1.4 var(--font-mono); }
.bot-message.panel > div { padding: 6px 9px; background: var(--plane-1); box-shadow: inset 0 0 0 1px var(--border); border-radius: 999px; }
.bot-compose { display: grid; grid-template-columns: minmax(0, 1fr) 38px; gap: 8px; padding: 12px 14px 14px; border-top: 1px solid var(--border); background: var(--plane-1); }
.bot-compose textarea {
  min-height: 52px; max-height: 120px; resize: none; border: 0; outline: 0; padding: 10px 12px;
  border-radius: var(--radius-control); background: var(--plane-2); color: var(--foreground); box-shadow: var(--shadow-control); font: 12.5px/1.45 var(--font-ui);
}
.bot-compose textarea:focus { box-shadow: inset 0 0 0 1.5px var(--primary); }
.bot-compose .btn { width: 38px; height: 38px; align-self: end; padding: 0; }
.bot-config-panel { overflow: hidden; background: var(--plane-1); }
.bot-config-scroll { height: 100%; overflow-y: auto; padding: 16px; }
.bot-config-head { display: flex; align-items: center; gap: 10px; padding: 2px 2px 14px; }
.bot-config-head > div { display: grid; gap: 3px; min-width: 0; }
.bot-config-head > .avv { margin-left: auto; flex: none; }
.bot-config-head b { font-size: 15px; letter-spacing: -.01em; }
.bot-config-head small { overflow: hidden; color: var(--muted-foreground); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.bot-config-section { margin-bottom: 10px; padding: 12px; border-radius: var(--radius-card); background: var(--plane-2); box-shadow: var(--shadow-control); }
.bot-config-title { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.bot-config-title span { font-size: 11.5px; font-weight: 750; }
.bot-config-title small { margin-left: auto; color: var(--ink-faint); font: 8.5px var(--font-mono); text-transform: uppercase; }
.bot-config-section > label { display: grid; gap: 4px; margin-top: 8px; }
.bot-config-section > label > span { color: var(--muted-foreground); font-size: 9.5px; }
.bot-config-section input:not([type="checkbox"]), .bot-config-section textarea {
  width: 100%; border: 0; outline: 0; resize: vertical; padding: 8px 9px; border-radius: 8px;
  background: var(--plane-1); color: var(--foreground); box-shadow: inset 0 0 0 1px var(--border); font: 11.5px/1.4 var(--font-ui);
}
.bot-config-section input:focus, .bot-config-section textarea:focus { box-shadow: inset 0 0 0 1px var(--primary); }
.bot-starter-row, .bot-option-row { display: flex; flex-wrap: wrap; gap: 6px; }
.bot-starter-row button {
  min-height: 34px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px;
  border-radius: var(--radius-control); background: var(--plane-1); color: var(--muted-foreground); box-shadow: inset 0 0 0 1px var(--border); font-size: 10px;
}
.bot-starter-row button b { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; background: var(--plane-3); color: var(--foreground); font: 8px var(--font-mono); }
.bot-starter-row button.selected { color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.bot-option { min-height: 29px; padding: 5px 9px; border-radius: 999px; background: var(--plane-1); color: var(--muted-foreground); box-shadow: inset 0 0 0 1px var(--border); font-size: 10px; }
.bot-option.selected { background: var(--primary-soft); color: var(--primary); box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--primary) 46%, transparent); }
.bot-starter-row button:active, .bot-option:active, .bot-check-list label:active { transform: scale(.97); }
.bot-check-list { display: grid; gap: 5px; max-height: 220px; overflow-y: auto; }
.bot-check-list label { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; padding: 8px; border-radius: 8px; background: var(--plane-1); cursor: pointer; }
.bot-check-list label.selected { background: var(--primary-soft); box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--primary) 36%, transparent); }
.bot-check-list input { margin-top: 2px; accent-color: var(--primary); }
.bot-check-list span { display: grid; gap: 2px; min-width: 0; }
.bot-check-list b { font-size: 10.5px; }
.bot-check-list small { color: var(--muted-foreground); font-size: 9px; line-height: 1.35; }
.bot-check-list.compact { max-height: 160px; }
.bot-disclosure, .bot-boundary { display: flex; align-items: flex-start; gap: 8px; margin-top: 9px; padding: 9px; border-radius: 8px; background: var(--plane-1); color: var(--muted-foreground); font-size: 9.5px; line-height: 1.4; }
.bot-disclosure svg, .bot-boundary svg { width: 13px; height: 13px; flex: none; color: var(--primary); }
.bot-boundary div { display: grid; gap: 2px; }
.bot-boundary b { color: var(--foreground); font-size: 10.5px; }
.bot-boundary small { color: var(--muted-foreground); font-size: 9px; line-height: 1.4; }
.bot-config-empty { padding: 22px 16px; border: 1px dashed var(--border-strong); border-radius: var(--radius-card); color: var(--muted-foreground); font-size: 11px; line-height: 1.55; text-align: center; }
.bot-review-card { box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--success) 34%, transparent); }
.bot-review-card > div:not(.bot-config-title) { display: grid; gap: 3px; padding: 7px 0; border-top: 1px solid var(--border); }
.bot-review-card b { font-size: 10px; }
.bot-review-card span { color: var(--muted-foreground); font-size: 9px; line-height: 1.4; }
.bot-builder-foot { min-height: 64px; padding-block: 12px; }
.bot-safe-note { display: flex; align-items: center; gap: 7px; color: var(--muted-foreground); font-size: 10px; }
.bot-safe-note svg { width: 13px; height: 13px; }

@media (hover: hover) and (pointer: fine) {
  .bot-starter-row button:hover, .bot-option:hover { color: var(--foreground); background: var(--plane-3); }
  .bot-check-list label:hover { background: var(--plane-3); }
}

@media (max-width: 760px) {
  .bot-builder-modal { inset: 8px; width: auto; height: auto; max-height: none; transform: none; animation: fadein var(--dur-fade) var(--ease) both; border-radius: var(--radius-sheet); }
  .bot-builder-head { min-height: 76px; padding-left: 16px; }
  .bot-builder-head > .chip { display: none; }
  .bot-builder-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 5px; background: var(--plane-1); border-bottom: 1px solid var(--border); }
  .bot-builder-tabs button { min-height: 34px; border-radius: var(--radius-control); color: var(--muted-foreground); font-size: 11px; }
  .bot-builder-tabs button.active { background: var(--plane-3); color: var(--primary); box-shadow: var(--shadow-control); }
  .bot-builder-body { display: block; }
  .bot-chat-panel, .bot-config-panel { height: 100%; border-right: 0; }
  .bot-config-panel { display: none; }
  .bot-builder-modal.show-config .bot-chat-panel { display: none; }
  .bot-builder-modal.show-config .bot-config-panel { display: block; }
  .bot-builder-foot { padding: 10px 12px; }
  .bot-safe-note { display: none; }
  .bot-builder-foot .btn { flex: 1; }
}

/* toast */
#toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: grid; gap: 8px; }
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--popover); border-radius: var(--radius-card);
  box-shadow: var(--shadow-pop);
  padding: 12px 16px; width: 320px;
  animation: toast-in var(--dur-pop) var(--ease) both;
}
.toast svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.toast.ok svg { color: var(--success); }
.toast.info svg { color: var(--info); }
.toast .t { font-weight: 700; font-size: 13px; }
.toast .s { font-size: 11.5px; color: var(--muted-foreground); margin-top: 2px; line-height: 1.4; }
.toast .rcp { font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-faint); margin-top: 4px; }

/* popover (customize etc.) */
.popover-menu {
  position: fixed; z-index: 70;
  background: var(--popover); border-radius: var(--radius-card);
  box-shadow: var(--shadow-pop);
  padding: 8px; min-width: 230px;
  max-height: calc(100dvh - 24px); overflow-y: auto;
  animation: pop var(--dur-pop) var(--ease) both;
}
.pop-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  min-height: var(--control-sm); padding: 8px 10px; border-radius: var(--radius-control); font-size: 13px;
  transition: background var(--dur-micro) var(--ease);
}
.pop-item:hover { background: var(--hover); }
.pop-item svg { width: 15px; height: 15px; color: var(--muted-foreground); }
.pop-item .sw {
  margin-left: auto;
  width: 30px; height: 18px; border-radius: 999px; background: var(--plane-1);
  position: relative; transition: background var(--dur-short) var(--ease);
  box-shadow: var(--shadow-control); flex: none;
}
.pop-item .sw::after {
  content: ""; position: absolute; top: 2.5px; left: 3px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--muted-foreground);
  transition: transform var(--dur-short) var(--ease), background var(--dur-short) var(--ease);
}
.pop-item.on .sw { background: var(--primary); }
.pop-item.on .sw::after { transform: translateX(11px); background: var(--primary-foreground); }
.pop-sep { height: 1px; background: var(--border); margin: 6px 4px; }

.kit-option { align-items: flex-start; }
.kit-option[aria-pressed="true"] { background: var(--primary-soft); }
.kit-option-copy { min-width: 0; flex: 1; display: grid; gap: 2px; }
.kit-option-copy strong { color: var(--foreground); }
.kit-option-copy small { color: var(--muted-foreground); line-height: 1.35; }
.kit-option-current { color: var(--primary); font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; }
.kit-swatches { display: flex; gap: 3px; padding-top: 3px; flex: none; }
.kit-swatches i { width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--foreground) 16%, transparent); }
.kit-swatches[data-kit-preview="animation"] i:nth-child(1) { background: oklch(0.1733 0.0068 308.13); }
.kit-swatches[data-kit-preview="animation"] i:nth-child(2) { background: oklch(0.71998 0.17231 303.07); }
.kit-swatches[data-kit-preview="animation"] i:nth-child(3) { background: oklch(0.9392 0.01 299.34); }
.kit-swatches[data-kit-preview="os"] i:nth-child(1) { background: oklch(0.2159 0.0063 264.13); }
.kit-swatches[data-kit-preview="os"] i:nth-child(2) { background: oklch(0.623 0.214 259.815); }
.kit-swatches[data-kit-preview="os"] i:nth-child(3) { background: oklch(0.985 0.002 247.839); }
.kit-swatches[data-kit-preview="jade"] i:nth-child(1) { background: oklch(0.24 0.008 168); }
.kit-swatches[data-kit-preview="jade"] i:nth-child(2) { background: oklch(0.84 0.13 168); }
.kit-swatches[data-kit-preview="jade"] i:nth-child(3) { background: oklch(0.94 0.012 168); }

/* empty states */
.empty { padding: 30px 20px; text-align: center; color: var(--muted-foreground); font-size: 13px; }
.empty svg { width: 24px; height: 24px; color: var(--ink-faint); margin-bottom: 8px; }

/* offer ladder */
.offer-ladder { display: grid; gap: 8px; }
.offer-step { display: grid; grid-template-columns: 76px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; background: var(--plane-1); border-radius: 10px; box-shadow: var(--shadow-control); }
.offer-step .d { font-family: var(--font-mono); font-size: 10px; color: var(--muted-foreground); }
.offer-step .amt { font-weight: 800; font-size: 15px; letter-spacing: -0.02em; font-family: var(--font-mono); }
.offer-step.ours .amt { color: var(--primary); }
.offer-step .note { font-size: 11.5px; color: var(--muted-foreground); }

/* mobile / responsive */
#hamburger, #insp-toggle-m { display: none; }
@media (max-width: 1280px) {
  :root { --rail-w: 260px; --inspector-w: 300px; }
}
@media (max-width: 1120px) {
  #app { grid-template-columns: var(--rail-w) minmax(0, 1fr) 0; grid-template-areas: "topbar topbar topbar" "rail main main"; }
  #inspector {
    position: fixed; top: var(--topbar-h); right: 0; bottom: 0;
    width: min(340px, 88vw);
    transform: translateX(105%);
    transition: transform 0.36s var(--ease-drawer);
    box-shadow: var(--shadow-pop);
  }
  #app.insp-open #inspector { transform: none; display: flex; }
  #app.no-inspector #inspector { display: flex; }
  #insp-toggle-m { display: grid; }
}
@media (max-width: 920px) {
  #app { grid-template-columns: minmax(0, 1fr); grid-template-areas: "topbar" "main"; }
  #topbar { gap: 8px; padding: 0 10px 30px; }
  #topbar .kbd, #omni-send, #btn-help, #omni-context { display: none; }
  .topbar-add-bot { width: var(--control-sm); padding: 0; }
  .topbar-add-bot span { display: none; }
  #omnibar { padding: 0 12px; }
  #omni-input::placeholder { font-size: 12.5px; }
  .switcher { max-width: 132px; padding: 0 8px 0 10px; flex: none; }
  .brand-glyph { width: 30px; height: 30px; }
  .avatar-btn { width: var(--control-h); height: var(--control-h); }
  #rail {
    position: fixed; top: var(--topbar-h); left: 0; bottom: 0;
    width: min(320px, 86vw);
    transform: translateX(-105%);
    transition: transform 0.36s var(--ease-drawer);
    box-shadow: var(--shadow-pop);
  }
  #app.rail-open #rail { transform: none; }
  #hamburger { display: grid; }
  .brand-name, .brand-sub { display: none; }
  .switcher { max-width: 150px; }
  .demo-chip { display: none; }
  .view { padding: 18px 16px 60px; }
  .panel-grid { grid-template-columns: minmax(0, 1fr); }
  .panel.span2 { grid-column: span 1; }
  .clock-row { grid-template-columns: 1fr; }
  .contract-cols { grid-template-columns: 1fr; }
  .ad-mocks { grid-template-columns: 1fr 1fr; }
  .kanban { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
  .kan-col { min-width: 240px; scroll-snap-align: start; }
  .doc-surface { padding: 20px 18px 28px; }
  .chat-scroll { padding: 18px 16px 8px; }
  .chat-compose { padding: 10px 12px 14px; }
  .greeting h1 { font-size: 24px; }
  .trust-ladder { grid-template-columns: 1fr 1fr; }
  .omni-command-grid, .omni-preview-grid { grid-template-columns: minmax(0, 1fr); }
  .data-result-summary { grid-template-columns: 1fr 1fr; }
  .data-result-layout { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Pattern Engine ---------- */
.pattern-explainer { margin-bottom: 14px; }
.pattern-explainer .panel-body { padding: 14px 16px; }
.pattern-steps {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center; gap: 12px;
}
.pattern-steps > div { display: grid; grid-template-columns: 24px 1fr; align-items: center; gap: 2px 9px; min-width: 0; }
.pattern-steps > div > span { grid-row: 1 / span 2; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 8px; background: var(--plane-3); color: var(--muted-foreground); font-family: var(--font-mono); font-size: 10px; }
.pattern-steps b { font-size: 12.5px; font-weight: 600; }
.pattern-steps small { color: var(--muted-foreground); font-size: 10.5px; line-height: 1.25; }
.pattern-steps > i { display: grid; color: var(--ink-faint); }
.pattern-steps > i svg { width: 14px; height: 14px; }
.pattern-list { display: grid; gap: 14px; }
.pattern-summary, .quiet-copy { margin: 0 0 14px; color: var(--muted-foreground); font-size: 12.5px; line-height: 1.55; }
.pattern-root { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: var(--radius-control); background: var(--plane-1); box-shadow: var(--shadow-control); overflow-x: auto; }
.pattern-root > span:last-child { display: flex; gap: 6px; }
.pattern-arrow { color: var(--ink-faint); font-family: var(--font-mono); font-size: 10px; white-space: nowrap; }
.pattern-node { display: inline-flex; align-items: center; min-height: 28px; padding: 5px 9px; border-radius: var(--radius-control); background: var(--plane-3); color: var(--ink-readable); font-size: 11px; white-space: nowrap; }
.pattern-node.root { box-shadow: inset 0 0 0 1px var(--border-strong); color: var(--foreground); font-weight: 600; }
.pattern-meta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; color: var(--muted-foreground); font-size: 10.5px; }
.pattern-meta span { display: inline-flex; align-items: center; gap: 5px; }
.pattern-meta svg { width: 13px; height: 13px; color: var(--ink-faint); }
.pattern-card .panel-foot { display: flex; justify-content: flex-end; }
.pattern-detail-map { margin-bottom: 14px; }
.root-cause-map { display: grid; grid-template-columns: minmax(180px, .65fr) minmax(0, 1.35fr); gap: 16px; align-items: center; }
.root-cause-focus { display: grid; gap: 8px; min-height: 122px; place-content: center; text-align: center; border-radius: var(--radius-card); background: var(--plane-1); box-shadow: inset 0 0 0 1px var(--border-strong); }
.root-cause-focus b { font-size: 18px; letter-spacing: -0.02em; }
.root-cause-lines { display: grid; gap: 8px; }
.root-cause-lines > div { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(40px, .6fr) auto; align-items: center; gap: 8px; padding: 9px 10px; background: var(--plane-1); border-radius: var(--radius-control); font-size: 11.5px; }
.root-cause-lines i { height: 1px; background: var(--border-strong); position: relative; }
.root-cause-lines i::after { content: ""; position: absolute; right: 0; top: -3px; width: 6px; height: 6px; border-top: 1px solid var(--ink-faint); border-right: 1px solid var(--ink-faint); transform: rotate(45deg); }
.root-cause-lines b { color: var(--muted-foreground); font-family: var(--font-mono); font-size: 9.5px; font-weight: 500; }
.pattern-recommendation { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--border); color: var(--muted-foreground); font-size: 12.5px; line-height: 1.5; }
.pattern-recommendation b { color: var(--foreground); }
.evidence-row { cursor: default; }

/* ---------- Mixes capability library ---------- */
.capability-summary {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 14px; padding: 10px 14px;
  background: var(--card); border-radius: var(--radius-card); box-shadow: var(--shadow-control); color: var(--muted-foreground); font-size: 11px;
}
.capability-summary span { display: inline-flex; align-items: baseline; gap: 5px; }
.capability-summary b { color: var(--foreground); font-family: var(--font-mono); font-size: 13px; }
.capability-summary .has-update b { color: var(--warning); }
.capability-summary small { margin-left: auto; color: var(--ink-faint); font-family: var(--font-mono); font-size: 9px; }
.library-filters { display: grid; grid-template-columns: minmax(260px, 1fr) 190px 150px; gap: 8px; margin-bottom: 14px; }
.library-search { display: flex; align-items: center; gap: 8px; height: var(--control-h); padding: 0 12px; background: var(--plane-2); border-radius: var(--radius-control); box-shadow: var(--shadow-control); }
.library-search svg { width: 15px; height: 15px; color: var(--ink-faint); }
.library-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 12.5px; }
.library-filters select, .field-label select { height: var(--control-h); padding: 0 34px 0 12px; border: 0; outline: 0; background: var(--plane-2); border-radius: var(--radius-control); box-shadow: var(--shadow-control); color: var(--ink-readable); font-size: 12px; }
.capability-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.capability-card .panel-head { align-items: flex-start; }
.capability-card .panel-head h3 { padding-top: 2px; }
.skill-mark { width: 28px; height: 28px; display: grid; place-items: center; flex: none; border-radius: 8px; background: var(--plane-3); color: var(--muted-foreground); }
.skill-mark svg { width: 15px; height: 15px; }
.skill-mark.large { width: 48px; height: 48px; border-radius: 12px; }
.skill-mark.large svg { width: 23px; height: 23px; }
.skill-taxonomy { color: var(--ink-faint); font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: .05em; }
.capability-card p { min-height: 55px; margin: 8px 0 12px; color: var(--muted-foreground); font-size: 12px; line-height: 1.5; }
.skill-version { display: grid; grid-template-columns: auto 1fr; gap: 5px 10px; align-items: center; padding-top: 10px; border-top: 1px solid var(--border); font-size: 10px; color: var(--muted-foreground); }
.skill-version code { justify-self: end; color: var(--ink-readable); font-family: var(--font-mono); font-size: 9.5px; }
.assigned-avatars { display: flex; align-items: center; gap: 7px; margin-top: 12px; color: var(--muted-foreground); font-size: 10.5px; }
.assigned-avatars b { color: var(--ink-readable); font-size: 11px; font-weight: 500; margin-right: 6px; }
.capability-actions { display: flex; align-items: center; gap: 6px; }
.capability-actions .spacer { flex: 1; }
.capability-overview { margin-bottom: 14px; }
.capability-definition { display: flex; gap: 14px; align-items: flex-start; }
.capability-definition p { margin: 5px 0 10px; color: var(--ink-readable); font-size: 13.5px; line-height: 1.55; }
.tag-line { display: flex; flex-wrap: wrap; gap: 5px; }
.capability-lineage { display: grid; grid-template-columns: repeat(7, auto); justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.capability-lineage > div { display: grid; gap: 3px; }
.capability-lineage span { color: var(--muted-foreground); font-size: 9.5px; }
.capability-lineage b { font-size: 12px; font-weight: 600; }
.capability-lineage > i { display: grid; color: var(--ink-faint); }
.capability-lineage svg { width: 14px; height: 14px; }
.field-label { display: grid; gap: 6px; margin-bottom: 10px; color: var(--muted-foreground); font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: .05em; }
.btn:disabled { opacity: .45; pointer-events: none; }
.toolbelt-body { display: grid; gap: 14px; }
.toolbelt-group { display: grid; gap: 8px; }
.toolbelt-items { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.capability-chip { cursor: pointer; min-height: var(--control-sm); padding: 5px 9px; }
.capability-chip svg { width: 13px; height: 13px; }
.capability-chip code { font-size: 8.5px; opacity: .72; }
.toolbelt-note { padding-top: 10px; border-top: 1px solid var(--border); color: var(--ink-faint); font-size: 10.5px; }

@media (max-width: 920px) {
  .pattern-steps { grid-template-columns: minmax(0, 1fr); }
  .pattern-steps > i { transform: rotate(90deg); justify-self: center; }
  .root-cause-map { grid-template-columns: minmax(0, 1fr); }
  .library-filters, .capability-grid { grid-template-columns: minmax(0, 1fr); }
  .capability-summary small { width: 100%; margin-left: 0; }
  .capability-lineage { grid-template-columns: minmax(0, 1fr); }
  .capability-lineage > i { transform: rotate(90deg); justify-self: center; }
}
@media (max-width: 480px) {
  #topbar { gap: 6px; padding-inline: 8px; }
  #omni-routing-controls { width: calc(100vw - 16px); gap: 4px; }
  #omni-routing-controls label { padding-inline: 6px 4px; }
  #omni-routing-controls label > span { display: none; }
  .brand, .avatar-btn { display: none; }
  .switcher { max-width: 120px; }
  .topbar-right { gap: 4px; }
  .result-modal .modal-head { padding: 16px 16px 0; }
  .result-modal .modal-body { padding: 14px 16px; }
  .result-modal .modal-foot { padding: 12px 16px 16px; }
  .result-modal .modal-foot .spacer { display: none; }
  .result-modal .modal-foot .btn { flex: 1 1 100%; }
}
@media (max-width: 360px) {
  #btn-bell { display: none; }
  .switcher { max-width: 104px; }
}

/* rail scrim for mobile */
#scrim {
  position: fixed; inset: 0; top: var(--topbar-h); z-index: 25;
  background: var(--overlay);
  opacity: 0; pointer-events: none; transition: opacity var(--dur-fade) var(--ease);
}
#app.rail-open #scrim, #app.insp-open #scrim { opacity: 1; pointer-events: auto; }

/* ---------- inspector widgets ---------- */
.widget {
  background: var(--plane-2);
  border-radius: 11px;
  padding: 8px 11px 10px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-control);
}
.widget.closed { padding-bottom: 8px; }
.w-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.w-head .section-label svg { display: none; }
.w-tools { margin-left: auto; display: flex; gap: 2px; opacity: 0; transition: opacity var(--dur-short) var(--ease); }
.widget:hover .w-tools, .widget:focus-within .w-tools { opacity: 1; }
@media (hover: none), (pointer: coarse) {
  .w-tools { opacity: 1; }
}
.w-btn {
  width: var(--control-sm); height: var(--control-sm); display: grid; place-items: center;
  border-radius: var(--radius-control); color: var(--ink-faint);
  transition: background var(--dur-micro) var(--ease), color var(--dur-micro) var(--ease);
}
.w-btn:hover { background: var(--plane-3); color: var(--foreground); }
.w-btn svg { width: 11px; height: 11px; }
.w-body .flag-row { border-bottom: 1px solid var(--border); }
.w-body .flag-row:last-of-type { border-bottom: 0; }

/* ---------- calendar ---------- */
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 6px; }
.cal-dow span { font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cell {
  min-height: 74px; background: var(--plane-1); border-radius: 9px;
  padding: 7px 8px; text-align: left; position: relative;
  display: flex; flex-direction: column; gap: 3px; align-items: flex-start;
  transition: background var(--dur-micro) var(--ease), transform var(--dur-micro) var(--ease);
}
.cal-cell.has-ev:hover { background: var(--plane-3); transform: translateY(-1px); cursor: pointer; }
.cal-cell.dim { background: transparent; }
.cal-cell.today { box-shadow: inset 0 0 0 1.5px var(--primary); }
.cal-cell.today .cal-num { color: var(--primary); font-weight: 800; }
.cal-num { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted-foreground); }
.cal-dots { display: flex; gap: 3px; }
.cal-dots i { width: 5px; height: 5px; border-radius: 50%; display: block; }
.cal-first { font-size: 9.5px; line-height: 1.25; color: var(--ink-readable); overflow: hidden; }
@media (max-width: 920px) {
  .cal-cell { min-height: 46px; padding: 5px 6px; }
  .cal-first { display: none; }
}

/* ---------- tour mode ---------- */
#tour-layer { position: fixed; inset: 0; z-index: 64; pointer-events: none; }
.tour-dot {
  position: fixed; width: 18px; height: 18px; border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--background), 0 0 0 6px var(--primary);
  pointer-events: auto; cursor: pointer;
  transition: transform var(--dur-micro) var(--ease);
}
.tour-dot:hover { transform: scale(1.2); }
.tour-pop {
  position: fixed; z-index: 66;
  background: var(--popover); border-radius: var(--radius-card);
  box-shadow: var(--shadow-pop);
  padding: 14px 16px;
  animation: pop var(--dur-pop) var(--ease) both;
}
.tp-title { font-weight: 800; font-size: 13.5px; display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.tp-title svg { color: var(--primary); width: 14px; height: 14px; }
.tp-body { font-size: 12.5px; line-height: 1.55; color: var(--ink-readable); }
.tp-foot { margin-top: 10px; font-family: var(--font-mono); font-size: 9px; color: var(--ink-faint); }
#btn-help.tour-on { background: var(--primary); color: var(--primary-foreground); }
#btn-help.tour-on:hover { background: var(--primary); color: var(--primary-foreground); opacity: 0.9; }

#tour-bar {
  position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%);
  z-index: 94;
  display: flex; align-items: center; gap: 10px;
  background: var(--popover); border-radius: 999px;
  box-shadow: var(--shadow-pop);
  padding: 8px 10px 8px 16px;
  max-width: calc(100vw - 20px);
  animation: centerx-in var(--dur-pop) var(--ease) both;
}
.tb-label { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 12px; white-space: nowrap; }
.tb-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex: none; }
.tb-demos { display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; }
.tb-demos::-webkit-scrollbar { display: none; }
.tb-demo {
  white-space: nowrap; font-size: 11.5px; font-weight: 700;
  min-height: var(--control-sm); padding: 7px 12px; border-radius: 999px;
  background: var(--plane-3); color: var(--ink-readable);
  transition: background var(--dur-micro) var(--ease), color var(--dur-micro) var(--ease);
}
.tb-demo:hover { background: var(--primary); color: var(--primary-foreground); }
.tb-close { width: var(--control-sm); height: var(--control-sm); border-radius: 50%; display: grid; place-items: center; color: var(--muted-foreground); flex: none; }
.tb-close:hover { background: var(--plane-3); color: var(--foreground); }
.tb-close svg { width: 13px; height: 13px; }

.tour-spot {
  position: fixed; z-index: 63; pointer-events: none;
  border-radius: 14px;
  outline: 3px solid var(--primary); outline-offset: 4px;
  box-shadow: none;
  animation: fadein var(--dur-fade) var(--ease) both;
}
.tour-narration {
  position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%);
  z-index: 95;
  width: min(620px, calc(100vw - 20px));
  background: var(--popover); border-radius: var(--radius-sheet);
  box-shadow: var(--shadow-pop);
  padding: 14px 18px 12px;
  animation: centerx-in var(--dur-pop) var(--ease) both;
}
.tn-head { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 6px; }
.tn-count { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--muted-foreground); }
.tn-say { font-size: 14px; line-height: 1.55; }
.tn-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.tn-track { flex: 1; height: 3px; border-radius: 3px; background: var(--plane-1); overflow: hidden; }
.tn-fill { height: 100%; background: var(--primary); width: 0; animation-name: tn-progress; animation-timing-function: linear; animation-fill-mode: forwards; }
@keyframes tn-progress { from { width: 0; } to { width: 100%; } }
@media (max-width: 920px) {
  #tour-bar { bottom: 10px; padding: 6px 8px 6px 12px; }
  .tb-label span + *, .tb-label { font-size: 11px; }
  .tour-narration { bottom: 10px; padding: 12px 14px 10px; }
  .tn-say { font-size: 13px; }
}

/* ---------- animation studio ---------- */
.studio-rail { display: flex; align-items: center; gap: 6px; margin: 16px 0 6px; flex-wrap: wrap; }
.st-step {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 999px;
  background: var(--plane-2); box-shadow: var(--shadow-control);
  font-size: 11.5px; font-weight: 700; color: var(--muted-foreground);
}
.st-step .st-n {
  width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center;
  background: var(--plane-3); font-family: var(--font-mono); font-size: 9px;
}
.st-step.current { background: var(--primary-soft); color: var(--foreground); box-shadow: inset 0 0 0 1.5px var(--primary); }
.st-step.current .st-n { background: var(--primary); color: var(--primary-foreground); }
.st-step.done { color: var(--foreground); }
.st-step.done .st-n { background: var(--success-soft); color: var(--success); }
.st-link { width: 14px; height: 1.5px; background: var(--border-strong); flex: none; }

.dir-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.dir-card {
  position: relative; text-align: left;
  background: var(--plane-1); border-radius: var(--radius-card);
  box-shadow: var(--shadow-control);
  padding: 16px;
  display: flex; flex-direction: column; align-items: flex-start;
  transition: transform var(--dur-micro) var(--ease), background var(--dur-micro) var(--ease), box-shadow var(--dur-micro) var(--ease);
}
.dir-card:hover { transform: translateY(-2px); background: var(--plane-2); }
.dir-card.top { box-shadow: inset 0 0 0 1.5px var(--primary), var(--shadow-control); }
.dir-score { font-family: var(--font-mono); font-size: 26px; font-weight: 800; color: var(--primary); letter-spacing: -0.03em; }
.dir-name { font-weight: 650; font-size: 15px; margin-top: 2px; }
.dir-hook { font-size: 13px; color: var(--ink-soft); margin-top: 8px; line-height: 1.45; min-height: 38px; }
.dir-angle { font-size: 11px; color: var(--muted-foreground); margin-top: 8px; }

.adplayer { width: min(250px, 100%); }
.ap-screen {
  position: relative; aspect-ratio: 9/16; border-radius: 14px; overflow: hidden;
  background: linear-gradient(165deg, oklch(0.24 0.05 295), oklch(0.13 0.02 275));
  box-shadow: var(--shadow-panel);
}
.ap-beat {
  position: absolute; inset: 0; padding: 22px 18px;
  display: flex; flex-direction: column; justify-content: center; gap: 8px;
  opacity: 0; transform: translateY(10px) scale(0.985);
  transition: opacity 0.32s var(--ease), transform 0.42s var(--ease);
  pointer-events: none;
}
.ap-beat.on { opacity: 1; transform: none; }
.ap-beat .ap-label {
  font-family: var(--font-mono); font-size: 8.5px; text-transform: uppercase;
  letter-spacing: 0.12em; color: oklch(0.82 0.12 303);
}
.ap-beat .ap-text { font-size: 19px; font-weight: 800; line-height: 1.18; letter-spacing: -0.02em; }
.ap-beat .ap-sub { font-size: 11px; color: oklch(1 0 0 / 0.75); line-height: 1.4; }
.ap-beat.b2 .ap-text { font-size: 30px; color: var(--primary); }
.ap-beat.b4 { background: linear-gradient(165deg, oklch(0.3 0.08 303 / 0.55), transparent); }
.ap-beat.b5 .ap-text { font-size: 26px; }
.ap-beat.b6 { background: linear-gradient(180deg, transparent, oklch(0.3 0.09 303 / 0.5)); justify-content: flex-end; padding-bottom: 34px; }
.ap-watermark {
  position: absolute; top: 10px; right: 10px;
  font-family: var(--font-mono); font-size: 7.5px; letter-spacing: 0.1em;
  color: oklch(1 0 0 / 0.4); text-transform: uppercase;
  border: 1px solid oklch(1 0 0 / 0.16); border-radius: 4px; padding: 3px 6px;
}
.ap-controls { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.ap-play {
  width: var(--control-sm); height: var(--control-sm); border-radius: 50%; flex: none;
  background: var(--primary); color: var(--primary-foreground);
  display: grid; place-items: center;
}
.ap-play svg { width: 13px; height: 13px; }
.ap-track { flex: 1; height: 4px; border-radius: 4px; background: var(--plane-1); overflow: hidden; }
.ap-fill { height: 100%; background: var(--primary); width: 0; transition: width 60ms linear; }
.ap-time { font-family: var(--font-mono); font-size: 9.5px; color: var(--muted-foreground); width: 34px; text-align: right; }

@media (max-width: 920px) {
  .dir-cards { grid-template-columns: 1fr; }
  .studio-rail { gap: 4px; }
  .st-step { font-size: 10px; padding: 6px 10px; }
  .st-link { display: none; }
  [data-tour="st-truth"] .panel-head,
  [data-tour="st-directions"] .panel-head,
  [data-tour="st-player"] .panel-head { align-items: flex-start; flex-wrap: wrap; }
  [data-tour="st-truth"] .panel-head .tools,
  [data-tour="st-directions"] .panel-head .tools,
  [data-tour="st-player"] .panel-head .tools { width: 100%; margin-left: 0; }
}

/* ---------- sidebar resize handles ---------- */
.resizer {
  position: absolute; top: 0; bottom: 0; width: 9px;
  cursor: col-resize; z-index: 36;
  touch-action: none;
}
#rail-resizer { right: -4.5px; }
#insp-resizer { left: -4.5px; }
.resizer { transition: background var(--dur-short) var(--ease); border-radius: 4px; }
.resizer:hover, .resizer.active { background: var(--primary-soft); }
body.resizing { cursor: col-resize; user-select: none; -webkit-user-select: none; }
body.resizing #main, body.resizing #rail, body.resizing #inspector { pointer-events: none; }
@media (max-width: 1120px) { #insp-resizer { display: none; } }
@media (max-width: 920px) { #rail-resizer { display: none; } }

/* ---------- collapsible inbox widgets ---------- */
.w-head { cursor: default; }
.w-title-btn {
  display: flex; align-items: center; gap: 6px;
  flex: 1; min-width: 0; min-height: var(--control-sm); text-align: left;
}
.w-title-btn .w-chev { display: grid; transition: transform var(--dur-short) var(--ease); color: var(--ink-faint); }
.w-title-btn .w-chev svg { width: 10px; height: 10px; }
.widget.closed .w-chev { transform: rotate(-90deg); }
.widget.closed .w-body { display: none; }
.widget.closed { margin-bottom: 10px; }

/* ---------- doc editor + file chat ---------- */
.doc-split { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 14px; align-items: start; }
@media (max-width: 1140px) { .doc-split { grid-template-columns: minmax(0, 1fr); } }
.doc-editor {
  width: 100%; min-height: 62vh;
  background: var(--card); border: 0; outline: none;
  border-radius: var(--radius-card); box-shadow: var(--shadow-control);
  padding: 26px 28px;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.75;
  color: var(--ink-strong);
  resize: vertical;
  tab-size: 2;
}
.doc-editor:focus { box-shadow: inset 0 0 0 1.5px var(--primary); }
.doc-chat { position: sticky; top: 16px; display: flex; flex-direction: column; max-height: calc(100dvh - var(--topbar-h) - 56px); overflow: hidden; }
.dc-scroll { flex: 1; overflow-y: auto; padding: 2px 14px 10px; min-height: 180px; }
.dc-chips { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.dc-msg { margin-bottom: 12px; font-size: 12.5px; line-height: 1.55; }
.dc-msg.me {
  background: var(--primary-soft); border-radius: 10px;
  padding: 8px 12px; margin-left: 26px;
}
.dc-msg.ai .dc-who { font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); margin-bottom: 3px; }
.dc-msg.ai .dc-txt { color: var(--ink-strong); }
.dc-msg .ai-rows { margin-top: 8px; }
.dc-msg .ai-actions { margin-top: 8px; }
.dc-msg .ai-sources { margin-top: 8px; }
.dc-msg blockquote, .dc-msg .dc-txt br + b { margin: 6px 0; }
.dc-compose {
  display: flex; gap: 6px; align-items: center;
  padding: 10px 12px; border-top: 1px solid var(--border);
}
.dc-compose input {
  flex: 1; min-width: 0; height: var(--control-sm);
  background: var(--plane-1); border: 0; border-radius: var(--radius-control);
  box-shadow: var(--shadow-control);
  padding: 0 10px; font-size: 12px; outline: none;
}
.dc-compose input:focus { box-shadow: inset 0 0 0 1.5px var(--primary); }

/* ---------- Bot Library ---------- */
.bot-store-view { max-width: 1240px; overflow-x: clip; }
.bot-store-head { display: flex; align-items: end; gap: 18px; margin-bottom: 14px; }
.bot-store-head > div { min-width: 0; }
.bot-store-head h1 { margin: 4px 0 0; font-size: clamp(28px, 4vw, 46px); letter-spacing: -.045em; }
.bot-store-head p { max-width: 68ch; margin: 8px 0 0; color: var(--muted-foreground); font-size: 12.5px; line-height: 1.55; }
.bot-store-head > .btn { margin-left: auto; flex: none; }
.bot-store-nav { width: fit-content; display: flex; align-items: center; gap: 3px; margin-bottom: 14px; padding: 4px; border-radius: var(--radius-control); background: var(--plane-2); box-shadow: var(--shadow-control); }
.bot-store-nav button { min-height: 34px; display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: calc(var(--radius-control) - 2px); color: var(--muted-foreground); font-size: 11px; }
.bot-store-nav button span { min-width: 18px; padding: 2px 5px; border-radius: 999px; background: var(--plane-3); color: var(--ink-readable); font: 8.5px var(--font-mono); }
.bot-store-nav button.active { background: var(--plane-3); color: var(--primary); box-shadow: var(--shadow-control); }
.bot-store-nav button:active { transform: translateY(1px); }
.bot-store-feature { min-height: 220px; display: grid; grid-template-columns: 62px minmax(0, 1fr) minmax(210px, .45fr); gap: 22px; align-items: center; padding: 26px; border-radius: var(--radius-card); background: linear-gradient(135deg, var(--card), var(--plane-2)); box-shadow: var(--shadow-control); overflow: hidden; }
.bot-store-feature-mark { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 18px; background: var(--primary-soft); color: var(--primary); box-shadow: var(--shadow-control); }
.bot-store-feature-mark svg { width: 28px; height: 28px; }
.bot-store-feature > div:nth-child(2) { min-width: 0; }
.bot-store-feature span { color: var(--primary); font: 9.5px var(--font-mono); text-transform: uppercase; letter-spacing: .08em; }
.bot-store-feature h2 { max-width: 720px; margin: 7px 0 0; font-size: clamp(23px, 3vw, 36px); line-height: 1.06; letter-spacing: -.04em; }
.bot-store-feature p { max-width: 68ch; margin: 10px 0 16px; color: var(--muted-foreground); font-size: 12px; line-height: 1.55; }
.bot-store-feature-stack { display: grid; gap: 7px; align-self: stretch; align-content: center; }
.bot-store-feature-stack span { min-height: 38px; display: flex; align-items: center; padding: 8px 11px; border-radius: var(--radius-control); background: var(--plane-3); color: var(--ink-readable); box-shadow: var(--shadow-control); text-transform: none; letter-spacing: 0; }
.bot-store-feature-stack span:nth-child(2), .bot-store-feature-stack span:nth-child(4) { margin-left: 20px; color: var(--primary); }
.bot-store-browser { margin-top: 22px; }
.bot-store-toolbar { display: grid; grid-template-columns: minmax(260px, 1fr) 180px 150px; gap: 8px; margin-bottom: 18px; }
.bot-store-search { min-height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 11px; border-radius: var(--radius-control); background: var(--plane-2); box-shadow: var(--shadow-control); }
.bot-store-search svg { width: 14px; height: 14px; flex: none; color: var(--muted-foreground); }
.bot-store-search input, .bot-store-toolbar select { min-width: 0; min-height: 38px; border: 0; outline: 0; background: transparent; color: var(--foreground); font: 11px var(--font-ui); }
.bot-store-search input { width: 100%; }
.bot-store-toolbar select { padding: 0 10px; border-radius: var(--radius-control); background: var(--plane-2); box-shadow: var(--shadow-control); }
.bot-store-search:focus-within, .bot-store-toolbar select:focus { box-shadow: inset 0 0 0 1px var(--primary); }
.bot-store-section-title { display: flex; align-items: end; gap: 16px; margin-bottom: 10px; }
.bot-store-section-title h2 { margin: 0; font-size: 18px; letter-spacing: -.025em; }
.bot-store-section-title p { margin: 4px 0 0; color: var(--muted-foreground); font-size: 11px; line-height: 1.45; }
.bot-store-section-title > .chip { margin-left: auto; white-space: nowrap; }
.bot-store-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.bot-store-card { min-width: 0; min-height: 292px; display: flex; flex-direction: column; padding: 15px; border-radius: var(--radius-card); background: var(--card); box-shadow: var(--shadow-control); }
.bot-store-card-top { display: flex; align-items: start; gap: 10px; }
.bot-store-card-top > .chip { margin-left: auto; }
.bot-store-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--plane-3); color: var(--primary); box-shadow: var(--shadow-control); font-weight: 760; }
.bot-store-card-copy { min-width: 0; margin-top: 14px; }
.bot-store-card-copy h3 { margin: 0; font-size: 17px; letter-spacing: -.025em; }
.bot-store-card-copy b { display: block; margin-top: 4px; color: var(--ink-readable); font-size: 11px; line-height: 1.35; }
.bot-store-card-copy p { margin: 9px 0 0; color: var(--muted-foreground); font-size: 10.5px; line-height: 1.5; }
.bot-store-card-meta { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-top: auto; padding-top: 16px; color: var(--ink-faint); font: 8.5px var(--font-mono); }
.bot-store-card-actions { display: flex; gap: 6px; margin-top: 11px; }
.bot-store-card-actions .btn:first-child { flex: 1; }
.bot-store-empty { grid-column: 1 / -1; min-height: 180px; display: grid; place-items: center; }
@media (hover: hover) and (pointer: fine) {
  .bot-store-nav button:hover { color: var(--foreground); }
  .bot-store-card:hover { box-shadow: var(--shadow-pop); }
}
@media (max-width: 900px) {
  .bot-store-feature { grid-template-columns: 54px minmax(0, 1fr); padding: 20px; }
  .bot-store-feature-mark { width: 54px; height: 54px; }
  .bot-store-feature-stack { display: none; }
  .bot-store-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bot-store-toolbar { grid-template-columns: minmax(0, 1fr) 160px 130px; }
}
@media (max-width: 620px) {
  .bot-store-head { align-items: flex-start; }
  .bot-store-head > .btn { width: 40px; overflow: hidden; white-space: nowrap; color: transparent; }
  .bot-store-head > .btn svg { color: var(--primary-foreground); }
  .bot-store-nav { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bot-store-nav button { justify-content: center; padding-inline: 5px; }
  .bot-store-feature { grid-template-columns: 1fr; gap: 14px; padding: 18px; }
  .bot-store-feature-mark { width: 46px; height: 46px; border-radius: 14px; }
  .bot-store-toolbar { grid-template-columns: 1fr 1fr; }
  .bot-store-search { grid-column: 1 / -1; }
  .bot-store-section-title { align-items: flex-start; }
  .bot-store-grid { grid-template-columns: 1fr; }
  .bot-store-card { min-height: 260px; }
}

/* ---------- Agent Playlist interface test ---------- */
.agent-playlist { max-width: 1240px; overflow-x: clip; }
.lineup-hero {
  display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 24px; align-items: end;
  padding: 24px 24px 32px; border-radius: var(--radius-card); background: var(--card); box-shadow: var(--shadow-control);
}
.lineup-cover {
  aspect-ratio: 1; min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden; border-radius: var(--radius-card); background: var(--plane-1); box-shadow: var(--shadow-inset);
}
.lineup-cover-cell { display: grid; place-items: center; min-width: 0; background: var(--plane-2); color: var(--ink-readable); font-size: 25px; font-weight: 700; }
.lineup-cover-cell:nth-child(2), .lineup-cover-cell:nth-child(3) { background: var(--plane-3); color: var(--primary); }
.lineup-cover-empty { grid-column: 1 / -1; display: grid; place-items: center; color: var(--ink-faint); }
.lineup-cover-empty svg { width: 36px; height: 36px; }
.lineup-hero-copy { min-width: 0; }
.lineup-test { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; color: var(--muted-foreground); font: 10px var(--font-mono); }
.lineup-hero h1 { min-width: 0; margin: 0; overflow-wrap: anywhere; font-size: clamp(30px, 4vw, 52px); line-height: 1.02; letter-spacing: -.045em; }
.lineup-hero p { max-width: 65ch; margin: 10px 0 0; color: var(--ink-readable); font-size: 13px; line-height: 1.55; }
.lineup-meta { margin-top: 12px; color: var(--ink-faint); font: 10px var(--font-mono); font-variant-numeric: tabular-nums; }
.lineup-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.lineup-actions .btn { white-space: nowrap; }
.lineup-library, .lineup-tracks { margin-top: 24px; }
.lineup-section-head { display: flex; align-items: end; gap: 16px; margin-bottom: 10px; }
.lineup-section-head > div { min-width: 0; }
.lineup-section-head h2 { margin: 0; font-size: 18px; letter-spacing: -.025em; }
.lineup-section-head p { margin: 4px 0 0; color: var(--muted-foreground); font-size: 11.5px; line-height: 1.45; }
.lineup-section-head > .chip { margin-left: auto; white-space: nowrap; }
.lineup-albums { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.lineup-album {
  min-width: 0; min-height: 72px; display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 10px; align-items: center;
  padding: 10px; border-radius: var(--radius-control); background: var(--plane-2); text-align: left; box-shadow: var(--shadow-control);
  transition: background var(--dur-micro) var(--ease), transform var(--dur-micro) var(--ease);
}
.lineup-album[aria-current="page"] { background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.lineup-album:active { transform: translateY(1px); }
.lineup-album-cover { width: 50px; aspect-ratio: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; border-radius: calc(var(--radius-control) - 2px); background: var(--plane-1); }
.lineup-album-cover .lineup-cover-cell { font-size: 8px; }
.lineup-album-cover .lineup-cover-empty svg { width: 18px; height: 18px; }
.lineup-album > span:last-child { min-width: 0; display: grid; gap: 4px; }
.lineup-album b, .lineup-album small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lineup-album b { font-size: 12px; }
.lineup-album small { color: var(--muted-foreground); font: 9px var(--font-mono); }
.lineup-tracks { overflow: hidden; border-radius: var(--radius-card); background: var(--card); box-shadow: var(--shadow-control); }
.lineup-tracks .lineup-section-head { padding: 16px 16px 8px; }
.lineup-track-head, .lineup-track {
  display: grid; grid-template-columns: 32px minmax(190px, 1.05fr) minmax(125px, .6fr) minmax(210px, 1fr) auto 18px;
  gap: 12px; align-items: center;
}
.lineup-track-head { padding: 7px 14px; color: var(--ink-faint); font: 9px var(--font-mono); text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--border); }
.lineup-track-list { padding: 0 8px 8px; }
.lineup-track { width: 100%; min-height: 58px; padding: 7px 6px; border-bottom: 1px solid var(--border); border-radius: var(--radius-control); text-align: left; transition: background var(--dur-micro) var(--ease), transform var(--dur-micro) var(--ease); }
.lineup-track:last-child { border-bottom-color: transparent; }
.lineup-track:active { transform: translateY(1px); }
.lineup-track-number { color: var(--ink-faint); font: 10px var(--font-mono); text-align: center; font-variant-numeric: tabular-nums; }
.lineup-track-agent { min-width: 0; display: flex; align-items: center; gap: 10px; }
.lineup-track-agent > span:last-child { min-width: 0; display: grid; gap: 2px; }
.lineup-track-agent b, .lineup-track-agent small, .lineup-track-capabilities, .lineup-track-current { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lineup-track-agent b { font-size: 12.5px; }
.lineup-track-agent small { color: var(--muted-foreground); font-size: 10.5px; }
.lineup-track-capabilities, .lineup-track-current { color: var(--muted-foreground); font-size: 10.5px; }
.lineup-track-status { color: var(--muted-foreground); font: 9.5px var(--font-mono); white-space: nowrap; }
.lineup-track-status.working { color: var(--success); }
.lineup-track-status.attention { color: var(--warning); }
.lineup-track-open { color: var(--ink-faint); }
.lineup-track-open svg { width: 13px; height: 13px; }
@media (hover: hover) and (pointer: fine) {
  .lineup-album:hover, .lineup-track:hover { background: var(--plane-3); }
  .lineup-album[aria-current="page"]:hover { background: var(--primary-soft); }
}

/* ---------- calibrated Agent runtime ---------- */
.custom-agent { max-width: 1220px; }
.agent-flightpath {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px; margin-top: 14px;
}
.agent-flightpath span {
  min-height: 34px; display: grid; place-items: center;
  border-radius: var(--radius-control); background: var(--plane-2);
  color: var(--ink-faint); font: 10px var(--font-mono);
  box-shadow: var(--shadow-control);
}
.agent-flightpath span.current { color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); background: var(--primary-soft); }
.agent-flightpath span.done { color: var(--success); background: var(--success-soft); }
.calibration-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.calibration-choice {
  min-width: 0; min-height: 300px; padding: 14px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  text-align: left; border-radius: var(--radius-card); background: var(--plane-2);
  box-shadow: var(--shadow-control);
  transition: background var(--dur-micro) var(--ease), transform var(--dur-micro) var(--ease), box-shadow var(--dur-micro) var(--ease);
}
.calibration-choice:hover { background: var(--plane-3); transform: translateY(-1px); }
.calibration-choice.selected { background: var(--primary-soft); box-shadow: inset 0 0 0 1.5px var(--primary), var(--shadow-control); }
.calibration-choice pre {
  flex: 1; width: 100%; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere;
  color: var(--ink-readable); font: 11.5px/1.6 var(--font-mono);
}
.calibration-choice .btn { pointer-events: none; }
.scope-chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tool-action-choice-list { display: grid; gap: 7px; margin-top: 8px; }
.tool-action-choice { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--plane-1); cursor: pointer; }
.tool-action-choice input { margin-top: 2px; accent-color: var(--accent); }
.tool-action-choice span { display: grid; gap: 2px; }
.tool-action-choice b { color: var(--foreground); font-size: 12px; }
.tool-action-choice small { color: var(--muted-foreground); font-size: 11px; }
.scope-chip {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px;
  border-radius: var(--radius-control); background: var(--plane-3);
  color: var(--muted-foreground); font: 10px var(--font-mono); box-shadow: var(--shadow-control);
}
.scope-chip.on { color: var(--primary); box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--primary) 38%, transparent); }

/* ---------- teammate builder ---------- */
.teammate-builder { max-width: 1320px; }
.teammate-stepper {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px;
  margin-bottom: 12px; padding: 5px; border: 1px solid var(--border);
  border-radius: var(--radius-md); background: var(--plane-2);
}
.teammate-stepper > span {
  min-height: 36px; display: flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: calc(var(--radius-md) - 4px); color: var(--muted-foreground); font-size: 11px;
}
.teammate-stepper b {
  width: 20px; height: 20px; display: grid; place-items: center; border-radius: 7px;
  background: var(--plane-3); font: 9px var(--font-mono);
}
.teammate-stepper b svg { width: 11px; height: 11px; }
.teammate-stepper .active { color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--primary) 38%, transparent); }
.teammate-stepper .done b { color: var(--success); }
.teammate-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr) 280px; gap: 12px; align-items: start; }
.teammate-guide { padding: 16px 6px 0 0; }
.teammate-guide h2, .teammate-stage h2 { margin: 7px 0 6px; font-size: 18px; letter-spacing: -.02em; }
.teammate-guide > p { margin: 0; color: var(--muted-foreground); font-size: 11.5px; line-height: 1.55; }
.teammate-principle { display: grid; gap: 6px; margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--border); }
.teammate-principle b { font-size: 11.5px; line-height: 1.4; }
.teammate-principle span { color: var(--muted-foreground); font-size: 10.5px; line-height: 1.5; }
.teammate-stage { min-height: 540px; }
.teammate-stage .panel-body { padding: 22px; }
.teammate-stage input.draft-box, .teammate-stage textarea.draft-box {
  width: 100%; border: 0; outline: none; resize: vertical; color: var(--foreground); font-family: var(--font-ui);
}
.teammate-stage input.draft-box { min-height: var(--control-lg); padding-block: 10px; }
.teammate-stage textarea.draft-box { min-height: 76px; max-height: 160px; }
.advisor-starter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 8px; }
.advisor-starter {
  min-width: 0; min-height: 108px; display: grid; grid-template-columns: 34px minmax(0, 1fr); align-content: start; gap: 10px;
  padding: 11px; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--plane-1); color: var(--foreground); text-align: left; cursor: pointer;
}
.advisor-starter:hover { background: var(--plane-3); border-color: var(--border-strong); }
.advisor-starter.selected { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--primary) 38%, transparent); }
.advisor-starter > span:nth-child(2) { min-width: 0; display: grid; align-content: start; gap: 4px; }
.advisor-starter b { font-size: 11.5px; }
.advisor-starter small { color: var(--muted-foreground); font-size: 9.75px; line-height: 1.4; }
.advisor-starter em { grid-column: 2; color: var(--ink-faint); font: 8.5px var(--font-mono); font-style: normal; text-transform: uppercase; }
.advisor-monogram { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--plane-3); color: var(--muted-foreground); font: 9px var(--font-mono); box-shadow: var(--shadow-control); }
.advisor-monogram svg { width: 15px; height: 15px; }
.advisor-starter.selected .advisor-monogram { color: var(--primary); }
.teammate-summary { position: sticky; top: 12px; }
.teammate-summary-name { display: flex; align-items: center; gap: 10px; padding-bottom: 13px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.teammate-summary-name > div { display: grid; gap: 3px; min-width: 0; }
.teammate-summary-name b { font-size: 13px; }
.teammate-summary-name small { color: var(--muted-foreground); font-size: 10.5px; line-height: 1.35; }
.teammate-summary .kv { padding: 7px 0; }
.teammate-summary-list { display: grid; gap: 7px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.teammate-summary-list > span { color: var(--muted-foreground); font-size: 10.5px; }
.advisor-disclosure, .advisor-template-boundary { display: flex; align-items: flex-start; gap: 8px; padding: 10px; border-radius: var(--radius-control); background: var(--plane-1); color: var(--muted-foreground); font-size: 9.75px; line-height: 1.45; }
.advisor-disclosure { margin-bottom: 7px; }
.advisor-template-boundary { margin-top: 14px; }
.advisor-disclosure svg, .advisor-template-boundary svg { width: 14px; height: 14px; flex: 0 0 auto; color: var(--primary); }
.advisor-profile-boundary { max-width: 760px; display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; color: var(--muted-foreground); font-size: 10px; line-height: 1.45; }
.advisor-profile-boundary svg { width: 14px; height: 14px; flex: 0 0 auto; color: var(--primary); }
.advisor-instructions { margin-top: 9px; border-radius: var(--radius-control); background: var(--plane-1); box-shadow: var(--shadow-control); }
.advisor-instructions summary { padding: 9px 10px; color: var(--muted-foreground); font-size: 10.5px; cursor: pointer; }
.advisor-instructions pre { max-height: 280px; margin: 0; padding: 0 10px 12px; overflow: auto; white-space: pre-wrap; color: var(--muted-foreground); font: 9.5px/1.55 var(--font-mono); }
.teammate-choice-list, .teammate-tool-list { display: grid; gap: 7px; margin-top: 8px; max-height: 260px; overflow-y: auto; padding: 1px; }
.teammate-choice, .teammate-tool {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
  min-height: 62px; padding: 10px 11px; border-radius: var(--radius-control); background: var(--plane-1);
  color: var(--foreground); box-shadow: var(--shadow-control); cursor: pointer;
}
.teammate-choice:hover, .teammate-tool:hover { background: var(--plane-3); }
.teammate-choice.selected, .teammate-tool.selected { background: var(--primary-soft); box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--primary) 42%, transparent); }
.teammate-choice input, .teammate-tool input { accent-color: var(--primary); }
.teammate-choice .ic, .teammate-tool .ic { width: 28px; height: 28px; }
.teammate-choice > span:nth-last-of-type(1), .teammate-tool > span:nth-last-of-type(1) { display: grid; gap: 3px; }
.teammate-choice b, .teammate-tool b { font-size: 11.5px; }
.teammate-choice small, .teammate-tool small { color: var(--muted-foreground); font-size: 10.5px; line-height: 1.4; }
.teammate-choice em, .teammate-tool em { color: var(--ink-faint); font: 9px var(--font-mono); font-style: normal; }
.teammate-tool.fixed { grid-template-columns: auto minmax(0, 1fr) auto; cursor: default; }
.teammate-preview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.teammate-preview-grid > div { padding: 12px; border-radius: var(--radius-control); background: var(--plane-1); box-shadow: var(--shadow-control); }
.teammate-preview-grid ul { margin: 8px 0 0; padding-left: 16px; color: var(--muted-foreground); font-size: 10.5px; line-height: 1.55; }
.teammate-preview-grid .never { box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--danger) 24%, transparent); }
.teammate-actions { margin-top: 12px; }
.teammate-actions [data-action="back"] svg { transform: rotate(180deg); }
.teammate-safe-note { display: flex; align-items: center; gap: 6px; color: var(--muted-foreground); font-size: 10.5px; }
.teammate-safe-note svg { width: 13px; height: 13px; }

/* ---------- Institution control center ---------- */
.control-summary {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 14px; overflow: hidden; border: 1px solid var(--border);
  border-radius: var(--radius-card); background: var(--plane-2); box-shadow: var(--shadow-card);
}
.control-summary > div { min-height: 70px; padding: 13px 15px; display: grid; gap: 6px; background: var(--plane-1); border-right: 1px solid var(--border); }
.control-summary > div:last-child { border-right: 0; }
.control-summary span { color: var(--muted-foreground); font-size: 10.5px; }
.control-summary b { font: 21px var(--font-display); font-weight: 500; }
.control-list, .control-learning { display: grid; }
.control-browser-task { min-width: 0; border-top: 1px solid var(--border); }
.control-browser-task:first-child { border-top: 0; }
.control-browser-task .grow { min-width: 0; }
.control-browser-task .s, .control-browser-note { overflow-wrap: anywhere; word-break: break-word; }
.control-browser-note { margin: 0 14px 10px 54px; color: var(--muted-foreground); font-size: 11px; line-height: 1.5; }
.control-browser-actions { display: flex; justify-content: flex-end; gap: 6px; padding: 0 14px 12px; }
.control-browser-actions:empty { display: none; }
.control-browser-evidence { margin: 0 14px 10px 54px; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: color-mix(in oklch, var(--panel) 84%, transparent); }
.control-browser-evidence summary { cursor: pointer; color: var(--foreground); font-size: 11px; font-weight: 650; }
.control-browser-evidence .kv { margin-top: 8px; align-items: start; }
.control-browser-evidence .v { max-width: 62%; overflow-wrap: anywhere; white-space: pre-wrap; }
.control-browser-evidence .sub { margin: 8px 0 0; font-size: 10px; line-height: 1.45; }
.browser-method-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.browser-method { display: flex; gap: 9px; align-items: flex-start; min-height: 58px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: color-mix(in oklch, var(--panel) 84%, transparent); cursor: pointer; }
.browser-method:has(input:checked) { border-color: color-mix(in oklch, var(--accent) 58%, var(--border)); background: color-mix(in oklch, var(--accent) 9%, var(--panel)); }
.browser-method input { margin-top: 3px; accent-color: var(--accent); }
.browser-method span { display: grid; gap: 3px; }
.browser-method b { color: var(--foreground); font-size: 11px; }
.browser-method small { color: var(--muted-foreground); font-size: 10px; line-height: 1.35; }
.browser-method:has(input:disabled) { cursor: not-allowed; opacity: .45; }
.browser-workflow-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.5fr) minmax(110px, .7fr); gap: 10px; }
#browser-workflow-fields { display: grid; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-card); background: color-mix(in oklch, var(--panel) 82%, transparent); }
#browser-workflow-fields[hidden], #browser-session-name-field[hidden], #browser-session-reuse-field[hidden] { display: none; }
.control-empty { min-height: 150px; padding: 20px; display: grid; place-content: center; justify-items: start; gap: 8px; color: var(--muted-foreground); }
.control-empty b { color: var(--foreground); font-size: 14px; }
.control-code { max-height: 240px; margin: 8px 0 0; padding: 14px; overflow: auto; border-radius: var(--radius-control); background: var(--plane-1); box-shadow: inset 0 0 0 1px var(--border); color: var(--ink-readable); font: 10.5px/1.65 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.mission-builder-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mission-builder-grid .blank-field { align-content: start; }
.control-mission { min-height: 82px; padding: 14px 15px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; border-bottom: 1px solid var(--border); }
.control-mission:last-child { border-bottom: 0; }
.control-mission h3 { margin: 8px 0 4px; font-size: 13px; }
.control-mission p { margin: 0; color: var(--muted-foreground); font-size: 11px; line-height: 1.5; }
.control-mission-actions { display: flex; align-items: center; }

/* ---------- Operations Schedule + controlled screen ---------- */
.operations-schedule { max-width: 1240px; }
.schedule-summary {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px;
  margin-bottom: 12px; overflow: hidden; border: 1px solid var(--border);
  border-radius: var(--radius-card); background: var(--border); box-shadow: var(--shadow-card);
}
.schedule-summary > div { min-height: 72px; padding: 13px 15px; display: grid; gap: 6px; background: var(--plane-1); }
.schedule-summary span { color: var(--muted-foreground); font-size: 10.5px; }
.schedule-summary b { font: 21px var(--font-display); font-weight: 500; }
.schedule-grid { grid-template-columns: minmax(0, 1.65fr) minmax(270px, .85fr); }
.schedule-list { max-height: 610px; overflow-y: auto; }
.schedule-row { grid-template-columns: 88px 30px minmax(0, 1fr) auto; }
.schedule-date { color: var(--ink-faint); font: 9px var(--font-mono); text-align: left; }
.schedule-rule { display: grid; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.schedule-rule:last-of-type { border-bottom: 0; }
.schedule-rule b { font-size: 11.5px; }
.schedule-rule span { color: var(--muted-foreground); font-size: 10.5px; line-height: 1.5; }
.takeover-modal { width: min(1040px, calc(100vw - 32px)); }
.takeover-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: stretch; }
.takeover-layout aside { padding: 8px 4px; }
.takeover-layout aside h3 { margin: 16px 0 6px; font-size: 14px; }
.takeover-layout aside > p { margin: 0; color: var(--muted-foreground); font-size: 11px; line-height: 1.6; }
.takeover-screen {
  min-height: 420px; overflow: hidden; border: 1px solid color-mix(in oklch, var(--primary) 30%, var(--border));
  border-radius: var(--radius-card); background: var(--background); box-shadow: inset 0 0 0 7px var(--plane-2), var(--shadow-float);
}
.takeover-screen-bar { height: 42px; padding: 0 17px; display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--border); background: var(--plane-2); }
.takeover-screen-bar span { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-faint); opacity: .5; }
.takeover-screen-bar b { margin-left: 7px; color: var(--muted-foreground); font: 9px var(--font-mono); font-weight: 500; }
.takeover-screen-body { max-width: 560px; margin: 0 auto; padding: 42px 34px; display: grid; gap: 17px; }
.takeover-screen-body input.draft-box, .takeover-screen-body select.draft-box { width: 100%; min-height: 42px; }
.takeover-check { min-height: 50px; padding: 13px; display: flex; align-items: center; gap: 11px; border-radius: var(--radius-control); background: var(--plane-2); box-shadow: var(--shadow-control); cursor: pointer; }
.takeover-check input { width: 17px; height: 17px; accent-color: var(--primary); }
.takeover-check span { font-size: 11.5px; }

@media (max-width: 760px) {
  .starter-template-grid, .starter-authority, .starter-packs { grid-template-columns: 1fr; }
  .lineup-hero { grid-template-columns: 112px minmax(0, 1fr); gap: 16px; align-items: center; padding: 16px 16px 22px; }
  .lineup-hero h1 { font-size: clamp(26px, 8vw, 38px); }
  .lineup-section-head { align-items: flex-start; flex-direction: column; }
  .lineup-section-head > .chip { margin-left: 0; }
  .lineup-albums { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(142px, 62%); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
  .lineup-album { scroll-snap-align: start; }
  .lineup-track-head { display: none; }
  .lineup-track { grid-template-columns: minmax(0, 1fr) auto 18px; gap: 9px; min-height: 62px; }
  .lineup-track-number, .lineup-track-capabilities, .lineup-track-current { display: none; }
  .blank-next-grid { grid-template-columns: 1fr; }
  .brain-field-grid { grid-template-columns: 1fr; gap: 0; }
  .accountability-skill-grid { grid-template-columns: 1fr; }
  .shared-brain-actions { flex-wrap: wrap; }
  .shared-brain-actions .spacer { flex-basis: 100%; order: 2; }
  .shared-brain-actions [data-brain="export"] { order: 3; width: 100%; }
  .blank-setup-actions { align-items: stretch; flex-direction: column; }
  .blank-setup-actions .btn { margin-left: 0; width: 100%; }
  .foundry-entry { align-items: stretch; flex-direction: column; }
  .foundry-entry .btn { width: 100%; }
  .foundry-stepper { display: flex; overflow-x: auto; }
  .foundry-step { flex: 0 0 auto; padding: 0 10px; }
  .foundry-interpret-grid, .foundry-detail-grid, .foundry-review-grid, .foundry-candidate-choices, .foundry-responsibility-list { grid-template-columns: 1fr; }
  .foundry-actions { position: static; flex-wrap: wrap; }
  .foundry-actions .spacer { flex-basis: 100%; }
  .foundry-actions .btn { flex: 1 1 auto; }
  .foundry-launch-counts { grid-template-columns: repeat(2, 1fr); }
  .agent-flightpath { display: flex; overflow-x: auto; }
  .agent-flightpath span { flex: 0 0 118px; }
  .calibration-grid { grid-template-columns: 1fr; }
  .calibration-choice { min-height: 0; }
  .teammate-stepper { display: flex; overflow-x: auto; }
  .teammate-stepper > span { flex: 0 0 112px; }
  .teammate-layout { grid-template-columns: 1fr; }
  .teammate-guide { padding: 0 2px; }
  .teammate-summary { position: static; }
  .teammate-actions { flex-wrap: wrap; }
  .teammate-actions .spacer { display: none; }
  .teammate-safe-note { order: -1; width: 100%; }
  .teammate-actions .btn { flex: 1; }
  .teammate-preview-grid { grid-template-columns: 1fr; }
  .advisor-starter-grid { grid-template-columns: 1fr; }
  .advisor-starter { min-height: 0; }
  .outcome-next { align-items: stretch; flex-direction: column; }
  .outcome-next .btn { margin-left: 0; width: 100%; }
  .outcome-contract { grid-template-columns: 1fr 1fr; }
  .outcome-trail { grid-template-columns: 1fr; }
  .routine-chain { grid-template-columns: 1fr; }
  .routine-chain i { transform: rotate(90deg); }
  .work-lifecycle { display: flex; overflow-x: auto; }
  .work-lifecycle > div { flex: 0 0 126px; }
  .work-lifecycle > i { flex: 0 0 16px; }
  .work-route-summary { grid-template-columns: 1fr; }
  .your-turn-grid { grid-template-columns: 1fr; }
  .your-turn-grid > .panel:first-child { position: static; }
  .your-turn-detail .panel-foot .spacer { flex-basis: 100%; }
  .your-turn-detail .panel-foot .btn { flex: 1 1 auto; }
  .schedule-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .control-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .control-summary > div { border-bottom: 1px solid var(--border); }
  .mission-builder-grid, .control-mission { grid-template-columns: 1fr; }
  .control-mission-actions .btn { width: 100%; }
  .control-browser-note, .control-browser-evidence { margin-left: 14px; }
  .control-browser-actions { justify-content: stretch; }
  .control-browser-actions .btn { flex: 1; }
  .browser-method-grid { grid-template-columns: 1fr; }
  .browser-workflow-grid { grid-template-columns: 1fr; }
  .schedule-grid { grid-template-columns: 1fr; }
  .schedule-row { grid-template-columns: 30px minmax(0, 1fr) auto; }
  .schedule-row .schedule-date { display: none; }
  .takeover-layout { grid-template-columns: 1fr; }
  .takeover-screen { min-height: 340px; }
  .takeover-screen-body { padding: 26px 18px; }
}

@media (max-width: 480px) {
  .lineup-hero { grid-template-columns: 84px minmax(0, 1fr); gap: 12px; }
  .lineup-meta { line-height: 1.5; }
  .lineup-actions { display: grid; }
  .lineup-actions .btn { width: 100%; }
  .lineup-albums { grid-auto-columns: minmax(138px, 78%); }
  .lineup-track { grid-template-columns: minmax(0, 1fr) 18px; }
  .lineup-track-status { display: none; }
}

@media (min-width: 761px) and (max-width: 1100px) {
  .teammate-layout { grid-template-columns: minmax(0, 1fr) 250px; }
  .teammate-guide { grid-column: 1 / -1; display: grid; grid-template-columns: 150px 1fr; align-items: start; gap: 12px; padding: 0; }
  .teammate-guide .teammate-principle { margin: 0; padding: 0; border: 0; }
}
