/* ScreenShare: a control room for a small group. Graphite surfaces separated
   by hairlines, warm off-white text, and colour only where it means
   something: red is live, green is talking (and a path that goes direct),
   amber is "you were mentioned / new since you looked". Numbers are mono. */

:root {
  --bg-0: #0a0b0c;   /* rail, console */
  --bg-1: #101113;   /* bars, floating layers */
  --bg-2: #141518;   /* the room */
  --bg-3: #1a1c1f;   /* raised: tiles, chips */
  --bg-4: #222428;   /* hover */
  --bg-5: #2a2d32;   /* pressed / selected */
  --line: #24262a;
  --line-2: #303338;
  --text: #ebe8e3;
  --text-2: #a7a59f;
  --text-3: #6e6d69;
  --live: #ff4a2e;
  --live-2: rgba(255, 74, 46, 0.1);
  --talk: #44d27d;
  --warn: #e7ae4c;
  --bad: #ff6a55;
  --link: #8fc3e6;
  --primary-bg: #ebe8e3;
  --primary-fg: #111214;
  --radius: 10px;
  --radius-sm: 7px;
  --pop: 0 18px 44px rgba(0, 0, 0, 0.55);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "SF Pro Text", Roboto, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "SF Pro Display", sans-serif;
  --mono: "Cascadia Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg-2);
  color: var(--text);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  user-select: none;
}
body.resizing { cursor: col-resize; }
body.resizing * { user-select: none !important; }
input, textarea, .mono, .codebox span, .msg-text { user-select: text; }
#root { height: 100%; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0; }
.mono { font-family: var(--mono); font-size: 0.92em; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.muted { color: var(--text-2); }
.small { font-size: 12.5px; }
.error, .bad { color: var(--bad); }
.warn { color: var(--warn); }
.spacer { flex: 1; }
.row { display: flex; gap: 8px; align-items: center; }
.lead { color: var(--text-2); line-height: 1.55; }
b { font-weight: 600; color: var(--text); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--bg-5); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #3a3d43; background-clip: content-box; border: 3px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---- buttons ---- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--bg-3); color: var(--text);
  font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, color 0.12s, transform 0.06s;
}
.btn:hover:not(:disabled) { background: var(--bg-4); border-color: #3a3d43; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary { background: var(--primary-bg); color: var(--primary-fg); border-color: var(--primary-bg); }
.btn.primary:hover:not(:disabled) { background: #fff; border-color: #fff; }
.btn.danger { color: var(--bad); border-color: rgba(255, 106, 85, 0.35); background: transparent; }
.btn.danger:hover:not(:disabled) { background: rgba(255, 106, 85, 0.1); border-color: rgba(255, 106, 85, 0.6); }
.btn.danger.solid { background: #c8402c; border-color: #c8402c; color: #fff; }
.btn.danger.solid:hover:not(:disabled) { background: #dc4a34; border-color: #dc4a34; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.07); }
.btn.ghost.on { background: rgba(255, 255, 255, 0.12); }
.btn.small { height: 28px; padding: 0 10px; font-size: 13px; }
.btn.block { width: 100%; }
.btn .ic { flex: none; }

.ibtn {
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-2); cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.ibtn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.07); color: var(--text); }
.ibtn.on { color: var(--text); background: rgba(255, 255, 255, 0.1); }
.ibtn.danger { color: var(--bad); }
.ibtn.danger:hover:not(:disabled) { background: rgba(255, 106, 85, 0.12); color: var(--bad); }
.ibtn:disabled { opacity: 0.4; cursor: default; }

/* ---- form controls ---- */

input:not([type]), input[type=text], select {
  width: 100%; height: 36px; padding: 0 11px;
  font: inherit; color: var(--text);
  background: var(--bg-0); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  outline: none; transition: border-color 0.12s, box-shadow 0.12s;
}
input:not([type]):focus, select:focus { border-color: #4a4d53; box-shadow: 0 0 0 3px rgba(235, 232, 227, 0.07); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
select { appearance: none; padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a7a59f' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
select option { background: var(--bg-3); }

input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; background: var(--bg-5); border-radius: 4px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: var(--text); border: 0; box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.35); }
input[type=range]::-moz-range-track { height: 4px; background: var(--bg-5); border-radius: 4px; }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--text); border: 0; }

.field { display: grid; gap: 7px; }
.field > span { display: flex; align-items: baseline; gap: 8px; color: var(--text-2); font-size: 13px; }
.field > span b { margin-left: auto; font-weight: 500; color: var(--text); }
.form { display: grid; gap: 20px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.label {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3);
}
.label span { color: var(--text-3); font-family: var(--mono); letter-spacing: 0; }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-0); border: 1px solid var(--line); border-radius: 9px; justify-self: start; }
.seg button {
  height: 30px; padding: 0 14px; border: 0; border-radius: 6px;
  background: transparent; color: var(--text-2); cursor: pointer; font-weight: 500;
  transition: background 0.12s, color 0.12s;
}
.seg button:hover:not(:disabled) { color: var(--text); }
.seg button.on { background: var(--bg-4); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.seg button:disabled { opacity: 0.35; cursor: default; }
.seg.compact button { height: 26px; padding: 0 9px; font-size: 12.5px; }

.toggle { display: flex; align-items: center; gap: 16px; cursor: pointer; }
.toggle-text { flex: 1; display: grid; gap: 2px; }
.toggle-text small { color: var(--text-2); font-size: 12.5px; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.switch { position: relative; flex: none; width: 36px; height: 20px; border-radius: 20px; background: var(--bg-5); transition: background 0.15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-2); transition: transform 0.15s, background 0.15s; }
.toggle input:checked + .switch { background: var(--text); }
.toggle input:checked + .switch::after { transform: translateX(16px); background: var(--bg-1); }
.toggle input:focus-visible + .switch { outline: 2px solid var(--text); outline-offset: 2px; }

.chip {
  display: inline-flex; align-items: center; flex: none; height: 18px; padding: 0 6px;
  border-radius: 5px; border: 1px solid var(--line-2);
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-2);
}
.chip.live { color: var(--live); border-color: rgba(255, 74, 46, 0.35); }
.chip.accent { color: var(--text); border-color: #4a4d53; }
.chip.good { color: var(--talk); border-color: rgba(68, 210, 125, 0.35); }
.chip.warn { color: var(--warn); border-color: rgba(231, 174, 76, 0.35); }

.badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--text); color: var(--bg-0); font: 700 11px var(--font); line-height: 1;
}
.badge.dot { min-width: 8px; width: 8px; height: 8px; padding: 0; background: var(--talk); margin-left: 8px; }

.kbd { display: inline-flex; gap: 3px; flex: none; }
kbd {
  display: inline-block; min-width: 20px; padding: 0 5px; text-align: center;
  font: 11.5px/18px var(--mono); color: var(--text-2); background: var(--bg-4);
  border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px;
}

.ok-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--talk); }
.spinner { display: inline-block; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--text); animation: spin 0.8s linear infinite; }
.spinner.small { width: 14px; height: 14px; border-width: 1.5px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px) scale(0.99); } }

/* ---- avatars ---- */

.av {
  --s: 32px;
  flex: none; display: inline-grid; place-items: center;
  width: var(--s); height: var(--s); border-radius: 50%;
  background: hsl(var(--h) 26% 21%); color: hsl(var(--h) 62% 78%);
  font-size: calc(var(--s) * 0.38); font-weight: 600; letter-spacing: 0.01em;
  transition: box-shadow 0.1s;
}
.av.ring { box-shadow: 0 0 0 2px var(--bg-0), 0 0 0 4px var(--talk); }
.av.dim { opacity: 0.5; }

/* ---- the frame ---- */

.boot { height: 100%; display: grid; place-items: center; color: var(--text-3); }
.app { display: grid; grid-template-columns: 64px minmax(0, 1fr); height: 100%; }

/* group strip */
.rail {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 12px 0; background: var(--bg-0); border-right: 1px solid var(--line); min-height: 0;
}
.rail-mark { color: var(--text); padding: 4px 0 6px; border-bottom: 1px solid var(--line); width: 36px; display: grid; place-items: center; }
.rail-groups { display: flex; flex-direction: column; align-items: center; gap: 8px; overflow-y: auto; padding: 2px 0 8px; scrollbar-width: none; }
.rail-groups::-webkit-scrollbar { display: none; }
.rail-group {
  position: relative; flex: none;
  width: 42px; height: 42px; border: 0; border-radius: 12px;
  background: hsl(var(--h) 18% 15%); color: hsl(var(--h) 55% 76%);
  font-weight: 600; font-size: 14.5px; cursor: pointer;
  transition: border-radius 0.15s, background 0.15s;
}
.rail-group:hover { border-radius: 10px; background: hsl(var(--h) 22% 19%); }
.rail-group::before {
  content: ""; position: absolute; left: -11px; top: 50%; width: 4px; height: 0;
  background: var(--text); border-radius: 0 4px 4px 0; transform: translateY(-50%); transition: height 0.15s;
}
.rail-group:hover::before { height: 14px; }
.rail-group.unread::before { height: 8px; }
.rail-group.on::before { height: 30px; }
.rail-group.on { border-radius: 10px; box-shadow: inset 0 0 0 1px hsl(var(--h) 30% 32%); }
.rail-act { position: absolute; right: -4px; bottom: -4px; display: flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--bg-0); }
.rail-dot { width: 8px; height: 8px; border-radius: 50%; }
.rail-dot.live { background: var(--live); }
.rail-dot.voice { background: var(--talk); }
.rail-group.add { background: transparent; color: var(--text-3); box-shadow: inset 0 0 0 1px var(--line-2); display: grid; place-items: center; }
.rail-group.add:hover { color: var(--text); box-shadow: inset 0 0 0 1px #4a4d53; }
.rail-group.add::before { display: none; }

/* the room */
.room { display: grid; grid-template-rows: 52px minmax(0, 1fr) auto; min-width: 0; min-height: 0; background: var(--bg-2); }
.room-body { display: flex; min-height: 0; min-width: 0; }
.room.has-stage .room-body { flex-direction: row; }
.room.no-stage .room-body { flex-direction: column; }

/* top bar */
.topbar { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 0 12px 0 10px; border-bottom: 1px solid var(--line); background: var(--bg-1); }
.group-title {
  display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 8px 0 10px; min-width: 0; max-width: 280px;
  border: 0; border-radius: 8px; background: transparent; color: var(--text); cursor: pointer;
}
.group-title strong { font: 600 15px var(--font-display); letter-spacing: -0.005em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-title .ic { flex: none; color: var(--text-3); }
.group-title:hover { background: rgba(255, 255, 255, 0.05); }
.presence { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px 0 6px; border: 0; border-radius: 16px; background: transparent; color: var(--text-2); cursor: pointer; }
.presence:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.presence-stack { display: flex; }
.presence-stack .av { box-shadow: 0 0 0 2px var(--bg-1); }
.presence-stack .av + .av { margin-left: -7px; }
.presence-count { font-size: 12px; }
.presence-count span { font-family: var(--font); }
.conn { color: var(--warn); font-size: 12.5px; padding: 0 6px; }
.view-tabs { display: none; }
.view-tabs .badge { margin-left: 4px; height: 16px; min-width: 16px; font-size: 10px; }
.palette-trigger {
  display: flex; align-items: center; gap: 8px; height: 32px; min-width: 230px; padding: 0 6px 0 10px;
  border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg-0); color: var(--text-3); cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}
.palette-trigger span { flex: 1; text-align: left; font-size: 13px; white-space: nowrap; }
.palette-trigger:hover { border-color: #3a3d43; color: var(--text-2); }
.pill { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 16px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.pill.update { border: 1px solid rgba(68, 210, 125, 0.4); background: rgba(68, 210, 125, 0.08); color: var(--talk); cursor: pointer; }
.pill.update .muted { color: rgba(68, 210, 125, 0.65); font-weight: 400; }
.pill.update:hover:not(.busy) { background: rgba(68, 210, 125, 0.14); }
.pill.update.busy { cursor: default; }
.progress-ring { width: 14px; height: 14px; border-radius: 50%; background: conic-gradient(var(--talk) calc(var(--p) * 1%), var(--bg-5) 0); }
.topbar .btn.primary { height: 32px; }

/* the console */
.dock { display: flex; align-items: center; gap: 14px; min-width: 0; height: 60px; padding: 0 12px 0 14px; border-top: 1px solid var(--line); background: var(--bg-0); }
.dock-me { display: flex; align-items: center; gap: 10px; min-width: 0; width: 196px; flex: none; }
.dock-me-text { display: grid; min-width: 0; line-height: 1.25; }
.dock-me-text strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-me-text small { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-voice { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; height: 38px; padding-left: 14px; border-left: 1px solid var(--line); }
.dock-label { display: inline-flex; align-items: center; gap: 6px; flex: none; color: var(--text-3); font: 600 11px var(--font); letter-spacing: 0.07em; text-transform: uppercase; }
.vchips { list-style: none; display: flex; align-items: center; gap: 4px; margin: 0; padding: 4px 0; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.vchips::-webkit-scrollbar { display: none; }
.vchip { position: relative; flex: none; }
.vchip-main {
  display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px 0 4px;
  border: 1px solid var(--line); border-radius: 17px; background: var(--bg-2); color: var(--text-2); cursor: pointer;
  transition: border-color 0.1s, color 0.1s;
}
.vchip-main:hover:not(:disabled) { border-color: var(--line-2); color: var(--text); }
.vchip.talking .vchip-main { color: var(--text); border-color: rgba(68, 210, 125, 0.5); }
.vchip.idle .vchip-main { cursor: default; background: transparent; }
.vchip.pending { opacity: 0.55; }
.vchip-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.vchip-tag { display: grid; color: var(--bad); }
.vchip-tag.bad { font: 700 12px var(--font); }
.vchip-pop {
  position: fixed; transform: translateY(calc(-100% - 50px)); width: 230px; display: grid; gap: 8px; padding: 10px 12px;
  background: var(--bg-1); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--pop); z-index: 25; animation: rise 0.1s ease-out;
}
.vchip-pop-head { display: flex; align-items: baseline; gap: 8px; justify-content: space-between; }
.vchip-pop-head .muted { font-size: 11.5px; }
.vol-row { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 12px; }
.vol-row input { flex: 1; }
.dock-empty { color: var(--text-3); font-size: 12.5px; padding: 0 4px; white-space: nowrap; }
.voice-join { flex: none; }
.live-pill { display: flex; align-items: center; gap: 10px; flex: none; height: 42px; padding: 0 6px 0 8px; border: 1px solid rgba(255, 74, 46, 0.35); border-radius: 10px; background: var(--live-2); }
.live-pill.starting { border-color: var(--line-2); background: var(--bg-2); }
.live-pill.starting .tally { background: var(--bg-5); }
.live-pill.starting .tally::before { animation: blink 1s steps(2) infinite; }
.live-pill-text { display: grid; line-height: 1.2; min-width: 0; max-width: 220px; }
.live-pill-text strong { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-pill-text span { font-size: 11.5px; color: var(--text-2); }
.dock-controls { display: flex; align-items: center; gap: 2px; flex: none; }
.dock-controls .ibtn { width: 36px; height: 36px; }
.dock-controls .ibtn.hang { color: var(--bad); }

/* tally: the one bright red in the app */
.tally {
  display: inline-flex; align-items: center; gap: 6px; flex: none; height: 20px; padding: 0 7px 0 6px;
  border-radius: 5px; background: var(--live); color: #fff;
  font: 700 10.5px var(--font); letter-spacing: 0.09em;
}
.tally::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; }

/* ---- the stage ---- */

.stage-wall { flex: 1; min-width: 0; overflow-y: auto; padding: 18px; }
.wall { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-content: start; }
.tile {
  display: flex; flex-direction: column; min-width: 0; max-width: 760px;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  transition: border-color 0.15s;
}
.tile:hover { border-color: var(--line-2); }
.tile.watching, .tile.own { border-color: #42454b; }
.tile-screen {
  position: relative; aspect-ratio: 16 / 9; width: 100%; display: grid; place-items: center; padding: 0;
  border: 0; border-bottom: 1px solid var(--line); background: hsl(var(--h) 12% 10%); cursor: pointer; color: inherit;
}
.tile-screen:disabled { cursor: default; }
.tile-screen::after {
  /* a faint bezel: reads as a display, not a card */
  content: ""; position: absolute; inset: 10px; border-radius: 6px;
  border: 1px solid hsl(var(--h) 14% 17%); pointer-events: none;
}
.tile-noise { position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.016) 0 1px, transparent 1px 3px); }
.tile-screen .tally { position: absolute; top: 14px; left: 14px; z-index: 1; }
.tile-viewers { position: absolute; top: 14px; right: 14px; z-index: 1; display: inline-flex; align-items: center; gap: 5px;
  height: 20px; padding: 0 7px; border-radius: 5px; background: rgba(0, 0, 0, 0.45); color: var(--text-2); font-size: 12px; }
.tile-spec { position: absolute; left: 14px; bottom: 12px; z-index: 1; color: hsl(var(--h) 10% 52%); font-size: 11.5px; }
.tile-screen .av { z-index: 1; }
.tile-play {
  position: absolute; inset: 0; z-index: 2; display: grid; place-items: center;
  background: rgba(10, 11, 12, 0.5); opacity: 0; transition: opacity 0.15s;
}
.tile-play span:last-child { margin-left: 0; }
.tile-play { grid-auto-flow: column; gap: 8px; }
.tile-play::before { content: ""; position: absolute; width: 104px; height: 38px; border-radius: 9px; background: var(--primary-bg); }
.tile-play > * { position: relative; color: var(--primary-fg); font-weight: 600; }
.tile-screen:hover .tile-play, .tile-screen:focus-visible .tile-play { opacity: 1; }
.tile-meta { display: grid; gap: 3px; padding: 11px 14px 12px; }
.tile-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tile-line strong { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-title { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.tile-watch { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px; border-top: 1px solid var(--line); background: var(--bg-2); font-size: 12.5px; }

.stage-empty { display: flex; align-items: center; gap: 12px; flex: none; padding: 9px 16px; border-bottom: 1px solid var(--line); background: var(--bg-1); font-size: 13px; }
.stage-empty-ic { display: grid; color: var(--text-3); }
.resizer { position: relative; flex: none; width: 7px; margin: 0 -3px; cursor: col-resize; z-index: 3; touch-action: none; }
.resizer::after { content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 1px; background: transparent; transition: background 0.12s; }
.resizer:hover::after, body.resizing .resizer::after { background: var(--text-3); }

/* ---- chat ---- */

.chat { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg-2); }
.room.has-stage .chat { width: var(--chat-w, 380px); flex: none; border-left: 1px solid var(--line); background: var(--bg-1); }
.room.no-stage .chat { flex: 1; }
.room.no-stage .chat { --gutter: max(0px, calc((100% - 860px) / 2)); }
.chat-head { display: flex; align-items: center; gap: 8px; flex: none; height: 44px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--line); }
.room.no-stage .chat-head { padding-inline: calc(var(--gutter) + 16px) calc(var(--gutter) + 8px); }
.chat-head h3 { font: 600 13.5px var(--font); }
.chat-head .search { flex: 1; height: 30px; }
.log-wrap { position: relative; flex: 1; min-height: 0; display: flex; }
.log { flex: 1; min-width: 0; overflow-y: auto; overflow-x: hidden; padding: 4px 0 14px; overscroll-behavior: contain; }
.room.no-stage .log { padding-inline: var(--gutter); }
.log-top { height: 30px; display: grid; place-items: center; }
.log-empty { display: grid; gap: 4px; justify-items: center; text-align: center; margin: 12vh auto 0; max-width: 360px; padding: 0 20px; }
.log-empty .muted { font-size: 13px; }
.log-day { display: flex; align-items: center; gap: 12px; margin: 16px 16px 6px; color: var(--text-3); font: 600 10.5px var(--font); letter-spacing: 0.08em; text-transform: uppercase; }
.log-day::before, .log-day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.log-new { display: flex; align-items: center; gap: 8px; margin: 10px 16px 4px; color: var(--warn); font: 600 10.5px var(--font); letter-spacing: 0.08em; text-transform: uppercase; }
.log-new::before { content: ""; flex: 1; height: 1px; background: rgba(231, 174, 76, 0.55); }

.mblock { position: relative; margin: 8px 10px 0 12px; padding: 2px 0 2px 14px; }
.mblock::before { content: ""; position: absolute; left: 0; top: 5px; bottom: 5px; width: 3px; border-radius: 3px; background: hsl(var(--h) 42% 46%); }
.mblock-head { display: flex; align-items: baseline; gap: 8px; padding-right: 8px; }
.mblock-name { font-weight: 600; font-size: 13.5px; color: hsl(var(--h) 58% 78%); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mblock-head time { flex: none; font-size: 11px; color: var(--text-3); }

.msg { position: relative; margin-left: -8px; padding: 1px 52px 1px 8px; border-radius: 6px; }
.msg:hover { background: rgba(255, 255, 255, 0.025); }
.msg.mentioned { background: rgba(231, 174, 76, 0.07); box-shadow: inset 2px 0 0 var(--warn); }
.msg.pending { opacity: 0.55; }
.msg.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 35% { background: rgba(231, 174, 76, 0.18); } 100% { background: transparent; } }
.msg-time { position: absolute; right: 10px; top: 3px; font-size: 10.5px; color: var(--text-3); opacity: 0; transition: opacity 0.1s; }
.msg:hover .msg-time { opacity: 1; }
.msg-text { line-height: 1.5; font-size: 14px; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-text.deleted { color: var(--text-3); font-style: italic; font-size: 13px; }
.msg-text code { font: 12.5px var(--mono); padding: 0 4px; border-radius: 4px; background: var(--bg-0); border: 1px solid var(--line); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.msg-text pre { margin: 4px 0; padding: 8px 10px; overflow-x: auto; white-space: pre; border-radius: 6px; background: var(--bg-0); border: 1px solid var(--line); }
.msg-text pre code { padding: 0; border: 0; background: none; }
.msg-text blockquote { margin: 2px 0; padding-left: 10px; border-left: 2px solid var(--line-2); color: var(--text-2); }
.msg-text a { color: var(--link); text-decoration: none; }
.msg-text a:hover { text-decoration: underline; }
.mention { padding: 0 3px; border-radius: 4px; background: rgba(235, 232, 227, 0.08); font-weight: 500; }
.mention.me { background: rgba(231, 174, 76, 0.18); color: #f3c97a; }
.spoiler { border-radius: 3px; background: var(--text-3); color: transparent; cursor: pointer; transition: background 0.15s, color 0.15s; }
.spoiler.open { background: rgba(255, 255, 255, 0.06); color: inherit; cursor: text; }
.edited { margin-left: 6px; font-size: 11px; color: var(--text-3); }
.msg-reply { display: flex; align-items: center; gap: 6px; max-width: 100%; margin: 2px 0 1px; padding: 0; border: 0; background: none; color: var(--text-3); font-size: 12.5px; cursor: pointer; text-align: left; }
.msg-reply b { flex: none; color: var(--text-2); font-weight: 600; }
.msg-reply span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-reply:hover span { color: var(--text-2); }
.msg-moment { display: flex; align-items: center; gap: 6px; margin: 2px 0; color: var(--text-3); font-size: 12px; }
.msg-files { display: grid; gap: 6px; margin: 4px 0 2px; grid-template-columns: repeat(2, minmax(0, 200px)); }
.msg-files.n1 { grid-template-columns: minmax(0, 380px); }
.msg-img { display: grid; place-items: center; width: 100%; max-height: 320px; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-0); cursor: zoom-in; }
.msg-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.reacts { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 2px; }
.react { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px 0 6px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg-3); color: var(--text-2); cursor: pointer; font-size: 12px; }
.react:hover { border-color: #44474d; }
.react.on { border-color: var(--text-3); background: var(--bg-5); color: var(--text); }
.react-e { font-size: 14px; line-height: 1; }
.retry { margin: 2px 0; padding: 0; border: 0; background: none; color: var(--bad); font-size: 12.5px; cursor: pointer; }
.msg-tools {
  position: absolute; right: 8px; top: -15px; z-index: 4; display: none; align-items: center; gap: 1px; padding: 2px;
  border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg-1); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.msg:hover .msg-tools, .msg:focus-within .msg-tools { display: flex; }
.msg-tools .ibtn { width: 28px; height: 26px; }
.tool-e { width: 28px; height: 26px; padding: 0; border: 0; border-radius: 6px; background: none; font-size: 14px; cursor: pointer; }
.tool-e:hover { background: rgba(255, 255, 255, 0.07); }
.emoji-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 6;
  display: grid; grid-template-columns: repeat(8, 32px); gap: 2px; padding: 6px;
  border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg-1); box-shadow: var(--pop); animation: rise 0.1s ease-out;
}
.emoji-pop.up { top: auto; bottom: calc(100% + 8px); }
.emoji-pop button { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 6px; background: none; font-size: 18px; cursor: pointer; }
.emoji-pop button:hover { background: var(--bg-4); }
.jump {
  position: absolute; right: 16px; bottom: 10px; z-index: 3; display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 15px; background: var(--bg-1); color: var(--text);
  font-size: 12.5px; cursor: pointer; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); animation: rise 0.12s ease-out;
}
.typing { display: flex; align-items: center; gap: 8px; flex: none; height: 20px; padding: 0 18px; color: var(--text-3); font-size: 12px; }
.room.no-stage .typing { padding-inline: calc(var(--gutter) + 18px); }
.typing-dots { display: inline-flex; gap: 3px; }
.typing-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--text-3); animation: bob 1.1s infinite ease-in-out; }
.typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.typing-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes bob { 0%, 70%, 100% { transform: none; opacity: 0.5; } 35% { transform: translateY(-3px); opacity: 1; } }

.composer { position: relative; flex: none; margin: 0 12px 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg-2); transition: border-color 0.12s; }
.room.has-stage .composer { background: var(--bg-2); }
.room.no-stage .composer { margin-inline: calc(var(--gutter) + 12px); background: var(--bg-1); }
.composer:focus-within { border-color: #46494f; }
.composer.editing { border-color: rgba(231, 174, 76, 0.5); }
.composer-ctx { display: flex; align-items: center; gap: 8px; padding: 6px 6px 0 12px; color: var(--text-2); font-size: 12.5px; min-width: 0; }
.composer-ctx > span:not(.spacer) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer-ctx .ibtn { width: 24px; height: 24px; }
.composer-files { display: flex; align-items: center; gap: 8px; padding: 10px 10px 0; }
.cfile { position: relative; width: 64px; height: 64px; overflow: hidden; border: 1px solid var(--line-2); border-radius: 8px; }
.cfile img { width: 100%; height: 100%; object-fit: cover; }
.cfile button { position: absolute; top: 3px; right: 3px; display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.7); color: #fff; cursor: pointer; }
.composer-row { display: flex; align-items: flex-end; gap: 2px; padding: 5px; }
.composer textarea {
  flex: 1; min-width: 0; min-height: 32px; max-height: 220px; padding: 6px 6px; resize: none;
  border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; line-height: 1.45;
}
.composer label.ibtn { cursor: pointer; }
.emoji-anchor { position: relative; }
.send { display: grid; place-items: center; flex: none; width: 34px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: var(--primary-bg); color: var(--primary-fg); cursor: pointer; }
.send:disabled { background: var(--bg-4); color: var(--text-3); cursor: default; }
.composer-left { position: absolute; right: 50px; bottom: 11px; font-size: 11px; color: var(--text-3); pointer-events: none; }
.suggest { position: absolute; left: 10px; bottom: calc(100% + 6px); z-index: 6; min-width: 200px; margin: 0; padding: 4px; list-style: none; border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg-1); box-shadow: var(--pop); }
.suggest li { padding: 6px 10px; border-radius: 6px; color: var(--text-2); cursor: pointer; }
.suggest li.on { background: var(--bg-4); color: var(--text); }
.drop-hint { position: absolute; inset: 8px; z-index: 8; display: grid; place-content: center; justify-items: center; gap: 8px; border: 2px dashed var(--text-2); border-radius: 12px; background: rgba(10, 11, 12, 0.78); pointer-events: none; }
.results { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 10px; }
.room.no-stage .results { padding-inline: calc(var(--gutter) + 10px); }
.results-head { padding: 2px 6px 8px; }
.result { display: grid; gap: 2px; width: 100%; margin-bottom: 4px; padding: 8px 10px 8px 14px; text-align: left; border: 0; border-radius: 8px; background: none; cursor: pointer; box-shadow: inset 3px 0 0 hsl(var(--h) 42% 46%); }
.result:hover { background: var(--bg-3); }
.result-head { display: flex; align-items: baseline; gap: 8px; }
.result-head time { color: var(--text-3); font-size: 11px; }
.result-text { color: var(--text-2); font-size: 13px; }

.lightbox { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 3vh 3vw; background: rgba(0, 0, 0, 0.88); cursor: zoom-out; animation: fade 0.12s ease-out; }
.lightbox img { max-width: 100%; max-height: 94vh; border-radius: 6px; box-shadow: var(--pop); }

/* ---- floating layers ---- */

.scrim {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 24px;
  background: rgba(5, 6, 7, 0.66); animation: fade 0.12s ease-out;
}
.scrim.top { place-items: start center; padding-top: 12vh; }
.modal {
  width: min(480px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column;
  background: var(--bg-1); border: 1px solid var(--line-2); border-radius: 14px;
  box-shadow: var(--pop); animation: rise 0.14s ease-out;
}
.modal.wide { width: min(700px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 12px 4px 20px; }
.modal-head h2, .modal-head h3 { flex: 1; font: 600 16px var(--font-display); }
.modal-body { padding: 12px 20px 20px; overflow-y: auto; display: grid; gap: 14px; align-content: start; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--bg-0); border-radius: 0 0 14px 14px; }
.foot-note { margin-right: auto; }

.modal.settings { width: min(840px, 100%); height: min(620px, calc(100vh - 48px)); flex-direction: row; overflow: hidden; }
.settings-nav { width: 196px; flex: none; padding: 18px 10px; background: var(--bg-0); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.settings-nav h2 { font: 600 11px var(--font); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); padding: 0 10px 10px; }
.settings-nav button { display: flex; align-items: center; text-align: left; height: 34px; padding: 0 10px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-2); cursor: pointer; }
.settings-nav button:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.settings-nav button.on { background: var(--bg-4); color: var(--text); }
.settings-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.settings-body .modal-body { padding: 14px 28px 28px; }

.menu {
  position: fixed; z-index: 55; min-width: 210px; max-width: 320px; padding: 5px;
  border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg-1); box-shadow: var(--pop); animation: rise 0.1s ease-out;
}
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 32px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: var(--text-2); text-align: left; font-size: 13.5px; cursor: pointer; }
.menu-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item:hover:not(:disabled) { background: var(--bg-4); color: var(--text); }
.menu-item.danger { color: var(--bad); }
.menu-item.danger:hover { background: rgba(255, 106, 85, 0.12); color: var(--bad); }
.menu-item:disabled { opacity: 0.45; cursor: default; }
.menu-sep { height: 1px; margin: 4px 6px; background: var(--line); }

.palette { width: min(620px, 100%); overflow: hidden; border: 1px solid var(--line-2); border-radius: 14px; background: var(--bg-1); box-shadow: var(--pop); animation: rise 0.12s ease-out; }
.palette-input { display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 18px; border-bottom: 1px solid var(--line); color: var(--text-3); }
.palette-input input { height: 52px; padding: 0; border: 0; background: transparent; font-size: 15.5px; box-shadow: none !important; }
.palette-list { max-height: 52vh; margin: 0; padding: 6px; overflow-y: auto; list-style: none; }
.palette-list li[role=option] { display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 10px; border-radius: 8px; color: var(--text-2); cursor: pointer; }
.palette-list li.on { background: var(--bg-4); color: var(--text); }
.palette-label { flex: none; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-hint { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-list li .kbd { margin-left: auto; }
.palette-sec { padding: 10px 10px 4px; font: 600 10.5px var(--font); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.palette-none { padding: 14px 10px; }

.toasts { position: fixed; left: 50%; top: 62px; transform: translateX(-50%); z-index: 70; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; max-width: 560px; padding: 9px 14px; border-radius: 9px; background: var(--text); color: var(--primary-fg); font-weight: 500; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); animation: rise 0.15s ease-out; }
.toast.error { background: #2a1512; color: #ffb3a7; border: 1px solid rgba(255, 106, 85, 0.4); }
.toast.mention { background: var(--bg-1); color: var(--text); border: 1px solid rgba(231, 174, 76, 0.5); font-weight: 400; }
.toast.mention .ic { color: var(--warn); flex: none; }
.toast .btn { pointer-events: auto; }

/* ---- dialogs ---- */

.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choices.col { grid-template-columns: 1fr; }
.choice {
  display: grid; gap: 4px; align-content: start; text-align: left;
  padding: 12px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg-3); cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.choice small { color: var(--text-2); font-size: 12px; line-height: 1.4; }
.choice:hover { border-color: #3a3d43; }
.choice.on { border-color: var(--text); background: var(--bg-4); }
.host-src-head { display: flex; align-items: center; gap: 8px; }
.host-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.host-cols > div { display: grid; gap: 10px; align-content: start; }
.monitors { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.monitor {
  display: grid; justify-items: start; gap: 2px; padding: 12px; text-align: left;
  border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg-3); cursor: pointer;
}
.monitor:hover { border-color: #3a3d43; }
.monitor.on { border-color: var(--text); background: var(--bg-4); }
.monitor small { color: var(--text-2); font-size: 12px; }
.monitor strong small { color: var(--text-3); font-weight: 500; margin-left: 4px; }
.monitor-shape { height: 44px; max-width: 84px; display: grid; place-items: center; margin-bottom: 8px; border: 1.5px solid var(--line-2); border-radius: 4px; color: var(--text-3); font: 600 13px var(--mono); }
.monitor.on .monitor-shape { border-color: var(--text-2); color: var(--text); }
.windows { display: grid; gap: 8px; }
.search { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--bg-0); color: var(--text-3); }
.search input { border: 0; background: transparent; height: 100%; padding: 0; box-shadow: none !important; }
.windows ul { list-style: none; margin: 0; padding: 4px; max-height: 210px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-0); }
.windows li button { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; text-align: left; cursor: pointer; color: var(--text-2); }
.windows li button span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.windows li button:hover { background: var(--bg-3); color: var(--text); }
.windows li button.on { background: var(--bg-4); color: var(--text); }
.pad { padding: 10px; }

.codebox { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--bg-0); }
.codebox span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bigcode { padding: 18px; text-align: center; font-size: 19px; letter-spacing: 0.04em; border: 1px dashed var(--line-2); border-radius: var(--radius); background: var(--bg-0); color: var(--text); user-select: all; }
.danger-zone { display: flex; align-items: center; gap: 16px; margin-top: 8px; padding: 14px; border: 1px solid rgba(255, 106, 85, 0.25); border-radius: var(--radius); }
.danger-zone div { flex: 1; display: grid; gap: 2px; }
.danger-zone small { color: var(--text-2); font-size: 12.5px; }
.about { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
.about div { flex: 1; display: grid; }
.notes { display: grid; gap: 8px; padding: 14px 16px; border: 1px solid rgba(68, 210, 125, 0.3); border-radius: var(--radius); }
.notes p { white-space: pre-wrap; }

.meter { position: relative; height: 8px; border-radius: 8px; background: var(--bg-0); border: 1px solid var(--line); overflow: hidden; }
.meter-fill { position: absolute; inset: 0 auto 0 0; background: var(--text-3); transition: width 0.08s linear; }
.meter.talking .meter-fill { background: var(--talk); }
.keycap { justify-self: start; min-width: 140px; height: 36px; padding: 0 14px; border: 1px solid var(--line-2); border-bottom-width: 3px; border-radius: 8px; background: var(--bg-4); color: var(--text); font: 600 13px var(--mono); cursor: pointer; }
.keycap.capturing { border-color: var(--text); animation: blink 1s steps(2) infinite; }
.usage { display: flex; align-items: center; gap: 12px; }
.usage-bar { flex: 1; height: 6px; border-radius: 6px; background: var(--bg-0); border: 1px solid var(--line); overflow: hidden; }
.usage-bar span { display: block; height: 100%; background: var(--text-2); }
.keys-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 20px; }
.keys dl { display: grid; grid-template-columns: max-content 1fr; gap: 9px 14px; margin: 10px 0 0; align-items: center; }
.keys dt { color: var(--text-2); font-size: 13px; display: flex; align-items: center; gap: 4px; }
.keys dd { margin: 0; color: var(--text-2); font-size: 13px; }

/* network view (group founder) */
.ladder { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 0; padding: 0; list-style: none; font-size: 11.5px; color: var(--text-2); }
.ladder li + li::before { content: "→"; margin-right: 8px; color: var(--text-3); }
.netlist { display: grid; gap: 10px; }
.net-member { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); overflow: hidden; }
.net-head { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.net-head strong { font-weight: 600; }
.net-items { margin: 0; padding: 4px 0; list-style: none; }
.net-items li { display: grid; grid-template-columns: 18px 1fr auto 52px; align-items: center; gap: 10px; padding: 6px 12px; }
.net-ic { color: var(--text-3); display: grid; }
.net-peer { color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.net-rtt { text-align: right; color: var(--text-2); }
.net-idle { padding: 9px 12px; color: var(--text-3); font-size: 12.5px; }
.kind { font-size: 12px; font-weight: 600; white-space: nowrap; }
.kind::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: currentColor; vertical-align: 1px; }
.k-ipv6, .k-ipv4, .k-punch, .k-lan { color: var(--talk); }
.k-turn { color: var(--warn); }
.k-relay { color: #ff8a4c; }
.k-none { color: var(--text-3); }

/* ---- watching in the browser ---- */

.watch { position: fixed; inset: 0; z-index: 30; display: flex; background: #000; }
.stage { position: relative; flex: 1; min-width: 0; background: #000; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.stage.idle { cursor: none; }
.stage-msg { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--text-2); text-align: center; }
.hud {
  position: absolute; top: 12px; left: 12px; display: grid; gap: 1px;
  padding: 7px 10px; border-radius: 8px; background: rgba(0, 0, 0, 0.62);
  font-size: 11.5px; color: var(--text-2); pointer-events: none;
}
.hud b { color: var(--text); }
.stage-bar {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 8px;
  padding: 26px 14px 12px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.82));
  transition: opacity 0.2s;
}
.stage.idle .stage-bar { opacity: 0; pointer-events: none; }
.stage-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-bar .vol { width: 90px; }
.chat-toggle .badge { position: absolute; top: -3px; right: -3px; height: 16px; min-width: 16px; font-size: 10px; }
.watch-chat { display: flex; flex: none; width: 360px; border-left: 1px solid var(--line); background: var(--bg-1); }
.watch-chat .chat { flex: 1; background: var(--bg-1); }

/* ---- first run ---- */

.onb { height: 100%; display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 480px); justify-content: center; align-items: center; gap: clamp(40px, 8vw, 110px); padding: 6vh 5vw; overflow-y: auto; }
.onb-side { display: grid; gap: 18px; }
.onb-mark { display: flex; align-items: center; gap: 10px; color: var(--text); font: 600 15px var(--font-display); }
.onb-side h1 { font: 600 30px/1.2 var(--font-display); letter-spacing: -0.02em; }
.onb-spec { display: grid; grid-template-columns: max-content 1fr; gap: 9px 20px; margin: 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12.5px; }
.onb-spec dt { color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.onb-spec dd { margin: 0; color: var(--text-2); font-family: var(--font); font-size: 13px; }
.onb-card { display: grid; gap: 18px; padding: 24px; border: 1px solid var(--line-2); border-radius: 16px; background: var(--bg-1); }
.onb-paths { display: grid; gap: 12px; }
.onb-paths section { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
.onb-paths h3 { display: flex; align-items: center; gap: 8px; font-size: 14px; }

/* ---- narrow windows ---- */

@media (max-width: 1100px) {
  .palette-trigger { min-width: 0; }
  .palette-trigger span, .palette-trigger .kbd { display: none; }
  .dock-me { width: auto; }
}
@media (max-width: 900px) {
  .view-tabs { display: inline-flex; }
  .room.has-stage.view-chat .stage-wall, .room.has-stage .resizer, .room.has-stage.view-stage .chat { display: none; }
  .room.has-stage.view-chat .chat { width: auto; flex: 1; border-left: 0; }
  .room.no-stage .view-tabs { display: none; }
  .dock-me-text, .presence-count span { display: none; }
  .live-pill-text span { display: none; }
  .choices { grid-template-columns: 1fr; }
  .host-cols { grid-template-columns: 1fr; }
  .modal.settings { flex-direction: column; height: auto; }
  .settings-nav { width: auto; flex-direction: row; overflow-x: auto; padding: 10px; }
  .settings-nav h2 { display: none; }
  .onb { grid-template-columns: 1fr; gap: 28px; }
  .watch-chat { position: absolute; top: 0; right: 0; bottom: 0; width: min(360px, 100%); z-index: 2; }
}
@media (max-width: 640px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 56px minmax(0, 1fr); }
  .rail { flex-direction: row; padding: 0 12px; gap: 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail-mark { border-bottom: 0; border-right: 1px solid var(--line); width: auto; padding: 0 10px 0 0; }
  .rail-groups { flex-direction: row; overflow-x: auto; padding: 0 2px; }
  .rail-group::before { display: none; }
  .group-title { max-width: 150px; }
  .presence { display: none; }
  .topbar .btn.primary span { display: none; }
  .dock { height: auto; flex-wrap: wrap; gap: 8px; padding: 8px 10px; }
  .dock-voice { order: 3; flex-basis: 100%; padding-left: 0; border-left: 0; }
  .stage-wall { padding: 12px; }
  .wall { grid-template-columns: 1fr; }
  .two { grid-template-columns: 1fr; }
  .msg { padding-right: 8px; }
  .toasts { top: 64px; }
}
