:root {
  color-scheme: dark;
  --sr-navy-1000: #020d1b;
  --sr-navy-950: #031326;
  --sr-navy-900: #061d35;
  --sr-navy-850: #08243e;
  --sr-navy-800: #0b2a4a;
  --sr-ink: #f8f4eb;
  --sr-muted: #aeb9c9;
  --sr-gold: #d9aa45;
  --sr-gold-bright: #f1cb70;
  --sr-teal: #33d6b1;
  --sr-danger: #ff5c54;
  --sr-border: rgba(217, 170, 69, 0.28);
  --sr-panel: rgba(5, 24, 44, 0.82);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--sr-navy-1000);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--sr-ink);
  background:
    radial-gradient(circle at 30% 2%, rgba(28, 79, 122, 0.22), transparent 31rem),
    radial-gradient(circle at 80% 90%, rgba(12, 58, 91, 0.2), transparent 34rem),
    linear-gradient(145deg, #020d1b 0%, #04182d 48%, #020d1b 100%);
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  touch-action: manipulation;
}

.sr-skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  min-height: 44px;
  padding: 11px 16px;
  color: var(--sr-navy-950);
  background: var(--sr-gold-bright);
  border-radius: 6px;
  transform: translateY(-140%);
}

.sr-skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
}

.sr-header {
  position: relative;
  z-index: 5;
  border-bottom: 1px solid rgba(191, 211, 231, 0.16);
  background: rgba(2, 15, 29, 0.92);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(22px);
}

.sr-topbar {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px clamp(18px, 3vw, 50px);
}

.sr-brand {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  gap: 11px;
  padding: 3px 18px 3px 6px;
  color: #fffaf0;
  text-decoration: none;
  border: 1px solid rgba(235, 183, 69, 0.92);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 222, 139, 0.12), 0 8px 28px rgba(0, 0, 0, 0.18);
}

.sr-brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.sr-brand span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.12rem, 2vw, 1.46rem);
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.sr-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sr-secure-label,
.sr-return-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid rgba(190, 205, 220, 0.24);
  border-radius: 999px;
  color: #e7edf5;
  font-size: 0.88rem;
  text-decoration: none;
}

.sr-secure-label img {
  filter: brightness(0) saturate(100%) invert(77%) sepia(55%) saturate(629%) hue-rotate(356deg) brightness(101%);
}

.sr-return-link:hover {
  border-color: var(--sr-gold);
  color: var(--sr-gold-bright);
}

.sr-nav {
  display: flex;
  min-height: 48px;
  align-items: stretch;
  gap: clamp(12px, 2.5vw, 38px);
  padding: 0 clamp(20px, 4vw, 68px);
  overflow-x: auto;
  border-top: 1px solid rgba(191, 211, 231, 0.08);
  scrollbar-width: thin;
}

.sr-nav a,
.sr-nav span {
  display: inline-flex;
  min-width: max-content;
  min-height: 48px;
  align-items: center;
  gap: 6px;
  padding: 0 2px;
  color: #dbe3ed;
  font-size: 0.85rem;
  font-weight: 650;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.sr-nav a:hover {
  color: #ffffff;
}

.sr-nav .is-current {
  color: var(--sr-gold-bright);
  border-bottom-color: var(--sr-gold);
}

.sr-nav small {
  padding: 2px 5px;
  color: var(--sr-navy-950);
  background: var(--sr-gold-bright);
  border-radius: 4px;
  font-size: 0.55rem;
  letter-spacing: 0.08em;
}

.sr-main {
  width: min(100%, 1680px);
  margin: 0 auto;
  padding: clamp(20px, 2.5vw, 36px) clamp(16px, 3.2vw, 52px) clamp(32px, 5vw, 70px);
}

.sr-access-state {
  display: grid;
  min-height: calc(100vh - 180px);
  place-items: center;
}

.sr-access-card {
  width: min(100%, 560px);
  padding: clamp(28px, 5vw, 50px);
  text-align: center;
  border: 1px solid var(--sr-border);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(11, 42, 74, 0.84), rgba(4, 20, 38, 0.94)),
    rgba(5, 24, 44, 0.85);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.sr-access-mark {
  display: grid;
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  place-items: center;
  color: var(--sr-gold-bright);
  border: 1px solid rgba(239, 195, 95, 0.64);
  border-radius: 50%;
  background: rgba(5, 25, 45, 0.72);
}

.sr-access-mark img {
  filter: sepia(1) saturate(1.35) hue-rotate(355deg) brightness(1.2);
}

.sr-kicker,
.sr-panel-eyebrow {
  margin: 0 0 8px;
  color: var(--sr-gold-bright);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sr-access-card h1,
.sr-room-heading h1,
.sr-prejoin-panel h2,
.sr-room-panel h2,
.sr-room-panel h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
}

.sr-access-card h1 {
  font-size: clamp(2rem, 6vw, 3.25rem);
}

.sr-access-card > p:not(.sr-kicker) {
  max-width: 450px;
  margin: 14px auto 0;
  color: var(--sr-muted);
  line-height: 1.65;
}

.sr-loading-bars {
  display: flex;
  height: 28px;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  margin-top: 24px;
}

.sr-loading-bars span {
  width: 5px;
  border-radius: 999px;
  background: var(--sr-teal);
  animation: sr-meter-pulse 1s ease-in-out infinite;
}

.sr-loading-bars span:nth-child(1) { height: 10px; }
.sr-loading-bars span:nth-child(2) { height: 24px; animation-delay: 0.12s; }
.sr-loading-bars span:nth-child(3) { height: 16px; animation-delay: 0.24s; }

@keyframes sr-meter-pulse {
  0%, 100% { opacity: 0.35; transform: scaleY(0.62); }
  50% { opacity: 1; transform: scaleY(1); }
}

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

.sr-access-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.sr-access-actions[hidden],
[hidden] {
  display: none !important;
}

.sr-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 18px;
  border: 1px solid rgba(201, 215, 229, 0.34);
  border-radius: 8px;
  color: #f8fbff;
  background: rgba(8, 34, 58, 0.72);
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.sr-button:hover:not(:disabled) {
  border-color: rgba(239, 195, 95, 0.8);
  background: rgba(12, 48, 80, 0.9);
}

.sr-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.sr-button-primary {
  color: #241704;
  border-color: rgba(255, 224, 145, 0.96);
  background:
    linear-gradient(180deg, rgba(255, 242, 196, 0.98), rgba(221, 172, 64, 0.97));
  box-shadow: 0 8px 28px rgba(224, 170, 53, 0.22), inset 0 1px 0 #fff9dc;
}

.sr-button-primary:hover:not(:disabled) {
  color: #130d03;
  border-color: #fff0bc;
  background: linear-gradient(180deg, #fff1bd, #e9b84e);
  box-shadow: 0 12px 36px rgba(224, 170, 53, 0.34), inset 0 1px 0 #fff;
}

.sr-button-wide {
  width: 100%;
}

.sr-button-compact {
  min-width: 88px;
  padding-inline: 14px;
}

.sr-room-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 20px;
  padding: 0 4px;
}

.sr-title-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}

.sr-room-heading h1 {
  font-size: clamp(2.55rem, 4.7vw, 3.75rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.sr-beta-badge {
  padding: 8px 12px;
  color: var(--sr-gold-bright);
  border: 1px solid var(--sr-gold);
  border-radius: 6px;
  background: rgba(78, 48, 4, 0.16);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sr-room-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 12px 0 0;
  color: var(--sr-muted);
  font-size: 0.92rem;
}

.sr-lock-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--sr-teal);
  box-shadow: 0 0 0 4px rgba(51, 214, 177, 0.11);
}

.sr-date-block {
  min-width: 180px;
  padding: 2px 0 2px 28px;
  border-left: 1px solid rgba(193, 208, 223, 0.26);
}

.sr-date-block span {
  display: block;
  margin-bottom: 8px;
  color: var(--sr-muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sr-date-block strong,
.sr-date-block time {
  display: block;
}

.sr-date-block strong {
  font-size: 1rem;
}

.sr-date-block time {
  margin-top: 5px;
  color: #cdd6e2;
  font-size: 0.86rem;
}

.sr-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.sr-prejoin {
  display: block;
}

.sr-room-lobby {
  margin-bottom: 16px;
  padding: 16px 18px 18px;
  border: 1px solid rgba(187, 204, 221, 0.24);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(11, 42, 74, 0.82), rgba(3, 18, 34, 0.92)),
    var(--sr-panel);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

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

.sr-room-lobby-heading h2 {
  margin: 0;
  font-size: clamp(1.2rem, 2.2vw, 1.62rem);
}

.sr-room-capacity {
  flex: 0 0 auto;
  padding: 6px 10px;
  color: var(--sr-gold-bright);
  border: 1px solid rgba(217, 170, 69, 0.4);
  border-radius: 999px;
  background: rgba(217, 170, 69, 0.07);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sr-room-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.sr-room-card {
  display: grid;
  min-width: 0;
  min-height: 88px;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  padding: 0;
  overflow: hidden;
  color: #f3f7fb;
  text-align: left;
  border: 1px solid rgba(195, 211, 226, 0.25);
  border-radius: 8px;
  background: rgba(2, 17, 32, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
  cursor: pointer;
}

.sr-room-card:hover,
.sr-room-card:focus-visible {
  border-color: rgba(241, 203, 112, 0.74);
  background: rgba(8, 37, 64, 0.92);
}

.sr-room-card.is-selected,
.sr-room-card[aria-pressed="true"] {
  border-color: var(--sr-gold-bright);
  background: linear-gradient(135deg, rgba(34, 52, 67, 0.9), rgba(63, 43, 9, 0.42));
  box-shadow: inset 0 0 0 1px rgba(255, 227, 154, 0.16), 0 0 26px rgba(217, 170, 69, 0.1);
}

.sr-room-card-copy {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 7px;
  padding: 12px 14px;
}

.sr-room-card-copy strong,
.sr-room-card-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sr-room-card-copy strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
}

.sr-room-card-copy small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--sr-muted);
  font-size: 0.72rem;
}

.sr-room-card-copy small img {
  flex: 0 0 auto;
  filter: brightness(0) invert(1);
  opacity: 0.72;
}

.sr-room-card-create {
  grid-template-columns: 56px minmax(0, 1fr);
  border-style: dashed;
  background: rgba(4, 25, 44, 0.56);
}

.sr-room-create-icon {
  display: grid;
  width: 42px;
  height: 42px;
  align-self: center;
  justify-self: end;
  place-items: center;
  color: var(--sr-gold-bright);
  border: 1px solid rgba(217, 170, 69, 0.4);
  border-radius: 50%;
  background: rgba(217, 170, 69, 0.08);
}

.sr-room-create-icon img {
  filter: brightness(0) saturate(100%) invert(82%) sepia(43%) saturate(822%) hue-rotate(351deg) brightness(101%);
}

.sr-prejoin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.72fr);
  gap: 18px;
  align-items: stretch;
}

.sr-entry-dialog {
  width: min(760px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  box-sizing: border-box;
  padding: 20px;
  color: var(--sr-ink);
  background: var(--sr-navy-900);
  border: 1px solid rgba(195, 211, 226, 0.4);
  border-radius: 10px;
  overflow: auto;
}
.sr-entry-dialog::backdrop { background: rgba(3, 13, 24, 0.76); }
.sr-entry-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.sr-entry-heading h2 { margin: 0 0 8px; }
.sr-entry-heading p { margin: 6px 0; line-height: 1.5; }
.sr-entry-close { flex: none; min-height: 44px; min-width: 44px; }
.sr-entry-dialog .sr-prejoin-layout { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr); gap: 16px; }
.sr-entry-dialog .sr-preview-card { align-self: start; }
.sr-entry-dialog .sr-prejoin-panel { padding: 14px; }
.sr-entry-dialog .sr-preview-frame { min-height: 160px; }
.sr-entry-dialog .sr-prejoin-panel h3 { margin-top: 0; }
@media (max-width: 600px) {
  .sr-entry-dialog { padding: 14px; }
  .sr-entry-dialog .sr-prejoin-layout { grid-template-columns: minmax(0, 1fr); }
  .sr-entry-dialog .sr-preview-frame { min-height: 120px; max-height: 180px; }
}

.sr-preview-card,
.sr-prejoin-panel,
.sr-stage-shell,
.sr-room-panel {
  overflow: hidden;
  border: 1px solid rgba(187, 204, 221, 0.26);
  border-radius: 10px;
  background: var(--sr-panel);
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.sr-preview-card {
  display: grid;
  grid-template-rows: minmax(410px, 1fr) auto;
}

.sr-preview-frame {
  position: relative;
  display: grid;
  min-height: 410px;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 30%, rgba(23, 76, 116, 0.72), transparent 52%),
    linear-gradient(145deg, #071d34, #03111f);
}

.sr-preview-frame::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.52));
}

.sr-preview-frame video {
  width: 100%;
  height: 100%;
  min-height: 410px;
  object-fit: cover;
  transform: scaleX(-1);
}

.sr-camera-placeholder {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 9px;
  max-width: 360px;
  padding: 24px;
  color: var(--sr-muted);
  text-align: center;
}

.sr-camera-placeholder strong {
  color: #f5f8fc;
  font-size: 1.05rem;
}

.sr-avatar {
  display: grid;
  width: 84px;
  height: 84px;
  margin-bottom: 5px;
  place-items: center;
  color: #201504;
  border: 2px solid rgba(255, 232, 171, 0.72);
  border-radius: 50%;
  background: linear-gradient(145deg, #f2d37b, #be8525);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.3);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 800;
}

.sr-preview-name {
  position: absolute;
  z-index: 2;
  bottom: 16px;
  left: 16px;
  max-width: calc(100% - 32px);
  overflow: hidden;
  padding: 8px 12px;
  color: #fff;
  border: 1px solid rgba(215, 227, 239, 0.22);
  border-radius: 7px;
  background: rgba(1, 14, 27, 0.82);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sr-prejoin-safety {
  display: grid;
  gap: 4px;
  padding: 17px 20px;
  border-top: 1px solid rgba(191, 211, 231, 0.14);
  background: rgba(3, 16, 30, 0.74);
}

.sr-prejoin-safety strong {
  color: #f8f4eb;
}

.sr-prejoin-safety span {
  color: var(--sr-muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.sr-prejoin-panel,
.sr-room-panel {
  padding: clamp(20px, 2.5vw, 30px);
}

.sr-prejoin-panel h2,
.sr-room-panel h2 {
  margin-bottom: 22px;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
}

.sr-field {
  display: grid;
  gap: 7px;
}

.sr-field > span {
  color: #cdd6e2;
  font-size: 0.83rem;
  font-weight: 700;
}

.sr-field input,
.sr-field select,
.sr-nickname-form input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  color: #f8fbff;
  border: 1px solid rgba(194, 210, 225, 0.28);
  border-radius: 7px;
  background: rgba(2, 17, 32, 0.82);
}

.sr-field input:focus,
.sr-field select:focus,
.sr-nickname-form input:focus {
  border-color: var(--sr-gold-bright);
}

.sr-field select:disabled {
  color: #8794a5;
  opacity: 0.8;
}

.sr-field-help,
.sr-status {
  margin: 7px 0 0;
  color: var(--sr-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.sr-device-selects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 19px 0 16px;
}

.sr-device-selects .sr-field:last-child {
  grid-column: 1 / -1;
}

.sr-meter-row {
  display: grid;
  grid-template-columns: auto minmax(110px, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  color: #cdd6e2;
  font-size: 0.8rem;
}

.sr-meter {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  height: 22px;
  align-items: end;
}

.sr-meter span {
  height: 8px;
  border-radius: 4px;
  background: rgba(178, 194, 208, 0.26);
  transition: height 90ms linear, background 90ms linear;
}

.sr-meter span.is-active {
  height: 18px;
  background: var(--sr-teal);
}

.sr-join-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 15px 0;
}

.sr-option-toggle {
  display: grid;
  min-height: 68px;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 10px;
  color: #eef4fa;
  text-align: left;
  border: 1px solid rgba(193, 209, 224, 0.25);
  border-radius: 8px;
  background: rgba(3, 18, 34, 0.68);
  cursor: pointer;
}

.sr-option-toggle[aria-pressed="true"] {
  border-color: rgba(51, 214, 177, 0.72);
  background: rgba(17, 86, 76, 0.28);
}

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

.sr-option-toggle span:last-child {
  display: grid;
  gap: 3px;
}

.sr-option-toggle strong,
.sr-option-toggle small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sr-option-toggle small {
  color: var(--sr-muted);
  font-size: 0.69rem;
}

.sr-join-button {
  min-height: 50px;
  margin-top: 4px;
}

.sr-status.is-error {
  color: #ffaaa5;
}

.sr-status.is-ok {
  color: #7df0d2;
}

.sr-live-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.34fr);
  align-items: stretch;
}

.sr-live-room {
  padding-bottom: 0;
}

.sr-stage-shell {
  position: relative;
  min-width: 0;
  border-radius: 10px 0 0 10px;
}

.sr-stage-header {
  display: grid;
  min-height: 66px;
  grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr);
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(190, 208, 224, 0.15);
  background: rgba(2, 16, 31, 0.74);
}

.sr-stage-presence {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sr-room-selector-chip {
  display: grid;
  min-width: 190px;
  min-height: 46px;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  color: #f5f8fc;
  text-align: left;
  border: 1px solid rgba(217, 170, 69, 0.62);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(13, 49, 80, 0.88), rgba(3, 20, 37, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 236, 186, 0.08), 0 8px 24px rgba(0, 0, 0, 0.18);
  cursor: pointer;
}

.sr-room-selector-chip:hover {
  border-color: var(--sr-gold-bright);
  background: linear-gradient(145deg, rgba(17, 61, 98, 0.92), rgba(5, 27, 48, 0.94));
}

.sr-room-selector-chip > img {
  filter: brightness(0) saturate(100%) invert(82%) sepia(43%) saturate(822%) hue-rotate(351deg) brightness(101%);
}

.sr-room-selector-chip > span {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.sr-room-selector-chip small,
.sr-room-selector-chip strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sr-room-selector-chip small {
  color: var(--sr-muted);
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sr-room-selector-chip strong {
  color: var(--sr-gold-bright);
  font-size: 0.8rem;
}

.sr-room-selector-menu {
  position: absolute;
  z-index: 20;
  top: 58px;
  left: 50%;
  display: grid;
  width: min(calc(100% - 28px), 330px);
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(217, 170, 69, 0.48);
  border-radius: 9px;
  background: rgba(2, 17, 32, 0.98);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.48);
  transform: translateX(-50%);
}

.sr-room-selector-menu[hidden] {
  display: none;
}

.sr-room-selector-menu button {
  min-height: 42px;
  padding: 9px 11px;
  color: #edf3f9;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.sr-room-selector-menu button:hover,
.sr-room-selector-menu button[aria-selected="true"] {
  color: var(--sr-gold-bright);
  border-color: rgba(217, 170, 69, 0.3);
  background: rgba(217, 170, 69, 0.08);
}

.sr-live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  color: #9ef7df;
  border: 1px solid rgba(51, 214, 177, 0.28);
  border-radius: 999px;
  background: rgba(51, 214, 177, 0.08);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sr-live-indicator i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sr-teal);
  box-shadow: 0 0 0 4px rgba(51, 214, 177, 0.12);
}

.sr-focus-clock {
  display: grid !important;
  justify-self: end;
  justify-items: end;
  gap: 2px !important;
}

.sr-focus-clock span {
  color: var(--sr-muted);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sr-focus-clock strong {
  color: var(--sr-gold-bright);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}

.sr-participant-grid {
  display: grid;
  min-height: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: auto;
  align-content: start;
  gap: 8px;
  padding: 8px;
  background: #020d19;
}

.sr-participant-grid[data-count="1"] {
  grid-template-columns: minmax(0, 1fr);
}

.sr-participant-tile {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 16 / 9;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(202, 215, 229, 0.22);
  border-radius: 7px;
  background:
    radial-gradient(circle at 50% 32%, rgba(25, 78, 116, 0.56), transparent 53%),
    #071b30;
}

.sr-participant-tile.is-speaking {
  border-color: rgba(51, 214, 177, 0.94);
  box-shadow: inset 0 0 0 2px rgba(51, 214, 177, 0.28);
}

.sr-participant-tile > video,
.sr-participant-tile > img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sr-participant-tile.is-self video {
  transform: scaleX(-1);
}

.sr-tile-placeholder {
  display: grid;
  justify-items: center;
  gap: 9px;
  color: var(--sr-muted);
}

/* Keep the video in layout for LiveKit adaptive streaming while recovery copy
   covers it. Hiding the media element would pause the stream we need to resume. */
.sr-tile-placeholder[data-sr-video-fallback="true"] {
  position: absolute;
  z-index: 1;
  inset: 0;
  align-content: center;
  padding: 16px;
  text-align: center;
  background: #071b30;
}

.sr-tile-placeholder[data-sr-video-fallback="true"][hidden] {
  display: none;
}

.sr-tile-placeholder .sr-avatar {
  width: 72px;
  height: 72px;
  font-size: 1.72rem;
}

.sr-tile-meta {
  position: absolute;
  z-index: 2;
  right: 10px;
  bottom: 10px;
  left: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}

.sr-tile-name,
.sr-tile-media-state {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 6px 10px;
  overflow: hidden;
  color: #fff;
  border: 1px solid rgba(209, 222, 235, 0.2);
  border-radius: 6px;
  background: rgba(1, 13, 25, 0.82);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sr-tile-name {
  max-width: calc(100% - 52px);
}

.sr-tile-media-state {
  width: 32px;
  justify-content: center;
  padding: 6px;
  color: #5ce2c2;
  font-weight: 800;
}

.sr-tile-media-state img,
.sr-person-actions img {
  filter: brightness(0) invert(1);
}

.sr-tile-media-state.is-muted {
  color: #ff8e88;
  border-color: rgba(255, 91, 82, 0.42);
  background: rgba(86, 13, 21, 0.84);
}

.sr-room-panel {
  min-width: 0;
  max-height: none;
  overflow-y: auto;
  border-left: 0;
  border-radius: 0 10px 10px 0;
}

.sr-panel-section + .sr-panel-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(195, 210, 224, 0.19);
}

.sr-room-panel h2 {
  margin-bottom: 14px;
  font-size: 1.28rem;
}

.sr-room-panel h3 {
  margin-bottom: 10px;
  font-size: 1.06rem;
}

.sr-nickname-form > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 7px;
}

.sr-health-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.sr-health-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.sr-health-list dt {
  color: var(--sr-muted);
  font-size: 0.82rem;
}

.sr-health-list dd {
  margin: 0;
  color: var(--sr-teal);
  font-size: 0.82rem;
  font-weight: 750;
}

.sr-live-media-status {
  margin: 13px 0 0;
  padding: 11px 12px;
  color: #d9e6f1;
  border: 1px solid rgba(217, 170, 69, 0.3);
  border-radius: 7px;
  background: rgba(217, 170, 69, 0.08);
  font-size: 0.79rem;
  line-height: 1.45;
}

.sr-live-media-status.is-on {
  color: #a5f4df;
  border-color: rgba(51, 214, 177, 0.38);
  background: rgba(51, 214, 177, 0.09);
}

.sr-backdrop-enforcement {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 11px;
  color: #dce7f0;
  border: 1px solid rgba(217, 170, 69, 0.28);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(217, 170, 69, 0.08), rgba(5, 28, 49, 0.72));
}

.sr-backdrop-enforcement-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(217, 170, 69, 0.42);
  border-radius: 50%;
  background: rgba(217, 170, 69, 0.09);
}

.sr-backdrop-enforcement-icon img {
  filter: brightness(0) saturate(100%) invert(82%) sepia(43%) saturate(822%) hue-rotate(351deg) brightness(101%);
}

.sr-backdrop-enforcement > span:last-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.sr-backdrop-enforcement strong {
  color: var(--sr-gold-bright);
  font-size: 0.78rem;
}

.sr-backdrop-enforcement small {
  color: var(--sr-muted);
  font-size: 0.69rem;
  line-height: 1.35;
}

.sr-backdrop-enforcement[data-backdrop-state="ready"] {
  border-color: rgba(51, 214, 177, 0.4);
  background: rgba(51, 214, 177, 0.08);
}

.sr-backdrop-enforcement[data-backdrop-state="ready"] strong {
  color: #9ef7df;
}

.sr-backdrop-enforcement[data-backdrop-state="off"] {
  border-color: rgba(184, 199, 214, 0.24);
  background: rgba(5, 24, 42, 0.7);
}

.sr-backdrop-enforcement[data-backdrop-state="off"] strong {
  color: #dbe5ee;
}

.sr-text-button {
  min-height: 44px;
  margin-top: 10px;
  padding: 8px 0;
  color: var(--sr-gold-bright);
  border: 0;
  background: none;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.sr-device-drawer {
  display: grid;
  max-height: 330px;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  overflow-y: auto;
  border: 1px solid rgba(192, 208, 224, 0.18);
  border-radius: 8px;
  background: rgba(1, 14, 28, 0.58);
}

.sr-device-drawer[hidden] {
  display: none;
}

.sr-section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sr-section-title-row span {
  display: grid;
  min-width: 28px;
  height: 28px;
  place-items: center;
  color: var(--sr-gold-bright);
  border: 1px solid rgba(217, 170, 69, 0.4);
  border-radius: 999px;
  font-size: 0.76rem;
}

.sr-people-list {
  display: grid;
  gap: 8px;
}

.sr-person-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 7px 0;
}

.sr-person-name {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.sr-person-name i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--sr-teal);
}

.sr-person-name span {
  overflow: hidden;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sr-person-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 5px;
}

.sr-person-actions button {
  display: inline-grid;
  width: 34px;
  min-height: 34px;
  padding: 6px;
  place-items: center;
  color: #edf3f9;
  border: 1px solid rgba(195, 211, 226, 0.28);
  border-radius: 6px;
  background: rgba(3, 19, 35, 0.72);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
}

.sr-person-actions button:hover:not(:disabled) {
  border-color: var(--sr-gold);
}

.sr-person-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.sr-person-volume {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding-left: 19px;
  color: var(--sr-muted);
  font-size: 0.7rem;
}

.sr-person-volume input {
  width: 100%;
}

.sr-control-dock {
  display: flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 18px auto 0;
  padding: 8px;
  border: 1px solid rgba(195, 211, 226, 0.22);
  border-radius: 18px;
  background: rgba(2, 17, 31, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055), 0 18px 38px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
}

.sr-control-dock button {
  position: relative;
  display: inline-grid;
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  place-items: center;
  padding: 0;
  color: #f3f7fb;
  border: 1px solid rgba(200, 215, 229, 0.28);
  border-radius: 13px;
  background: rgba(7, 29, 50, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
  font-weight: 750;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.sr-control-dock button img {
  width: 21px;
  height: 21px;
  padding: 0;
  filter: brightness(0) invert(1);
}

.sr-control-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.sr-control-dock button::after {
  position: absolute;
  z-index: 4;
  bottom: calc(100% + 9px);
  left: 50%;
  width: max-content;
  max-width: 210px;
  padding: 6px 8px;
  color: #f8fbff;
  border: 1px solid rgba(200, 215, 229, 0.24);
  border-radius: 7px;
  background: rgba(1, 13, 25, 0.97);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  content: attr(aria-label);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.25;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.sr-control-dock button:hover:not(:disabled),
.sr-control-dock button:focus-visible {
  border-color: rgba(241, 203, 112, 0.82);
  background: rgba(13, 47, 75, 0.98);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 24px rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
}

.sr-control-dock button:hover::after,
.sr-control-dock button:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.sr-control-dock button:focus-visible {
  outline: 2px solid #f6cf71;
  outline-offset: 2px;
}

.sr-control-dock button:disabled {
  cursor: wait;
  opacity: 0.48;
  transform: none;
}

.sr-control-dock #sr-toggle-microphone[aria-pressed="false"],
.sr-control-dock #sr-toggle-camera[aria-pressed="false"] {
  border-color: rgba(255, 116, 108, 0.42);
  background: rgba(73, 22, 29, 0.82);
}

.sr-control-dock #sr-toggle-microphone[aria-pressed="true"],
.sr-control-dock #sr-toggle-camera[aria-pressed="true"] {
  color: #06291f;
  border-color: #62dfbf;
  background: #62dfbf;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 0 0 3px rgba(51, 214, 177, 0.08);
}

.sr-control-dock #sr-toggle-microphone[aria-pressed="true"] img,
.sr-control-dock #sr-toggle-camera[aria-pressed="true"] img {
  filter: brightness(0) saturate(100%) invert(12%) sepia(13%) saturate(1765%) hue-rotate(114deg) brightness(93%);
}

.sr-control-dock #sr-toggle-backdrop[aria-pressed="true"] {
  color: #241805;
  border-color: #efc968;
  background: linear-gradient(180deg, #f6d77e, #d7a43d);
  box-shadow: inset 0 1px 0 rgba(255, 250, 225, 0.65), 0 0 0 3px rgba(217, 170, 69, 0.08);
}

.sr-control-dock #sr-toggle-backdrop[aria-pressed="true"] img {
  filter: brightness(0) saturate(100%) invert(12%) sepia(43%) saturate(972%) hue-rotate(355deg) brightness(88%);
}

.sr-control-dock button.is-leave {
  margin-left: 2px;
  color: #fff;
  border-color: rgba(255, 116, 108, 0.72);
  background: rgba(139, 39, 42, 0.9);
}

.sr-control-dock button.is-leave:hover {
  border-color: #ff8179;
  background: #b93d3d;
}

@media (min-width: 1081px) and (min-height: 620px) {
  .sr-main:has(.sr-live-room:not([hidden])) {
    padding-bottom: 18px;
  }

  .sr-live-room:not([hidden]) {
    display: grid;
    height: calc(100vh - 270px);
    min-height: 440px;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .sr-live-layout {
    min-height: 0;
  }

  .sr-stage-shell {
    display: grid;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .sr-participant-grid {
    min-height: 0;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(0, 1fr);
    align-content: stretch;
    overflow: hidden;
  }

  .sr-participant-tile {
    height: 100%;
    aspect-ratio: auto;
  }

  .sr-room-panel {
    max-height: 100%;
  }

  .sr-control-dock {
    margin-top: 12px;
  }
}

.sr-audio-prompt {
  position: fixed;
  z-index: 50;
  right: 20px;
  bottom: 96px;
  min-height: 48px;
  padding: 11px 18px;
  color: #1c1202;
  border: 1px solid #ffe5a2;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe9aa, #d8a43b);
  box-shadow: 0 12px 42px rgba(0, 0, 0, 0.4);
  font-weight: 800;
  cursor: pointer;
}

.sr-toast {
  position: fixed;
  z-index: 60;
  right: 20px;
  bottom: 96px;
  width: min(calc(100vw - 40px), 390px);
  padding: 13px 16px;
  color: #edf5fb;
  border: 1px solid rgba(197, 213, 228, 0.3);
  border-radius: 8px;
  background: rgba(2, 17, 31, 0.96);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.42);
  font-size: 0.84rem;
  line-height: 1.5;
}

.sr-audio-bin {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  pointer-events: none;
}

@media (max-width: 1080px) {
  .sr-prejoin-layout,
  .sr-live-layout {
    grid-template-columns: 1fr;
  }

  .sr-preview-card {
    grid-template-rows: minmax(360px, 55vh) auto;
  }

  .sr-preview-frame,
  .sr-preview-frame video {
    min-height: 360px;
  }

  .sr-stage-shell {
    border-radius: 10px 10px 0 0;
  }

  .sr-room-panel {
    max-height: none;
    border-top: 0;
    border-left: 1px solid rgba(187, 204, 221, 0.26);
    border-radius: 0 0 10px 10px;
  }

  .sr-room-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
  }

  .sr-panel-section + .sr-panel-section {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .sr-people-section {
    grid-column: 1 / -1;
    padding-top: 20px !important;
    border-top: 1px solid rgba(195, 210, 224, 0.19) !important;
  }
}

@media (max-width: 760px) {
  .sr-topbar {
    min-height: 70px;
    padding: 10px 14px;
  }

  .sr-brand {
    padding-right: 10px;
  }

  .sr-brand span {
    font-size: 0.88rem;
    letter-spacing: 0.07em;
  }

  .sr-brand img {
    width: 36px;
    height: 36px;
  }

  .sr-secure-label {
    display: none;
  }

  .sr-return-link {
    padding-inline: 10px;
    font-size: 0.75rem;
  }

  .sr-nav {
    padding-inline: 14px;
  }

  .sr-room-heading {
    display: block;
  }

  .sr-room-lobby {
    padding: 14px;
  }

  .sr-room-card {
    grid-template-columns: 106px minmax(0, 1fr);
  }

  .sr-room-card-create {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .sr-date-block {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    padding: 12px 0 0;
    border-top: 1px solid rgba(193, 208, 223, 0.2);
    border-left: 0;
  }

  .sr-date-block span,
  .sr-date-block time {
    margin: 0;
  }

  .sr-room-note {
    align-items: flex-start;
    line-height: 1.45;
  }

  .sr-device-selects,
  .sr-join-options,
  .sr-room-panel {
    grid-template-columns: 1fr;
  }

  .sr-device-selects .sr-field:last-child,
  .sr-people-section {
    grid-column: auto;
  }

  .sr-panel-section + .sr-panel-section,
  .sr-people-section {
    padding-top: 20px !important;
    border-top: 1px solid rgba(195, 210, 224, 0.19) !important;
  }

  .sr-participant-grid {
    min-height: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: auto;
  }

  .sr-control-dock {
    width: fit-content;
    max-width: 100%;
    gap: 6px;
    margin-top: 14px;
    padding: 7px;
  }

  .sr-control-dock button {
    width: 46px;
    min-width: 46px;
    height: 46px;
    min-height: 46px;
  }

  .sr-control-dock button img {
    width: 20px;
    height: 20px;
    padding: 0;
  }

  .sr-stage-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .sr-room-selector-chip {
    width: 100%;
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .sr-room-selector-menu {
    top: 112px;
  }
}

@media (max-width: 480px) {
  .sr-main {
    padding-inline: 10px;
  }

  .sr-brand span {
    display: none;
  }

  .sr-title-line {
    gap: 10px;
  }

  .sr-room-heading h1 {
    font-size: 2.55rem;
  }

  .sr-beta-badge {
    padding: 6px 8px;
    font-size: 0.63rem;
  }

  .sr-preview-card {
    grid-template-rows: minmax(290px, 48vh) auto;
  }

  .sr-preview-frame,
  .sr-preview-frame video {
    min-height: 290px;
  }

  .sr-prejoin-panel,
  .sr-room-panel {
    padding: 18px 14px;
  }

  .sr-stage-header {
    padding-inline: 12px;
  }

  .sr-stage-presence {
    display: grid;
    gap: 5px;
  }

  .sr-room-lobby-heading {
    align-items: start;
  }

  .sr-room-card-grid {
    grid-template-columns: 1fr;
  }

  .sr-room-card {
    min-height: 82px;
    grid-template-columns: minmax(0, 1fr);
  }

  .sr-room-card-create {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .sr-person-row {
    grid-template-columns: 1fr;
  }

  .sr-person-actions {
    justify-content: start;
    padding-left: 19px;
  }

  .sr-nickname-form > div {
    grid-template-columns: 1fr;
  }

  .sr-button-compact {
    width: 100%;
  }
}

@media (max-width: 390px) {
  .sr-participant-grid {
    grid-template-columns: 1fr;
  }

  .sr-control-dock button {
    width: 43px;
    min-width: 43px;
    height: 43px;
    min-height: 43px;
  }

  .sr-control-dock button img {
    width: 19px;
    height: 19px;
    padding: 0;
  }
}

/* Adaptive Study Room stage: square cameras, stable presentation rail, and a
   compact meeting shell that keeps the media canvas dominant at every size. */
.sr-stage-tools {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.sr-layout-button {
  display: inline-flex;
  min-width: 92px;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  color: #f3f7fb;
  border: 1px solid rgba(200, 215, 229, 0.3);
  border-radius: 8px;
  background: rgba(5, 28, 49, 0.9);
  cursor: pointer;
}

.sr-layout-button:hover,
.sr-layout-button[aria-expanded="true"] {
  color: var(--sr-gold-bright);
  border-color: rgba(241, 203, 112, 0.78);
  background: rgba(12, 47, 76, 0.96);
}

.sr-layout-button img {
  filter: brightness(0) invert(1);
}

.sr-layout-menu {
  position: absolute;
  z-index: 26;
  top: 60px;
  left: 50%;
  display: grid;
  width: min(calc(100% - 24px), 310px);
  gap: 6px;
  padding: 10px;
  color: #edf4fb;
  border: 1px solid rgba(217, 170, 69, 0.48);
  border-radius: 10px;
  background: rgba(2, 17, 32, 0.985);
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.52);
  transform: translateX(-12%);
}

.sr-layout-menu[hidden] {
  display: none;
}

.sr-layout-menu > p {
  margin: 2px 6px 4px;
  color: var(--sr-gold-bright);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sr-layout-menu > button {
  display: grid;
  min-height: 48px;
  gap: 2px;
  padding: 8px 10px;
  color: #f3f7fb;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
}

.sr-layout-menu > button span {
  color: var(--sr-muted);
  font-size: 0.69rem;
}

.sr-layout-menu > button:hover,
.sr-layout-menu > button[aria-checked="true"] {
  color: var(--sr-gold-bright);
  border-color: rgba(217, 170, 69, 0.34);
  background: rgba(217, 170, 69, 0.09);
}

.sr-layout-menu > label {
  display: grid;
  gap: 8px;
  margin-top: 3px;
  padding: 10px 7px 4px;
  border-top: 1px solid rgba(199, 214, 228, 0.16);
  font-size: 0.72rem;
}

.sr-layout-menu > label > span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--sr-muted);
}

.sr-layout-menu output {
  color: var(--sr-gold-bright);
  font-variant-numeric: tabular-nums;
}

.sr-layout-menu input {
  width: 100%;
  accent-color: var(--sr-gold);
}

body.sr-in-call {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

body.sr-in-call .sr-header,
body.sr-in-call .sr-room-heading {
  display: none;
}

body.sr-in-call .sr-main,
body.sr-in-call .sr-experience {
  width: 100%;
  max-width: none;
  height: 100dvh;
  min-height: 0;
  margin: 0;
  padding: 0;
}

body.sr-in-call .sr-live-room:not([hidden]) {
  display: grid;
  width: 100%;
  height: 100dvh;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: 0 10px 8px;
}

body.sr-in-call .sr-live-layout {
  position: relative;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  overflow: hidden;
}

body.sr-in-call .sr-stage-shell {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(194, 210, 225, 0.18);
  border-radius: 10px;
  background: #020d19;
}

body.sr-in-call .sr-participant-grid {
  flex: 1 1 auto;
}

body.sr-in-call .sr-live-layout:not(:has(.sr-room-panel[hidden])) .sr-stage-shell {
  border-radius: 10px 0 0 10px;
}

body.sr-in-call .sr-control-dock {
  margin: 8px auto 0;
}

.sr-participant-grid {
  --sr-grid-columns: 2;
  --sr-tile-size: 260px;
  --sr-companion-size: 180px;
  --sr-presentation-size: 78;
  width: 100%;
  height: 100%;
  min-height: 0;
  grid-template-columns: repeat(var(--sr-grid-columns), var(--sr-tile-size));
  grid-auto-rows: var(--sr-tile-size);
  place-content: center;
  align-content: center;
  justify-content: center;
  gap: 10px;
  padding: 10px;
  overflow: hidden;
}

body.sr-in-call .sr-participant-grid[data-layout-mode="auto"]:not([data-presenting="true"]),
body.sr-in-call .sr-participant-grid[data-layout-mode="tiled"] {
  grid-template-columns: repeat(var(--sr-grid-columns), var(--sr-tile-size));
  grid-template-rows: none;
  grid-auto-rows: var(--sr-tile-size);
}

.sr-participant-tile.is-camera {
  width: var(--sr-tile-size);
  height: var(--sr-tile-size);
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1 / 1;
}

.sr-participant-tile.is-self.is-camera video {
  transform: scaleX(-1);
}

.sr-participant-tile.is-self.is-screen-share video {
  transform: none;
}

.sr-participant-grid[data-presenting="true"]:is([data-layout-mode="auto"], [data-layout-mode="spotlight"]) {
  grid-template-columns: minmax(0, 1fr) var(--sr-companion-size);
  grid-template-rows: repeat(2, var(--sr-companion-size));
  place-content: center stretch;
}

.sr-participant-grid[data-presenting="true"]:is([data-layout-mode="auto"], [data-layout-mode="spotlight"]) .sr-participant-tile.is-presentation {
  width: 100%;
  height: 100%;
  grid-column: 1;
  grid-row: 1 / 3;
  aspect-ratio: auto;
}

.sr-participant-grid[data-presenting="true"][data-layout-mode="auto"] .sr-participant-tile.is-companion {
  width: var(--sr-companion-size);
  height: var(--sr-companion-size);
  grid-column: 2;
  aspect-ratio: 1 / 1;
}

.sr-participant-grid[data-presenting="true"][data-layout-mode="auto"] .sr-participant-tile.is-companion:nth-of-type(2) {
  grid-row: 1;
}

.sr-participant-grid[data-presenting="true"][data-layout-mode="auto"] .sr-participant-tile.is-companion:nth-of-type(3) {
  grid-row: 2;
}

.sr-participant-grid[data-presenting="true"][data-layout-mode="auto"] .sr-participant-tile:not(.is-presentation):not(.is-companion),
.sr-participant-grid[data-layout-mode="spotlight"] .sr-participant-tile:not(:first-child) {
  display: none;
}

.sr-participant-grid[data-layout-mode="spotlight"] {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.sr-participant-grid[data-layout-mode="spotlight"] .sr-participant-tile:first-child {
  display: grid;
  width: 100%;
  height: 100%;
  grid-column: 1;
  grid-row: 1;
  aspect-ratio: auto;
}

.sr-participant-grid[data-layout-mode="tiled"] {
  grid-template-columns: repeat(var(--sr-grid-columns), var(--sr-tile-size));
  grid-auto-rows: var(--sr-tile-size);
}

.sr-participant-grid[data-layout-mode="tiled"] .sr-participant-tile {
  width: var(--sr-tile-size);
  height: var(--sr-tile-size);
  aspect-ratio: 1 / 1;
}

.sr-participant-tile.is-screen-share > video,
.sr-participant-tile.is-screen-share > img {
  object-fit: contain;
  background: #010912;
}

@media (max-width: 1080px) {
  body.sr-in-call .sr-live-layout {
    display: block;
  }

  body.sr-in-call .sr-stage-shell {
    width: 100%;
    height: 100%;
    border-radius: 10px;
  }

  body.sr-in-call .sr-room-panel:not([hidden]) {
    position: absolute;
    z-index: 32;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    width: min(92vw, 380px);
    max-height: none;
    border: 1px solid rgba(217, 170, 69, 0.36);
    border-radius: 10px 0 0 10px;
    background: rgba(2, 17, 32, 0.985);
    box-shadow: -24px 0 60px rgba(0, 0, 0, 0.48);
  }
}

@media (max-width: 720px), (max-aspect-ratio: 108 / 100) {
  .sr-participant-grid[data-presenting="true"][data-layout-mode="auto"] {
    grid-template-columns: repeat(2, var(--sr-companion-size));
    grid-template-rows: minmax(0, 1fr) var(--sr-companion-size);
    justify-content: center;
  }

  .sr-participant-grid[data-presenting="true"][data-layout-mode="auto"] .sr-participant-tile.is-presentation {
    grid-column: 1 / 3;
    grid-row: 1;
  }

  .sr-participant-grid[data-presenting="true"][data-layout-mode="auto"] .sr-participant-tile.is-companion:nth-of-type(2) {
    grid-column: 1;
    grid-row: 2;
  }

  .sr-participant-grid[data-presenting="true"][data-layout-mode="auto"] .sr-participant-tile.is-companion:nth-of-type(3) {
    grid-column: 2;
    grid-row: 2;
  }

  .sr-stage-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding-inline: 10px;
  }

  .sr-stage-presence strong,
  .sr-focus-clock span,
  .sr-room-selector-chip small,
  .sr-layout-button span {
    display: none;
  }

  .sr-stage-tools {
    justify-self: end;
  }

  .sr-room-selector-chip,
  .sr-layout-button {
    min-width: 46px;
    width: 46px;
    padding: 0;
  }

  .sr-room-selector-chip {
    display: inline-grid;
    grid-template-columns: 1fr;
    place-items: center;
  }

  .sr-room-selector-chip > span {
    display: none;
  }

  .sr-focus-clock {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: center;
  }

  .sr-layout-menu {
    top: 104px;
    right: 8px;
    left: auto;
    transform: none;
  }
}

@media (max-height: 600px) {
  .sr-stage-header {
    min-height: 52px;
    padding-block: 4px;
  }

  .sr-live-indicator,
  .sr-focus-clock span,
  .sr-room-selector-chip small {
    display: none;
  }

  .sr-room-selector-chip,
  .sr-layout-button {
    min-height: 42px;
  }

  body.sr-in-call .sr-control-dock {
    gap: 5px;
    margin-top: 5px;
    padding: 5px;
  }

  body.sr-in-call .sr-control-dock button {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    border-radius: 11px;
  }
}

@media (max-width: 1080px), (min-width: 1081px) and (max-height: 619px) {
  body.sr-in-call .sr-live-room:not([hidden]) {
    padding-bottom: calc(102px + env(safe-area-inset-bottom, 0px));
  }

  .sr-control-dock {
    position: fixed;
    z-index: 45;
    right: 10px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 10px;
    width: auto;
    max-width: 520px;
    margin: 0 auto;
    padding: 8px 10px;
  }
}

/* Study Room launch: Meet-familiar interaction model in the Due Diligence system. */
.sr-room-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sr-room-card-closed {
  grid-template-columns: 56px minmax(0, 1fr);
  border-style: dashed;
  background: rgba(4, 25, 44, 0.56);
}

.sr-room-card.is-restricted {
  cursor: not-allowed;
  opacity: 0.58;
}

.sr-field.is-room-muted {
  opacity: 0.72;
}

.sr-live-layout:has(.sr-room-panel[hidden]) {
  grid-template-columns: minmax(0, 1fr);
}

.sr-room-panel[hidden],
.sr-panel-view[hidden] {
  display: none !important;
}

.sr-room-panel {
  display: flex;
  width: min(360px, 34vw);
  padding: 0;
  flex-direction: column;
  overflow: hidden;
}

.sr-panel-header {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(195, 210, 224, 0.14);
}

.sr-panel-header h2,
.sr-room-panel .sr-panel-header h2 {
  margin: 2px 0 0;
  font-size: 1.35rem;
}

.sr-icon-button {
  position: relative;
  display: inline-grid;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  place-items: center;
  padding: 0;
  color: #f4f7fb;
  border: 1px solid rgba(197, 212, 226, 0.26);
  border-radius: 10px;
  background: rgba(4, 25, 44, 0.78);
  cursor: pointer;
}

.sr-icon-button:hover,
.sr-icon-button:focus-visible {
  border-color: var(--sr-gold-bright);
  background: rgba(14, 50, 80, 0.92);
}

.sr-icon-button img {
  filter: brightness(0) invert(1);
}

.sr-panel-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(195, 210, 224, 0.14);
  background: rgba(2, 17, 32, 0.54);
}

.sr-panel-tabs button {
  position: relative;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 6px;
  color: var(--sr-muted);
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font-size: 0.72rem;
  font-weight: 750;
  cursor: pointer;
}

.sr-panel-tabs button img {
  filter: brightness(0) invert(1);
  opacity: 0.76;
}

.sr-panel-tabs button[aria-selected="true"] {
  color: var(--sr-gold-bright);
  border-color: rgba(217, 170, 69, 0.35);
  background: rgba(217, 170, 69, 0.09);
}

.sr-panel-view {
  min-height: 0;
  padding: 16px;
  overflow-y: auto;
}

.sr-people-section,
.sr-settings-panel {
  flex: 1 1 auto;
}

.sr-chat-panel {
  display: grid;
  min-height: 0;
  flex: 1 1 auto;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  overflow: hidden;
}

.sr-chat-intro {
  display: grid;
  gap: 4px;
  padding: 10px 11px;
  color: #eaf0f6;
  border: 1px solid rgba(217, 170, 69, 0.22);
  border-radius: 8px;
  background: rgba(217, 170, 69, 0.06);
  font-size: 0.78rem;
}

.sr-chat-intro span {
  color: var(--sr-muted);
  font-size: 0.69rem;
  line-height: 1.4;
}

.sr-chat-list {
  display: grid;
  min-height: 180px;
  align-content: end;
  gap: 10px;
  overflow-y: auto;
}

.sr-chat-message {
  display: grid;
  gap: 5px;
  padding: 10px 11px;
  border: 1px solid rgba(194, 210, 225, 0.18);
  border-radius: 10px 10px 10px 3px;
  background: rgba(8, 34, 57, 0.84);
}

.sr-chat-message.is-local {
  border-color: rgba(217, 170, 69, 0.32);
  border-radius: 10px 10px 3px 10px;
  background: rgba(80, 57, 14, 0.35);
}

.sr-chat-message header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sr-chat-message strong {
  color: var(--sr-gold-bright);
  font-size: 0.72rem;
}

.sr-chat-message time {
  color: var(--sr-muted);
  font-size: 0.63rem;
}

.sr-chat-message p {
  margin: 0;
  color: #edf3f9;
  font-size: 0.79rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.sr-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: end;
  gap: 8px;
}

.sr-chat-form textarea {
  width: 100%;
  min-height: 52px;
  max-height: 128px;
  padding: 10px 11px;
  resize: vertical;
  color: #f7f9fc;
  border: 1px solid rgba(194, 210, 225, 0.28);
  border-radius: 9px;
  background: rgba(2, 17, 32, 0.88);
  font: inherit;
  font-size: 0.8rem;
}

.sr-settings-panel .sr-panel-section + .sr-panel-section {
  margin-top: 18px;
  padding-top: 18px;
}

.sr-unread-badge {
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  padding: 0 5px;
  color: #1d1302;
  border: 1px solid #ffe1a0;
  border-radius: 999px;
  background: var(--sr-gold-bright);
  font-size: 0.61rem;
  font-weight: 900;
}

.sr-control-dock .sr-unread-badge {
  position: absolute;
  top: -5px;
  right: -5px;
}

.sr-unread-badge[hidden] {
  display: none;
}

.sr-connection-banner {
  margin: 8px 8px 0;
  padding: 9px 12px;
  color: #fff1c7;
  border: 1px solid rgba(217, 170, 69, 0.5);
  border-radius: 8px;
  background: rgba(84, 57, 10, 0.76);
  font-size: 0.77rem;
  text-align: center;
}

.sr-connection-banner[hidden] {
  display: none;
}

.sr-participant-tile.is-pinned {
  border-color: var(--sr-gold-bright);
  box-shadow: inset 0 0 0 1px rgba(255, 229, 159, 0.3), 0 0 24px rgba(217, 170, 69, 0.13);
}

.sr-participant-grid[data-pinned="true"] .sr-participant-tile:first-child {
  grid-column: 1 / -1;
}

.sr-participant-tile.is-screen-share > video {
  object-fit: contain;
  background: #010912;
}

.sr-tile-pin,
.sr-raised-hand {
  position: absolute;
  z-index: 3;
  top: 10px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #fff;
  border: 1px solid rgba(206, 220, 233, 0.24);
  border-radius: 9px;
  background: rgba(1, 13, 25, 0.78);
  backdrop-filter: blur(8px);
}

.sr-tile-pin {
  right: 10px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 120ms ease, border-color 120ms ease;
}

.sr-participant-tile:hover .sr-tile-pin,
.sr-tile-pin:focus-visible,
.sr-tile-pin[aria-pressed="true"] {
  opacity: 1;
}

.sr-tile-pin[aria-pressed="true"] {
  color: #211603;
  border-color: #f5d477;
  background: #e3b951;
}

.sr-raised-hand {
  left: 10px;
  color: #241805;
  border-color: #f5d477;
  background: #e3b951;
}

.sr-tile-pin img,
.sr-raised-hand img,
.sr-person-hand {
  filter: brightness(0) invert(1);
}

.sr-tile-pin[aria-pressed="true"] img,
.sr-raised-hand img {
  filter: brightness(0) saturate(100%);
}

.sr-person-name:has(.sr-person-hand) {
  grid-template-columns: 10px minmax(0, 1fr) 18px;
}

.sr-control-dock #sr-toggle-screen-share[aria-pressed="true"],
.sr-control-dock #sr-toggle-hand[aria-pressed="true"],
.sr-control-dock #sr-dock-chat[aria-pressed="true"],
.sr-control-dock #sr-dock-people[aria-pressed="true"],
.sr-control-dock #sr-dock-devices[aria-pressed="true"] {
  color: #211603;
  border-color: #efc968;
  background: linear-gradient(180deg, #f6d77e, #d7a43d);
}

.sr-control-dock #sr-toggle-screen-share[aria-pressed="true"] img,
.sr-control-dock #sr-toggle-hand[aria-pressed="true"] img,
.sr-control-dock #sr-dock-chat[aria-pressed="true"] img,
.sr-control-dock #sr-dock-people[aria-pressed="true"] img,
.sr-control-dock #sr-dock-devices[aria-pressed="true"] img {
  filter: brightness(0) saturate(100%);
}

.sr-control-dock #sr-toggle-microphone[aria-disabled="true"] {
  cursor: not-allowed;
  border-color: rgba(174, 188, 202, 0.22);
  background: rgba(45, 55, 65, 0.72);
}

@media (min-width: 1081px) and (min-height: 620px) {
  .sr-stage-shell {
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .sr-room-panel {
    max-height: 100%;
  }
}

@media (max-width: 1080px) {
  .sr-room-panel {
    display: flex;
    width: 100%;
    max-height: 620px;
  }

  .sr-panel-view {
    min-height: 260px;
  }
}

@media (max-width: 760px) {
  .sr-room-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sr-room-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .sr-control-dock {
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .sr-control-dock::-webkit-scrollbar {
    display: none;
  }

  .sr-control-dock button {
    flex: 0 0 44px;
  }
}

@media (max-width: 480px) {
  .sr-room-card-grid {
    grid-template-columns: 1fr;
  }

  .sr-room-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .sr-panel-tabs button span:not(.sr-unread-badge) {
    display: none;
  }

  .sr-participant-grid[data-pinned="true"] .sr-participant-tile:first-child {
    grid-column: auto;
  }
}

/* Meet-familiar responsive tiling: preserve readable 16:9 video instead of
   shrinking every participant into the original two-column proof-of-concept. */
.sr-participant-grid:is(
  [data-count="5"],
  [data-count="6"],
  [data-count="7"],
  [data-count="8"],
  [data-count="9"],
  [data-count="10"],
  [data-count="11"],
  [data-count="12"]
) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (min-width: 1081px) and (min-height: 620px) {
  .sr-participant-grid {
    grid-template-rows: none;
    grid-auto-rows: minmax(150px, 1fr);
    overflow: auto;
  }

  .sr-participant-grid[data-count="1"] {
    grid-template-columns: minmax(0, 1fr);
  }

  .sr-participant-grid:is([data-count="2"], [data-count="3"], [data-count="4"]) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .sr-participant-grid:is(
    [data-count="5"],
    [data-count="6"],
    [data-count="7"],
    [data-count="8"],
    [data-count="9"],
    [data-count="10"],
    [data-count="11"],
    [data-count="12"]
  ) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 390px) {
  .sr-participant-grid:is(
    [data-count="5"],
    [data-count="6"],
    [data-count="7"],
    [data-count="8"],
    [data-count="9"],
    [data-count="10"],
    [data-count="11"],
    [data-count="12"]
  ) {
    grid-template-columns: 1fr;
  }
}

body.sr-in-call .sr-participant-grid {
  overflow: hidden;
  scrollbar-width: none;
}

body.sr-in-call .sr-participant-grid::-webkit-scrollbar {
  display: none;
}

body.sr-in-call.sr-compact-mode .sr-live-room:not([hidden]) {
  position: fixed;
  z-index: 80;
  right: 12px;
  bottom: 12px;
  width: min(460px, calc(100vw - 24px));
  height: min(360px, calc(100dvh - 24px));
  min-width: 320px;
  min-height: 240px;
  padding: 6px;
  overflow: hidden;
  resize: both;
  border: 1px solid rgba(217, 170, 69, 0.58);
  border-radius: 16px;
  background: #020f1d;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.62);
}

body.sr-in-call.sr-compact-mode .sr-stage-header,
body.sr-in-call.sr-compact-mode .sr-room-panel,
body.sr-in-call.sr-compact-mode .sr-room-selector-menu,
body.sr-in-call.sr-compact-mode .sr-layout-menu {
  display: none !important;
}

body.sr-in-call.sr-compact-mode .sr-live-layout,
body.sr-in-call.sr-compact-mode .sr-stage-shell {
  height: 100%;
  min-height: 0;
}

body.sr-in-call.sr-compact-mode .sr-stage-shell {
  grid-template-rows: minmax(0, 1fr);
}

body.sr-in-call.sr-compact-mode .sr-control-dock {
  position: absolute;
  z-index: 4;
  right: 50%;
  bottom: 8px;
  left: auto;
  width: auto;
  margin: 0;
  padding: 5px;
  transform: translateX(50%);
  background: rgba(2, 15, 29, 0.9);
}

body.sr-in-call.sr-compact-mode .sr-control-dock button {
  display: none;
}

body.sr-in-call.sr-compact-mode .sr-control-dock :is(
  #sr-toggle-microphone,
  #sr-toggle-camera,
  #sr-toggle-compact,
  #sr-leave
) {
  display: inline-grid;
}

body.sr-in-call.sr-compact-mode #sr-toggle-compact,
#sr-toggle-compact[aria-pressed="true"] {
  color: #211603;
  border-color: #efc968;
  background: linear-gradient(180deg, #f6d77e, #d7a43d);
}

/* Keep room names, background controls and call actions usable on smaller screens. */
.sr-room-admin-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 16px; }
.sr-room-admin-controls[hidden], .sr-room-editor[hidden] { display: none; }
.sr-room-admin-controls p { margin: 0; color: #b9c8d8; font-size: 13px; }
.sr-room-admin-card { display: flex; flex-direction: column; min-width: 0; gap: 6px; }
.sr-room-admin-card > .sr-room-card { width: 100%; flex: 1; }
.sr-room-edit, .sr-room-add, .sr-room-editor-actions button { min-height: 44px; padding: 10px 14px; border: 1px solid #72889c; border-radius: 10px; background: #142a40; color: #f4f1e9; font: inherit; cursor: pointer; }
.sr-room-edit { align-self: stretch; font-size: 12px; }
.sr-room-add, #sr-room-save { border-color: #d4af57; color: #f6db94; }
.sr-room-edit:disabled, .sr-room-add:disabled, .sr-room-editor-actions button:disabled { opacity: .55; cursor: not-allowed; }
.sr-room-edit:focus-visible, .sr-room-add:focus-visible, .sr-room-editor :is(input,select,button):focus-visible { outline: 2px solid #f2cf70; outline-offset: 3px; }
.sr-room-editor { min-width: 0; margin: 0 0 20px; padding: 18px; border: 1px solid #72889c; border-radius: 14px; background: #101f31; }
.sr-room-editor h3 { margin: 0 0 16px; color: #f4f1e9; }
.sr-room-editor > p { margin: 10px 0; font-size: 12px; line-height: 1.5; color: #b9c8d8; overflow-wrap: anywhere; }
.sr-room-editor-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.sr-room-editor-fields label { display: grid; gap: 7px; min-width: 0; font-size: 13px; color: #f4f1e9; }
.sr-room-editor-fields :is(input,select) { box-sizing: border-box; width: 100%; min-width: 0; min-height: 44px; padding: 10px; border: 1px solid #72889c; border-radius: 8px; color: #f4f1e9; background: #09192a; font: inherit; }
.sr-room-editor-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.sr-room-audience { color: #f6db94; }
@media (max-width: 560px) { .sr-room-editor-fields { grid-template-columns: minmax(0, 1fr); } }
.sr-lobby-entry-hint {
  max-width: 62ch;
  margin: 8px 0 0;
  color: #b9c8d8;
  font-size: .875rem;
  line-height: 1.5;
}

.sr-background-picker {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 18px 0;
}

.sr-background-preview {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid rgba(217, 170, 69, .45);
  border-radius: 10px;
}

.sr-background-picker input[type="file"] {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  font: inherit;
  font-size: .85rem;
  overflow: hidden;
}

.sr-background-picker input[type="file"]::file-selector-button {
  min-height: 44px;
  margin-right: 8px;
  padding: 8px 12px;
  color: #f5f0e6;
  background: #15344e;
  border: 1px solid #61768b;
  border-radius: 8px;
  cursor: pointer;
}

.sr-background-picker small { line-height: 1.5; color: #b9c8d8; }
.sr-background-picker small.is-error { color: #ffb9b9; }
.sr-background-picker select { min-height: 44px; }
.sr-room-card-copy { min-width: 0; }
.sr-room-card-copy small { white-space: normal; overflow-wrap: anywhere; }
.sr-settings-panel { overflow-y: auto; overscroll-behavior: contain; }
.sr-admin-person-actions { display: flex; flex-wrap: wrap; gap: 8px; grid-column: 1 / -1; }
.sr-admin-person-actions button {
  min-height: 44px;
  padding: 8px 12px;
  color: var(--sr-gold-bright);
  border: 1px solid rgba(217, 170, 69, .4);
  border-radius: 7px;
  background: rgba(2, 17, 32, .82);
  cursor: pointer;
}
.sr-admin-person-actions button:disabled { opacity: .5; cursor: not-allowed; }

@media (min-width: 761px) and (max-width: 1080px) {
  .sr-room-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .sr-room-lobby-heading { align-items: flex-start; flex-wrap: wrap; gap: 12px; }
  .sr-room-panel { max-height: min(70dvh, 620px); }
  .sr-panel-view { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .sr-control-dock { scrollbar-width: thin; scrollbar-color: #718398 transparent; }
  .sr-control-dock::-webkit-scrollbar { display: block; height: 3px; }
  .sr-control-dock::-webkit-scrollbar-thumb { background: #718398; border-radius: 3px; }
}

@media (max-width: 1080px) and (min-height: 620px) {
  body.sr-in-call:not(.sr-compact-mode) .sr-control-dock { max-width: 680px; }
}

/* Keep every call action, including Leave, visible on portrait phones. */
.sr-entry-admission { margin-top: 12px; padding: 12px; border: 1px solid var(--sr-border, #dfe5df); border-radius: 12px; background: #f7faf7; }
.sr-admission-actions { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.sr-admission-actions button, .sr-waiting-room button { min-height: 44px; }
.sr-waiting-room { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--sr-border, #dfe5df); }
.sr-waiting-person { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 12px 0; border-bottom: 1px solid #e7ece7; }
.sr-waiting-person strong { flex: 1 1 100%; overflow-wrap: anywhere; }
.sr-waiting-person > span { flex: 1 1 auto; font-size: 12px; }
.sr-entry-admission[hidden], .sr-waiting-room[hidden] { display: none; }

@media (max-width: 760px) and (max-height: 600px) and (orientation: portrait) {
  .sr-stage-header { min-height: 90px; }
}

@media (max-width: 760px) and (orientation: portrait) {
  body.sr-in-call:not(.sr-compact-mode) .sr-live-room:not([hidden]) {
    padding-bottom: calc(138px + env(safe-area-inset-bottom, 0px));
  }
  body.sr-in-call:not(.sr-compact-mode) .sr-control-dock {
    display: grid;
    grid-template-columns: repeat(5, minmax(44px, 1fr));
    gap: 8px;
    overflow: visible;
  }
  body.sr-in-call:not(.sr-compact-mode) .sr-control-dock button {
    width: 100%;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }
}
