@font-face {
  font-family: 'Roboto';
  src: url('/calls/assets/fonts/roboto-300.ttf') format('truetype');
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: 'Roboto';
  src: url('/calls/assets/fonts/roboto-500.ttf') format('truetype');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: 'Roboto';
  src: url('/calls/assets/fonts/roboto-900.ttf') format('truetype');
  font-style: normal;
  font-weight: 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --v2-canvas: #090b10;
  --v2-canvas-soft: #0d1017;
  --v2-surface: #131720;
  --v2-surface-raised: #181d28;
  --v2-surface-soft: #10141c;
  --v2-border: #272d3a;
  --v2-border-strong: #353d4d;
  --v2-border-active: #6558a0;
  --v2-text: #f4f6fb;
  --v2-muted: #9299aa;
  --v2-subtle: #858da0;
  --v2-accent: #725ce7;
  --v2-accent-hover: #836ff0;
  --v2-accent-soft: rgba(114, 92, 231, 0.16);
  --v2-success: #53dfa1;
  --v2-success-soft: rgba(83, 223, 161, 0.14);
  --v2-warning: #f4bd61;
  --v2-danger: #ff637d;
  --v2-window-width: 390px;
  --v2-radius: 20px;
  --v2-gap: 18px;
  --divider-dark: var(--v2-border);
  --divider-light: var(--v2-border-strong);
  --action-gray: var(--v2-muted);
  --text-primary: var(--v2-text);
  --text-secondary: var(--v2-muted);
  --bg-dark: var(--v2-canvas);
  --bg-light-primary: var(--v2-surface);
  --bg-light-secondary: var(--v2-surface-raised);
  font-family: 'Roboto', system-ui, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--v2-canvas);
}

body[data-ui-version='2'] {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--v2-text);
  background:
    radial-gradient(circle at 50% -12%, rgba(114, 92, 231, 0.17), transparent 34rem),
    radial-gradient(circle at 8% 40%, rgba(55, 87, 125, 0.07), transparent 28rem),
    var(--v2-canvas);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #9b89ff;
  outline-offset: 3px;
}

.hidden,
.compat-hidden {
  display: none !important;
}

.v2-sr-only {
  position: fixed;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.v2-startup-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  background: rgba(9, 11, 16, 0.96);
  color: var(--v2-muted);
  font-size: 14px;
  letter-spacing: 0.02em;
  transition: opacity 240ms ease, visibility 240ms ease;
}

.v2-startup-overlay.hidden {
  display: grid !important;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.v2-startup-mark,
.v2-brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(154, 137, 255, 0.5);
  border-radius: 12px;
  background: linear-gradient(145deg, #816af2, #5842c4);
  color: white;
  box-shadow: 0 8px 30px rgba(114, 92, 231, 0.28);
  font-weight: 900;
}

.v2-startup-mark {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  animation: v2-breathe 1.4s ease-in-out infinite;
}

@keyframes v2-breathe {
  50% { transform: translateY(-3px); box-shadow: 0 12px 40px rgba(114, 92, 231, 0.42); }
}

.v2-app-shell {
  min-height: 100dvh;
}

.v2-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: max(12px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 12px max(18px, env(safe-area-inset-left));
  border-bottom: 1px solid rgba(39, 45, 58, 0.72);
  background: rgba(9, 11, 16, 0.82);
  backdrop-filter: blur(18px) saturate(130%);
}

.v2-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--v2-text);
  text-decoration: none;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.025em;
}

.v2-brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 14px;
}

.v2-topbar-status {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(55vw, 360px);
  color: var(--v2-muted);
  font-size: 13px;
}

.v2-topbar-status > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v2-presence-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--v2-success);
  box-shadow: 0 0 0 4px rgba(83, 223, 161, 0.11);
}

.v2-workspace {
  min-height: calc(100dvh - 64px);
}

.v2-window-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--v2-window-width)), var(--v2-window-width)));
  align-items: start;
  justify-content: center;
  gap: var(--v2-gap);
  width: 100%;
  max-width: 1700px;
  min-height: calc(100dvh - 64px);
  margin: 0 auto;
  padding: clamp(16px, 3vw, 34px) max(14px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}

.v2-window {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, var(--v2-window-width));
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 72px),
    var(--v2-surface);
  box-shadow:
    0 22px 60px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.025);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.v2-window:hover {
  border-color: var(--v2-border-strong);
}

.v2-window[data-v2-joined='true'] {
  border-color: var(--v2-border-active);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.29), 0 0 0 1px rgba(114, 92, 231, 0.13);
}

.v2-window.v2-dragging {
  z-index: 30;
  opacity: 0.72;
  transform: scale(0.985);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
}

.v2-window.v2-drop-target {
  border-color: #9b89ff;
  transform: translateY(-3px);
}

.v2-window-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 72px;
  padding: 16px 16px 14px 18px;
  border-bottom: 1px solid rgba(39, 45, 58, 0.76);
}

.v2-window-heading {
  min-width: 0;
}

.v2-window-heading h1,
.v2-window-heading h2,
.v2-window-heading h3 {
  overflow: hidden;
  margin: 2px 0 0;
  color: var(--v2-text);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.018em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v2-window-kicker {
  display: block;
  color: var(--v2-muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}

.v2-window-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.v2-window-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-height: 48px;
  padding: 4px 8px 0;
}

.v2-window-tools-actions,
.v2-media-overlay-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.v2-drag-handle,
.v2-icon-button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--v2-subtle);
  font-size: 20px;
  cursor: pointer;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
}

.v2-drag-handle {
  touch-action: none;
  cursor: grab;
}

.v2-drag-handle:active {
  cursor: grabbing;
}

.v2-drag-handle:hover,
.v2-icon-button:hover {
  border-color: var(--v2-border);
  background: var(--v2-surface-raised);
  color: var(--v2-text);
}

.v2-app-toast {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 80;
  width: min(360px, calc(100vw - 32px));
  margin: 0;
  padding: 11px 13px;
  border: 1px solid var(--v2-border);
  border-radius: 13px;
  background: rgba(16, 20, 28, 0.94);
  color: var(--v2-text);
  font-size: 12px;
  line-height: 1.45;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(16px);
  pointer-events: none;
}

.v2-app-toast[data-level='success'] {
  border-color: rgba(83, 223, 161, 0.3);
  color: var(--v2-success);
}

.v2-app-toast[data-level='error'] {
  border-color: rgba(255, 99, 125, 0.34);
  color: var(--v2-danger);
}

.v2-presence-dot.error {
  background: var(--v2-danger);
  box-shadow: 0 0 0 4px rgba(255, 99, 125, 0.12);
}

.v2-launcher-actions {
  display: grid;
  gap: 10px;
  padding: 14px 14px 16px;
}

.v2-launcher-identity {
  margin: 0 14px;
}

.v2-action-button {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 68px;
  padding: 10px 13px;
  border: 1px solid var(--v2-border);
  border-radius: 15px;
  background: var(--v2-surface-soft);
  color: var(--v2-text);
  text-align: left;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.v2-action-button:hover {
  border-color: var(--v2-border-strong);
  background: var(--v2-surface-raised);
  transform: translateY(-1px);
}

.v2-action-button:active {
  transform: translateY(0);
}

.v2-action-button > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.v2-action-button strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v2-action-button small {
  overflow: hidden;
  color: var(--v2-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v2-action-button > i:last-child {
  color: var(--v2-subtle);
  font-size: 17px;
}

.v2-action-button:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.v2-action-icon,
.v2-device-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  color: #c1c6d2;
  font-size: 19px;
}

.v2-action-primary {
  border-color: rgba(132, 111, 240, 0.5);
  background: linear-gradient(135deg, rgba(114, 92, 231, 0.26), rgba(114, 92, 231, 0.11));
}

.v2-action-primary .v2-action-icon {
  background: var(--v2-accent);
  color: white;
  box-shadow: 0 8px 24px rgba(114, 92, 231, 0.24);
}

.v2-settings-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.v2-setting-row,
.device-group,
.noise-settings-row {
  overflow: hidden;
  border: 1px solid var(--v2-border);
  border-radius: 14px;
  background: var(--v2-surface-soft);
}

.v2-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding: 10px 10px 10px 14px;
}

.v2-setting-label {
  color: var(--v2-muted);
  font-size: 12px;
}

.v2-setting-control {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.nickname-footer-button,
.nickname-inline-input {
  min-width: 0;
  max-width: 180px;
  height: 40px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--v2-text);
  font-size: 13px;
  text-align: right;
}

.nickname-footer-button {
  overflow: hidden;
  cursor: pointer;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nickname-inline-input {
  border-color: var(--v2-border-strong);
  background: var(--v2-canvas-soft);
  outline: none;
}

.device-summary {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 10px 13px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.device-summary > span:nth-child(2),
.noise-settings-row > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.device-summary small,
.noise-settings-row small {
  color: var(--v2-muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.device-summary strong,
.noise-settings-row strong {
  overflow: hidden;
  color: var(--v2-text);
  font-size: 12px;
  font-weight: 300;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-summary > i:last-child {
  color: var(--v2-subtle);
  transition: transform 160ms ease;
}

.device-summary.expanded > i:last-child {
  transform: rotate(180deg);
}

.device-list {
  display: grid;
  gap: 1px;
  max-height: 210px;
  overflow-y: auto;
  border-top: 1px solid var(--v2-border);
  background: var(--v2-border);
}

.device-list.collapsed {
  display: none;
}

.device-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 8px 12px;
  background: var(--v2-surface-soft);
  color: var(--v2-muted);
  font-size: 11px;
}

.device-row > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-action {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--v2-border-strong);
  border-radius: 9px;
  background: transparent;
  color: var(--v2-text);
  font-size: 10px;
  cursor: pointer;
}

.noise-settings-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 11px 13px;
}

.noise-settings-status[data-status='success'],
.noise-settings-status[data-status='ready'] {
  color: var(--v2-success);
}

.noise-settings-status[data-status='warning'],
.noise-settings-status[data-status='loading'] {
  color: var(--v2-warning);
}

.noise-settings-status[data-status='error'] {
  color: var(--v2-danger);
}

.noise-settings-row .noise-settings-status {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.v2-chat-window {
  height: 560px;
  min-height: 360px;
  max-height: 900px;
}

.messages-panel {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 16px;
  scrollbar-color: var(--v2-border-strong) transparent;
}

.v2-chat-empty {
  display: grid;
  flex: 1 1 auto;
  place-content: center;
  justify-items: center;
  gap: 10px;
  min-height: 210px;
  color: var(--v2-muted);
  text-align: center;
}

.v2-chat-empty i {
  color: var(--v2-subtle);
  font-size: 34px;
}

.v2-chat-empty strong {
  color: var(--v2-text);
  font-size: 13px;
  font-weight: 500;
}

.v2-chat-empty span {
  max-width: 220px;
  font-size: 12px;
  line-height: 1.5;
}

.chat-day-separator {
  align-self: center;
  margin: 12px 0;
  padding: 5px 10px;
  border: 1px solid var(--v2-border);
  border-radius: 999px;
  background: var(--v2-surface-soft);
  color: var(--v2-subtle);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.chat-retention-notice {
  color: var(--v2-muted);
}

.chat-message {
  display: grid;
  gap: 5px;
  margin-top: 14px;
}

.chat-message.compact {
  margin-top: 5px;
}

.chat-author {
  padding-left: 2px;
  color: var(--v2-muted);
  font-size: 10px;
  font-weight: 500;
}

.chat-message-line {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.chat-bubble {
  min-width: 0;
  max-width: calc(100% - 46px);
  padding: 9px 11px;
  border: 1px solid var(--v2-border);
  border-radius: 13px 13px 13px 4px;
  background: var(--v2-surface-raised);
  color: var(--v2-text);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.chat-time {
  flex: 0 0 auto;
  padding-bottom: 3px;
  color: var(--v2-subtle);
  font-size: 10px;
}

.chat-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: end;
  gap: 9px;
  padding: 12px 12px 10px;
  border-top: 1px solid var(--v2-border);
}

.chat-input {
  width: 100%;
  min-height: 42px;
  max-height: 126px;
  resize: none;
  padding: 11px 13px;
  border: 1px solid var(--v2-border);
  border-radius: 13px;
  outline: none;
  background: var(--v2-surface-soft);
  color: var(--v2-text);
  font-size: 12px;
  line-height: 1.5;
}

.chat-input::placeholder {
  color: var(--v2-subtle);
}

.chat-input:disabled {
  opacity: 0.7;
}

.send-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 13px;
  background: var(--v2-surface-raised);
  color: var(--v2-subtle);
  font-size: 17px;
}

.send-button.enabled {
  background: var(--v2-accent);
  color: white;
  cursor: pointer;
}

.v2-resize-handle {
  display: grid;
  flex: 0 0 30px;
  place-items: center;
  border-top: 1px solid rgba(39, 45, 58, 0.45);
  cursor: ns-resize;
  touch-action: none;
}

.v2-resize-handle span {
  width: 42px;
  height: 3px;
  border-radius: 999px;
  background: var(--v2-border-strong);
  transition: background 140ms ease, width 140ms ease;
}

.v2-resize-handle:hover span,
.v2-resize-handle:focus-visible span {
  width: 58px;
  background: var(--v2-accent);
}

.v2-room-window {
  min-height: 330px;
}

.v2-room-tools {
  justify-content: space-between;
  padding-left: 14px;
}

.v2-room-heading-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.v2-room-live-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--v2-subtle);
}

.v2-room-window[data-v2-joined='true'] .v2-room-live-dot {
  background: var(--v2-success);
  box-shadow: 0 0 0 4px var(--v2-success-soft);
}

.v2-room-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.v2-room-badge,
.v2-participant-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--v2-muted);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.v2-room-badge.private {
  color: var(--v2-warning);
}

.v2-room-participants {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 148px;
  max-height: 280px;
  overflow-y: auto;
  padding: 14px;
}

.v2-room-empty {
  display: grid;
  place-content: center;
  min-height: 120px;
  color: var(--v2-muted);
  font-size: 12px;
  text-align: center;
}

.v2-room-missing {
  gap: 7px;
  padding: 18px;
}

.v2-room-missing strong {
  color: var(--v2-text);
  font-size: 14px;
  font-weight: 500;
}

.participant-row,
.v2-passive-participant {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) minmax(90px, 128px);
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 7px 9px;
  border: 1px solid var(--v2-border);
  border-radius: 13px;
  background: var(--v2-surface-soft);
}

.participant-row .participant-media-icon {
  display: none;
}

.participant-row::before,
.v2-passive-participant::before {
  content: attr(data-initials);
  display: grid;
  place-items: center;
  grid-row: 1;
  grid-column: 1;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  outline: 2px solid transparent;
  outline-offset: 2px;
  background: var(--v2-accent-soft);
  box-shadow: 0 0 0 0 rgba(83, 223, 161, 0);
  color: #c8bdff;
  font-size: 10px;
  font-weight: 500;
  transition: outline-color 0.5s ease-out, box-shadow 0.5s ease-out;
}

.participant-row.is-speaking::before,
.v2-passive-participant.is-speaking::before {
  outline-color: rgba(83, 223, 161, 0.92);
  box-shadow:
    0 0 0 4px var(--v2-success-soft),
    0 0 18px rgba(83, 223, 161, 0.3);
  transition-duration: 0.12s;
}

.participant-row .nickname,
.v2-passive-participant .nickname {
  overflow: hidden;
  grid-column: 2;
  color: var(--v2-text);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v2-passive-participant {
  grid-template-columns: 34px minmax(0, 1fr) auto;
}

.v2-participant-media {
  display: flex;
  gap: 5px;
  color: var(--v2-subtle);
  font-size: 13px;
}

.volume-slider,
.screen-volume-slider {
  width: 100%;
  min-width: 0;
  height: 32px;
  margin: 0;
  accent-color: var(--v2-accent);
  cursor: pointer;
}

.v2-room-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--v2-border);
}

.v2-room-primary-action {
  display: grid;
  place-items: center;
  min-height: 44px;
  border: 1px solid var(--v2-border-strong);
  border-radius: 13px;
  background: var(--v2-surface-raised);
  color: var(--v2-text);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.v2-room-primary-action.join {
  border-color: rgba(114, 92, 231, 0.48);
  background: linear-gradient(135deg, var(--v2-accent), #6049ce);
  color: white;
}

.v2-room-primary-action.leave {
  color: #ff9aad;
}

.v2-room-primary-action:disabled {
  opacity: 0.55;
  cursor: wait;
}

.v2-room-media-controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.v2-media-button {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  height: 46px;
  padding: 0;
  border: 1px solid var(--v2-border);
  border-radius: 13px;
  background: var(--v2-surface-soft);
  color: var(--v2-muted);
  font-size: 18px;
  cursor: pointer;
}

.v2-media-button:hover:not(:disabled) {
  border-color: var(--v2-border-strong);
  color: var(--v2-text);
}

.v2-media-button.enabled {
  border-color: rgba(83, 223, 161, 0.35);
  background: var(--v2-success-soft);
  color: var(--v2-success);
}

.v2-media-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.mic-warning-bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 8;
  width: max-content;
  padding: 8px 10px;
  border: 1px solid var(--v2-border-strong);
  border-radius: 10px;
  background: var(--v2-surface-raised);
  color: var(--v2-text);
  font-size: 10px;
  transform: translateX(-50%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.v2-private-info {
  display: grid;
  gap: 8px;
  padding: 0 14px 14px;
}

.v2-private-link {
  overflow: hidden;
  padding: 10px 11px;
  border: 1px solid var(--v2-border);
  border-radius: 11px;
  background: var(--v2-surface-soft);
  color: #bbb0ff;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v2-private-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.v2-private-actions button {
  min-height: 38px;
  border: 1px solid var(--v2-border);
  border-radius: 11px;
  background: transparent;
  color: var(--v2-muted);
  font-size: 10px;
  cursor: pointer;
}

.v2-private-actions button.danger {
  color: var(--v2-danger);
}

.v2-media-window {
  min-height: 0;
}

.v2-media-stage {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #050609;
}

.v2-media-overlay {
  position: absolute;
  inset: 8px 8px auto;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.v2-media-label {
  overflow: hidden;
  max-width: calc(100% - 98px);
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  background: rgba(5, 6, 9, 0.68);
  color: rgba(244, 246, 251, 0.9);
  font-size: 10px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(12px);
}

.v2-media-overlay-actions {
  pointer-events: auto;
}

.v2-media-overlay .v2-drag-handle,
.v2-media-overlay .v2-icon-button {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(5, 6, 9, 0.68);
  color: rgba(244, 246, 251, 0.86);
  backdrop-filter: blur(12px);
}

.v2-media-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.v2-media-window[data-v2-screen='true'] .v2-media-stage video {
  object-fit: contain;
}

.v2-media-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 58px;
  padding: 9px 12px;
}

.v2-media-footer .screen-volume-slider {
  max-width: 210px;
}

.v2-media-fullscreen {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--v2-border);
  border-radius: 11px;
  background: var(--v2-surface-soft);
  color: var(--v2-muted);
  cursor: pointer;
}

.debug-panel {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 90;
  width: min(480px, calc(100vw - 24px));
  max-height: 55vh;
  overflow: auto;
  border: 1px solid var(--v2-border);
  border-radius: 12px;
  background: rgba(13, 16, 23, 0.97);
  color: var(--v2-muted);
  font-size: 10px;
  opacity: 0.38;
}

.debug-panel[open] {
  opacity: 1;
}

.debug-panel summary {
  padding: 9px 11px;
  cursor: pointer;
}

.debug-log {
  margin: 0;
  padding: 10px;
  white-space: pre-wrap;
}

.debug-status {
  display: block;
  padding: 0 10px 10px;
}

.v2-back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--v2-muted);
  font-size: 12px;
  text-decoration: none;
}

.v2-back-link:hover {
  color: var(--v2-text);
}

.v2-private-create-shell {
  display: grid;
  place-items: center;
  min-height: calc(100dvh - 64px);
  padding: 24px 14px max(24px, env(safe-area-inset-bottom));
}

.v2-private-create-window {
  width: min(100%, var(--v2-window-width));
}

.v2-private-create-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--v2-accent-soft);
  color: #c7bbff;
  font-size: 19px;
}

.v2-private-create-content {
  display: grid;
  justify-items: center;
  gap: 22px;
  padding: 24px 18px 28px;
  text-align: center;
}

.v2-private-create-content > p:first-child {
  max-width: 310px;
  margin: 0;
  color: var(--v2-muted);
  font-size: 13px;
  line-height: 1.55;
}

.v2-turnstile-wrap {
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  min-height: 65px;
}

.v2-turnstile-wrap .cf-turnstile {
  width: 100%;
  max-width: 300px;
}

.v2-private-create-status {
  min-height: 20px;
  margin: 0;
  color: var(--v2-warning);
  font-size: 11px;
  line-height: 1.45;
}

@media (max-width: 430px) {
  :root {
    --v2-window-width: 100%;
    --v2-gap: 13px;
    --v2-radius: 17px;
  }

  .v2-topbar {
    min-height: 58px;
  }

  .v2-window-grid {
    min-height: calc(100dvh - 58px);
    padding-top: 12px;
  }

  .v2-window-header {
    min-height: 66px;
  }

  .v2-chat-window {
    max-height: 900px;
  }
}

@media (max-width: 340px) {
  .v2-turnstile-wrap .cf-turnstile {
    width: 300px;
    transform: scale(0.86);
    transform-origin: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  .v2-window,
  .v2-action-button,
  .device-group,
  .participant-row,
  .v2-passive-participant {
    border: 1px solid CanvasText;
  }

  .participant-row.is-speaking::before,
  .v2-passive-participant.is-speaking::before {
    outline-color: Highlight;
  }
}
