:root {
  color-scheme: dark;
  --bg: #0a0f15;
  --panel: #111923;
  --panel-strong: #172231;
  --ink: #f7fafc;
  --muted: #a8b3bf;
  --line: rgba(255, 255, 255, 0.12);
  --brand: #55dba7;
  --brand-dark: #31b889;
  --brand-soft: rgba(85, 219, 167, 0.16);
  --accent: #f0a45b;
  --danger: #f34d4d;
  --danger-soft: rgba(255, 88, 88, 0.14);
  --active-soft: rgba(255, 88, 88, 0.12);
  --camera-frame: 16 / 9;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 66% 10%, rgba(36, 79, 77, 0.28), transparent 30%),
    radial-gradient(circle at 12% 86%, rgba(85, 219, 167, 0.08), transparent 34%),
    linear-gradient(145deg, #0a0f15 0%, #101820 56%, #0b1117 100%),
    var(--bg);
  color: var(--ink);
}

body.overlay-scroll-locked {
  overflow: hidden;
  overscroll-behavior: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #101820 url("/icons/icon-192-v76.png") center / 92% 92% no-repeat;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.2),
    0 10px 28px rgba(0, 0, 0, 0.22);
  flex: 0 0 auto;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.1;
}

.brand strong {
  font-size: 1.08rem;
}

.brand small {
  color: var(--muted);
  margin-top: 3px;
}

.topbar-actions,
.room-actions,
.quick-actions,
.tile-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar-spacer {
  min-width: 1px;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  flex: 1;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.home-grid {
  min-height: calc(100vh - 112px);
  display: grid;
  grid-template-columns: minmax(0, 820px);
  justify-content: center;
  align-items: center;
  padding: 24px 0 48px;
}

.room-panel,
.lobby,
.admin-panel,
.call-controls,
.stage-layout {
  background: rgba(17, 25, 34, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.primary-panel {
  min-height: 440px;
  padding: clamp(24px, 5vw, 56px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.home-brand {
  margin-bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 900;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  line-height: 0.98;
}

h2 {
  font-size: 1.2rem;
}

.quick-actions {
  margin-top: 30px;
}

.visibility-choice {
  margin: 28px 0 0;
  padding: 22px 0 28px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.visibility-choice legend {
  grid-column: 1 / -1;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: clamp(1.08rem, 2vw, 1.32rem);
  font-weight: 950;
}

.visibility-choice legend,
.join-form > label:first-child,
.section-heading h2 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  line-height: 1.1;
}

.visibility-choice legend::before,
.join-form > label:first-child::before,
.section-heading h2::before {
  content: "";
  width: 5px;
  height: 1.1em;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--brand), var(--accent));
  box-shadow: 0 0 16px rgba(85, 219, 167, 0.24);
  flex: 0 0 auto;
}

.choice-card {
  min-height: 92px;
  padding: 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.choice-card:has(input:checked) {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.choice-card input {
  margin-top: 4px;
  accent-color: var(--brand);
}

.choice-card strong,
.choice-card small {
  display: block;
}

.choice-card small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.join-form {
  margin-top: 0;
  padding: 24px 0 28px;
  display: grid;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.join-form > label:first-child {
  color: var(--ink);
  font-size: clamp(1.08rem, 2vw, 1.32rem);
  font-weight: 950;
}

.input-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.public-rooms,
.saved-rooms {
  margin-top: 0;
  padding-top: 24px;
  border-top: 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-heading h2 {
  color: var(--ink);
  font-size: clamp(1.08rem, 2vw, 1.32rem);
  font-weight: 950;
}

.public-room-list,
.saved-room-list {
  display: grid;
  gap: 8px;
}

.public-room-button,
.saved-room-card {
  width: 100%;
  min-height: 62px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.public-room-button {
  padding: 10px 12px;
}

.saved-room-join {
  min-width: 0;
  min-height: 60px;
  padding: 10px 12px;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: inherit;
  background: transparent;
  border: 0;
  text-align: left;
}

.saved-room-remove {
  min-width: 74px;
  min-height: 42px;
  margin-right: 8px;
  border: 1px solid rgba(255, 88, 88, 0.45);
  border-radius: 8px;
  color: #ffb4b4;
  background: rgba(255, 88, 88, 0.1);
  font-weight: 900;
}

.saved-room-password {
  min-width: 86px;
  min-height: 42px;
  border: 1px solid rgba(85, 219, 167, 0.48);
  border-radius: 8px;
  color: #d9fff1;
  background: rgba(85, 219, 167, 0.1);
  font-weight: 900;
}

.saved-room-password:hover {
  color: #07110d;
  background: var(--brand);
  border-color: var(--brand);
}

.saved-room-remove:hover {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.public-room-button:hover,
.saved-room-card:hover {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.public-room-button strong,
.public-room-button small,
.saved-room-card strong,
.saved-room-card small {
  display: block;
}

.public-room-button small,
.saved-room-card small,
.empty-note {
  color: var(--muted);
}

.saved-room-heading {
  margin-top: 8px;
  color: var(--brand);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.overlay-room-list {
  gap: 10px;
}

.rooms-menu-section {
  position: relative;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.rooms-menu-section + .rooms-menu-section {
  margin-top: 14px;
}

.rooms-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.rooms-section-heading > div {
  min-width: 0;
}

.rooms-section-heading h3 {
  display: inline;
  margin: 0 0 0 8px;
  color: #f7fafc;
  font-size: 1.12rem;
}

.rooms-section-heading p {
  margin: 6px 0 0 36px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.rooms-section-number {
  display: inline-grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid rgba(85, 219, 167, 0.42);
  border-radius: 50%;
  color: var(--brand);
  background: rgba(85, 219, 167, 0.1);
  font-size: 0.78rem;
  font-weight: 900;
}

.rooms-create-toggle {
  flex: 0 0 auto;
  min-width: 190px;
  min-height: 44px;
}

.permanent-room-form {
  margin-top: 18px;
  padding-top: 18px;
  display: grid;
  gap: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.11);
}

.permanent-room-form[hidden] {
  display: none;
}

.rooms-card .settings-section.rooms-menu-section {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow: none;
}

.rooms-card .settings-section.rooms-menu-section + .settings-section.rooms-menu-section {
  margin-top: 14px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.11);
}

@media (max-width: 620px) {
  .rooms-card .settings-section.rooms-menu-section,
  .rooms-card .settings-section.rooms-menu-section + .settings-section.rooms-menu-section {
    padding: 16px;
  }

  .rooms-section-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .rooms-create-toggle {
    width: 100%;
    min-width: 0;
  }
}

label {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.joined-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

input[type="text"],
input[type="password"],
input[type="email"],
select,
input[type="range"] {
  width: 100%;
}

input[type="text"],
input[type="password"],
input[type="email"],
select {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(9, 14, 20, 0.86);
  color: var(--ink);
  padding: 0 14px;
  outline: none;
}

input[type="text"]::placeholder,
input[type="password"]::placeholder,
input[type="email"]::placeholder {
  color: #8d99a7;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.primary-button,
.secondary-button,
.ghost-button,
.control-button,
.danger-button,
.mini-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 800;
  white-space: nowrap;
}

.primary-button {
  min-height: 52px;
  background: var(--brand);
  color: #06130f;
  padding: 0 22px;
}

.primary-button:hover {
  background: var(--brand-dark);
}

.secondary-button,
.control-button {
  background: var(--panel-strong);
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.14);
}

.ghost-button,
.mini-button {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  border-color: var(--line);
}

.danger-button {
  background: var(--danger);
  color: #fff;
}

.danger-button:hover {
  background: #d83a3a;
}

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

.room-topline h1 {
  font-size: clamp(1.8rem, 4vw, 3.4rem);
}

.lobby {
  width: min(520px, 100%);
  min-height: 260px;
  margin: 12vh auto 0;
  display: grid;
  place-items: center;
  padding: 28px;
}

.lobby-controls {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.call-area {
  display: grid;
  grid-template-rows: auto auto auto;
  min-height: calc(100vh - 182px);
  gap: 14px;
  padding-bottom: 18px;
}

.admin-panel {
  min-height: 68px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-panel > div {
  display: grid;
  gap: 3px;
}

.admin-panel span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.room-visibility-control {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.room-visibility-control select {
  min-width: 132px;
}

.stage-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 12px;
  min-height: 0;
  padding: 12px;
}

.main-frame,
.participant-rail {
  min-height: 0;
}

.main-frame {
  display: grid;
  align-self: start;
  align-content: start;
  min-width: 0;
}

.participant-rail {
  display: grid;
  align-content: start;
  gap: 10px;
  overflow-y: auto;
  padding-right: 2px;
}

.video-tile {
  position: relative;
  min-height: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--ink);
  isolation: isolate;
  outline: none;
}

.video-tile.thumbnail {
  cursor: pointer;
}

.video-tile.focused {
  width: 100%;
  height: auto;
  min-height: 0;
}

.video-tile:focus-visible {
  box-shadow: 0 0 0 4px var(--brand-soft), var(--shadow);
}

.video-tile.is-speaking {
  border-color: rgba(85, 219, 167, 0.92);
  box-shadow: var(--shadow);
}

.video-tile.is-speaking .tile-bar {
  border-top-color: rgba(85, 219, 167, 0.7);
}

.camera-frame {
  position: relative;
  aspect-ratio: var(--camera-frame);
  overflow: hidden;
  background: #05080c;
}

.camera-frame video,
.video-canvas {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
  object-fit: cover;
  background: #05080c;
}

.video-canvas {
  display: none;
}

.video-tile.canvas-fallback .camera-frame video {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.video-tile.canvas-fallback .video-canvas {
  display: block;
}

.video-tile.focused .camera-frame video,
.video-tile.focused .video-canvas {
  min-height: 0;
}

.tile-placeholder {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(14, 105, 94, 0.5), rgba(201, 95, 61, 0.3)),
    #05080c;
}

.avatar-mark {
  width: 92px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 38%, #fff 0 14%, transparent 15%),
    radial-gradient(circle at 50% 100%, #fff 0 34%, transparent 35%);
  opacity: 0.34;
}

.video-tile.camera-muted .tile-placeholder {
  display: grid;
}

.video-resume {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  min-height: 44px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  padding: 0 16px;
  color: #06130f;
  background: #effdf7;
  box-shadow: var(--shadow);
  font-weight: 800;
}

.video-resume:hover {
  background: #ffffff;
}

.tile-bar {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  color: var(--ink);
  background: rgba(12, 17, 23, 0.94);
  border-top: 1px solid var(--line);
}

.video-tile.thumbnail .tile-bar {
  min-height: 46px;
  padding: 8px 9px;
}

.tile-name,
.tile-state {
  display: block;
  line-height: 1.2;
}

.tile-name {
  max-width: 32ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-state {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
}

.local .remote-mute {
  display: none;
}

.call-controls {
  min-height: 72px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.control-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.control-button.is-active,
.mini-button.is-active {
  color: var(--danger);
  background: var(--active-soft);
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(179, 38, 30, 0.13);
}

.control-icon {
  min-width: 44px;
  min-height: 28px;
  padding: 0 8px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #06130f;
  background: var(--brand);
  font-size: 0.78rem;
  font-weight: 900;
}

.control-button.is-active .control-icon {
  background: var(--danger);
  color: #fff;
}

.lock-button .control-icon {
  background: #263542;
  color: #f7fafc;
}

.call-status {
  min-height: 42px;
  max-width: 100%;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 800;
}

.volume-control,
.name-control {
  min-height: 42px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.name-control {
  padding: 8px;
}

.name-control input {
  width: 180px;
  min-height: 38px;
}

.name-control .secondary-button {
  min-height: 38px;
  padding: 0 12px;
}

.volume-control input {
  width: 130px;
  accent-color: var(--brand);
}

.meter-control {
  min-height: 42px;
  min-width: 170px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.meter-track {
  width: 74px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.meter-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #e2a13a, var(--accent));
  transition: width 80ms linear;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 40;
  width: min(520px, calc(100% - 32px));
  max-width: min(540px, calc(100% - 32px));
  padding: 12px 14px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(44, 18, 22, 0.98), rgba(17, 24, 32, 0.98));
  color: #f7fafc;
  border: 1px solid rgba(255, 88, 88, 0.78);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.4), 0 0 0 4px rgba(255, 88, 88, 0.16);
  font-weight: 800;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.debug-panel {
  position: fixed;
  inset: 18px;
  z-index: 60;
  width: min(860px, calc(100% - 36px));
  max-height: calc(100vh - 36px);
  margin: auto;
  padding: 14px;
  display: grid;
  grid-template-rows: auto minmax(260px, 1fr) auto;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.debug-header,
.debug-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.debug-header h2 {
  margin: 0;
}

#debugOutput {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: #091016;
  font: 0.82rem ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  line-height: 1.45;
}

@media (max-width: 820px) {
  .topbar,
  main {
    width: min(100% - 24px, 1180px);
  }

  .home-grid {
    grid-template-columns: 1fr;
  }

  .home-grid {
    min-height: auto;
    padding-top: 8px;
  }

  .primary-panel {
    min-height: 360px;
  }

  .joined-input {
    grid-template-columns: 1fr;
  }

  .visibility-choice {
    grid-template-columns: 1fr;
  }

  .room-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .room-actions {
    width: 100%;
  }

  .room-actions .ghost-button {
    flex: 1 1 auto;
  }

  .lobby,
  .call-area {
    min-height: auto;
  }

  .lobby {
    margin-top: 6vh;
  }

  .stage-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  .admin-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .room-visibility-control,
  .admin-panel .control-button {
    width: 100%;
  }

  .participant-rail {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0 4px;
  }

  .video-tile.thumbnail {
    flex: 0 0 clamp(156px, 38vw, 210px);
  }

  .call-controls {
    justify-content: stretch;
  }

  .call-controls > button,
  .call-status,
  .name-control,
  .volume-control,
  .meter-control {
    flex: 1 1 150px;
  }

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

  .name-control input {
    flex: 1 1 180px;
  }

  .debug-panel {
    inset: 10px;
    width: calc(100% - 20px);
    max-height: calc(100vh - 20px);
  }
}

@media (max-width: 520px) {
  .topbar {
    align-items: flex-start;
  }

  .brand small {
    display: none;
  }

  .primary-panel,
  .lobby {
    padding: 18px;
  }

  .video-tile.thumbnail {
    flex-basis: 156px;
  }

  .video-tile.thumbnail .tile-actions {
    display: none;
  }

  .video-tile.thumbnail .tile-name {
    max-width: 13ch;
  }
}

/* Roomdrop v132 centered desktop split and mobile viewport repair */
@media (min-width: 1280px) {
  body.room-active .call-controls .admin-panel {
    width: 50%;
    max-width: 50%;
    flex: 0 1 50%;
    margin-left: auto;
  }
}

@media (max-width: 900px) {
  body.room-active .room-shell {
    min-height: 100dvh;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, auto);
  }

  body.room-active .room-sidebar {
    position: fixed;
    z-index: 90;
    inset: 0 auto 0 0;
    width: min(340px, calc(100vw - 28px));
    height: var(--roomdrop-visual-height, 100dvh);
    min-height: 0;
    max-height: var(--roomdrop-visual-height, 100dvh);
    transform: translateX(-105%);
  }

  body.room-active.mobile-menu-open .room-sidebar,
  body.room-active.mobile-participants-open .room-sidebar {
    transform: translateX(0);
  }

  body.room-active.mobile-menu-open .mobile-drawer-backdrop,
  body.room-active.mobile-participants-open .mobile-drawer-backdrop {
    display: block;
  }

  body.room-active .room-workspace {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    min-height: 0;
  }

  body.mobile-chat-open .room-workspace {
    position: fixed;
    z-index: 60;
    top: 0;
    right: 0;
    bottom: auto;
    left: 0;
    width: 100%;
    height: var(--roomdrop-visual-height, 100dvh);
    max-height: var(--roomdrop-visual-height, 100dvh);
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    transform: translateY(var(--roomdrop-visual-top, 0px));
  }

  body.mobile-chat-open .call-area,
  body.mobile-chat-open .stage-layout,
  body.mobile-chat-open .chat-panel {
    min-height: 0;
  }

  body.mobile-chat-open .chat-panel {
    overflow: hidden;
  }

  body.mobile-chat-open .chat-composer {
    flex: 0 0 auto;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
}

/* Roomdrop v131 desktop dock and responsive room navigation */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.sidebar-profile {
  display: none !important;
}

.chat-header {
  position: relative;
  overflow: visible;
}

.chat-room-info {
  position: absolute;
  z-index: 24;
  top: 52px;
  right: 8px;
  width: min(292px, calc(100% - 16px));
  padding: 12px;
  grid-template-columns: 1fr;
  background: #18232e;
  border: 1px solid rgba(85, 219, 167, 0.34);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.48);
}

.chat-room-info > div {
  padding: 7px 8px;
  background: rgba(255, 255, 255, 0.045);
  border-radius: 6px;
}

.chat-room-info-button,
.chat-attach-button,
.chat-send-button {
  width: 42px;
  min-width: 42px;
  max-width: 42px;
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  padding: 0 !important;
  overflow: hidden;
  display: inline-grid;
  place-items: center;
  color: #eef5f8;
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
}

.chat-room-info-button:hover,
.chat-attach-button:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.28);
}

.chat-send-button {
  color: #07110d;
  background: #55dba7;
  border-color: #55dba7;
}

.chat-send-button:hover {
  background: #70e3b6;
  border-color: #70e3b6;
}

.chat-room-info-button .control-icon,
.chat-attach-button .control-icon,
.chat-send-button .control-icon,
.chat-room-info-button .control-icon svg,
.chat-attach-button .control-icon svg,
.chat-send-button .control-icon svg {
  width: 21px;
  min-width: 21px;
  height: 21px;
  min-height: 21px;
}

body.media-maximized .stage-layout {
  position: static;
  inset: auto;
  width: auto;
  height: auto;
  display: block;
  background: transparent;
}

body.media-maximized .chat-panel {
  display: none !important;
}

body.media-maximized .call-controls {
  display: none !important;
}

body.media-maximized .media-stage,
.media-stage:fullscreen {
  position: fixed;
  z-index: 220;
  inset: 0;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: none;
  max-height: none;
  background: #05080c;
  border: 0;
  border-radius: 0;
}

.media-stage:fullscreen {
  position: relative;
  width: 100% !important;
  height: 100% !important;
}

body.media-maximized .media-stage .main-frame,
.media-stage:fullscreen .main-frame {
  width: 100%;
  height: 100% !important;
  min-height: 100% !important;
}

@media (min-width: 1280px) {
  .room-shell {
    --room-sidebar-width: 380px;
    grid-template-columns: var(--room-sidebar-width) minmax(0, 1fr);
  }

  body.room-active .room-sidebar {
    height: calc(100dvh - 108px);
    padding: 20px 16px 14px;
    gap: 16px;
  }

  body.room-active .room-workspace {
    width: 100%;
    max-width: none;
    padding-bottom: 112px;
  }

  body.room-active .call-area {
    padding-bottom: 0;
  }

  .sidebar-participants .participant-admin-actions {
    flex-wrap: nowrap;
    gap: 5px;
  }

  .sidebar-participants .participant-admin-button {
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    flex-basis: 48px;
  }

  body.room-active .call-controls {
    position: fixed;
    z-index: 74;
    left: 12px;
    right: 12px;
    bottom: 10px;
    width: auto;
    max-width: none;
    min-height: 86px;
    margin: 0;
    padding: 9px 12px;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow: visible;
    background: rgba(15, 24, 33, 0.97);
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.52);
  }

  body.room-active .call-controls > .control-button,
  body.room-active .call-controls > .end-call-button {
    width: 66px;
    min-width: 66px;
    max-width: 66px;
    height: 60px;
    min-height: 60px;
  }

  body.room-active .call-controls .audio-stack {
    width: clamp(270px, 18vw, 330px);
    min-width: 270px;
    flex: 0 1 330px;
  }

  body.room-active .call-controls .admin-panel {
    width: auto;
    min-width: 0;
    max-width: none;
    min-height: 64px;
    margin-left: auto;
    padding: 0 0 0 10px;
    flex: 1 1 auto;
    border-left: 1px solid rgba(255, 255, 255, 0.11);
  }

  body.room-active .call-controls .admin-access-controls {
    width: 100%;
    min-width: 0;
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: center;
    align-content: center;
    gap: 7px;
  }

  body.room-active .call-controls .room-visibility-control,
  body.room-active .call-controls .room-join-mode-control {
    width: 146px;
    min-width: 112px;
    flex: 0 1 146px;
  }

  body.room-active .call-controls .room-access-pill {
    width: 232px;
    min-width: 188px;
    flex: 0 1 232px;
  }

  body.room-active .call-controls .admin-transfer-control,
  body.room-active .call-controls .admin-delete-control {
    flex: 0 0 82px;
  }

  body.room-active .call-controls .transfer-admin-button,
  body.room-active .call-controls .delete-room-button {
    width: 82px;
    min-width: 82px;
    max-width: 82px;
  }
}

@media (min-width: 1280px) and (max-width: 1499px) {
  .room-shell {
    --room-sidebar-width: 350px;
  }

  body.room-active .call-controls {
    gap: 6px;
  }

  body.room-active .call-controls > .control-button,
  body.room-active .call-controls > .end-call-button {
    width: 62px;
    min-width: 62px;
    max-width: 62px;
  }

  body.room-active .call-controls .audio-stack {
    width: 250px;
    min-width: 230px;
    flex-basis: 250px;
  }

  body.room-active .call-controls .room-visibility-control,
  body.room-active .call-controls .room-join-mode-control {
    width: 130px;
    flex-basis: 130px;
  }

  body.room-active .call-controls .room-access-pill {
    width: 205px;
    min-width: 170px;
    flex-basis: 205px;
  }
}

@media (max-width: 900px) {
  body.room-active {
    min-height: 100dvh;
  }

  body.room-active .room-workspace {
    min-height: 0;
  }

  body.room-active .room-topline {
    align-items: flex-start;
  }

  .mobile-room-actions {
    display: none !important;
  }

  .mobile-view-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .mobile-view-tab,
  .mobile-menu-button {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    height: 46px;
    padding: 0 10px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 0.82rem;
    line-height: 1;
  }

  .mobile-view-tab .control-text {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: nowrap;
  }

  .mobile-view-tab.has-unread {
    color: #fff1f1;
    border-color: rgba(255, 91, 91, 0.85);
    box-shadow: inset 0 0 0 1px rgba(255, 91, 91, 0.24);
  }

  .mobile-view-tab.has-unread .control-icon {
    color: #ff7b7b;
  }

  .mobile-view-tab.has-unread::after {
    position: absolute;
    top: 7px;
    right: 9px;
    width: 8px;
    height: 8px;
    margin: 0;
    box-shadow: 0 0 0 3px #111922;
  }

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

  body.mobile-chat-open .room-workspace {
    height: var(--roomdrop-visual-height, 100dvh);
    max-height: var(--roomdrop-visual-height, 100dvh);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  body.mobile-chat-open .room-topline,
  body.mobile-chat-open .mobile-view-tabs {
    flex: 0 0 auto;
  }

  body.mobile-chat-open .call-area {
    min-height: 0;
    flex: 1 1 auto;
    display: block;
    overflow: hidden;
  }

  body.mobile-chat-open .stage-layout,
  body.mobile-chat-open .chat-panel {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
  }

  body.mobile-chat-open .chat-panel {
    border-radius: 8px;
  }

  body.mobile-chat-open .chat-messages {
    min-height: 0;
  }

  body.mobile-menu-open .sidebar-profile {
    display: none !important;
  }
}

@media (max-width: 520px) {
  .mobile-view-tabs {
    margin-bottom: 7px;
  }

  .mobile-view-tab,
  .mobile-menu-button {
    min-height: 44px;
    height: 44px;
    font-size: 0.78rem;
  }

  .chat-room-info {
    top: 50px;
    width: calc(100% - 16px);
  }
}

body.room-active {
  color-scheme: dark;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 68% 9%, rgba(36, 79, 77, 0.24), transparent 30%),
    linear-gradient(145deg, #0a0f15 0%, #101820 55%, #0b1117 100%);
  color: #f7fafc;
}

body.room-active .topbar {
  display: none;
}

body.room-active main {
  width: 100%;
  margin: 0;
}

body.room-active .app-shell {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025), transparent 22%),
    radial-gradient(circle at 86% 76%, rgba(62, 176, 145, 0.08), transparent 34%),
    #0a0f15;
}

.room-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}

.room-sidebar {
  min-height: 100vh;
  padding: 30px 18px;
  display: flex;
  flex-direction: column;
  gap: 34px;
  background:
    linear-gradient(180deg, rgba(23, 32, 42, 0.96), rgba(11, 17, 24, 0.96)),
    #111820;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 18px 0 60px rgba(0, 0, 0, 0.28);
}

.room-brand {
  color: #f7fafc;
}

.room-brand-button {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
}

.room-brand-button:hover .brand-mark {
  box-shadow:
    inset 0 0 0 1px rgba(85, 219, 167, 0.55),
    0 10px 28px rgba(0, 0, 0, 0.22),
    0 0 0 4px rgba(85, 219, 167, 0.12);
}

.room-brand small,
.sidebar-profile small {
  color: #9da8b3;
}

.room-nav {
  display: grid;
  gap: 10px;
}

.room-nav-item {
  min-height: 58px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #d7dee6;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  text-decoration: none;
}

button.room-nav-item {
  width: 100%;
  text-align: left;
}

.room-nav-item.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.room-nav-item.muted {
  opacity: 1;
}

.room-nav-item.disabled {
  opacity: 0.38;
  cursor: not-allowed;
  filter: grayscale(0.55);
  pointer-events: none;
}

.room-nav-item.disabled .nav-icon {
  border-style: dashed;
}

.room-nav-item > span:first-child {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  font-size: 0;
}

.room-nav-item .nav-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.room-nav-item strong {
  font-size: 0.98rem;
}

.sidebar-profile {
  margin-top: auto;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.sidebar-profile-button {
  min-width: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 0;
}

.profile-avatar,
.participant-avatar {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #effdf7;
  background: linear-gradient(135deg, #16735f, #4aaa81);
  font-weight: 900;
  box-shadow: 0 0 0 4px rgba(80, 220, 154, 0.11);
}

.sidebar-profile strong,
.sidebar-profile small {
  display: block;
  max-width: 142px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-name-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.sidebar-name-editor input {
  min-height: 38px;
  padding-inline: 10px;
}

.sidebar-name-editor .secondary-button {
  min-height: 38px;
  padding-inline: 10px;
}

.settings-overlay,
.rooms-overlay {
  position: fixed;
  inset: 0;
  z-index: 58;
  padding: 22px;
  display: grid;
  place-items: center;
  background: rgba(3, 7, 11, 0.62);
  backdrop-filter: blur(12px);
  overscroll-behavior: contain;
}

.settings-card,
.rooms-card {
  width: min(560px, 100%);
  max-height: min(720px, calc(100vh - 44px));
  overflow: auto;
  padding: 18px;
  color: #f7fafc;
  background:
    linear-gradient(180deg, rgba(21, 30, 40, 0.98), rgba(10, 15, 22, 0.98)),
    #101820;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
  overscroll-behavior: contain;
}

.rooms-card {
  width: min(680px, 100%);
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.settings-section h3 {
  margin: 0;
}

.settings-title {
  margin: 0;
  color: #55dba7;
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0;
  text-transform: none;
}

.settings-section {
  margin-top: 26px;
  display: grid;
  gap: 14px;
}

.settings-section h3 {
  color: #f7fafc;
  font-size: 1.22rem;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0;
}

.settings-section + .settings-section {
  margin-top: 28px;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(85, 219, 167, 0.12);
}

.settings-section select {
  width: 100%;
}

.notification-channel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, auto);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.notification-channel strong,
.notification-channel label {
  display: block;
  margin: 0 0 3px;
  color: #f7fafc;
  font-weight: 900;
}

.notification-channel .input-help {
  font-size: 0.82rem;
}

.notification-channel .secondary-button {
  min-width: 170px;
  min-height: 44px;
  padding-inline: 12px;
  white-space: normal;
}

.notification-email-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.notification-email-control input {
  min-height: 44px;
}

@media (max-width: 620px) {
  .notification-channel {
    grid-template-columns: 1fr;
  }

  .notification-channel .secondary-button {
    width: 100%;
  }
}

.password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 98px;
  gap: 8px;
}

.password-toggle {
  width: 98px;
  min-width: 98px;
  display: inline-grid;
  grid-template-columns: 18px auto;
  place-items: center;
  gap: 6px;
}

.password-toggle .control-icon,
.password-toggle .control-icon svg {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
}

.settings-toggle {
  min-height: 48px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #f7fafc;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.settings-toggle input {
  width: 18px;
  height: 18px;
  accent-color: #55dba7;
}

.settings-toggle span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.settings-toggle strong {
  color: #f7fafc;
}

.settings-toggle small {
  color: #a8b3bf;
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.35;
}

.settings-range,
.settings-meter {
  min-height: 58px;
  padding: 10px 12px;
  display: grid;
  gap: 8px;
  color: #c5ced8;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.settings-range > span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.settings-range strong {
  color: #f7fafc;
}

.settings-meter {
  grid-template-columns: 110px minmax(0, 1fr);
  align-items: center;
}

.settings-meter .meter-track {
  width: 100%;
}

.room-workspace {
  min-width: 0;
  padding: 30px 24px 28px;
}

body.room-active .room-topline {
  max-width: none;
  margin: 0 0 16px;
  padding: 0;
  color: #f7fafc;
}

body.room-active .room-topline h1 {
  max-width: none;
  font-size: clamp(1.75rem, 3vw, 2.45rem);
  line-height: 1.08;
}

.room-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.copy-room-button {
  min-height: 38px;
  margin-top: 6px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.copy-room-button .control-icon {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  color: inherit;
}

.copy-room-button .control-icon svg {
  width: 18px;
  height: 18px;
}

body.room-active .eyebrow {
  color: #55dba7;
}

body.room-active .ghost-button {
  background: rgba(19, 27, 36, 0.82);
  border-color: rgba(255, 255, 255, 0.16);
  color: #f7fafc;
}

body.room-active .ghost-button:hover,
body.room-active .control-button:hover,
body.room-active .secondary-button:hover {
  border-color: rgba(85, 219, 167, 0.58);
}

body.room-active .outline-danger {
  color: #ff6b6b;
  background: rgba(66, 18, 22, 0.16);
  border-color: rgba(255, 88, 88, 0.65);
}

body.room-active .outline-danger:hover,
body.room-active .end-call-button:hover {
  background: #d83a3a;
  color: #ffffff;
}

body.room-active input[type="text"],
body.room-active input[type="password"],
body.room-active input[type="email"],
body.room-active select {
  color: #eef5fb;
  background: rgba(9, 14, 20, 0.86);
  border-color: rgba(255, 255, 255, 0.14);
}

body.room-active input[type="text"]::placeholder,
body.room-active input[type="password"]::placeholder,
body.room-active input[type="email"]::placeholder {
  color: #8d99a7;
}

body.room-active input[type="text"]:focus,
body.room-active input[type="password"]:focus,
body.room-active input[type="email"]:focus,
body.room-active select:focus {
  border-color: #55dba7;
  box-shadow: 0 0 0 3px rgba(85, 219, 167, 0.16);
}

body.room-active label {
  color: #a8b3bf;
}

body.room-active .lobby {
  width: min(560px, 100%);
  margin-top: 8vh;
  background: rgba(16, 24, 32, 0.88);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}

body.room-lobby-active .room-workspace {
  min-height: 100vh;
  padding: 24px;
  display: grid;
  place-items: center;
}

body.room-lobby-active .lobby {
  width: min(520px, 100%);
  min-height: auto;
  margin: 0;
}

.call-area {
  max-width: none;
  margin: 0;
}

body.room-active .call-area {
  min-height: calc(100vh - 132px);
  padding-bottom: 0;
}

body.room-active .admin-panel,
body.room-active .stage-layout,
body.room-active .call-controls,
body.room-active .participant-panel {
  background: rgba(17, 25, 34, 0.76);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

body.room-active .admin-panel {
  min-height: 78px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, auto);
  align-items: center;
  gap: 14px;
}

.admin-copy {
  display: flex;
  align-items: center;
  gap: 0;
  justify-self: end;
  text-align: right;
}

.admin-access-controls {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.admin-copy strong,
.room-access-pill strong {
  color: #f7fafc;
  font-size: 1rem;
}

.admin-copy small,
.room-access-pill > span:not(.access-icon) > span {
  display: block;
  margin-top: 4px;
  color: #a8b3bf;
  font-size: 0.9rem;
  line-height: 1.25;
}

.admin-icon {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #eef5fb;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.72rem;
  font-weight: 900;
}

body.room-active .admin-panel span {
  color: #a8b3bf;
}

.room-access-pill {
  width: min(300px, 100%);
  min-height: 54px;
  padding: 0 14px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  background: rgba(85, 219, 167, 0.08);
  border: 1px solid rgba(85, 219, 167, 0.22);
}

.room-access-pill.is-public {
  color: #9ef0c4;
  background: rgba(85, 219, 167, 0.12);
  border-color: rgba(85, 219, 167, 0.38);
}

.room-access-pill.is-private {
  color: #ffd18f;
  background: rgba(240, 164, 91, 0.12);
  border-color: rgba(240, 164, 91, 0.34);
}

.room-access-pill.is-locked {
  color: #ffb4b4;
  background: rgba(255, 88, 88, 0.12);
  border-color: rgba(255, 88, 88, 0.4);
}

.access-icon {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.admin-panel .room-access-pill .access-icon {
  color: inherit;
}

.access-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.room-visibility-control {
  width: min(210px, 100%);
  display: grid;
  gap: 6px;
}

body.room-active .room-visibility-control select {
  min-height: 54px;
}

body.room-active .lock-button {
  width: 54px;
  min-width: 54px;
  min-height: 54px;
  padding: 0;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  color: #f7fafc;
  border-radius: 50%;
}

.lock-control {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 76px;
}

.lock-label {
  color: #c5ced8;
  font-size: 0.75rem;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
}

body.room-active .lock-button.is-active {
  color: #ffb4b4;
  background: rgba(255, 88, 88, 0.12);
  border-color: rgba(255, 88, 88, 0.58);
}

body.room-active .stage-layout {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
  align-items: stretch;
  gap: 16px;
  min-height: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

body.room-active .main-frame {
  min-width: 0;
}

body.room-active .video-tile {
  color: #f7fafc;
  background: rgba(14, 21, 28, 0.92);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}

body.room-active .video-tile.focused {
  overflow: hidden;
}

body.room-active .video-tile.focused .camera-frame {
  aspect-ratio: 16 / 9;
  max-height: min(54vh, 620px);
  background: #05080c;
}

body.room-active .camera-frame video,
body.room-active .video-canvas {
  object-fit: contain;
  background: #05080c;
}

body.room-active .tile-bar {
  min-height: 58px;
  color: #f7fafc;
  background: rgba(12, 17, 23, 0.94);
  border-top-color: rgba(255, 255, 255, 0.1);
}

body.room-active .tile-state {
  color: #a8b3bf;
}

body.room-active .video-tile.is-speaking {
  border-color: rgba(85, 219, 167, 0.92);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}

body.room-active .video-tile.is-speaking .tile-bar {
  border-top-color: rgba(85, 219, 167, 0.7);
}

@keyframes roomdrop-speaking-pulse {
  0%,
  100% {
    box-shadow:
      0 0 0 2px rgba(85, 219, 167, 0.18),
      0 24px 80px rgba(0, 0, 0, 0.32);
  }
  50% {
    box-shadow:
      0 0 0 5px rgba(85, 219, 167, 0.3),
      0 24px 80px rgba(0, 0, 0, 0.32);
  }
}

.participant-panel {
  min-height: 100%;
  padding: 0;
  overflow: hidden;
  border-radius: 8px;
}

.participant-tabs {
  min-height: 52px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #f7fafc;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.participant-tabs span {
  color: #a8b3bf;
}

.participant-section-label {
  margin: 18px 16px 10px;
  color: #9da8b3;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

body.room-active .participant-rail {
  display: grid;
  gap: 6px;
  padding: 0 10px 16px;
  overflow-y: auto;
}

.participant-row {
  width: 100%;
  min-height: 72px;
  padding: 6px;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: #f7fafc;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.participant-row:focus-visible {
  border-color: rgba(85, 219, 167, 0.78);
  box-shadow: 0 0 0 3px rgba(85, 219, 167, 0.16);
  outline: none;
}

.participant-preview {
  position: relative;
  width: 72px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  background: #05080c;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.participant-preview video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #05080c;
}

.participant-preview .participant-avatar {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: none;
}

.participant-row:not(.no-video) .participant-avatar {
  display: none;
}

.participant-row:hover,
.participant-row.active {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.participant-row.is-speaking {
  background: rgba(85, 219, 167, 0.1);
  border-color: rgba(85, 219, 167, 0.82);
  box-shadow: 0 0 0 2px rgba(85, 219, 167, 0.14);
}

.participant-row.is-speaking .participant-preview {
  border-color: rgba(85, 219, 167, 0.9);
}

.participant-copy {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 3px;
}

.participant-name-line {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.participant-copy strong {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.participant-copy small {
  display: block;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  color: #a8b3bf;
  font-size: 0.82rem;
  line-height: 1.25;
}

.participant-status-line {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.participant-status-line small {
  min-width: 0;
  flex: 1 1 auto;
}

.participant-status-icons {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.participant-status-icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  color: #ffb4b4;
  background: rgba(255, 88, 88, 0.12);
  border: 1px solid rgba(255, 88, 88, 0.38);
  border-radius: 999px;
}

.participant-status-icon svg {
  width: 12px;
  height: 12px;
}

.admin-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 8px;
  color: #dbe7ef;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  font-weight: 900;
}

.participant-admin-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 2px;
}

.participant-admin-button {
  min-width: 64px;
  min-height: 42px;
  padding: 5px 8px;
  display: inline-grid;
  place-items: center;
  gap: 2px;
  border: 1px solid rgba(85, 219, 167, 0.35);
  border-radius: 8px;
  color: #dff7ee;
  background: rgba(85, 219, 167, 0.12);
  font-size: 0.74rem;
  font-weight: 900;
}

.participant-admin-button .control-icon,
.participant-admin-button .control-icon svg {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
}

.participant-admin-button .control-text {
  max-width: 74px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.participant-admin-button:hover {
  border-color: rgba(85, 219, 167, 0.8);
  background: rgba(85, 219, 167, 0.2);
}

.participant-admin-button.is-danger {
  color: #ffb4b4;
  background: rgba(255, 88, 88, 0.1);
  border-color: rgba(255, 88, 88, 0.42);
}

.participant-admin-button.is-danger:hover {
  color: #fff;
  background: rgba(255, 88, 88, 0.32);
  border-color: rgba(255, 88, 88, 0.76);
}

.participant-alias-editor {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: end;
  padding-top: 4px;
}

.participant-alias-editor label {
  display: grid;
  gap: 5px;
  color: #aebccc;
  font-size: 0.72rem;
  font-weight: 800;
}

.participant-alias-editor input {
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  color: #f7fafc;
  background: rgba(3, 8, 13, 0.78);
}

.chat-message.mentioned {
  border-color: rgba(85, 219, 167, 0.62);
  box-shadow: inset 3px 0 0 rgba(85, 219, 167, 0.92);
}

body.room-active .call-controls {
  width: 100%;
  max-width: 100%;
  min-height: 88px;
  margin: 18px auto 0;
  padding: 12px 16px;
  border-radius: 28px;
  justify-content: flex-start;
  gap: 10px;
  overflow: hidden;
}

body.room-active .call-status,
body.room-active .name-control,
body.room-active .volume-control,
body.room-active .meter-control {
  min-width: 0;
  color: #c5ced8;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

body.room-active .call-status {
  flex: 1 1 150px;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.room-active .name-control {
  flex: 1 1 250px;
  max-width: 340px;
}

body.room-active .name-control input {
  min-width: 0;
  width: 100%;
}

body.room-active .volume-control {
  flex: 1 1 260px;
  max-width: 340px;
}

body.room-active .meter-control {
  flex: 1 1 150px;
  max-width: 190px;
}

body.room-active .control-button {
  width: 76px;
  min-width: 76px;
  flex: 0 0 76px;
  min-height: 64px;
  padding: 7px 6px 6px;
  flex-direction: column;
  gap: 5px;
  justify-content: center;
  color: #f7fafc;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  border-radius: 16px;
}

body.room-active .admin-panel .lock-button {
  width: 54px;
  min-width: 54px;
  flex: 0 0 54px;
  min-height: 54px;
  padding: 0;
  border-radius: 50%;
}

body.room-active .control-icon {
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  background: transparent;
  color: inherit;
}

.control-icon svg {
  width: 24px;
  height: 24px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.room-active .call-controls .control-text,
body.room-active .end-call-button .control-text {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  color: #c5ced8;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  white-space: normal;
}

body.room-active .control-button.is-active {
  color: #ffb4b4;
  background: rgba(255, 88, 88, 0.12);
  border-color: rgba(255, 88, 88, 0.68);
}

body.room-active .control-button.is-active .control-icon {
  background: transparent;
}

body.room-active .mute-all-active,
body.room-active .control-button[aria-pressed="true"] {
  box-shadow: 0 0 0 3px rgba(255, 88, 88, 0.13);
}

body.room-active .volume-control input {
  min-width: 0;
  flex: 1 1 100px;
  accent-color: #55dba7;
}

body.room-active .meter-track {
  background: rgba(255, 255, 255, 0.14);
}

body.room-active .end-call-button {
  width: 76px;
  min-width: 76px;
  flex: 0 0 76px;
  min-height: 64px;
  padding: 7px 6px 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border-radius: 16px;
  background: #f34d4d;
  border-color: transparent;
  color: #ffffff;
}

body.room-active .secondary-button {
  color: #f7fafc;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

body.room-active .debug-panel {
  background: #101820;
  border-color: rgba(255, 255, 255, 0.12);
}

body.room-active #debugOutput {
  color: #eaf1f7;
  background: #091016;
  border-color: rgba(255, 255, 255, 0.12);
}

@media (max-width: 1120px) {
  .room-shell {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .room-sidebar {
    padding: 24px 12px;
    align-items: center;
  }

  .room-brand span:last-child,
  .room-nav-item strong,
  .sidebar-profile span:last-child {
    display: none;
  }

  .room-nav-item {
    width: 58px;
    padding: 0;
    justify-content: center;
  }

  .room-workspace {
    padding-inline: 24px;
  }
}

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

  .room-sidebar {
    display: none;
  }

  .room-workspace {
    padding: 18px 14px 22px;
  }

  body.room-active .room-topline {
    margin-bottom: 18px;
    align-items: flex-start;
    flex-direction: column;
  }

  body.room-active .room-actions {
    width: 100%;
  }

  body.room-active .room-actions > button {
    flex: 1 1 160px;
  }

  body.room-active .admin-panel,
  body.room-active .stage-layout {
    grid-template-columns: 1fr;
  }

  body.room-active .admin-panel {
    align-items: stretch;
  }

  body.room-active .call-controls {
    width: 100%;
    border-radius: 22px;
  }

  body.room-active .name-control,
  body.room-active .volume-control,
  body.room-active .meter-control,
  body.room-active .call-status {
    flex: 1 1 220px;
  }
}

@media (max-width: 620px) {
  body.room-active .room-topline h1 {
    font-size: 1.65rem;
  }

  body.room-active .admin-panel {
    padding: 14px;
  }

  .participant-row {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .participant-preview {
    width: 64px;
  }

  .admin-badge {
    grid-column: 2;
    justify-self: start;
  }

  .participant-admin-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .participant-admin-button {
    flex: 1 1 0;
  }

  body.room-active .call-controls {
    justify-content: stretch;
  }

  body.room-active .control-button,
  body.room-active .end-call-button {
    flex: 1 1 112px;
    border-radius: 16px;
  }
}

body.room-active .call-controls .admin-panel {
  min-height: 64px;
  margin-left: auto;
  padding: 0 0 0 14px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex: 1 1 560px;
  max-width: 760px;
  min-width: 0;
  background: transparent;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}

body.room-active .call-controls .admin-copy {
  display: none;
}

body.room-active .call-controls .admin-access-controls {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: nowrap;
}

body.room-active .call-controls .room-visibility-control {
  width: 168px;
  flex: 0 0 168px;
}

body.room-active .call-controls .room-access-pill {
  width: min(280px, 100%);
  flex: 1 1 230px;
}

body.room-active .call-controls .lock-control {
  flex: 0 0 76px;
}

@media (max-width: 1240px) {
  body.room-active .call-controls .admin-panel {
    flex-basis: 100%;
    max-width: none;
    margin-left: 0;
    padding: 12px 0 0;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    justify-content: stretch;
  }

  body.room-active .call-controls .admin-access-controls {
    justify-content: stretch;
  }
}

@media (max-width: 620px) {
  body.room-active .call-controls .admin-panel {
    padding: 12px 0 0;
    overflow-x: auto;
  }

  body.room-active .call-controls .admin-access-controls {
    min-width: max-content;
    align-items: center;
    justify-content: flex-start;
  }

  body.room-active .call-controls .room-visibility-control {
    width: 140px;
    flex: 0 0 140px;
  }

  body.room-active .call-controls .room-access-pill {
    width: 220px;
    flex: 0 0 220px;
  }

  body.room-active .call-controls .lock-control {
    width: 70px;
    flex: 0 0 70px;
  }

  body.room-active .call-controls .lock-control {
    align-items: center;
    justify-items: center;
  }

  body.room-active .call-controls .lock-label {
    text-align: center;
  }
}

body.room-active .call-controls > .control-button,
body.room-active .call-controls > .end-call-button {
  width: 78px;
  min-width: 78px;
  max-width: 78px;
  height: 66px;
  min-height: 66px;
  max-height: 66px;
  flex: 0 0 78px;
  box-sizing: border-box;
}

body.room-active .call-controls > .control-button .control-text,
body.room-active .call-controls > .end-call-button .control-text {
  width: 100%;
  min-height: 1.55rem;
  max-height: 1.55rem;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body.room-active .audio-stack {
  width: 300px;
  min-width: 300px;
  max-width: 300px;
  flex: 0 0 300px;
  display: grid;
  gap: 6px;
}

body.room-active .audio-stack .volume-control,
body.room-active .audio-stack .meter-control {
  width: 100%;
  max-width: none;
  min-width: 0;
  height: 30px;
  min-height: 30px;
  padding: 0 10px;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
}

body.room-active .audio-stack .volume-control span,
body.room-active .audio-stack .meter-control span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.room-active .audio-stack .volume-control input {
  width: 100%;
  min-width: 0;
}

body.room-active .audio-stack .meter-track {
  width: 100%;
  min-width: 0;
}

body.room-active .call-controls .admin-panel {
  flex: 0 1 470px;
  max-width: 470px;
  transform: translateY(-4px);
}

body.room-active .call-controls .admin-access-controls {
  align-items: end;
}

body.room-active .call-controls .room-visibility-control {
  width: 150px;
  flex: 0 0 150px;
}

body.room-active .call-controls .room-access-pill {
  width: 270px;
  flex: 0 0 270px;
}

body.room-active .room-access-pill > span:not(.access-icon) {
  min-width: 0;
}

body.room-active .room-access-pill strong,
body.room-active .room-access-pill > span:not(.access-icon) > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 620px) {
  body.room-active .audio-stack {
    width: 100%;
    min-width: 220px;
    max-width: none;
    flex: 1 1 220px;
  }

  body.room-active .call-controls .admin-panel {
    transform: none;
  }
}

body.room-active .stage-layout {
  align-items: start;
}

body.room-active .video-tile.focused,
body.room-active .participant-panel {
  height: clamp(360px, calc(100vh - 280px), 680px);
}

body.room-active .video-tile.focused {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 58px;
}

body.room-active .video-tile.focused .camera-frame {
  height: 100%;
  max-height: none;
}

body.room-active .participant-panel {
  min-height: 0;
  align-self: start;
}

body.room-active .participant-rail {
  max-height: calc(100% - 92px);
}

body.room-active .call-controls {
  min-height: 78px;
  margin-top: 12px;
  padding: 8px 14px;
  gap: 8px;
}

body.room-active .audio-stack {
  width: 342px;
  min-width: 342px;
  max-width: 342px;
  flex-basis: 342px;
}

body.room-active .audio-stack .volume-control,
body.room-active .audio-stack .meter-control {
  grid-template-columns: 112px minmax(0, 1fr);
}

body.room-active .audio-stack .volume-control span,
body.room-active .audio-stack .meter-control span:first-child {
  overflow: visible;
  text-overflow: clip;
}

body.room-active .call-controls .admin-panel {
  flex: 1 1 760px;
  max-width: none;
  min-height: 66px;
  transform: translateY(-2px);
}

body.room-active .call-controls .admin-access-controls {
  align-items: center;
  gap: 10px;
}

body.room-active .call-controls .room-visibility-control {
  width: 152px;
  flex: 0 0 152px;
}

body.room-active .call-controls .room-visibility-control span,
.admin-transfer-control label > span {
  min-height: 1rem;
  line-height: 1;
}

body.room-active .call-controls .room-access-pill {
  width: 270px;
  flex: 0 0 270px;
}

.admin-transfer-control,
.admin-delete-control {
  min-width: 88px;
  flex: 0 0 88px;
  display: grid;
  align-items: end;
  gap: 8px;
}

.admin-transfer-control label {
  min-width: 0;
  display: grid;
  gap: 6px;
}

body.room-active .admin-transfer-control select {
  width: 100%;
  min-height: 54px;
}

body.room-active .transfer-admin-button,
body.room-active .delete-room-button {
  width: 88px;
  min-width: 88px;
  max-width: 88px;
  height: 54px;
  min-height: 54px;
  max-height: 54px;
  padding: 5px 6px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 14px;
}

body.room-active .transfer-admin-button .control-icon,
body.room-active .delete-room-button .control-icon {
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
}

body.room-active .transfer-admin-button .control-text,
body.room-active .delete-room-button .control-text {
  width: 100%;
  max-height: 1.45rem;
  overflow: hidden;
  color: #c5ced8;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
}

body.room-active .transfer-admin-button:disabled,
body.room-active .delete-room-button:disabled,
body.room-active .admin-transfer-control select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 1240px) {
  body.room-active .call-controls .admin-panel {
    flex-basis: 100%;
    transform: none;
  }

  body.room-active .call-controls .admin-access-controls {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  body.room-active .video-tile.focused,
  body.room-active .participant-panel {
    height: auto;
  }

  body.room-active .video-tile.focused {
    display: block;
  }

  body.room-active .video-tile.focused .camera-frame {
    height: auto;
    max-height: 52svh;
  }

  body.room-active .participant-panel {
    max-height: 260px;
  }
}

@media (max-width: 620px) {
  body.room-active .call-controls {
    padding: 8px;
  }

  body.room-active .audio-stack {
    width: 100%;
    min-width: 280px;
    flex-basis: 100%;
  }

  body.room-active .call-controls .admin-panel {
    overflow-x: visible;
  }

  body.room-active .call-controls .admin-access-controls {
    min-width: 0;
  }

  .admin-transfer-control,
  .admin-delete-control,
  body.room-active .call-controls .room-access-pill,
  body.room-active .call-controls .room-visibility-control {
    width: 100%;
    flex: 1 1 100%;
  }
}

/* Roomdrop v41 refinements */
.settings-meter {
  --gate-threshold: 8%;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.settings-meter.is-active {
  border-color: rgba(85, 219, 167, 0.9);
  background: rgba(85, 219, 167, 0.1);
  box-shadow: 0 0 0 3px rgba(85, 219, 167, 0.14);
}

.settings-meter .meter-track {
  position: relative;
  height: 12px;
  overflow: visible;
}

.settings-meter .meter-track #settingsMicLevelBar {
  position: relative;
  z-index: 1;
  background: linear-gradient(90deg, #55dba7, #f0c46e, #ff6b6b);
}

.settings-meter .meter-track .gate-marker {
  position: absolute;
  z-index: 2;
  top: -5px;
  bottom: -5px;
  left: var(--gate-threshold);
  width: 2px;
  height: auto;
  display: block;
  border-radius: 999px;
  background: #f7fafc;
  box-shadow: 0 0 0 2px rgba(5, 8, 12, 0.72), 0 0 12px rgba(247, 250, 252, 0.38);
  transform: translateX(-1px);
}

.settings-meter small {
  grid-column: 1 / -1;
  color: #a8b3bf;
  font-size: 0.8rem;
  font-weight: 800;
}

@media (max-width: 620px) {
  .settings-meter {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .settings-meter .meter-track {
    width: 100%;
    min-width: 0;
    height: 14px;
  }

  .settings-meter small {
    grid-column: auto;
  }
}

body.room-active .call-area {
  min-height: 0;
  gap: 8px;
  align-content: start;
}

body.room-active .call-controls {
  min-height: 64px;
  margin-top: 7px;
  padding: 6px 12px;
  align-items: center;
  gap: 8px;
  border-radius: 22px;
}

body.room-active .call-controls > .control-button,
body.room-active .call-controls > .end-call-button {
  width: 68px;
  min-width: 68px;
  max-width: 68px;
  height: 56px;
  min-height: 56px;
  max-height: 56px;
  flex: 0 0 68px;
  padding: 5px 4px;
  gap: 3px;
  border-radius: 14px;
}

body.room-active .call-controls > .control-button .control-icon,
body.room-active .call-controls > .end-call-button .control-icon {
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
}

body.room-active .call-controls > .control-button .control-text,
body.room-active .call-controls > .end-call-button .control-text {
  min-height: 1.35rem;
  max-height: 1.35rem;
  font-size: 0.66rem;
  line-height: 1.02;
}

body.room-active .audio-stack {
  width: 330px;
  min-width: 330px;
  max-width: 330px;
  flex: 0 0 330px;
  gap: 4px;
}

body.room-active .audio-stack .volume-control,
body.room-active .audio-stack .meter-control {
  height: 25px;
  min-height: 25px;
  padding: 0 10px;
  grid-template-columns: 112px minmax(0, 1fr);
}

body.room-active .call-controls .admin-panel {
  min-height: 58px;
  padding: 0 0 0 12px;
  transform: none;
  align-items: center;
}

body.room-active .call-controls .admin-access-controls {
  align-items: start;
  gap: 10px;
}

body.room-active .call-controls .room-visibility-control,
.admin-transfer-control label {
  height: 58px;
  display: grid;
  grid-template-rows: 12px 44px;
  gap: 2px;
  align-items: stretch;
}

body.room-active .call-controls .room-visibility-control span,
.admin-transfer-control label > span {
  min-height: 0;
  line-height: 1;
  font-size: 0.76rem;
}

body.room-active .call-controls .room-visibility-control select,
body.room-active .admin-transfer-control select {
  height: 44px;
  min-height: 44px;
}

body.room-active .call-controls .room-access-pill {
  height: 44px;
  min-height: 44px;
  margin-top: 14px;
  padding: 0 10px;
}

body.room-active .call-controls .room-access-pill .access-icon {
  width: 30px;
  height: 30px;
}

.admin-transfer-control,
.admin-delete-control {
  min-width: 82px;
  flex: 0 0 82px;
  grid-template-columns: 1fr;
  align-items: start;
}

body.room-active .transfer-admin-button,
body.room-active .delete-room-button {
  width: 82px;
  min-width: 82px;
  max-width: 82px;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  margin-top: 14px;
  padding: 4px 5px;
}

body.room-active .transfer-admin-button .control-icon,
body.room-active .delete-room-button .control-icon {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
}

body.room-active .transfer-admin-button .control-text,
body.room-active .delete-room-button .control-text {
  max-height: 1.3rem;
  font-size: 0.64rem;
}

@media (max-width: 1240px) {
  body.room-active .call-controls .admin-panel {
    min-height: 58px;
    padding: 8px 0 0;
  }
}

@media (max-width: 620px) {
  body.room-active .call-controls {
    padding: 6px;
  }

  body.room-active .audio-stack {
    width: 100%;
    min-width: 250px;
    max-width: none;
    flex-basis: 100%;
  }

  body.room-active .call-controls .room-access-pill,
  body.room-active .call-controls .transfer-admin-button,
  body.room-active .call-controls .delete-room-button {
    margin-top: 0;
  }

  body.room-active .call-controls .room-visibility-control,
  .admin-transfer-control label {
    height: auto;
    grid-template-rows: auto 44px;
  }
}

/* Roomdrop v42 refinements */
body.room-active .camera-frame {
  display: grid;
  place-items: center;
}

body.room-active .camera-frame video,
body.room-active .video-canvas {
  margin: auto;
  justify-self: center;
  align-self: center;
  object-position: center center;
}

body.room-active .call-controls > .control-button,
body.room-active .call-controls > .end-call-button {
  width: 78px;
  min-width: 78px;
  max-width: 78px;
  height: 66px;
  min-height: 66px;
  max-height: 66px;
  flex: 0 0 78px;
  padding: 7px 6px 6px;
  display: inline-grid;
  grid-template-rows: 26px minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  gap: 4px;
  text-align: center;
}

body.room-active .call-controls > .control-button .control-icon,
body.room-active .call-controls > .end-call-button .control-icon {
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  display: grid;
  place-items: center;
  margin: 0;
}

body.room-active .call-controls > .control-button .control-icon svg,
body.room-active .call-controls > .end-call-button .control-icon svg {
  width: 23px;
  height: 23px;
}

body.room-active .call-controls > .control-button .control-text,
body.room-active .call-controls > .end-call-button .control-text {
  min-height: 1.5rem;
  max-height: 1.5rem;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  line-height: 1.06;
}

/* Roomdrop v43 themed confirmation dialog */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 62;
  padding: 22px;
  display: grid;
  place-items: center;
  background: rgba(3, 7, 11, 0.66);
  backdrop-filter: blur(12px);
  overscroll-behavior: contain;
}

.confirm-card {
  width: min(460px, 100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
  padding: 18px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  color: #f7fafc;
  background:
    linear-gradient(180deg, rgba(21, 30, 40, 0.98), rgba(10, 15, 22, 0.98)),
    #101820;
  border: 1px solid rgba(255, 88, 88, 0.46);
  border-radius: 12px;
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  overscroll-behavior: contain;
}

.confirm-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffb4b4;
  background: rgba(255, 88, 88, 0.12);
  border: 1px solid rgba(255, 88, 88, 0.44);
}

.confirm-mark svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.confirm-copy h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.15;
}

.confirm-copy p:not(.eyebrow) {
  margin: 8px 0 0;
  color: #c5ced8;
  line-height: 1.45;
  white-space: pre-line;
}

.confirm-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.confirm-actions .ghost-button,
.confirm-actions .danger-button {
  min-width: 112px;
}

body.room-active .call-controls {
  padding-bottom: 10px;
}

@media (max-width: 620px) {
  .confirm-card {
    grid-template-columns: 1fr;
  }

  .confirm-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  body.room-active .call-controls {
    padding-bottom: 9px;
  }
}

/* Roomdrop v44 media centering */
body.room-active .video-tile.focused .camera-frame {
  width: 100%;
  min-width: 0;
  aspect-ratio: auto;
  justify-self: stretch;
  align-self: stretch;
}

body.room-active .video-tile.focused .camera-frame video,
body.room-active .video-tile.focused .video-canvas {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: 50% 50%;
}

body.room-active .video-tile.focused.canvas-fallback .video-canvas {
  justify-self: stretch;
  align-self: stretch;
}

/* Roomdrop v45 full media-stage fill */
body.room-active .main-frame,
body.room-active .video-tile.focused,
body.room-active .video-tile.focused .camera-frame {
  background: #05080c;
}

body.room-active .video-tile.focused .camera-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
}

body.room-active .video-tile.focused .camera-frame video,
body.room-active .video-tile.focused .video-canvas {
  display: block;
  flex: 0 0 auto;
  margin: auto;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  background: #05080c;
}

/* Roomdrop v46 admin chooser and consistent media stage */
.confirm-extra {
  margin-top: 14px;
}

.confirm-fields {
  display: grid;
  gap: 8px;
}

.confirm-fields label {
  color: #a8b3bf;
  font-size: 0.78rem;
  font-weight: 900;
}

.confirm-fields input {
  width: 100%;
}

.confirm-select {
  display: grid;
  gap: 7px;
}

.confirm-select span {
  color: #a8b3bf;
  font-size: 0.78rem;
  font-weight: 900;
}

.confirm-select select {
  width: 100%;
  height: 46px;
  min-height: 46px;
}

.confirm-check {
  min-height: 44px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #c5ced8;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 800;
}

.confirm-check input {
  width: 18px;
  height: 18px;
  accent-color: #55dba7;
}

body.room-active .main-frame {
  align-content: stretch;
  background: #05080c;
}

body.room-active .video-tile.focused {
  background: #05080c;
}

body.room-active .video-tile.focused .camera-frame {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #05080c;
}

body.room-active .video-tile.focused .camera-frame video,
body.room-active .video-tile.focused .video-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  object-fit: contain;
  object-position: 50% 50%;
  background: #05080c;
}

body.room-active .video-tile.focused.canvas-fallback .video-canvas {
  width: 100%;
  height: 100%;
}

body.room-active .call-controls .room-access-pill {
  height: 50px;
  min-height: 50px;
  padding: 6px 12px;
}

body.room-active .room-access-pill > span:not(.access-icon) > span {
  margin-top: 2px;
  line-height: 1.15;
}

.admin-transfer-control,
.admin-delete-control {
  min-width: 88px;
  flex: 0 0 88px;
  display: flex;
  align-items: flex-start;
}

body.room-active .transfer-admin-button,
body.room-active .delete-room-button {
  width: 88px;
  min-width: 88px;
  max-width: 88px;
  height: 50px;
  min-height: 50px;
  max-height: 50px;
  margin-top: 14px;
}

body.room-active .transfer-admin-button:disabled,
body.room-active .delete-room-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Roomdrop v47 focused media visibility */
body.room-active .video-tile.focused:not(.canvas-fallback) .video-canvas {
  display: none;
}

body.room-active .video-tile.focused .camera-frame video {
  z-index: 1;
}

body.room-active .video-tile.focused.canvas-fallback .video-canvas {
  display: block;
  z-index: 2;
}

/* Roomdrop v48 admin access alignment */
body.room-active .call-controls .room-visibility-control {
  height: 64px;
  grid-template-rows: 12px 50px;
}

body.room-active .call-controls .room-visibility-control select {
  height: 50px;
  min-height: 50px;
}

/* Roomdrop v49 responsive room sizing */
body.room-active .room-workspace {
  width: min(100%, 1900px);
  max-width: 1900px;
  justify-self: center;
}

body.room-active .call-area,
body.room-active .room-topline,
body.room-active .stage-layout,
body.room-active .call-controls {
  max-width: 100%;
}

body.room-active .stage-layout {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
}

body.room-active .video-tile.focused,
body.room-active .participant-panel {
  height: clamp(420px, calc(100svh - 235px), 860px);
}

body.room-active .video-tile.focused .camera-frame video,
body.room-active .video-tile.focused .video-canvas {
  left: 50%;
  top: 50%;
  right: auto;
  bottom: auto;
  width: min(100%, var(--stream-max-width, 100%));
  height: min(100%, var(--stream-max-height, 100%));
  transform: translate(-50%, -50%);
}

@media (min-height: 980px) {
  body.room-active .video-tile.focused,
  body.room-active .participant-panel {
    height: clamp(520px, calc(100svh - 250px), 940px);
  }
}

@media (max-width: 900px) {
  body.room-active .video-tile.focused,
  body.room-active .participant-panel {
    height: auto;
  }
}

/* Roomdrop v50 stage fill without premature stream caps */
body.room-active .room-workspace {
  width: min(100%, 1680px);
  max-width: 1680px;
  justify-self: center;
}

body.room-active .video-tile.focused .camera-frame video,
body.room-active .video-tile.focused .video-canvas {
  left: 50%;
  top: 50%;
  right: auto;
  bottom: auto;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  transform: translate(-50%, -50%);
  object-fit: contain;
  object-position: center center;
}

/* Roomdrop v53 mobile call layout */
.mobile-room-actions,
.mobile-drawer-backdrop {
  display: none;
}

@media (max-width: 900px) {
  body.room-active .room-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  body.room-active .room-sidebar {
    position: fixed;
    z-index: 70;
    inset: 0 auto 0 0;
    width: min(280px, calc(100vw - 48px));
    min-height: 100svh;
    display: flex;
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  body.mobile-menu-open .room-sidebar {
    transform: translateX(0);
  }

  .mobile-drawer-backdrop {
    position: fixed;
    z-index: 60;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    padding: 0;
    border: 0;
    background: rgba(1, 6, 12, 0.66);
    backdrop-filter: blur(5px);
  }

  .mobile-drawer-backdrop[hidden] {
    display: none !important;
  }

  body.room-active .room-workspace {
    width: 100%;
    max-width: 900px;
    padding: max(12px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom));
  }

  body.room-active .room-topline {
    margin-bottom: 10px;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
  }

  body.room-active .room-title-row {
    gap: 8px;
    align-items: center;
  }

  body.room-active .room-topline h1 {
    font-size: clamp(1.45rem, 7vw, 2.15rem);
    line-height: 1.04;
  }

  body.room-active .copy-room-button {
    min-height: 38px;
    padding: 0 12px;
  }

  .mobile-room-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    padding-top: 24px;
  }

  .mobile-room-actions .ghost-button {
    min-width: 58px;
    height: 42px;
    padding: 0 10px;
    display: inline-grid;
    grid-template-columns: 18px auto;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 12px;
  }

  .mobile-room-actions .control-icon {
    width: 18px;
    height: 18px;
  }

  .mobile-room-actions .control-icon svg {
    width: 18px;
    height: 18px;
  }

  .mobile-room-actions .control-text {
    font-size: 0.78rem;
    font-weight: 900;
  }

  body.room-active .call-area {
    gap: 8px;
  }

  body.room-active .stage-layout {
    display: block;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
  }

  body.room-active .main-frame {
    width: 100%;
    min-height: 0;
  }

  body.room-active .video-tile.focused {
    height: clamp(250px, 46svh, 520px) !important;
    min-height: 250px;
    display: grid !important;
    grid-template-rows: minmax(0, 1fr) 48px;
  }

  body.room-active .video-tile.focused .camera-frame {
    width: 100%;
    height: 100% !important;
    min-height: 0;
    max-height: none !important;
  }

  body.room-active .video-tile.focused .tile-bar {
    min-height: 48px;
    padding: 7px 10px;
  }

  body.room-active .participant-panel {
    position: fixed;
    z-index: 70;
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    width: min(340px, calc(100vw - 24px));
    height: auto !important;
    max-height: none !important;
    transform: translateX(calc(100% + 20px));
    transition: transform 180ms ease;
  }

  body.mobile-participants-open .participant-panel {
    transform: translateX(0);
  }

  body.room-active .participant-rail {
    max-height: calc(100svh - 112px);
    overflow: auto;
  }

  body.room-active .call-controls {
    min-height: 0;
    margin-top: 8px;
    padding: 8px;
    border-radius: 20px;
    justify-content: flex-start;
    gap: 7px;
    overflow: visible;
  }

  body.room-active .call-controls > .control-button,
  body.room-active .call-controls > .end-call-button {
    width: 70px;
    min-width: 70px;
    max-width: 70px;
    height: 62px;
    min-height: 62px;
    max-height: 62px;
    flex: 1 1 70px;
    padding: 6px 5px;
  }

  body.room-active .audio-stack {
    order: 10;
    width: 100%;
    min-width: 0;
    max-width: none;
    flex: 1 1 100%;
  }

  body.room-active .audio-stack .volume-control,
  body.room-active .audio-stack .meter-control {
    height: 27px;
    min-height: 27px;
    grid-template-columns: 104px minmax(0, 1fr);
  }

  body.room-active .call-controls .admin-panel {
    order: 20;
    width: 100%;
    max-width: none;
    min-height: 0;
    flex: 1 1 100%;
    margin-left: 0;
    padding: 8px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    transform: none;
  }

  body.room-active .call-controls .admin-access-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    justify-content: stretch;
    gap: 7px;
    min-width: 0;
  }

  .admin-transfer-control,
  body.room-active .call-controls .room-access-pill,
  body.room-active .call-controls .room-visibility-control {
    width: 100%;
    min-width: 0;
    max-width: none;
    flex: 1 1 100%;
  }

  body.room-active .call-controls .room-access-pill {
    margin-top: 0;
  }

  .admin-transfer-control,
  .admin-delete-control {
    display: block;
  }

  body.room-active .transfer-admin-button,
  body.room-active .delete-room-button {
    width: 100%;
    min-width: 0;
    max-width: none;
    margin-top: 0;
  }
}

@media (max-width: 520px) {
  body.room-active .room-topline {
    flex-direction: column;
    gap: 8px;
  }

  .mobile-room-actions {
    width: 100%;
    padding-top: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .mobile-room-actions .ghost-button {
    width: 100%;
  }

  body.room-active .video-tile.focused {
    height: clamp(230px, 43svh, 430px) !important;
    min-height: 230px;
  }

  body.room-active .call-controls > .control-button,
  body.room-active .call-controls > .end-call-button {
    flex: 1 1 calc(25% - 7px);
  }
}

/* Roomdrop v54 mobile drawer labels and centered controls */
@media (max-width: 900px) {
  body.room-active .room-sidebar {
    padding: 24px 16px;
    align-items: stretch;
    gap: 28px;
  }

  body.room-active .room-brand {
    width: 100%;
  }

  body.room-active .room-brand span:last-child,
  body.room-active .room-nav-item strong,
  body.room-active .sidebar-profile span:last-child {
    display: block;
  }

  body.room-active .room-nav-item {
    width: 100%;
    min-height: 56px;
    padding: 0 14px;
    justify-content: flex-start;
  }

  body.room-active .sidebar-profile,
  body.room-active .sidebar-profile-button {
    width: 100%;
  }

  body.room-active .sidebar-profile strong,
  body.room-active .sidebar-profile small {
    max-width: 176px;
  }

  body.room-active .call-controls {
    justify-content: center;
  }

  body.room-active .call-controls > .control-button,
  body.room-active .call-controls > .end-call-button {
    flex: 0 0 70px;
  }
}

@media (max-width: 520px) {
  body.room-active .call-controls > .control-button,
  body.room-active .call-controls > .end-call-button {
    flex: 0 0 68px;
  }
}

/* Roomdrop v55 stage layouts and quality-aware room sizing */
.layout-control {
  height: 40px;
  padding: 3px;
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(58px, 1fr));
  align-items: center;
  gap: 3px;
  flex: 0 0 206px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(4, 9, 14, 0.62);
}

.layout-option {
  height: 32px;
  min-width: 0;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #aeb8c3;
  background: transparent;
  font-size: 0.74rem;
  font-weight: 900;
}

.layout-option.active {
  color: #f7fafc;
  background: rgba(85, 219, 167, 0.16);
  border-color: rgba(85, 219, 167, 0.54);
}

body.room-active .main-frame.is-grid {
  height: clamp(420px, calc(100svh - 235px), 860px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: minmax(0, 1fr);
  gap: 10px;
  align-content: stretch;
  background: transparent;
}

body.room-active .main-frame.is-grid[data-grid-count="2"],
body.room-active .main-frame.is-grid[data-grid-count="3"],
body.room-active .main-frame.is-grid[data-grid-count="4"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.room-active .main-frame.is-grid[data-grid-count="5"],
body.room-active .main-frame.is-grid[data-grid-count="6"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.room-active .main-frame.is-grid .video-tile.grid-tile {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 48px;
}

body.room-active .main-frame.is-grid .video-tile.grid-tile .camera-frame {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  aspect-ratio: auto;
}

body.room-active .main-frame.is-grid .video-tile.grid-tile .camera-frame video,
body.room-active .main-frame.is-grid .video-tile.grid-tile .video-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  background: #05080c;
}

body.room-active .main-frame.is-grid .video-tile.grid-tile:not(.canvas-fallback) .video-canvas {
  display: none;
}

body.room-active .main-frame.is-grid .video-tile.grid-tile.canvas-fallback .video-canvas {
  display: block;
}

body.room-active .main-frame.is-grid .video-tile.grid-tile .tile-bar {
  min-height: 48px;
  padding: 7px 10px;
}

body.room-active .main-frame.is-grid .video-tile.grid-tile .tile-name {
  max-width: 22ch;
}

@media (max-width: 900px) {
  .layout-control {
    order: 8;
    flex: 0 1 214px;
  }

  body.room-active .main-frame.is-grid {
    height: clamp(250px, 46svh, 520px);
  }

  body.room-active .main-frame.is-grid[data-grid-count="5"],
  body.room-active .main-frame.is-grid[data-grid-count="6"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .layout-control {
    width: min(100%, 230px);
    flex: 0 0 min(100%, 230px);
  }

  body.room-active .main-frame.is-grid {
    height: clamp(230px, 43svh, 430px);
    gap: 7px;
  }

  body.room-active .main-frame.is-grid .video-tile.grid-tile {
    grid-template-rows: minmax(0, 1fr) 42px;
  }

  body.room-active .main-frame.is-grid .video-tile.grid-tile .tile-bar {
    min-height: 42px;
    padding: 6px 8px;
  }

  body.room-active .main-frame.is-grid .video-tile.grid-tile .tile-state {
    display: none;
  }
}

/* Roomdrop v56 participant-selected stage and profile settings */
.layout-control {
  display: none !important;
}

.sidebar-name-editor {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.sidebar-name-editor input,
.sidebar-name-editor .secondary-button {
  width: 100%;
}

.settings-name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.settings-name-row input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: #f7fafc;
  background: rgba(4, 9, 14, 0.74);
  font: inherit;
  font-weight: 800;
}

body.room-active .participant-row.active {
  background: rgba(85, 219, 167, 0.12);
  border-color: rgba(85, 219, 167, 0.55);
}

body.room-active .participant-row.manual-stage,
body.room-active .participant-row.auto-stage,
body.room-active .participant-row.self-view-full {
  box-shadow: inset 4px 0 0 rgba(85, 219, 167, 0.95);
}

body.room-active .participant-row.auto-stage:not(.active) {
  border-color: rgba(255, 255, 255, 0.12);
}

body.room-active .call-controls .admin-panel {
  flex: 1 1 560px;
  max-width: none;
}

body.room-active .call-controls .admin-access-controls {
  justify-content: flex-end;
}

@media (max-width: 1240px) {
  body.room-active .call-controls .admin-panel {
    flex: 1 1 100%;
  }

  body.room-active .call-controls .admin-access-controls {
    justify-content: flex-start;
  }
}

/* Roomdrop v57 access badge wrapping and mobile auto stage */
body.room-active .call-controls .room-access-pill {
  width: min(340px, 100%);
  flex: 0 1 340px;
  height: auto;
  min-height: 50px;
  padding-block: 6px;
  align-items: center;
}

body.room-active .room-access-pill strong,
body.room-active .room-access-pill > span:not(.access-icon) > span {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

body.room-active .room-access-pill > span:not(.access-icon) > span {
  line-height: 1.18;
}

@media (max-width: 620px) {
  body.room-active .call-controls .room-access-pill {
    width: 100%;
    flex: 1 1 100%;
  }
}

/* Roomdrop v59 self-view overlay */
body.room-active .main-frame {
  position: relative;
  overflow: hidden;
}

body.room-active .video-tile.self-overlay {
  position: absolute !important;
  right: 16px;
  bottom: 72px;
  z-index: 8;
  width: clamp(150px, 18vw, 260px);
  min-height: 0 !important;
  height: auto !important;
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) 34px !important;
  border-color: rgba(85, 219, 167, 0.48);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 18px 42px rgba(0, 0, 0, 0.48);
}

body.room-active .video-tile.self-overlay .camera-frame {
  width: 100%;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: 16 / 9 !important;
}

body.room-active .video-tile.self-overlay .camera-frame video,
body.room-active .video-tile.self-overlay .video-canvas {
  position: absolute;
  inset: 0;
  left: 0;
  top: 0;
  right: auto;
  bottom: auto;
  width: 100%;
  height: 100%;
  transform: none;
  object-fit: contain;
  object-position: center center;
}

body.room-active .video-tile.self-overlay:not(.canvas-fallback) .video-canvas {
  display: none;
}

body.room-active .video-tile.self-overlay.canvas-fallback .video-canvas {
  display: block;
}

body.room-active .video-tile.self-overlay .tile-bar {
  min-height: 34px;
  padding: 4px 8px;
}

body.room-active .video-tile.self-overlay .tile-state,
body.room-active .video-tile.self-overlay .tile-actions {
  display: none;
}

body.room-active .video-tile.self-overlay .tile-name {
  max-width: 100%;
  font-size: 0.78rem;
}

body.room-active .participant-row.self-view-overlay {
  box-shadow: inset 1px 0 0 rgba(85, 219, 167, 0.95);
}

body.room-active .participant-row.self-view-hidden {
  opacity: 0.78;
}

@media (max-width: 620px) {
  body.room-active .video-tile.self-overlay {
    right: 8px;
    bottom: 52px;
    width: clamp(112px, 38vw, 132px);
    grid-template-rows: minmax(0, 1fr) 28px !important;
  }

  body.room-active .video-tile.self-overlay .tile-bar {
    min-height: 28px;
    padding: 3px 6px;
  }

  body.room-active .video-tile.self-overlay .tile-name {
    font-size: 0.68rem;
  }
}

/* Roomdrop v61 mobile self-view sizing */
@media (max-width: 420px) {
  body.room-active .video-tile.self-overlay {
    width: clamp(106px, 36vw, 126px);
  }
}

/* Roomdrop v66 setup flow */
body.room-active.room-lobby-active .room-workspace {
  width: min(100%, 1680px);
  min-height: 100vh;
  max-width: 1680px;
  padding: 24px;
  display: grid;
  place-items: center;
}

body.room-active.room-lobby-active .lobby {
  width: min(520px, 100%);
  min-height: auto;
  margin: 0;
}

@media (max-width: 900px) {
  body.room-active.room-lobby-active .room-workspace {
    min-height: 100svh;
    padding: 16px;
  }
}

/* Roomdrop v73 settings heading clarity */
.settings-card .settings-title {
  margin: 0;
  color: #55dba7;
  font-size: clamp(1.55rem, 3vw, 1.9rem);
  font-weight: 950;
  line-height: 1.08;
  letter-spacing: 0;
  text-transform: none;
}

.settings-card .settings-section > h3 {
  margin: 0;
  color: #f7fafc;
  font-size: clamp(1.18rem, 2.2vw, 1.38rem);
  font-weight: 950;
  line-height: 1.15;
  letter-spacing: 0;
}

/* Roomdrop v82 room counts and compact participant actions */
.saved-room-card .saved-room-users {
  color: #55dba7;
}

.remote-mute {
  width: 84px;
  min-width: 84px;
  max-width: 84px;
  height: 38px;
  min-height: 38px;
  padding: 4px 8px;
  display: inline-grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  gap: 6px;
}

.remote-mute .control-icon,
.remote-mute .control-icon svg {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  color: currentColor;
  background: transparent;
}

.remote-mute .control-text {
  max-width: 48px;
  overflow: hidden;
  color: inherit;
  font-size: 0.72rem;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.participant-admin-actions {
  gap: 3px;
  padding-top: 0;
}

.participant-admin-button {
  flex: 0 0 58px;
  width: 58px;
  min-width: 58px;
  max-width: 58px;
  height: 48px;
  min-height: 48px;
  max-height: 48px;
  padding: 4px;
  display: inline-grid;
  grid-template-rows: 13px minmax(0, 22px);
  align-content: center;
  justify-items: center;
  gap: 2px;
  border-radius: 8px;
  font-size: 0.58rem;
  line-height: 1;
  overflow: hidden;
}

.participant-admin-button .control-icon,
.participant-admin-button .control-icon svg {
  width: 13px;
  min-width: 13px;
  height: 13px;
  min-height: 13px;
  padding: 0;
}

.participant-admin-button .control-text {
  width: 50px;
  max-width: 50px;
  max-height: 21px;
  display: -webkit-box;
  overflow: hidden;
  font-size: 0.55rem;
  line-height: 1.05;
  text-align: center;
  text-overflow: clip;
  overflow-wrap: break-word;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.participant-admin-button.is-active {
  color: #ffb4b4;
  background: rgba(255, 88, 88, 0.14);
  border-color: rgba(255, 88, 88, 0.66);
  box-shadow: 0 0 0 2px rgba(255, 88, 88, 0.12);
}

.participant-admin-button.is-active:hover {
  color: #fff;
  background: rgba(255, 88, 88, 0.26);
  border-color: rgba(255, 88, 88, 0.82);
}

/* Roomdrop v83 permanent room creation */
.room-kind-help {
  margin-top: 12px;
}

.quick-actions .primary-button,
.quick-actions .secondary-button {
  min-width: 190px;
}

.quick-actions .permanent-room-button {
  background: linear-gradient(135deg, var(--brand), #3ac7c2);
  border-color: rgba(85, 219, 167, 0.8);
}

.quick-actions .permanent-room-button:hover {
  background: linear-gradient(135deg, var(--brand-dark), #2ab2ad);
}

.room-explainer {
  margin: 0;
  padding: 12px 14px;
  color: #d5dee7;
  background: rgba(85, 219, 167, 0.08);
  border: 1px solid rgba(85, 219, 167, 0.24);
  border-radius: 8px;
  font-size: 0.92rem;
  line-height: 1.45;
}

.form-status {
  min-height: 22px;
  margin: 0;
  color: #a8e8cf;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.35;
}

.form-status.is-error {
  color: #ffb4b4;
}

@media (max-width: 620px) {
  .quick-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .quick-actions .primary-button,
  .quick-actions .secondary-button {
    width: 100%;
    min-width: 0;
  }
}

/* Roomdrop v91 media max view and staged participant toggles */
.media-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
}

body.media-maximized {
  overflow: hidden;
}

body.media-maximized .stage-layout {
  position: fixed;
  z-index: 220;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
  height: 100svh;
  padding: 0;
  background: #05080c;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body.media-maximized .participant-panel,
body.media-maximized .media-max-button {
  display: none;
}

body.media-maximized .remote-mute {
  display: none;
}

body.media-maximized .media-stage,
body.media-maximized .main-frame,
body.media-maximized .main-frame.is-grid {
  width: 100%;
  height: 100%;
  min-height: 100%;
}

body.media-maximized .video-tile.focused,
body.media-maximized .video-tile.grid-tile {
  width: 100%;
  height: 100% !important;
  border: 0;
  border-radius: 0;
}

body.media-maximized .video-tile.focused .camera-frame {
  border-radius: 0;
}

body.room-active .main-frame.is-focus[data-grid-count="0"] {
  height: clamp(420px, calc(100svh - 235px), 860px);
  background: #05080c;
  border: 1px solid var(--line);
  border-radius: 8px;
}

@media (max-width: 900px) {
  body.room-active .main-frame.is-focus[data-grid-count="0"] {
    height: clamp(250px, 46svh, 520px);
  }
}

@media (max-width: 520px) {
  body.room-active .main-frame.is-focus[data-grid-count="0"] {
    height: clamp(230px, 43svh, 430px);
  }
}

body.media-maximized .main-frame.is-focus[data-grid-count="0"] {
  height: 100%;
  border: 0;
  border-radius: 0;
}

/* Roomdrop v103 custom room access picker */
.room-visibility-control {
  position: relative;
}

body.room-active .call-controls .native-room-access-select,
body.room-active .call-controls .native-room-join-mode-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.room-access-picker {
  position: relative;
  min-width: 0;
}

body.room-active .call-controls .room-visibility-control .room-access-picker,
body.room-active .call-controls .room-join-mode-control .room-access-picker {
  height: 50px;
  min-height: 50px;
}

.room-access-menu-button {
  width: 100%;
  height: 100%;
  min-height: 50px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #f7fafc;
  font-weight: 800;
  text-align: left;
  background: rgba(5, 9, 14, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.room-access-menu-button:hover,
.room-access-menu-button[aria-expanded="true"] {
  border-color: rgba(86, 221, 170, 0.5);
  background: rgba(12, 20, 28, 0.94);
}

.room-access-menu-button:focus-visible {
  outline: none;
  border-color: rgba(86, 221, 170, 0.86);
  box-shadow: 0 0 0 3px rgba(86, 221, 170, 0.18);
}

.room-access-menu-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.select-chevron {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: 0.82;
}

.room-access-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 90;
  padding: 6px;
  display: grid;
  gap: 4px;
  background:
    linear-gradient(180deg, rgba(22, 31, 42, 0.98), rgba(8, 13, 20, 0.98)),
    #101820;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.48);
}

.room-access-menu button {
  min-height: 38px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #eaf2f8;
  font-weight: 750;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
}

.room-access-menu button:hover,
.room-access-menu button:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
}

.room-access-menu button.is-selected {
  color: #d9fff1;
  background: rgba(86, 221, 170, 0.14);
  border-color: rgba(86, 221, 170, 0.42);
}

.room-access-menu button.is-selected::after {
  content: "";
  width: 7px;
  height: 12px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.room-access-menu button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

/* Roomdrop v104 Edge stacking, brighter mute states, and mobile max-grid fill */
.joining-room-placeholder {
  min-height: clamp(260px, 42svh, 520px);
  display: grid;
  place-content: center;
  gap: 8px;
  color: #f7fafc;
  text-align: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(85, 219, 167, 0.12), transparent 34%),
    #05080c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.joining-room-placeholder strong {
  font-size: 1.1rem;
}

.joining-room-placeholder span {
  color: #a8b3bf;
}

body.room-active .stage-layout {
  position: relative;
  z-index: 1;
}

body.room-active .call-controls {
  position: relative;
  z-index: 45;
  overflow: visible;
}

body.room-active .call-controls .admin-panel,
body.room-active .call-controls .admin-access-controls,
.room-access-picker {
  position: relative;
  z-index: 46;
  overflow: visible;
}

.room-access-menu {
  z-index: 500;
}

.participant-status-icon {
  color: #ffffff;
  background: #e84242;
  border-color: rgba(255, 190, 190, 0.92);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.16) inset,
    0 0 14px rgba(255, 70, 70, 0.34);
}

.participant-status-icon svg {
  stroke-width: 2.5;
}

.participant-admin-button.is-active,
.remote-mute.is-active {
  color: #ffffff;
  background: rgba(255, 58, 58, 0.34);
  border-color: rgba(255, 146, 146, 0.95);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12) inset,
    0 0 16px rgba(255, 58, 58, 0.28);
}

.participant-admin-button.is-active .control-icon,
.participant-admin-button.is-active .control-icon svg,
.remote-mute.is-active .control-icon,
.remote-mute.is-active .control-icon svg {
  color: #ffffff;
  stroke-width: 2.5;
}

@media (max-width: 620px) {
  body.media-maximized .main-frame.is-grid {
    height: 100svh !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-auto-rows: minmax(0, 1fr);
    gap: 0;
  }

  body.media-maximized .main-frame.is-grid .video-tile.grid-tile {
    border-radius: 0;
    border-width: 0 0 1px;
  }

  body.media-maximized .main-frame.is-grid .video-tile.grid-tile .tile-bar {
    min-height: 40px;
  }
}

/* Roomdrop v105 joining fill, toast stacking, clearer muted states, and sharp mobile drawers */
.toast {
  z-index: 900;
}

body.room-active .call-area.is-joining .stage-layout {
  align-items: stretch;
}

body.room-active .call-area.is-joining .media-stage,
body.room-active .call-area.is-joining .main-frame {
  min-height: 0;
  height: clamp(420px, calc(100svh - 235px), 860px);
}

body.room-active .call-area.is-joining .main-frame {
  display: grid;
  align-content: stretch;
  align-self: stretch;
}

.joining-room-placeholder {
  width: 100%;
  height: 100%;
  min-height: 0;
  align-self: stretch;
  justify-self: stretch;
  place-content: center;
}

.participant-status-icon {
  color: #fff4ce;
  background: rgba(255, 183, 77, 0.2);
  border-color: rgba(255, 213, 128, 0.95);
  box-shadow:
    0 0 0 1px rgba(255, 244, 206, 0.18) inset,
    0 0 14px rgba(255, 183, 77, 0.28);
}

.participant-status-icon svg,
.participant-status-icon svg * {
  color: currentColor;
  stroke: currentColor;
  stroke-width: 2.7;
}

.participant-admin-button.is-active,
.remote-mute.is-active {
  color: #fff4ce;
  background: rgba(255, 183, 77, 0.18);
  border-color: rgba(255, 213, 128, 0.92);
  box-shadow:
    0 0 0 1px rgba(255, 244, 206, 0.14) inset,
    0 0 16px rgba(255, 183, 77, 0.24);
}

.participant-admin-button.is-active:hover,
.remote-mute.is-active:hover {
  color: #fff9e8;
  background: rgba(255, 183, 77, 0.27);
  border-color: rgba(255, 225, 150, 1);
}

.participant-admin-button.is-active .control-icon,
.participant-admin-button.is-active .control-icon svg,
.participant-admin-button.is-active .control-icon svg *,
.remote-mute.is-active .control-icon,
.remote-mute.is-active .control-icon svg,
.remote-mute.is-active .control-icon svg * {
  color: currentColor;
  stroke: currentColor;
  stroke-width: 2.7;
}

@media (min-height: 980px) {
  body.room-active .call-area.is-joining .media-stage,
  body.room-active .call-area.is-joining .main-frame {
    height: clamp(520px, calc(100svh - 250px), 940px);
  }
}

@media (max-width: 900px) {
  body.room-active .call-area.is-joining .media-stage,
  body.room-active .call-area.is-joining .main-frame {
    height: clamp(250px, 46svh, 520px);
  }

  body.room-active .participant-panel {
    background: rgba(17, 25, 34, 0.98);
  }

  body.mobile-participants-open .participant-panel {
    backdrop-filter: none !important;
    filter: none !important;
  }
}

@media (max-width: 520px) {
  body.room-active .call-area.is-joining .media-stage,
  body.room-active .call-area.is-joining .main-frame {
    height: clamp(230px, 43svh, 430px);
  }
}

/* Roomdrop v106 clearer media-status pills and mobile People drawer stacking */
.participant-status-icons,
.tile-status-icons {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.tile-status-icons {
  margin-top: 6px;
}

.tile-status-icons:empty {
  display: none;
}

.participant-status-icon {
  width: auto;
  min-width: 72px;
  height: 26px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 999px;
  color: #fff3c4;
  background: rgba(255, 181, 71, 0.2);
  border: 1px solid rgba(255, 213, 128, 0.92);
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
  box-shadow:
    0 0 0 1px rgba(255, 244, 206, 0.16) inset,
    0 0 14px rgba(255, 183, 77, 0.24);
}

.participant-status-icon .status-icon-glyph,
.participant-status-icon svg {
  width: 14px;
  min-width: 14px;
  height: 14px;
}

.participant-status-icon svg,
.participant-status-icon svg * {
  color: currentColor;
  stroke: currentColor;
  stroke-width: 2.8;
}

.status-icon-label {
  display: inline-block;
}

.tile-bar > div:first-child {
  min-width: 0;
}

.tile-status-icons .participant-status-icons {
  gap: 6px;
}

.tile-status-icons .participant-status-icon {
  min-width: 82px;
  height: 28px;
  font-size: 0.72rem;
}

@media (max-width: 900px) {
  body.mobile-participants-open .mobile-drawer-backdrop {
    z-index: 55;
    background: rgba(1, 6, 12, 0.72);
    backdrop-filter: none !important;
  }

  body.mobile-participants-open .stage-layout {
    position: relative;
    z-index: 80;
  }

  body.mobile-participants-open .media-stage {
    filter: blur(5px);
  }

  body.mobile-participants-open .participant-panel {
    z-index: 95;
    background: rgba(17, 25, 34, 0.99);
    backdrop-filter: none !important;
    filter: none !important;
    box-shadow: 0 26px 90px rgba(0, 0, 0, 0.58);
  }

  .participant-status-icons {
    gap: 5px;
  }

  .participant-status-icon {
    min-width: 66px;
    height: 25px;
    padding: 0 7px;
    font-size: 0.64rem;
  }
}

@media (max-width: 520px) {
  .participant-status-icon {
    min-width: 62px;
  }

  .tile-status-icons .participant-status-icon {
    min-width: 74px;
  }
}

/* Roomdrop v107 compact control-style muted badges */
.participant-status-icons,
.tile-status-icons {
  gap: 5px;
  flex-wrap: nowrap;
}

.tile-state {
  display: inline;
}

.tile-status-icons {
  margin-top: 2px;
  margin-left: 6px;
  vertical-align: middle;
}

.participant-status-icon.control-icon,
.participant-status-icon {
  width: 24px;
  min-width: 24px;
  max-width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: #d84343;
  border: 1px solid rgba(255, 198, 198, 0.72);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12) inset,
    0 0 12px rgba(216, 67, 67, 0.28);
}

.participant-status-icon svg,
.participant-status-icon svg * {
  width: 15px;
  height: 15px;
  color: currentColor;
  stroke: currentColor;
  stroke-width: 2.6;
}

.tile-status-icons .participant-status-icon {
  width: 22px;
  min-width: 22px;
  max-width: 22px;
  height: 22px;
  min-height: 22px;
  border-radius: 7px;
}

.tile-status-icons .participant-status-icon svg,
.tile-status-icons .participant-status-icon svg * {
  width: 14px;
  height: 14px;
}

.status-icon-label {
  display: none !important;
}

.tile-status-icons:empty {
  display: none;
  margin: 0;
}

body.room-active .video-tile.self-overlay .tile-state,
body.room-active .video-tile.self-overlay .tile-status-icons,
body.room-active .video-tile.self-overlay .tile-actions {
  display: none;
}

@media (max-width: 900px) {
  .participant-status-icons,
  .tile-status-icons {
    gap: 4px;
  }

  .participant-status-icon.control-icon,
  .participant-status-icon {
    width: 23px;
    min-width: 23px;
    max-width: 23px;
    height: 23px;
    min-height: 23px;
  }
}

@media (max-width: 520px) {
  body.room-active .main-frame.is-grid .video-tile.grid-tile .tile-state:empty,
  body.room-active .main-frame.is-grid .video-tile.grid-tile .tile-status-icons:empty {
    display: none;
  }
}

/* Roomdrop v108 mobile tile breathing room */
@media (max-width: 900px) {
  body.room-active .video-tile .tile-bar {
    position: relative;
    padding-right: 10px;
  }

  body.room-active .video-tile .tile-state {
    display: block;
    margin-top: 2px;
  }

  body.room-active .video-tile.local .tile-state,
  body.room-active .video-tile.local .tile-status-icons,
  body.room-active .video-tile.self-overlay .tile-state,
  body.room-active .video-tile.self-overlay .tile-status-icons {
    display: none !important;
  }

  body.room-active .video-tile:not(.local) .tile-status-icons {
    position: absolute;
    z-index: 8;
    top: 8px;
    right: 8px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    pointer-events: none;
  }

  body.room-active .video-tile:not(.local) .tile-status-icons:empty {
    display: none;
  }

  body.room-active .video-tile:not(.local) .tile-status-icons .participant-status-icons {
    gap: 4px;
  }

  body.room-active .video-tile:not(.local) .tile-status-icons .participant-status-icon {
    width: 21px;
    min-width: 21px;
    max-width: 21px;
    height: 21px;
    min-height: 21px;
    border-radius: 7px;
    background: rgba(216, 67, 67, 0.94);
    border-color: rgba(255, 205, 205, 0.76);
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.14) inset,
      0 8px 18px rgba(0, 0, 0, 0.36);
  }

  body.room-active .video-tile:not(.local) .tile-status-icons .participant-status-icon svg,
  body.room-active .video-tile:not(.local) .tile-status-icons .participant-status-icon svg * {
    width: 13px;
    height: 13px;
  }
}

@media (max-width: 520px) {
  body.room-active .video-tile:not(.local) .tile-status-icons {
    top: 7px;
    right: 7px;
  }

  body.room-active .video-tile:not(.local) .tile-status-icons .participant-status-icon {
    width: 20px;
    min-width: 20px;
    max-width: 20px;
    height: 20px;
    min-height: 20px;
  }
}

/* Roomdrop v109 keep mobile remote badges inside the media tile */
@media (max-width: 900px) {
  body.room-active .video-tile .tile-bar {
    position: static;
  }

  body.room-active .video-tile:not(.local) .tile-status-icons {
    top: 8px;
    right: 8px;
    max-width: calc(100% - 16px);
  }

  body.room-active .video-tile:not(.local) .tile-actions {
    position: relative;
    z-index: 2;
  }
}

@media (max-width: 520px) {
  body.room-active .video-tile:not(.local) .tile-status-icons {
    top: 7px;
    right: 7px;
    max-width: calc(100% - 14px);
  }
}

/* Roomdrop v110 left-align admin controls before they wrap awkwardly */
@media (max-width: 1560px) {
  body.room-active .call-controls .admin-panel {
    flex: 1 1 100%;
    width: 100%;
    max-width: none;
    margin-left: 0;
    padding: 8px 0 0;
    border-left: 0;
    transform: none;
    justify-content: flex-start;
  }

  body.room-active .call-controls .admin-access-controls {
    width: 100%;
    justify-content: flex-start;
    align-content: flex-start;
  }

body.room-active .call-controls .room-access-pill {
    flex-grow: 0;
  }
}

/* Roomdrop v111 permanent-room join controls */
.room-join-mode-control {
  width: 190px;
  min-width: 0;
  flex: 0 0 190px;
  height: 64px;
  display: grid;
  grid-template-rows: 12px 50px;
  gap: 2px;
  align-items: stretch;
}

.room-join-mode-control > span {
  min-height: 0;
  color: #a8b3bf;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
}

.room-join-mode-control select {
  width: 100%;
  height: 50px;
  min-height: 50px;
  padding: 0 12px;
}

.room-join-mode-control .room-access-menu {
  min-width: 220px;
}

body.room-active .call-controls .admin-access-controls {
  justify-content: flex-start;
}

body.room-active .call-controls .room-join-mode-control[hidden] {
  display: none;
}

@media (max-width: 1240px) {
  body.room-active .call-controls .admin-panel {
    flex: 1 1 100%;
  }

  body.room-active .call-controls .admin-access-controls {
    justify-content: flex-start;
  }
}

@media (max-width: 700px) {
  .room-join-mode-control {
    width: 100%;
    flex: 1 1 100%;
    height: auto;
    grid-template-rows: auto 50px;
  }
}

/* roomdrop-v153 final layout overrides */
@media (min-width: 901px) {
  body.room-active .room-shell {
    --room-sidebar-width: 400px;
  }

  body.room-active .room-sidebar {
    gap: 18px;
  }

  body.room-active .room-nav {
    gap: 10px;
  }

  body.room-active .room-nav-item {
    min-height: 58px;
    padding: 0 18px;
    gap: 14px;
  }

  body.room-active .room-nav-item > span:first-child {
    width: 34px;
    height: 34px;
  }

  body.room-active .room-nav-item .nav-icon svg {
    width: 20px;
    height: 20px;
  }

  body.room-active .room-nav-item strong {
    font-size: 0.98rem;
  }
}

@media (min-width: 901px) and (max-width: 1279px) {
  body.room-active .room-shell {
    --room-sidebar-width: 380px;
  }
}

.sidebar-participants .participant-admin-button {
  width: 56px;
  min-width: 56px;
  max-width: 56px;
  flex-basis: 56px;
}

.sidebar-participants .participant-admin-button .control-text {
  width: 52px;
  max-width: 52px;
  font-size: 0.61rem;
}

/* Roomdrop v115 admin access row sizing */
body.room-active .call-controls .admin-panel {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  flex: 1 1 100%;
  box-sizing: border-box;
}

body.room-active .call-controls .admin-access-controls {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-content: flex-start;
  overflow: visible;
}

body.room-active .call-controls .admin-access-controls > * {
  min-width: 0;
}

body.room-active .call-controls .room-visibility-control,
body.room-active .call-controls .room-join-mode-control {
  height: 64px;
  grid-template-rows: 12px 50px;
  gap: 2px;
}

body.room-active .call-controls .room-visibility-control {
  width: 180px;
  flex: 0 1 180px;
}

body.room-active .call-controls .room-join-mode-control {
  width: 180px;
  flex: 0 1 180px;
}

body.room-active .call-controls .room-visibility-control > span,
body.room-active .call-controls .room-join-mode-control > span {
  min-height: 0;
  color: #a8b3bf;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
}

body.room-active .call-controls .room-access-menu-button {
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1;
}

body.room-active .call-controls .room-access-menu-button > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

body.room-active .call-controls .room-access-pill {
  width: 280px;
  flex: 0 1 280px;
  height: 50px;
  min-height: 50px;
  max-height: 50px;
  margin-top: 14px;
  padding: 5px 10px;
  overflow: hidden;
  align-self: start;
}

body.room-active .call-controls .room-access-pill > span:not(.access-icon) {
  min-width: 0;
  overflow: hidden;
}

body.room-active .call-controls .room-access-pill strong,
body.room-active .call-controls .room-access-pill > span:not(.access-icon) > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.room-active .call-controls .room-access-pill strong {
  font-size: 0.9rem;
  line-height: 1;
}

body.room-active .call-controls .room-access-pill > span:not(.access-icon) > span {
  margin-top: 3px;
  font-size: 0.78rem;
  line-height: 1.05;
}

@media (max-width: 700px) {
  body.room-active .call-controls .room-visibility-control,
  body.room-active .call-controls .room-join-mode-control {
    width: 100%;
    flex: 1 1 100%;
    height: auto;
    grid-template-rows: auto 50px;
  }

  body.room-active .call-controls .room-access-pill {
    width: 100%;
    flex: 1 1 100%;
    margin-top: 0;
  }
}

/* Roomdrop v116 single-row desktop controls */
body.room-active .call-controls .admin-panel {
  width: auto;
  min-width: 0;
  flex: 1 1 820px;
  padding-left: 8px;
}

body.room-active .call-controls .admin-access-controls {
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 8px;
}

body.room-active .call-controls .room-visibility-control,
body.room-active .call-controls .room-join-mode-control {
  width: 168px;
  flex: 0 1 168px;
}

body.room-active .call-controls .room-access-pill {
  width: 260px;
  flex: 0 1 260px;
}

@media (max-width: 1800px) {
  body.room-active .call-controls .admin-panel {
    width: 100%;
    flex: 1 1 100%;
    padding-left: 0;
  }

  body.room-active .call-controls .admin-access-controls {
    flex-wrap: wrap;
    justify-content: flex-start;
    align-content: flex-start;
  }
}

@media (max-width: 700px) {
  body.room-active .call-controls .room-visibility-control,
  body.room-active .call-controls .room-join-mode-control,
  body.room-active .call-controls .room-access-pill {
    width: 100%;
    flex: 1 1 100%;
  }
}

/* Roomdrop v130 persistent room chat */
.mobile-view-tabs {
  display: none;
}

.room-shell {
  grid-template-columns: clamp(300px, 17vw, 340px) minmax(0, 1fr);
}

body.room-active .room-sidebar {
  position: sticky;
  top: 0;
  height: 100svh;
  min-height: 0;
  padding: 24px 16px 18px;
  gap: 22px;
  overflow: hidden;
}

.sidebar-participants {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #f7fafc;
  background: rgba(5, 10, 15, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.sidebar-participants-header {
  min-height: 46px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.sidebar-participants-header strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.86rem;
}

.participant-activity-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #55dba7;
  box-shadow: 0 0 12px rgba(85, 219, 167, 0.7);
}

body.room-active .sidebar-participants .participant-rail {
  min-height: 0;
  flex: 1 1 auto;
  align-content: start;
  padding: 8px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sidebar-participants .participant-row {
  min-height: 62px;
  padding: 6px;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 8px;
}

.sidebar-participants .participant-preview {
  width: 58px;
}

.sidebar-participants .participant-copy {
  gap: 2px;
}

.sidebar-participants .participant-copy strong {
  font-size: 0.86rem;
}

.sidebar-participants .participant-copy small {
  font-size: 0.74rem;
  line-height: 1.18;
}

.sidebar-participants .participant-admin-actions {
  justify-content: flex-start;
  gap: 4px;
}

.sidebar-participants .participant-admin-button {
  width: 50px;
  min-width: 50px;
  max-width: 50px;
  height: 44px;
  min-height: 44px;
  flex-basis: 50px;
  padding: 4px 3px;
}

.sidebar-participants .participant-admin-button .control-text {
  max-width: 46px;
  font-size: 0.62rem;
  line-height: 1.05;
}

.sidebar-participants .participant-admin-button .control-icon,
.sidebar-participants .participant-admin-button .control-icon svg {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
}

body.room-active .room-workspace {
  position: relative;
  width: min(100%, 1800px);
  max-width: 1800px;
  padding-inline: clamp(18px, 2vw, 32px);
}

body.room-active .stage-layout {
  min-width: 0;
  height: clamp(500px, calc(100svh - 250px), 820px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 400px);
  gap: 12px;
  padding: 0;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

body.room-active .media-stage,
body.room-active .main-frame {
  min-width: 0;
  min-height: 0;
  height: 100%;
}

body.room-active .main-frame.is-grid,
body.room-active .main-frame.is-focus[data-grid-count="0"] {
  height: 100%;
}

body.room-active .video-tile.focused {
  height: 100% !important;
}

.chat-panel {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #f7fafc;
  background:
    linear-gradient(180deg, rgba(18, 27, 37, 0.98), rgba(8, 14, 20, 0.98)),
    #101820;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.panel-collapse-button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: #dce7ef;
  background: rgba(20, 30, 40, 0.88);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
  z-index: 20;
}

.panel-collapse-button:hover,
.panel-collapse-button:focus-visible {
  color: #ffffff;
  border-color: rgba(85, 219, 167, 0.55);
  background: rgba(31, 45, 59, 0.96);
}

.right-panel-collapse-button.has-unread {
  color: #fff1f1;
  border-color: rgba(255, 91, 91, 0.85);
  background: rgba(70, 24, 30, 0.94);
  box-shadow:
    inset 0 0 0 1px rgba(255, 91, 91, 0.24),
    0 14px 36px rgba(255, 91, 91, 0.16);
}

.right-panel-collapse-button.has-unread .control-icon {
  color: #ff7b7b;
}

.right-panel-collapse-button.has-unread::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff5b5b;
  box-shadow: 0 0 12px rgba(255, 91, 91, 0.75);
}

.panel-collapse-button .control-icon,
.panel-collapse-button .control-icon svg {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
}

.left-panel-collapse-button {
  position: absolute;
  top: 22px;
  right: 8px;
}

.right-panel-collapse-button {
  position: absolute;
  top: 34px;
  right: clamp(18px, 2vw, 32px);
}

@media (min-width: 901px) {
  body.room-active.left-panel-collapsed .room-shell {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  body.room-active.left-panel-collapsed .room-sidebar {
    padding-inline: 8px;
    align-items: center;
    gap: 12px;
  }

  body.room-active.left-panel-collapsed .room-brand {
    justify-content: center;
    width: 52px;
    min-height: 52px;
    padding: 0;
  }

  body.room-active.left-panel-collapsed .room-brand span:last-child,
  body.room-active.left-panel-collapsed .room-nav-item strong,
  body.room-active.left-panel-collapsed .sidebar-participants,
  body.room-active.left-panel-collapsed .sidebar-profile {
    display: none !important;
  }

  body.room-active.left-panel-collapsed .room-nav {
    width: 52px;
    display: grid;
    gap: 10px;
  }

  body.room-active.left-panel-collapsed .room-nav-item {
    width: 52px;
    min-height: 52px;
    padding: 0;
    justify-content: center;
  }

  body.room-active.left-panel-collapsed .left-panel-collapse-button {
    top: 84px;
    right: -24px;
  }

  body.room-active.right-panel-collapsed .stage-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  body.room-active.right-panel-collapsed .chat-panel {
    display: none;
  }

  body.room-active.right-panel-collapsed .right-panel-collapse-button {
    right: clamp(18px, 2vw, 32px);
  }
}

@media (max-width: 900px) {
  .panel-collapse-button {
    display: none !important;
  }
}

.chat-header {
  min-height: 58px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-header > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.chat-header strong {
  font-size: 0.98rem;
}

.chat-header small {
  overflow: hidden;
  color: #93a1ae;
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-room-info-button,
.chat-attach-button,
.chat-send-button,
.chat-attachment-preview .icon-button {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
}

.chat-room-info-button .control-icon,
.chat-attach-button .control-icon,
.chat-send-button .control-icon,
.chat-attachment-preview .control-icon {
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
}

.chat-room-info-button .control-icon svg,
.chat-attach-button .control-icon svg,
.chat-send-button .control-icon svg,
.chat-attachment-preview .control-icon svg {
  width: 20px;
  height: 20px;
}

.chat-room-info {
  padding: 10px 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  background: rgba(85, 219, 167, 0.055);
  border-bottom: 1px solid rgba(85, 219, 167, 0.16);
}

.chat-room-info[hidden] {
  display: none;
}

.chat-room-info > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.chat-room-info span {
  color: #93a1ae;
  font-size: 0.7rem;
}

.chat-room-info strong {
  overflow: hidden;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-messages {
  min-height: 0;
  flex: 1 1 auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.chat-empty-state {
  margin: auto;
  color: #84919e;
  font-size: 0.85rem;
  text-align: center;
}

.chat-message {
  width: fit-content;
  max-width: min(88%, 520px);
  padding: 8px 10px;
  align-self: flex-start;
  color: #eaf1f7;
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow-wrap: anywhere;
}

.chat-message.has-link-preview {
  width: min(88%, 420px);
}

.chat-message.own {
  align-self: flex-end;
  background: rgba(39, 143, 112, 0.24);
  border-color: rgba(85, 219, 167, 0.34);
}

.chat-message.deletable {
  cursor: context-menu;
  -webkit-touch-callout: none;
}

.chat-message.deleted {
  color: #9aa6b2;
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.08);
}

.chat-message .chat-deleted-message {
  color: #9aa6b2;
  font-style: italic;
}

.chat-message.pending {
  opacity: 0.72;
}

.chat-message.failed {
  border-color: rgba(255, 94, 94, 0.72);
  background: rgba(133, 34, 42, 0.26);
}

.chat-message.system {
  max-width: 100%;
  padding: 2px 6px;
  align-self: center;
  color: #93a1ae;
  background: transparent;
  border: 0;
  text-align: center;
}

.chat-message header {
  margin-bottom: 5px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.chat-message header strong {
  min-width: 0;
  overflow: hidden;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-message time {
  flex: 0 0 auto;
  color: #91a0ad;
  font-size: 0.66rem;
}

.chat-message p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.4;
}

.chat-message a {
  color: #8cefc8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.chat-message.system p {
  display: inline;
  font-size: 0.74rem;
}

.chat-message.system time {
  margin-left: 6px;
}

.chat-attachment {
  margin-top: 7px;
}

.chat-image-button {
  width: 100%;
  max-width: 320px;
  padding: 0;
  display: block;
  overflow: hidden;
  background: #05080c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
}

.chat-image-button img {
  width: 100%;
  max-height: 260px;
  display: block;
  object-fit: contain;
}

.chat-attachment.file a {
  min-width: 0;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
}

.chat-attachment.file a > span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.chat-attachment.file strong,
.chat-attachment.file small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-attachment.file small {
  color: #93a1ae;
  font-size: 0.7rem;
}

.chat-message-failure {
  margin-top: 7px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  color: #ffb9b9;
  font-size: 0.7rem;
}

.chat-message-failure span {
  flex: 1 1 100%;
}

.chat-message-failure button {
  min-height: 28px;
  padding: 0 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
}

.chat-message-menu {
  position: fixed;
  z-index: 940;
  min-width: 170px;
  padding: 5px;
  background: #17212c;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.52);
}

.chat-message-menu button {
  width: 100%;
  min-height: 42px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #eaf1f7;
  background: transparent;
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  text-align: left;
}

.chat-message-menu button[hidden] {
  display: none;
}

.chat-message-menu button:hover,
.chat-message-menu button:focus-visible {
  outline: none;
  background: rgba(85, 219, 167, 0.13);
}

.chat-message-menu #chatDeleteMessageButton {
  color: #ffb2b2;
}

.chat-message-menu #chatDeleteMessageButton:hover,
.chat-message-menu #chatDeleteMessageButton:focus-visible {
  background: rgba(243, 77, 77, 0.16);
}

.chat-message-menu .control-icon,
.chat-message-menu .control-icon svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.chat-new-messages {
  position: absolute;
  z-index: 3;
  right: 16px;
  bottom: 92px;
  min-height: 34px;
  padding: 0 12px;
  color: #07110d;
  background: #65ddb0;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.38);
  font-size: 0.76rem;
  font-weight: 900;
}

.chat-drop-overlay {
  position: absolute;
  z-index: 8;
  inset: 58px 8px 70px;
  display: grid;
  place-content: center;
  gap: 4px;
  color: #eafff6;
  text-align: center;
  background: rgba(6, 20, 16, 0.92);
  border: 2px dashed rgba(85, 219, 167, 0.74);
  border-radius: 8px;
}

.chat-drop-overlay[hidden] {
  display: none;
}

.chat-drop-overlay span {
  color: #9cc5b5;
  font-size: 0.78rem;
}

.chat-typing {
  min-height: 22px;
  padding: 3px 12px 0;
  overflow: hidden;
  color: #93a1ae;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-attachment-preview {
  min-height: 48px;
  margin: 0 10px 8px;
  padding: 5px 6px 5px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #eaf1f7;
  background: rgba(85, 219, 167, 0.08);
  border: 1px solid rgba(85, 219, 167, 0.28);
  border-radius: 8px;
}

.chat-attachment-preview[hidden] {
  display: none;
}

.chat-attachment-preview > span {
  min-width: 0;
  display: grid;
}

.chat-attachment-preview strong,
.chat-attachment-preview small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-attachment-preview small {
  color: #93a1ae;
  font-size: 0.7rem;
}

.chat-composer {
  min-height: 62px;
  padding: 8px 10px 10px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  align-items: end;
  gap: 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-composer textarea {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  max-height: 120px;
  padding: 9px 10px;
  resize: none;
  color: #f7fafc;
  background: rgba(2, 7, 11, 0.64);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  font: inherit;
  font-size: 0.84rem;
  line-height: 1.35;
}

.chat-composer textarea:focus {
  outline: none;
  border-color: rgba(85, 219, 167, 0.72);
  box-shadow: 0 0 0 3px rgba(85, 219, 167, 0.12);
}

.chat-composer button:disabled,
.chat-composer textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-lightbox {
  position: fixed;
  z-index: 300;
  inset: 0;
  padding: 32px;
  display: grid;
  place-items: center;
  background: rgba(1, 4, 7, 0.92);
}

.chat-lightbox[hidden] {
  display: none;
}

.chat-lightbox img {
  max-width: min(1200px, 92vw);
  max-height: 88svh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.6);
}

.chat-lightbox-close {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  padding: 0;
  color: #fff;
  background: rgba(20, 27, 35, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
}

.chat-lightbox-close::before,
.chat-lightbox-close::after {
  content: "";
  position: absolute;
  top: 20px;
  left: 11px;
  width: 20px;
  height: 2px;
  background: currentColor;
}

.chat-lightbox-close::before {
  transform: rotate(45deg);
}

.chat-lightbox-close::after {
  transform: rotate(-45deg);
}

@media (max-width: 1399px) and (min-width: 1101px) {
  .room-shell {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  body.room-active .room-sidebar {
    padding-inline: 12px;
  }

  body.room-active .stage-layout {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 350px);
  }

  .sidebar-participants .participant-row {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .sidebar-participants .participant-preview {
    width: 52px;
  }
}

@media (max-width: 1100px) and (min-width: 901px) {
  .room-shell {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  body.room-active .room-sidebar {
    padding-inline: 12px;
  }

  body.room-active .stage-layout {
    display: block;
  }

  .chat-panel {
    position: fixed;
    z-index: 85;
    top: 16px;
    right: 16px;
    bottom: 16px;
    width: min(390px, calc(100vw - 32px));
    height: auto;
    transform: translateX(calc(100% + 28px));
    transition: transform 180ms ease;
  }

  body.mobile-chat-open .chat-panel {
    transform: translateX(0);
  }

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

  .mobile-participants-button {
    display: none;
  }

  .mobile-view-tab {
    min-height: 42px;
  }
}

@media (max-width: 900px) {
  body.room-active .room-sidebar {
    z-index: 90;
    width: min(340px, calc(100vw - 28px));
    padding: max(18px, env(safe-area-inset-top)) 14px max(16px, env(safe-area-inset-bottom));
    gap: 18px;
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  body.mobile-menu-open .room-sidebar,
  body.mobile-participants-open .room-sidebar {
    transform: translateX(0);
  }

  body.mobile-participants-open .room-sidebar {
    background: #111a23;
  }

  body.mobile-participants-open .room-brand,
  body.mobile-participants-open .room-nav {
    display: none;
  }

  body.mobile-participants-open .sidebar-participants {
    flex: 1 1 auto;
  }

  body.mobile-participants-open .sidebar-profile {
    display: none;
  }

  body.mobile-menu-open .sidebar-participants {
    display: none;
  }

  body.mobile-menu-open .sidebar-profile {
    margin-top: auto;
  }

  body.mobile-participants-open .mobile-drawer-backdrop,
  body.mobile-menu-open .mobile-drawer-backdrop {
    z-index: 80;
    background: rgba(1, 6, 12, 0.72);
    backdrop-filter: none;
  }

  body.mobile-participants-open .media-stage {
    filter: none;
  }

  body.room-active .room-workspace {
    padding: max(10px, env(safe-area-inset-top)) 10px max(14px, env(safe-area-inset-bottom));
  }

  body.room-active .room-topline {
    margin-bottom: 8px;
  }

  .mobile-view-tabs {
    margin-bottom: 8px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .mobile-view-tab {
    min-width: 0;
    min-height: 40px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #c5ced8;
    background: rgba(17, 25, 34, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    font-weight: 900;
  }

  .mobile-view-tab .control-icon,
  .mobile-view-tab .control-icon svg {
    width: 17px;
    min-width: 17px;
    height: 17px;
    min-height: 17px;
  }

  .mobile-view-tab.active {
    color: #eafff6;
    background: rgba(85, 219, 167, 0.13);
    border-color: rgba(85, 219, 167, 0.5);
  }

  .mobile-view-tab.has-unread::after {
    content: "";
    width: 7px;
    height: 7px;
    margin-left: 1px;
    border-radius: 50%;
    background: #ff5f5f;
  }

  body.room-active .stage-layout {
    height: auto;
    min-height: 0;
    display: block;
  }

  body.room-active .media-stage,
  body.room-active .main-frame {
    height: auto;
  }

  body.room-active .main-frame.is-grid,
  body.room-active .main-frame.is-focus[data-grid-count="0"] {
    height: clamp(280px, 48svh, 540px);
  }

  body.room-active .video-tile.focused {
    height: 100% !important;
  }

  .chat-panel {
    display: none;
    height: clamp(430px, calc(100svh - 150px), 760px);
    min-height: 430px;
    box-shadow: none;
  }

  body.mobile-chat-open .chat-panel {
    display: flex;
  }

  body.mobile-chat-open .media-stage,
  body.mobile-chat-open .call-controls {
    display: none;
  }

  body.mobile-chat-open .call-area {
    gap: 0;
  }

  .chat-message {
    max-width: 90%;
  }
}

@media (max-width: 520px) {
  body.room-active .room-topline {
    align-items: center;
  }

  body.room-active .room-topline h1 {
    font-size: clamp(1.3rem, 7vw, 1.8rem);
  }

  .mobile-room-actions {
    padding-top: 18px;
  }

  .mobile-view-tab {
    min-height: 38px;
    font-size: 0.76rem;
  }

  body.room-active .main-frame.is-grid,
  body.room-active .main-frame.is-focus[data-grid-count="0"] {
    height: clamp(260px, 46svh, 480px);
  }

  .chat-panel {
    height: calc(100svh - 132px);
    min-height: 390px;
  }

  .chat-messages {
    padding-inline: 9px;
  }

  .chat-message {
    max-width: 94%;
  }

  .chat-message.has-link-preview {
    width: 94%;
  }

  .chat-composer {
    padding-inline: 8px;
    grid-template-columns: 38px minmax(0, 1fr) 38px;
  }

  .chat-room-info-button,
  .chat-attach-button,
  .chat-send-button {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
  }
}

/* Roomdrop v131 final room layout overrides */
.chat-header {
  position: relative;
  overflow: visible;
}

.chat-room-info {
  position: absolute;
  z-index: 24;
  top: 52px;
  right: 8px;
  width: min(292px, calc(100% - 16px));
  padding: 12px;
  grid-template-columns: 1fr;
  background: #18232e;
  border: 1px solid rgba(85, 219, 167, 0.34);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.48);
}

.chat-room-info > div {
  padding: 7px 8px;
  background: rgba(255, 255, 255, 0.045);
  border-radius: 6px;
}

.chat-room-info-button,
.chat-attach-button,
.chat-send-button {
  width: 42px;
  min-width: 42px;
  max-width: 42px;
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  padding: 0 !important;
  overflow: hidden;
  display: inline-grid;
  place-items: center;
  color: #eef5f8;
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
}

.chat-room-info-button:hover,
.chat-attach-button:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.28);
}

.chat-send-button,
.chat-send-button:hover {
  color: #07110d;
  background: #55dba7;
  border-color: #55dba7;
}

.chat-room-info-button .control-icon,
.chat-attach-button .control-icon,
.chat-send-button .control-icon,
.chat-room-info-button .control-icon svg,
.chat-attach-button .control-icon svg,
.chat-send-button .control-icon svg {
  width: 21px;
  min-width: 21px;
  height: 21px;
  min-height: 21px;
}

body.media-maximized .stage-layout {
  position: static;
  inset: auto;
  width: auto;
  height: auto;
  display: block;
  background: transparent;
}

body.media-maximized .chat-panel {
  display: none !important;
}

body.media-maximized .media-stage,
.media-stage:fullscreen {
  position: fixed;
  z-index: 220;
  inset: 0;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: none;
  max-height: none;
  background: #05080c;
  border: 0;
  border-radius: 0;
}

.media-stage:fullscreen {
  position: relative;
  width: 100% !important;
  height: 100% !important;
}

body.media-maximized .media-stage .main-frame,
.media-stage:fullscreen .main-frame {
  width: 100%;
  height: 100% !important;
  min-height: 100% !important;
}

@media (min-width: 1280px) {
  .room-shell {
    --room-sidebar-width: 380px;
    grid-template-columns: var(--room-sidebar-width) minmax(0, 1fr);
  }

  body.room-active .room-sidebar {
    height: calc(100dvh - 108px);
    padding: 20px 16px 14px;
    gap: 16px;
  }

  body.room-active .room-workspace {
    width: 100%;
    max-width: none;
    padding-bottom: 112px;
  }

  body.room-active .call-area {
    padding-bottom: 0;
  }

  .sidebar-participants .participant-admin-actions {
    flex-wrap: nowrap;
    gap: 5px;
  }

  .sidebar-participants .participant-admin-button {
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    flex-basis: 48px;
  }

  body.room-active .call-controls {
    position: fixed;
    z-index: 74;
    left: 12px;
    right: 12px;
    bottom: 10px;
    width: auto;
    max-width: none;
    min-height: 86px;
    margin: 0;
    padding: 9px 12px;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow: visible;
    background: rgba(15, 24, 33, 0.97);
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.52);
  }

  body.room-active .call-controls > .control-button,
  body.room-active .call-controls > .end-call-button {
    width: 66px;
    min-width: 66px;
    max-width: 66px;
    height: 60px;
    min-height: 60px;
  }

  body.room-active .call-controls .audio-stack {
    width: clamp(270px, 18vw, 330px);
    min-width: 270px;
    flex: 0 1 330px;
  }

  body.room-active .call-controls .admin-panel {
    width: auto;
    min-width: 0;
    max-width: none;
    min-height: 64px;
    margin-left: auto;
    padding: 0 0 0 10px;
    flex: 1 1 auto;
    border-left: 1px solid rgba(255, 255, 255, 0.11);
  }

  body.room-active .call-controls .admin-access-controls {
    width: 100%;
    min-width: 0;
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: center;
    align-content: center;
    gap: 7px;
  }

  body.room-active .call-controls .room-visibility-control,
  body.room-active .call-controls .room-join-mode-control {
    width: 146px;
    min-width: 112px;
    flex: 0 1 146px;
  }

  body.room-active .call-controls .room-access-pill {
    width: 232px;
    min-width: 188px;
    flex: 0 1 232px;
  }

  body.room-active .call-controls .admin-transfer-control,
  body.room-active .call-controls .admin-delete-control {
    flex: 0 0 82px;
  }

  body.room-active .call-controls .transfer-admin-button,
  body.room-active .call-controls .delete-room-button {
    width: 82px;
    min-width: 82px;
    max-width: 82px;
  }
}

@media (min-width: 1280px) and (max-width: 1499px) {
  .room-shell {
    --room-sidebar-width: 350px;
  }

  body.room-active .call-controls {
    gap: 6px;
  }

  body.room-active .call-controls > .control-button,
  body.room-active .call-controls > .end-call-button {
    width: 62px;
    min-width: 62px;
    max-width: 62px;
  }

  body.room-active .call-controls .audio-stack {
    width: 250px;
    min-width: 230px;
    flex-basis: 250px;
  }

  body.room-active .call-controls .room-visibility-control,
  body.room-active .call-controls .room-join-mode-control {
    width: 130px;
    flex-basis: 130px;
  }

  body.room-active .call-controls .room-access-pill {
    width: 205px;
    min-width: 170px;
    flex-basis: 205px;
  }
}

@media (max-width: 900px) {
  body.room-active {
    min-height: 100dvh;
  }

  body.room-active .room-workspace {
    min-height: 0;
  }

  body.room-active .room-topline {
    align-items: flex-start;
  }

  .mobile-room-actions {
    display: none !important;
  }

  .mobile-view-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .mobile-view-tab,
  .mobile-menu-button {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    height: 46px;
    padding: 0 10px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 0.82rem;
    line-height: 1;
  }

  .mobile-view-tab .control-text {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: nowrap;
  }

  .mobile-view-tab.has-unread {
    color: #fff1f1;
    border-color: rgba(255, 91, 91, 0.85);
    box-shadow: inset 0 0 0 1px rgba(255, 91, 91, 0.24);
  }

  .mobile-view-tab.has-unread .control-icon {
    color: #ff7b7b;
  }

  .mobile-view-tab.has-unread::after {
    position: absolute;
    top: 7px;
    right: 9px;
    width: 8px;
    height: 8px;
    margin: 0;
    box-shadow: 0 0 0 3px #111922;
  }

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

  body.mobile-chat-open .room-workspace {
    height: var(--roomdrop-visual-height, 100dvh);
    max-height: var(--roomdrop-visual-height, 100dvh);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  body.mobile-chat-open .room-topline,
  body.mobile-chat-open .mobile-view-tabs {
    flex: 0 0 auto;
  }

  body.mobile-chat-open .call-area {
    min-height: 0;
    flex: 1 1 auto;
    display: block;
    overflow: hidden;
  }

  body.mobile-chat-open .stage-layout,
  body.mobile-chat-open .chat-panel {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
  }

  body.mobile-chat-open .chat-panel {
    border-radius: 8px;
  }

  body.mobile-chat-open .chat-messages {
    min-height: 0;
  }

  body.mobile-menu-open .sidebar-profile {
    display: none !important;
  }
}

@media (max-width: 520px) {
  .mobile-view-tabs {
    margin-bottom: 7px;
  }

  .mobile-view-tab,
  .mobile-menu-button {
    min-height: 44px;
    height: 44px;
    font-size: 0.78rem;
  }

  .chat-room-info {
    top: 50px;
    width: calc(100% - 16px);
  }
}

/* Roomdrop v132 final centered desktop split and mobile viewport repair */
@media (min-width: 1280px) {
  body.room-active .call-controls .admin-panel {
    width: 50%;
    max-width: 50%;
    flex: 0 1 50%;
    margin-left: auto;
  }
}

@media (max-width: 900px) {
  body.room-active .room-shell {
    min-height: 100dvh;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, auto);
  }

  body.room-active .room-sidebar {
    position: fixed;
    z-index: 90;
    inset: 0 auto 0 0;
    width: min(340px, calc(100vw - 28px));
    height: var(--roomdrop-visual-height, 100dvh);
    min-height: 0;
    max-height: var(--roomdrop-visual-height, 100dvh);
    transform: translateX(-105%);
  }

  body.room-active .room-workspace {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    min-height: 0;
  }

  body.mobile-chat-open .room-workspace {
    position: fixed;
    z-index: 60;
    top: 0;
    right: 0;
    bottom: auto;
    left: 0;
    width: 100%;
    height: var(--roomdrop-visual-height, 100dvh);
    max-height: var(--roomdrop-visual-height, 100dvh);
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    transform: translateY(var(--roomdrop-visual-top, 0px));
  }

  body.mobile-chat-open .call-area,
  body.mobile-chat-open .stage-layout,
  body.mobile-chat-open .chat-panel {
    min-height: 0;
  }

  body.mobile-chat-open .chat-panel {
    overflow: hidden;
  }

  body.mobile-chat-open .chat-composer {
    flex: 0 0 auto;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }

  body.room-active.mobile-menu-open .room-sidebar,
  body.room-active.mobile-participants-open .room-sidebar {
    transform: translateX(0);
  }

  body.room-active.mobile-menu-open .mobile-drawer-backdrop,
  body.room-active.mobile-participants-open .mobile-drawer-backdrop {
    display: block;
  }
}

/* Roomdrop v147 stable admin controls and circular participants */
body.room-active .call-controls .room-join-mode-control {
  width: 200px;
  flex: 0 0 200px;
}

body.room-active .call-controls .room-join-mode-picker .room-access-menu-button {
  padding-inline: 11px;
  gap: 8px;
}

.sidebar-participants .participant-admin-actions {
  justify-content: center;
  gap: 5px;
}

.sidebar-participants .participant-admin-button {
  width: 52px;
  min-width: 52px;
  max-width: 52px;
  height: 50px;
  min-height: 50px;
  max-height: 50px;
  flex: 0 0 52px;
  padding: 4px 2px;
  grid-template-rows: 16px minmax(0, 22px);
  align-content: center;
  justify-items: center;
  gap: 2px;
}

.sidebar-participants .participant-admin-button .control-text {
  width: 48px;
  max-width: 48px;
  max-height: 22px;
  font-size: 0.6rem;
  line-height: 1.08;
}

@media (max-width: 700px) {
  body.room-active .call-controls .room-join-mode-control {
    width: 100%;
    flex: 1 1 100%;
  }
}

/* Compact and complete link previews */
.chat-panel {
  position: relative;
  z-index: 980;
  overflow: visible;
}

.chat-picker-layer {
  position: fixed;
  z-index: 2147483647;
  inset: 0;
  pointer-events: none;
}

.chat-composer {
  grid-template-columns: auto minmax(90px, 1fr) 40px;
}

.chat-composer-tools {
  display: flex;
  align-items: center;
  gap: 5px;
}

.chat-composer-tools .icon-button,
.chat-send-button {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.chat-gif-button {
  color: #dff9ef;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.chat-gif-label {
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0;
}

.chat-picker {
  position: fixed;
  z-index: 2147483647;
  right: auto;
  bottom: var(--chat-picker-bottom, 70px);
  left: var(--chat-picker-left, 10px);
  width: var(--chat-picker-width, min(430px, calc(100vw - 24px)));
  max-height: min(var(--chat-picker-max-height, 390px), calc(100dvh - 92px));
  padding: 10px;
  overflow: auto;
  pointer-events: auto;
  color: #eff8f4;
  background: #17222d;
  border: 1px solid rgba(85, 219, 167, 0.36);
  border-radius: 8px;
  box-shadow: 0 20px 58px rgba(0, 0, 0, 0.56);
}

.chat-picker[hidden] {
  display: none;
}

.chat-picker header {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-picker header strong {
  font-size: 0.9rem;
}

.chat-picker header small {
  margin-left: auto;
  color: #91a0ad;
  font-size: 0.66rem;
}

.chat-picker header .icon-button {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  margin-left: auto;
  padding: 0;
}

.chat-gif-picker header .icon-button {
  margin-left: 0;
}

.chat-picker input {
  width: 100%;
  height: 38px;
  margin: 7px 0 9px;
  padding: 0 10px;
  color: #f5f8fa;
  background: #0b1219;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  font: inherit;
  font-size: 0.8rem;
}

.chat-picker input:focus {
  outline: none;
  border-color: rgba(85, 219, 167, 0.7);
  box-shadow: 0 0 0 3px rgba(85, 219, 167, 0.1);
}

.chat-emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 4px;
}

.chat-emoji-option {
  aspect-ratio: 1;
  min-width: 0;
  padding: 0;
  display: grid;
  place-items: center;
  color: inherit;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 1.35rem;
}

.chat-emoji-option:hover,
.chat-emoji-option:focus-visible {
  outline: none;
  background: rgba(85, 219, 167, 0.12);
  border-color: rgba(85, 219, 167, 0.32);
}

.chat-picker-status,
.chat-picker-empty {
  margin: 0 0 8px;
  color: #91a0ad;
  font-size: 0.72rem;
}

.chat-picker-empty {
  grid-column: 1 / -1;
  padding: 18px 0;
  text-align: center;
}

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

.chat-gif-option {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  background: #060a0e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
}

.chat-gif-option:hover,
.chat-gif-option:focus-visible {
  outline: none;
  border-color: rgba(85, 219, 167, 0.72);
}

.chat-gif-option img {
  width: 100%;
  height: 116px;
  display: block;
  object-fit: cover;
}

.chat-attachment.video video,
.chat-gif img {
  width: 100%;
  max-width: 320px;
  max-height: 280px;
  display: block;
  object-fit: contain;
  background: #05080c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
}

.chat-attachment.video small,
.chat-gif figcaption {
  margin-top: 4px;
  display: block;
  overflow: hidden;
  color: #91a0ad;
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-gif {
  margin: 7px 0 0;
}

.chat-link-preview {
  margin-top: 7px;
  display: grid;
  gap: 0;
  overflow: hidden;
  color: #eaf7f1 !important;
  text-decoration: none !important;
  background: rgba(2, 8, 12, 0.35);
  border: 1px solid rgba(85, 219, 167, 0.28);
  border-left: 3px solid #55dba7;
  border-radius: 7px;
}

.chat-link-copy {
  min-width: 0;
  padding: 9px 10px;
  display: grid;
  gap: 3px;
  color: #eaf7f1 !important;
  text-decoration: none !important;
}

.chat-link-copy:hover {
  background: rgba(85, 219, 167, 0.08);
}

.chat-link-copy small,
.chat-link-copy span {
  color: #9babb7;
  font-size: 0.7rem;
}

.chat-link-copy strong,
.chat-link-copy span {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
}

.chat-link-copy strong {
  -webkit-line-clamp: 2;
}

.chat-link-copy span {
  -webkit-line-clamp: 3;
}

.chat-link-media,
.chat-link-image img,
.chat-link-embed {
  width: 100%;
  display: block;
  background: #05080c;
  border: 0;
}

.chat-link-media,
.chat-link-image img {
  height: auto;
  max-height: 320px;
  object-fit: contain;
  object-position: center;
}

.chat-link-image {
  padding: 0;
  overflow: hidden;
  cursor: zoom-in;
  background: transparent;
  border: 0;
}

.chat-link-embed {
  min-height: 230px;
  aspect-ratio: 16 / 9;
}

.chat-link-preview.provider-tiktok .chat-link-embed,
.chat-link-preview.provider-instagram .chat-link-embed {
  max-height: 560px;
  aspect-ratio: 9 / 16;
}

.chat-link-fallback {
  min-height: 92px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: #aebbc5;
  background:
    linear-gradient(135deg, rgba(85, 219, 167, 0.11), transparent 62%),
    #091018;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.72rem;
  font-weight: 800;
}

.chat-link-fallback-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #07110d;
  background: #55dba7;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 7px;
  font-size: 1.2rem;
  font-weight: 950;
}

.chat-link-fallback-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #f5f7f9;
}

.chat-link-fallback-mark.has-image {
  color: transparent;
  background: #f5f7f9;
}

.chat-draft-preview {
  position: relative;
  margin: 0 10px 8px;
}

.chat-draft-preview[hidden] {
  display: none;
}

.chat-draft-preview .chat-link-preview {
  margin-top: 0;
}

.chat-draft-preview-remove {
  position: absolute;
  z-index: 3;
  top: 6px;
  right: 6px;
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  color: #f4f8fb;
  background: rgba(8, 13, 18, 0.88);
  border-color: rgba(255, 255, 255, 0.24);
}

.chat-draft-preview-remove .control-icon {
  width: 16px;
  height: 16px;
}

.chat-draft-preview-remove .control-icon svg {
  width: 16px;
  height: 16px;
}

.chat-message-reactions {
  position: relative;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.chat-reaction-summary {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.chat-reaction-count,
.chat-reaction-trigger,
.chat-reaction-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #eaf7f1;
  background: #17212a;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.chat-reaction-count {
  min-width: 38px;
  height: 28px;
  padding: 0 8px;
  gap: 4px;
  border-radius: 14px;
}

.chat-reaction-count strong {
  font-size: 0.7rem;
}

.chat-reaction-count.active {
  color: #a9f4d4;
  background: rgba(85, 219, 167, 0.14);
  border-color: rgba(85, 219, 167, 0.62);
}

.chat-reaction-trigger {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
}

.chat-reaction-trigger .control-icon {
  width: 15px;
  height: 15px;
}

.chat-reaction-picker {
  position: fixed;
  z-index: 2147483647;
  right: auto;
  bottom: auto;
  left: var(--chat-reaction-picker-left, 10px);
  top: var(--chat-reaction-picker-top, 10px);
  max-width: var(--chat-reaction-picker-max-width, 232px);
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(6, 34px);
  gap: 3px;
  background: #111a22;
  border: 1px solid rgba(85, 219, 167, 0.35);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.38);
}

.chat-reaction-option {
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 1.05rem;
  border-radius: 6px;
}

.chat-reaction-count:hover,
.chat-reaction-trigger:hover,
.chat-reaction-option:hover {
  background: #22313d;
  border-color: rgba(85, 219, 167, 0.5);
}

.chat-upload-progress {
  position: relative;
  height: 28px;
  margin-top: 7px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
}

.chat-upload-progress > span {
  position: absolute;
  inset: 0 auto 0 0;
  background: rgba(85, 219, 167, 0.28);
  transition: width 120ms linear;
}

.chat-upload-progress small {
  position: relative;
  z-index: 1;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 0.68rem;
}

.chat-attachment-preview > span {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.chat-attachment-preview > span > span {
  min-width: 0;
  display: grid;
}

.chat-attachment-preview img,
.chat-attachment-preview video {
  width: 42px;
  height: 36px;
  display: block;
  object-fit: cover;
  background: #05080c;
  border-radius: 5px;
}

@media (max-width: 520px) {
  .chat-composer {
    grid-template-columns: auto minmax(72px, 1fr) 38px;
    gap: 5px;
  }

  .chat-composer-tools {
    gap: 3px;
  }

  .chat-composer-tools .icon-button {
    width: 36px;
    min-width: 36px;
    height: 38px;
    min-height: 38px;
  }

  .chat-picker {
    bottom: var(--chat-picker-bottom, calc(66px + env(safe-area-inset-bottom)));
    left: var(--chat-picker-left, 8px);
    width: var(--chat-picker-width, calc(100vw - 16px));
    max-height: min(var(--chat-picker-max-height, 54dvh), 430px);
  }

  .chat-emoji-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .chat-link-embed {
    min-height: 180px;
  }

  .chat-link-preview.provider-tiktok .chat-link-embed,
  .chat-link-preview.provider-instagram .chat-link-embed {
    min-height: 360px;
    max-height: 58dvh;
  }

  .chat-reaction-picker {
    right: auto;
    bottom: auto;
    left: var(--chat-reaction-picker-left, 8px);
    top: var(--chat-reaction-picker-top, 8px);
    grid-template-columns: repeat(6, 32px);
  }

  .chat-reaction-option {
    width: 32px;
    height: 32px;
  }
}

/* roomdrop Android communication directory and setup isolation */
body.native-android #installButton {
  display: none !important;
}

.android-offline-members {
  margin: 10px 8px 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.11);
}

.android-offline-members[hidden] {
  display: none;
}

.android-offline-heading {
  width: 100%;
  min-height: 34px;
  margin: 0;
  padding: 7px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #aebbc5;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 7px;
  cursor: pointer;
}

.android-offline-heading strong {
  color: #aebbc5;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.android-offline-heading span:last-child {
  color: #7f8b96;
  font-size: 0.66rem;
  font-weight: 800;
}

.android-offline-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.android-call-all {
  min-width: 82px;
  height: 30px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 0.68rem;
}

.android-offline-list {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.android-offline-member {
  min-width: 0;
  padding: 7px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 7px;
}

.android-offline-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #07110d;
  background: #55dba7;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 900;
}

.android-offline-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.android-offline-copy strong,
.android-offline-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.android-offline-copy strong {
  font-size: 0.76rem;
}

.android-offline-copy small {
  color: #9eabb5;
  font-size: 0.64rem;
}

.android-call-member {
  width: 66px;
  min-width: 66px;
  height: 36px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.64rem;
}

.android-call-member .control-icon,
.android-call-all .control-icon {
  width: 14px;
  min-width: 14px;
  height: 14px;
}

.android-call-member .control-icon svg,
.android-call-all .control-icon svg {
  width: 14px;
  height: 14px;
}

.android-call-member .control-text,
.android-call-all .control-text {
  white-space: nowrap;
}

.android-remove-member {
  width: 58px;
  min-width: 58px;
  height: 30px;
  padding: 0 5px;
  font-size: 0.62rem;
}

.android-call-member:disabled,
.android-call-all:disabled {
  opacity: 0.45;
}

.android-communication-settings .settings-toggle {
  margin-top: 8px;
}

.android-ignore-group {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
}

.android-ignore-group h4 {
  margin: 0 0 5px;
  color: #f1f6f8;
  font-size: 0.9rem;
}

.android-ignore-list {
  display: grid;
  gap: 7px;
}

.android-ignore-row {
  min-width: 0;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 7px;
}

.android-ignore-row > strong,
.android-ignore-row > span > strong,
.android-ignore-row > span > small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.android-ignore-row > strong,
.android-ignore-row > span > strong {
  font-size: 0.78rem;
}

.android-ignore-row > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.android-ignore-row > span > small {
  color: #93a1ac;
  font-size: 0.72rem;
}

.android-ignore-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.android-ignore-actions label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #b8c3ca;
  font-size: 0.67rem;
  white-space: nowrap;
}

.android-ignore-actions label:has(input:disabled) {
  opacity: 0.45;
}

body.native-room-setup .room-sidebar,
body.native-room-setup .mobile-view-tabs,
body.native-room-setup .room-topline {
  display: none !important;
}

/* roomdrop-v153 Android call toasts, sidebar menu collapse, and mention picker */
body.native-android .toast {
  bottom: max(96px, calc(env(safe-area-inset-bottom) + 88px));
}

body.room-active .room-brand-button {
  cursor: pointer;
}

body.room-active .room-brand-button:focus-visible {
  outline: 3px solid rgba(85, 219, 167, 0.28);
  outline-offset: 4px;
}

body.room-active .room-nav {
  max-height: 240px;
  opacity: 1;
  overflow: hidden;
  transform: translateY(0);
  transition:
    max-height 190ms ease,
    opacity 160ms ease,
    transform 190ms ease;
}

body.room-active.sidebar-menu-collapsed .room-nav {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
}

body.room-active.sidebar-menu-collapsed .room-brand-button .brand-mark {
  box-shadow:
    inset 0 0 0 1px rgba(85, 219, 167, 0.75),
    0 0 0 4px rgba(85, 219, 167, 0.13);
}

@media (min-width: 901px) {
  body.room-active .room-shell {
    --room-sidebar-width: 400px;
  }

  body.room-active .room-sidebar {
    gap: 18px;
  }

  body.room-active .room-nav {
    gap: 10px;
  }

  body.room-active .room-nav-item {
    min-height: 58px;
    padding: 0 18px;
    gap: 14px;
  }

  body.room-active .room-nav-item > span:first-child {
    width: 34px;
    height: 34px;
  }

  body.room-active .room-nav-item .nav-icon svg {
    width: 20px;
    height: 20px;
  }

  body.room-active .room-nav-item strong {
    font-size: 0.98rem;
  }
}

@media (min-width: 901px) and (max-width: 1279px) {
  body.room-active .room-shell {
    --room-sidebar-width: 380px;
  }
}

.sidebar-participants .participant-admin-actions {
  gap: 6px;
}

.sidebar-participants .participant-admin-button {
  width: 56px;
  min-width: 56px;
  max-width: 56px;
  flex-basis: 56px;
}

.sidebar-participants .participant-admin-button .control-text {
  width: 52px;
  max-width: 52px;
  font-size: 0.61rem;
}

.chat-composer {
  position: relative;
}

.chat-mention-menu {
  position: absolute;
  right: 56px;
  bottom: calc(100% + 8px);
  left: 58px;
  z-index: 42;
  max-height: min(280px, 48vh);
  padding: 6px;
  display: grid;
  gap: 4px;
  overflow-y: auto;
  background: rgba(9, 15, 22, 0.98);
  border: 1px solid rgba(85, 219, 167, 0.26);
  border-radius: 8px;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.42);
}

.chat-mention-menu[hidden] {
  display: none;
}

.chat-mention-option {
  width: 100%;
  min-width: 0;
  padding: 7px 8px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  color: #eff7f4;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  text-align: left;
}

.chat-mention-option.active,
.chat-mention-option:hover {
  background: rgba(85, 219, 167, 0.13);
  border-color: rgba(85, 219, 167, 0.38);
}

.chat-mention-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #07110d;
  background: #55dba7;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 900;
}

.chat-mention-option strong,
.chat-mention-option small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-mention-option small {
  color: #9fb0ba;
  font-size: 0.68rem;
}

@media (max-width: 520px) {
  .chat-mention-menu {
    right: 8px;
    left: 8px;
    bottom: calc(66px + env(safe-area-inset-bottom));
  }
}

/* roomdrop-v151 denser desktop sidebar navigation */
@media (min-width: 901px) {
  body.room-active .room-sidebar {
    gap: 10px;
    padding-top: 14px;
  }

  body.room-active .room-brand {
    min-height: 44px;
  }

  body.room-active .room-nav {
    gap: 4px;
  }

  body.room-active .room-nav-item {
    min-height: 44px;
    padding: 0 10px;
    gap: 10px;
  }

  body.room-active .room-nav-item > span:first-child {
    width: 30px;
    height: 30px;
  }

  body.room-active .room-nav-item .nav-icon svg {
    width: 18px;
    height: 18px;
  }

  body.room-active .room-nav-item strong {
    font-size: 0.92rem;
  }

  body.room-active .sidebar-participants-header {
    min-height: 40px;
  }
}

/* roomdrop-v155 participant rail containment and compact action reveal */
body.room-active .room-sidebar {
  padding-inline: 3px;
}

body.room-active:not(.sidebar-menu-collapsed) .room-nav {
  max-height: 240px !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateY(0) !important;
}

body.room-active.sidebar-menu-collapsed .room-nav {
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-10px);
}

body.room-active .room-nav {
  visibility: visible;
}

body.room-active .sidebar-participants .participant-rail {
  display: grid;
  grid-auto-rows: max-content;
  gap: 6px;
  max-height: none;
  padding: 4px 2px 10px;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-padding-bottom: 10px;
}

.sidebar-participants .participant-row {
  min-height: 0;
  height: auto;
  align-items: start;
  overflow: visible;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 7px;
  padding: 6px;
}

.sidebar-participants .participant-preview {
  width: 50px;
}

.sidebar-participants .participant-status-line {
  gap: 4px;
}

.participant-action-toggle {
  width: 24px;
  min-width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  color: #dce7ee;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
}

.participant-action-toggle:hover,
.participant-row.actions-open .participant-action-toggle {
  color: #ffffff;
  background: rgba(85, 219, 167, 0.16);
  border-color: rgba(85, 219, 167, 0.48);
}

.participant-action-toggle svg {
  width: 15px;
  height: 15px;
}

.sidebar-participants .participant-row:not(.actions-open) .participant-admin-actions {
  display: none;
}

.sidebar-participants .participant-admin-actions {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(var(--action-count, 6), minmax(0, 1fr));
  align-items: stretch;
  justify-content: stretch;
  gap: 4px;
  padding-top: 0;
  grid-column: 1 / -1;
}

.sidebar-participants .participant-admin-button {
  width: 100%;
  min-width: 0;
  max-width: none;
  height: 38px;
  min-height: 38px;
  max-height: 38px;
  flex: 1 1 auto;
  padding: 3px 1px;
  grid-template-rows: 13px minmax(0, 17px);
  gap: 1px;
}

.sidebar-participants .participant-admin-button .control-text {
  width: 100%;
  max-width: 100%;
  max-height: 18px;
  font-size: clamp(0.48rem, 1.35vw, 0.56rem);
  line-height: 1.02;
  overflow-wrap: normal;
}

.sidebar-participants .participant-admin-button .control-icon,
.sidebar-participants .participant-admin-button .control-icon svg {
  width: 13px;
  min-width: 13px;
  height: 13px;
  min-height: 13px;
}

.sidebar-participants .participant-copy {
  min-width: 0;
}

body.room-active .android-offline-members {
  flex: 0 0 auto;
}

@media (min-width: 901px) and (max-width: 1279px) {
  body.room-active .room-shell {
    --room-sidebar-width: 390px;
  }
}

@media (max-width: 420px) {
  .sidebar-participants .participant-admin-button .control-text {
    font-size: 0.48rem;
  }
}

body.native-room-setup .room-shell {
  display: block;
}

/* roomdrop-v170 desktop side panel collapse */
@media (min-width: 901px) {
  body.room-active.left-panel-collapsed .room-shell {
    grid-template-columns: 76px minmax(0, 1fr) !important;
  }

  body.room-active.left-panel-collapsed .room-sidebar {
    padding-inline: 8px !important;
    align-items: center;
    gap: 12px;
    overflow: visible;
  }

  body.room-active.left-panel-collapsed .room-brand {
    width: 52px;
    min-height: 52px;
    padding: 0;
    justify-content: center;
  }

  body.room-active.left-panel-collapsed .room-brand span:last-child,
  body.room-active.left-panel-collapsed .room-nav-item strong,
  body.room-active.left-panel-collapsed .sidebar-participants,
  body.room-active.left-panel-collapsed .sidebar-profile {
    display: none !important;
  }

  body.room-active.left-panel-collapsed .room-nav {
    width: 52px;
    max-height: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
    display: grid;
    gap: 10px;
  }

  body.room-active.left-panel-collapsed .room-nav-item {
    width: 52px;
    min-height: 52px;
    padding: 0;
    justify-content: center;
  }

  body.room-active.left-panel-collapsed .left-panel-collapse-button {
    width: 52px;
    min-height: 52px;
    padding: 0;
    justify-content: center;
    transform: translateX(-3px);
  }

  body.room-active.right-panel-collapsed .stage-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.room-active.right-panel-collapsed .chat-panel {
    display: none !important;
  }
}

/* roomdrop-v172 nav-style left collapse and Android settings clearance */
.left-panel-collapse-button {
  position: static !important;
  inset: auto !important;
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 !important;
  justify-content: center;
}

.left-panel-collapse-button strong {
  display: none !important;
}

.left-panel-collapse-button .control-icon,
.left-panel-collapse-button .control-icon svg {
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
}

@media (max-width: 900px) {
  .left-panel-collapse-button {
    display: none !important;
  }
}

body.native-android .settings-card {
  padding-bottom: max(96px, calc(env(safe-area-inset-bottom) + 84px));
}

body.native-android.mobile-menu-open .room-brand-button {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  padding-left: 0;
  gap: 16px;
}

body.native-android.mobile-menu-open .room-brand-button .brand-mark {
  justify-self: center;
  transform: none;
}

.primary-panel {
  position: relative;
}

.build-version-badge {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 2;
  color: rgba(157, 168, 179, 0.58);
  font-size: 0.62rem;
  line-height: 1;
  letter-spacing: 0;
  pointer-events: none;
  user-select: none;
}

body.room-active .build-version-badge {
  display: none;
}

.room-brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.room-brand-row .room-brand-button {
  flex: 0 1 auto;
  min-width: 0;
}

.room-brand-row .left-panel-collapse-button {
  margin-left: auto;
}

body.room-active:not(.left-panel-collapsed) .room-brand-row {
  position: static !important;
  align-self: stretch;
  width: 100%;
  min-width: 100%;
  padding-right: 0;
  box-sizing: border-box;
  gap: 12px;
}

body.room-active:not(.left-panel-collapsed) .room-brand-row .room-brand-button {
  flex: 1 1 auto;
  width: auto !important;
  max-width: calc(100% - 56px);
}

body.room-active:not(.left-panel-collapsed) .room-brand-row .left-panel-collapse-button {
  position: static !important;
  margin-left: auto;
  margin-top: 0;
  flex: 0 0 44px;
  align-self: flex-start;
  transform: translateY(4px);
}

body.room-active.left-panel-collapsed .room-brand-row {
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

body.room-active.left-panel-collapsed .room-brand-button {
  cursor: default;
  pointer-events: none;
}

body.room-active.left-panel-collapsed .room-brand-button:hover .brand-mark,
body.room-active.left-panel-collapsed .room-brand-button .brand-mark {
  box-shadow: none;
}

body.native-room-setup .room-workspace {
  width: min(100%, 760px);
  min-height: var(--roomdrop-visual-height, 100dvh);
  margin: 0 auto;
  display: grid;
  place-items: center;
}

body.native-room-setup .lobby {
  width: 100%;
}

body.native-room-setup .call-area.is-joining {
  width: 100%;
  min-height: min(520px, var(--roomdrop-visual-height, 100dvh));
}

@media (max-width: 700px) {
  .android-ignore-row {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .android-ignore-actions {
    width: 100%;
    justify-content: space-between;
  }

  body.native-room-setup .room-workspace {
    min-height: var(--roomdrop-visual-height, 100dvh);
    padding: max(14px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom));
  }
}

@media (orientation: landscape) and (max-height: 620px) {
  body.native-android:not(.native-force-portrait).room-active .room-shell {
    display: block;
    grid-template-columns: none !important;
    height: var(--roomdrop-visual-height, 100dvh);
    min-height: 0;
    overflow: hidden;
  }

  body.native-android:not(.native-force-portrait).room-active .room-sidebar,
  body.native-android:not(.native-force-portrait).room-active .room-topline,
  body.native-android:not(.native-force-portrait).room-active .mobile-view-tabs,
  body.native-android:not(.native-force-portrait).room-active .mobile-drawer-backdrop,
  body.native-android:not(.native-force-portrait).room-active .chat-panel,
  body.native-android:not(.native-force-portrait).room-active .call-controls,
  body.native-android:not(.native-force-portrait).room-active .right-panel-collapse-button,
  body.native-android:not(.native-force-portrait).room-active .participant-panel {
    display: none !important;
  }

  body.native-android:not(.native-force-portrait).room-active .room-workspace {
    position: fixed;
    z-index: 220;
    inset: 0;
    width: 100vw;
    height: var(--roomdrop-visual-height, 100dvh);
    max-height: var(--roomdrop-visual-height, 100dvh);
    min-height: 0;
    padding: 0 !important;
    overflow: hidden;
  }

  body.native-android:not(.native-force-portrait).room-active .call-area,
  body.native-android:not(.native-force-portrait).room-active .stage-layout {
    width: 100vw;
    height: var(--roomdrop-visual-height, 100dvh);
    min-height: 0;
    max-height: var(--roomdrop-visual-height, 100dvh);
    display: block;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #05080c;
    overflow: hidden;
  }

  body.native-android:not(.native-force-portrait).room-active .media-stage,
  body.native-android:not(.native-force-portrait).room-active .main-frame {
    width: 100vw !important;
    height: var(--roomdrop-visual-height, 100dvh) !important;
    min-height: var(--roomdrop-visual-height, 100dvh) !important;
    max-height: var(--roomdrop-visual-height, 100dvh);
    border: 0;
    border-radius: 0;
    overflow: hidden;
    background: #05080c;
  }

  body.native-android:not(.native-force-portrait).room-active .main-frame.is-grid,
  body.native-android:not(.native-force-portrait).room-active .main-frame.is-focus[data-grid-count="0"] {
    height: var(--roomdrop-visual-height, 100dvh) !important;
  }

  body.native-android:not(.native-force-portrait).room-active .tile-actions,
  body.native-android:not(.native-force-portrait).room-active .remote-mute {
    display: none !important;
  }

  body.native-android:not(.native-force-portrait).room-active .video-tile.self-overlay {
    display: grid !important;
    left: auto;
    right: max(52px, calc(env(safe-area-inset-right) + 46px));
    bottom: max(58px, calc(env(safe-area-inset-bottom) + 52px));
    width: clamp(128px, 22vw, 210px);
    z-index: 12;
  }
}

body.native-android.native-force-landscape.room-active .room-shell {
  display: block;
  grid-template-columns: none !important;
  height: var(--roomdrop-visual-height, 100dvh);
  min-height: 0;
  overflow: hidden;
}

body.native-android.native-force-landscape.room-active .room-sidebar,
body.native-android.native-force-landscape.room-active .room-topline,
body.native-android.native-force-landscape.room-active .mobile-view-tabs,
body.native-android.native-force-landscape.room-active .mobile-drawer-backdrop,
body.native-android.native-force-landscape.room-active .chat-panel,
body.native-android.native-force-landscape.room-active .call-controls,
body.native-android.native-force-landscape.room-active .right-panel-collapse-button,
body.native-android.native-force-landscape.room-active .participant-panel {
  display: none !important;
}

body.native-android.native-force-landscape.room-active .room-workspace {
  position: fixed;
  z-index: 220;
  inset: 0;
  width: 100vw;
  height: var(--roomdrop-visual-height, 100dvh);
  max-height: var(--roomdrop-visual-height, 100dvh);
  min-height: 0;
  padding: 0 !important;
  overflow: hidden;
}

body.native-android.native-force-landscape.room-active .call-area,
body.native-android.native-force-landscape.room-active .stage-layout {
  width: 100vw;
  height: var(--roomdrop-visual-height, 100dvh);
  min-height: 0;
  max-height: var(--roomdrop-visual-height, 100dvh);
  display: block;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #05080c;
  overflow: hidden;
}

body.native-android.native-force-landscape.room-active .media-stage,
body.native-android.native-force-landscape.room-active .main-frame {
  width: 100vw !important;
  height: var(--roomdrop-visual-height, 100dvh) !important;
  min-height: var(--roomdrop-visual-height, 100dvh) !important;
  max-height: var(--roomdrop-visual-height, 100dvh);
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: #05080c;
}

body.native-android.native-force-landscape.room-active .main-frame.is-grid,
body.native-android.native-force-landscape.room-active .main-frame.is-focus[data-grid-count="0"] {
  height: var(--roomdrop-visual-height, 100dvh) !important;
}

body.native-android.native-force-landscape.room-active .tile-actions,
body.native-android.native-force-landscape.room-active .remote-mute {
  display: none !important;
}

body.native-android.native-force-landscape.room-active .video-tile.self-overlay {
  display: grid !important;
  left: auto;
  right: max(52px, calc(env(safe-area-inset-right) + 46px));
  bottom: max(58px, calc(env(safe-area-inset-bottom) + 52px));
  width: clamp(128px, 22vw, 210px);
  z-index: 12;
}

/* roomdrop-v198 Android horizontal escape menu */
.android-landscape-menu-button,
.android-landscape-menu {
  display: none;
}

.android-landscape-menu-button {
  position: fixed;
  z-index: 340;
  top: max(14px, calc(env(safe-area-inset-top) + 12px));
  left: max(14px, calc(env(safe-area-inset-left) + 12px));
  width: 58px;
  height: 58px;
  min-width: 58px;
  min-height: 58px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(13, 20, 28, 0.78);
  color: #f8fbff;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(10px);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.android-landscape-menu-button .control-icon {
  width: 24px;
  height: 24px;
}

.android-landscape-menu {
  position: fixed;
  z-index: 341;
  top: max(78px, calc(env(safe-area-inset-top) + 74px));
  left: max(14px, calc(env(safe-area-inset-left) + 12px));
  width: min(210px, calc(100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right)));
  padding: 8px;
  gap: 6px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(14, 22, 31, 0.94);
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(14px);
}

.android-landscape-menu button {
  min-height: 38px;
  width: 100%;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
  color: #f8fbff;
  font: inherit;
  font-weight: 800;
  text-align: left;
}

.android-landscape-menu button:active {
  transform: translateY(1px);
}

.android-landscape-menu .control-icon {
  width: 18px;
  height: 18px;
  justify-self: center;
}

body.native-android.room-active.native-force-landscape .android-landscape-menu-button:not([hidden]),
body.native-android.room-active.native-force-landscape.android-landscape-menu-open .android-landscape-menu:not([hidden]) {
  display: grid;
}

body.native-android.room-active.android-landscape-panel-open .settings-overlay,
body.native-android.room-active.android-landscape-panel-open .rooms-overlay,
body.native-android.room-active .confirm-overlay {
  z-index: 360;
}

body.native-android.room-active.android-landscape-panel-open.mobile-menu-open .room-sidebar,
body.native-android.room-active.android-landscape-panel-open.mobile-participants-open .room-sidebar {
  display: flex !important;
  position: fixed;
  z-index: 330;
  inset: 0 auto 0 0;
  width: min(340px, calc(100vw - 28px));
  height: var(--roomdrop-visual-height, 100dvh);
  max-height: var(--roomdrop-visual-height, 100dvh);
  min-height: 0;
  transform: translateX(0) !important;
}

body.native-android.room-active.android-landscape-panel-open.mobile-menu-open .mobile-drawer-backdrop,
body.native-android.room-active.android-landscape-panel-open.mobile-participants-open .mobile-drawer-backdrop {
  display: block !important;
  z-index: 320;
}

body.native-android.room-active.android-landscape-panel-open.mobile-chat-open .chat-panel {
  display: flex !important;
  position: fixed;
  z-index: 330;
  inset: max(10px, calc(env(safe-area-inset-top) + 8px)) max(10px, calc(env(safe-area-inset-right) + 8px)) max(10px, calc(env(safe-area-inset-bottom) + 8px)) max(10px, calc(env(safe-area-inset-left) + 8px));
  width: auto;
  height: auto;
  max-height: none;
  min-height: 0;
  transform: none !important;
  border-radius: 12px;
}

@media (orientation: landscape) and (max-height: 620px) {
  body.native-android:not(.native-force-portrait).room-active .android-landscape-menu-button:not([hidden]),
  body.native-android:not(.native-force-portrait).room-active.android-landscape-menu-open .android-landscape-menu:not([hidden]) {
    display: grid;
  }
}
