/* AKAORA MEET — ATELIER / UI STABILITY PATCH (19 NOV 2026)
   Intentionally loaded last. The app's three legacy theme sheets contained
   competing !important rules; these scoped rules restore one visual system.
   Firebase, WebRTC, meeting and screen sharing logic is unchanged. */

/* Consistent page canvas and typography — no elevated cards. */
body[data-theme="light"]:not([data-view="meeting"]) {
  background: #f8f7f3 !important;
  color: #24302e !important;
}
body[data-theme="dark"]:not([data-view="meeting"]) {
  background: #131a1d !important;
  color: #f0eee7 !important;
}
body[data-theme="light"]:not([data-view="meeting"]) .topbar {
  background: #f8f7f3 !important;
  color: #24302e !important;
}
body[data-theme="dark"]:not([data-view="meeting"]) .topbar {
  background: #131a1d !important;
  color: #f0eee7 !important;
}
body:not([data-view="meeting"]) .topbar {
  isolation: isolate;
  min-height: 84px !important;
  border-bottom: 1px solid var(--atelier-line) !important;
  box-shadow: none !important;
}
body[data-theme] .topbar .nav-actions { flex: 0 0 auto; min-width: 0; }
body[data-theme] .topbar .theme-switch,
body[data-theme] .topbar .theme-switch:hover {
  background: transparent !important;
  color: var(--atelier-ink) !important;
  border: 0 !important;
  border-left: 1px solid var(--atelier-line) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transform: none !important;
}
body[data-theme] .topbar .theme-switch svg { stroke: var(--atelier-ink) !important; }
body[data-theme] .topbar .status-chip { color: var(--atelier-muted) !important; }
body[data-theme] .topbar .brand small { overflow-wrap: anywhere; }

/* Editorial landing: temper excessive vertical whitespace and maintain a
   consistent baseline without reintroducing a card-shaped hero. */
body[data-theme] .hero-card { margin-top: 20px !important; }
body[data-theme] .hero-card .hero-text { max-width: 540px; }
body[data-theme] .hero-photo-top,
body[data-theme] .hero-photo-caption { pointer-events: none; }

/* Setup pages: the focused field previously gained a 2 px orange rectangle
   even though the designed form uses a single underline. */
body[data-theme] .form-card input,
body[data-theme] .form-card input:focus,
body[data-theme] .form-card input:focus-visible {
  width: 100% !important;
  outline: none !important;
  outline-offset: 0 !important;
  border: 0 !important;
  border-bottom: 1px solid var(--atelier-line) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--atelier-ink) !important;
}
body[data-theme] .form-card input:focus,
body[data-theme] .form-card input:focus-visible {
  border-bottom: 2px solid var(--atelier-accent) !important;
}
body[data-theme] .form-card .form-heading h2 {
  font-size: clamp(2.7rem, 4.2vw, 4.6rem) !important;
  line-height: 1.2 !important;
  overflow-wrap: normal;
}
body[data-theme] .form-card .form-heading { margin-bottom: 18px !important; padding-bottom: 26px !important; }
body[data-theme] .form-view { padding-top: 27px !important; }
body[data-theme] .form-card { margin-top: 26px !important; }
body[data-theme] .generated-room {
  grid-template-columns: minmax(0,1fr) auto auto !important;
  column-gap: 18px !important;
  align-items: center !important;
}
body[data-theme] .generated-room strong {
  white-space: nowrap;
  letter-spacing: .11em !important;
  font-size: clamp(1.5rem,2.2vw,2.15rem) !important;
}
body[data-theme] .toggle-pill[data-enabled="false"] {
  color: var(--atelier-muted) !important;
}
body[data-theme] .toggle-pill:focus-visible,
body[data-theme] .hero-primary:focus-visible,
body[data-theme] .hero-secondary:focus-visible {
  outline: 2px solid var(--atelier-accent) !important;
  outline-offset: 4px !important;
}

/* The meeting header is *theme aware*; video itself stays cinematic and dark.
   This fixes the black-on-dark clock and the invisible Light/Dark button text. */
body[data-theme="light"][data-view="meeting"] {
  --meet-chrome-bg: #f5f4ef;
  --meet-chrome-text: #25312f;
  --meet-chrome-muted: #596963;
  --meet-chrome-line: #d5dad5;
  --meet-chrome-hover: #e7e8e2;
  --meet-live: #26816b;
}
body[data-theme="dark"][data-view="meeting"] {
  --meet-chrome-bg: #121b1e;
  --meet-chrome-text: #f1f1e9;
  --meet-chrome-muted: #aebbb6;
  --meet-chrome-line: #344044;
  --meet-chrome-hover: #253236;
  --meet-live: #82c7ad;
}
body[data-theme][data-view="meeting"],
body[data-theme="light"][data-view="meeting"],
body[data-theme="dark"][data-view="meeting"] {
  background: #121a1d !important;
  color: #edf0eb !important;
  overflow: hidden !important;
}
body[data-view="meeting"] .app-shell {
  width: 100% !important;
  max-width: none !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
}
body[data-view="meeting"] #meetingView.active {
  height: 100dvh !important;
  min-height: 0 !important;
  gap: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
body[data-theme="light"][data-view="meeting"] .meeting-top,
body[data-theme="dark"][data-view="meeting"] .meeting-top,
body[data-view="meeting"] .meeting-top {
  display: flex !important;
  flex: 0 0 80px !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 16px !important;
  width: 100% !important;
  min-height: 80px !important;
  height: 80px !important;
  padding: 12px 28px !important;
  margin: 0 !important;
  background: var(--meet-chrome-bg) !important;
  color: var(--meet-chrome-text) !important;
  border: 0 !important;
  border-bottom: 1px solid var(--meet-chrome-line) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
  backdrop-filter: none !important;
}
body[data-view="meeting"] .meeting-top .meeting-live-chip {
  display: inline-flex !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  gap: 9px !important;
  white-space: nowrap !important;
  color: var(--meet-live) !important;
  font-size: .69rem !important;
  font-weight: 750 !important;
  letter-spacing: .12em !important;
  line-height: 1.2 !important;
}
body[data-view="meeting"] .meeting-top .meeting-live-chip i { background: var(--meet-live) !important; }
body[data-view="meeting"] .meeting-top .meeting-hud-left {
  display: flex !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  width: auto !important;
  height: auto !important;
  padding: 0 19px 0 0 !important;
  gap: 0 !important;
  border-right: 1px solid var(--meet-chrome-line) !important;
  overflow: visible !important;
  color: var(--meet-chrome-muted) !important;
}
body[data-view="meeting"] .meeting-top .meeting-clock {
  display: inline-block !important;
  position: static !important;
  opacity: 1 !important;
  visibility: visible !important;
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  color: var(--meet-chrome-text) !important;
  font-family: 'DM Sans',Arial,sans-serif !important;
  font-size: .80rem !important;
  font-weight: 650 !important;
  letter-spacing: .01em !important;
  white-space: nowrap !important;
  font-variant-numeric: tabular-nums;
}
body[data-view="meeting"] .meeting-top .meeting-sep { display: none !important; }
body[data-view="meeting"] .meeting-top .room-meta {
  flex: 0 1 auto !important;
  display: flex !important;
  min-width: 0 !important;
  max-width: 400px !important;
  margin-right: auto !important;
  overflow: visible !important;
  align-items: center !important;
  gap: 13px !important;
  color: var(--meet-chrome-text) !important;
}
body[data-view="meeting"] .meeting-top .room-meta img {
  flex: 0 0 41px !important;
  width: 41px !important;
  height: 41px !important;
  object-fit: contain !important;
  border-radius: 8px !important;
  background: #07162a !important;
}
body[data-view="meeting"] .meeting-top .room-meta > div {
  min-width: 0 !important;
  width: 100% !important;
}
body[data-view="meeting"] .meeting-top .room-meta span,
body[data-view="meeting"] .meeting-top .room-meta small,
body[data-view="meeting"] .meeting-top .room-meta .host-meta {
  display: block !important;
  color: var(--meet-chrome-muted) !important;
  font-size: .64rem !important;
  line-height: 1.45 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
body[data-view="meeting"] .meeting-top .room-meta span { font-size: .62rem !important; letter-spacing: .10em !important; }
body[data-view="meeting"] .meeting-top .room-meta strong {
  color: var(--meet-chrome-text) !important;
  font-size: 1.04rem !important;
  line-height: 1.24 !important;
  font-weight: 750 !important;
  letter-spacing: .085em !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
body[data-view="meeting"] .meeting-top .room-meta small b { color: inherit !important; }
body[data-view="meeting"] .meeting-top .share-actions {
  display: flex !important;
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: 45vw !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 0 !important;
  overflow: visible !important;
  flex-wrap: nowrap !important;
  color: var(--meet-chrome-text) !important;
}
body[data-view="meeting"] .meeting-top .share-actions .mini-btn,
body[data-view="meeting"] .meeting-top .share-actions .theme-switch,
body[data-view="meeting"] .meeting-top .share-actions button {
  position: relative !important;
  display: inline-flex !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 40px !important;
  height: 40px !important;
  margin: 0 !important;
  padding: 0 16px !important;
  gap: 9px !important;
  justify-content: center !important;
  align-items: center !important;
  white-space: nowrap !important;
  background: transparent !important;
  color: var(--meet-chrome-text) !important;
  border: 0 !important;
  border-left: 1px solid var(--meet-chrome-line) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transform: none !important;
  font-weight: 600 !important;
  font-size: .78rem !important;
  opacity: 1 !important;
}
body[data-view="meeting"] .meeting-top .share-actions button:hover {
  background: var(--meet-chrome-hover) !important;
}
body[data-view="meeting"] .meeting-top .share-actions button span { color: inherit !important; }
body[data-view="meeting"] .meeting-top .share-actions button svg,
body[data-view="meeting"] .meeting-top .share-actions button svg path,
body[data-view="meeting"] .meeting-top .share-actions button svg circle {
  width: 18px !important;
  height: 18px !important;
  color: var(--meet-chrome-text) !important;
  stroke: var(--meet-chrome-text) !important;
  filter: none !important;
}
body[data-view="meeting"] .meeting-top .share-actions button:focus-visible {
  outline: 2px solid var(--meet-live) !important;
  outline-offset: -4px !important;
}

/* Meeting surface: video stage never gets covered by the controls. */
body[data-view="meeting"] .call-layout {
  display: flex !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}
body[data-theme="light"][data-view="meeting"] .stage,
body[data-theme="dark"][data-view="meeting"] .stage,
body[data-view="meeting"] .call-layout .stage {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: 100% !important;
  padding: 14px 22px 0 !important;
  gap: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  background: #121a1d !important;
  color: #edf0eb !important;
  border: 0 !important;
  border-radius: 0 !important;
}
body[data-view="meeting"] .call-layout .stage::before { display: none !important; }
body[data-view="meeting"] .call-layout .video-grid,
body[data-view="meeting"] .call-layout .video-grid[data-pinned]:not([data-pinned=""]) {
  position: relative !important;
  inset: auto !important;
  display: grid;
  flex: 1 1 auto !important;
  width: 100% !important;
  height: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  gap: 6px !important;
  overflow: hidden !important;
  background: #22292d !important;
  border: 1px solid #303c3e !important;
  border-radius: 0 !important;
}
body[data-view="meeting"] .stage .video-tile {
  min-height: 0 !important;
  background: #242b2e !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
body[data-view="meeting"] .stage .tile-badge,
body[data-view="meeting"] .stage .local-tile .tile-badge {
  background: rgba(16,24,27,.86) !important;
  color: #f0f2ee !important;
  border: 1px solid rgba(219,232,224,.18) !important;
  padding: 7px 12px !important;
  font-size: .73rem !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
body[data-view="meeting"] .stage .tile-badge span,
body[data-view="meeting"] .stage .tile-badge svg { color: #f0f2ee !important; stroke: #f0f2ee !important; }
body[data-view="meeting"] .stage .tile-pin,
body[data-view="meeting"] .stage .tile-fullscreen-action {
  background: rgba(18,28,30,.85) !important;
  color: #f4f4f0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
body[data-view="meeting"] .stage .avatar-placeholder p { color: #e5e9e5 !important; }
body[data-view="meeting"] .stage .avatar-circle { background: #d4b49e !important; color: #152024 !important; }

/* Flat continuous toolbar, matching icons and states; no old rainbow squares. */
body[data-theme="light"][data-view="meeting"] .call-layout .stage .call-controls,
body[data-theme="dark"][data-view="meeting"] .call-layout .stage .call-controls,
body[data-view="meeting"] .call-layout .stage .call-controls,
body.screen-share-mode[data-view="meeting"] .call-layout .stage .call-controls {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  transform: none !important;
  display: flex !important;
  flex: 0 0 82px !important;
  align-items: center !important;
  justify-content: center !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  height: 82px !important;
  min-height: 82px !important;
  margin: 0 !important;
  padding: 12px 14px !important;
  color: #e8eeeb !important;
  background: #121a1d !important;
  border: 0 !important;
  border-top: 1px solid #374447 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  overflow: visible !important;
}
body[data-view="meeting"] .call-layout .stage .call-controls > button.control-btn,
body.screen-share-mode[data-view="meeting"] .call-layout .stage .call-controls > button.control-btn {
  position: relative !important;
  display: inline-flex !important;
  flex: 0 0 54px !important;
  align-items: center !important;
  justify-content: center !important;
  width: 54px !important;
  max-width: 54px !important;
  min-width: 0 !important;
  height: 51px !important;
  min-height: 51px !important;
  padding: 0 !important;
  gap: 0 !important;
  color: #dce5df !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  opacity: 1 !important;
  filter: none !important;
  transform: none !important;
  animation: none !important;
}
body[data-view="meeting"] .call-layout .stage .call-controls > button.control-btn:hover {
  color: #ffffff !important;
  background: #273438 !important;
  transform: none !important;
}
body[data-view="meeting"] .call-layout .stage .call-controls > button.control-btn.on {
  color: #b4e3cb !important;
  background: rgba(83,143,119,.12) !important;
}
body[data-view="meeting"] .call-layout .stage .call-controls > button.control-btn.off {
  color: #f0bcb5 !important;
  background: rgba(173,92,80,.14) !important;
}
body[data-view="meeting"] .call-layout .stage .call-controls > button.control-btn.danger,
body[data-view="meeting"] .call-layout .stage .call-controls > button#hangupBtn {
  color: #fff !important;
  background: #aa4b46 !important;
  border: 0 !important;
  box-shadow: none !important;
}
body[data-view="meeting"] .call-layout .stage .call-controls > button#hangupBtn:hover { background: #c15c54 !important; }
body[data-view="meeting"] .call-layout .stage .call-controls > button.control-btn svg,
body[data-view="meeting"] .call-layout .stage .call-controls > button.control-btn svg path,
body[data-view="meeting"] .call-layout .stage .call-controls > button.control-btn svg circle {
  width: 20px !important;
  height: 20px !important;
  color: inherit !important;
  stroke: currentColor !important;
  filter: none !important;
}
body[data-view="meeting"] .call-layout .stage .call-controls > button.control-btn::after,
body[data-view="meeting"] .call-layout .stage .call-controls > button.control-btn::before { display: none !important; }
body[data-view="meeting"] .call-layout .stage .call-controls > button.control-btn:focus-visible {
  outline: 2px solid #b5cfc3 !important;
  outline-offset: 2px !important;
}
body[data-view="meeting"] .call-layout .stage .call-controls .chat-badge { color: #fff !important; }

/* Tablet & mobile: keep branding legible and every control reachable. */
@media (max-width: 1100px) {
  body[data-view="meeting"] .meeting-top .meeting-live-chip { display: none !important; }
  body[data-view="meeting"] .meeting-top { gap: 13px !important; padding: 12px 20px !important; }
  body[data-view="meeting"] .meeting-top .room-meta { max-width: 300px !important; }
  body[data-view="meeting"] .meeting-top .share-actions { max-width: none !important; }
}
@media (max-width: 720px) {
  body:not([data-view="meeting"]) .topbar { min-height: 75px !important; }
  body[data-theme] .form-card .form-heading h2 { font-size: clamp(2.4rem,9vw,3.65rem) !important; }
  body[data-theme] .form-card .form-heading { padding-bottom: 20px !important; }
  body[data-theme] .generated-room { grid-template-columns: 1fr auto !important; row-gap: 7px !important; }
  body[data-theme] .generated-room span { grid-column: 1/-1 !important; }
  body[data-theme] .generated-room strong { font-size: clamp(1.25rem,6vw,1.8rem) !important; }
  body[data-view="meeting"] .meeting-top {
    display: flex !important;
    min-height: 68px !important;
    height: 68px !important;
    flex-basis: 68px !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 7px 12px !important;
  }
  body[data-view="meeting"] .meeting-top .meeting-hud-left { display: none !important; }
  body[data-view="meeting"] .meeting-top .meeting-live-chip { display: none !important; }
  body[data-view="meeting"] .meeting-top .room-meta {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    max-width: none !important;
    gap: 8px !important;
  }
  body[data-view="meeting"] .meeting-top .room-meta img {
    width: 36px !important;
    height: 36px !important;
    flex-basis: 36px !important;
  }
  body[data-view="meeting"] .meeting-top .room-meta span { font-size: .52rem !important; }
  body[data-view="meeting"] .meeting-top .room-meta strong { font-size: .89rem !important; }
  body[data-view="meeting"] .meeting-top .room-meta small { display: none !important; }
  body[data-view="meeting"] .meeting-top .share-actions {
    width: auto !important;
    flex: 0 0 auto !important;
    max-width: 92px !important;
    gap: 0 !important;
  }
  body[data-view="meeting"] .meeting-top .share-actions .mini-btn#copyCodeBtn { display: none !important; }
  body[data-view="meeting"] .meeting-top .share-actions .mini-btn#copyInviteBtn,
  body[data-view="meeting"] .meeting-top .share-actions .theme-switch#meetingThemeToggle {
    display: inline-flex !important;
    flex: 0 0 38px !important;
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 !important;
  }
  body[data-view="meeting"] .meeting-top .share-actions #copyInviteBtn { font-size: 0 !important; }
  body[data-view="meeting"] .meeting-top .share-actions .theme-switch span { display: none !important; }
  body[data-view="meeting"] .call-layout .stage { padding: 8px 8px 0 !important; }
  body[data-view="meeting"] .call-layout .video-grid,
  body[data-view="meeting"] .call-layout .video-grid[data-pinned]:not([data-pinned=""]) {
    width: 100% !important;
    min-height: 0 !important;
    height: 0 !important;
    border: 1px solid #364346 !important;
  }
  body[data-theme="light"][data-view="meeting"] .call-layout .stage .call-controls,
  body[data-theme="dark"][data-view="meeting"] .call-layout .stage .call-controls,
  body[data-view="meeting"] .call-layout .stage .call-controls {
    display: grid !important;
    grid-template-columns: repeat(5,minmax(0,1fr)) !important;
    flex: 0 0 116px !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 116px !important;
    min-height: 116px !important;
    gap: 3px !important;
    padding: 5px 4px max(9px,env(safe-area-inset-bottom)) !important;
    justify-items: center !important;
    align-content: center !important;
  }
  body[data-view="meeting"] .call-layout .stage .call-controls > button.control-btn {
    width: min(100%,50px) !important;
    max-width: 50px !important;
    min-width: 0 !important;
    height: 45px !important;
    min-height: 45px !important;
    flex: none !important;
  }
  body[data-view="meeting"] .call-layout .stage .call-controls > button.control-btn:nth-child(6) { grid-column: 2 !important; }
  body[data-view="meeting"] .call-layout .stage .call-controls > button.control-btn svg { width: 19px !important; height: 19px !important; }
  body[data-view="meeting"] .stage .tile-badge { font-size: .66rem !important; max-width: 85% !important; }
}
@media (max-width: 430px) {
  body[data-theme] .topbar .brand small { font-size: .49rem !important; letter-spacing: .07em !important; }
  body[data-theme] .topbar .nav-actions { gap: 4px !important; }
  body[data-theme] .topbar .status-chip { display: none !important; }
  body[data-view="meeting"] .meeting-top .room-meta span { max-width: 195px !important; }
  body[data-view="meeting"] .meeting-top .share-actions .theme-switch,
  body[data-view="meeting"] .meeting-top .share-actions .mini-btn { border-left: 0 !important; }
}
@media (prefers-reduced-motion: reduce) {
  body[data-theme] .control-btn,
  body[data-theme] .topbar .theme-switch { transition-duration: .01ms !important; }
}

/* High-specificity phone header repair: old media styles wrap its actions
   onto a second, overlapping row unless both theme selectors are covered. */
@media (max-width: 720px) {
  body[data-theme="light"][data-view="meeting"] .meeting-top,
  body[data-theme="dark"][data-view="meeting"] .meeting-top {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex: 0 0 68px !important;
    width: 100% !important;
    height: 68px !important;
    min-height: 68px !important;
    max-height: 68px !important;
    padding: 7px 12px !important;
    gap: 8px !important;
  }
  body[data-theme="light"][data-view="meeting"] .meeting-top .room-meta,
  body[data-theme="dark"][data-view="meeting"] .meeting-top .room-meta {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    max-width: calc(100% - 90px) !important;
    margin: 0 auto 0 0 !important;
  }
  body[data-theme="light"][data-view="meeting"] .meeting-top .share-actions,
  body[data-theme="dark"][data-view="meeting"] .meeting-top .share-actions {
    display: flex !important;
    flex: 0 0 76px !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: flex-end !important;
    align-items: center !important;
    width: 76px !important;
    min-width: 76px !important;
    max-width: 76px !important;
    height: 40px !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
    overflow: visible !important;
  }
  body[data-theme="light"][data-view="meeting"] .meeting-top .share-actions #copyInviteBtn,
  body[data-theme="dark"][data-view="meeting"] .meeting-top .share-actions #copyInviteBtn {
    grid-column: auto !important;
    flex: 0 0 38px !important;
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
  }
  body[data-theme="light"][data-view="meeting"] .meeting-top .share-actions #meetingThemeToggle,
  body[data-theme="dark"][data-view="meeting"] .meeting-top .share-actions #meetingThemeToggle {
    flex: 0 0 38px !important;
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
  }
}
body[data-theme="light"][data-view="meeting"] #localLabel,
body[data-theme="dark"][data-view="meeting"] #localLabel,
body[data-theme="light"][data-view="meeting"] #remoteLabel,
body[data-theme="dark"][data-view="meeting"] #remoteLabel,
body[data-view="meeting"] .video-tile .avatar-placeholder p {
  color: #ebf0ed !important;
  font-size: clamp(.83rem,1.1vw,1rem) !important;
  font-weight: 600 !important;
  text-shadow: none !important;
}
body[data-theme="light"][data-view="meeting"] .stage .tile-pin svg,
body[data-theme="dark"][data-view="meeting"] .stage .tile-pin svg,
body[data-theme="light"][data-view="meeting"] .stage .tile-fullscreen-action svg,
body[data-theme="dark"][data-view="meeting"] .stage .tile-fullscreen-action svg {
  color: #edf0e9 !important;
  stroke: #edf0e9 !important;
  filter: none !important;
}
/* The initial invite sheet should not hide half the local mobile preview. */
body[data-view="meeting"] #inviteCard {
  position: fixed !important;
  top: 92px !important;
  right: 24px !important;
  left: auto !important;
  bottom: auto !important;
  width: min(360px, calc(100vw - 48px)) !important;
  max-height: min(65dvh,540px) !important;
  overflow-y: auto !important;
  z-index: 90 !important;
  border: 1px solid #425254 !important;
  border-radius: 0 !important;
  box-shadow: 0 14px 30px rgba(0,0,0,.16) !important;
  padding: 23px 20px !important;
}
@media (max-width:720px) {
  body[data-view="meeting"] #inviteCard {
    top: 76px !important;
    left: 8px !important;
    right: 8px !important;
    width: calc(100vw - 16px) !important;
    max-height: min(52dvh,390px) !important;
    padding: 19px 17px !important;
  }
}

/* Feedback is readable but never masks the call-control dock. */
body[data-theme="light"][data-view="meeting"] .toast,
body[data-theme="dark"][data-view="meeting"] .toast,
body[data-view="meeting"] #toast {
  bottom: 99px !important;
  max-width: min(90vw,420px) !important;
  padding: 10px 15px !important;
  border: 1px solid #53635f !important;
  border-radius: 0 !important;
  background: #263236 !important;
  color: #f1f3ed !important;
  font-size: .80rem !important;
  line-height: 1.35 !important;
  box-shadow: 0 10px 24px rgba(0,0,0,.19) !important;
}
body[data-view="meeting"] #toast.error { background: #663830 !important; color: #fff2ed !important; }
body[data-view="meeting"] #inviteCard .invite-card-title {
  font-family:'DM Sans',Arial,sans-serif !important;
  font-size: 1.22rem !important;
  font-weight: 600 !important;
  letter-spacing: -.02em !important;
  line-height: 1.3 !important;
  margin: 0 26px 14px 0 !important;
  color: #f1f3ed !important;
}
body[data-view="meeting"] #inviteCard .invite-card-text,
body[data-view="meeting"] #inviteCard .invite-card-note {
  line-height: 1.45 !important;
  font-size: .81rem !important;
  margin: 12px 0 !important;
}
body[data-view="meeting"] #inviteCard .invite-primary-btn {
  min-height: 43px !important;
  border-radius: 0 !important;
  font-size: .85rem !important;
  padding: 8px 13px !important;
  box-shadow: none !important;
}
body[data-view="meeting"] #inviteCard .invite-link-box { min-height: 42px !important; }
body[data-theme="light"][data-view="meeting"] #inviteCard .invite-link-box button svg,
body[data-theme="dark"][data-view="meeting"] #inviteCard .invite-link-box button svg,
body[data-view="meeting"] #inviteCard #inviteLinkCopyBtn svg {
  color: #f1eee7 !important;
  stroke: #f1eee7 !important;
  opacity: 1 !important;
}
@media (max-width:720px) {
  body[data-view="meeting"] #toast { bottom: 126px !important; }
  body[data-view="meeting"] #inviteCard { max-height: min(42dvh,335px) !important; }
}

/* Mid-size tablets: don't let 3 action buttons wrap below an 80px header. */
@media (min-width:721px) and (max-width:980px) {
  body[data-theme="light"][data-view="meeting"] .meeting-top,
  body[data-theme="dark"][data-view="meeting"] .meeting-top {
    display:flex !important;
    flex-wrap:nowrap !important;
    flex-direction:row !important;
    align-items:center !important;
    height:76px !important;
    min-height:76px !important;
    flex:0 0 76px !important;
    padding:9px 17px !important;
    gap:12px !important;
  }
  body[data-view="meeting"] .meeting-top .meeting-hud-left { display:none !important; }
  body[data-view="meeting"] .meeting-top .room-meta { flex:1 1 0 !important; min-width:0 !important; max-width:none !important; margin-right:auto !important; }
  body[data-view="meeting"] .meeting-top .share-actions { display:flex !important; flex:0 0 auto !important; max-width:none !important; width:auto !important; margin:0 !important; }
  body[data-view="meeting"] .meeting-top .share-actions #copyCodeBtn { display:none !important; }
}

/* Functional drawers sit ABOVE, never behind, the fixed-height call dock. */
body[data-theme="light"][data-view="meeting"] #chatDrawer,
body[data-theme="dark"][data-view="meeting"] #chatDrawer,
body[data-view="meeting"] .call-layout #chatDrawer {
  position: fixed !important;
  inset: 80px 0 82px auto !important;
  top: 80px !important;
  right: 0 !important;
  bottom: 82px !important;
  left: auto !important;
  display: flex !important;
  flex-direction: column !important;
  width: min(400px, 100vw) !important;
  height: auto !important;
  max-height: calc(100dvh - 162px) !important;
  min-height: 0 !important;
  padding: 16px 18px !important;
  overflow: hidden !important;
  border-radius: 0 !important;
  border: 0 !important;
  border-left: 1px solid #536062 !important;
  background: #1b2428 !important;
  color: #eef1ed !important;
  box-shadow: none !important;
  z-index: 50 !important;
}
body[data-view="meeting"] #chatDrawer .chat-head {
  flex: 0 0 auto !important;
  padding: 4px 0 14px !important;
  min-height: 0 !important;
  border-bottom: 1px solid #465456 !important;
  color: #f1f2ec !important;
}
body[data-view="meeting"] #chatDrawer .chat-head strong {
  color: #f1f2ec !important;
  font-family: 'DM Sans',Arial,sans-serif !important;
  font-size: 1.03rem !important;
  font-weight: 650 !important;
}
body[data-view="meeting"] #chatDrawer .chat-head small { color: #aebbb6 !important; }
body[data-view="meeting"] #chatDrawer .chat-messages {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  margin: 0 !important;
  padding: 13px 0 !important;
}
body[data-view="meeting"] #chatDrawer .chat-input-wrap {
  flex: 0 0 auto !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 9px 0 0 !important;
  min-height: 53px !important;
  background: transparent !important;
  border: 0 !important;
  border-top: 1px solid #465456 !important;
  border-radius: 0 !important;
}
body[data-view="meeting"] #chatDrawer #chatInput {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  color: #f1f3ef !important;
  background: #121d20 !important;
  border: 1px solid #475456 !important;
  border-radius: 0 !important;
  height: 40px !important;
  padding: 8px 10px !important;
  box-shadow: none !important;
}
body[data-view="meeting"] #chatDrawer #chatInput::placeholder { color: #aebbb6 !important; }
body[data-view="meeting"] #chatDrawer .emoji-btn,
body[data-view="meeting"] #chatDrawer .send-btn,
body[data-view="meeting"] #chatDrawer .icon-only {
  color: #ebf1ec !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
body[data-view="meeting"] #chatDrawer .icon-only svg,
body[data-view="meeting"] #chatDrawer .icon-only svg path,
body[data-view="meeting"] #chatDrawer .emoji-btn svg,
body[data-view="meeting"] #chatDrawer .send-btn svg {
  color: #ebf1ec !important;
  stroke: #ebf1ec !important;
}
body[data-view="meeting"] #chatDrawer #closeChatBtn { color: #e9a19d !important; }
body[data-view="meeting"] #chatDrawer #closeChatBtn svg path { stroke: #e9a19d !important; }
body[data-view="meeting"] #chatDrawer #closeChatBtn:hover { background: #2c3437 !important; }
body[data-view="meeting"] #chatDrawer .emoji-row {
  flex: 0 0 auto !important;
  overflow-x: auto !important;
  max-height: 90px !important;
  background: #1b2428 !important;
  border-radius: 0 !important;
}
body[data-theme="light"][data-view="meeting"] #morePanel,
body[data-theme="dark"][data-view="meeting"] #morePanel,
body[data-theme="light"][data-view="meeting"] .side-panel,
body[data-theme="dark"][data-view="meeting"] .side-panel,
body[data-theme="light"][data-view="meeting"] #devicePanel,
body[data-theme="dark"][data-view="meeting"] #devicePanel {
  top: 87px !important;
  right: 16px !important;
  bottom: 92px !important;
  max-height: calc(100dvh - 179px) !important;
  overflow-y: auto !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
@media (max-width: 720px) {
  body[data-theme="light"][data-view="meeting"] #chatDrawer,
  body[data-theme="dark"][data-view="meeting"] #chatDrawer,
  body[data-view="meeting"] .call-layout #chatDrawer {
    inset: 68px 0 116px auto !important;
    top: 68px !important;
    right: 0 !important;
    bottom: 116px !important;
    left: auto !important;
    width: 100vw !important;
    max-width: 100vw !important;
    max-height: calc(100dvh - 184px) !important;
    padding: 14px 13px !important;
    border-left: 0 !important;
  }
  body[data-theme="light"][data-view="meeting"] #morePanel,
  body[data-theme="dark"][data-view="meeting"] #morePanel,
  body[data-theme="light"][data-view="meeting"] .side-panel,
  body[data-theme="dark"][data-view="meeting"] .side-panel,
  body[data-theme="light"][data-view="meeting"] #devicePanel,
  body[data-theme="dark"][data-view="meeting"] #devicePanel {
    top: 76px !important;
    right: 8px !important;
    bottom: 124px !important;
    max-height: calc(100dvh - 200px) !important;
  }
}
/* Stronger targets for icons whose original theme rules force navy strokes. */
body[data-theme="light"][data-view="meeting"] .video-tile .tile-badge svg *,
body[data-theme="dark"][data-view="meeting"] .video-tile .tile-badge svg *,
body[data-theme="light"][data-view="meeting"] .video-tile .tile-pin svg *,
body[data-theme="dark"][data-view="meeting"] .video-tile .tile-pin svg * {
  stroke: #edf2ee !important;
  color: #edf2ee !important;
}
