/* Launchpad Agents: a company of AI agents. Dark first, light when the system is light. */
:root {
  --bg: #0a0b0f;
  --bg-2: #0e1016;
  --panel: #12141b;
  --panel-2: #171a23;
  --raise: #1c1f2a;
  --line: #232736;
  --line-2: #2c3142;
  --text: #eceef4;
  --text-2: #b4b9c8;
  --muted: #7d8397;
  --faint: #545a6d;
  --accent: #8b7bff;
  --accent-2: #a99dff;
  --accent-bg: rgba(139, 123, 255, 0.14);
  --accent-line: rgba(139, 123, 255, 0.38);
  --green: #34d399;
  --green-bg: rgba(52, 211, 153, 0.13);
  --amber: #fbbf24;
  --amber-bg: rgba(251, 191, 36, 0.13);
  --red: #f87171;
  --red-bg: rgba(248, 113, 113, 0.13);
  --blue: #60a5fa;
  --blue-bg: rgba(96, 165, 250, 0.13);
  --slate: #94a3b8;
  --slate-bg: rgba(148, 163, 184, 0.13);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.75), 0 0 0 1px var(--line-2);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Inter", "InterVariable", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f6f9;
    --bg-2: #f0f0f5;
    --panel: #ffffff;
    --panel-2: #fafafc;
    --raise: #f3f3f8;
    --line: #e7e7ef;
    --line-2: #dcdce6;
    --text: #15161d;
    --text-2: #3d4152;
    --muted: #6b7083;
    --faint: #9a9fb0;
    --accent: #6d5bf5;
    --accent-2: #5a47e8;
    --accent-bg: rgba(109, 91, 245, 0.09);
    --accent-line: rgba(109, 91, 245, 0.35);
    --green: #059669;
    --green-bg: rgba(5, 150, 105, 0.1);
    --amber: #b45309;
    --amber-bg: rgba(217, 119, 6, 0.11);
    --red: #dc2626;
    --red-bg: rgba(220, 38, 38, 0.09);
    --blue: #2563eb;
    --blue-bg: rgba(37, 99, 235, 0.09);
    --slate: #64748b;
    --slate-bg: rgba(100, 116, 139, 0.1);
    --shadow: 0 1px 2px rgba(20, 20, 40, 0.04), 0 8px 24px -14px rgba(20, 20, 40, 0.18);
    --shadow-lg: 0 24px 60px -20px rgba(20, 20, 40, 0.3), 0 0 0 1px var(--line);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
a.link, .md a { color: var(--accent-2); }
a.link:hover, .md a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 22px; letter-spacing: -0.02em; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0; }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
::selection { background: var(--accent-bg); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.xs { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; height: 100vh; }
.shell.with-hq { grid-template-columns: 248px 1fr 420px; }
.side {
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 14px 10px;
  gap: 4px;
  min-height: 0;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: conic-gradient(from 210deg, #8b7bff, #38bdf8, #34d399, #8b7bff);
  color: #fff; font-size: 13px; font-weight: 700; box-shadow: 0 6px 20px -6px rgba(139, 123, 255, 0.7);
}
.brand-mark.big { width: 54px; height: 54px; border-radius: 16px; font-size: 22px; margin: 0 auto 18px; }
.brand-text { min-width: 0; }
.brand-text b { display: block; font-size: 14px; letter-spacing: -0.01em; }
.brand-text span { display: block; font-size: 12px; color: var(--muted); }
.nav-label { font-size: 11px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; padding: 14px 10px 6px; }
.nav a, .nav button.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 8px; color: var(--text-2);
  font-weight: 500; border: 0; background: none; width: 100%; text-align: left; cursor: pointer;
}
.nav a:hover, .nav button.nav-item:hover { background: var(--raise); color: var(--text); }
.nav a.active { background: var(--accent-bg); color: var(--text); }
.nav a.active svg { color: var(--accent-2); }
svg { width: 16px; height: 16px; flex: none; }
.card-head > svg { color: var(--muted); }
.nav svg { width: 17px; height: 17px; color: var(--muted); flex: none; }
.nav .count { margin-left: auto; font-size: 11px; font-weight: 600; background: var(--accent); color: #fff; border-radius: 99px; padding: 0 7px; line-height: 18px; }
.nav .count.quiet { background: var(--raise); color: var(--muted); }
.side-team { overflow: auto; min-height: 0; flex: 1; margin: 0 -4px; padding: 0 4px; }
.side-member { display: flex; align-items: center; gap: 9px; padding: 5px 10px; border-radius: 8px; color: var(--text-2); }
.side-member:hover { background: var(--raise); color: var(--text); }
.side-member.active { background: var(--raise); color: var(--text); }
.side-foot { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.main { overflow: auto; min-width: 0; position: relative; }
.page { max-width: 1320px; margin: 0 auto; padding: 28px 32px 64px; }
.page.wide { max-width: none; }
.page.full { padding: 0; max-width: none; height: 100%; }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.page-head .sub { color: var(--muted); margin-top: 4px; max-width: 760px; }
.mobile-bar { display: none; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 13px; border-radius: 9px;
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text);
  font-weight: 500; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, transform .05s;
}
.btn:hover { background: var(--raise); border-color: var(--faint); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; box-shadow: 0 6px 18px -8px var(--accent); }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-bg); border-color: var(--red); }
.btn.ghost { background: none; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--raise); color: var(--text); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.icon { width: 34px; padding: 0; }
.btn.sm.icon { width: 28px; }
.btn.green { color: var(--green); }
.btn.green:hover { background: var(--green-bg); border-color: var(--green); }

input.input, textarea.input, select.input {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 9px;
  padding: 8px 11px; outline: none; transition: border-color .12s, box-shadow .12s;
}
input.input, select.input { height: 36px; }
textarea.input { resize: vertical; min-height: 90px; line-height: 1.5; }
textarea.input.code { font-family: var(--mono); font-size: 12.5px; }
.input:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-bg); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 15px, calc(100% - 11px) 15px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
label.field { display: flex; flex-direction: column; gap: 6px; }
label.field > span:first-child { font-weight: 500; font-size: 13px; color: var(--text-2); }
.hint { font-size: 12px; color: var(--muted); }
.form { display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--accent); }
.switch { position: relative; width: 36px; height: 21px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; position: absolute; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line-2); transition: background .15s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(15px); }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; color: var(--muted); cursor: pointer; font-weight: 500; }
.seg button.on { background: var(--raise); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.2); }

/* ---------- surfaces ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 18px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 14px; }
.card-body { padding: 16px 18px; }
.section { margin-top: 26px; }
.section > h2, .section-title { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.empty { text-align: center; padding: 42px 20px; color: var(--muted); }
.empty h3 { color: var(--text); margin-bottom: 6px; font-size: 15px; }
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel-2); }
.callout svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.callout.warn { border-color: rgba(251, 191, 36, .35); background: var(--amber-bg); }
.callout.warn svg { color: var(--amber); }
.callout.info svg { color: var(--accent-2); }
.callout.danger { border-color: rgba(248, 113, 113, .35); background: var(--red-bg); }
.divider { height: 1px; background: var(--line); margin: 14px 0; }

/* ---------- badges, chips, avatars ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--raise); color: var(--text-2); white-space: nowrap; }
.chip.green { background: var(--green-bg); color: var(--green); }
.chip.amber { background: var(--amber-bg); color: var(--amber); }
.chip.red { background: var(--red-bg); color: var(--red); }
.chip.blue { background: var(--blue-bg); color: var(--blue); }
.chip.violet { background: var(--accent-bg); color: var(--accent-2); }
.chip.slate { background: var(--slate-bg); color: var(--slate); }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.live .dot { animation: pulse 1.6s infinite; }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 500; background: var(--raise); color: var(--text-2); border: 1px solid var(--line); }
.key { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 currentColor; } 70% { box-shadow: 0 0 0 5px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.avatar {
  --c: var(--accent);
  position: relative; flex: none; display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 10px;
  background: linear-gradient(140deg, color-mix(in srgb, var(--c) 92%, white 8%), color-mix(in srgb, var(--c) 70%, black 30%));
  color: #fff; font-weight: 650; font-size: 13px; letter-spacing: -0.02em;
  box-shadow: 0 0 0 1px rgba(255,255,255,.06) inset;
}
.avatar.xs { width: 20px; height: 20px; border-radius: 6px; font-size: 10px; }
.avatar.sm { width: 26px; height: 26px; border-radius: 8px; font-size: 11px; }
.avatar.lg { width: 48px; height: 48px; border-radius: 14px; font-size: 18px; }
.avatar.xl { width: 68px; height: 68px; border-radius: 20px; font-size: 26px; }
.avatar.emoji { font-size: 16px; }
.avatar.lg.emoji { font-size: 24px; }
.avatar.xl.emoji { font-size: 34px; }
.avatar .status { position: absolute; right: -3px; bottom: -3px; width: 11px; height: 11px; border-radius: 50%; border: 2.5px solid var(--panel); background: var(--faint); }
.avatar.sm .status, .avatar.xs .status { width: 9px; height: 9px; border-width: 2px; right: -2px; bottom: -2px; }
.avatar.lg .status, .avatar.xl .status { width: 15px; height: 15px; border-width: 3px; }
.side .avatar .status { border-color: var(--bg-2); }
.status.working { background: var(--green); }
.status.working::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--green); animation: ring 1.8s ease-out infinite; }
.status.queued, .status.waking { background: var(--amber); }
.status.paused { background: var(--slate); }
.status.idle { background: var(--faint); }
@keyframes ring { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }
.board-avatar { background: linear-gradient(140deg, #3b3f52, #20232f); }
@media (prefers-color-scheme: light) { .board-avatar { background: linear-gradient(140deg, #4b5063, #2a2d3a); } }

/* ---------- overview ---------- */
.hero { display: flex; align-items: center; gap: 12px 18px; margin-bottom: 22px; flex-wrap: wrap; }
.hero > .grow { min-width: 240px; }
.hero h1 { font-size: 26px; }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat { padding: 14px 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat .label { color: var(--muted); font-size: 12px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.stat .label svg { width: 14px; height: 14px; }
.stat .value { font-size: 26px; font-weight: 650; letter-spacing: -0.03em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: 0; margin-left: 4px; }
.stat.attention { border-color: var(--accent-line); background: linear-gradient(180deg, var(--accent-bg), transparent 70%), var(--panel); cursor: pointer; }
.overview { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.floor { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 12px; }
.agent-card {
  display: flex; flex-direction: column; gap: 12px; padding: 15px 16px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); cursor: pointer;
  transition: border-color .15s, transform .15s, box-shadow .15s; position: relative; overflow: hidden; min-height: 158px;
}
.agent-card:hover { border-color: var(--line-2); transform: translateY(-1px); }
.agent-card.working { border-color: rgba(52, 211, 153, .35); }
.agent-card.working::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, transparent, var(--green), transparent); animation: scan 2.4s linear infinite; }
@keyframes scan { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.agent-card .who { display: flex; align-items: center; gap: 11px; min-width: 0; }
.agent-card .who b { display: block; font-size: 14.5px; }
.agent-card .who .grow > span { display: block; color: var(--muted); font-size: 12.5px; }
.agent-card .now { font-size: 12.5px; color: var(--text-2); background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; min-height: 52px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.agent-card .now.thinking { font-style: italic; color: var(--muted); }
.agent-card .now.cmd { font-family: var(--mono); font-size: 11.5px; }
.agent-card .meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin-top: auto; }
.agent-card .meta span { display: inline-flex; align-items: center; gap: 4px; }
.agent-card .meta svg { width: 13px; height: 13px; }
.add-card { border-style: dashed; align-items: center; justify-content: center; color: var(--muted); background: transparent; box-shadow: none; }
.add-card:hover { color: var(--text); background: var(--panel); }
.add-card svg { width: 22px; height: 22px; }

.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 11px; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 13px; }
.feed-item:last-child { border-bottom: 0; }
.feed-item .ico { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--raise); color: var(--muted); flex: none; }
.feed-item .ico svg { width: 14px; height: 14px; }
.feed-item .ico.done { background: var(--green-bg); color: var(--green); }
.feed-item .ico.error { background: var(--red-bg); color: var(--red); }
.feed-item .ico.hire { background: var(--accent-bg); color: var(--accent-2); }
.feed-item .ico.limit { background: var(--amber-bg); color: var(--amber); }
.feed-item .ico.approval { background: var(--blue-bg); color: var(--blue); }
.feed-item .txt { min-width: 0; color: var(--text-2); word-break: break-word; }
.feed-item .when { font-size: 11.5px; color: var(--faint); margin-top: 2px; }
.new-flash { animation: flash 1.4s ease-out; }
@keyframes flash { from { background: var(--accent-bg); } to { background: transparent; } }

.needs { display: flex; flex-direction: column; gap: 10px; }
.need { padding: 12px 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }

.welcome { padding: 44px; border-radius: 22px; position: relative; overflow: hidden; background: radial-gradient(1200px 400px at 0% 0%, rgba(139,123,255,.18), transparent 60%), radial-gradient(800px 400px at 100% 100%, rgba(56,189,248,.12), transparent 60%), var(--panel); border: 1px solid var(--line); }
.welcome h1 { font-size: 30px; letter-spacing: -0.03em; }
.welcome p { color: var(--text-2); font-size: 15px; max-width: 640px; margin-top: 10px; }
.welcome-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 28px; }
.welcome-action { text-align: left; padding: 16px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); cursor: pointer; display: flex; flex-direction: column; gap: 6px; transition: border-color .15s, transform .15s; }
.welcome-action:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.welcome-action svg { width: 20px; height: 20px; color: var(--accent-2); }
.welcome-action b { font-size: 14px; }
.welcome-action span { color: var(--muted); font-size: 12.5px; }

/* ---------- agent page ---------- */
.profile-head { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.profile-head h1 { font-size: 24px; }
.profile-head .line { display: flex; align-items: center; gap: 10px; color: var(--muted); margin-top: 4px; flex-wrap: wrap; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 9px 13px; color: var(--muted); font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.tabs .count { font-size: 11px; background: var(--raise); border-radius: 99px; padding: 0 6px; color: var(--muted); }
.two { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 9px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; }

/* the live feed of a run */
.run-feed { display: flex; flex-direction: column; gap: 2px; }
.ev { display: flex; gap: 10px; padding: 7px 10px; border-radius: 9px; font-size: 13px; min-width: 0; }
.ev:hover { background: var(--panel-2); }
.ev .ev-ico { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; flex: none; background: var(--raise); color: var(--muted); margin-top: 1px; }
.ev .ev-ico svg { width: 13px; height: 13px; }
.ev .ev-body { min-width: 0; flex: 1; }
.ev.thinking .ev-body { color: var(--muted); font-style: italic; white-space: pre-wrap; }
.ev.thinking .ev-ico { background: var(--accent-bg); color: var(--accent-2); }
.ev.command .ev-ico { background: var(--blue-bg); color: var(--blue); }
.ev.tool .ev-ico { background: var(--amber-bg); color: var(--amber); }
.ev.edit .ev-ico { background: var(--green-bg); color: var(--green); }
.ev.message .ev-ico { background: var(--green-bg); color: var(--green); }
.ev.phase { color: var(--faint); font-size: 12px; padding-top: 3px; padding-bottom: 3px; }
.ev.phase .ev-ico { background: none; }
.ev pre { margin: 6px 0 0; padding: 8px 10px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; max-height: 180px; overflow: auto; white-space: pre-wrap; word-break: break-word; color: var(--text-2); }
.ev .cmd { font-family: var(--mono); font-size: 12px; word-break: break-all; }
.ev .err { color: var(--red); }
.typing { display: inline-flex; gap: 4px; padding: 8px 10px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.wake { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.wake + .wake { margin-top: 10px; }
.wake-head { display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; }
.wake-body { border-top: 1px solid var(--line); padding: 10px 8px; }

/* ---------- org chart ---------- */
.org { overflow: auto; padding: 10px 0 40px; }
.org ul { position: relative; display: flex; justify-content: center; padding: 26px 0 0; margin: 0; list-style: none; }
.org li { position: relative; padding: 26px 10px 0; display: flex; flex-direction: column; align-items: center; }
.org li::before, .org li::after { content: ""; position: absolute; top: 0; right: 50%; width: 50%; height: 26px; border-top: 1.5px solid var(--line-2); }
.org li::after { right: auto; left: 50%; border-left: 1.5px solid var(--line-2); }
.org li:only-child::before, .org li:only-child::after { display: none; }
.org li:only-child { padding-top: 0; }
.org li:first-child::before, .org li:last-child::after { border: 0 none; }
.org li:last-child::before { border-right: 1.5px solid var(--line-2); border-radius: 0 10px 0 0; }
.org li:first-child::after { border-radius: 10px 0 0 0; }
.org ul ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 26px; border-left: 1.5px solid var(--line-2); }
.org > ul { padding-top: 0; }
.org-node { width: 196px; padding: 13px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; cursor: pointer; transition: border-color .15s, transform .15s; }
.org-node:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.org-node b { font-size: 14px; }
.org-node .t { color: var(--muted); font-size: 12px; margin-top: -4px; }
.org-node.board { width: auto; padding: 10px 18px; flex-direction: row; cursor: default; }
.org-node.drop { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }

/* ---------- tasks board ---------- */
.board-wrap { overflow-x: auto; padding-bottom: 8px; }
.kanban { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: 12px; min-width: 1060px; }
.lane { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 420px; }
.lane-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-weight: 600; font-size: 13px; }
.lane-head .n { color: var(--muted); font-weight: 500; }
.lane-body { padding: 0 8px 10px; display: flex; flex-direction: column; gap: 8px; flex: 1; border-radius: 0 0 var(--radius) var(--radius); }
.lane-body.drop { background: var(--accent-bg); }
.tcard { padding: 11px 12px; border-radius: 11px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); cursor: pointer; display: flex; flex-direction: column; gap: 8px; }
.tcard:hover { border-color: var(--line-2); }
.tcard.dragging { opacity: .4; }
.tcard .t { font-weight: 500; font-size: 13.5px; line-height: 1.35; }
.tcard .foot { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.pri { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; }
.pri.urgent { color: var(--red); }
.pri.high { color: var(--amber); }
.pri.normal { color: var(--muted); }
.pri.low { color: var(--faint); }
.st-dot { width: 9px; height: 9px; border-radius: 50%; border: 2px solid currentColor; display: inline-block; flex: none; }
.st-todo { color: var(--faint); }
.st-in_progress { color: var(--amber); }
.st-blocked { color: var(--red); }
.st-in_review { color: var(--blue); }
.st-done { color: var(--green); }
.st-done.st-dot, .st-in_review.st-dot { background: currentColor; }
.st-cancelled { color: var(--faint); }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .input { width: 260px; height: 34px; }
.filter-avatars { display: flex; gap: 4px; }
.filter-avatars button { border: 0; padding: 0; background: none; cursor: pointer; border-radius: 9px; opacity: .55; transition: opacity .12s, transform .12s; }
.filter-avatars button.on, .filter-avatars button:hover { opacity: 1; }
.filter-avatars button.on .avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }

/* ---------- drawer, modal, toast ---------- */
.scrim { position: fixed; inset: 0; background: rgba(5, 6, 10, .55); backdrop-filter: blur(3px); z-index: 50; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); background: var(--panel); border-left: 1px solid var(--line); z-index: 51; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-body { overflow: auto; padding: 20px; flex: 1; }
.drawer-foot { border-top: 1px solid var(--line); padding: 14px 20px; }
.modal { position: fixed; z-index: 51; left: 50%; top: 7vh; transform: translateX(-50%); width: min(680px, calc(100vw - 32px)); max-height: 86vh; display: flex; flex-direction: column; background: var(--panel); border-radius: 18px; box-shadow: var(--shadow-lg); animation: pop .16s ease-out; }
.modal.wide { width: min(940px, calc(100vw - 32px)); }
@keyframes pop { from { transform: translateX(-50%) scale(.97); opacity: 0; } }
.modal-head { padding: 18px 22px 0; display: flex; align-items: flex-start; gap: 12px; }
.modal-head p { color: var(--muted); margin-top: 3px; }
.modal-body { padding: 18px 22px; overflow: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--text); color: var(--bg); padding: 9px 14px; border-radius: 10px; font-weight: 500; box-shadow: var(--shadow-lg); animation: pop2 .18s; max-width: 90vw; }
.toast.error { background: var(--red); color: #fff; }
@keyframes pop2 { from { transform: translateY(8px); opacity: 0; } }

.templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.tpl { text-align: left; border: 1px solid var(--line); background: var(--panel-2); border-radius: 12px; padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; transition: border-color .12s; }
.tpl:hover, .tpl.on { border-color: var(--accent-line); background: var(--accent-bg); }
.tpl .e { font-size: 20px; }
.tpl b { font-size: 13.5px; }
.tpl span { font-size: 12px; color: var(--muted); line-height: 1.4; }
.steps { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 12.5px; }
.steps b { color: var(--text); font-weight: 600; }
.colors { display: flex; gap: 6px; flex-wrap: wrap; }
.colors button { width: 22px; height: 22px; border-radius: 7px; border: 0; cursor: pointer; }
.colors button.on { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--text); }
.skill-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-pick { border: 1px solid var(--line-2); background: var(--panel-2); border-radius: 99px; padding: 4px 11px; font-size: 12.5px; cursor: pointer; color: var(--text-2); }
.skill-pick.on { background: var(--accent-bg); border-color: var(--accent-line); color: var(--text); }

/* ---------- chat (HQ) ---------- */
.chat { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.chat-scroll { flex: 1; overflow: auto; padding: 20px 18px; min-height: 0; }
.chat-col { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; gap: 10px; min-width: 0; }
.msg.user { justify-content: flex-end; }
.msg.user .bubble { background: var(--accent); color: #fff; border-radius: 16px 16px 4px 16px; padding: 9px 14px; max-width: 85%; white-space: pre-wrap; word-break: break-word; }
.msg.assistant .body { min-width: 0; flex: 1; }
.hq-mark { width: 28px; height: 28px; border-radius: 9px; flex: none; display: grid; place-items: center; background: conic-gradient(from 210deg, #8b7bff, #38bdf8, #34d399, #8b7bff); color: #fff; font-size: 11px; font-weight: 700; }
.toolcall { border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); font-size: 12.5px; overflow: hidden; }
.toolcall-head { display: flex; align-items: center; gap: 8px; padding: 8px 11px; cursor: pointer; }
.toolcall-head svg { width: 14px; height: 14px; color: var(--muted); }
.toolcall pre { margin: 0; padding: 10px 12px; border-top: 1px solid var(--line); max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-word; color: var(--text-2); }
.toolcall.approval { border-color: var(--accent-line); background: var(--accent-bg); }
.toolcall .approve-row { display: flex; gap: 8px; padding: 0 11px 11px; align-items: center; flex-wrap: wrap; }
.chat-compose { padding: 12px 18px 18px; }
.composer { max-width: 780px; margin: 0 auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px; padding: 10px 10px 10px 14px; display: flex; gap: 10px; align-items: flex-end; box-shadow: var(--shadow); }
.composer:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-bg); }
.composer textarea { flex: 1; border: 0; outline: 0; background: none; resize: none; max-height: 220px; min-height: 24px; line-height: 1.5; padding: 4px 0; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.suggest button { border: 1px solid var(--line-2); background: var(--panel); border-radius: 99px; padding: 7px 13px; cursor: pointer; color: var(--text-2); font-size: 13px; }
.suggest button:hover { border-color: var(--accent-line); color: var(--text); }
.chat-layout { display: grid; grid-template-columns: 250px 1fr; height: 100vh; }
.chat-list { border-right: 1px solid var(--line); background: var(--bg-2); overflow: auto; padding: 12px 8px; }
.chat-list a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--text-2); font-size: 13px; }
.chat-list a:hover { background: var(--raise); }
.chat-list a.on { background: var(--raise); color: var(--text); }
.hq-panel { border-left: 1px solid var(--line); background: var(--bg-2); min-height: 0; height: 100vh; }

.md { line-height: 1.6; word-break: break-word; }
.md > * + * { margin-top: 8px; }
.md ul, .md ol { padding-left: 20px; margin: 0; }
.md li + li { margin-top: 3px; }
.md code { background: var(--raise); border-radius: 5px; padding: 1px 5px; }
.md pre.code { background: var(--bg-2); border: 1px solid var(--line); padding: 10px 12px; border-radius: 9px; overflow: auto; }
.md h4 { font-size: 14px; margin-top: 12px; }
.md table { border-collapse: collapse; font-size: 13px; }
.md th, .md td { border: 1px solid var(--line); padding: 5px 9px; text-align: left; }

/* conversation with an agent */
.thread { display: flex; flex-direction: column; gap: 10px; }
.tmsg { display: flex; gap: 10px; max-width: 88%; }
.tmsg.mine { align-self: flex-end; flex-direction: row-reverse; }
.tmsg .b { background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 9px 13px; min-width: 0; }
.tmsg.mine .b { background: var(--accent-bg); border-color: var(--accent-line); }
.tmsg .w { font-size: 11.5px; color: var(--faint); margin-top: 3px; }
.inbox { display: grid; grid-template-columns: 300px 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; min-height: 520px; }
.inbox-list { border-right: 1px solid var(--line); overflow: auto; max-height: 70vh; }
.inbox-item { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.inbox-item:hover { background: var(--panel-2); }
.inbox-item.on { background: var(--raise); }
.inbox-item .p { color: var(--muted); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.inbox-item .unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; margin-top: 6px; }
.inbox-conv { display: flex; flex-direction: column; min-height: 0; max-height: 70vh; }
.inbox-conv .thread { flex: 1; overflow: auto; padding: 18px; }

.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.skill-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; }
.skill-card:hover { border-color: var(--line-2); }

.settings { display: grid; grid-template-columns: 200px minmax(0, 760px); gap: 32px; }
.settings-nav { position: sticky; top: 20px; align-self: start; display: flex; flex-direction: column; gap: 2px; }
.settings-nav a { padding: 6px 10px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.settings-nav a:hover { color: var(--text); background: var(--raise); }
.settings .card { scroll-margin-top: 20px; }
.settings .card + .card { margin-top: 16px; }

.signin { display: grid; place-items: center; min-height: 100vh; background: radial-gradient(900px 500px at 50% -10%, rgba(139,123,255,.2), transparent 60%), var(--bg); }
.signin-card { text-align: center; padding: 44px 40px; max-width: 420px; }
.signin-card h1 { font-size: 30px; letter-spacing: -0.03em; }
.signin-card p { margin: 10px 0 26px; }
.loading { display: grid; place-items: center; height: 60vh; color: var(--muted); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--panel) 0%, var(--raise) 50%, var(--panel) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.bar { height: 6px; border-radius: 99px; background: var(--raise); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.bar.warn > i { background: var(--amber); }
.bar.over > i { background: var(--red); }
kbd { font-family: var(--font); font-size: 11px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; color: var(--muted); }

/* ---------- small screens ---------- */
@media (max-width: 1180px) {
  .shell.with-hq { grid-template-columns: 248px 1fr; }
  .shell.with-hq .hq-panel { position: fixed; right: 0; top: 0; bottom: 0; width: min(420px, 100vw); z-index: 40; box-shadow: var(--shadow-lg); }
  .overview { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .hero h1 { font-size: 22px; }
  .page-head { flex-wrap: wrap; }
  .profile-head { flex-wrap: wrap; }
  .shell, .shell.with-hq { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 60; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .side.open { transform: none; }
  .mobile-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 20; }
  .page { padding: 18px 16px 48px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two, .form-grid, .welcome-actions { grid-template-columns: 1fr; }
  .inbox { grid-template-columns: 1fr; }
  .inbox-list { max-height: 240px; border-right: 0; border-bottom: 1px solid var(--line); }
  .chat-layout { grid-template-columns: 1fr; height: calc(100vh - 53px); }
  .chat-list { display: none; }
  .settings { grid-template-columns: 1fr; }
  .settings-nav { display: none; }
  .page-head { flex-wrap: wrap; }
  .welcome { padding: 26px; }
  .welcome h1 { font-size: 24px; }
  .hq-panel { height: 100vh; }
}
