/* zellous.css — built from 247420 design tokens only */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%; width: 100%;
  font-size: var(--fs-sm);
  background: var(--bg);
  color: var(--fg);
  overflow: hidden;
}

/* Extension tokens — surface hierarchy beyond --bg/--bg-2 */
:root {
  --bg-3:       var(--paper-3, #DFDED9);
  --bg-4:       #C8C0A8;
  --accent-alt: #420247;
  --green-fg:   var(--paper, #F6F5F1);
  /* Category / avatar palette — zellous brand color-coding tokens (mirror of AVATAR_COLORS) */
  --cat-green:  #3F8A4A;
  --cat-purple: #6B3A78;
  --cat-mascot: #F07AA8;
  --cat-sun:    #FFD86B;
  --cat-flame:  #FF8454;
  --cat-sky:    #6FA9FF;
  --cat-sun-fg: #2A2820;
  --warn:       #ff4d4f;
}
[data-theme="ink"], .theme-ink {
  --bg-3: #36383E;
  --bg-4: #42444B;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="paper"]):not([data-theme="light"]) {
    --bg-3: #36383E;
    --bg-4: #42444B;
  }
}
/* Surface tokens — extend canonical (which only defines --bg/--bg-2) with bg-3/bg-4 + panel aliases used by legacy zellous chrome.
   Canonical colors_and_type.css owns --bg/--fg/--accent/--ink/--paper toggling via [data-theme]. We do NOT redefine those. */
html.ds-247420[data-theme="ink"], html.ds-247420[data-theme="dark"] {
  --bg-3: #34343C;
  --bg-4: #42444B;
  --green-fg:   var(--ink);
  --panel-0: var(--ink);
  --panel-1: var(--ink-2);
  --panel-2: #34343C;
  --panel-text: var(--paper);
  --panel-text-2: var(--paper-2);
  --panel-text-3: var(--ink-3);
  --border-color: color-mix(in oklab, var(--paper) 12%, transparent);
}
html.ds-247420[data-theme="light"], html.ds-247420[data-theme="paper"] {
  --bg-3: var(--paper-3);
  --bg-4: #C8C0A8;
  --panel-0: var(--paper);
  --panel-1: var(--paper-2);
  --panel-2: var(--paper-3);
  --panel-text: var(--ink);
  --panel-text-2: var(--ink-2);
  --panel-text-3: var(--ink-3);
  --border-color: color-mix(in oklab, var(--ink) 12%, transparent);
}

/* ── 247420 design primitives — rail / dot / chip ── */
.rail        { box-shadow: inset 4px 0 0 var(--fg-3); }
.rail-green  { box-shadow: inset 4px 0 0 var(--cat-green); }
.rail-purple { box-shadow: inset 4px 0 0 var(--cat-purple); }
.rail-mascot { box-shadow: inset 4px 0 0 var(--cat-mascot); }
.rail-sun    { box-shadow: inset 4px 0 0 var(--cat-sun); }
.rail-flame  { box-shadow: inset 4px 0 0 var(--cat-flame); }
.rail-sky    { box-shadow: inset 4px 0 0 var(--cat-sky); }

.dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; background: var(--fg-3);
  vertical-align: middle; flex-shrink: 0;
}
.dot.live   { background: var(--live); }
.dot.green  { background: var(--cat-green); }
.dot.purple { background: var(--cat-purple); }
.dot.mascot { background: var(--cat-mascot); }
.dot.sun    { background: var(--cat-sun); }
.dot.flame  { background: var(--cat-flame); }
.dot.sky    { background: var(--cat-sky); }

/* .chip base comes from the SDK; assert per-hue variants at higher specificity. */
html.ds-247420 .chip.green  { background: color-mix(in oklab, var(--cat-green) 22%, var(--bg-3)); color: var(--cat-green); }
html.ds-247420 .chip.purple { background: color-mix(in oklab, var(--cat-purple) 22%, var(--bg-3)); color: var(--cat-purple); }
html.ds-247420 .chip.mascot { background: color-mix(in oklab, var(--cat-mascot) 22%, var(--bg-3)); color: var(--cat-mascot); }
html.ds-247420 .chip.sun    { background: color-mix(in oklab, var(--cat-sun) 22%, var(--bg-3)); color: var(--fg); }
html.ds-247420 .chip.flame  { background: color-mix(in oklab, var(--cat-flame) 22%, var(--bg-3)); color: var(--cat-flame); }
html.ds-247420 .chip.sky    { background: color-mix(in oklab, var(--cat-sky) 22%, var(--bg-3)); color: var(--cat-sky); }

/* ── App shell — let SDK's app-shell.css drive the column layout (topbar/crumb/body/status) ── */

.reconnect-banner {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  background: var(--warn);
  color: #fff;
  text-align: center;
  padding: 6px 12px;
  font-size: var(--fs-xs);
  font-weight: 600;
}
.reconnect-banner.visible { display: block; }
/* When banner is visible, shift the app down so it isn't covered */
body:has(.reconnect-banner.visible) .app { padding-top: 32px; }

/* ── Server list rail ── */
.server-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 72px;
  min-width: 72px;
  background: var(--bg);
  padding: 8px 0;
  gap: 4px;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.2s, min-width 0.2s, opacity 0.2s;
  flex-shrink: 0;
  scrollbar-width: none;
}
.server-list::-webkit-scrollbar { display: none; }
.server-list.collapsed { width: 0; min-width: 0; opacity: 0; pointer-events: none; }

/* ── Channel sidebar ── */
.channel-sidebar {
  display: flex;
  flex-direction: column;
  width: 240px;
  min-width: 240px;
  background: var(--bg-2);
  flex-shrink: 0;
  overflow: hidden;
  transition: width 0.2s, min-width 0.2s, opacity 0.2s;
}
.channel-sidebar.collapsed { width: 0; min-width: 0; opacity: 0; pointer-events: none; }

/* ── App-defined modal vocabulary (modal-box / modal-field / modal-input / modal-btn) ── */
.modal-box {
  background: var(--bg-2);
  border-radius: 8px;
  padding: 20px 24px;
  min-width: 320px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.modal-subtitle {
  font-size: var(--fs-sm);
  color: var(--fg-3);
  margin-bottom: 16px;
}
.modal-field { margin-bottom: 16px; }
.modal-label {
  display: block;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--fg-2);
  margin-bottom: 6px;
}
.modal-input {
  width: 100%;
  background: var(--bg-4);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 8px 12px;
  color: var(--fg);
  font-size: var(--fs-sm);
  font-family: var(--ff-ui);
  outline: none;
  transition: border-color 0.1s;
}
.modal-input:focus { border-color: var(--accent); }
textarea.modal-input { resize: vertical; min-height: 60px; }
select.modal-input { cursor: pointer; }
html.ds-247420 button.modal-btn,
.modal-btn {
  display: inline-block;
  background: var(--accent);
  color: var(--green-fg);
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: var(--fs-sm);
  font-weight: 600;
  font-family: var(--ff-ui);
  cursor: pointer;
  margin-right: 8px;
  transition: background 0.1s;
}
html.ds-247420 button.modal-btn:hover,
.modal-btn:hover { background: var(--green-2); }
html.ds-247420 button.modal-btn.secondary,
.modal-btn.secondary { background: var(--bg-4); color: var(--fg); }
html.ds-247420 button.modal-btn.secondary:hover,
.modal-btn.secondary:hover { background: var(--bg-3); }

/* ── Main content ── */
.main-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  background: var(--bg-3);
  overflow: hidden;
}

/* Mobile header */
.mobile-header {
  display: none;
  align-items: center;
  height: 48px;
  padding: 0 12px;
  background: var(--bg-2);
  flex-shrink: 0;
  gap: 12px;
}
.mobile-hamburger {
  background: none; border: none; cursor: pointer;
  color: var(--fg-2); font-size: 20px; padding: 4px;
}
.mobile-title { flex: 1; font-weight: 600; color: var(--fg); font-size: var(--fs-sm); }
.mobile-members-btn { background: none; border: none; cursor: pointer; color: var(--fg-2); display: flex; padding: 4px; border-radius: 4px; }

/* Chat area host — transparent; canonical .chat / .chat-head / .chat-thread / .chat-composer come from 247420.css */
.chat-area { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; background: transparent; }
.chat-header-bar { display: none; } /* legacy zellous header — replaced by C.Chat's inline chat-head */

/* Chat surface — fill the canonical app-main flex column */
html.ds-247420 .chat-head {
  display: flex; align-items: baseline; gap: 6px;
  padding: 0 2px 14px;
  font-size: var(--fs-sm); color: var(--fg-2);
}
html.ds-247420 .chat-head .spread { flex: 1; }
html.ds-247420 .chat-head > span:nth-child(2) {
  font-size: var(--fs-h2, 32px); font-weight: 600;
  color: var(--fg); letter-spacing: var(--tr-tight, -0.01em);
  font-family: var(--ff-display, 'Space Grotesk');
  line-height: 1.2;
}
html.ds-247420 .chat-head .dot { background: var(--accent); }

/* Chat composer — textarea has white default; make it match the canonical input look */
html.ds-247420 .chat-composer {
  display: flex; gap: 8px; padding: var(--space-3, 14px) 0 0;
  border-top: 1px solid var(--border-color, color-mix(in oklab, var(--fg) 12%, transparent));
  margin-top: 8px;
}
html.ds-247420 .chat-composer textarea {
  flex: 1; padding: 12px 16px;
  background: var(--bg-2); color: var(--fg);
  border: 0; border-radius: var(--r-pill, 999px);
  font-family: inherit; font-size: var(--fs-sm);
  outline: 0; resize: none; line-height: 1.4;
  min-height: 44px; max-height: 200px;
}
html.ds-247420 .chat-composer textarea:focus {
  box-shadow: inset 0 0 0 2px var(--accent);
}
html.ds-247420 .chat-composer textarea::placeholder { color: var(--fg-3); }
html.ds-247420 .chat-composer .send,
html.ds-247420 .chat-composer button {
  width: 44px; height: 44px; border-radius: var(--r-pill, 999px);
  background: var(--accent); color: var(--accent-fg);
  border: 0; cursor: pointer; font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
html.ds-247420 .chat-composer button:disabled {
  background: var(--bg-3); color: var(--fg-3); cursor: not-allowed;
}

/* Chat messages — give them breathing room similar to canonical */
html.ds-247420 .chat-thread {
  display: flex; flex-direction: column; gap: 16px;
  padding: 8px 0 16px;
}
html.ds-247420 .chat-msg {
  display: flex; gap: 12px; align-items: flex-start;
}
html.ds-247420 .chat-msg.you { flex-direction: row-reverse; }
html.ds-247420 .chat-avatar {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 50%; background: var(--bg-3); color: var(--fg);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  font-family: var(--ff-mono, 'JetBrains Mono', monospace);
  text-transform: lowercase;
}
html.ds-247420 .chat-stack {
  display: flex; flex-direction: column; gap: 4px;
  max-width: 70%; min-width: 0;
}
html.ds-247420 .chat-msg.you .chat-stack { align-items: flex-end; }
html.ds-247420 .chat-bubble {
  padding: 10px 14px; background: var(--bg-2); color: var(--fg);
  border-radius: 14px; line-height: 1.5; word-break: break-word;
  font-size: var(--fs-sm);
}
html.ds-247420 .chat-msg.you .chat-bubble {
  background: var(--accent); color: var(--accent-fg);
}
html.ds-247420 .chat-bubble code {
  font-family: var(--ff-mono, 'JetBrains Mono', monospace);
  background: color-mix(in oklab, var(--fg) 12%, transparent);
  padding: 1px 5px; border-radius: 4px; font-size: 0.9em;
}
html.ds-247420 .chat-bubble a { color: inherit; text-decoration: underline; }
html.ds-247420 .chat-meta {
  display: flex; gap: 6px; font-size: var(--fs-xs, 12px); color: var(--fg-3);
  font-family: var(--ff-mono, 'JetBrains Mono', monospace);
  padding: 0 4px;
}
html.ds-247420 .chat-reactions {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin-top: 2px;
}
html.ds-247420 .chat-reactions .rxn,
html.ds-247420 .chat-reactions span:not(.e):not(.n) {
  display: inline-flex; gap: 3px; align-items: center;
  padding: 2px 8px; background: var(--bg-2);
  border-radius: var(--r-pill, 999px);
  font-size: var(--fs-xs, 11px); cursor: pointer;
}
html.ds-247420 .chat-reactions .rxn.you {
  background: color-mix(in oklab, var(--accent) 22%, var(--bg-2));
  outline: 1px solid var(--accent);
}
html.ds-247420 .chat-reactions .n { font-weight: 600; }

/* zellous is a live app — main area should fill height, scroll the thread, sit tight to topbar */
html.ds-247420 .app-main { padding: 0; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
html.ds-247420 .main-content { display: flex; flex-direction: column; flex: 1; min-height: 0; background: transparent; }
html.ds-247420 .chat { display: flex; flex-direction: column; flex: 1; min-height: 0; background: transparent; }
html.ds-247420 .chat-thread { flex: 1; overflow-y: auto; min-height: 0; background: transparent; padding: var(--space-4) var(--space-5); }
html.ds-247420 .chat-head { padding: var(--space-3) var(--space-5); border-bottom: 1px solid var(--rule); }
html.ds-247420 .chat-area { background: transparent; display: flex; flex-direction: column; flex: 1; min-height: 0; }
html.ds-247420 .app-body { height: calc(100vh - 56px - 32px - 36px); min-height: 0; }
html.ds-247420 .app-side-shell { overflow-y: auto; min-height: 0; }
html.ds-247420 .ds-pattern-notes p { margin: 0 0 8px; font-size: var(--fs-sm); color: var(--fg-2); line-height: 1.5; }

.chat-messages {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 16px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-4) transparent;
}
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 3px; }
.chat-messages-inner { display: flex; flex-direction: column; }

.empty-state { padding: 32px 16px; text-align: center; color: var(--fg-3); font-size: var(--fs-sm); }

.msg {
  display: flex; gap: 12px;
  padding: 2px 16px;
  border-radius: 4px;
  transition: background 0.1s;
  position: relative;
}
.msg:hover { background: var(--bg-4); }
.msg.new-sender { margin-top: 12px; }
.msg-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); color: var(--green-fg);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 16px;
  flex-shrink: 0; margin-top: 2px; cursor: pointer;
}
.msg-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.msg-avatar-spacer { width: 40px; flex-shrink: 0; }
.msg-body { flex: 1; min-width: 0; }
.msg-header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.msg-author { font-weight: 600; font-size: var(--fs-sm); color: var(--fg); cursor: pointer; }
.msg-author:hover { text-decoration: underline; }
.msg-time { font-size: 10px; color: var(--fg-3); }
.msg-content { font-size: var(--fs-sm); color: var(--fg); line-height: 1.4; word-break: break-word; }
.msg-content a { color: var(--link); }
.msg-content code { background: var(--bg); padding: 1px 4px; border-radius: 3px; font-family: var(--ff-mono); font-size: var(--fs-xs); }
.msg-content pre { background: var(--bg); padding: 8px 12px; border-radius: 4px; overflow-x: auto; font-family: var(--ff-mono); font-size: var(--fs-xs); margin: 4px 0; }
.msg-image { max-width: 400px; max-height: 300px; border-radius: 4px; margin-top: 4px; cursor: pointer; }
.msg-actions {
  display: none; position: absolute; right: 16px; top: 0;
  background: var(--bg-2);
  border-radius: 6px;
  gap: 2px; padding: 2px; z-index: 10;
}
.msg:hover .msg-actions { display: flex; }
.msg-action-btn {
  background: none; border: none; cursor: pointer;
  color: var(--fg-3); padding: 4px 6px; border-radius: 4px; font-size: var(--fs-xs);
}
.msg-action-btn:hover { background: var(--bg-3); color: var(--fg); }
.msg-mention { background: rgba(36,116,32,0.15); color: var(--accent); padding: 0 2px; border-radius: 2px; }
.msg-system { color: var(--fg-3); font-size: var(--fs-xs); font-style: italic; text-align: center; margin: 8px 0; }

/* Chat input */
.chat-input-wrapper { padding: 0 16px 16px; flex-shrink: 0; }
.chat-input-bar {
  display: flex; align-items: stretch;
  background: var(--bg-4);
  border-radius: 8px;
  gap: 0;
  border: 1px solid var(--border-color);
  overflow: hidden;
}
/* SDK-injected composer must fill the bar */
.chat-input-bar .chat-composer { flex: 1; min-width: 0; background: transparent !important; padding: 0 8px; }
.chat-input-bar .chat-composer textarea { background: transparent !important; color: var(--fg) !important; }
/* SDK send button */
.chat-input-bar .chat-composer .send { background: var(--accent) !important; color: var(--green-fg) !important; }
.chat-input-bar .chat-composer .send:disabled { background: var(--bg-3) !important; color: var(--fg-3) !important; }
.attach-btn {
  background: none; border: none; cursor: pointer;
  color: var(--fg-3); font-size: 22px; line-height: 1;
  padding: 6px; border-radius: 4px; flex-shrink: 0; transition: color 0.1s;
}
.attach-btn:hover { color: var(--fg); }
.chat-input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--fg); font-size: var(--fs-sm);
  font-family: var(--ff-ui); padding: 10px 0; line-height: 1.4;
}
.chat-input::placeholder { color: var(--fg-3); }
.input-buttons { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.input-icon-btn { background: none; border: none; cursor: pointer; color: var(--fg-3); padding: 6px; border-radius: 4px; display: flex; }
.input-icon-btn:hover { color: var(--fg); }
.input-btn {
  background: var(--accent); border: none; cursor: pointer;
  color: var(--green-fg); border-radius: 4px; padding: 6px 10px;
  display: flex; align-items: center;
}
.input-btn:hover { background: var(--green-2); }

/* ── Voice view ── */
.voice-view {
  display: none; flex-direction: column;
  flex: 1; min-height: 0; background: var(--bg-3);
}
.voice-view.active { display: flex; }
.voice-grid {
  flex: 1; overflow: auto;
  display: flex; flex-wrap: wrap;
  align-content: flex-start; gap: 8px; padding: 16px;
}
.voice-tile {
  width: 220px; height: 160px;
  background: var(--bg-2); border-radius: 8px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px; position: relative; overflow: hidden;
  border: 2px solid transparent; transition: border-color 0.1s;
}
.voice-tile.speaking { border-color: var(--live); }
.voice-tile video { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.voice-tile-name {
  position: absolute; bottom: 4px; left: 8px;
  font-size: var(--fs-xs); font-weight: 600; color: var(--fg);
  background: rgba(0,0,0,0.6); padding: 2px 6px; border-radius: 3px;
}
.voice-tile-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--accent); color: var(--green-fg);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 24px;
}
.voice-controls {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; padding: 16px;
  background: var(--bg-2); flex-shrink: 0;
}
.voice-ctrl-btn {
  background: var(--bg-4); border: none; cursor: pointer;
  color: var(--fg-2); border-radius: 50%;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.1s, color 0.1s;
}
.voice-ctrl-btn:hover { background: var(--bg-3); color: var(--fg); }
.voice-ctrl-btn.active { background: var(--accent); color: var(--green-fg); }
.voice-ctrl-btn.muted { background: var(--warn); color: var(--green-fg); }
.voice-ctrl-btn.danger { background: var(--warn); color: var(--green-fg); }
.voice-ctrl-btn.danger:hover { background: var(--warn); filter: brightness(0.85); }

/* ── Member list ── */
.member-list {
  width: 240px; min-width: 240px;
  background: var(--bg-2);
  overflow-y: auto; overflow-x: hidden;
  flex-shrink: 0; padding: 8px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-4) transparent;
  display: none;
}
.member-list.open { display: block; }
.member-category {
  padding: 12px 8px 4px 16px;
  font-size: var(--fs-xs); font-weight: 600;
  color: var(--fg-3);
}
.member-item {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 12px; border-radius: 4px; margin: 1px 8px;
  cursor: pointer; transition: background 0.1s;
}
.member-item:hover { background: var(--bg-3); }
.member-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: var(--green-fg);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 12px; flex-shrink: 0; position: relative;
}
.member-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.member-status {
  position: absolute; bottom: -1px; right: -1px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--live); border: 2px solid var(--bg-2);
}
.member-name { font-size: var(--fs-xs); font-weight: 500; color: var(--fg-2); }

/* ── Forum view ── */
.forum-view { display: none; flex-direction: column; flex: 1; overflow: hidden; }
.forum-view.active { display: flex; }
.forum-header-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; flex-shrink: 0;
}
.forum-search {
  flex: 1; background: var(--bg-4);
  border: 1px solid var(--border-color); border-radius: 6px;
  padding: 6px 10px; color: var(--fg); font-size: var(--fs-sm);
  font-family: var(--ff-ui); outline: none;
}
.forum-search:focus { border-color: var(--accent); }
.forum-new-post-btn {
  background: var(--accent); border: none; cursor: pointer;
  color: var(--green-fg); border-radius: 6px;
  padding: 6px 14px; font-size: var(--fs-sm); font-weight: 600; white-space: nowrap;
}
.forum-new-post-btn:hover { background: var(--green-2); }
.forum-posts { flex: 1; overflow-y: auto; padding: 12px 16px; }
.forum-post {
  background: var(--bg-2); border-radius: 8px;
  padding: 14px 16px; margin-bottom: 8px;
  cursor: pointer; transition: background 0.1s;
}
.forum-post:hover { background: var(--bg-4); }
.forum-post-title { font-weight: 600; color: var(--fg); margin-bottom: 4px; }
.forum-post-meta { font-size: var(--fs-xs); color: var(--fg-3); }

/* ── Page view ── */
.page-view { display: none; flex-direction: column; flex: 1; overflow-y: auto; padding: 32px; line-height: 1.6; color: var(--fg); }
.page-view.active { display: flex; }
.page-view h1 { font-family: var(--ff-display); font-size: var(--fs-h3); margin-bottom: 16px; }
.page-view h2 { font-family: var(--ff-display); font-size: var(--fs-h4); margin: 20px 0 10px; }
.page-view p { margin-bottom: 12px; }

/* ── Threaded view ── */
.threaded-view { display: none; flex-direction: column; flex: 1; overflow: hidden; }
.threaded-view.active { display: flex; }
.threaded-content { display: flex; flex: 1; overflow: hidden; }
.threaded-main {
  flex: 1; overflow-y: auto; padding: 24px;
  display: flex; flex-direction: column; gap: 12px;
  align-items: center; justify-content: center;
}

.ptt-status { display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); color: var(--fg-3); }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fg-3); }
.ptt-status.active .rec-dot { background: var(--warn); animation: pulse 1s infinite; }
.ptt-btn {
  background: var(--accent); border: none; cursor: pointer;
  color: var(--green-fg); border-radius: 8px;
  padding: 14px 32px; font-size: var(--fs-lg); font-weight: 600;
  transition: background 0.1s, transform 0.05s;
  font-family: var(--ff-display);
}
.ptt-btn:active { background: var(--green-2); transform: scale(0.97); }

.threaded-controls { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 8px; }
.threaded-controls.hidden { display: none; }
.ctrl-row { display: flex; align-items: center; gap: 8px; }
.ctrl-label { font-size: var(--fs-xs); color: var(--fg-3); width: 28px; flex-shrink: 0; }
.ctrl-row input[type=range] { flex: 1; accent-color: var(--accent); }
.ctrl-row select {
  flex: 1; background: var(--bg-4); border: 1px solid var(--border-color);
  border-radius: 4px; padding: 4px 6px; color: var(--fg); font-size: var(--fs-xs);
  font-family: var(--ff-ui); outline: none;
}
.ctrl-value { font-size: var(--fs-xs); color: var(--fg-3); width: 36px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.ctrl-btn {
  background: var(--bg-4);
  cursor: pointer; color: var(--fg-2); border-radius: 6px;
  padding: 6px 14px; font-size: var(--fs-xs); font-weight: 600;
  transition: background 0.1s, color 0.1s;
}
.ctrl-btn:hover { background: var(--bg-3); color: var(--fg); }
.ctrl-btn.active { background: var(--accent); color: var(--green-fg); }

.vad-container { width: 100%; max-width: 340px; }
.vad-container.hidden { display: none; }
.vad-bar { position: relative; height: 8px; background: var(--bg-4); border-radius: 4px; overflow: visible; }
.vad-fill { height: 100%; background: var(--live); border-radius: 4px; transition: width 0.05s; }
.vad-threshold-marker { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--accent); border-radius: 1px; }

.webcam-preview { display: none; border-radius: 8px; overflow: hidden; }
.webcam-preview.active { display: block; }
.webcam-preview video { display: block; width: 100%; }

/* ── Rail toggle buttons ── */
.rail-toggle {
  position: fixed; z-index: 100;
  width: 20px; height: 40px;
  background: var(--bg-2);
  border-radius: 0 4px 4px 0;
  color: var(--fg-2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: background 0.1s, color 0.1s;
  padding: 0;
}
.rail-toggle:hover { background: var(--bg-3); color: var(--fg); }
.rail-toggle.servers { top: 50%; transform: translateY(-50%); left: 72px; }
.rail-toggle.servers.collapsed { left: 0; }
.rail-toggle.channels { top: 50%; transform: translateY(-50%); left: calc(72px + 240px); }
.rail-toggle.channels.collapsed { left: 72px; }

/* ── Command palette ── */
.cmdk-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.7); z-index: 9998;
  align-items: flex-start; justify-content: center;
  padding-top: 15vh;
}
.cmdk-overlay.open { display: flex; }
.cmdk-box {
  background: var(--bg-2);
  border-radius: 12px; width: 560px; max-width: 90vw;
  overflow: hidden;
}
.cmdk-input {
  width: 100%; background: var(--bg-3);
  border: none;
  padding: 16px 20px; outline: none;
  font-size: var(--fs-lg); color: var(--fg); font-family: var(--ff-ui);
}
.cmdk-input::placeholder { color: var(--fg-3); }
.cmdk-list { max-height: 320px; overflow-y: auto; padding: 6px; }
.cmdk-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 6px; cursor: pointer;
  color: var(--fg-2); font-size: var(--fs-sm); transition: background 0.1s;
}
.cmdk-item:hover, .cmdk-item.active { background: var(--bg-3); color: var(--fg); }
.cmdk-kind {
  font-size: 10px; font-weight: 600;
  color: var(--fg-3); background: var(--bg-4);
  padding: 2px 6px; border-radius: 4px; flex-shrink: 0;
}
.cmdk-empty { padding: 20px; text-align: center; color: var(--fg-3); font-size: var(--fs-sm); }

/* ── Voice strip ── inline above the user-panel inside the channel-sidebar.
   Matches the user-panel's height/surface vocabulary; only the inset rail
   and pulsing dot distinguish it as the live-voice indicator. */
.voice-strip {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  height: 52px;
  background: var(--bg-2);
  box-shadow: inset 3px 0 0 var(--live), inset 0 1px 0 var(--bg-3);
  flex-shrink: 0;
}
.voice-strip.open { display: flex; }
.voice-strip::before {
  content: '';
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--live);
  flex-shrink: 0;
  animation: pulse 1.4s infinite;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--live) 30%, transparent);
}
.vs-label { flex: 1; overflow: hidden; min-width: 0; }
.vs-channel {
  display: block;
  font-size: var(--fs-xs); font-weight: 600;
  color: var(--fg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vs-status {
  display: block;
  font-size: 10px;
  color: var(--live);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.voice-strip button {
  background: none; border: none; cursor: pointer;
  color: var(--fg-3); padding: 6px; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
}
.voice-strip button:hover { background: var(--bg-3); color: var(--fg); }
.voice-strip button.danger { color: var(--warn); }
.voice-strip button.danger:hover { background: var(--warn); color: var(--green-fg); }
.voice-strip button svg { display: block; }

/* Top connected banner — shown while in voice but viewing a different channel
   (text/page). Persistent, screen-wide, hard to miss. */
.voice-connected-banner {
  display: none;
  align-items: center; gap: 12px;
  padding: 8px 16px;
  background: linear-gradient(90deg, color-mix(in oklab, var(--live) 24%, var(--bg-2)) 0%, var(--bg-2) 100%);
  color: var(--fg);
  font-size: var(--fs-xs); font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--live);
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s;
}
.voice-connected-banner.visible { display: flex; }
.voice-connected-banner:hover { background: linear-gradient(90deg, color-mix(in oklab, var(--live) 34%, var(--bg-2)) 0%, var(--bg-3) 100%); }
.voice-connected-banner .vcb-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--live);
  animation: pulse 1.4s infinite;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--live) 35%, transparent);
  flex-shrink: 0;
}
.voice-connected-banner .vcb-channel { color: var(--live); font-weight: 700; }
.voice-connected-banner .vcb-spacer { flex: 1; }
.voice-connected-banner .vcb-jump {
  font-size: 10px; color: var(--fg-3);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.voice-connected-banner button {
  background: var(--warn); color: var(--green-fg);
  border: none; cursor: pointer;
  padding: 4px 10px; border-radius: 4px;
  font-size: 11px; font-weight: 600;
  font-family: var(--ff-ui);
}
.voice-connected-banner button:hover { filter: brightness(0.92); }
html.ds-247420 .voice-connected-banner button { background: var(--warn); color: var(--green-fg); padding: 4px 10px; border-radius: 4px; }

/* PTT pill in realtime mode — looks like a static "live" badge, not a button */
html.ds-247420 button.voice-ptt-pill[data-state="realtime"],
.voice-ptt-pill[data-state="realtime"] {
  background: var(--live);
  color: var(--green-fg);
  cursor: default;
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--live) 30%, transparent);
  pointer-events: none;
}
.voice-ptt-pill[data-state="realtime"]::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green-fg);
  margin-right: 2px;
  animation: pulse 1.2s infinite;
}

/* ── Modals ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.7); z-index: 9990;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-title { font-weight: 600; font-size: var(--fs-lg); color: var(--fg); margin-bottom: 4px; }

/* Context menu */
.context-menu {
  position: fixed; z-index: 9995;
  background: var(--bg-2);
  border-radius: 6px;
  padding: 4px; min-width: 160px; display: none;
}
.context-menu.open { display: block; }
.ctx-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 4px; cursor: pointer;
  font-size: var(--fs-sm); color: var(--fg-2); transition: background 0.1s, color 0.1s;
}
.ctx-item:hover { background: var(--bg-3); color: var(--fg); }
.ctx-item.danger { color: var(--warn); }
.ctx-item.danger:hover { background: var(--warn); color: var(--green-fg); }
.ctx-separator { height: 0; margin: 6px 0; }

/* Thread panel */
.thread-panel {
  width: 360px; flex-shrink: 0;
  background: var(--bg-2);
  display: none; flex-direction: column; overflow: hidden;
}
.thread-panel.open { display: flex; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--bg-4) transparent; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 3px; }

/* Animations */
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }
@keyframes spin { to{transform:rotate(360deg)} }
.spin { animation: spin 1s linear infinite; }

/* Mobile */
@media (max-width: 768px) {
  .server-list { width: 60px; min-width: 60px; }
  .channel-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 500;
    transform: translateX(-100%); transition: transform 0.2s;
    width: 260px; min-width: 260px;
  }
  .channel-sidebar.mobile-open { transform: translateX(60px); }
  .member-list {
    position: fixed; right: 0; top: 0; bottom: 0; z-index: 500;
    transform: translateX(100%); transition: transform 0.2s;
  }
  .member-list.open { transform: translateX(0); }
  .mobile-header { display: flex; }
  .chat-header-bar { display: none; }
  .rail-toggle { display: none; }
}

.server-back-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 32px;
  color: var(--fg-2);
  text-decoration: none;
  font-family: var(--ff-mono);
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
  transition: color 0.15s;
  margin-bottom: 4px;
}
.server-back-link:hover { color: var(--fg); }

/* ──────────────────────────────────────────────────────────────────────────
   2026-05-10 sweep: rules for every classname rendered by JS that previously
   had no CSS. Aligned with the AnEntrypoint design bible (soft surfaces,
   rounded shapes, no hard borders, colour-coded rails, generous spacing).
   ──────────────────────────────────────────────────────────────────────── */

/* Modal button row — primary + secondary side by side with breathing room */
.modal-box .modal-btn { margin: 0; }
.modal-box .modal-btn + .modal-btn { margin-left: 8px; }
.modal-box form > .modal-btn,
.modal-box > .modal-btn {
  margin-top: 12px;
}
.modal-box form > .modal-btn + .modal-btn,
.modal-box > .modal-btn + .modal-btn {
  margin-left: 8px;
}

/* Voice tiles: centred grid with comfortable size; speaking ring uses live token */
.voice-grid {
  align-content: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
}
.voice-tile {
  width: 240px; height: 180px;
  background: var(--bg-3);
  border-radius: 12px;
  border: 2px solid transparent;
  box-shadow: 0 1px 2px rgba(0,0,0,0.18);
  position: relative;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px;
  transition: border-color 0.15s, transform 0.15s;
}
.voice-tile.speaking { border-color: var(--live); transform: translateY(-1px); }
.voice-tile-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--green-fg);
  font-weight: 600; font-size: 24px;
  transition: box-shadow 0.15s;
}
.voice-tile-avatar.speaking { box-shadow: 0 0 0 3px var(--live); }
.voice-tile-name {
  position: absolute; bottom: 8px; left: 50%;
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,0.55);
  color: var(--fg);
  font-size: var(--fs-xs); font-weight: 600;
  padding: 3px 10px; border-radius: 999px;
  max-width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.voice-tile-muted {
  position: absolute; top: 8px; right: 8px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--warn);
  color: var(--green-fg);
  display: flex; align-items: center; justify-content: center;
}
.voice-tile-muted svg { display: block; }
.voice-tile-role-badge {
  font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--green-fg);
  padding: 1px 5px; border-radius: 4px;
}
.quality-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--fg-3); flex-shrink: 0;
}
.quality-dot.good { background: var(--live); }
.quality-dot.fair { background: var(--cat-sun); }
.quality-dot.poor { background: var(--warn); }
.quality-dot.connecting { background: var(--fg-3); animation: pulse 1.2s infinite; }

/* Voice control bar PTT pill + queue badge */
.voice-controls {
  justify-content: center;
  gap: 10px;
  border-radius: 12px 12px 0 0;
}
.voice-ptt-pill {
  background: var(--accent);
  color: var(--green-fg);
  border: none; cursor: pointer;
  border-radius: 999px;
  padding: 10px 18px;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--fs-sm); font-weight: 600;
  transition: background 0.1s, transform 0.05s, box-shadow 0.1s;
  user-select: none;
}
.voice-ptt-pill:hover { background: var(--green-2); }
.voice-ptt-pill.active,
.voice-ptt-pill[data-state="live"] {
  background: var(--live); color: var(--green-fg);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--live) 30%, transparent);
}
.voice-ptt-pill[data-state="queued"] {
  background: var(--cat-sun); color: var(--cat-sun-fg);
}
.voice-ptt-pill svg { fill: currentColor; }

.voice-ptt-queue {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-3); color: var(--fg-2);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: var(--fs-xs); font-weight: 600;
}
.voice-ptt-queue[data-empty="true"] { opacity: 0.55; }
.voice-ptt-queue.playing { background: color-mix(in oklab, var(--live) 25%, var(--bg-3)); color: var(--live); }
.vptq-label { text-transform: uppercase; letter-spacing: 0.04em; font-size: 10px; }
.vptq-count {
  min-width: 18px; text-align: center;
  background: var(--bg); color: var(--fg);
  border-radius: 999px;
  padding: 0 6px;
}
.vptq-skip {
  background: none; border: none; cursor: pointer;
  color: var(--fg-3); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  padding: 2px 6px; border-radius: 4px;
}
.vptq-skip:hover { color: var(--fg); background: var(--bg-4); }

/* Voice users (under voice channel in sidebar) */
.voice-user-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Audio queue panel inside voice view */
.skip-btn {
  background: var(--bg-4); border: none; cursor: pointer;
  color: var(--fg); border-radius: 999px;
  padding: 4px 12px; font-size: var(--fs-xs); font-weight: 600;
  margin: 0 16px 8px; align-self: flex-start;
}
.skip-btn:hover { background: var(--bg-3); }
.skip-btn.resume { background: var(--accent); color: var(--green-fg); }

.queue-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 16px;
  font-size: var(--fs-xs); color: var(--fg-2);
}
.queue-item.replaying { color: var(--live); }
.queue-icon { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.queue-info { flex: 1; min-width: 0; }
.queue-name { font-weight: 600; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-meta { font-size: 10px; color: var(--fg-3); }
.queue-actions { display: flex; gap: 4px; flex-shrink: 0; }
.queue-btn {
  background: none; border: none; cursor: pointer;
  color: var(--fg-3); padding: 4px; border-radius: 4px;
  display: inline-flex; align-items: center;
}
.queue-btn:hover { color: var(--fg); background: var(--bg-3); }

/* Member-list role headers + badges */
.member-role-header {
  padding: 16px 16px 4px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.02em;
  color: var(--fg-3);
}
.member-role-badge {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-left: 6px;
}
.member-section-separator { height: 1px; background: var(--bg-3); margin: 8px 16px; opacity: 0.5; }
.member-status.online { background: var(--live); }
.member-status.offline { background: var(--fg-3); }
.member-item.speaking { color: var(--live); }
.member-item.speaking .member-name { color: var(--live); }

/* Voice strip (the always-on connected indicator at bottom-left) */
.voice-strip { border-radius: 0 12px 0 0; }
.voice-strip .vs-channel { display: inline-flex; align-items: center; gap: 4px; }

/* SDK button reset inside our chat input bar (cosmetic safety) */
.chat-input-bar button { font-family: inherit; }

/* Tighten the join-preview address + actions */
#serverJoinPreviewModal .modal-box { padding: 24px 28px; }
#serverJoinPreviewModal .modal-btn + .modal-btn { margin-left: 8px; }

/* Reconnect banner uses warn token; readable on light theme too */
.reconnect-banner { color: var(--green-fg); }

/* ── Mobile polish for voice ── */
@media (max-width: 768px) {
  .voice-tile { width: calc(50% - 12px); height: 160px; }
  .voice-controls { padding: 12px 8px; gap: 6px; flex-wrap: wrap; }
  .voice-ptt-pill { padding: 10px 14px; }
}

/* ──────────────────────────────────────────────────────────────────────────
   SDK-reset override: SDK 247420.css ships `.ds-247420 button { padding:0;
   background:none; }` at specificity (0,1,1), which beats every plain
   `.foo-btn` rule (0,1,0). Re-assert all our button classes at higher
   specificity so they keep their padding/background/borders.
   ──────────────────────────────────────────────────────────────────────── */
html.ds-247420 button.modal-btn { background: var(--accent); color: var(--green-fg); padding: 8px 16px; border-radius: 4px; }
html.ds-247420 button.modal-btn.secondary { background: var(--bg-4); color: var(--fg); }

html.ds-247420 button.voice-ctrl-btn { background: var(--bg-4); color: var(--fg-2); width: 48px; height: 48px; border-radius: 50%; padding: 0; }
html.ds-247420 button.voice-ctrl-btn.active { background: var(--accent); color: var(--green-fg); }
html.ds-247420 button.voice-ctrl-btn.muted { background: var(--warn); color: var(--green-fg); }
html.ds-247420 button.voice-ctrl-btn.danger { background: var(--warn); color: var(--green-fg); }

html.ds-247420 button.voice-ptt-pill { background: var(--accent); color: var(--green-fg); padding: 10px 18px; border-radius: 999px; }
html.ds-247420 button.voice-ptt-pill[data-state="live"], html.ds-247420 button.voice-ptt-pill.active { background: var(--live); }
html.ds-247420 button.voice-ptt-pill[data-state="queued"] { background: var(--cat-sun); color: var(--cat-sun-fg); }

html.ds-247420 button.input-btn { background: var(--accent); color: var(--green-fg); padding: 6px 10px; border-radius: 4px; }
html.ds-247420 button.input-icon-btn { color: var(--fg-3); padding: 6px; border-radius: 4px; background: transparent; }
html.ds-247420 button.attach-btn { color: var(--fg-3); padding: 6px; background: transparent; }
html.ds-247420 button.mobile-hamburger { color: var(--fg-2); padding: 4px; background: transparent; }
html.ds-247420 button.mobile-members-btn { color: var(--fg-2); padding: 4px; border-radius: 4px; background: transparent; }

html.ds-247420 button.forum-new-post-btn { background: var(--accent); color: var(--green-fg); padding: 6px 14px; border-radius: 6px; }
html.ds-247420 button.ptt-btn { background: var(--accent); color: var(--green-fg); padding: 14px 32px; border-radius: 8px; font-size: var(--fs-lg); font-weight: 600; }
html.ds-247420 button.ctrl-btn { background: var(--bg-4); color: var(--fg-2); padding: 6px 14px; border-radius: 6px; font-size: var(--fs-xs); font-weight: 600; }
html.ds-247420 button.ctrl-btn.active { background: var(--accent); color: var(--green-fg); }
html.ds-247420 button.skip-btn { background: var(--bg-4); color: var(--fg); padding: 4px 12px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; }
html.ds-247420 button.skip-btn.resume { background: var(--accent); color: var(--green-fg); }
html.ds-247420 button.queue-btn { color: var(--fg-3); padding: 4px; border-radius: 4px; background: transparent; }
html.ds-247420 button.vptq-skip { color: var(--fg-3); padding: 2px 6px; border-radius: 4px; background: transparent; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }

html.ds-247420 button.msg-action-btn { color: var(--fg-3); padding: 4px 6px; border-radius: 4px; background: transparent; }

html.ds-247420 .voice-strip button { color: var(--fg-3); padding: 6px; border-radius: 4px; background: transparent; }
html.ds-247420 .voice-strip button.danger { color: var(--warn); }
html.ds-247420 .voice-strip button:hover { background: var(--bg-3); color: var(--fg); }

/* SDK chat-kit surface — keep area transparent, kill legacy duplicate header strips */
html.ds-247420 .chat-header-bar { display: none !important; }
html.ds-247420 .mobile-header { display: none !important; }
@media (max-width: 900px) {
  html.ds-247420 .mobile-header {
    display: flex !important;
    position: fixed; left: 8px; top: 8px;
    height: 44px; width: 44px;
    padding: 0;
    background: var(--bg-2);
    border: 1px solid color-mix(in oklab, var(--fg) 12%, transparent);
    color: var(--fg);
    border-radius: var(--r-pill, 999px);
    z-index: 60;
    align-items: center; justify-content: center;
  }
  html.ds-247420 .mobile-header .mobile-title,
  html.ds-247420 .mobile-header .mobile-members-btn { display: none !important; }
  html.ds-247420 .mobile-header .mobile-hamburger { display: inline-flex; color: var(--fg); font-size: 20px; }
  html.ds-247420 .app-topbar { padding-left: 60px !important; }
}
html.ds-247420 .chat-area { padding: 0; border: 0; background: transparent; box-shadow: none; }
html.ds-247420 .chat { padding: 0 0 calc(var(--app-status-h, 42px) + var(--space-2)) 0 !important; background: transparent; }
html.ds-247420 .chat .chat-composer { padding: var(--space-3) var(--space-5); background: transparent; }

/* Active room pill: keep glyph + count visible on accent background */
html.ds-247420 .app-side a.active .glyph { color: var(--accent-fg) !important; }
html.ds-247420 .app-side a.active .count { background: var(--warn); color: #fff; }
html.ds-247420 .app-side .count {
  background: var(--warn); color: #fff;
  font-family: var(--ff-mono); font-size: 10px; font-weight: 700;
  min-width: 20px; height: 18px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-pill, 999px); letter-spacing: 0.02em;
}
html.ds-247420 .app-side a {
  min-height: 36px; padding: 8px 12px; margin-bottom: 2px;
  grid-template-columns: 18px 1fr auto; gap: 10px;
}

/* Chat-head: align with rooms group label vertically (kill gap above) */
html.ds-247420 .chat-head {
  padding: var(--space-5) var(--space-5) var(--space-3) !important;
  border-bottom: 1px solid var(--rule);
}

/* Composer: rounded rectangle with send button INSIDE on right */
html.ds-247420 .chat-composer {
  position: relative;
  padding: var(--space-3) var(--space-5) var(--space-5) !important;
  border-top: 0;
  background: transparent;
}
html.ds-247420 .chat-composer textarea {
  width: 100%; flex: 1;
  padding: 14px 56px 14px 18px !important;
  background: var(--bg-2); color: var(--fg);
  border-radius: var(--r-2, 14px) !important;
  min-height: 52px; max-height: 200px;
  font-size: var(--fs-sm); line-height: 1.4;
  border: 0; outline: 0; resize: none;
}
html.ds-247420 .chat-composer textarea:focus {
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--accent) 30%, transparent);
}
html.ds-247420 .chat-composer .send,
html.ds-247420 .chat-composer button {
  position: absolute;
  right: calc(var(--space-5) + 8px);
  bottom: calc(var(--space-4) + 8px);
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent); color: var(--accent-fg);
  font-size: 14px;
}
.chat-input-bar .chat-composer .send,
.chat-input-bar .chat-composer button {
  position: static;
}

/* Status bar — make sure it's visible and styled */
html.ds-247420 .app-status {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 10px var(--space-5);
  font-family: var(--ff-mono); font-size: var(--fs-xs);
  color: var(--fg-3);
  border-top: 1px solid var(--rule);
  flex-shrink: 0;
}
html.ds-247420 .app-status .item:first-of-type { color: var(--accent); }
html.ds-247420 .app-status .spread { flex: 1; }
html.ds-247420 .app-body {
  height: auto !important;
  flex: 1 1 0 !important;
  min-height: 0 !important;
}
html.ds-247420 .app { height: calc(100vh - 42px) !important; overflow: hidden; }
html.ds-247420 .app-status {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: 42px; z-index: 100;
  background: var(--bg);
}

/* Empty chat-thread placeholder — sentinel child blocks :empty, so target sentinel-only */
html.ds-247420 .chat-thread:has(> [data-scroll-sentinel]:only-child)::before,
html.ds-247420 .chat-thread[data-msg-count="0"]::before {
  content: 'no messages yet\Astart the conversation';
  white-space: pre;
  color: var(--fg-3);
  font-family: var(--ff-mono);
  font-size: var(--fs-sm);
  text-align: center;
  margin: auto;
  opacity: 0.6;
  pointer-events: none;
  line-height: 1.6;
}

/* Legacy overlays (#videoPlayback, #settingsPopover) carried no position rule,
   so they sat in normal flow below the SDK app and inflated document.body
   scrollHeight. They are fixed overlays, hidden until their controller activates them. */
html.ds-247420 .video-playback {
  position: fixed;
  right: 16px;
  bottom: 64px;
  z-index: 2600;
  display: none;
  max-width: 320px;
  background: var(--bg-2);
  border: 1px solid var(--bg-4);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
html.ds-247420 .video-playback video { display: block; width: 100%; height: auto; }
html.ds-247420 .video-playback .video-label {
  padding: 4px 8px;
  font-size: var(--fs-sm);
  color: var(--fg-2);
}
html.ds-247420 .settings-popover {
  position: fixed;
  right: 16px;
  bottom: 64px;
  z-index: 2600;
  display: none;
  width: 280px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 16px;
  background: var(--bg-2);
  border: 1px solid var(--bg-4);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
html.ds-247420 .settings-popover.open { display: block; }
html.ds-247420 .hidden-input {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* SDK ThreadPanel / ForumView own their chrome; hide the legacy duplicate
   header/list/search that threadManager used to render into, so the panels
   don't show two close buttons / two post lists. */
html.ds-247420 #threadPanel > .thread-panel-header,
html.ds-247420 #threadPanel > #threadList,
html.ds-247420 #threadPanel > div:has(> #createThreadBtn),
html.ds-247420 #forumView > .forum-header-bar,
html.ds-247420 #forumView > #forumPosts { display: none !important; }

html.ds-247420 .rail-empty {
  padding: 8px 12px;
  font-size: var(--fs-sm);
  color: var(--fg-3);
  opacity: 0.6;
  font-family: var(--ff-mono);
}
