/* ============================================================
   OpenStream — multi-stream thinking UI for OpenClaw
   Dark, glassmorphism, motion = life, stillness = done.
   ============================================================ */

:root {
  --bg: #07090f;
  --bg-soft: #0b0e16;
  --panel: rgba(17, 22, 34, 0.66);
  --panel-solid: #10141f;
  --panel-2: rgba(24, 30, 46, 0.72);
  --line: rgba(148, 163, 184, 0.14);
  --line-strong: rgba(148, 163, 184, 0.28);
  --text: #e5e9f2;
  --text-dim: #8b94a7;
  --text-faint: #5b6478;

  --work: #34d399;        /* alive green */
  --work-2: #22d3ee;      /* cyan accent */
  --work-3: #818cf8;      /* indigo accent */
  --done: #64748b;        /* settled slate */
  --await: #f59e0b;       /* needs you amber */
  --err: #f87171;         /* error red */
  --info: #60a5fa;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px -18px rgba(0, 0, 0, 0.75);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  font-size: 14.5px;
  line-height: 1.5;
}

/* ---------- background ---------- */
.bg { position: fixed; inset: 0; z-index: -2; overflow: hidden; background:
  radial-gradient(1200px 700px at 75% -10%, rgba(99, 102, 241, 0.10), transparent 60%),
  radial-gradient(900px 600px at -10% 110%, rgba(52, 211, 153, 0.07), transparent 55%),
  var(--bg); }
.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.045) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 30%, transparent 75%);
}
.bg-glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5; }
.bg-glow-1 { width: 420px; height: 420px; left: -120px; top: 30%; background: rgba(52, 211, 153, 0.10); }
.bg-glow-2 { width: 460px; height: 460px; right: -140px; top: -80px; background: rgba(99, 102, 241, 0.12); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 18px;
  background: rgba(7, 9, 15, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark { position: relative; width: 30px; height: 30px; flex: none; }
.bm { position: absolute; border-radius: 50%; }
.bm-a { width: 12px; height: 12px; left: 1px; top: 9px; background: var(--work); box-shadow: 0 0 12px rgba(52, 211, 153, 0.8); }
.bm-b { width: 9px; height: 9px; right: 1px; top: 2px; background: var(--work-3); box-shadow: 0 0 10px rgba(129, 140, 248, 0.8); }
.bm-c { width: 9px; height: 9px; right: 1px; bottom: 2px; background: var(--await); box-shadow: 0 0 10px rgba(245, 158, 11, 0.7); }
.brand-name { font-size: 15.5px; font-weight: 700; letter-spacing: 0.2px; }
.brand-sub { font-size: 10.5px; color: var(--text-dim); letter-spacing: 0.4px; text-transform: uppercase; margin-top: -1px; }

.conn { display: flex; align-items: center; gap: 8px; margin-left: 4px;
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--panel); font-size: 12px; color: var(--text-dim); }
.conn-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-faint); flex: none; }
.conn[data-state="on"] .conn-dot { background: var(--work); box-shadow: 0 0 10px rgba(52, 211, 153, 0.9); animation: pulseDot 2s ease-in-out infinite; }
.conn[data-state="connecting"] .conn-dot { background: var(--await); box-shadow: 0 0 10px rgba(245, 158, 11, 0.9); animation: pulseDot 0.9s ease-in-out infinite; }
.conn[data-state="err"] .conn-dot { background: var(--err); box-shadow: 0 0 10px rgba(248, 113, 113, 0.9); }
@keyframes pulseDot { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.72); opacity: 0.6; } }

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font: inherit; font-size: 13px; font-weight: 600;
  color: var(--text); background: var(--panel);
  border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 7px 14px; cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.06s, box-shadow 0.18s;
  white-space: nowrap;
}
.btn:hover { border-color: rgba(148, 163, 184, 0.5); background: var(--panel-2); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.16), rgba(99, 102, 241, 0.16));
  border-color: rgba(52, 211, 153, 0.45);
  box-shadow: 0 0 18px -6px rgba(52, 211, 153, 0.5);
}
.btn-primary:hover { border-color: rgba(52, 211, 153, 0.8); box-shadow: 0 0 22px -4px rgba(52, 211, 153, 0.6); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn-ghost:hover { background: var(--panel); color: var(--text); }
.icon-only { padding: 7px 9px; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 11px 22px; font-size: 14.5px; border-radius: 12px; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn-ico { font-size: 14px; line-height: 1; }

/* ---------- overview rail ---------- */
.overview {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 14, 22, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky; top: 51px; z-index: 35;
}
.overview-label { font-size: 10.5px; font-weight: 700; letter-spacing: 1.4px; color: var(--text-faint); flex: none; }
.overview-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px; scrollbar-width: thin; }
.ochip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 11px 4px 7px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel);
  font-size: 12px; color: var(--text-dim); cursor: pointer; flex: none;
  transition: border-color 0.18s, background 0.18s, transform 0.06s;
  max-width: 180px;
}
.ochip:hover { border-color: var(--line-strong); background: var(--panel-2); }
.ochip .ochip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ochip-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.ochip[data-st="working"] .ochip-dot { background: var(--work); animation: pulseDot 1.1s ease-in-out infinite; box-shadow: 0 0 8px rgba(52, 211, 153, 0.9); }
.ochip[data-st="done"] .ochip-dot { background: var(--done); }
.ochip[data-st="awaiting"] .ochip-dot { background: var(--await); box-shadow: 0 0 8px rgba(245, 158, 11, 0.7); }
.ochip[data-st="error"] .ochip-dot { background: var(--err); }
.ochip[data-st="offline"] .ochip-dot { background: var(--text-faint); }
.ochip[data-st="working"] { color: var(--work); border-color: rgba(52, 211, 153, 0.4); }
.ochip[data-st="awaiting"] { color: var(--await); border-color: rgba(245, 158, 11, 0.35); }
.ochip[data-st="error"] { color: var(--err); border-color: rgba(248, 113, 113, 0.35); }

/* ---------- board ---------- */
.board {
  display: flex; flex-wrap: wrap; gap: 18px;
  padding: 22px 18px 90px;
  align-items: flex-start;
  max-width: 1600px; margin: 0 auto;
}

/* ---------- stream cards ---------- */
.stream {
  position: relative;
  width: 300px; min-height: 168px;
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color 0.55s ease, box-shadow 0.55s ease, filter 0.55s ease, transform 0.18s ease, opacity 0.55s ease;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.stream:hover { transform: translateY(-3px); }
.stream:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }

/* --- state: WORKING — alive, animated --- */
.stream[data-st="working"] {
  border-color: transparent;
  background:
    linear-gradient(var(--panel), var(--panel)) padding-box,
    linear-gradient(120deg, var(--work), var(--work-2), var(--work-3), var(--work)) border-box;
  animation: breathe 2.6s ease-in-out infinite;
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.25), 0 0 34px -6px rgba(52, 211, 153, 0.55), var(--shadow);
}
.stream[data-st="working"]::before {  /* flowing edge light */
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px;
  background: conic-gradient(from var(--ang, 0deg), transparent 0deg, rgba(52, 211, 153, 0.9) 60deg, rgba(34, 211, 238, 0.9) 140deg, transparent 200deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spinEdge 3.2s linear infinite;
  opacity: 0.85; pointer-events: none;
}
@property --ang { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes spinEdge { to { --ang: 360deg; } }
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.22), 0 0 26px -8px rgba(52, 211, 153, 0.5), var(--shadow); }
  50%      { box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.45), 0 0 44px -6px rgba(52, 211, 153, 0.75), var(--shadow); }
}

/* --- state: DONE — still, dimmed, settled --- */
.stream[data-st="done"] {
  border-color: var(--line);
  filter: saturate(0.78);
  opacity: 0.92;
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.7);
}
.stream[data-st="done"] .card-head { color: var(--text-dim); }

/* --- state: AWAITING — dashed, amber --- */
.stream[data-st="awaiting"] {
  border: 1.5px dashed rgba(245, 158, 11, 0.55);
  background: linear-gradient(rgba(245, 158, 11, 0.045), rgba(245, 158, 11, 0.045)) padding-box, var(--panel);
}

/* --- state: ERROR --- */
.stream[data-st="error"] {
  border-color: rgba(248, 113, 113, 0.55);
  box-shadow: 0 0 26px -10px rgba(248, 113, 113, 0.5);
}

/* --- state: OFFLINE (gateway dropped) --- */
.stream[data-st="offline"] { border-style: dotted; opacity: 0.6; filter: grayscale(0.6); }

.stream.dimmed { opacity: 0.42; filter: grayscale(0.5) brightness(0.8); }

.card-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px 6px;
  font-size: 12.5px; font-weight: 650; color: var(--text);
}
.card-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.status-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase;
  padding: 2.5px 8px; border-radius: 999px; flex: none;
}
.status-chip .sc-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.stream[data-st="working"] .status-chip { color: var(--work); background: rgba(52, 211, 153, 0.12); border: 1px solid rgba(52, 211, 153, 0.3); }
.stream[data-st="working"] .status-chip .sc-dot { animation: pulseDot 1.1s ease-in-out infinite; }
.stream[data-st="done"] .status-chip { color: var(--done); background: rgba(100, 116, 139, 0.14); border: 1px solid rgba(100, 116, 139, 0.3); }
.stream[data-st="awaiting"] .status-chip { color: var(--await); background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.32); }
.stream[data-st="error"] .status-chip { color: var(--err); background: rgba(248, 113, 113, 0.12); border: 1px solid rgba(248, 113, 113, 0.32); }
.stream[data-st="offline"] .status-chip { color: var(--text-dim); background: rgba(148, 163, 184, 0.1); border: 1px solid var(--line); }

.card-activity { display: flex; flex-wrap: wrap; gap: 5px; padding: 2px 14px 4px; min-height: 8px; }
.tool-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; color: var(--text-dim);
  background: rgba(148, 163, 184, 0.09); border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 8px;
  animation: chipIn 0.25s ease;
}
.tool-chip.running { color: var(--work-2); border-color: rgba(34, 211, 238, 0.35); background: rgba(34, 211, 238, 0.08); }
.tool-chip .spin { display: inline-block; animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes chipIn { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: scale(1); } }

.card-preview {
  flex: 1; padding: 4px 14px 12px;
  font-size: 12.5px; color: var(--text-dim);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 62px;
}
.card-preview .who { color: var(--text-faint); font-weight: 700; margin-right: 6px; }
.stream[data-st="working"] .card-preview { color: var(--text); }
.thinking-ripple {
  display: inline-flex; gap: 3px; align-items: center; margin-left: 4px;
}
.thinking-ripple i {
  width: 4px; height: 4px; border-radius: 50%; background: var(--work-2);
  animation: ripple 1.2s ease-in-out infinite;
}
.thinking-ripple i:nth-child(2) { animation-delay: 0.15s; }
.thinking-ripple i:nth-child(3) { animation-delay: 0.3s; }
@keyframes ripple { 0%, 100% { transform: translateY(0); opacity: 0.4; } 50% { transform: translateY(-4px); opacity: 1; } }

.card-foot {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  border-top: 1px solid var(--line);
  font-size: 10.5px; color: var(--text-faint);
}
.card-time { margin-left: auto; }
.card-actions { display: flex; gap: 4px; }
.card-actions button {
  background: none; border: none; color: var(--text-faint); cursor: pointer;
  font-size: 12px; padding: 2px 6px; border-radius: 6px;
}
.card-actions button:hover { color: var(--text); background: rgba(148, 163, 184, 0.12); }
.abort-btn:hover { color: var(--err) !important; }

/* ---------- empty state ---------- */
.no-streams { display: flex; align-items: center; justify-content: center; min-height: 62vh; padding: 30px; text-align: center; }
.no-streams-inner { max-width: 640px; }
.no-streams-mark { position: relative; width: 64px; height: 64px; margin: 0 auto 18px; transform: scale(1.6); }
.no-streams h1 { font-size: 26px; margin: 0 0 10px; font-weight: 750; letter-spacing: -0.3px; }
.no-streams p { color: var(--text-dim); font-size: 14.5px; margin: 0 0 26px; }
.no-streams p em { color: var(--work); font-style: normal; }
.no-streams-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.no-streams-hint { margin-top: 34px; color: var(--text-faint); font-size: 12px; }
kbd {
  font-family: var(--mono); font-size: 11px;
  background: var(--panel-2); border: 1px solid var(--line-strong); border-bottom-width: 2px;
  border-radius: 6px; padding: 1px 6px; color: var(--text-dim);
}

/* ---------- demo banner ---------- */
.demo-banner {
  display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
  padding: 8px 14px; font-size: 12.5px; color: var(--await);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.08), rgba(99, 102, 241, 0.08), rgba(245, 158, 11, 0.08));
  border-bottom: 1px solid rgba(245, 158, 11, 0.3);
}

/* ---------- detail view ---------- */
.detail-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(4, 6, 10, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.detail {
  position: fixed; inset: 0; z-index: 61;
  margin: auto;
  width: min(880px, calc(100vw - 32px));
  height: min(760px, calc(100vh - 48px));
  background: var(--panel-solid);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  box-shadow: 0 40px 120px -20px rgba(0, 0, 0, 0.9);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: detailIn 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
@keyframes detailIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }

.detail[data-st="working"] { border-color: rgba(52, 211, 153, 0.45); box-shadow: 0 0 60px -12px rgba(52, 211, 153, 0.35), 0 40px 120px -20px rgba(0, 0, 0, 0.9); }

.detail-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(16, 20, 31, 0.9);
}
.detail-title { font-size: 15px; font-weight: 700; }
.detail-sub { font-size: 11px; color: var(--text-faint); font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; }
.detail-head .spacer { flex: 1; }

.detail-tools { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 18px 0; min-height: 8px; }

.detail-chat {
  flex: 1; overflow-y: auto; padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
  scroll-behavior: smooth;
}
.msg { max-width: 86%; }
.msg-row { display: flex; }
.msg-row.user { justify-content: flex-end; }
.msg-row.assistant { justify-content: flex-start; }
.msg-bubble {
  padding: 10px 14px; border-radius: 14px;
  font-size: 13.8px; line-height: 1.6;
  white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere;
}
.msg-row.user .msg-bubble {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.28), rgba(99, 102, 241, 0.16));
  border: 1px solid rgba(129, 140, 248, 0.35);
  border-bottom-right-radius: 5px;
}
.msg-row.assistant .msg-bubble {
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--line);
  border-bottom-left-radius: 5px;
}
.msg-meta { font-size: 10px; color: var(--text-faint); margin-top: 5px; display: flex; gap: 8px; align-items: center; }
.msg-thinking {
  font-size: 12px; color: var(--text-faint); font-style: italic;
  background: rgba(148, 163, 184, 0.05);
  border-left: 2px solid var(--text-faint);
  padding: 6px 10px; margin-bottom: 8px; border-radius: 0 8px 8px 0;
  white-space: pre-wrap; word-break: break-word;
}
.streaming-cursor {
  display: inline-block; width: 7px; height: 15px; margin-left: 2px;
  background: var(--work-2); vertical-align: -2px;
  animation: blink 0.8s step-end infinite; border-radius: 2px;
}
@keyframes blink { 50% { opacity: 0; } }

.detail-input {
  display: flex; gap: 10px; align-items: flex-end;
  padding: 14px 18px 16px;
  border-top: 1px solid var(--line);
  background: rgba(16, 20, 31, 0.92);
}
.detail-input textarea {
  flex: 1; resize: none; min-height: 44px; max-height: 160px;
  font: inherit; font-size: 13.8px; color: var(--text);
  background: rgba(7, 9, 15, 0.8);
  border: 1px solid var(--line-strong); border-radius: 12px;
  padding: 11px 14px; outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.detail-input textarea:focus { border-color: rgba(52, 211, 153, 0.5); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12); }
.detail-input .send {
  height: 44px; padding: 0 18px;
}

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(4, 6, 10, 0.7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fadeIn 0.18s ease; }
.modal {
  position: fixed; inset: 0; z-index: 71; margin: auto;
  width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  background: var(--panel-solid);
  border: 1px solid var(--line-strong); border-radius: 18px;
  box-shadow: 0 40px 120px -20px rgba(0, 0, 0, 0.9);
  display: flex; flex-direction: column;
  animation: detailIn 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.08);
  overflow: hidden;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 12px; }
.modal-head h2 { margin: 0; font-size: 16px; font-weight: 700; }
.modal-body { padding: 4px 18px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; align-items: center; gap: 10px; padding: 14px 18px 16px; border-top: 1px solid var(--line); }
.spacer { flex: 1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12px; font-weight: 650; color: var(--text-dim); }
.field-label em { color: var(--text-faint); font-weight: 500; }
.field input {
  font: inherit; font-size: 13.5px; color: var(--text);
  background: rgba(7, 9, 15, 0.8);
  border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 9px 12px; outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.field input:focus { border-color: rgba(99, 102, 241, 0.6); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12); }
.field-hint { font-size: 11.5px; color: var(--text-faint); }
.field-hint code { font-family: var(--mono); color: var(--text-dim); background: rgba(148, 163, 184, 0.08); padding: 1px 5px; border-radius: 5px; }
.conn-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-dim); }
.conn-row .conn-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-faint); }
.conn-row[data-state="on"] .conn-dot { background: var(--work); box-shadow: 0 0 10px rgba(52, 211, 153, 0.9); }
.conn-row[data-state="connecting"] .conn-dot { background: var(--await); box-shadow: 0 0 10px rgba(245, 158, 11, 0.9); animation: pulseDot 0.9s infinite; }
.conn-row[data-state="err"] .conn-dot { background: var(--err); }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--panel-solid);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--info);
  border-radius: 10px; padding: 10px 14px;
  font-size: 12.5px; color: var(--text);
  box-shadow: var(--shadow);
  animation: toastIn 0.22s ease;
  max-width: 340px;
}
.toast.err { border-left-color: var(--err); }
.toast.ok { border-left-color: var(--work); }
.toast.warn { border-left-color: var(--await); }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.toast.out { opacity: 0; transform: translateX(16px); transition: all 0.3s; }

/* ---------- scrollbars ---------- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.18); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.32); border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .brand-sub { display: none; }
  .overview { top: 50px; }
  .board { padding: 14px 12px 80px; gap: 12px; }
  .stream { width: calc(50% - 8px); min-height: 150px; }
  .detail { width: 100vw; height: 100dvh; border-radius: 0; border: none; }
  .no-streams h1 { font-size: 21px; }
}
@media (max-width: 480px) {
  .stream { width: 100%; }
  .btn-lg { width: 100%; }
  .topbar { padding: 9px 12px; }
  .overview { padding: 7px 12px; }
}
