:root {
  color-scheme: dark;

  --bg-base: #07090d;
  --bg-elevated: #0c1018;
  --bg-raised: #11161f;
  --bg-overlay: rgba(8, 11, 17, 0.78);
  --surface-glass: rgba(20, 25, 36, 0.72);
  --surface-glass-strong: rgba(16, 21, 31, 0.92);

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text-primary: #f3f6fb;
  --text-secondary: #b6c1d3;
  --text-muted: #7a8699;
  --text-faint: #545f73;

  --accent: #5da7ff;
  --accent-strong: #3a8af0;
  --accent-glow: rgba(93, 167, 255, 0.32);
  --signal: #54e2c4;
  --warning: #f6c46a;
  --danger: #ef6a7e;
  --danger-strong: #d2495f;

  --shadow-soft: 0 12px 32px rgba(0, 0, 0, 0.32);
  --shadow-strong: 0 28px 64px rgba(0, 0, 0, 0.48);
  --shadow-dock: 0 22px 60px rgba(0, 0, 0, 0.55), 0 1px 0 rgba(255, 255, 255, 0.04) inset;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --speed-fast: 140ms;
  --speed-mid: 220ms;
  --ease: cubic-bezier(0.32, 0.72, 0.21, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100vh;
}

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background:
    radial-gradient(ellipse 60% 40% at 18% 8%, rgba(93, 167, 255, 0.10), transparent 60%),
    radial-gradient(ellipse 45% 35% at 88% 92%, rgba(84, 226, 196, 0.06), transparent 60%),
    linear-gradient(180deg, #060810 0%, #07090f 60%, #04060c 100%);
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.is-hidden,
[hidden] {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  padding: 20px clamp(20px, 4vw, 56px) 32px;
  position: relative;
  max-width: 1440px;
  margin: 0 auto;
}

.overlay-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 9, 0.55);
  backdrop-filter: blur(8px);
  z-index: 25;
}

/* ───────── Top bar ───────── */

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 14px 20px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent), var(--surface-glass);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-soft);
}

.top-bar-left,
.top-bar-right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: conic-gradient(from 220deg at 50% 50%, #5da7ff, #54e2c4, #5da7ff);
  box-shadow: 0 8px 24px rgba(93, 167, 255, 0.35);
}

.brand-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #06080d;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-text strong {
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.brand-text span {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.room-badge {
  display: flex;
  flex-direction: column;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  line-height: 1.1;
}

.room-badge-label {
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.room-badge strong {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.signal-quality {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
}

.signal-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 16px;
}

.signal-bars span {
  width: 3px;
  border-radius: 2px;
  background: var(--text-faint);
  transition: background var(--speed-mid) var(--ease), height var(--speed-mid) var(--ease);
}

.signal-bars span:nth-child(1) { height: 4px; }
.signal-bars span:nth-child(2) { height: 8px; }
.signal-bars span:nth-child(3) { height: 12px; }
.signal-bars span:nth-child(4) { height: 16px; }

.signal-bars[data-tier="good"] span { background: var(--signal); }
.signal-bars[data-tier="warning"] span:nth-child(-n+3) { background: var(--warning); }
.signal-bars[data-tier="warning"] span:nth-child(4) { background: var(--text-faint); }
.signal-bars[data-tier="danger"] span:nth-child(-n+1) { background: var(--danger); }
.signal-bars[data-tier="danger"] span:nth-child(n+2) { background: var(--text-faint); }
.signal-bars[data-tier="neutral"] span { background: var(--text-faint); }

.signal-quality-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.signal-label {
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.top-stat {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle);
}

.connection-chip {
  border: 1px solid rgba(93, 167, 255, 0.28);
  border-radius: 999px;
  padding: 10px 18px;
  background: rgba(93, 167, 255, 0.10);
  color: #d6e6ff;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background var(--speed-mid) var(--ease), border-color var(--speed-mid) var(--ease);
}

.connection-chip.is-good {
  border-color: rgba(84, 226, 196, 0.32);
  background: rgba(84, 226, 196, 0.10);
  color: #c6fff0;
}

.connection-chip.is-warning {
  border-color: rgba(246, 196, 106, 0.32);
  background: rgba(246, 196, 106, 0.10);
  color: #ffe4ad;
}

.connection-chip.is-danger {
  border-color: rgba(239, 106, 126, 0.32);
  background: rgba(239, 106, 126, 0.10);
  color: #ffc4cf;
}

/* ───────── Workspace ───────── */

.workspace {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-bottom: 24px;
}

.warning-banner {
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(246, 196, 106, 0.24);
  background: rgba(246, 196, 106, 0.08);
  color: #ffe2ad;
}

.warning-banner strong,
.warning-banner p {
  margin: 0;
}

.warning-banner p {
  margin-top: 4px;
  color: #f5e7c8;
  line-height: 1.5;
}

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

.participants-grid.is-solo {
  grid-template-columns: minmax(0, 720px);
  justify-content: center;
}

.empty-room {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  padding: 56px 24px;
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(ellipse 50% 40% at 50% 30%, rgba(93, 167, 255, 0.06), transparent 70%),
    rgba(255, 255, 255, 0.012);
  color: var(--text-secondary);
}

.empty-room strong {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.empty-room p {
  margin: 0;
  max-width: 440px;
  line-height: 1.55;
}

.empty-room-illustration {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: rgba(93, 167, 255, 0.08);
  color: var(--accent);
  border: 1px solid rgba(93, 167, 255, 0.18);
}

.empty-room-illustration svg {
  width: 40px;
  height: 40px;
}

.participant-card.is-deafened {
  box-shadow: inset 0 0 0 1px rgba(239, 106, 126, 0.28);
}

.participant-badge.danger {
  background: rgba(239, 106, 126, 0.14);
  color: #ffc6d0;
  border-color: rgba(239, 106, 126, 0.32);
}

.screen-share-stage {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(93, 167, 255, 0.08), transparent 70%),
    var(--surface-glass-strong);
  box-shadow: var(--shadow-soft);
}

.screen-share-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.screen-share-header strong {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.screen-share-actions {
  display: flex;
  gap: 8px;
}

.screen-share-video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border-subtle) inset;
}

.screen-share-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.screen-share-stage:fullscreen {
  border-radius: 0;
  padding: 16px;
  background: #000;
}

.screen-share-stage:fullscreen .screen-share-video-wrap {
  height: calc(100vh - 80px);
  aspect-ratio: auto;
}

.participant-badge.good {
  background: rgba(84, 226, 196, 0.14);
  color: #c6fff0;
  border-color: rgba(84, 226, 196, 0.32);
}

.participant-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  min-height: 240px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(93, 167, 255, 0.08), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 60%),
    var(--surface-glass-strong);
  transition: border-color var(--speed-mid) var(--ease), transform var(--speed-mid) var(--ease), box-shadow var(--speed-mid) var(--ease);
  isolation: isolate;
  overflow: hidden;
}

.participant-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 1px solid transparent;
  pointer-events: none;
  transition: border-color var(--speed-mid) var(--ease), opacity var(--speed-mid) var(--ease);
  opacity: 0;
}

.participant-card.is-speaking::before {
  border-color: rgba(93, 167, 255, 0.45);
  box-shadow: 0 0 0 6px rgba(93, 167, 255, 0.06), 0 18px 48px rgba(93, 167, 255, 0.18);
  opacity: 1;
}

.participant-card.is-empty {
  opacity: 0.7;
}

.participant-card.is-muted .participant-badge {
  background: rgba(239, 106, 126, 0.14);
  color: #ffc6d0;
}

.participant-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.participant-identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.participant-avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #5da7ff 0%, #3a8af0 100%);
  color: #061018;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 1.15rem;
  box-shadow: 0 8px 20px rgba(93, 167, 255, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  position: relative;
}

.participant-avatar.guest {
  background: linear-gradient(135deg, #54e2c4 0%, #2da691 100%);
  box-shadow: 0 8px 20px rgba(84, 226, 196, 0.24), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.participant-card.is-speaking .participant-avatar::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  border: 2px solid currentColor;
  opacity: 0.4;
  animation: pulse-soft 1.6s ease-in-out infinite;
}

.participant-role {
  margin: 0 0 4px;
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.participant-name {
  display: block;
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.participant-badge-stack,
.participant-top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.participant-badge {
  flex: none;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(93, 167, 255, 0.14);
  color: #c8defe;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  border: 1px solid rgba(93, 167, 255, 0.18);
}

.participant-badge.muted {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border-color: var(--border-subtle);
}

.participant-badge.danger {
  background: rgba(239, 106, 126, 0.16);
  color: #ffc4cf;
  border-color: rgba(239, 106, 126, 0.3);
}

.participant-action-button {
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 0.82rem;
  transition: background var(--speed-mid) var(--ease), border-color var(--speed-mid) var(--ease);
}

.participant-action-button:hover:not(:disabled) {
  background: rgba(93, 167, 255, 0.10);
  border-color: rgba(93, 167, 255, 0.25);
  color: var(--text-primary);
}

.participant-hint {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.55;
  font-size: 0.92rem;
}

.participant-meter-block {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.025);
}

.meter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.meter-label {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.meter-track {
  position: relative;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.meter-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--signal), var(--accent));
  transition: width 90ms linear;
}

.meter-threshold {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: var(--warning);
  box-shadow: 0 0 8px rgba(246, 196, 106, 0.55);
}

.voice-visual {
  position: relative;
  isolation: isolate;
  min-height: 68px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at center, rgba(93, 167, 255, 0.14), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
  overflow: hidden;
}

.voice-ring {
  position: absolute;
  inset: 50%;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transform: translate(-50%, -50%) scale(0.6);
  opacity: 0.35;
}

.voice-ring.ring-1 { width: 44px; height: 44px; }
.voice-ring.ring-2 { width: 70px; height: 70px; }
.voice-ring.ring-3 { width: 96px; height: 96px; }

.voice-visual.is-speaking .voice-ring {
  border-color: rgba(93, 167, 255, 0.32);
  animation: pulse-ring 2s ease-in-out infinite;
}

.voice-visual.is-speaking .ring-2 { animation-delay: 0.2s; }
.voice-visual.is-speaking .ring-3 { animation-delay: 0.4s; }

.voice-bars {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 32px;
}

.voice-bars span {
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, #9bc4ff, var(--accent-strong));
  opacity: 0.3;
  transform-origin: center;
  transition: height 80ms linear, opacity 120ms ease;
  max-height: 28px;
}

.voice-visual.is-speaking .voice-bars span {
  opacity: 1;
}

/* ───────── Status row ───────── */

.status-row {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--surface-glass);
  backdrop-filter: blur(14px);
}

.status-cell {
  padding: 8px 10px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  min-width: 0;
}

.status-label {
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.status-message {
  margin: 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* ───────── Control dock ───────── */

.control-dock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 28px;
  border: 1px solid var(--border-default);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent), var(--surface-glass-strong);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow-dock);
  position: sticky;
  bottom: 16px;
  z-index: 22;
}

.control-dock-inner {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.dock-divider {
  width: 1px;
  height: 28px;
  background: var(--border-subtle);
  margin: 0 4px;
}

.dock-button {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  padding: 10px 14px;
  border-radius: 14px;
  min-width: 64px;
  transition: background var(--speed-fast) var(--ease), color var(--speed-fast) var(--ease), border-color var(--speed-fast) var(--ease), transform var(--speed-fast) var(--ease);
}

.dock-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.dock-button:active:not(:disabled) {
  transform: translateY(1px);
}

.dock-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
}

.dock-icon svg {
  width: 22px;
  height: 22px;
}

.dock-label {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.dock-button:hover:not(:disabled) .dock-label {
  color: var(--text-secondary);
}

.dock-button.primary {
  background: linear-gradient(180deg, #62b3ff, #3787e8);
  color: #051119;
  box-shadow: 0 12px 28px rgba(58, 138, 240, 0.45);
  border-color: rgba(255, 255, 255, 0.12);
}

.dock-button.primary .dock-label {
  color: #061119;
  font-weight: 600;
}

.dock-button.primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #74bdff, #4192ed);
  color: #051119;
}

.dock-button.danger {
  background: rgba(239, 106, 126, 0.10);
  color: #ffb6c1;
  border-color: rgba(239, 106, 126, 0.24);
}

.dock-button.danger:hover:not(:disabled) {
  background: rgba(239, 106, 126, 0.18);
  color: #ffd3da;
  border-color: rgba(239, 106, 126, 0.4);
}

.dock-button.is-active {
  background: rgba(239, 106, 126, 0.16);
  color: #ffc4cf;
  border-color: rgba(239, 106, 126, 0.32);
}

.dock-button.is-active .dock-label {
  color: #ffc4cf;
}

.control-dock-meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.meta-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.meta-cell span {
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.62rem;
}

.meta-cell strong {
  color: var(--text-secondary);
  font-weight: 500;
}

/* ───────── Drawers ───────── */

.audio-panel,
.settings-drawer {
  position: fixed;
  top: 24px;
  right: 24px;
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  padding: 16px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-default);
  background: var(--surface-glass-strong);
  backdrop-filter: blur(28px);
  box-shadow: var(--shadow-strong);
  transform: translateX(calc(100% + 40px));
  opacity: 0;
  pointer-events: none;
  transition: transform var(--speed-mid) var(--ease), opacity var(--speed-mid) var(--ease);
  z-index: 30;
}

.settings-drawer {
  width: min(500px, calc(100vw - 32px));
  z-index: 32;
}

.audio-panel.is-open,
.settings-drawer.is-open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 4px 14px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}

.drawer-eyebrow,
.section-eyebrow {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 4px;
}

.drawer-header strong {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.drawer-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border-default);
  margin-bottom: 14px;
}

.drawer-tab {
  flex: 1 1 auto;
  min-width: 64px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-secondary);
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-align: center;
  transition: background var(--speed-fast) var(--ease), color var(--speed-fast) var(--ease), border-color var(--speed-fast) var(--ease), transform var(--speed-fast) var(--ease);
  white-space: nowrap;
  cursor: pointer;
}

.drawer-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-subtle);
}

.drawer-tab:active {
  transform: translateY(1px);
}

.drawer-tab.is-active {
  background: linear-gradient(180deg, rgba(93, 167, 255, 0.22), rgba(93, 167, 255, 0.12));
  color: #f1f6ff;
  border-color: rgba(93, 167, 255, 0.45);
  box-shadow: 0 4px 14px rgba(93, 167, 255, 0.18), 0 0 0 1px rgba(93, 167, 255, 0.18) inset;
}

.drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.drawer-body::-webkit-scrollbar {
  width: 6px;
}

.drawer-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.drawer-panel {
  display: grid;
  gap: 12px;
}

.settings-section {
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.025);
}

.settings-section.danger-section {
  border-color: rgba(239, 106, 126, 0.18);
  background: rgba(239, 106, 126, 0.04);
}

.card-section-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-section-top strong {
  font-size: 0.95rem;
  font-weight: 600;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.field span,
.toggle-row span {
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.field select,
.field input[type="text"],
.field input[type="number"] {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--speed-fast) var(--ease);
}

.field select:focus,
.field input:focus {
  border-color: rgba(93, 167, 255, 0.5);
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 6px 0;
}

.toggle-row input[type="checkbox"] {
  appearance: none;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  position: relative;
  cursor: pointer;
  transition: background var(--speed-fast) var(--ease), border-color var(--speed-fast) var(--ease);
}

.toggle-row input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #d6dde9;
  transition: transform var(--speed-mid) var(--ease), background var(--speed-fast) var(--ease);
}

.toggle-row input[type="checkbox"]:checked {
  background: rgba(93, 167, 255, 0.45);
  border-color: rgba(93, 167, 255, 0.6);
}

.toggle-row input[type="checkbox"]:checked::after {
  transform: translateX(16px);
  background: #f3f6fb;
}

.mono-value {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--text-primary);
  letter-spacing: 0.01em;
  font-weight: 500;
}

.mono-value.compact {
  display: block;
  margin-top: -6px;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.volume-slider {
  width: 100%;
  accent-color: var(--accent);
  height: 4px;
}

.muted-copy {
  margin: 6px 0 0;
  color: var(--text-muted);
  line-height: 1.55;
  font-size: 0.85rem;
}

.diagnostics-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.diagnostics-list div {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.025);
}

.diagnostics-list dt {
  color: var(--text-faint);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.diagnostics-list dd {
  margin: 6px 0 0;
  color: var(--text-primary);
}

.ghost-action {
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 0.86rem;
  transition: background var(--speed-fast) var(--ease), border-color var(--speed-fast) var(--ease), color var(--speed-fast) var(--ease);
}

.ghost-action:hover:not(:disabled) {
  background: rgba(93, 167, 255, 0.08);
  border-color: rgba(93, 167, 255, 0.28);
  color: var(--text-primary);
}

.ghost-action.small {
  padding: 4px 10px;
  font-size: 1.1rem;
  line-height: 1;
}

.ghost-action.danger {
  border-color: rgba(239, 106, 126, 0.24);
  color: #ffc4cf;
}

.ghost-action.danger:hover:not(:disabled) {
  background: rgba(239, 106, 126, 0.16);
  border-color: rgba(239, 106, 126, 0.4);
}

.ghost-action.is-active {
  background: rgba(84, 226, 196, 0.14);
  border-color: rgba(84, 226, 196, 0.4);
  color: #c6fff0;
}

/* ───────── Soundboard ───────── */

.soundboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.soundboard-button {
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  padding: 12px 10px;
  border-radius: 10px;
  font-size: 0.82rem;
  min-height: 44px;
  transition: background var(--speed-fast) var(--ease), color var(--speed-fast) var(--ease), border-color var(--speed-fast) var(--ease);
}

.soundboard-button:hover:not(:disabled) {
  background: rgba(93, 167, 255, 0.08);
  border-color: rgba(93, 167, 255, 0.25);
  color: var(--text-primary);
}

audio {
  display: none;
}

/* ───────── Animations ───────── */

@keyframes pulse-ring {
  0%, 100% {
    transform: translate(-50%, -50%) scale(0.7);
    opacity: 0.25;
  }
  50% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.65;
  }
}

@keyframes pulse-soft {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.06); opacity: 0.18; }
}

/* ───────── Responsive ───────── */

@media (max-width: 980px) {
  .status-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .top-bar-right {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 14px 14px 24px;
    gap: 16px;
  }
  .participants-grid {
    grid-template-columns: 1fr;
  }
  .status-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .control-dock {
    position: sticky;
    bottom: 8px;
    padding: 10px;
  }
  .control-dock-inner {
    gap: 2px;
  }
  .dock-button {
    padding: 8px 8px;
    min-width: 56px;
  }
  .dock-button.hidden-on-narrow {
    display: none;
  }
  .audio-panel,
  .settings-drawer {
    top: auto;
    right: 8px;
    bottom: 8px;
    left: 8px;
    width: auto;
    max-height: min(85vh, calc(100vh - 16px));
  }
  .diagnostics-list {
    grid-template-columns: 1fr;
  }
}
