/* Crewline: neon command center. Three themes share one structure; only tokens change. */
:root, [data-theme="violeta"] {
  --bg: #0a0618; --bg-2: #140b2e;
  --panel: rgba(34, 22, 72, .52); --panel-solid: #1a1238; --raise: rgba(70, 48, 140, .35);
  --line: rgba(186, 150, 255, .16); --line-2: rgba(186, 150, 255, .32);
  --fg: #f1ecff; --muted: #b5a8d8; --faint: #8f83b5;
  --accent: #a855f7; --accent-2: #22d3ee; --on-accent: #fff;
  --me-1: #7c3aed; --me-2: #6427d6;
  --glow-a: rgba(147, 51, 234, .35); --glow-b: rgba(34, 211, 238, .14);
}
[data-theme="moca"] {
  --bg: #03100b; --bg-2: #08221a;
  --panel: rgba(12, 52, 40, .5); --panel-solid: #0c241c; --raise: rgba(20, 90, 68, .35);
  --line: rgba(120, 230, 190, .15); --line-2: rgba(120, 230, 190, .3);
  --fg: #eafaf3; --muted: #a2c7b8; --faint: #7fa597;
  --accent: #10b981; --accent-2: #e3b341; --on-accent: #02130d;
  --me-1: #0b7a57; --me-2: #08684a;
  --glow-a: rgba(16, 185, 129, .28); --glow-b: rgba(227, 179, 65, .12);
}
[data-theme="plasma"] {
  --bg: #12050c; --bg-2: #24091a;
  --panel: rgba(70, 16, 44, .5); --panel-solid: #2a0d1d; --raise: rgba(130, 30, 80, .35);
  --line: rgba(255, 160, 200, .15); --line-2: rgba(255, 160, 200, .3);
  --fg: #fff0f6; --muted: #dcaec2; --faint: #b48a9d;
  --accent: #ff3d7f; --accent-2: #ffb020; --on-accent: #fff;
  --me-1: #c21d5b; --me-2: #a3174c;
  --glow-a: rgba(255, 61, 127, .28); --glow-b: rgba(255, 176, 32, .12);
}
:root {
  --font: "Manrope", system-ui, sans-serif;
  --display: "Sora", "Manrope", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --ok: #34d399; --warn: #fbbf24;
  color-scheme: dark;
  font: 15px/1.5 var(--font);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; display: grid; grid-template-columns: 272px minmax(0, 1fr); height: 100dvh; overflow: hidden;
  color: var(--fg); caret-color: var(--accent); -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1100px 700px at 62% 30%, var(--glow-a), transparent 60%),
    radial-gradient(800px 600px at 100% 100%, var(--glow-b), transparent 60%),
    radial-gradient(600px 500px at 0% 100%, var(--glow-b), transparent 60%),
    linear-gradient(160deg, var(--bg-2), var(--bg) 55%);
}
::selection { background: var(--accent); color: var(--on-accent); }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 10px; }
.glass {
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  backdrop-filter: blur(16px) saturate(1.2); box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 20px 40px -24px rgba(0,0,0,.8);
}

/* ---------- sidebar ---------- */
aside {
  display: flex; flex-direction: column; gap: 10px; min-height: 0; min-width: 0; padding: 22px 14px 14px;
  background: rgba(0,0,0,.22); border-right: 1px solid var(--line); backdrop-filter: blur(20px);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px 12px; }
.logo { width: 46px; height: 46px; display: grid; place-items: center; color: var(--accent); filter: drop-shadow(0 0 10px var(--accent)); }
.logo svg { width: 42px; height: 42px; stroke-width: 1.6; }
.brand b { display: block; font: 700 21px/1.1 var(--display); letter-spacing: .06em; }
.brand small { color: var(--muted); font-size: 13.5px; }
.main-nav { display: grid; gap: 4px; }
.main-nav button {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; border: 1px solid transparent;
  background: none; color: var(--muted); font-weight: 600; text-align: left; transition: background .2s, color .2s;
}
.main-nav button:hover { background: var(--raise); color: var(--fg); }
.main-nav button[aria-current="true"] {
  color: var(--fg); border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 45%, transparent), color-mix(in srgb, var(--accent) 12%, transparent));
  box-shadow: 0 0 22px -4px color-mix(in srgb, var(--accent) 70%, transparent);
}
.list-head { display: flex; align-items: center; justify-content: space-between; margin: 10px 6px 0; color: var(--faint); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px;
  border: 1px solid var(--line); background: var(--raise); color: var(--muted); transition: color .2s, border-color .2s;
}
.icon-btn:hover { color: var(--fg); border-color: var(--line-2); }
.icon-btn svg { width: 17px; height: 17px; }
.search {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 11px;
  background: rgba(0,0,0,.2); border: 1px solid var(--line); color: var(--faint);
}
.search svg { width: 16px; height: 16px; }
.search:focus-within { border-color: var(--accent); }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; }
::placeholder { color: var(--faint); opacity: 1; }
#list { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -4px; padding: 0 4px; }
.row {
  display: flex; gap: 11px; align-items: center; width: 100%; padding: 8px 10px; border: 1px solid transparent;
  border-radius: 12px; background: none; text-align: left; transition: background .2s;
}
.row:hover { background: var(--raise); }
.row[aria-current="true"] { background: var(--raise); border-color: var(--line-2); }
.row .t { flex: 1; min-width: 0; }
.row .top { display: flex; align-items: baseline; gap: 8px; }
.row b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row time { margin-left: auto; font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; flex: none; }
.row small { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot { display: grid; gap: 10px; }
.me-card { display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.me-card div { flex: 1; min-width: 0; }
.me-card b { display: block; font-weight: 700; }
.me-card small { color: var(--accent-2); font-size: 12.5px; }
.themes { display: flex; gap: 8px; padding: 0 4px; }
.themes button { width: 22px; height: 22px; border-radius: 50%; padding: 0; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); transition: transform .2s var(--ease); }
.themes button:hover { transform: scale(1.12); }
.themes [data-theme-pick="violeta"] { background: conic-gradient(from 200deg, #a855f7, #22d3ee, #a855f7); }
.themes [data-theme-pick="moca"] { background: conic-gradient(from 200deg, #10b981, #e3b341, #10b981); }
.themes [data-theme-pick="plasma"] { background: conic-gradient(from 200deg, #ff3d7f, #ffb020, #ff3d7f); }
.themes [aria-checked="true"] { border-color: var(--fg); }

/* ---------- avatars: each agent wears its own neon ring ---------- */
.av {
  --c: var(--accent);
  position: relative; width: 40px; height: 40px; flex: none; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; font: 700 16px var(--display); color: #fff;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 70%, #fff 0%), color-mix(in srgb, var(--c) 35%, #05020f));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 85%, transparent), 0 0 14px -2px var(--c);
}
.av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av.sm { width: 30px; height: 30px; font-size: 12.5px; box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--c) 85%, transparent), 0 0 10px -3px var(--c); }
.av.lg { width: 46px; height: 46px; font-size: 18px; }
.av.xl { width: 58px; height: 58px; font-size: 22px; }
.av.room { --c: var(--accent-2); color: var(--fg); }
.av.room svg { width: 45%; height: 45%; }
.av.sys { --c: var(--accent); }
.av.sys svg { width: 60%; height: 60%; }
.me-av { --c: var(--accent); }
.av-wrap { position: relative; flex: none; }
.presence { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--bg); background: var(--faint); }
.presence.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
button.av-edit { padding: 0; border: 0; background: none; border-radius: 50%; position: relative; }
button.av-edit::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; opacity: 0; transition: opacity .2s;
  background: rgba(0,0,0,.55) center / 18px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3z'/%3E%3Ccircle cx='12' cy='13' r='3'/%3E%3C/svg%3E");
}
button.av-edit:hover::after, button.av-edit:focus-visible::after { opacity: 1; }
.stack { display: flex; }
.stack .av { margin-left: -9px; }
.stack .av:first-child { margin-left: 0; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--faint); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status.work { color: var(--warn); }
.status.on { color: var(--ok); }
.status.on::before, .status.work::before { box-shadow: 0 0 8px currentColor; }

/* ---------- main area ---------- */
main { min-height: 0; min-width: 0; overflow: auto; }
.back { display: none; }

/* command center */
.dash { display: grid; gap: 16px; padding: 22px 24px 28px; grid-template-columns: minmax(0, 1fr) 340px; align-content: start; }
.stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.stat > svg { width: 30px; height: 30px; color: var(--c, var(--accent)); filter: drop-shadow(0 0 8px var(--c, var(--accent))); stroke-width: 1.7; }
.stat small { display: block; color: var(--muted); font-size: 13.5px; }
.stat b { font: 600 24px/1.2 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat b.ok { color: var(--ok); }
.panel { padding: 18px 20px; min-width: 0; }
.panel h2 { margin: 0 0 14px; font: 600 18px/1.2 var(--display); display: flex; align-items: center; gap: 10px; }
.panel h2 span { color: var(--muted); font: 500 14px var(--font); }
.panel h2 svg { color: var(--accent-2); }

/* orbit: the operator in the core, agents in neon pills around it */
.orbit-wrap { display: grid; place-items: center; min-height: 420px; padding: 10px; }
.orbit { position: relative; width: var(--size); height: var(--size); }
.orbit .ring {
  position: absolute; inset: 0; border-radius: 50%; border: 1.5px dashed color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: 0 0 30px -6px var(--glow-a), inset 0 0 30px -6px var(--glow-a);
}
.orbit .ring.inner { inset: 18%; border-style: solid; border-color: color-mix(in srgb, var(--accent-2) 25%, transparent); box-shadow: none; }
.core {
  position: absolute; inset: 28%; border-radius: 50%; display: grid; place-items: center; text-align: center; align-content: center; gap: 2px;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--accent) 55%, #2a0d5c), #0c0620 72%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 80%, transparent), 0 0 60px 4px var(--glow-a), 0 0 0 10px color-mix(in srgb, var(--accent-2) 10%, transparent);
}
.core svg { width: 38px; height: 38px; color: var(--accent-2); filter: drop-shadow(0 0 10px var(--accent-2)); }
.core b { font: 700 19px/1.1 var(--display); }
.core small { color: var(--muted); font-size: 13px; }
.dot { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px var(--c); }
.node {
  position: absolute; display: flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; min-width: 170px;
  border-radius: 999px; border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  background: rgba(10, 6, 24, .78); backdrop-filter: blur(10px);
  box-shadow: 0 0 18px -6px var(--c); transform: translate(var(--tx), -50%); text-align: left; transition: transform .3s var(--ease), box-shadow .3s;
}
.node:hover { box-shadow: 0 0 26px -4px var(--c); }
.node b { display: block; font: 600 15px/1.2 var(--display); white-space: nowrap; }
.orbit-empty { color: var(--muted); text-align: center; max-width: 30ch; }

/* side lists */
.items { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(0,0,0,.2); border: 1px solid var(--line); width: 100%; text-align: left; transition: border-color .2s; }
button.item:hover { border-color: var(--line-2); }
.item .t { flex: 1; min-width: 0; }
.item b { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item small { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.count { min-width: 28px; height: 24px; padding: 0 8px; border-radius: 999px; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--fg); }

/* delegation timeline */
.timeline { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(130px, 1fr); gap: 8px; overflow-x: auto; padding: 6px 2px 4px; }
.timeline::before { content: ""; position: absolute; left: 60px; right: 60px; top: 15px; height: 2px; background: linear-gradient(90deg, var(--accent-2), var(--accent), var(--accent-2)); opacity: .7; }
.step { position: relative; display: grid; justify-items: center; text-align: center; gap: 3px; }
.step i { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--c); background: var(--bg); box-shadow: 0 0 12px var(--c); margin-bottom: 8px; }
.step time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.step b { font: 600 14.5px var(--display); }
.step small { color: var(--muted); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 18ch; }
.step .arrow { color: var(--accent-2); }

/* quick chat */
.quick-last { display: flex; gap: 12px; padding: 12px; border-radius: 14px; background: rgba(0,0,0,.22); border: 1px solid var(--line); margin-bottom: 12px; }
.quick-last b { color: var(--accent-2); font-family: var(--display); }
.quick-last time { color: var(--faint); font-size: 12.5px; margin-left: 6px; }
.quick-last p { margin: 2px 0 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.quick select { width: 100%; height: 38px; margin-bottom: 10px; padding: 0 10px; border-radius: 11px; border: 1px solid var(--line); background: var(--panel-solid); }
.pill-input { display: flex; align-items: center; gap: 8px; padding: 5px 5px 5px 16px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(0,0,0,.25); transition: border-color .2s; }
.pill-input:focus-within { border-color: var(--accent); }
.pill-input input { flex: 1; min-width: 0; border: 0; background: none; outline: none; height: 36px; }
.send { width: 38px; height: 38px; border-radius: 11px; border: 0; display: grid; place-items: center; background: none; color: var(--accent-2); transition: transform .2s var(--ease), opacity .2s; }
.send:not(:disabled):hover { transform: translateX(2px); }
.send:disabled { opacity: .35; cursor: default; }
.send svg { width: 22px; height: 22px; }
.none { color: var(--muted); margin: 4px 0; }

/* ---------- conversation ---------- */
.convo { display: grid; grid-template-rows: auto 1fr auto; height: 100%; min-height: 0; }
.head { display: flex; align-items: center; gap: 12px; padding: 14px 24px; min-height: 74px; border-bottom: 1px solid var(--line); background: rgba(0,0,0,.18); backdrop-filter: blur(14px); }
.head .who b { display: block; font: 600 17px/1.25 var(--display); }
.head .who small { color: var(--muted); font-size: 13px; }
#msgs { overflow: auto; padding: 26px max(20px, calc(50% - 420px)) 12px; display: flex; flex-direction: column; }
.day { align-self: center; margin: 18px 0 10px; padding: 3px 12px; border-radius: 999px; font-size: 12px; color: var(--muted); border: 1px solid var(--line); background: rgba(0,0,0,.2); }
.mg { display: flex; gap: 10px; align-items: flex-end; max-width: min(78%, 640px); margin-top: 14px; }
.mg .col { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mg .name { font: 600 13px var(--display); color: var(--c, var(--muted)); margin: 0 0 2px 12px; }
.bubble { padding: 9px 14px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(10px); white-space: pre-wrap; overflow-wrap: anywhere; width: fit-content; max-width: 100%; }
.mg:not(.me) .bubble { border-bottom-left-radius: 6px; }
.stamp { font-size: 11px; color: var(--faint); margin: 2px 12px 0; font-variant-numeric: tabular-nums; }
.mg.me { align-self: flex-end; }
.mg.me .col { align-items: flex-end; }
.mg.me .bubble { color: #fff; border-color: transparent; border-bottom-right-radius: 6px; background: linear-gradient(150deg, var(--me-1), var(--me-2)); box-shadow: 0 0 20px -8px var(--me-1); }
.mg.bot .bubble { border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.mention { color: var(--accent-2); font-weight: 700; }
.mg.me .mention { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.fresh { animation: arrive .5s var(--ease); }
@keyframes arrive { from { opacity: .35; transform: translateY(10px); filter: blur(5px); } }
@media (prefers-reduced-motion: reduce) { .fresh { animation: none; } }
.empty { margin: auto; max-width: 34ch; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--fg); font: 600 17px var(--display); margin-bottom: 4px; }
#composer { display: flex; align-items: flex-end; gap: 8px; width: min(860px, calc(100% - 40px)); margin: 8px auto 20px; padding: 6px 6px 6px 18px; border-radius: 18px; border: 1px solid var(--line-2); background: var(--panel); backdrop-filter: blur(14px); transition: border-color .2s; }
#composer:focus-within { border-color: var(--accent); }
#text { flex: 1; min-width: 0; resize: none; border: 0; background: none; outline: none; padding: 9px 0; max-height: 180px; line-height: 1.45; overflow: hidden; }
#text.tall { overflow-y: auto; }
#text::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* setup */
.picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 12px 0 6px 40px; max-width: 560px; }
.pick { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); font-weight: 700; text-align: left; transition: border-color .2s, transform .25s var(--ease); }
.pick:hover { border-color: var(--accent); transform: translateY(-2px); }
.pair { margin: 8px 0 0 40px; max-width: 620px; border: 1px solid var(--line-2); border-radius: 16px; background: var(--panel); overflow: hidden; }
.pair pre { margin: 0; padding: 14px 16px; max-height: 230px; overflow: auto; white-space: pre-wrap; font: 12.5px/1.6 var(--mono); color: var(--muted); }
.pair .bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--line); background: rgba(0,0,0,.2); }
.pair .bar .status { margin-left: auto; }
.ok-line { display: flex; align-items: center; gap: 12px; margin: 10px 0 0 40px; }
.ok-line .hint { color: var(--muted); font-size: 13px; }

/* buttons */
.primary, .soft { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 11px; font-weight: 700; border: 0; transition: filter .2s; }
.primary { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, var(--accent-2))); color: var(--on-accent); box-shadow: 0 0 20px -6px var(--accent); }
.primary:hover { filter: brightness(1.12); }
.soft { background: var(--raise); border: 1px solid var(--line); }
.soft:hover { border-color: var(--line-2); }
.soft.danger:hover { color: #ff9a9a; }
.primary svg, .soft svg { width: 16px; height: 16px; }
.ghost-btn { padding: 8px 14px; border-radius: 11px; border: 1px solid var(--line-2); background: none; color: var(--muted); font-weight: 600; }
.ghost-btn:hover { color: var(--fg); }

/* dialog */
dialog { width: min(420px, 92vw); padding: 22px; border-radius: 20px; border: 1px solid var(--line-2); background: var(--panel-solid); color: var(--fg); box-shadow: 0 30px 60px -20px #000, 0 0 40px -10px var(--glow-a); }
dialog::backdrop { background: rgba(0,0,0,.6); backdrop-filter: blur(4px); }
dialog h2 { margin: 0 0 16px; font: 600 20px/1.2 var(--display); }
.field { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.field input, .login input { height: 42px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(0,0,0,.25); color: var(--fg); font-size: 15px; outline: none; }
.field input:focus, .login input:focus { border-color: var(--accent); }
fieldset { margin: 14px 0 18px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 10px; }
legend { color: var(--muted); font-size: 13px; padding: 0 4px; }
fieldset label { display: flex; align-items: center; gap: 10px; }
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }
menu { display: flex; justify-content: flex-end; gap: 8px; margin: 0; padding: 0; }

/* login */
.login-page { grid-template-columns: 1fr; place-items: center; }
.login { width: min(380px, 90vw); display: grid; gap: 14px; padding: 30px; }
.login h1 { display: flex; align-items: center; gap: 12px; margin: 0; font: 700 28px/1 var(--display); letter-spacing: .05em; }
.login p { margin: 0 0 6px; color: var(--muted); }
.login .primary { justify-content: center; height: 46px; font-size: 15px; }
#err { color: #ff9a9a; min-height: 1.5em; margin: 0; font-size: 14px; }

/* medium screens: orbit and lists stack */
@media (max-width: 1180px) {
  .dash { grid-template-columns: minmax(0, 1fr); }
}
/* phones: one screen at a time */
@media (max-width: 760px) {
  body { grid-template-columns: minmax(0, 1fr); }
  body[data-view="chat"] aside, body:not([data-view="chat"]) main { display: none; }
  aside { border-right: 0; padding: 16px 12px max(12px, env(safe-area-inset-bottom)); }
  .back { display: grid; margin-left: -6px; }
  .dash { padding: 14px 12px 20px; gap: 12px; }
  .dash-top { display: flex; align-items: center; gap: 10px; }
  .orbit-wrap { min-height: 0; }
  /* the circle needs width; on phones agents become a list around the core */
  .orbit { width: 100% !important; height: auto !important; display: grid; gap: 10px; }
  .orbit .ring, .orbit .dot { display: none; }
  .core { position: relative; inset: auto; width: 170px; height: 170px; margin: 6px auto 10px; }
  .node { position: relative; left: auto !important; top: auto !important; transform: none; width: 100%; }
  .head { padding: 10px 14px; min-height: 62px; }
  #msgs { padding: 16px 12px 8px; }
  .mg { max-width: 88%; }
  .picks, .pair, .ok-line { margin-left: 0; }
  #composer { width: calc(100% - 20px); margin: 6px auto max(10px, env(safe-area-inset-bottom)); }
  #text { font-size: 16px; }
}
@media (min-width: 761px) { .dash-top { display: none; } }

[hidden] { display: none !important; }
@media (max-width: 760px) { .stats { grid-template-columns: 1fr 1fr; gap: 10px; } .stat { padding: 12px 14px; gap: 10px; } .stat > svg { width: 24px; height: 24px; } .stat b { font-size: 20px; } .stat:last-child { grid-column: 1 / -1; } .node { flex-direction: row !important; text-align: left !important; } }
@media (max-width: 760px) { .panel h2 span { display: none; } }
