/* ===================================================================
   Bua™ CHAT + DASHBOARDS CSS FOUNDATION
   Tokenized theme system with dark/light auto-switching
   =================================================================== */

/* ===================================================================
   1. CHAT-SPECIFIC THEME EXTENSIONS
   =================================================================== */

:root[data-theme="dark"] {
  /* Chat-specific dark theme additions */
  --bubble-in: rgba(242, 242, 242, .08);
  --bubble-out: var(--bua-action);
  --composer: rgba(242, 242, 242, .07);
  --icon: rgba(241, 241, 241, .80);
}

:root[data-theme="light"] {
  /* Chat-specific light theme additions */
  --bubble-in: rgba(11, 5, 3, .05);
  --bubble-out: var(--bua-action);
  --composer: rgba(11, 5, 3, .04);
  --icon: rgba(11, 5, 3, .72);
}

/* Legacy chat-specific variable aliases */
:root[data-theme="dark"] {
  --surface: var(--surface-bg);
  --surface-2: var(--surface-elevated);
  --text-2: var(--text-secondary);
  --muted: var(--text-tertiary);
}

:root[data-theme="light"] {
  --surface: var(--frame-bg);
  --surface-2: var(--surface-elevated);
  --text-2: var(--text-secondary);
  --muted: var(--text-tertiary);
}

/* Spacing shortcuts (chat-specific) */
:root {
  --r-12: var(--radius-md);
  --r-16: var(--radius-lg);
  --r-20: var(--radius-lg);
  --s-8: 0.5rem;
  --s-12: 0.75rem;
  --s-16: 1rem;
  --s-24: 1.5rem;
}

/* ===================================================================
   2. GLOBAL SHELL
   =================================================================== */

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text-primary);
  font-family: var(--font-body);
}

.message-actions {
  width: min(360px, calc(100vw - 48px));
  max-height: calc(100dvh - 48px);
  overflow: auto;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--surface-elevated);
  color: var(--text-primary);
  padding: var(--s-16);
  box-shadow: var(--shadow-soft);
}
.message-actions::backdrop { background: var(--overlay-backdrop, rgba(0, 0, 0, .4)); }
.message-actions h2 { font-size: 1rem; }
.message-actions button {
  display: flex; align-items: center; gap: var(--s-12); width: 100%; min-height: 48px;
  background: transparent; color: inherit; border: 0; padding: var(--s-8); font: inherit; cursor: pointer;
}
.message-actions button:hover, .message-actions button:focus-visible { background: var(--bubble-in); }
.message-actions textarea {
  box-sizing: border-box; width: 100%; min-height: 100px; max-height: 40vh; resize: vertical;
  background: var(--page-bg); color: var(--text-primary); border: 1px solid var(--border-default); font: inherit;
}
.message-actions button:disabled { opacity: .5; cursor: wait; }
.message-menu-button { margin-inline-start: auto; min-width: 44px; min-height: 44px; }

.surface {
  background: var(--surface);
  border: 1px solid var(--border-default);
  border-radius: var(--r-20);
  box-shadow: var(--shadow-soft);
}

/* ===================================================================
   3. CHAT SCREEN
   =================================================================== */

.chat {
  max-width: 420px;
  margin: 0 auto;
  padding: var(--s-16);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.legal-footer {
  margin-top: auto;
  padding-top: var(--s-16);
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
}

.legal-footer a {
  color: inherit;
  text-decoration: underline;
  font-weight: 600;
}

.chat__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-12) var(--s-16);
  border-radius: var(--r-20);
  background: var(--surface);
  border: 1px solid var(--border);
  gap: var(--s-12);
}

.chat__topbar-left,
.chat__topbar-right {
  display: flex;
  align-items: center;
  gap: var(--s-12);
}

.chat__title {
  display: flex;
  gap: var(--s-12);
  align-items: center;
  font-weight: 700;
  flex-direction: column;
  align-items: flex-start;
}

.chat__title-name {
  font-size: 15px;
  color: var(--text);
}

.chat__title-presence {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

.badge {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-2);
  background: var(--surface-2);
  white-space: nowrap;
}

.badge--classification {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge--public { background: var(--bua-verified-soft); color: var(--status-success); }
.badge--internal { background: color-mix(in srgb, var(--bua-channel) 20%, transparent); color: var(--status-info); }
.badge--confidential { background: var(--bua-action-soft); color: var(--status-warning); }
.badge--restricted { background: var(--bua-dispute-soft); color: var(--status-error); }

.profile-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
  display: block;
  flex-shrink: 0;
  object-fit: cover;
  object-position: center;
}

.thread {
  margin-top: var(--s-16);
  display: flex;
  flex-direction: column;
  gap: var(--s-12);
  flex: 1;
  overflow-y: auto;
}

.msg {
  display: flex;
  gap: var(--s-12);
  align-items: flex-end;
}

.msg--out {
  justify-content: flex-end;
}

.message-content { min-width: 0; max-width: calc(100% - 46px); }
.message-content > .bubble { max-width: 100%; padding: 8px 10px; }
.bubble__header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 12px; }
.bubble__sender { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bubble__time { flex-shrink: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }

.msg--out .avatar {
  order: 2;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
  display: block;
  object-fit: cover;
}

.bubble {
  max-width: 78%;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--bubble-in);
  color: var(--text);
  word-wrap: break-word;
}

.msg--out .bubble {
  background: var(--bubble-out);
  border-color: rgba(0, 0, 0, .08);
  color: var(--bua-action-contrast);
}

.bubble--system {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text-2);
  font-size: 13px;
  text-align: left;
  max-width: 85%;
  margin: 0;
}

.bubble--action {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: var(--s-16);
  border-radius: var(--r-16);
  max-width: 90%;
  display: flex;
  flex-direction: column;
  gap: var(--s-12);
}

.action-card__title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

.action-card__meta {
  display: flex;
  gap: var(--s-8);
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-2);
}

.action-card__buttons {
  display: flex;
  gap: var(--s-8);
  margin-top: var(--s-8);
}

.action-card__footer {
  font-size: 11px;
  color: var(--muted);
  padding-top: var(--s-8);
  border-top: 1px solid var(--border);
}

.bubble--pinned {
  background: var(--bua-action-soft);
  border-color: color-mix(in srgb, var(--bua-action) 40%, transparent);
}

.meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.meta__ticks {
  display: inline-flex;
  gap: 2px;
}

.audit-marker {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--muted);
  font-family: monospace;
}

/* ===================================================================
   4. COMPOSER
   =================================================================== */

.composer {
  margin-top: var(--s-16);
  display: flex;
  align-items: center;
  gap: var(--s-12);
  padding: 10px 12px;
  border-radius: 999px;
  background: var(--composer);
  border: 1px solid var(--border);
}

.composer input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font-size: 14px;
}

.composer input::placeholder {
  color: var(--muted);
}

.composer__enterprise-actions {
  display: flex;
  gap: var(--s-8);
  padding-left: var(--s-8);
  border-left: 1px solid var(--border);
}

.icon-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--icon);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 18px;
}


.icon-glyph {
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.interface-icon,
.product-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.interface-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.product-icon { object-fit: contain; }

.icon-btn:hover {
  background: var(--surface);
  transform: scale(1.05);
}

.icon-btn--primary {
  background: var(--bua-action);
  border-color: rgba(0, 0, 0, .10);
  color: var(--bua-action-contrast);
}

.icon-btn--primary:hover {
  background: var(--accent-hover);
}

.icon-btn--small {
  width: 44px;
  height: 44px;
  font-size: 14px;
}

@media (max-width: 760px) {
  .chat__topbar { flex-wrap: wrap; }
  .chat__title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
  .chat__topbar-right { flex-basis: 100%; justify-content: flex-end; gap: var(--s-8); }
}

/* ===================================================================
   5. DASHBOARD CARDS (PRIVATE + ENTERPRISE)
   =================================================================== */

.dashboard {
  max-width: 980px;
  margin: 0 auto;
  padding: var(--s-24);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.dashboard .legal-footer {
  margin-top: auto;
  padding-top: var(--s-24);
  text-align: left;
}

.dashboard__header {
  margin-bottom: var(--s-24);
}

.dashboard__header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-16);
  flex-wrap: wrap;
  margin-bottom: var(--s-16);
}

.dashboard__brand {
  display: flex;
  align-items: center;
  gap: var(--s-12);
}

.dashboard__brand-logo {
  width: 72px;
  height: 48px;
  object-fit: contain;
  background: transparent;
}

.dashboard__brand-logo[data-bua-mark] {width:48px; height:48px; flex-shrink:0;}
.dashboard__brand-home {display:inline-flex; flex:0 0 48px; min-height:48px; margin-left:auto;}
.dashboard__header-actions {display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-left:auto;}
.dashboard__brand {flex-wrap: wrap;}

.dashboard__brand-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.dashboard__brand-subtitle {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-2);
}

.dashboard__identity {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
}

.dashboard__identity-user {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.dashboard__identity-meta {
  font-size: 0.72rem;
  color: var(--text-2);
}

.dashboard__header-actions {
  display: flex;
  gap: var(--s-12);
  flex-wrap: wrap;
}

.dashboard__title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 var(--s-8) 0;
  color: var(--text);
}

.dashboard__subtitle {
  font-size: 1rem;
  color: var(--text-2);
  margin: 0;
}

.dashboard__actions {
  margin-top: var(--s-16);
  display: flex;
  gap: var(--s-12);
  flex-wrap: wrap;
}

body.chat-popup-open {
  overflow: hidden;
}

.chat-popup {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: var(--s-24);
  background: rgba(0, 0, 0, 0.42);
}

.chat-popup__panel {
  width: min(460px, 100%);
  height: min(760px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.chat-popup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-12);
  padding: var(--s-12) var(--s-16);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.chat-popup__title {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
}

.chat-popup__status {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 2px;
}

.chat-popup__close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.chat-popup__frame {
  width: 100%;
  flex: 1;
  border: 0;
  background: var(--page-bg);
}

.chat-popup-mode {
  background: var(--page-bg);
}

.chat-popup-mode .chat {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  padding: var(--s-12);
  box-sizing: border-box;
}

.chat-popup-mode .chat__topbar {
  border-radius: 8px;
}

.chat-popup-mode .thread {
  min-height: 0;
}

.chat-popup-mode .file-share-panel,
.chat-popup-mode .legal-footer {
  display: none;
}

.grid {
  display: grid;
  gap: var(--s-16);
  grid-template-columns: repeat(12, 1fr);
}

.card {
  grid-column: span 6;
  padding: var(--s-16);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-20);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: var(--s-12);
}

.card--full {
  grid-column: span 12;
}

.card--third {
  grid-column: span 4;
}

.card h3 {
  margin: 0 0 10px 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.card p {
  margin: 0;
  font-size: 14px;
  color: var(--text-2);
}

.kpi {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.kpi .value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
}

.kpi .label {
  color: var(--text-2);
  font-size: 13px;
}

.widget {
  display: flex;
  flex-direction: column;
  gap: var(--s-8);
}

.widget__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--s-8) 0;
  border-bottom: 1px solid var(--border);
}

.widget__row:last-child {
  border-bottom: none;
}

.widget__label {
  font-size: 14px;
  color: var(--text);
}

.widget__value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}

.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.status-indicator--locked { background: var(--status-success); }
.status-indicator--unlocked { background: var(--status-error); }
.status-indicator--active { background: var(--status-success); }
.status-indicator--warning { background: var(--status-warning); }

.cta-button {
  padding: 10px 16px;
  border-radius: var(--r-12);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  display: inline-block;
  text-decoration: none;
}

.cta-button:hover {
  background: var(--surface);
  border-color: var(--bua-action);
}

.cta-button--primary {
  background: var(--bua-action);
  border-color: var(--bua-action);
  color: var(--bua-action-contrast);
}

.cta-button--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.alert-card {
  padding: var(--s-12);
  border-radius: var(--r-12);
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  gap: var(--s-12);
  align-items: flex-start;
}

.alert-card--warning {
  background: var(--bua-action-soft);
  border-color: color-mix(in srgb, var(--bua-action) 40%, transparent);
}

.alert-card--critical {
  background: var(--bua-dispute-soft);
  border-color: color-mix(in srgb, var(--bua-dispute) 50%, transparent);
}

.alert-card__icon {
  font-size: 18px;
}

.alert-card__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.alert-card__title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.alert-card__message {
  font-size: 13px;
  color: var(--text-2);
}

/* ===================================================================
   6. RESPONSIVE
   =================================================================== */

@media (max-width: 900px) {
  .card {
    grid-column: span 12;
  }

  .card--third {
    grid-column: span 12;
  }

  .dashboard {
    padding: var(--s-16);
  }
}

@media (max-width: 480px) {
  .chat-popup {
    padding: 0;
    align-items: stretch;
  }

  .chat-popup__panel {
    width: 100%;
    height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .chat {
    padding: var(--s-8);
  }

  .chat__topbar {
    padding: var(--s-8) var(--s-12);
  }

  .bubble {
    max-width: 85%;
  }
}

/* ===================================================================
   7. UTILITY CLASSES
   =================================================================== */

.hidden {
  display: none !important;
}

.text-center {
  text-align: left;
}

.mt-16 {
  margin-top: var(--s-16);
}

.mb-16 {
  margin-bottom: var(--s-16);
}

.flex {
  display: flex;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-col {
  flex-direction: column;
}

.gap-8 {
  gap: var(--s-8);
}

.gap-12 {
  gap: var(--s-12);
}

.gap-16 {
  gap: var(--s-16);
}

.grid--tight {
  gap: var(--s-12);
}

.card--kpi {
  grid-column: span 3;
  padding: var(--s-12);
}

.widget__value--success {
  color: var(--status-success);
}

.widget__value--warning {
  color: var(--status-warning);
}

.widget__value--error {
  color: var(--status-error);
}

.cta-button--danger {
  background: var(--status-error);
  color: var(--dv8-white);
  border-color: var(--status-error);
}

.section-intro {
  margin-bottom: var(--s-16);
  color: var(--text-2);
}

/* Search form elements */
.search-input,
.search-select {
  flex: 1;
  min-width: 150px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
}

.search-input::placeholder {
  color: var(--muted);
}

.meta-text {
  font-size: 12px;
  color: var(--muted);
}

.video-call-panel {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: clamp(0.75rem, 2vw, 1rem);
  margin: var(--s-12) 0;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

#memberNotificationsButton {
  position: relative;
}

.notification-count {
  align-items: center;
  background: var(--status-error);
  border: 2px solid var(--surface);
  border-radius: 999px;
  color: var(--dv8-white);
  display: inline-flex;
  font-size: 0.62rem;
  font-weight: 700;
  justify-content: center;
  min-height: 1.1rem;
  min-width: 1.1rem;
  padding: 0 0.2rem;
  position: absolute;
  right: -0.35rem;
  top: -0.35rem;
}

.video-call-panel__header {
  align-items: center;
  display: flex;
  gap: var(--s-12);
  justify-content: space-between;
  margin-bottom: var(--s-12);
}

.video-call-panel__header > div {
  display: grid;
  gap: 0.15rem;
}

.video-call-panel__header strong {
  color: var(--text-primary);
  font-size: 1rem;
}

.video-call-panel__header .badge {
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-call-panel__grid {
  aspect-ratio: 16 / 9;
  background: var(--page-bg);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}

.video-call-panel__viewport {
  background: var(--page-bg);
  height: 100%;
  margin: 0;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.video-call-panel__viewport video {
  background: var(--page-bg);
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.video-call-panel__viewport figcaption {
  background: var(--surface-elevated);
  border-radius: var(--radius-sm);
  bottom: var(--s-8);
  color: var(--text-primary);
  font-size: 0.75rem;
  left: var(--s-8);
  padding: 0.2rem 0.45rem;
  position: absolute;
}

.video-call-panel__viewport--local {
  border: 2px solid var(--surface);
  border-radius: var(--radius-md);
  bottom: var(--s-12);
  box-shadow: var(--shadow-soft);
  height: auto;
  overflow: hidden;
  position: absolute;
  right: var(--s-12);
  width: min(30%, 12rem);
  aspect-ratio: 16 / 9;
}

.video-call-panel[data-mode="voice"] .video-call-panel__grid {
  aspect-ratio: 3 / 1;
}

.video-call-panel[data-mode="voice"] video {
  visibility: hidden;
}

.video-call-panel[data-mode="voice"] .video-call-panel__grid::before {
  color: var(--text-secondary);
  content: "Voice call · camera remains off";
  inset: 0;
  display: grid;
  place-items: center;
  position: absolute;
}

.media-device-panel {
  border-top: 1px solid var(--border-default);
  margin-top: var(--s-12);
  padding-top: var(--s-12);
}

.media-device-panel summary {
  color: var(--text-primary);
  cursor: pointer;
  font-weight: 650;
}

.media-device-panel__status {
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.45;
}

.media-device-panel__grid {
  display: grid;
  gap: var(--s-8);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: var(--s-12) 0;
}

.media-device-panel label {
  color: var(--text-secondary);
  display: grid;
  font-size: 0.75rem;
  gap: 0.3rem;
}

.media-device-panel select {
  background: var(--surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  min-height: 2.75rem;
  min-width: 0;
  padding: 0.5rem;
}

.video-call-panel__actions {
  display: flex;
  justify-content: center;
  gap: var(--s-8);
  margin-top: var(--s-12);
}

.call-control {
  align-items: center;
  background: var(--surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  display: inline-flex;
  flex: 0 1 7rem;
  flex-direction: column;
  gap: 0.4rem;
  justify-content: center;
  min-height: 4.75rem;
  padding: 0.55rem 0.75rem;
}

.video-call-panel__actions { flex-wrap: wrap; align-items: stretch; }
.call-control[hidden], #callMeshGrid[hidden], #callMemberForm[hidden], .video-call-panel__grid[hidden] { display: none; }
.call-control .interface-icon { width: 24px; height: 24px; flex-shrink: 0; }
.call-control:disabled { opacity: .5; cursor: default; }
#callMeshGrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; aspect-ratio: auto; }
#callMeshGrid .video-call-panel__viewport { min-height: 180px; aspect-ratio: 4 / 3; }
.video-call-panel[data-mode="voice"] #callMeshGrid { aspect-ratio: auto; }
.video-call-panel[data-mode="voice"] #callMeshGrid::before { content: none; }
#callMemberForm { padding: 1rem; display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
#callMemberHelp { flex-basis: 100%; }
#chatIncomingCallList li { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
#chatIncomingCallList li > span { flex: 1 1 100%; }
@media (max-width: 420px) { #callMeshGrid .video-call-panel__viewport { min-height: 130px; } }

.call-control:hover,
.call-control:focus-visible {
  border-color: var(--bua-brand-primary, var(--status-warning));
}

.call-control.is-off {
  opacity: 0.62;
}

.call-control--danger {
  background: var(--status-error);
  border-color: var(--status-error);
  color: var(--dv8-white);
}

@media (max-width: 640px) {
  .media-device-panel__grid {
    grid-template-columns: 1fr;
  }

  .video-call-panel__header {
    align-items: flex-start;
  }

  .call-control span:last-child {
    font-size: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .video-call-panel *,
  .video-call-panel *::before,
  .video-call-panel *::after {
    scroll-behavior: auto;
    transition: none !important;
  }
}

.file-share-panel {
  margin: 0.25rem 0.75rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 0.6rem;
  background: rgba(0, 0, 0, 0.15);
}

.file-share-panel__header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.35rem;
  font-size: 0.86rem;
}

.file-share-panel__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.file-share-panel__item {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.82rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.18);
  padding-top: 0.35rem;
}

.file-share-panel__meta {
  opacity: 0.85;
  font-size: 0.75rem;
}
