:root {
  --bg: #07080d;
  --bg-2: #0d0f17;
  --panel: rgba(20, 23, 35, 0.72);
  --panel-solid: #141723;
  --panel-2: rgba(30, 34, 50, 0.65);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #e8eaf2;
  --muted: #8b90a7;
  --faint: #5b6078;
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --accent-3: #f472b6;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --info: #60a5fa;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.7);
  --mono: ui-monospace, "JetBrains Mono", "SF Mono", "Cascadia Code", Menlo, monospace;
  --sans: ui-sans-serif, -apple-system, "Segoe UI", "Inter", Roboto, system-ui, sans-serif;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f6fb; --bg-2: #eceef6; --panel: rgba(255, 255, 255, 0.78); --panel-solid: #fff;
    --panel-2: rgba(240, 242, 250, 0.9); --line: rgba(15, 18, 40, 0.08); --line-2: rgba(15, 18, 40, 0.16);
    --text: #141627; --muted: #5d6280; --faint: #9196ad; --shadow: 0 20px 50px -25px rgba(30, 30, 80, 0.35);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f5f6fb; --bg-2: #eceef6; --panel: rgba(255, 255, 255, 0.78); --panel-solid: #fff;
  --panel-2: rgba(240, 242, 250, 0.9); --line: rgba(15, 18, 40, 0.08); --line-2: rgba(15, 18, 40, 0.16);
  --text: #141627; --muted: #5d6280; --faint: #9196ad; --shadow: 0 20px 50px -25px rgba(30, 30, 80, 0.35);
  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(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent-2); }

/* aurora background */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora i {
  position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%;
  filter: blur(90px); opacity: 0.22; animation: drift 28s ease-in-out infinite alternate;
}
.aurora i:nth-child(1) { background: var(--accent); top: -25vmax; left: -15vmax; }
.aurora i:nth-child(2) { background: var(--accent-2); bottom: -30vmax; right: -20vmax; animation-delay: -9s; }
.aurora i:nth-child(3) { background: var(--accent-3); top: 30%; left: 45%; width: 35vmax; height: 35vmax; opacity: 0.12; animation-delay: -17s; }
.aurora::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 28px 28px; mask-image: linear-gradient(to bottom, black, transparent 85%);
}
@keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .aurora i, .pulse::after { animation: none !important; } }

/* layout */
.app { max-width: 1440px; margin: 0 auto; padding: 20px 24px 60px; }
header.top {
  position: sticky; top: 12px; z-index: 20;
  display: flex; align-items: center; gap: 16px; padding: 10px 14px;
  background: var(--panel); backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.02em; font-size: 16px; }
.logo {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: conic-gradient(from 200deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent));
  box-shadow: 0 0 24px -4px var(--accent);
}
.logo::after { content: ""; width: 12px; height: 12px; border-radius: 4px; background: var(--bg); }
.brand small { color: var(--muted); font-weight: 500; }
.spacer { flex: 1; }
.search {
  display: flex; align-items: center; gap: 8px; min-width: 240px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px;
}
.search input { border: 0; outline: 0; background: transparent; width: 100%; }
kbd {
  font: 11px var(--mono); padding: 1px 6px; border-radius: 5px;
  border: 1px solid var(--line-2); color: var(--muted); background: var(--panel-2);
}
.live { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer; white-space: nowrap;
  padding: 7px 13px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--panel-2); transition: transform .12s, background .2s, border-color .2s, box-shadow .2s;
}
.btn:hover { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.primary {
  border-color: transparent; color: white; font-weight: 600;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 50%, var(--accent-2)));
  box-shadow: 0 8px 24px -10px var(--accent);
}
.btn.danger:hover { border-color: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 20%, transparent); color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--panel-2); border-color: var(--line); box-shadow: none; }
.btn.sm { padding: 4px 9px; font-size: 12px; border-radius: 8px; }
.icon { width: 16px; height: 16px; flex: none; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 22px 0 18px; }
.stat {
  padding: 14px 16px; border-radius: var(--radius); background: var(--panel);
  border: 1px solid var(--line); backdrop-filter: blur(12px); position: relative; overflow: hidden;
}
.stat b { display: block; font-size: 26px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.stat::before {
  content: ""; position: absolute; inset: auto -20% -60% auto; width: 120px; height: 120px; border-radius: 50%;
  background: var(--c, var(--accent)); filter: blur(40px); opacity: .25;
}

/* grid of agents */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.card {
  --c: var(--faint);
  position: relative; padding: 16px; border-radius: var(--radius); cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(14px);
  transition: transform .2s cubic-bezier(.2,.8,.2,1), border-color .2s, box-shadow .2s;
  animation: rise .35s cubic-bezier(.2,.8,.2,1) both;
}
.card::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 70%, transparent), transparent 45%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: .8;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow), 0 0 40px -18px var(--c); }
.card.sel { border-color: var(--c); }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.card-head { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 38px; height: 38px; border-radius: 11px; flex: none; display: grid; place-items: center;
  font-weight: 700; color: white; text-transform: uppercase; font-size: 15px;
  background: linear-gradient(135deg, hsl(var(--h) 80% 60%), hsl(calc(var(--h) + 50) 80% 50%));
}
.card h3 { margin: 0; font-size: 15px; letter-spacing: -0.01em; }
.card .role { color: var(--muted); font-size: 12px; }
.card .body { margin: 14px 0 12px; min-height: 40px; color: var(--muted); font-size: 13px; }
.card .now { display: flex; align-items: center; gap: 8px; color: var(--text); }
.card .now code { font: 12px var(--mono); padding: 2px 7px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); }
.card-foot { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.card-foot .when { color: var(--faint); font-size: 12px; margin-right: auto; }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 26px; margin-top: 10px; }
.spark i { flex: 1; border-radius: 2px; background: var(--c); opacity: .55; min-height: 2px; transition: height .4s; }

/* status pill */
.pill {
  --c: var(--faint);
  display: inline-flex; align-items: center; gap: 6px; margin-left: auto;
  padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
  color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); position: relative; }
.pulse::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--c);
  animation: ping 1.6s cubic-bezier(0,0,.2,1) infinite;
}
@keyframes ping { 75%, 100% { transform: scale(1.8); opacity: 0; } }

[data-s="idle"], [data-s="running"] { --c: var(--ok); }
[data-s="working"] { --c: var(--accent-2); }
[data-s="needs_attention"] { --c: var(--warn); }
[data-s="starting"], [data-s="creating"] { --c: var(--accent); }
[data-s="failed"], [data-s="unreachable"], [data-s="exited"] { --c: var(--bad); }
[data-s="stopped"], [data-s="ended"], [data-s="deleting"] { --c: var(--faint); }

/* empty state */
.empty {
  text-align: center; padding: 70px 20px; border: 1px dashed var(--line-2); border-radius: var(--radius);
  background: var(--panel); color: var(--muted);
}
.empty h2 { color: var(--text); margin: 14px 0 6px; letter-spacing: -0.02em; }
.orb {
  width: 76px; height: 76px; margin: 0 auto; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--accent-2), var(--accent) 55%, transparent 70%);
  box-shadow: 0 0 60px -10px var(--accent); animation: float 5s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-8px); } }

/* drawer */
.scrim { position: fixed; inset: 0; background: rgba(4, 5, 10, .55); backdrop-filter: blur(3px); z-index: 30; animation: fade .2s; }
.drawer {
  position: fixed; top: 10px; right: 10px; bottom: 10px; width: min(980px, calc(100vw - 20px)); z-index: 31;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: 20px; box-shadow: var(--shadow);
  animation: slide .32s cubic-bezier(.2,.8,.2,1);
}
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px 0; }
.drawer-head h2 { margin: 0; font-size: 18px; letter-spacing: -0.02em; }
.drawer-head .sub { color: var(--muted); font-size: 12px; }
.tabs { display: flex; gap: 4px; padding: 12px 18px 0; border-bottom: 1px solid var(--line); }
.tab {
  padding: 8px 12px; border: 0; background: none; cursor: pointer; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; gap: 6px; align-items: center;
}
.tab.on { color: var(--text); border-color: var(--accent); }
.tab .count { font-size: 11px; padding: 0 6px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); }
.pane { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 14px 18px 18px; gap: 12px; }

/* terminal-like screen */
.screen {
  flex: 1; min-height: 0; overflow: auto; margin: 0; padding: 14px 16px; border-radius: 14px;
  background: #05060a; color: #d7dae6; border: 1px solid var(--line);
  font: 12.5px/1.45 var(--mono); white-space: pre; tab-size: 8;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02), inset 0 20px 60px -30px color-mix(in srgb, var(--accent) 40%, transparent);
}
.screen .b { font-weight: 700; } .screen .d { opacity: .6; } .screen .i { font-style: italic; } .screen .u { text-decoration: underline; }
.screen-bar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.screen-bar .hint { color: var(--faint); font-size: 12px; margin-left: auto; }

.composer {
  display: flex; gap: 10px; align-items: flex-end; padding: 10px; border-radius: 14px;
  background: var(--panel-2); border: 1px solid var(--line);
  transition: border-color .2s, box-shadow .2s;
}
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent); }
.composer textarea { flex: 1; resize: none; border: 0; outline: 0; background: transparent; min-height: 22px; max-height: 200px; }

/* timeline */
.timeline { flex: 1; min-height: 0; overflow: auto; padding-right: 4px; }
.ev {
  display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start;
  padding: 8px 10px; border-radius: 10px; position: relative; animation: rise .25s both;
}
.ev:hover { background: var(--panel-2); }
.ev .ic {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c);
}
.ev .name { font-weight: 600; }
.ev .meta { color: var(--muted); font: 12px var(--mono); word-break: break-word; }
.ev time { color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.ev pre {
  grid-column: 2 / 4; margin: 6px 0 0; padding: 10px; border-radius: 8px; background: #05060a; color: #c9cde0;
  font: 11.5px/1.5 var(--mono); max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-all;
}
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent;
  font-size: 12px; cursor: pointer; color: var(--muted);
}
.chip.on { color: var(--text); background: color-mix(in srgb, var(--accent) 20%, transparent); border-color: var(--accent); }

/* ttyd frame */
.frame { flex: 1; border: 1px solid var(--line); border-radius: 14px; background: #000; width: 100%; }

/* details */
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; align-content: start; overflow: auto; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font: 13px var(--mono); word-break: break-all; display: flex; gap: 8px; align-items: center; }

/* modal */
.modal {
  position: fixed; z-index: 41; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 40px); overflow: auto;
  background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: 20px; box-shadow: var(--shadow);
  animation: pop .25s cubic-bezier(.2,.8,.2,1);
}
.modal + .scrim, .scrim.top { z-index: 40; }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -46%) scale(.97); } }
.modal header { padding: 20px 22px 4px; }
.modal header h2 { margin: 0; letter-spacing: -0.02em; }
.modal header p { margin: 4px 0 0; color: var(--muted); }
.modal form { padding: 14px 22px 22px; display: grid; gap: 14px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label.f { display: grid; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.f input, .f textarea, .f select {
  width: 100%; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--panel-2); outline: 0; font-weight: 400; font-size: 14px; color: var(--text);
}
.f input:focus, .f textarea:focus, .f select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.f textarea { min-height: 80px; resize: vertical; }
.f .help { font-weight: 400; color: var(--faint); }
.seg { display: flex; padding: 3px; gap: 3px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.seg button { flex: 1; border: 0; background: none; padding: 6px; border-radius: 8px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--panel-solid); color: var(--text); box-shadow: 0 2px 8px -2px rgba(0,0,0,.4); }
.roles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.role-opt {
  padding: 10px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel-2);
  cursor: pointer; text-align: left; display: grid; gap: 2px;
}
.role-opt b { font-size: 13px; } .role-opt span { font-size: 11px; color: var(--muted); }
.role-opt.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--panel-2)); }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
input[type=range] { accent-color: var(--accent); padding: 0; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .box {
  width: min(400px, 100%); padding: 32px; border-radius: 22px; text-align: center;
  background: var(--panel); border: 1px solid var(--line-2); backdrop-filter: blur(20px); box-shadow: var(--shadow);
}
.login form { display: grid; gap: 12px; margin-top: 22px; }

/* toasts */
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; }
.toast {
  --c: var(--accent);
  padding: 10px 16px; border-radius: 12px; background: var(--panel-solid); border: 1px solid var(--line-2);
  box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; animation: rise .25s both;
}
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 12px var(--c); }
.toast.err { --c: var(--bad); } .toast.ok { --c: var(--ok); }

.muted { color: var(--muted); }
.err-box { padding: 10px 12px; border-radius: 10px; color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); border: 1px solid color-mix(in srgb, var(--bad) 30%, transparent); font: 12px var(--mono); }
.loader { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }

@media (max-width: 720px) {
  .app { padding: 12px 16px 40px; }
  .search, .brand small, .live span { display: none; }
  .row, .roles { grid-template-columns: 1fr 1fr; }
  .kv { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
}
.btn.armed { border-color: var(--bad); color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.tools { display: flex; gap: 2px; }
.tools a { text-decoration: none; color: var(--muted); }
.tools a:hover { color: var(--text); }
@media (max-width: 960px) { .tools { display: none; } }

/* request groups in the timeline */
.req { border: 1px solid var(--line); border-radius: 12px; margin: 6px 0; background: var(--panel-2); overflow: hidden; animation: rise .25s both; }
.req.focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.req > header { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: start; padding: 10px 12px; cursor: pointer; border-left: 3px solid var(--c); }
.req > header .dot { margin-top: 6px; }
.req > header:hover { background: color-mix(in srgb, var(--c) 6%, transparent); }
.req-title b { display: block; font-weight: 600; }
.req-title .meta code { font: 11px var(--mono); padding: 0 5px; border-radius: 5px; background: var(--panel-solid); border: 1px solid var(--line); }
.req .tag { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; padding: 0 6px; margin-right: 6px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--muted); }
.req-body { padding: 0 6px 6px 18px; border-top: 1px solid var(--line); }
.req time { color: var(--faint); font-size: 11px; }

/* queue metrics */
.qstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: 8px; }
.qstats .stat { padding: 9px 11px; }
.qstats .stat b { font-size: 18px; }
.qstats .stat span { font-size: 10px; }
.qstrip { display: flex; gap: 12px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.qstrip b { color: var(--text); font-variant-numeric: tabular-nums; }
.qstrip .bad b { color: var(--bad); }

/* queues overview */
.viewbar { display: flex; margin: 0 0 14px; }
.viewbar .seg { width: auto; }
.viewbar .seg button { padding: 6px 16px; }
.qtable-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(14px); }
.qtable { width: 100%; border-collapse: collapse; font-size: 13px; }
.qtable th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.qtable td { padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.qtable tbody tr { cursor: pointer; transition: background .15s; }
.qtable tbody tr:hover { background: var(--panel-2); }
.qtable td.num { font-variant-numeric: tabular-nums; }
.qtable td.ok { color: var(--ok); } .qtable td.bad { color: var(--bad); }
.qtable .pill { margin-left: 0; }
.cell-agent { display: flex; gap: 10px; align-items: center; }
.avatar.sm { width: 28px; height: 28px; font-size: 12px; border-radius: 8px; }

/* filters + groups */
.viewbar { flex-wrap: wrap; gap: 10px; align-items: center; }
.filterbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-left: auto; }
.fsel { display: flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(10px); font-size: 12px; color: var(--muted); }
.fsel.on { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 12%, var(--panel)); }
.fsel select { border: 0; background: transparent; color: var(--text); font-size: 12px; padding: 3px 4px; outline: 0; cursor: pointer; }
.fsel select option { background: var(--panel-solid); }
.agroup + .agroup { margin-top: 26px; }
.ghead { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 0 2px 12px; }
.ghead h3 { margin: 0; font-size: 16px; letter-spacing: -0.01em; }
.gpills { display: flex; gap: 6px; margin-left: auto; }
.gpills .pill { margin-left: 0; font-size: 11px; padding: 1px 8px 1px 6px; }
.team { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 1px 6px; border-radius: 6px; color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent-2) 30%, transparent); }
.qtable tr.grow td { background: var(--panel-2); font-size: 12px; cursor: default; }
@media (max-width: 720px) { .filterbar { margin-left: 0; } .gpills { margin-left: 0; } }

/* api examples */
.snip { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel-2); }
.snip-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 12px; font-size: 12px; border-bottom: 1px solid var(--line); }
.snip pre { margin: 0; padding: 10px 12px; background: #05060a; color: #c9cde0; font: 12px/1.55 var(--mono); white-space: pre-wrap; word-break: break-all; }

/* metrics */
.tbar { display: flex; width: 140px; height: 10px; border-radius: 99px; overflow: hidden; background: var(--line); }
.tbar i { display: block; height: 100%; transition: width .4s; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: 12px; margin: 0 2px 10px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.qtable th.sortable { cursor: pointer; user-select: none; }
.qtable th.sortable:hover, .qtable th.sorted { color: var(--text); }
.qtable tr.total td { font-weight: 600; }
.qtable tfoot tr.total td { border-top: 2px solid var(--line-2); }
.live-task { font-size: 11px; color: var(--accent-2); }

/* api reference */
.modal.wide { width: min(980px, calc(100vw - 24px)); }
.apihead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 18px 22px 10px !important; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel-solid); z-index: 1; }
.apihead > div { margin-right: auto; }
.apihead code { font: 12px var(--mono); }
.apibody { padding: 6px 22px 22px; display: grid; gap: 10px; }
.apibody h3 { margin: 14px 0 2px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

.combo-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.combo-chips .chip { font-weight: 500; }
.chip.new { border-style: dashed; color: var(--accent-2); cursor: default; }
.team.proj { color: var(--accent-3); background: color-mix(in srgb, var(--accent-3) 12%, transparent); border-color: color-mix(in srgb, var(--accent-3) 30%, transparent); }

/* files & secrets */
.sec-title { margin: 6px 0 0; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.crumbs { display: flex; align-items: center; gap: 2px; color: var(--faint); flex-wrap: wrap; }
.drop { border: 1px dashed var(--line-2); border-radius: 12px; min-height: 60px; transition: background .2s, border-color .2s; }
.drop.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.frow { display: grid; grid-template-columns: 18px 1fr auto auto auto; gap: 10px; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.frow:last-child { border-bottom: 0; }
.frow .link { background: none; border: 0; padding: 0; color: var(--text); cursor: pointer; text-align: left; font: 13px var(--mono); }
.frow .link:hover { color: var(--accent-2); text-decoration: underline; }
.secrets { display: flex; flex-wrap: wrap; gap: 6px; }
.chip.secret { display: inline-flex; gap: 6px; align-items: center; }
.chip.secret code { font: 12px var(--mono); }
.chip.secret .x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 0 2px; }
.chip.secret .x:hover { color: var(--bad); }
.secret-form { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; }
.secret-form input { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: 13px var(--mono); }

.remote-row { display: grid; grid-template-columns: 120px 1fr 80px auto; gap: 8px; }
.remote-row input { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: 13px var(--mono); }
.tab .count.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
