:root {
  color-scheme: dark;
  --paper: oklch(15.5% 0.015 92);
  --paper-deep: oklch(10.5% 0.012 92);
  --panel: oklch(20% 0.017 92);
  --panel-strong: oklch(25% 0.019 92);
  --control: oklch(23% 0.016 92);
  --control-hover: oklch(30% 0.018 92);
  --control-active: oklch(84% 0.012 92);
  --control-active-hover: oklch(89% 0.01 92);
  --control-line: oklch(41% 0.018 92);
  --ink: oklch(94% 0.012 92);
  --muted: oklch(69% 0.028 88);
  --line: oklch(35% 0.025 92);
  --green: oklch(72% 0.16 164);
  --blue: oklch(68% 0.14 246);
  --coral: oklch(67% 0.18 31);
  --amber: oklch(79% 0.14 82);
  --shadow: 0 24px 70px oklch(6% 0.02 92 / 0.46);
  --radius-sm: 8px;
  --radius-md: 14px;
  --space-2xs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  font-family: Aptos, "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 14%, oklch(37% 0.09 158 / 0.18), transparent 30%),
    radial-gradient(circle at 84% 10%, oklch(42% 0.11 31 / 0.14), transparent 28%),
    linear-gradient(135deg, var(--paper-deep), var(--paper) 48%, oklch(13% 0.018 76)),
    var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.64;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-rows: auto 1fr;
  padding: var(--space-lg);
  gap: var(--space-lg);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--ink);
  font-weight: 750;
  letter-spacing: 0;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  width: 32px;
  height: 32px;
  border: 2px solid oklch(9% 0.01 92);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--amber), var(--green));
}

.brand-mark::before,
.brand-mark::after {
  position: absolute;
  top: 50%;
  width: 5px;
  height: 12px;
  border-radius: 999px;
  background: oklch(9% 0.01 92);
  content: "";
  transform: translateY(-50%);
}

.brand-mark::before {
  left: 9px;
}

.brand-mark::after {
  right: 9px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-width: 122px;
  justify-content: center;
  gap: var(--space-xs);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: oklch(18% 0.014 92 / 0.72);
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
}

.status-pill[data-state="connected"] .status-dot {
  background: var(--green);
}

.status-pill[data-state="error"] .status-dot {
  background: var(--coral);
}

.status-pill[data-state="connecting"] .status-dot {
  animation: blink 1s infinite;
  background: var(--blue);
}

.room-layout {
  display: grid;
  min-height: 0;
}

.not-found-layout {
  display: grid;
  min-height: min(760px, calc(100vh - 116px));
  place-items: center;
}

.start-layout {
  display: grid;
  width: min(100%, 1040px);
  min-height: min(760px, calc(100vh - 116px));
  grid-template-columns: minmax(0, 500px) minmax(340px, 430px);
  align-items: center;
  justify-content: center;
  gap: clamp(var(--space-xl), 4vw, 64px);
  margin-inline: auto;
}

.start-copy {
  display: grid;
  align-content: center;
  gap: var(--space-md);
  max-width: 680px;
}

.start-copy h1 {
  max-width: 13ch;
  font-size: clamp(3.5rem, 5vw, 4.4rem);
}

.start-lead {
  max-width: 38ch;
  margin: 0;
  color: var(--muted);
  font-size: 1.15rem;
  font-weight: 650;
}

.start-panel {
  display: grid;
  gap: var(--space-lg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  background:
    linear-gradient(180deg, oklch(22% 0.018 92 / 0.96), oklch(17% 0.014 92 / 0.96)),
    var(--panel);
  box-shadow: var(--shadow);
}

.not-found-panel {
  display: grid;
  width: min(100%, 620px);
  gap: var(--space-lg);
  border: 1px solid color-mix(in oklch, var(--line), var(--coral) 18%);
  border-radius: var(--radius-md);
  padding: clamp(var(--space-xl), 5vw, 64px);
  background:
    radial-gradient(circle at 18% 4%, oklch(62% 0.15 31 / 0.16), transparent 38%),
    linear-gradient(180deg, oklch(22% 0.018 92 / 0.96), oklch(14% 0.013 92 / 0.98)),
    var(--panel);
  box-shadow: var(--shadow);
}

.not-found-panel h1 {
  max-width: 12ch;
}

.not-found-copy {
  max-width: 46ch;
  margin: 0;
  color: var(--muted);
  font-size: 1.06rem;
  font-weight: 650;
}

.not-found-copy span {
  color: var(--ink);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.start-divider {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.start-divider::before,
.start-divider::after {
  height: 1px;
  flex: 1;
  background: var(--line);
  content: "";
}

.room-actions {
  display: grid;
  gap: var(--space-md);
}

.stage {
  position: relative;
  display: grid;
  min-height: 100%;
  grid-template-rows: auto 1fr;
  gap: var(--space-xl);
  overflow: visible;
  padding: var(--space-md) var(--space-xl) 104px;
  background: transparent;
}

.room-heading {
  position: relative;
  z-index: 1;
  display: block;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
}

.room-title-line {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.room-title-actions {
  display: inline-flex;
  flex: 0 0 auto;
  gap: var(--space-xs);
}

.eyebrow {
  margin: 0 0 var(--space-xs);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  max-width: 18ch;
  margin: 0;
  overflow-wrap: anywhere;
  font-family: "Arial Narrow", Aptos, "Segoe UI", sans-serif;
  font-size: 3.75rem;
  line-height: 0.92;
  letter-spacing: 0;
}

.copy-room-button {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0;
  background: var(--panel);
  color: var(--muted);
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.copy-room-button:hover {
  border-color: color-mix(in oklch, var(--control-line), var(--ink) 18%);
  background: var(--panel-strong);
  color: var(--ink);
  box-shadow: 0 0 0 3px oklch(84% 0.012 92 / 0.1);
}

.copy-room-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.heading-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-xs);
}

.tool-button,
.primary-button,
.secondary-button,
.home-link-button,
.leave-button,
.sound-button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 16px;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.tool-button {
  background: var(--panel);
  color: var(--ink);
  font-weight: 750;
}

.home-link-button {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  border-color: var(--control-line);
  background: var(--control);
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.tool-button:hover,
.primary-button:hover,
.secondary-button:hover,
.home-link-button:hover,
.sound-button:hover {
  border-color: color-mix(in oklch, var(--control-line), var(--ink) 22%);
  box-shadow: 0 0 0 3px oklch(84% 0.012 92 / 0.1);
}

.participants {
  --tile-columns: 1;
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  min-height: min(520px, calc(100vh - 250px));
  grid-template-columns: repeat(var(--tile-columns), minmax(0, 1fr));
  grid-auto-rows: minmax(180px, 1fr);
  align-content: center;
  justify-content: center;
  justify-items: stretch;
  gap: var(--space-md);
}

.screen-stage {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  min-height: 0;
  margin-inline: auto;
  overflow: hidden;
  background: oklch(5% 0.01 92);
}

.screen-video {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 0;
  background: oklch(5% 0.01 92);
  object-fit: contain;
}

.screen-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.screen-placeholder[hidden] {
  display: none;
}

.screen-view-controls {
  position: absolute;
  right: var(--space-md);
  bottom: var(--space-md);
  z-index: 2;
  display: flex;
  align-items: flex-end;
  gap: var(--space-xs);
  border-radius: var(--radius-sm);
  padding: var(--space-md) var(--space-md) var(--space-md) var(--space-xl);
  background: linear-gradient(90deg, transparent, oklch(5% 0.01 92 / 0.7) 38%, oklch(5% 0.01 92 / 0.9));
  pointer-events: auto;
}

.screen-view-controls[hidden] {
  display: none;
}

.screen-control-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid oklch(86% 0.012 92 / 0.18);
  border-radius: var(--radius-sm);
  padding: 0;
  background: oklch(9% 0.012 92 / 0.88);
  color: oklch(97% 0.008 92);
  box-shadow: 0 12px 28px oklch(5% 0.01 92 / 0.3);
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.screen-control-button:hover,
.stream-volume-control:focus-within .stream-volume-button {
  border-color: oklch(88% 0.012 92 / 0.36);
  background: oklch(16% 0.014 92 / 0.94);
  transform: translateY(-1px);
}

.screen-control-button svg {
  display: block;
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.stream-volume-icon,
.screen-fullscreen-icon {
  display: grid;
  place-items: center;
}

.stream-volume-control {
  position: relative;
}

.stream-volume-popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + var(--space-xs));
  display: grid;
  width: 42px;
  height: 142px;
  place-items: center;
  border: 1px solid oklch(86% 0.012 92 / 0.2);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) 0;
  background: oklch(8% 0.012 92 / 0.94);
  box-shadow: 0 18px 36px oklch(5% 0.01 92 / 0.38);
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.stream-volume-control:hover .stream-volume-popover,
.stream-volume-control:focus-within .stream-volume-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.stream-volume-slider {
  width: 104px;
  min-height: 0;
  border: 0;
  padding: 0;
  background: transparent;
  accent-color: var(--control-active);
  cursor: pointer;
  transform: rotate(-90deg);
}

.stream-volume-icon-off,
.stream-volume-button[data-muted="true"] .stream-volume-icon-on,
.screen-fullscreen-icon-exit,
.screen-fullscreen-button[data-fullscreen="true"] .screen-fullscreen-icon-enter {
  display: none;
}

.stream-volume-button[data-muted="true"] .stream-volume-icon-off,
.screen-fullscreen-button[data-fullscreen="true"] .screen-fullscreen-icon-exit {
  display: grid;
}

body[data-screen-view="true"] {
  overflow: hidden;
}

body[data-screen-view="true"] .app-shell {
  height: 100dvh;
  overflow: hidden;
}

body[data-screen-view="true"] .room-layout,
body[data-screen-view="true"] .stage {
  min-height: 0;
  overflow: hidden;
}

body[data-screen-view="true"] .stage {
  height: 100%;
  grid-template-rows: 1fr;
  gap: 0;
  padding: var(--space-md) var(--space-xl) 92px;
}

body[data-screen-view="true"] .room-heading,
body[data-screen-view="true"] .participants,
body[data-screen-view="true"] .empty-room {
  display: none;
}

body[data-screen-view="true"] .screen-stage {
  height: 100%;
  border-radius: 0;
}

.participants[data-count="0"] {
  display: block;
}

.participants[data-count="1"] {
  width: min(860px, 100%);
  min-height: min(420px, calc(100vh - 280px));
  grid-template-rows: minmax(280px, min(420px, 48vh));
  margin-inline: auto;
}

.participants[data-count="2"] {
  --tile-columns: 2;
  grid-template-rows: minmax(280px, min(460px, 52vh));
}

.participants[data-count="3"],
.participants[data-count="4"] {
  --tile-columns: 2;
}

.participants[data-count="5"],
.participants[data-count="6"] {
  --tile-columns: 3;
}

.participants[data-count="7"],
.participants[data-count="8"] {
  --tile-columns: 4;
}

.participant {
  --level: 0;
  position: relative;
  display: grid;
  min-height: 0;
  height: 100%;
  aspect-ratio: auto;
  place-items: center;
  border: 1px solid color-mix(in oklch, var(--line), var(--ink) 8%);
  border-radius: var(--radius-sm);
  padding: var(--space-lg) var(--space-md);
  overflow: hidden;
  background:
    linear-gradient(180deg, oklch(24% 0.019 92 / 0.9), oklch(18% 0.015 92 / 0.86)),
    var(--panel);
  box-shadow: 0 10px 30px oklch(30% 0.03 245 / 0.08);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.participant[data-speaking="true"] {
  border-color: color-mix(in oklch, var(--green), var(--line) 24%);
  box-shadow: 0 0 0 1px oklch(72% 0.16 164 / 0.2), 0 14px 34px oklch(6% 0.02 92 / 0.34);
}

.participant[data-local="true"] {
  border-color: color-mix(in oklch, var(--green), var(--line) 56%);
  background:
    linear-gradient(180deg, oklch(24% 0.023 112 / 0.92), oklch(17% 0.026 154 / 0.78)),
    var(--panel);
}

.participant[data-muted="true"] {
  opacity: 0.82;
}

.participant[data-screen="true"] {
  border-color: color-mix(in oklch, var(--blue), var(--line) 28%);
}

.voice-ring {
  display: grid;
  width: 86px;
  height: 86px;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  transition: transform 160ms ease;
}

.participant[data-speaking="true"] .voice-ring {
  transform: scale(1.03);
}

.avatar {
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 24%, oklch(100% 0 0 / 0.18), transparent 30%),
    color-mix(in oklch, var(--panel-strong), var(--paper-deep) 42%);
  color: var(--ink);
  font-weight: 850;
  box-shadow: 0 8px 18px oklch(6% 0.02 92 / 0.28);
  transition: box-shadow 120ms linear, transform 160ms ease;
}

.participant[data-speaking="true"] .avatar {
  box-shadow:
    0 0 0 2px var(--green),
    0 0 calc(8px + (var(--level) * 14px)) oklch(62% 0.14 164 / 0.3);
}

.participant-copy {
  position: absolute;
  right: var(--space-sm);
  bottom: var(--space-sm);
  left: var(--space-sm);
  display: grid;
  justify-items: start;
  gap: var(--space-2xs);
  min-width: 0;
}

.participant h2 {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  border-radius: 7px;
  padding: 5px 8px;
  background: oklch(9% 0.012 92 / 0.84);
  color: oklch(98% 0.006 92);
  font-size: 0.9rem;
  font-weight: 850;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.participant-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.participant-muted-icon {
  display: none;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  place-items: center;
  color: oklch(93% 0.034 32);
}

.participant-muted-icon svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.participant[data-muted="true"] .participant-muted-icon {
  display: grid;
}

.participant p {
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  border-radius: 999px;
  padding: 3px 7px;
  background: oklch(9% 0.012 92 / 0.78);
  color: oklch(86% 0.035 86);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.participant-screen-action {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid color-mix(in oklch, var(--control-line), var(--ink) 12%);
  border-radius: 999px;
  padding: 0 10px;
  background: oklch(84% 0.012 92);
  color: oklch(9% 0.012 92);
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.participant-screen-action:hover {
  background: var(--control-active-hover);
  transform: translateY(-1px);
}

.participant-screen-action svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.3;
}

.empty-room {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: var(--space-md);
  color: var(--muted);
  font-weight: 750;
  pointer-events: none;
}

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

.empty-orbit {
  width: 108px;
  height: 108px;
  border: 1px dashed oklch(55% 0.06 238 / 0.42);
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--blue) 0 8px, transparent 9px),
    radial-gradient(circle at 72% 30%, var(--coral) 0 6px, transparent 7px),
    radial-gradient(circle at 34% 78%, var(--amber) 0 7px, transparent 8px);
}

.empty-room p {
  margin: 0;
}

.name-panel,
.join-panel,
.room-actions {
  display: grid;
  gap: var(--space-md);
}

.field {
  display: grid;
  gap: var(--space-xs);
}

.field span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.name-status {
  margin: calc(var(--space-xs) * -1) 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.name-status[data-state="saved"] {
  color: oklch(82% 0.018 92);
}

.name-status[data-state="dirty"] {
  color: color-mix(in oklch, var(--amber), var(--ink) 36%);
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  background: oklch(14% 0.013 92);
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus,
button:focus-visible,
.home-link-button:focus-visible {
  outline: 3px solid oklch(70% 0.14 82 / 0.55);
  outline-offset: 2px;
}

.primary-button {
  width: 100%;
  border-color: color-mix(in oklch, var(--control-line), var(--ink) 20%);
  background: var(--control-active);
  color: oklch(9% 0.012 92);
  font-weight: 850;
}

.secondary-button {
  width: 100%;
  background: var(--panel);
  color: var(--ink);
  font-weight: 850;
}

.primary-button:hover {
  background: var(--control-active-hover);
}

.home-link-button:hover {
  background: var(--control-hover);
}

.secondary-button:hover {
  background: var(--panel-strong);
}

.room-dock {
  position: fixed;
  right: 0;
  bottom: max(var(--space-lg), env(safe-area-inset-bottom));
  left: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding-inline: var(--space-lg);
  pointer-events: none;
}

.dock-cluster {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid oklch(34% 0.02 92 / 0.88);
  border-radius: 999px;
  background: oklch(11% 0.012 92 / 0.96);
  box-shadow: 0 18px 44px oklch(6% 0.02 92 / 0.4);
  pointer-events: auto;
}

.dock-button,
.dock-menu-button {
  display: grid;
  place-items: center;
  min-height: 0;
  border: 0;
  color: oklch(98% 0.006 92);
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.dock-button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  padding: 0;
  background: var(--control);
  pointer-events: auto;
}

.mic-button {
  border-radius: 999px 0 0 999px;
  background: transparent;
}

.dock-menu-button {
  width: 40px;
  height: 48px;
  border-left: 1px solid oklch(42% 0.018 92 / 0.42);
  border-radius: 0 999px 999px 0;
  padding: 0;
  background: transparent;
}

.dock-button:hover,
.dock-menu-button:hover {
  background: var(--control-hover);
  box-shadow: inset 0 0 0 1px oklch(84% 0.012 92 / 0.16);
}

.dock-button:disabled {
  cursor: wait;
}

.dock-button svg,
.dock-menu-button svg {
  width: 21px;
  height: 21px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.35;
}

.dock-icon {
  display: grid;
  place-items: center;
}

.dock-icon-mic svg,
.dock-icon-muted svg,
.dock-icon-screen svg,
.dock-icon-screen-stop svg {
  transform: translateY(-1px);
}

.mic-button[data-state="idle"],
.mic-button[data-state="connecting"] {
  background: transparent;
}

.mic-button[data-state="live"] {
  background: transparent;
  color: oklch(94% 0.012 92);
}

.mic-button[data-state="muted"] {
  background: transparent;
  color: oklch(79% 0.018 92);
}

.screen-button {
  border: 1px solid var(--control-line);
  background: oklch(11% 0.012 92 / 0.96);
  color: oklch(88% 0.014 92);
  box-shadow: 0 18px 44px oklch(6% 0.02 92 / 0.4);
}

.screen-button:hover {
  background: var(--control-hover);
}

.screen-button[data-state="live"] {
  border-color: color-mix(in oklch, var(--control-active), var(--line) 26%);
  background: var(--control-active);
  color: oklch(9% 0.012 92);
}

.screen-button[data-state="live"]:hover {
  background: var(--control-active-hover);
}

.screen-profile-popover {
  position: absolute;
  bottom: calc(100% + var(--space-sm));
  left: 50%;
  width: min(380px, calc(100vw - 32px));
  border: 1px solid oklch(34% 0.02 92);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
  background: oklch(10% 0.012 92);
  color: oklch(96% 0.008 92);
  box-shadow: 0 22px 54px oklch(6% 0.02 92 / 0.46);
  pointer-events: auto;
  transform: translateX(-50%);
}

.screen-profile-title {
  margin: 2px var(--space-xs) var(--space-xs);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.screen-profile-options {
  display: grid;
  gap: var(--space-xs);
}

.screen-profile-option {
  display: grid;
  min-height: 68px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-sm);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: var(--space-sm);
  background: transparent;
  color: inherit;
  text-align: left;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.screen-profile-option:hover,
.screen-profile-option[aria-pressed="true"] {
  border-color: color-mix(in oklch, var(--control-line), var(--ink) 16%);
  background: oklch(17% 0.014 92 / 0.9);
}

.screen-profile-option[aria-pressed="true"] {
  box-shadow: inset 0 0 0 1px oklch(84% 0.012 92 / 0.14);
}

.screen-profile-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.screen-profile-copy strong,
.screen-profile-copy span,
.screen-profile-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.screen-profile-copy strong {
  color: oklch(98% 0.006 92);
  font-size: 0.95rem;
  font-weight: 850;
}

.screen-profile-copy span,
.screen-profile-meta {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
}

.screen-profile-meta {
  justify-self: end;
}

.dock-icon-muted,
.dock-icon-screen-stop,
.mic-button[data-state="muted"] .dock-icon-mic,
.screen-button[data-state="live"] .dock-icon-screen {
  display: none;
}

.mic-button[data-state="muted"] .dock-icon-muted {
  display: grid;
}

.screen-button[data-state="live"] .dock-icon-screen-stop {
  display: grid;
}

.leave-button {
  background: var(--coral);
  color: oklch(8% 0.014 92);
  pointer-events: auto;
}

.leave-button:hover {
  background: oklch(56% 0.18 31);
  box-shadow: inset 0 0 0 1px oklch(92% 0.06 31 / 0.22);
}

.screen-exit-button {
  border: 1px solid var(--control-line);
  background: var(--control-active);
  color: oklch(9% 0.012 92);
  pointer-events: auto;
}

.screen-exit-button:hover {
  background: var(--control-active-hover);
  box-shadow: inset 0 0 0 1px oklch(18% 0.012 92 / 0.18);
}

.device-popover {
  position: absolute;
  bottom: calc(100% + var(--space-sm));
  left: 0;
  width: min(320px, calc(100vw - 48px));
  border: 1px solid oklch(34% 0.02 92);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  background: oklch(11% 0.012 92);
  color: oklch(96% 0.008 92);
  box-shadow: 0 22px 54px oklch(6% 0.02 92 / 0.46);
}

.device-popover .field span {
  color: var(--muted);
}

.device-popover select {
  border-color: var(--line);
  background: oklch(15% 0.014 92);
  color: oklch(96% 0.008 92);
}

.sound-button {
  min-height: 48px;
  border: 1px solid var(--control-line);
  border-radius: 999px;
  padding: 0 18px;
  background: var(--control);
  color: var(--ink);
  font-weight: 850;
  pointer-events: auto;
}

.sound-button:hover {
  background: var(--control-hover);
}

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

.toast {
  position: fixed;
  right: var(--space-lg);
  bottom: var(--space-lg);
  z-index: 10;
  max-width: min(360px, calc(100vw - 32px));
  border: 1px solid color-mix(in oklch, var(--control-line), var(--ink) 18%);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: oklch(10% 0.012 92);
  color: var(--ink);
  font-weight: 750;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast[data-visible="true"] {
  opacity: 1;
  transform: translateY(0);
}

@keyframes blink {
  50% {
    opacity: 0.35;
  }
}

@media (max-width: 900px) {
  .app-shell {
    padding: var(--space-md);
  }

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

  .start-layout {
    min-height: auto;
    grid-template-columns: 1fr;
    align-content: start;
    gap: var(--space-xl);
  }

  .start-copy h1 {
    max-width: 14ch;
    font-size: 3rem;
  }

  .stage {
    min-height: 100%;
  }

  .participants[data-count="5"],
  .participants[data-count="6"],
  .participants[data-count="7"],
  .participants[data-count="8"] {
    --tile-columns: 3;
  }

  h1 {
    font-size: 2.4rem;
  }
}

@media (max-width: 560px) {
  .topbar,
  .room-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .status-pill,
  .heading-actions,
  .tool-button {
    width: 100%;
  }

  .heading-actions {
    justify-content: stretch;
  }

  .participants {
    min-height: auto;
    grid-auto-rows: minmax(148px, 1fr);
  }

  .participants[data-count="2"],
  .participants[data-count="3"],
  .participants[data-count="4"],
  .participants[data-count="5"],
  .participants[data-count="6"],
  .participants[data-count="7"],
  .participants[data-count="8"] {
    --tile-columns: 2;
  }

  .start-panel {
    padding: var(--space-lg);
  }

  .not-found-panel {
    padding: var(--space-lg);
  }

  .start-copy h1 {
    font-size: 2.5rem;
  }

  .start-lead {
    font-size: 1rem;
  }

  .participant {
    min-height: 148px;
  }

  body[data-screen-view="true"] .stage {
    padding: var(--space-sm) var(--space-sm) 88px;
  }

  .screen-view-controls {
    right: var(--space-xs);
    bottom: var(--space-xs);
    gap: 6px;
    padding: var(--space-sm) var(--space-sm) var(--space-sm) var(--space-lg);
  }

  .screen-control-button {
    width: 40px;
    height: 40px;
  }

  .screen-profile-popover {
    width: min(360px, calc(100vw - 24px));
  }

  .screen-profile-option {
    min-height: 64px;
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .screen-profile-meta {
    justify-self: start;
  }

  .voice-ring {
    width: 72px;
    height: 72px;
  }

  .avatar {
    width: 62px;
    height: 62px;
  }
}

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