/* Prima Agent OS — the illuminated operator shell.
   Dark only: the glow is the design. Tokens, layout, parts, then screens. */
:root {
  --bg: #07080f;
  --bg-2: #0a0c17;
  --bg-3: #0f1222;
  --panel: #121528;
  --line: rgba(140, 150, 255, 0.16);
  --line-2: rgba(140, 150, 255, 0.28);
  --text: #eef0ff;
  --soft: #c9cde6;
  --muted: #9aa0c3;
  --faint: #7a80a8;
  --cyan: #3ee6ff;
  --violet: #9b6bff;
  --violet-2: #b18cff;
  --gold: #ffd27a;
  --green: #3dffa8;
  --amber: #ffc24d;
  --red: #ff8fa3;
  --glow-cyan: 0 0 0 1px rgba(62, 230, 255, 0.3), 0 0 24px rgba(62, 230, 255, 0.1);
  --glow-violet: 0 0 0 1px rgba(155, 107, 255, 0.45), 0 0 24px rgba(155, 107, 255, 0.2);
  --glow-amber: 0 0 0 1px rgba(255, 194, 77, 0.5), 0 0 24px rgba(255, 194, 77, 0.14);
  --r: 16px;
  --r-sm: 10px;
  --side-w: 256px;
  --display: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(1100px 560px at 88% -10%, rgba(155, 107, 255, 0.14), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(62, 230, 255, 0.08), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { color: #8ff1ff; }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { flex: none; }

/* text helpers */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }
.cyan { color: var(--cyan); } .amber { color: var(--amber); } .green { color: var(--green); } .gold { color: var(--gold); } .violet { color: var(--violet-2); }
.error { color: var(--red); }
.block { display: block; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pad { padding: 16px; } .pad-top { margin-top: 24px; }
.lede { margin: -10px 0 18px; color: var(--soft); max-width: 70ch; }

/* ---- layout ------------------------------------------------------------------- */
.os { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); height: 100dvh; }
.main { overflow-y: auto; overflow-x: hidden; min-width: 0; position: relative; }
/* Installed on an iPhone the status bar is translucent and drawn over the page
   (viewport-fit=cover): keep content below the clock and battery, and paint the
   strip behind them so scrolled content never runs under them. */
.main { padding-top: env(safe-area-inset-top); }
.os.in-room .main { padding-top: 0; display: flex; flex-direction: column; overflow: hidden; }
body::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top); background: var(--bg); z-index: 30; pointer-events: none; }
.view-host { min-height: 100%; height: 100%; }
.os.in-room .view-host { flex: 1; min-height: 0; height: auto; }
.os.in-room .conn { flex: none; }
.view { padding: 28px 40px 48px; max-width: 1320px; margin: 0 auto; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.split-main, .split-side { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.three { display: grid; grid-template-columns: 360px minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.grid { display: grid; gap: 14px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---- sidebar ----------------------------------------------------------------- */
.side { display: flex; flex-direction: column; gap: 3px; padding: 18px 14px; border-right: 1px solid var(--line); background: rgba(10, 12, 23, 0.94); overflow-y: auto; min-height: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; color: var(--muted); }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--violet); color: var(--bg); font: 700 16px var(--display); box-shadow: 0 0 20px rgba(155, 107, 255, 0.45); }
.brand-text b { color: var(--text); }
.side-search { display: flex; align-items: center; gap: 8px; height: 40px; margin-bottom: 8px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--faint); font-size: 14px; }
.side-search:hover { color: var(--soft); }
.side-nav, .side-agents { display: flex; flex-direction: column; gap: 2px; }
.nav-link, .agent-link { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: var(--r-sm); color: var(--muted); font-size: 15px; transition: background-color .15s, color .15s, box-shadow .15s; }
.agent-link { font-size: 14px; color: var(--soft); }
.nav-link:hover, .agent-link:hover { background: rgba(155, 107, 255, 0.08); color: var(--text); }
.nav-link[aria-current="page"] { background: rgba(155, 107, 255, 0.16); color: var(--text); box-shadow: var(--glow-violet); }
.agent-link[aria-current="page"] { background: rgba(155, 107, 255, 0.16); color: var(--text); }
.nav-ico { width: 20px; display: flex; justify-content: center; color: var(--cyan); }
.nav-label { flex: 1; }
.nav-badge, .tab-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--amber); color: #1a1200; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.side-label { margin: 18px 10px 6px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.agent-link-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-new { color: var(--faint); }
.side-foot { margin-top: auto; padding-top: 12px; display: flex; flex-direction: column; gap: 2px; }
.side-classic { display: flex; align-items: center; gap: 4px; padding: 8px 10px; color: var(--faint); font-size: 13px; }
.side-classic:hover { color: var(--text); }
.tabbar { display: none; }
.conn { position: sticky; top: env(safe-area-inset-top); z-index: 5; padding: 8px 16px; text-align: center; background: rgba(255, 194, 77, .14); color: var(--amber); font-size: 13px; }

/* ---- shared parts ------------------------------------------------------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.eyebrow { margin: 0 0 4px; font: 600 12px/1.2 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); }
h1 { margin: 0; font: 600 32px/1.12 var(--display); letter-spacing: -0.02em; }
h2 { font-family: var(--display); }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 2px; flex-wrap: wrap; }
.block-title { margin: 0; font: 600 13px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.empty { padding: 26px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--r); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty p { margin: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--text); cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap; transition: background-color .15s, box-shadow .15s, opacity .15s; }
.btn:hover { background: rgba(155, 107, 255, 0.1); color: var(--text); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { border-color: transparent; background: var(--violet); color: #fff; box-shadow: 0 0 20px rgba(155, 107, 255, 0.35); }
.btn-primary:hover { background: #a97dff; color: #fff; }
.btn-good { border-color: transparent; background: var(--green); color: #07261a; font-weight: 700; }
.btn-good:hover { background: #7affc4; color: #07261a; }
.btn-bad { border-color: rgba(255, 92, 122, .5); color: var(--red); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn-lg { min-height: 50px; font-size: 16px; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; font-size: 20px; line-height: 1; flex: none; }
.icon-btn:hover { background: rgba(155, 107, 255, 0.1); color: var(--text); }
.icon-btn-sm { width: 34px; height: 34px; border-radius: 10px; font-size: 16px; }
.icon-btn[aria-pressed="true"] { background: rgba(155, 107, 255, 0.2); border-color: transparent; }
.link-btn { border: 0; background: none; padding: 4px 0; color: var(--cyan); cursor: pointer; font-size: 13px; }
.link-btn.danger { color: var(--red); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--soft); font-size: 13px; cursor: pointer; }
.chip[aria-pressed="true"], .chip[aria-selected="true"] { background: rgba(155, 107, 255, 0.16); border-color: rgba(155, 107, 255, 0.5); color: var(--text); }
.chip-file { min-height: 28px; font-size: 12px; color: var(--cyan); border-color: rgba(62, 230, 255, .35); }
.pill { font: 600 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.pill-on { color: var(--green); border-color: rgba(61, 255, 168, .4); }
.pill-wait { color: var(--amber); border-color: rgba(255, 194, 77, .5); }
.row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--text); }
.list-row:last-child { border-bottom: 0; }
.list-link:hover { background: rgba(155, 107, 255, 0.06); color: var(--text); }
.list-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 0 14px; margin-bottom: 14px; }
.row-ico { width: 32px; display: flex; justify-content: center; color: var(--cyan); }
.more-link { font-size: 14px; margin-top: 4px; }
.panel { padding: 18px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.panel-title { margin: 0; font: 600 12px var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.panel-link { margin-top: auto; color: var(--faint); }
.kicker { margin: 0; font: 600 12px var(--font); letter-spacing: .1em; color: var(--faint); }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; font-size: 13px; }
.kv > span:nth-child(odd) { color: var(--muted); }
.callout { padding: 12px 14px; border-radius: 12px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.callout-wait { background: rgba(255, 194, 77, .07); border: 1px solid rgba(255, 194, 77, .4); }
.doc { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.6 var(--mono); color: var(--soft); }

.avatar { flex: none; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #1b2140; color: var(--text); font-weight: 700; font-size: 13px; border: 1px solid var(--line-2); overflow: hidden; }
.avatar:has(.emblem) { background: none; border: 0; overflow: visible; }
.emblem { width: 100%; height: 100%; display: block; overflow: visible; filter: drop-shadow(0 0 6px rgba(155, 107, 255, .25)); }
.avatar-xs { width: 20px; height: 20px; font-size: 9px; } .avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 48px; height: 48px; } .avatar-xl { width: 64px; height: 64px; } .avatar-xxl { width: 104px; height: 104px; }
.avatar-add { background: transparent; border-style: dashed; color: var(--muted); }
.avatar-stack { display: flex; } .avatar-stack .avatar + .avatar { margin-left: -14px; border: 2px solid var(--panel); }

.dot { width: 8px; height: 8px; border-radius: 50%; background: #5d6388; flex: none; display: inline-block; }
.dot.on { background: var(--green); box-shadow: 0 0 10px var(--green); }
.dot.busy { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); animation: pulse 1.4s ease-in-out infinite; }
.dot.wait { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.dot.plan { background: var(--violet); }
.dot.off { background: #3a3f5c; }
@keyframes pulse { 50% { opacity: .35; } }
.bar { height: 5px; border-radius: 3px; background: var(--bg-2); overflow: hidden; position: relative; }
.bar.indeterminate span { position: absolute; inset: 0 auto 0 0; width: 35%; background: var(--cyan); border-radius: 3px; box-shadow: 0 0 10px var(--cyan); animation: slide 1.6s ease-in-out infinite; }
@keyframes slide { 0% { left: -35%; } 100% { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .dot.busy, .bar.indeterminate span, .msg-streaming::after { animation: none; } }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); font-size: 14px; }
.toast-error { border-color: rgba(255, 92, 122, .5); color: #ffd0d8; }

.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(3, 4, 10, .7); display: grid; place-items: center; padding: 16px; }
.sheet { width: min(560px, 100%); max-height: 88dvh; display: flex; flex-direction: column; border-radius: 20px; background: var(--bg-3); border: 1px solid var(--line-2); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 8px; }
.sheet-head h2 { margin: 0; font-size: 20px; }
.sheet-head .icon-btn { width: 44px; height: 44px; }
.sheet-body { padding: 8px 18px 18px; overflow-y: auto; }
.sheet-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.choice { width: 100%; display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--text); text-align: left; cursor: pointer; }
.choice:hover { box-shadow: var(--glow-violet); }
.choice-hot { border-color: rgba(155, 107, 255, .5); background: rgba(155, 107, 255, .1); }
.choice-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(62, 230, 255, .1); color: var(--cyan); flex: none; }
.choice-text { display: flex; flex-direction: column; min-width: 0; }
.choice-text span { color: var(--muted); font-size: 13px; }

/* ---- Mission Control ------------------------------------------------------------ */
.ask { padding: 8px 8px 8px 18px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 0 0 1px rgba(155, 107, 255, .22), 0 0 36px rgba(155, 107, 255, .14); display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.ask:focus-within { border-color: rgba(62, 230, 255, .5); }
.ask-row { display: flex; align-items: center; gap: 12px; }
.ask input { flex: 1; min-width: 0; height: 50px; border: 0; background: transparent; font-size: 17px; }
.ask input::placeholder, .composer textarea::placeholder, textarea::placeholder, input::placeholder { color: var(--faint); }
.ask input:focus-visible { outline: none; }
.ask-go { border-radius: 14px; min-height: 48px; padding: 0 24px; }
.ask-try { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-bottom: 8px; }
.ask-hint { margin-left: auto; }
.ask-compact .ask-row input { height: 44px; font-size: 16px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 8px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: var(--r); background: var(--panel); border: 1px solid transparent; box-shadow: var(--glow-cyan); color: var(--text); }
.stat-label { font-size: 13px; color: var(--muted); }
.stat-value { font: 700 30px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 16px; color: var(--faint); font-weight: 500; }
a.stat:hover { color: var(--text); }
.stat-hot { box-shadow: var(--glow-amber); background: rgba(255, 194, 77, .05); }
.stat-hot .stat-label, .stat-hot .stat-value { color: var(--amber); }
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); color: var(--text); transition: box-shadow .2s, border-color .2s, transform .2s; min-width: 0; }
a.tile:hover { box-shadow: var(--glow-violet); border-color: transparent; color: var(--text); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { a.tile:hover { transform: none; } }
.tile-busy { border-color: rgba(62, 230, 255, .4); }
.tile-wait { border-color: rgba(255, 194, 77, .45); }
.tile-add { align-items: center; justify-content: center; border-style: dashed; border-color: var(--line-2); color: var(--muted); background: transparent; min-height: 150px; }
.add-circle { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 22px; color: var(--text); }
.tile-status { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.st-busy { color: var(--cyan); } .st-wait { color: var(--amber); } .st-on { color: var(--green); }
.tile-last { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.work-card { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 14px; background: var(--panel); border: 1px solid rgba(62, 230, 255, .3); color: var(--text); }
.work-card:hover { box-shadow: var(--glow-cyan); color: var(--text); }
.work-top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.approval { padding: 14px 16px; border-radius: var(--r); background: rgba(255, 194, 77, .05); border: 1px solid rgba(255, 194, 77, .4); display: flex; flex-direction: column; gap: 8px; }
.approval-who { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--amber); }
.approval-title { margin: 0; font-weight: 600; font-size: 15px; }
.approval-detail { margin: 0; font-size: 13px; color: var(--soft); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 9em; overflow: auto; }

/* ---- Board -------------------------------------------------------------------- */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
.col { padding: 14px; border-radius: 18px; background: var(--bg-2); border: 1px solid var(--line); min-width: 0; }
.col-wait { background: rgba(255, 194, 77, .03); border-color: rgba(255, 194, 77, .28); }
.col-busy { background: rgba(62, 230, 255, .02); border-color: rgba(62, 230, 255, .22); }
.col-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-weight: 600; }
.col-count { margin-left: auto; font: 600 12px var(--mono); color: var(--faint); }
.col-items { display: flex; flex-direction: column; gap: 10px; }
.task { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--text); }
a.task:hover { box-shadow: var(--glow-cyan); color: var(--text); }
.task-wait { border-color: rgba(255, 194, 77, .4); }
.task-run { border-color: rgba(62, 230, 255, .35); }
.task-fail { background: rgba(255, 92, 122, .05); border-color: rgba(255, 92, 122, .35); }
.task-title { margin: 0; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.task-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.task-error { margin: 0; font-size: 12px; color: #ffb3c1; overflow-wrap: anywhere; }

/* ---- Workflows ------------------------------------------------------------------ */
.wf-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wf-top b { overflow-wrap: anywhere; }
.flow-mini { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.flow-line { font-size: 14px; color: var(--soft); gap: 10px; }
.when-chip { padding: 3px 8px; border-radius: 6px; background: rgba(62, 230, 255, .1); color: var(--cyan); }
.tpl { background: var(--bg-3); }

/* the builder */
.view-builder { display: flex; flex-direction: column; height: 100%; }
.bld-head { display: flex; align-items: center; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--line); background: rgba(7, 8, 15, .7); position: sticky; top: env(safe-area-inset-top); z-index: 3; flex-wrap: wrap; }
.bld-head .eyebrow { margin-bottom: 2px; }
.bld-name { width: 100%; border: 0; background: transparent; font: 600 22px var(--display); padding: 0; }
.bld-name:focus-visible { outline: none; box-shadow: 0 1px 0 var(--cyan); }
.bld-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 400px minmax(0, 1fr); }
.bld-chat { border-right: 1px solid var(--line); background: var(--bg-2); display: flex; flex-direction: column; min-height: 0; }
.bld-log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; min-height: 240px; }
.bld-form { margin: 14px; padding: 12px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 8px; }
.bld-form textarea { border: 0; background: transparent; resize: none; font-size: 14px; line-height: 1.5; }
.bld-form textarea:focus-visible { outline: none; }
.bld-flow { overflow-y: auto; padding: 24px 32px 48px; display: flex; flex-direction: column; align-items: center; }
.flow { width: min(600px, 100%); display: flex; flex-direction: column; align-items: stretch; }
.wire { width: 2px; height: 20px; background: var(--line-2); align-self: center; }
.node { display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line-2); }
.node-when { background: rgba(62, 230, 255, .05); border-color: rgba(62, 230, 255, .45); }
.node-gate { background: rgba(255, 194, 77, .06); border-color: rgba(255, 194, 77, .5); box-shadow: 0 0 24px rgba(255, 194, 77, .1); align-items: center; }
.node-bad { border-color: rgba(255, 92, 122, .45); }
.node-add { justify-content: center; align-items: center; border-style: dashed; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; min-height: 48px; }
.node-add:hover { color: var(--text); box-shadow: var(--glow-violet); }
.node-end { border-style: dashed; background: transparent; align-items: center; }
.node-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(62, 230, 255, .12); flex: none; }
.node-gate .node-ico { background: rgba(255, 194, 77, .14); }
.node-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.node-kicker { font: 600 11px var(--font); letter-spacing: .08em; color: var(--faint); }
.node-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.node-tools { gap: 16px; }
select, .step-agent, .when-select, .cron-input { min-height: 38px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); }
.cron-input { width: 180px; }
.step-prompt { width: 100%; min-height: 56px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); resize: vertical; font-size: 14px; line-height: 1.5; }
.step-model, .step-insert { min-height: 38px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); max-width: 100%; }
.step-insert { align-self: flex-start; color: var(--cyan); font-size: 13px; }
/* Flow view: steps collapse to a summary card; steps that run at the same time sit side by side. */
.flow-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.fchip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--bg-3); font-size: 12.5px; color: var(--soft); white-space: nowrap; }
.fchip b { color: var(--text); font-weight: 600; }
.fchip-amber, .fchip-amber b { color: var(--amber); border-color: rgba(255, 194, 77, .5); }
.node-step { flex-direction: column; align-items: stretch; gap: 0; padding: 0; min-width: 0; }
.node-step.open { box-shadow: var(--glow-violet); border-color: transparent; }
.step-head { display: flex; align-items: flex-start; gap: 14px; width: 100%; min-height: 44px; padding: 14px 16px; border: 0; border-radius: var(--r); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.step-head:focus-visible { outline: 2px solid var(--violet-2); outline-offset: 2px; }
.step-head-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.step-title { font: 600 15px/1.25 var(--display); color: var(--text); overflow-wrap: anywhere; }
.step-sum { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 5px; }
.step-caret { color: var(--faint); padding-top: 10px; flex: none; }
.mchip { font: 500 11.5px var(--mono); padding: 3px 8px; border-radius: 6px; background: rgba(140, 150, 255, .10); color: var(--soft); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mchip-openai { background: rgba(62, 230, 255, .10); color: var(--cyan); }
.mchip-anthropic { background: rgba(177, 140, 255, .14); color: var(--violet-2); }
.mchip-fireworks { background: rgba(61, 255, 168, .10); color: var(--green); }
.cost { font: 600 12px var(--mono); }
.cost-1 { color: var(--green); } .cost-2 { color: var(--amber); } .cost-3 { color: var(--red); }
.step-edit { display: flex; flex-direction: column; gap: 12px; padding: 0 16px 16px 70px; min-width: 0; }
.step-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.step-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.step-field select { width: 100%; }
.step-lbl { font: 600 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.step-contract { min-height: 44px; font-size: 13px; }
.deps { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.deps label { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; color: var(--soft); cursor: pointer; }
.deps label:has(input:checked) { border-color: rgba(155, 107, 255, .6); background: rgba(155, 107, 255, .14); color: var(--text); }
.deps input { accent-color: var(--violet); }
.flow-par { position: relative; padding: 22px 10px 10px; border: 1px dashed var(--line-2); border-radius: calc(var(--r) + 6px); }
.flow-par-label { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); padding: 0 8px; background: var(--bg); font: 600 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); white-space: nowrap; }
.flow-par-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.flow-par .step-edit { padding-left: 16px; }
.flow-par .step-pair { grid-template-columns: minmax(0, 1fr); }

/* ---- Control room --------------------------------------------------------------- */
.view-room { display: flex; flex-direction: column; height: 100%; }
.room-head { display: flex; align-items: center; gap: 14px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: rgba(7, 8, 15, .7); backdrop-filter: blur(12px); flex-wrap: wrap; flex: none; }
.room-back { display: none; border: 0; }
.room-id { min-width: 0; flex: 1 1 160px; }
.room-id h1 { font-size: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-status { display: flex; align-items: center; gap: 6px; margin: 2px 0 0; font-size: 13px; color: var(--muted); min-width: 0; }
.room-runtime { order: 4; flex: 1 0 100%; margin: 0; font-size: 12px; line-height: 1.4; color: var(--muted); overflow-wrap: anywhere; }
.task-result { display: grid; gap: 16px; }
.task-result-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.conversation-directory { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; margin-top: 20px; }
.conversation-view .lede { margin: 8px 0 0; }
.directory-search { width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--panel); font-size: 16px; line-height: 1.4; }
.directory-card { display: flex; flex-direction: column; gap: 12px; padding: 20px; min-width: 0; overflow-wrap: anywhere; }
.directory-card h2 { font-size: 18px; }
.directory-card p { margin: 0; }
.directory-agent, .directory-actions, .directory-members, .directory-tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.directory-tabs { margin: 12px 0; }
.directory-tabs [aria-current="page"] { color: var(--text); background: var(--panel); }
.directory-chat { text-decoration: none; color: inherit; }
.browser-watch { padding: 16px; min-width: 0; overflow: auto; }
.browser-watch-image { display: block; width: 100%; height: auto; border-radius: 8px; }
.browser-watch-image[hidden] { display: none; }
.browser-watch a, .browser-watch-history { overflow-wrap: anywhere; }
.browser-watch-history { padding-left: 24px; line-height: 1.5; }
.room-tabs { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--bg-3); }
.room-tab { padding: 7px 14px; border-radius: 999px; color: var(--muted); font-size: 14px; font-weight: 600; }
.room-tab[aria-current="page"] { background: var(--violet); color: #fff; }
.room-actions { display: flex; gap: 8px; }
.room-thread-title { margin: 0; padding: 8px 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-side-toggle { display: none; }
.room-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 320px; position: relative; }
.room-body-build { grid-template-columns: 400px minmax(0, 1fr); }
.room-body-build .room-chat { border-right: 1px solid var(--line); background: var(--bg-2); }
.room-body-build .dash + .room-chat { border-right: 0; border-left: 1px solid var(--line); }
.room-body-build:has(.dash) { grid-template-columns: minmax(0, 1fr) 360px; }
.room-chat { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.messages { flex: 1; overflow-y: auto; padding: 22px 26px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: min(760px, 86%); padding: 11px 15px; border-radius: 18px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.msg-me { align-self: flex-end; background: #6d5bff; color: #fff; border-bottom-right-radius: 6px; }
.msg-agent { align-self: flex-start; background: var(--panel); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg-note { align-self: center; max-width: 92%; font-size: 13px; color: var(--muted); padding: 4px 8px; text-align: center; }
.msg-streaming::after { content: "▍"; color: var(--cyan); animation: pulse 1s steps(2) infinite; }
.msg-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chat-empty { margin: auto; text-align: center; color: var(--muted); max-width: 380px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.chat-empty h2 { margin: 8px 0 0; color: var(--text); font-size: 20px; }
.chat-empty p { margin: 0; }
.typing { align-self: flex-start; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--cyan); }
.composer { display: flex; align-items: flex-end; gap: 10px; margin: 0 24px 18px; padding: 7px 7px 7px 18px; border-radius: 24px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 0 28px rgba(155, 107, 255, .14); }
.composer:focus-within { border-color: rgba(62, 230, 255, .5); box-shadow: var(--glow-cyan); }
.composer textarea { flex: 1; min-width: 0; max-height: 200px; padding: 9px 0; border: 0; background: transparent; resize: none; font-size: 16px; line-height: 1.4; }
.composer textarea:focus-visible { outline: none; }
.send { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer; background: var(--violet); color: #fff; display: grid; place-items: center; transition: opacity .15s; }
.send:disabled { opacity: .4; }
.voice-btn { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); cursor: pointer; background: transparent; color: var(--text); display: grid; place-items: center; transition: background-color .15s, color .15s, opacity .15s; }
.voice-btn:hover { border-color: var(--cyan); }
.voice-btn:disabled { opacity: .5; cursor: progress; }
.voice-btn.is-recording { background: #e5484d; border-color: #e5484d; color: #fff; }
.composer-status { margin: -8px 26px 14px; color: var(--muted); }
.composer-status.error { color: var(--red); }
.composer-error { margin: -8px 26px 14px; }
.composer-files { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 16px 10px; }
.composer-files[hidden] { display: none; }
.composer-file { display: flex; align-items: center; min-width: 0; max-width: 100%; padding-left: 12px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--panel); }
.composer-file .ellipsis { min-width: 0; font-size: 13px; }
.composer-attach { flex-shrink: 0; }
.room-side { border-left: 1px solid var(--line); padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 22px; background: var(--bg-2); }
.room-side .panel { background: transparent; border: 0; padding: 0; }
.perm-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; min-height: 26px; }
.perm { font-size: 13px; white-space: nowrap; }
.perm-allow { color: var(--green); } .perm-approve { color: var(--amber); } .perm-block { color: var(--muted); }
.thread-list, .file-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.thread-list li, .file-list li { min-width: 0; }
.thread-list button, .file-list a { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: var(--r-sm); border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-list button:hover, .file-list a:hover { background: rgba(155, 107, 255, .08); color: var(--text); }
.thread-list button[aria-current="true"] { background: rgba(155, 107, 255, .14); color: var(--text); }
.thread-actions:not(:empty) { margin-top: 8px; }
.thread-del { width: 100%; min-height: 44px; }
.thread-team-run { width: 100%; min-height: 44px; margin-bottom: 8px; justify-content: center; }

/* live build workbench */
.workbench { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.wb-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.wb-url { flex: 1; min-width: 0; height: 34px; padding: 0 12px; border-radius: 10px; background: var(--bg-3); border: 1px solid var(--line); display: flex; align-items: center; font-size: 12px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.wb-tools { display: flex; gap: 4px; }
.wb-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 200px minmax(0, 1fr); }
.wb-files { border-right: 1px solid var(--line); padding: 10px 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.wb-label { margin: 0 0 4px; padding: 4px 8px; font: 600 11px var(--mono); color: var(--faint); letter-spacing: .08em; }
.wb-file { display: flex; justify-content: space-between; gap: 6px; padding: 7px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: 12px var(--mono); text-align: left; cursor: pointer; min-width: 0; }
.wb-file:hover:not(:disabled) { background: rgba(62, 230, 255, .06); color: var(--text); }
.wb-file[aria-current="true"] { background: rgba(62, 230, 255, .1); color: var(--cyan); }
.wb-file:disabled { opacity: .45; cursor: default; }
.wb-stage { position: relative; padding: 18px; background: #05060c; display: flex; flex-direction: column; align-items: center; min-height: 0; overflow: auto; }
.wb-frame { flex: 1; width: 100%; min-height: 420px; border: 0; border-radius: 12px; background: #fff; box-shadow: 0 0 0 1px var(--line-2), 0 20px 60px rgba(0, 0, 0, .5); }
.wb-frame-phone { width: 390px; max-width: 100%; flex: none; height: min(780px, 100%); }
.wb-note { margin: 10px 0 0; color: var(--muted); }
.wb-empty { margin: auto; max-width: 440px; text-align: center; color: var(--muted); padding: 16px; }
.wb-empty h2 { color: var(--text); font-size: 20px; }
.wb-status { display: flex; align-items: center; gap: 18px; height: 34px; padding: 0 14px; border-top: 1px solid var(--line); background: var(--bg-2); font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.wb-status-right { margin-left: auto; }
.dash { display: flex; flex-direction: column; gap: 8px; padding: 14px 18px; min-height: 0; min-width: 0; }
.dash-bar { display: flex; align-items: center; gap: 8px; }
.dash-open { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; }
.dash-frame { flex: 1; width: 100%; min-height: 480px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--bg-3); }

/* ---- New agent -------------------------------------------------------------------- */
.step-label { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 600; font-size: 16px; }
.step-num { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: rgba(62, 230, 255, .12); color: var(--cyan); font: 600 13px var(--mono); }
.panel textarea, .panel > input { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); font-size: 15px; line-height: 1.5; resize: vertical; }
.avatar-choice { padding: 0; border: 2px solid transparent; border-radius: 50%; background: none; cursor: pointer; }
.avatar-choice[aria-checked="true"] { border-color: var(--cyan); box-shadow: 0 0 16px rgba(62, 230, 255, .5); }
.perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 24px; }
.perm-edit { min-height: 46px; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--bg-2); flex: none; }
.seg-btn { min-height: 32px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; color: var(--faint); font-size: 12px; cursor: pointer; }
.seg-btn:disabled { opacity: .35; cursor: not-allowed; }
.seg-allow[aria-checked="true"] { background: rgba(61, 255, 168, .18); color: var(--green); font-weight: 600; }
.seg-approve[aria-checked="true"] { background: rgba(255, 194, 77, .18); color: var(--amber); font-weight: 600; }
.seg-pick[aria-checked="true"] { background: rgba(62, 230, 255, .16); color: var(--cyan); font-weight: 600; }
.seg-btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; }
.seg-block[aria-checked="true"] { background: rgba(140, 150, 255, .18); color: var(--soft); font-weight: 600; }
.advanced summary { cursor: pointer; min-height: 32px; color: var(--muted); font-size: 13px; }
.advanced select { margin-top: 6px; width: 100%; }
.na-card { padding: 24px; border-radius: 20px; background: var(--panel); border: 1px solid rgba(62, 230, 255, .4); box-shadow: 0 0 36px rgba(62, 230, 255, .12); display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.na-card p { margin: 0; overflow-wrap: anywhere; }
.na-name { font: 600 22px var(--display); }

/* ---- Team -------------------------------------------------------------------------- */
.org { padding: 22px; border-radius: 20px; background: var(--bg-2); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; }
.org .panel-title { align-self: flex-start; }
.org-top { margin-top: 8px; }
.org-wire { width: 2px; height: 26px; background: var(--line-2); }
.org-row { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; padding-top: 16px; border-top: 2px solid var(--line-2); }
.org-card { width: 200px; padding: 14px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line-2); display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; color: var(--text); }
.org-card:hover { box-shadow: var(--glow-violet); color: var(--text); }
.org-lead { width: 240px; border-color: rgba(155, 107, 255, .5); box-shadow: 0 0 28px rgba(155, 107, 255, .2); }

/* ---- Settings, Outputs, Create ------------------------------------------------------------ */
.conn-ok { border-color: rgba(61, 255, 168, .35); }
.conn-bad { border-color: rgba(255, 194, 77, .4); }
.conn-off { border-style: dashed; border-color: var(--line-2); }
.out-thumb { aspect-ratio: 16 / 10; border-radius: 12px; display: grid; place-items: center; color: var(--faint); font-size: 12px; background: #1b2140; }
.out-page { background: #15253a; } .out-image { background: #221a3d; } .out-video { background: #1f1f33; }
.mode-card { gap: 8px; }
.mode-ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: rgba(155, 107, 255, .14); color: var(--violet-2); }

/* ---- Memory ----------------------------------------------------------------------------- */
.gx-host { height: 100%; }
.gx { display: grid; grid-template-columns: minmax(0, 1fr) 360px; height: 100dvh; background: #05060c; }
.gx-stage { position: relative; min-width: 0; overflow: hidden; }
.gx-svg { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.gx-svg:active { cursor: grabbing; }
.gx-node { cursor: pointer; }
.gx-node:focus-visible { outline: none; }
.gx-label { font: 11px var(--font); fill: var(--muted); pointer-events: none; }
.gx-label-agent { font: 600 13px var(--font); fill: var(--text); }
.gx-label-hot { fill: var(--text); font-weight: 600; font-size: 12px; }
.gx-top { position: absolute; left: 24px; right: 24px; top: 20px; display: flex; flex-direction: column; gap: 12px; pointer-events: none; }
.gx-top > * { pointer-events: auto; }
.gx-title h1 { font-size: 28px; }
.gx-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.gx-controls input { width: 280px; max-width: 100%; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(18, 21, 40, .85); font-size: 13px; }
.gx-zoom { display: flex; gap: 4px; }
.gx-learning { position: absolute; left: 24px; right: 24px; bottom: 20px; display: flex; justify-content: space-between; padding: 12px 16px; border-radius: 14px; background: rgba(12, 14, 26, .9); border: 1px solid var(--line-2); font-size: 14px; font-weight: 600; }
.gx-empty { position: absolute; left: 50%; top: 58%; transform: translate(-50%, -50%); width: min(420px, 80%); text-align: center; color: var(--muted); padding: 16px; border-radius: 14px; background: rgba(12, 14, 26, .8); }
.gx-empty p { margin: 0; }
.gx-inspector { border-left: 1px solid var(--line); background: var(--bg-2); padding: 24px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.gx-inspector h2 { margin: -6px 0 0; font-size: 22px; overflow-wrap: anywhere; }
.gx-inspector p { margin: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--soft); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.sw-skill { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); } .sw-memory { background: var(--violet-2); box-shadow: 0 0 8px var(--violet-2); } .sw-note { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.q-card { padding: 14px 16px; border-radius: 14px; background: var(--panel); border: 1px solid rgba(255, 194, 77, .4); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.q-card p { margin: 0; }
.table { border-radius: var(--r); background: var(--bg-3); border: 1px solid var(--line); overflow: hidden; }
.tr { width: 100%; display: grid; grid-template-columns: 1.3fr 1fr 0.8fr 0.8fr; gap: 12px; padding: 13px 16px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; font-size: 14px; cursor: pointer; }
.tr > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr:hover:not(.th) { background: rgba(155, 107, 255, .06); }
.th { cursor: default; font-size: 12px; color: var(--faint); padding: 10px 16px; }

/* ---- tablet --------------------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .three { grid-template-columns: minmax(0, 1fr); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .room-body { grid-template-columns: minmax(0, 1fr); }
  .room-side { display: none; position: absolute; inset: 0 0 0 auto; width: min(320px, 92vw); z-index: 4; box-shadow: -20px 0 40px rgba(0, 0, 0, .5); }
  .room-side.open { display: flex; }
  .room-side-toggle { display: inline-flex; }
  .room-body-build, .room-body-build:has(.dash) { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(220px, 38%); }
  .room-body-build .room-chat { border-right: 0; border-left: 0; border-top: 1px solid var(--line); order: 2; }
  .room-body-build .workbench, .room-body-build .dash { order: 1; }
  .gx { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .gx-inspector { border-left: 0; border-top: 1px solid var(--line); max-height: 40dvh; }
  .bld-body { grid-template-columns: minmax(0, 1fr); }
  .bld-chat { border-right: 0; border-bottom: 1px solid var(--line); }
  .bld-log { max-height: 36dvh; min-height: 120px; }
}

/* ---- phone ---------------------------------------------------------------------------------- */
@media (max-width: 760px) {
  .os { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .side { display: none; }
  .view { padding: 18px 16px 28px; }
  h1 { font-size: 25px; }
  .page-head { margin-bottom: 16px; }
  .hide-phone { display: none; }
  .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px 14px; }
  .stat-value { font-size: 24px; }
  .ask { padding: 6px 6px 6px 14px; border-radius: 16px; }
  .ask input { height: 44px; font-size: 16px; }
  .ask-go { min-height: 44px; padding: 0 16px; }
  .ask-hint { display: none; }
  .ask-try { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 6px; }
  .ask-try .chip { flex: none; }
  .agent-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .agent-tile { flex-direction: row; align-items: center; gap: 12px; padding: 12px; }
  .agent-tile .avatar-xl { width: 48px; height: 48px; }
  .agent-tile .tile-last { display: none; }
  .agent-tile b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tile-add { min-height: 64px; flex-direction: row; }
  .kanban { grid-template-columns: minmax(0, 1fr); }
  .perm-grid { grid-template-columns: minmax(0, 1fr); }
  .tr { grid-template-columns: 1.4fr 1fr; }
  .tr > :nth-child(n+3) { display: none; }
  .org-card, .org-lead { width: 100%; }
  .toasts { left: 16px; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); }

  .tabbar { display: flex; height: calc(64px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: rgba(7, 8, 15, .95); backdrop-filter: blur(14px); }
  .tab { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--faint); min-height: 44px; }
  .tab[aria-current="page"] { color: var(--text); }
  .tab[aria-current="page"] .ico { color: var(--cyan); filter: drop-shadow(0 0 6px var(--cyan)); }
  .tab-badge { position: absolute; top: 6px; left: calc(50% + 6px); }

  /* the control room owns the whole screen */
  .os.in-room { grid-template-rows: minmax(0, 1fr); }
  .os.in-room .tabbar { display: none; }
  .room-head { padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top)); gap: 8px; }
  .room-back { display: inline-grid; }
  .room-head .avatar-lg { width: 38px; height: 38px; }
  .room-id { flex: 1 1 0; }
  .room-id h1 { font-size: 17px; }
  .room-status { font-size: 12px; }
  .room-tabs { order: 5; width: 100%; }
  .room-tab { flex: 1; text-align: center; padding: 8px 6px; }
  .room-actions .btn { min-width: 44px; min-height: 44px; padding: 0 8px; }
  .messages { padding: 14px 12px; }
  .msg { max-width: 92%; }
  .composer { margin: 0 10px calc(10px + env(safe-area-inset-bottom)); }
  .wb-body { grid-template-columns: minmax(0, 1fr); }
  .wb-files { display: none; }
  .wb-stage { padding: 10px; }
  .wb-frame { min-height: 0; }
  .wb-status { display: none; }
  .bld-head { padding: 10px 12px; }
  .bld-head > .grow { flex: 1 1 calc(100% - 56px); }
  .bld-head > .btn { flex: 1 1 0; }
  .bld-log { max-height: 26dvh; }
  .bld-name { font-size: 18px; }
  .bld-head .btn { min-height: 38px; padding: 0 12px; font-size: 13px; }
  .bld-flow { padding: 16px 12px 32px; }
  .node { padding: 12px; gap: 10px; }
  .node-step { padding: 0; }
  .step-head { padding: 12px; gap: 10px; }
  .step-edit { padding: 0 12px 12px; }
  .step-pair { grid-template-columns: minmax(0, 1fr); }
  .flow-par { padding: 20px 8px 8px; }
  .flow-par-grid { grid-template-columns: minmax(0, 1fr); }
  .gx { height: calc(100dvh - 64px - env(safe-area-inset-bottom)); }
  .gx-inspector { max-height: 30dvh; padding: 16px; }
  .gx-top { left: 12px; right: 12px; top: 12px; }
  .gx-title h1 { font-size: 22px; }
  .gx-controls input { width: 100%; }
  .gx-learning { left: 12px; right: 12px; bottom: 12px; }
}

/* emblem picker */
.avatar-picker { display: flex; flex-direction: column; gap: 12px; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch-btn { width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent; background: radial-gradient(circle at 35% 30%, #fff 0, var(--c) 45%, #0b0d1a 100%); cursor: pointer; box-shadow: 0 0 12px color-mix(in srgb, var(--c) 50%, transparent); }
.swatch-btn[aria-checked="true"] { border-color: #fff; }
.icon-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; align-items: start; }
.icon-choice { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 12px; border: 1px solid transparent; background: none; color: var(--muted); font-size: 11px; cursor: pointer; }
.icon-choice:hover { background: rgba(155, 107, 255, .08); }
.icon-choice[aria-checked="true"] { border-color: rgba(62, 230, 255, .5); background: rgba(62, 230, 255, .08); color: var(--text); }

/* phone & voice */
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel-h { margin: 0; font-size: 20px; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--soft); }
.steps code, .code-row code { font: 12px var(--mono); padding: 2px 6px; border-radius: 6px; background: var(--bg-2); color: var(--cyan); overflow-wrap: anywhere; }
.bullets { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--soft); }
.code-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.big-code { font-size: 22px !important; letter-spacing: .12em; padding: 6px 12px !important; }
.token { flex: 1; min-width: 0; }
.phone-card { margin-bottom: 18px; border-color: rgba(62, 230, 255, .4); box-shadow: var(--glow-cyan); }
.row-actions input { min-height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); }
@media (max-width: 1180px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* Recommended agents */
.presets { display: grid; gap: 12px; margin-bottom: 8px; }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.preset-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line-2); min-width: 0; }
.preset-card p { margin: 0; overflow-wrap: anywhere; }
.preset-card .row-actions { margin-top: auto; }
.preset-card.is-added { border-color: rgba(61, 255, 168, .35); }
.preset-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.preset-top b { display: block; }
@media (max-width: 760px) { .preset-grid { grid-template-columns: minmax(0, 1fr); } }

/* Recommended teams (New agent) and a team's "What it's working on" board */
.team-lib { margin-top: 14px; }
.team-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.team-roster { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.team-roster li { display: flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.team-roster .avatar { flex: none; }
.team-flow { overflow-wrap: anywhere; }
.team-lib .btn, .team-board .btn { min-height: 44px; }
.team-board { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.team-routines { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.team-routines-label { display: inline-flex; align-items: center; gap: 4px; }
.team-routine { min-height: 44px; max-width: 100%; color: var(--soft); }
.team-routine span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.team-routine.is-paused { border-style: dashed; }
.team-kanban .task { min-width: 0; }
.team-step { margin: 0; color: var(--soft); overflow-wrap: anywhere; }
.team-open { color: var(--cyan); }
/* A team's journey (team-journey.js): readiness before a run, jobs, run summary. */
.dot.bad { background: var(--red); box-shadow: 0 0 10px var(--red); }
.tj-ready { margin-bottom: 14px; min-width: 0; }
.tj-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.tj-summary::-webkit-details-marker { display: none; }
.tj-summary:focus-visible { outline: 2px solid var(--violet-2); outline-offset: 4px; border-radius: 8px; }
.tj-state { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.tj-body { display: flex; flex-direction: column; gap: 14px; min-width: 0; margin-top: 8px; }
.tj-block { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tj-h3 { margin: 0; font-size: 13px; font-weight: 700; color: var(--soft); }
.tj-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--soft); overflow-wrap: anywhere; }
.tj-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tj-check { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); min-width: 0; }
.tj-check.tj-bad { border-color: rgba(255, 92, 122, .45); }
.tj-check-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.tj-check-head b { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
.tj-detail, .tj-fix { margin: 6px 0 0; color: var(--soft); overflow-wrap: anywhere; }
.tj-fix-link { display: inline-block; min-height: 24px; }
.tj-pill-bad { color: var(--red); border-color: rgba(255, 92, 122, .5); }
.tj-alert { margin: 0; padding: 10px 12px; border-radius: 12px; background: rgba(255, 92, 122, .08); border: 1px solid rgba(255, 92, 122, .35); color: var(--text); font-size: 14px; }
.tj-job { gap: 8px; }
.tj-job-title { display: flex; flex-direction: column; gap: 2px; color: var(--text); min-height: 44px; justify-content: center; overflow-wrap: anywhere; }
.tj-job-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tj-job-actions .btn, .tj-existing .btn, .tj-run .btn { min-height: 44px; }
.tj-existing { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.tj-run .pill { white-space: normal; }
.team-note { grid-column: 1 / -1; margin: 0; }
@media (max-width: 760px) {
  .team-grid { grid-template-columns: minmax(0, 1fr); }
  /* the board, not the standing brief, is what a phone opens the team for */
  .team-lede { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
}

/* ---- Design studio (#/create/design) --------------------------------------------------- */
.ds { --prima-navy: #16467C; --prima-gold: #F9BC3D; --prima-warm: #FAFAF7; }
.ds .btn, .ds .btn-sm { min-height: 44px; }
.ds .btn-sm { padding: 0 16px; }
.ds textarea, .ds select { font-size: 16px; }
.mode-card-native { border-color: rgba(62, 230, 255, .35); }
.ds-conn { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--panel); }
.ds-conn > .grow { flex: 1 1 220px; }
.ds-conn-detail { display: block; color: var(--soft); }
.ds-conn-ok { border-color: rgba(61, 255, 168, .35); }
.ds-conn-wait { border-color: rgba(62, 230, 255, .35); }
.ds-conn-bad { border-color: rgba(255, 194, 77, .5); background: rgba(255, 194, 77, .06); }
.ds-conn-off { border-style: dashed; }
.fmt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(124px, 1fr)); gap: 10px; }
.fmt-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; min-height: 44px; padding: 12px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--bg-2); cursor: pointer; transition: border-color .15s, background-color .15s, box-shadow .15s; }
.fmt-card:hover { border-color: rgba(62, 230, 255, .45); }
.fmt-card input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.fmt-card:has(input:checked) { border-color: rgba(62, 230, 255, .7); background: rgba(62, 230, 255, .08); box-shadow: var(--glow-cyan); }
.fmt-card:has(input:focus-visible) { outline: 2px solid var(--cyan); outline-offset: 2px; }
.fmt-card b { font-size: 14px; }
.fmt-shape { display: block; height: 34px; max-width: 72px; margin-bottom: 6px; border: 1.5px solid var(--soft); border-radius: 4px; background: rgba(22, 70, 124, .4); }
.fmt-card:has(input:checked) .fmt-shape { border-color: var(--cyan); background: rgba(62, 230, 255, .14); }
.ds-field select { width: 100%; min-height: 44px; padding: 0 12px; border-radius: 12px; }
.ds-ref { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.ds-ref-chip { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; padding: 4px 4px 4px 12px; border-radius: 12px; border: 1px solid rgba(62, 230, 255, .35); background: var(--bg-2); color: var(--cyan); }
.ds-ref-chip .grow { color: var(--text); }
.ds-ref-chip.is-bad { border-color: rgba(255, 92, 122, .5); }
.ds-go-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 4px 0; }
.ds-why { margin: 0; flex: 1 1 240px; }
.ds-run-head, .ds-results-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ds-run-head > .grow, .ds-results-head > .grow { flex: 1 1 200px; min-width: 0; }
.ds-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ds-step { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.ds-step-mark { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); font: 600 12px var(--mono); }
.ds-step.is-done { color: var(--soft); }
.ds-step.is-done .ds-step-mark { background: rgba(61, 255, 168, .14); border-color: rgba(61, 255, 168, .5); color: var(--green); }
.ds-step.is-active { color: var(--text); }
.ds-step.is-active .ds-step-mark { border-color: var(--cyan); color: var(--cyan); }
.ds-step.is-failed { color: #ffd0d8; }
.ds-step.is-failed .ds-step-mark { border-color: rgba(255, 92, 122, .6); color: var(--red); }
.ds-alert { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 92, 122, .07); border: 1px solid rgba(255, 92, 122, .45); font-size: 14px; overflow-wrap: anywhere; }
.ds-alert-wait { background: rgba(255, 194, 77, .07); border-color: rgba(255, 194, 77, .45); }
.ds-msg-wrap { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ds-msg { margin: 0; max-height: 16em; overflow: auto; padding: 10px 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; color: var(--soft); }
.ds-events { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.ds-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.ds-file .btn-sm { padding: 0 14px; }
.ds-file { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 12px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); }
.ds-file-meta { min-width: 0; }
.ds-thumb { aspect-ratio: 4 / 3; border-radius: 10px; display: grid; place-items: center; overflow: hidden; background: #15253a; color: var(--faint); font-size: 12px; }
.ds-thumb img { width: 100%; height: 100%; object-fit: contain; background: repeating-conic-gradient(#1b2140 0 25%, #151a33 0 50%) 0 0 / 16px 16px; }
.ds-thumb-pdf { background: #2a1a2e; } .ds-thumb-vector { background: #221a3d; } .ds-thumb-file { background: #1b2140; }
.ds-view-img { display: block; max-width: 100%; max-height: 70dvh; margin: 0 auto; border-radius: 8px; background: repeating-conic-gradient(#1b2140 0 25%, #151a33 0 50%) 0 0 / 16px 16px; }
.ds-logos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ds-logo { height: 64px; padding: 10px; border-radius: 10px; display: grid; place-items: center; }
.ds-logo img { max-width: 100%; max-height: 40px; object-fit: contain; }
.ds-logo-dark { background: var(--prima-navy); }
.ds-logo-light { background: var(--prima-warm); }
.ds-swatches { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ds-swatches li { display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 8px; align-items: center; }
.ds-swatch { grid-row: span 2; width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line-2); }
.ds-footer-text { margin: 0; padding: 10px 12px; border-left: 3px solid var(--prima-gold); border-radius: 0 10px 10px 0; background: var(--bg-2); color: var(--soft); }
.ds-recent-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.ds-recent-row { width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--soft); text-align: left; font-size: 14px; cursor: pointer; }
.ds-recent-row > .ellipsis { flex: 1; }
.ds-recent-row > .muted { flex: none; }
.ds-recent-row:hover { background: rgba(155, 107, 255, .08); color: var(--text); }
.ds-recent-row[aria-current="true"] { background: rgba(155, 107, 255, .14); color: var(--text); }
@media (max-width: 760px) {
  .fmt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ds-go-row .ds-go { width: 100%; }
  .ds-conn > .row-actions, .ds-results-head > .row-actions { width: 100%; }
  .ds-conn > .row-actions .btn, .ds-results-head > .row-actions .btn { flex: 1 1 auto; }
}

/* ---- Sign in -------------------------------------------------------------------- */
.signin { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: max(24px, env(safe-area-inset-top)) 16px 24px; background: radial-gradient(900px 500px at 70% -10%, rgba(155, 107, 255, .14), transparent), var(--bg); overflow-y: auto; }
.signin-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 10px; padding: 28px 24px; border-radius: calc(var(--r) + 4px); background: var(--panel); border: 1px solid var(--line-2); box-shadow: var(--glow-violet); }
.signin-card h1 { margin: 6px 0 0; font: 700 24px var(--display); }
.signin-label { margin-top: 8px; font: 600 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.signin-card input { min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); font-size: 16px; }
.signin-card input:focus-visible { outline: 2px solid var(--violet-2); outline-offset: 2px; }
.signin-error { margin: 0; color: var(--red); font-size: 14px; }
.signin-submit { min-height: 48px; margin-top: 6px; }
.invite-card .btn { white-space: normal; text-align: center; }
.invite-card #invite-token { font: 500 14px var(--mono); letter-spacing: .02em; }

/* A voice link opened where the browser wants a tap first: the microphone pulses. */
.voice-btn.needs-tap { border-color: var(--cyan); color: var(--cyan); animation: voice-tap 1.4s ease-in-out infinite; }
@keyframes voice-tap { 50% { box-shadow: 0 0 0 6px rgba(62, 230, 255, .25); } }
@media (prefers-reduced-motion: reduce) { .voice-btn.needs-tap { animation: none; box-shadow: 0 0 0 3px rgba(62, 230, 255, .35); } }
/* A notification's approval on the Board (#/board?approval=<id>). */
.approval-target { border-color: rgba(255, 194, 77, .9); box-shadow: 0 0 0 2px rgba(255, 194, 77, .55); }
.approval-target:focus { outline: none; }
.board-target-note { margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line-2); color: var(--soft); font-size: 14px; }
.push-prompt { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 0 0 18px; background: rgba(62, 230, 255, .06); border: 1px solid rgba(62, 230, 255, .35); }
.push-prompt-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 16em; }
.push-prompt-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.push-prompt-actions .btn { min-height: 44px; }

/* CRM campaigns on the marketing team page (campaigns.js). */
.cmp-section { margin-top: 18px; }
.cmp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.cmp-card { min-width: 0; }
.cmp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cmp-title { min-width: 0; overflow-wrap: anywhere; }
.cmp-chip { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 12px; color: var(--soft); }
.cmp-approved { border-color: rgba(62, 255, 170, .45); color: var(--green); }
.cmp-rejected { border-color: rgba(255, 92, 122, .5); color: var(--red); }
.cmp-card p { margin: 0; overflow-wrap: anywhere; }
.cmp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.cmp-section .btn, .cmp-sheet-go { min-height: 44px; }
.cmp-run { white-space: normal; text-align: center; max-width: 100%; }
.cmp-state { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(255, 196, 92, .45); }
.cmp-state p { margin: 0; }
.cmp-brief-row { display: flex; flex-direction: column; gap: 2px; }
.cmp-brief-row p { margin: 0; overflow-wrap: anywhere; }
.cmp-list { margin: 0; padding-left: 18px; }
.rich-text { white-space: normal; overflow-wrap: anywhere; }
.rich-text p { white-space: pre-wrap; margin: 0 0 .8em; }
.rich-text > :last-child { margin-bottom: 0; }
.rich-text h2,.rich-text h3,.rich-text h4 { font-size: 1.1em; margin: 1em 0 .5em; }
.rich-text ul,.rich-text ol { padding-left: 1.5em; margin: .5em 0 1em; }
.rich-text pre,.rich-table { max-width: 100%; overflow: auto; }
.rich-text pre { white-space: pre; padding: .8em; background: #080c19; border-radius: 8px; }
.rich-text table { border-collapse: collapse; font-size: .95em; }
.rich-text th,.rich-text td { border: 1px solid var(--border, #34364a); padding: .45em .65em; text-align: left; }
.rich-text a { color: var(--cyan, #74d8ed); text-decoration: underline; }
.wb-file-actions { padding: .5rem 1rem; }
