/* ============================================================
   Venice Meeting Stage — PWA design system
   Breakpoints: mobile <768px · tablet 768–1024px · desktop >1024px
   ============================================================ */

:root {
  --bg: #130f18;
  --surface-0: #170f1e;
  --surface-1: #221c2a;
  --surface-2: #2c2438;
  --surface-3: #362c45;
  --surface-bubble-in: rgba(255, 255, 255, 0.05);
  --surface-bubble-out: linear-gradient(135deg, rgba(141, 240, 204, 0.22), rgba(127, 200, 255, 0.14));
  --ink: #f7f1e8;
  --muted: #c7bdce;
  --faint: #8f8499;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --accent: #8df0cc;
  --accent-2: #f69d7a;
  --accent-3: #a38cff;
  --warning: #ffd36e;
  --danger: #ff8f8f;
  --speaker-pat: #7fc8ff;
  --speaker-drew: #f69d7a;
  --speaker-connie: #a38cff;
  --speaker-chad: #8df0cc;
  --speaker-kara: #ff9ecf;
  --speaker-kai: #ffd36e;
  --speaker-james: #38bdf8;
  --speaker-default: #8f8499;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 6px 24px rgba(0, 0, 0, 0.22);
  --glass: rgba(34, 28, 42, 0.72);
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --touch: 44px;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
}

body {
  overscroll-behavior-y: contain;
  -webkit-tap-highlight-color: transparent;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }

.hidden { display: none !important; }

/* minimal custom scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }
*::-webkit-scrollbar-track { background: transparent; }

.icon-btn {
  min-width: var(--touch);
  min-height: var(--touch);
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
  flex: none;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.12); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 20px; height: 20px; }

.pill, .ghost, .cta, .mini-btn {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  padding: 10px 14px;
  font-weight: 700;
  min-height: var(--touch);
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}
.pill:hover, .ghost:hover, .mini-btn:hover { background: rgba(255, 255, 255, 0.12); }
.ghost { background: transparent; }
.cta {
  background: linear-gradient(135deg, var(--accent), #7fc8ff);
  color: #091218;
  border: none;
}
.cta:active, .pill:active, .ghost:active, .mini-btn:active { transform: scale(0.97); }
.mini-btn { padding: 8px 12px; font-size: 0.88rem; }

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 700;
}

.tiny { color: var(--muted); font-size: 0.82rem; line-height: 1.35; }

/* ============================================================
   App shell — 1 / 2 / 3 column responsive grid
   ============================================================ */

.shell {
  height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
}

.sidebar {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--surface-0);
  border-right: 1px solid var(--line);
}

.sidebar-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(var(--safe-top) + 12px) 14px 12px;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  color: #10131a; font-weight: 900; font-size: 0.95rem;
}
.brand-name { font-weight: 800; font-size: 1rem; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 0.72rem; color: var(--faint); white-space: nowrap; }

.sidebar-collapse { display: none; }

.sidebar-search { padding: 0 14px 10px; }
.sidebar-search input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  min-height: var(--touch);
}

.thread-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 10px 10px;
  display: grid;
  gap: 6px;
  align-content: start;
}

.thread-section {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--faint);
  padding: 10px 8px 4px;
}

.thread-item {
  position: relative;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid transparent;
  cursor: pointer;
  min-height: 52px;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
  text-align: left;
  width: 100%;
}
.thread-item:hover { background: rgba(255, 255, 255, 0.06); }
.thread-item.active {
  background: rgba(141, 240, 204, 0.10);
  border-color: rgba(141, 240, 204, 0.35);
}
.thread-avatar {
  width: 40px; height: 40px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-weight: 800; font-size: 0.9rem;
  color: var(--accent-3);
  overflow: hidden;
}
.thread-avatar img { width: 100%; height: 100%; object-fit: cover; }
.thread-meta { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.thread-name { display: block; min-width: 0; font-weight: 700; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-sub { display: block; min-width: 0; font-size: 0.76rem; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.thread-remove {
  position: absolute; right: 6px; top: 6px;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--faint); font-size: 1rem; line-height: 1;
  opacity: 0; transition: opacity 0.2s ease;
}
.thread-item:hover .thread-remove { opacity: 1; }

.new-thread-fab {
  position: absolute;
  right: 18px;
  bottom: calc(var(--safe-bottom) + 84px);
  width: 56px; height: 56px;
  border-radius: 20px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #7fc8ff);
  color: #091218;
  box-shadow: var(--shadow-sm);
  z-index: 5;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.new-thread-fab:active { transform: scale(0.94); }
.new-thread-fab svg { width: 24px; height: 24px; }
/* profile card docked at sidebar bottom */
.profile-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px calc(var(--safe-bottom) + 12px);
  border-top: 1px solid var(--line);
  background: var(--surface-0);
  width: 100%;
  transition: background 0.2s ease;
}
.profile-card:hover { background: rgba(255, 255, 255, 0.05); }
.profile-avatar {
  position: relative;
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent-3), var(--accent-2));
  color: #10131a; font-weight: 900;
}
.status-dot {
  position: absolute; right: -1px; bottom: -1px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #35d487;
  border: 2.5px solid var(--surface-0);
}
.profile-meta { flex: 1; min-width: 0; text-align: left; }
.profile-name { font-weight: 700; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-status { font-size: 0.74rem; color: var(--faint); }

/* ---------- Chat column ---------- */

.chatcol {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  position: relative;
  background: var(--bg);
}

.chat-head {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(var(--safe-top) + 8px) 12px 8px;
  background: var(--glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  min-height: calc(var(--safe-top) + 60px);
}

.chat-back { display: grid; }
.room-avatar {
  width: 40px; height: 40px; border-radius: 14px; flex: none;
  display: grid; place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-weight: 900; color: var(--accent);
  overflow: hidden;
}
.room-avatar img { width: 100%; height: 100%; object-fit: cover; }
.room-id-title { font-weight: 800; font-size: 1rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-id-title-btn {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  min-height: 40px;
  display: flex;
  align-items: center;
}
.room-id-title-btn:active { opacity: 0.6; }

.thread-edit-card { width: min(480px, 100%); }
.thread-id-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.thread-id-current {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.85rem;
  word-break: break-all;
  user-select: all;
  -webkit-user-select: all;
  overflow-wrap: anywhere;
}
.thread-id-row .mini-btn { flex: none; }
.room-id-sub { font-size: 0.74rem; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.thread-id-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 260px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  min-height: var(--touch);
}
.thread-id-pill label { font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); flex: none; }
.thread-id-pill input {
  border: none;
  background: transparent;
  color: var(--ink);
  font-size: 0.86rem;
  min-width: 0;
  width: 100%;
  padding: 0;
}
.thread-id-pill input:focus { outline: none; }

.chat-menu-wrap { position: relative; }
.chat-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  background: var(--surface-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 40;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* chat feed */
.chat-feed {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feed-empty {
  margin: auto;
  text-align: center;
  color: var(--faint);
  max-width: 340px;
  display: grid;
  gap: 8px;
  padding: 30px 10px;
}

.day-divider {
  align-self: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--faint);
  background: var(--surface-1);
  border: 1px solid var(--line);
  padding: 4px 12px;
  border-radius: 999px;
}

.msg-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  max-width: min(720px, 92%);
  margin-right: auto;
}
.msg-row.out { margin-left: auto; margin-right: 0; flex-direction: row-reverse; }

.msg-row[data-speaker="pat"] { --msg-accent: var(--speaker-pat); }
.msg-row[data-speaker="drew"] { --msg-accent: var(--speaker-drew); }
.msg-row[data-speaker="connie"] { --msg-accent: var(--speaker-connie); }
.msg-row[data-speaker="chad"] { --msg-accent: var(--speaker-chad); }
.msg-row[data-speaker="kara"] { --msg-accent: var(--speaker-kara); }
.msg-row[data-speaker="kai"] { --msg-accent: var(--speaker-kai); }

.msg-avatar {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  font-size: 0.76rem; font-weight: 900;
  background: color-mix(in srgb, var(--msg-accent, var(--surface-2)) 20%, var(--surface-2));
  color: var(--msg-accent, var(--faint));
  border: 1px solid color-mix(in srgb, var(--msg-accent, var(--line)) 45%, var(--line));
  overflow: hidden;
  margin-bottom: 4px;
}
.msg-avatar img { width: 100%; height: 100%; object-fit: cover; }

.msg-bubble {
  position: relative;
  padding: 10px 14px;
  border-radius: 20px;
  border-bottom-left-radius: 8px;
  background: var(--surface-bubble-in);
  border: 1px solid var(--line);
  min-width: 0;
}
.msg-row.out .msg-bubble {
  background: var(--surface-bubble-out);
  border-color: rgba(141, 240, 204, 0.30);
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 8px;
}

.msg-meta { display: flex; gap: 8px; align-items: baseline; margin-bottom: 4px; }
.msg-name { font-size: 0.82rem; font-weight: 800; color: var(--msg-accent, var(--ink)); }
.msg-row.out .msg-name { color: var(--accent); }
.msg-time { font-size: 0.68rem; color: var(--faint); }
.msg-body {
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.95rem;
}

.msg-actions {
  position: absolute;
  top: -20px;
  right: 4px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transform: translateY(4px);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.msg-row.out .msg-actions { right: auto; left: 4px; }
.msg-row:hover .msg-actions, .msg-actions.sticky { opacity: 1; transform: none; }
.msg-action {
  width: var(--touch); height: var(--touch);
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--surface-1);
  border: 1px solid var(--line-strong);
  color: var(--muted);
  box-shadow: var(--shadow-sm);
  font-size: 0.78rem; font-weight: 800;
}
.msg-action:hover { color: var(--ink); background: var(--surface-3); }
@media (pointer: fine) {
  .msg-actions { top: -16px; }
  .msg-action { width: 30px; height: 30px; border-radius: 10px; font-size: 0.72rem; }
}

.typing-banner {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--glass);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}

/* ---------- Composer dock ---------- */

.composer-dock {
  position: relative;
  padding: 10px 12px calc(var(--safe-bottom) + 10px);
  background: var(--glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}

.composer {
  display: grid;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 10px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.composer:focus-within {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: var(--shadow-sm), 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.composer-main {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.composer textarea {
  flex: 1;
  min-height: var(--touch);
  max-height: 140px;
  resize: none;
  border: none;
  background: transparent;
  color: var(--ink);
  padding: 10px 4px;
  line-height: 1.4;
}
.composer textarea:focus { outline: none; }

.composer-send {
  width: var(--touch);
  height: var(--touch);
  border-radius: 16px;
  flex: none;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), #7fc8ff);
  color: #091218;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.composer-send:active { transform: scale(0.94); }
.composer-send svg { width: 20px; height: 20px; }
.composer-send:disabled { opacity: 0.45; }

.emoji-pop {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 12px;
  width: min(280px, calc(100vw - 32px));
  background: var(--surface-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  z-index: 30;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.emoji-pop.open { opacity: 1; transform: none; pointer-events: auto; }
.emoji-pop button {
  min-height: 34px;
  border-radius: 8px;
  font-size: 1.1rem;
}
.emoji-pop button:hover { background: rgba(255, 255, 255, 0.08); }

.composer-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 0;
  min-height: 24px;
}
.statusline { color: var(--muted); font-size: 0.8rem; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.composer-config {
  display: grid;
  gap: 8px;
  padding: 0 4px;
}
.composer-config .field-grid { display: grid; gap: 8px; }
.composer-config input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  min-height: var(--touch);
}

/* ---------- Inspector column (desktop) ---------- */

.inspector {
  grid-column: 3;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--surface-0);
  border-left: 1px solid var(--line);
}

.inspector-tabs {
  display: flex;
  gap: 4px;
  padding: calc(var(--safe-top) + 10px) 12px 8px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.inspector-tab {
  flex: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--muted);
  min-height: var(--touch);
  transition: background 0.2s ease, color 0.2s ease;
}
.inspector-tab.active {
  background: rgba(141, 240, 204, 0.12);
  color: var(--accent);
}

.inspector-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
  display: grid;
  gap: 14px;
  align-content: start;
}

.inspector-pane { display: none; }
.inspector-pane.active { display: grid; gap: 14px; }

.panel-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.panel-title { font-size: 1rem; font-weight: 800; }
.panel-subtitle { color: var(--muted); font-size: 0.82rem; }
.panel-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; }

.typing-banner.show { display: flex; }
.typing-banner .dots { display: inline-flex; gap: 3px; }
.typing-banner .dots i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  animation: typingPulse 1.2s ease-in-out infinite;
}
.typing-banner .dots i:nth-child(2) { animation-delay: 0.15s; }
.typing-banner .dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingPulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

.chat-menu.open { opacity: 1; transform: none; pointer-events: auto; }
.chat-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  min-height: var(--touch);
  text-align: left;
}
.chat-menu button:hover { background: rgba(255, 255, 255, 0.07); }

/* ---------- Stage / speaker / queue / roster (inspector contents) ---------- */

.stage-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stat-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.14);
  padding: 12px;
  display: grid;
  gap: 4px;
}

.stat-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-value { font-size: 1rem; font-weight: 800; }

.speaker-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: center;
}

.avatar {
  position: relative;
  width: 110px;
  aspect-ratio: 1;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  overflow: hidden;
  justify-self: center;
}
.avatar svg { width: 88%; height: 88%; }
.avatar.speaking {
  box-shadow: 0 0 0 2px rgba(141, 240, 204, 0.55), 0 0 28px rgba(141, 240, 204, 0.18);
  animation: pulseSpeak 1s ease-in-out infinite;
}
@keyframes pulseSpeak { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }

.speaker-meta { display: grid; gap: 8px; }
.speaker-name { font-size: 1.4rem; font-weight: 900; line-height: 1; }
.speaker-role { color: var(--muted); font-size: 0.9rem; }

.speaker-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.speaker-pill {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
}
.speaker-pill.accent { background: rgba(141, 240, 204, 0.12); color: var(--accent); }
.speaker-pill.warning { background: rgba(255, 211, 110, 0.12); color: var(--warning); }

.speech {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  font-size: 0.95rem;
  line-height: 1.45;
  max-height: 180px;
  overflow-y: auto;
}

.queue-panel {
  display: grid;
  gap: 12px;
}
.queue-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.queue-title { font-size: 0.95rem; font-weight: 800; }
.queue-meta { font-size: 0.82rem; color: var(--muted); }
.queue-mode { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.queue-mode label { font-size: 0.82rem; color: var(--muted); font-weight: 700; }
.queue-mode select { min-width: 150px; padding: 10px 12px; border-radius: 999px; }
.queue-controls { display: flex; gap: 8px; flex-wrap: wrap; }

.queue-list { display: grid; gap: 8px; }
.queue-item {
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 12px;
  display: grid;
  gap: 7px;
}
.queue-item.speaking { outline: 2px solid rgba(141, 240, 204, 0.9); }
.queue-item.next { outline: 2px solid rgba(163, 140, 255, 0.42); }
.queue-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.queue-speaker { font-weight: 800; }
.queue-state { font-size: 0.78rem; color: var(--muted); }
.queue-excerpt { color: var(--ink); font-size: 0.88rem; line-height: 1.35; }
.queue-progress { width: 100%; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.queue-progress > span { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), #7fc8ff); transition: width 0.2s linear; }

.roster-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.member {
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  padding: 12px;
  display: grid;
  gap: 8px;
}
.member.active { outline: 2px solid rgba(141, 240, 204, 0.85); }
.member-head { display: flex; align-items: center; gap: 10px; }
.avatar-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent-3);
  box-shadow: 0 0 0 4px rgba(163, 140, 255, 0.12);
  flex: none;
}
.member-name { font-weight: 800; }
.member-status { font-size: 0.82rem; color: var(--muted); }
.member-role { font-size: 0.78rem; color: var(--muted); line-height: 1.35; }
.member-model { font-size: 0.78rem; color: var(--accent); word-break: break-word; }

.roster-editor { display: grid; gap: 10px; }
.agent-row {
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  display: grid;
  gap: 10px;
}
.agent-check { display: flex; align-items: start; gap: 12px; }
.agent-check input { width: auto; margin-top: 2px; min-height: var(--touch); min-width: var(--touch); }
.agent-desc { color: var(--muted); font-size: 0.82rem; line-height: 1.35; }

.diag {
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line-strong);
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  background: rgba(0, 0, 0, 0.14);
}

.field-grid { display: grid; gap: 8px; }

.reply-tag {
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.72rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-weight: 700;
}
.msg-row[data-speaker] .reply-tag:first-child {
  color: var(--msg-accent, var(--muted));
  border-color: color-mix(in srgb, var(--msg-accent, var(--line)) 40%, var(--line));
  background: color-mix(in srgb, var(--msg-accent, transparent) 14%, transparent);
}

/* ---------- Overlay: backdrop, drawers, sheets, modals ---------- */

.overlay-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 3, 6, 0.55);
  z-index: 45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.overlay-backdrop.show { opacity: 1; pointer-events: auto; }

/* roster sheet — bottom sheet on mobile, right drawer on tablet/desktop */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  background: rgba(3, 3, 6, 0.55);
}
.sheet.hidden { display: none; }

.sheet-card {
  width: min(760px, 100%);
  max-height: min(82dvh, 900px);
  overflow-y: auto;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--surface-1);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  color: var(--ink);
  animation: sheetUp 0.25s var(--ease);
}
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.sheet-inner { padding: 16px; display: grid; gap: 14px; }
.sheet-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pillrow { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* settings modal — centered with backdrop blur */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(3, 3, 6, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal.hidden { display: none; }

.modal-card {
  width: min(620px, 100%);
  max-height: min(84dvh, 760px);
  display: flex;
  flex-direction: column;
  background: var(--surface-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: modalIn 0.22s var(--ease);
}
@keyframes modalIn { from { transform: scale(0.96) translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px 0;
}

.modal-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 18px 0;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.modal-tab {
  flex: none;
  padding: 10px 14px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  min-height: var(--touch);
}
.modal-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.modal-body { padding: 16px 18px; overflow-y: auto; display: grid; gap: 14px; }
.modal-pane { display: none; }
.modal-pane.active { display: grid; gap: 14px; }

.setting-row {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.setting-row label { font-weight: 700; font-size: 0.9rem; }
.setting-row .tiny { margin: 0; }
.setting-row input[type="text"], .setting-row input[type="password"], .setting-row select {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  min-height: var(--touch);
}

/* quick switcher */
.quick-switch {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: start center;
  padding: calc(var(--safe-top) + 12vh) 16px 16px;
  background: rgba(3, 3, 6, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.quick-switch.hidden { display: none; }
.quick-card {
  width: min(520px, 100%);
  background: var(--surface-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: modalIn 0.2s var(--ease);
}
.quick-card input {
  width: 100%;
  padding: 14px 16px;
  border: none;
  background: transparent;
  color: var(--ink);
  font-size: 1rem;
  border-bottom: 1px solid var(--line);
}
.quick-card input:focus { outline: none; }
.quick-results { max-height: 320px; overflow-y: auto; padding: 6px; }

.reply-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.install-banner {
  display: none;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(141, 240, 204, 0.09);
  border: 1px solid rgba(141, 240, 204, 0.24);
}
.install-banner.show { display: flex; }

/* ============================================================
   Responsive modes
   ============================================================ */

/* ---------- Mobile portrait (<768px): single-column drill-down ---------- */

@media (max-width: 767px) {
  .shell { grid-template-columns: 1fr; }

  /* both columns are full-screen views; JS toggles which is visible */
  .sidebar, .chatcol {
    grid-column: 1;
    grid-row: 1;
    transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
  }

  body[data-mobile-view="threads"] .chatcol {
    transform: translateX(18%);
    opacity: 0;
    pointer-events: none;
  }
  body[data-mobile-view="chat"] .sidebar {
    transform: translateX(-18%);
    opacity: 0;
    pointer-events: none;
  }

  .inspector { display: none; }
  .inspector.mobile-drawer {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 55;
    grid-column: auto;
    background: var(--surface-0);
    transform: translateX(100%);
    transition: transform 0.25s var(--ease);
  }
  .inspector.mobile-drawer.open { transform: none; }

  .sidebar { position: relative; }
  .new-thread-fab { display: grid; }

  .chat-back { display: grid; }
  .thread-id-pill { max-width: none; flex: 1; }

  .msg-row { max-width: 88%; }

  /* compact mobile header: shrink to ~48px content height, drop non-essentials */
  .chat-head {
    min-height: calc(var(--safe-top) + 48px);
    padding: calc(var(--safe-top) + 6px) 8px 6px;
    gap: 8px;
  }
  .room-avatar { width: 32px; height: 32px; border-radius: 11px; }
  .room-id-sub { display: none; }
  .thread-id-pill { display: none; }
}

/* mobile: hide desktop-only affordances */
.chat-back { display: none; }
.new-thread-fab { display: none; }

/* ---------- Tablet (768–1024px): master-detail + slide-over drawers ---------- */

@media (min-width: 768px) and (max-width: 1024px) {
  .shell { grid-template-columns: 320px minmax(0, 1fr); }
  .sidebar { grid-row: 1; }
  .chatcol { grid-row: 1; }
  .inspector { display: none; }

  /* inspector becomes a right-edge slide-over drawer with backdrop */
  .inspector.tablet-drawer {
    display: flex;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(400px, 92vw);
    z-index: 55;
    grid-column: auto;
    background: var(--surface-0);
    border-left: 1px solid var(--line-strong);
    box-shadow: var(--shadow);
    transform: translateX(105%);
    transition: transform 0.25s var(--ease);
  }
  .inspector.tablet-drawer.open { transform: none; }

  .sidebar-collapse { display: none; }
  .thread-remove { opacity: 1; }
}

/* ---------- Desktop (>1024px): three columns ---------- */

@media (min-width: 1025px) {
  .shell { grid-template-columns: 280px minmax(0, 1fr) 350px; }
  .sidebar { grid-row: 1; }
  .chatcol { grid-row: 1; }
  .inspector { grid-row: 1; }
  .sidebar-collapse { display: grid; }

  /* collapsible sidebar → icon rail */
  .shell.sidebar-collapsed { grid-template-columns: 72px minmax(0, 1fr) 350px; }
  .shell.sidebar-collapsed .sidebar-head { flex-direction: column; gap: 8px; padding-bottom: 4px; }
  .shell.sidebar-collapsed .sidebar-collapse svg { transform: rotate(180deg); }
  .shell.sidebar-collapsed .brand-name,
  .shell.sidebar-collapsed .brand-sub,
  .shell.sidebar-collapsed .sidebar-search,
  .shell.sidebar-collapsed .thread-meta,
  .shell.sidebar-collapsed .thread-remove,
  .shell.sidebar-collapsed .profile-meta { display: none; }
  .shell.sidebar-collapsed .thread-item { grid-template-columns: 1fr; justify-items: center; padding: 8px 0; }
  .shell.sidebar-collapsed .profile-card { justify-content: center; padding-inline: 8px; }

  .stage-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .speaker-card { grid-template-columns: 1fr; }
  .avatar { width: 110px; }
  .thread-remove { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* ============================================================
   Zoom-Style Call Overlay & Grid
   ============================================================ */

.call-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #090a0f;
  color: #f7f1e8;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.98);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  overflow: hidden;
}

.call-overlay.active {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.call-header {
  height: calc(var(--safe-top) + 52px);
  padding: var(--safe-top) 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(12, 13, 18, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex: none;
  z-index: 10;
}

.call-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.call-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #4ade80;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.call-header-badge .live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: liveDotPulse 1.5s infinite ease-in-out;
}

@keyframes liveDotPulse {
  0%, 100% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
}

.call-header-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #f7f1e8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.call-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.call-grid-container {
  flex: 1;
  min-height: 0;
  padding: 10px 14px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.call-grid {
  width: 100%;
  height: 100%;
  max-width: 100%;
  margin: 0 auto;
  display: grid;
  gap: 14px;
  /* JS overrides columns/rows for a two-row layout based on tile count */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  align-content: stretch;
  justify-content: center;
}

.call-tile {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 180px;
  background: #151620;
  border-radius: var(--radius-md);
  border: 2px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  user-select: none;
}

.call-tile.is-speaking {
  border-color: #22c55e;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.35), 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Mobile: portrait = 4 cols x 2 rows; landscape = 2 cols x 4 rows.
   NOTE: landscape is detected by small HEIGHT, because once the orientation
   lock rotates a phone to landscape its width exceeds 767px. */
@media (max-width: 767px) and (orientation: portrait) {
  .call-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
  }
  .call-tile { min-height: 110px; }
  .call-tile-nametag { font-size: 0.7rem; padding: 3px 8px; }
}

@media (orientation: landscape) and (max-height: 520px) {
  .call-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(4, minmax(0, 1fr)) !important;
    gap: 8px;
  }
  .call-tile { min-height: 0; }
  .call-tile-nametag { font-size: 0.76rem; padding: 4px 10px; }
}

/* Mobile only: relocate the top call header into the bottom bar area
   to give the cards the full screen height. */
@media (max-width: 767px), (orientation: landscape) and (max-height: 520px) {
  .call-header {
    order: 3; /* after grid (1) and bottom bar (2 default) -> sits at the very bottom */
    height: auto;
    padding: 8px 16px calc(var(--safe-bottom) + 8px);
    background: #111218;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .call-bottom-bar {
    border-top: none;
    padding-bottom: 8px;
  }

  .call-grid-container {
    padding: 8px 10px;
  }
}

/* Landscape: compact layout — icon-only round PTT next to the caption bar,
   nametags in the top-left of each card */
@media (orientation: landscape) and (max-height: 520px) {
  .call-caption-bar { min-height: 24px; font-size: 0.78rem; padding: 3px 10px; flex: 1; min-width: 0; }

  /* bottom bar becomes a single row: caption bar with mic button on the right */
  .call-bottom-bar {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 8px;
  }
  .call-controls { width: auto; flex: none; }

  /* icon-only circular PTT button */
  .call-ptt-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    min-height: 0;
    border-radius: 50%;
    gap: 0;
    flex: none;
  }
  .call-ptt-btn svg { width: 20px; height: 20px; }
  #callPttLabel { display: none; }
  #callPttSub { display: none; }

  .call-header { padding-top: 6px; padding-bottom: calc(var(--safe-bottom) + 6px); gap: 8px; }
  .call-header-badge { font-size: 0.64rem; padding: 2px 8px; }
  .call-header-title { font-size: 0.78rem; }

  /* nametag pinned to the top-left of each card */
  .call-tile-nametag { top: 6px !important; left: 6px !important; bottom: auto !important; }
}

.call-tile.is-offline {
  opacity: 0.45;
  filter: grayscale(60%);
}

.call-tile-avatar-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: #0f172a;
}

.call-tile-avatar-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.call-tile-avatar-wrap svg rect:first-of-type {
  rx: 0 !important;
  ry: 0 !important;
}
.call-tile-nametag {
  position: absolute;
  bottom: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 16, 24, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #f7f1e8;
  max-width: calc(100% - 20px);
  pointer-events: none;
  z-index: 2;
}

.call-tile-nametag .tile-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.call-tile-nametag .tile-status-icon {
  width: 14px;
  height: 14px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
}

.call-tile.is-speaking .call-tile-nametag .tile-status-icon {
  color: #22c55e;
}

.call-tile-speaking-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  display: none;
  align-items: center;
  gap: 4px;
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.5);
  color: #4ade80;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 999px;
  pointer-events: none;
  z-index: 2;
}

.call-tile.is-speaking .call-tile-speaking-badge {
  display: inline-flex;
}

/* Call Bottom Bar & PTT */
.call-bottom-bar {
  flex: none;
  background: #111218;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 16px calc(var(--safe-bottom) + 12px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  z-index: 10;
}

.call-caption-bar {
  width: 100%;
  max-width: 900px;
  min-height: 32px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--muted);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.call-caption-bar.has-caption {
  color: #f7f1e8;
}

.call-caption-bar .caption-speaker {
  font-weight: 800;
  color: var(--accent);
  margin-right: 6px;
}

.call-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
}

.call-ptt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  color: #f7f1e8;
  font-size: 0.96rem;
  font-weight: 700;
  min-height: 48px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
}

.call-ptt-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
}

.call-ptt-btn:active {
  transform: scale(0.96);
}

.call-ptt-btn.recording {
  background: #dc2626;
  border-color: #ef4444;
  color: #ffffff;
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.65), 0 4px 16px rgba(0, 0, 0, 0.4);
  animation: pttPulse 1.2s infinite ease-in-out;
}

@keyframes pttPulse {
  0%, 100% { box-shadow: 0 0 16px rgba(239, 68, 68, 0.5); }
  50% { box-shadow: 0 0 32px rgba(239, 68, 68, 0.85), 0 0 8px #ffffff; }
}

.call-ptt-btn svg {
  width: 20px;
  height: 20px;
}

.call-ptt-sub {
  font-size: 0.74rem;
  color: var(--faint);
  text-align: center;
}

/* ============================================================
   SVG Avatar Animations (Head-bob, Eye-blink, Mouth-flap)
   ============================================================ */

.svg-head-group {
  transform-origin: 60px 80px;
  animation: headBob 4s ease-in-out infinite;
}

@keyframes headBob {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  30% { transform: translateY(-2.5px) rotate(0.4deg); }
  70% { transform: translateY(1.5px) rotate(-0.4deg); }
}

.svg-eyes {
  transform-origin: 60px 58px;
  animation: eyeBlink 5s infinite;
}

@keyframes eyeBlink {
  0%, 46%, 50%, 96%, 100% { transform: scaleY(1); }
  48%, 98% { transform: scaleY(0.08); }
}

/* Mouth Flap: closed by default, steps open/closed when tile .is-speaking */
.svg-mouth-closed {
  display: block;
}
.svg-mouth-open {
  display: none;
}

.call-tile.is-speaking .svg-mouth-closed {
  animation: mouthFlapClosed 0.32s steps(1, end) infinite;
}
.call-tile.is-speaking .svg-mouth-open {
  animation: mouthFlapOpen 0.32s steps(1, end) infinite;
}

@keyframes mouthFlapClosed {
  0%, 49% { display: none; }
  50%, 100% { display: block; }
}

@keyframes mouthFlapOpen {
  0%, 49% { display: block; }
  50%, 100% { display: none; }
}

/* Randomize animation offsets so avatars don't bob or blink in robotic unison */
.call-tile[data-key="james"] .svg-head-group { animation-delay: 0s; }
.call-tile[data-key="james"] .svg-eyes { animation-delay: 0.8s; }

.call-tile[data-key="pat"] .svg-head-group { animation-delay: -1.2s; }
.call-tile[data-key="pat"] .svg-eyes { animation-delay: -2.3s; }

.call-tile[data-key="drew"] .svg-head-group { animation-delay: -2.7s; }
.call-tile[data-key="drew"] .svg-eyes { animation-delay: -3.8s; }

.call-tile[data-key="connie"] .svg-head-group { animation-delay: -0.6s; }
.call-tile[data-key="connie"] .svg-eyes { animation-delay: -1.5s; }

.call-tile[data-key="chad"] .svg-head-group { animation-delay: -3.1s; }
.call-tile[data-key="chad"] .svg-eyes { animation-delay: -0.4s; }

.call-tile[data-key="kara"] .svg-head-group { animation-delay: -1.9s; }
.call-tile[data-key="kara"] .svg-eyes { animation-delay: -2.9s; }

.call-tile[data-key="kai"] .svg-head-group { animation-delay: -3.5s; }
.call-tile[data-key="kai"] .svg-eyes { animation-delay: -4.2s; }



