:root {
  --bg: #07111f;
  --bg-2: #0c1b31;
  --panel: rgba(10, 22, 40, 0.84);
  --panel-2: rgba(14, 31, 55, 0.92);
  --line: rgba(122, 167, 255, 0.18);
  --line-strong: rgba(122, 167, 255, 0.24);
  --text: #e9f2ff;
  --muted: #8ca5c7;
  --muted-2: #7288a7;
  --cyan: #57d7ff;
  --accent: #57d7ff;
  --blue: #6e86ff;
  --green: #4ef0b2;
  --yellow: #ffd76a;
  --red: #ff6a89;
  --violet: #b285ff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --radius: 24px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background:
  radial-gradient(circle at top left, rgba(87, 215, 255, 0.08), transparent 28%),
  radial-gradient(circle at top right, rgba(110, 134, 255, 0.10), transparent 30%),
  linear-gradient(160deg, var(--bg) 0%, #091321 40%, var(--bg-2) 100%); color: var(--text); font-family: Inter, system-ui, sans-serif; }
body { position: relative; }
.noise { position: fixed; inset: 0; pointer-events: none; opacity: 0.12; background-image: radial-gradient(rgba(255,255,255,.22) .45px, transparent .45px); background-size: 10px 10px; mix-blend-mode: soft-light; }
.app-shell { position: relative; z-index: 1; display: grid; grid-template-columns: 320px 1fr; gap: 20px; padding: 20px; min-height: 100vh; }
.panel, .glass { background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.panel { border-radius: var(--radius); padding: 22px; transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.panel-active { border-color: rgba(87, 215, 255, 0.36); box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(87, 215, 255, 0.12); }
.sidebar { border-radius: 28px; padding: 20px; display: flex; flex-direction: column; gap: 18px; background: linear-gradient(180deg, rgba(8, 21, 37, 0.92), rgba(7, 15, 26, 0.95)); }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 18px; font-weight: 800; letter-spacing: 0.08em; background: linear-gradient(135deg, rgba(87, 215, 255, 0.20), rgba(110, 134, 255, 0.35)); border: 1px solid rgba(87, 215, 255, 0.25); }
.brand h1, .hero h2, .panel h3, .sidebar h2 { margin: 0; }
.kicker { margin: 0 0 6px; color: var(--cyan); text-transform: uppercase; letter-spacing: 0.16em; font-size: 11px; font-weight: 700; }
.nav-stack { display: grid; gap: 10px; }
.nav-chip, .action { appearance: none; border: 1px solid var(--line); background: rgba(255,255,255,0.02); color: var(--text); padding: 12px 14px; border-radius: 14px; cursor: pointer; font: inherit; transition: .2s ease; }
.nav-chip:hover, .action:hover, .nav-chip.active { border-color: rgba(87, 215, 255, 0.38); background: rgba(87, 215, 255, 0.08); }
.sidebar-block { padding: 16px; border-radius: 20px; border: 1px solid rgba(122, 167, 255, 0.12); background: rgba(255,255,255,0.02); }
.block-head, .panel-head, .agent-topline, .toolbar, .shell-topline.split { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.toolbar { flex-wrap: wrap; }
.sidebar-block p { color: var(--muted); }
.compact-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.compact-metrics article { border-radius: 16px; padding: 12px; background: rgba(6, 16, 30, 0.85); border: 1px solid rgba(122, 167, 255, 0.12); }
.compact-metrics span, .metric-card span, .agent-role, .queue-meta, .link-list span, .shell-topline, .shell-topline code, .agent-meta, .status-dot { color: var(--muted); font-size: 12px; }
.compact-metrics strong, .metric-card strong { display: block; margin-top: 8px; font-size: 24px; }
.badge, .status-pill { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 8px 12px; background: rgba(255,255,255,0.06); border: 1px solid rgba(122, 167, 255, 0.14); font-size: 12px; }
.badge.muted { color: var(--muted); }
.badge.accent { background: rgba(87, 215, 255, 0.12); color: var(--cyan); }
.status-dot::before { content: ''; width: 8px; height: 8px; border-radius: 999px; background: currentColor; box-shadow: 0 0 12px currentColor; }
.status-dot.online { color: var(--green); }
.status-dot.offline { color: var(--red); }
.link-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.link-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.link-list code, .shell-topline, .editor-preview, .terminal-lines { font-family: "JetBrains Mono", monospace; }
.main-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; align-content: start; }
.hero { grid-column: 1 / -1; display: grid; grid-template-columns: 1.4fr .8fr; gap: 20px; min-height: 280px; overflow: hidden; background: linear-gradient(135deg, rgba(10, 26, 47, 0.94), rgba(9, 18, 32, 0.88)); }
.hero-copy { display: flex; flex-direction: column; gap: 16px; }
.hero-copy p { margin: 0; color: var(--muted); }
.signal-row { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-radar { position: relative; border-radius: 28px; min-height: 220px; display: grid; place-items: center; background:
  radial-gradient(circle, rgba(87, 215, 255, 0.12) 0, rgba(87, 215, 255, 0.03) 35%, transparent 60%),
  rgba(6, 18, 31, 0.78); overflow: hidden; }
.radar-ring { position: absolute; border: 1px solid rgba(87, 215, 255, 0.18); border-radius: 999px; }
.ring-1 { width: 80px; height: 80px; }
.ring-2 { width: 150px; height: 150px; }
.ring-3 { width: 230px; height: 230px; }
.radar-sweep { position: absolute; width: 180px; height: 180px; background: conic-gradient(from 220deg, transparent 0deg, rgba(87, 215, 255, 0.02) 230deg, rgba(87, 215, 255, 0.30) 320deg, transparent 360deg); border-radius: 50%; animation: spin 8s linear infinite; filter: blur(2px); }
.radar-core { width: 18px; height: 18px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 28px var(--cyan); }
.hero-radar-copy { position: absolute; bottom: 18px; left: 18px; display: flex; flex-direction: column; gap: 4px; }
.hero-radar-copy strong { font-size: 28px; }
.overview-cards { grid-column: span 12; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.metric-card { border-radius: 20px; padding: 18px; background: linear-gradient(180deg, rgba(16, 34, 59, 0.72), rgba(11, 23, 40, 0.94)); border: 1px solid rgba(122, 167, 255, 0.14); }
.metric-card small { color: var(--muted); display: block; margin-top: 8px; }
.command-deck { grid-column: span 7; }
.queue-deck { grid-column: span 5; }
.systems-deck, .workbench { grid-column: span 12; }
.agent-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.agent-card { padding: 18px; border-radius: 22px; background: linear-gradient(180deg, rgba(14, 31, 55, 0.92), rgba(9, 20, 37, 0.96)); }
.agent-name { margin: 4px 0 0; font-size: 19px; }
.agent-note { color: #c9daf7; line-height: 1.5; min-height: 44px; }
.agent-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.agent-meta span, .signal-row span { padding: 8px 10px; border-radius: 999px; background: rgba(255,255,255,0.05); border: 1px solid rgba(122, 167, 255, 0.12); font-size: 12px; color: var(--muted); }
.card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.card-actions .action { width: auto; min-width: 96px; }
.meter { height: 10px; margin: 14px 0; background: rgba(255,255,255,0.06); border-radius: 999px; overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--blue)); box-shadow: 0 0 18px rgba(87, 215, 255, 0.3); }
.queue-list, .system-grid, .file-tree, .terminal-lines { display: grid; gap: 12px; }
.queue-list { margin-top: 18px; }
.queue-item, .system-card, .tree-item { display: grid; gap: 10px; border-radius: 18px; padding: 16px; background: rgba(255,255,255,0.03); border: 1px solid rgba(122, 167, 255, 0.12); }
.queue-item { grid-template-columns: 52px 1fr; align-items: start; }
.queue-rank { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; font-size: 20px; font-weight: 800; background: linear-gradient(135deg, rgba(87, 215, 255, 0.16), rgba(110, 134, 255, 0.22)); }
.queue-item strong, .system-card strong { font-size: 16px; }
.queue-item p, .system-card p { margin: 4px 0 0; color: var(--muted); line-height: 1.45; }
.system-grid { margin-top: 18px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.system-card small { color: var(--muted); }
.workbench-grid { margin-top: 18px; display: grid; grid-template-columns: 340px 1fr; gap: 18px; }
.browser-shell, .editor-shell, .terminal-shell { border-radius: 22px; border: 1px solid rgba(122, 167, 255, 0.12); background: rgba(7, 16, 29, 0.86); overflow: hidden; }
.editor-stack { display: grid; gap: 18px; }
.shell-topline { padding: 12px 14px; border-bottom: 1px solid rgba(122, 167, 255, 0.12); background: rgba(255,255,255,0.03); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }
.file-tree { padding: 14px; max-height: 520px; overflow: auto; }
.tree-item { grid-template-columns: auto 1fr auto; align-items: center; }
.tree-button { width: 100%; appearance: none; text-align: left; color: inherit; cursor: pointer; }
.tree-button:hover { border-color: rgba(87, 215, 255, 0.35); background: rgba(87, 215, 255, 0.06); }
.tree-button:disabled, .action:disabled { cursor: wait; opacity: 0.7; }
.tree-item .kind { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: rgba(87, 215, 255, 0.10); }
.tree-item.active { border-color: rgba(87, 215, 255, 0.45); background: rgba(87, 215, 255, 0.08); }
.editor-preview { margin: 0; padding: 16px; min-height: 290px; max-height: 320px; overflow: auto; white-space: pre-wrap; color: #d9e8ff; }
.terminal-lines { padding: 16px; min-height: 180px; max-height: 220px; overflow: auto; }
.terminal-line { color: #9cc3ff; }
.terminal-line.warn { color: var(--yellow); }
.terminal-line.error { color: var(--red); }
.inline-status { margin-top: 14px; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(122, 167, 255, 0.12); background: rgba(255,255,255,0.03); font-size: 13px; }
.inline-status.muted { color: var(--muted); }
.inline-status.ok { color: var(--green); border-color: rgba(78, 240, 178, 0.25); background: rgba(78, 240, 178, 0.08); }
.inline-status.error { color: var(--red); border-color: rgba(255, 106, 137, 0.25); background: rgba(255, 106, 137, 0.08); }
.empty { padding: 18px; border-radius: 18px; color: var(--muted); background: rgba(255,255,255,0.03); border: 1px dashed rgba(122, 167, 255, 0.16); }
.ghost { background: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 1200px) {
  .app-shell { grid-template-columns: 1fr; }
  .overview-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .command-deck, .queue-deck { grid-column: span 12; }
  .system-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .hero, .workbench-grid, .agent-grid, .overview-cards, .compact-metrics, .system-grid { grid-template-columns: 1fr; }
  .main-grid { grid-template-columns: 1fr; }
  .panel, .sidebar { padding: 18px; }
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(122, 167, 255, 0.24); border-radius: 999px; }
