:root {
  --bg: oklch(0.09 0 0);
  --bg-elevated: oklch(0.13 0.006 150);
  --surface: oklch(0.16 0.008 150);
  --surface-strong: oklch(0.22 0.01 150);
  --ink: oklch(0.96 0 0);
  --muted: oklch(0.72 0.01 150);
  --muted-strong: oklch(0.82 0.008 150);
  --border: oklch(0.27 0.01 150);
  --primary: oklch(0.63 0.16 150);
  --primary-strong: oklch(0.56 0.15 150);
  --danger: oklch(0.58 0.2 28);
  --danger-strong: oklch(0.52 0.19 28);
  --focus: oklch(0.82 0.13 150);
  --shadow: 0 6px 8px oklch(0 0 0 / 0.28);
  --radius: 12px;
  --control-size: 4.6rem;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  background: var(--bg);
}

body {
  width: 100%;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  letter-spacing: 0;
}

body::selection {
  color: white;
  background: var(--primary-strong);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 1.25rem;
  padding-top: max(1.25rem, env(safe-area-inset-top));
  padding-right: max(1.25rem, env(safe-area-inset-right));
  padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
  padding-left: max(1.25rem, env(safe-area-inset-left));
  gap: 1.25rem;
}

.topbar {
  min-height: 3.5rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 0.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  width: fit-content;
  color: var(--ink);
  text-decoration: none;
  font-weight: 720;
  font-size: 1.25rem;
}

.brand-mark {
  width: 2rem;
  height: 2rem;
  display: inline-grid;
  place-items: center;
  color: var(--primary);
}

.brand-mark svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.status {
  grid-column: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-width: 13rem;
  color: var(--muted-strong);
  font-size: 0.98rem;
}

.status-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--muted);
}

body[data-state="waiting"] .status-dot,
body[data-state="connected"] .status-dot {
  background: var(--primary);
  box-shadow: 0 0 0 0.38rem oklch(0.63 0.16 150 / 0.13);
}

body[data-state="error"] .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 0.38rem oklch(0.58 0.2 28 / 0.12);
}

.stage {
  position: relative;
  min-height: 28rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 50%, oklch(0.18 0.012 150), transparent 38%),
    var(--bg-elevated);
  box-shadow: var(--shadow);
}

.remote-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: oklch(0.03 0 0);
}

.remote-video.is-empty {
  opacity: 0;
}

body[data-video-fit="cover"] .remote-video {
  object-fit: cover;
}

.room-video-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 0.5rem;
  padding: 0.5rem;
  background: oklch(0.04 0 0);
}

.room-video-tile {
  position: relative;
  min-height: 12rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
}

.room-video-tile video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: oklch(0.02 0 0);
}

body[data-video-fit="cover"] .room-video-tile video {
  object-fit: cover;
}

.room-video-tile span {
  position: absolute;
  left: 0.65rem;
  bottom: 0.65rem;
  padding: 0.28rem 0.52rem;
  border-radius: 999px;
  background: oklch(0.05 0 0 / 0.78);
  font-size: 0.78rem;
  font-weight: 680;
}

.center-state {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1rem;
  padding: 2rem;
  text-align: center;
  background: oklch(0.09 0 0 / 0.12);
}

.center-state.is-hidden {
  display: none;
}

.center-state h1 {
  margin: 0;
  max-width: 16ch;
  font-size: 1.45rem;
  line-height: 1.15;
  text-wrap: balance;
}

.center-state p {
  max-width: 35ch;
  margin: -0.2rem 0 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.55;
  text-wrap: pretty;
}

.join-button {
  min-width: 8rem;
  min-height: 3rem;
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1.4rem;
  color: white;
  background: var(--primary-strong);
  font-weight: 760;
  cursor: pointer;
  transition:
    background 180ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 140ms cubic-bezier(0.22, 1, 0.36, 1);
}

.join-button:hover {
  background: var(--primary);
  transform: translateY(-1px);
}

.join-button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.entry-actions {
  width: min(100%, 60rem);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 0.35rem;
}

.mode-card {
  --mode-accent: var(--primary);
  position: relative;
  min-width: 0;
  min-height: 10.5rem;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr;
  gap: 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 0 0, color-mix(in oklch, var(--mode-accent) 15%, transparent), transparent 52%),
    oklch(0.145 0.007 150 / 0.96);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 180ms cubic-bezier(0.22, 1, 0.36, 1),
    background 180ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.mode-card--private {
  --mode-accent: oklch(0.67 0.14 285);
}

.mode-card--quick {
  grid-template-rows: auto 1fr auto;
  cursor: default;
}

.mode-card-quick-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid color-mix(in oklch, var(--mode-accent) 28%, var(--border));
}

.mode-card-quick-action {
  min-width: 0;
  min-height: 2.45rem;
  border: 1px solid color-mix(in oklch, var(--mode-accent) 42%, var(--border));
  border-radius: 9px;
  padding: 0.5rem 0.6rem;
  color: var(--ink);
  background: color-mix(in oklch, var(--mode-accent) 10%, var(--surface));
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 740;
  line-height: 1.2;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.mode-card-quick-action:hover {
  border-color: var(--mode-accent);
  background: color-mix(in oklch, var(--mode-accent) 17%, var(--surface));
  transform: translateY(-1px);
}

.mode-card-quick-action.is-primary {
  border-color: color-mix(in oklch, var(--mode-accent) 72%, white);
  color: white;
  background: color-mix(in oklch, var(--mode-accent) 58%, oklch(0.2 0.02 285));
}

.mode-card--live {
  --mode-accent: oklch(0.65 0.18 24);
}

.mode-card:hover {
  border-color: color-mix(in oklch, var(--mode-accent) 70%, var(--border));
  background:
    radial-gradient(circle at 0 0, color-mix(in oklch, var(--mode-accent) 22%, transparent), transparent 56%),
    var(--surface);
  box-shadow: 0 12px 28px oklch(0 0 0 / 0.24);
  transform: translateY(-3px);
}

.mode-card-icon {
  width: 2.8rem;
  height: 2.8rem;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in oklch, var(--mode-accent) 38%, transparent);
  border-radius: 11px;
  color: var(--mode-accent);
  background: color-mix(in oklch, var(--mode-accent) 11%, transparent);
}

.mode-card-icon svg {
  width: 1.55rem;
  height: 1.55rem;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mode-card-content {
  grid-column: 1 / -1;
  align-self: end;
  display: grid;
  gap: 0.45rem;
}

.mode-card-content strong {
  font-size: 1rem;
  line-height: 1.2;
}

.mode-card-content > span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
  text-wrap: pretty;
}

.mode-card-arrow {
  align-self: center;
  color: var(--muted);
  font-size: 1.25rem;
  transition:
    color 180ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.mode-card:hover .mode-card-arrow {
  color: var(--mode-accent);
  transform: translateX(3px);
}

.room-meta {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 5;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: calc(100% - 2rem);
}

.room-mode-badge,
.room-audience {
  min-height: 2rem;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.38rem 0.7rem;
  color: var(--ink);
  background: oklch(0.05 0 0 / 0.8);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: 0.78rem;
  font-weight: 720;
}

.room-code-button {
  order: -1;
  min-width: 13.75rem;
  min-height: 4.25rem;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
  border: 1px solid oklch(0.63 0.16 150 / 0.72);
  border-radius: 13px;
  padding: 0.62rem 0.72rem 0.62rem 0.85rem;
  color: var(--ink);
  background:
    linear-gradient(135deg, oklch(0.28 0.07 150 / 0.96), oklch(0.12 0.015 150 / 0.96));
  box-shadow:
    0 0 0 1px oklch(0.63 0.16 150 / 0.12),
    0 10px 26px oklch(0 0 0 / 0.32);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 160ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 160ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 160ms cubic-bezier(0.22, 1, 0.36, 1);
}

.room-code-button:hover {
  border-color: var(--primary);
  box-shadow:
    0 0 0 3px oklch(0.63 0.16 150 / 0.13),
    0 12px 30px oklch(0 0 0 / 0.38);
  transform: translateY(-1px);
}

.room-code-button.is-copied {
  border-color: var(--focus);
  box-shadow:
    0 0 0 3px oklch(0.82 0.13 150 / 0.16),
    0 12px 30px oklch(0 0 0 / 0.38);
}

.room-code-main {
  display: grid;
  gap: 0.14rem;
}

.room-code-label {
  color: oklch(0.82 0.04 150);
  font-size: 0.64rem;
  font-weight: 760;
  letter-spacing: 0.11em;
  line-height: 1.2;
  text-transform: uppercase;
}

.room-code-value {
  color: white;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.45rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.13em;
  line-height: 1.1;
}

.room-code-action {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  border-left: 1px solid oklch(0.63 0.16 150 / 0.3);
  padding-left: 0.72rem;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 760;
  white-space: nowrap;
}

.room-code-action svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.room-audience {
  color: var(--muted-strong);
}

.live-requests-panel {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 6;
  width: min(20rem, calc(100% - 2rem));
  overflow: hidden;
  border: 1px solid oklch(0.63 0.16 150 / 0.4);
  border-radius: 13px;
  color: var(--ink);
  background: oklch(0.085 0.01 150 / 0.94);
  box-shadow: 0 16px 36px oklch(0 0 0 / 0.38);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.live-requests-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.78rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

.live-requests-header > span:first-child {
  display: grid;
  gap: 0.16rem;
}

.live-requests-header strong {
  font-size: 0.84rem;
}

.live-requests-header small {
  color: var(--muted);
  font-size: 0.7rem;
}

.live-requests-count {
  min-width: 1.7rem;
  height: 1.7rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: oklch(0.12 0.02 150);
  background: var(--primary);
  font-size: 0.74rem;
  font-weight: 800;
}

.live-requests-list {
  display: grid;
  max-height: 15rem;
  overflow-y: auto;
}

.live-request-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.85rem;
}

.live-request-item + .live-request-item {
  border-top: 1px solid var(--border);
}

.live-request-person {
  min-width: 0;
  display: grid;
  gap: 0.12rem;
}

.live-request-person strong,
.live-request-person small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-request-person strong {
  font-size: 0.8rem;
}

.live-request-person small {
  color: var(--muted);
  font-size: 0.68rem;
}

.live-request-actions {
  display: flex;
  gap: 0.38rem;
}

.live-request-action {
  min-width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted-strong);
  background: var(--surface);
  cursor: pointer;
}

.live-request-action svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.live-request-action.approve {
  border-color: oklch(0.63 0.16 150 / 0.42);
  color: var(--primary);
}

.live-request-action.reject {
  color: oklch(0.72 0.16 25);
}

.live-request-action:hover {
  background: var(--surface-strong);
}

.live-request-action:disabled {
  cursor: wait;
  opacity: 0.5;
}

.live-participation-feedback {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  z-index: 6;
  max-width: calc(100% - 2rem);
  border: 1px solid oklch(0.63 0.16 150 / 0.38);
  border-radius: 999px;
  padding: 0.55rem 0.85rem;
  color: var(--ink);
  background: oklch(0.065 0.008 150 / 0.9);
  box-shadow: 0 8px 20px oklch(0 0 0 / 0.3);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: 0.78rem;
  font-weight: 650;
  text-align: center;
  transform: translateX(-50%);
}

.radar {
  position: relative;
  width: 8.25rem;
  height: 8.25rem;
  display: none;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid oklch(0.63 0.16 150 / 0.28);
  contain: paint;
  background:
    radial-gradient(circle at center, oklch(0.63 0.16 150 / 0.18) 0 0.44rem, transparent 0.48rem),
    repeating-radial-gradient(circle at center, transparent 0 1.45rem, oklch(0.63 0.16 150 / 0.22) 1.48rem 1.54rem),
    linear-gradient(90deg, transparent calc(50% - 0.5px), oklch(0.63 0.16 150 / 0.16) 50%, transparent calc(50% + 0.5px)),
    linear-gradient(0deg, transparent calc(50% - 0.5px), oklch(0.63 0.16 150 / 0.16) 50%, transparent calc(50% + 0.5px)),
    oklch(0.1 0.01 150 / 0.84);
  box-shadow:
    inset 0 0 1.4rem oklch(0 0 0 / 0.34),
    0 0 2rem oklch(0.63 0.16 150 / 0.08);
}

.radar::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: conic-gradient(
    from -90deg,
    transparent 0deg 288deg,
    oklch(0.63 0.16 150 / 0.08) 306deg,
    oklch(0.63 0.16 150 / 0.58) 350deg,
    transparent 360deg
  );
  transform-origin: 50% 50%;
  animation: sweep 1.8s linear infinite;
  will-change: transform;
}

.radar span {
  position: relative;
  z-index: 1;
  width: 0.66rem;
  height: 0.66rem;
  display: block;
  border-radius: 50%;
  background: var(--primary);
  box-shadow:
    0 0 0 0.45rem oklch(0.63 0.16 150 / 0.11),
    0 0 1.1rem oklch(0.63 0.16 150 / 0.45);
}

body[data-state="waiting"] .radar {
  display: grid;
}

body[data-state="waiting"] .center-state {
  background:
    radial-gradient(circle at 50% 43%, oklch(0.17 0.026 150 / 0.78), transparent 42%),
    oklch(0.08 0 0 / 0.42);
}

body[data-state="waiting"] .status-dot {
  animation: statusPulse 1.8s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

.local-preview {
  position: absolute;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 3;
  width: min(22rem, 28vw);
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid oklch(0.04 0 0 / 0.85);
  border-radius: 10px;
  background: var(--surface-strong);
  box-shadow: 0 6px 8px oklch(0 0 0 / 0.3);
}

body[data-call-mode="live-host"] .local-preview,
body[data-call-mode="live-viewer"] .local-preview,
body[data-call-mode="live-guest"] .local-preview {
  display: none !important;
}

.local-preview video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scaleX(-1);
}

body[data-video-fit="cover"] .local-preview video {
  object-fit: cover;
}

.local-preview.is-user-blackout video {
  opacity: 0;
}

.local-preview.is-user-blackout::after {
  content: "";
  position: absolute;
  inset: 0;
  background: oklch(0.02 0 0);
}

.local-badge {
  position: absolute;
  left: 0.65rem;
  bottom: 0.65rem;
  z-index: 1;
  padding: 0.28rem 0.52rem;
  border-radius: 999px;
  color: var(--ink);
  background: oklch(0.05 0 0 / 0.74);
  font-size: 0.78rem;
  font-weight: 680;
}

.profile-dialog {
  width: min(calc(100vw - 2rem), 34rem);
  max-height: calc(100dvh - 2rem);
  overflow: hidden;
  border: 1px solid oklch(0.32 0.012 150);
  border-radius: 10px;
  padding: 0;
  color: var(--ink);
  background: oklch(0.09 0 0);
  box-shadow: 0 6px 8px oklch(0 0 0 / 0.34);
}

.profile-dialog::backdrop {
  background: oklch(0.02 0 0 / 0.78);
}

.lives-dialog {
  width: min(calc(100vw - 2rem), 60rem);
}

.profile-dialog-inner {
  display: grid;
  gap: 1rem;
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  padding: 1.1rem;
}

.profile-dialog-inner header {
  display: grid;
  gap: 0.35rem;
}

.profile-dialog-inner h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.25;
}

.profile-dialog-inner p {
  margin: 0.28rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.media-settings-form {
  gap: 1.1rem;
}

.media-settings-fields {
  display: grid;
  gap: 0.85rem;
}

.media-settings-field {
  display: grid;
  gap: 0.42rem;
  color: var(--muted-strong);
  font-size: 0.84rem;
  font-weight: 680;
}

.media-settings-field select {
  width: 100%;
  min-height: 2.85rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.65rem 2.2rem 0.65rem 0.8rem;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
}

.media-settings-field select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.dialog-heading {
  grid-template-columns: 1fr auto;
  align-items: start;
}

.dialog-close {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--ink);
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.dialog-close:hover {
  border-color: oklch(0.63 0.16 150 / 0.65);
  background: var(--surface-strong);
  transform: translateY(-1px);
}

.room-dialog-inner {
  gap: 1.1rem;
}

.dialog-primary-action,
.code-entry-form button {
  min-height: 2.85rem;
  border: 0;
  border-radius: 9px;
  padding: 0.7rem 1rem;
  color: white;
  background: var(--primary-strong);
  font-weight: 740;
  cursor: pointer;
}

.dialog-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.82rem;
}

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

.code-entry-form {
  display: grid;
  gap: 0.5rem;
}

.code-entry-form label {
  color: var(--muted-strong);
  font-size: 0.84rem;
  font-weight: 680;
}

.code-entry-form > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
}

.code-entry-form input {
  min-width: 0;
  min-height: 2.85rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.65rem 0.8rem;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.live-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.live-list-summary {
  display: grid;
  gap: 0.18rem;
}

.live-list-summary small {
  color: var(--muted);
  font-size: 0.72rem;
}

.text-button {
  border: 0;
  padding: 0.35rem;
  color: var(--primary);
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}

.public-lives-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  max-height: min(32rem, calc(100dvh - 16rem));
  overflow-y: auto;
  padding: 0.15rem 0.2rem 0.35rem 0;
}

.public-live-card {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 0.7rem;
}

.public-live-watch {
  min-width: 0;
  display: grid;
  gap: 0.7rem;
  border: 0;
  border-radius: 11px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.public-live-share {
  position: absolute;
  z-index: 2;
  top: 0.62rem;
  right: 0.62rem;
  min-height: 2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid oklch(1 0 0 / 0.2);
  border-radius: 6px;
  padding: 0.34rem 0.48rem;
  color: white;
  background: oklch(0.05 0 0 / 0.78);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 800;
  cursor: pointer;
}

.public-live-share svg {
  width: 0.85rem;
  height: 0.85rem;
  stroke: currentColor;
  stroke-width: 1.8;
}

.public-live-share:hover,
.public-live-share:focus-visible,
.public-live-share.is-copied {
  border-color: oklch(0.72 0.16 24 / 0.8);
  color: oklch(0.84 0.11 24);
}

.public-live-card span,
.public-live-card strong {
  display: block;
}

.public-live-thumbnail {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 11px;
  background:
    radial-gradient(circle at 50% 35%, oklch(0.22 0.03 24), transparent 48%),
    oklch(0.08 0 0);
  transition:
    border-color 180ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 180ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.public-live-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.public-live-card:hover .public-live-thumbnail {
  border-color: oklch(0.65 0.18 24 / 0.72);
  box-shadow: 0 12px 26px oklch(0 0 0 / 0.3);
  transform: translateY(-2px);
}

.public-live-card:hover .public-live-thumbnail img {
  transform: scale(1.025);
}

.public-live-preview-placeholder {
  position: absolute;
  inset: 0;
  display: grid !important;
  place-content: center;
  justify-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.public-live-placeholder-icon {
  position: relative;
  width: 2.85rem;
  height: 2.85rem;
  border: 1px solid oklch(0.65 0.18 24 / 0.45);
  border-radius: 50%;
  background: oklch(0.65 0.18 24 / 0.13);
  box-shadow: 0 0 0 0.5rem oklch(0.65 0.18 24 / 0.05);
}

.public-live-placeholder-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 54%;
  border-top: 0.42rem solid transparent;
  border-bottom: 0.42rem solid transparent;
  border-left: 0.66rem solid oklch(0.72 0.16 24);
  transform: translate(-50%, -50%);
}

.public-live-badge,
.public-live-audience {
  position: absolute;
  z-index: 1;
  border-radius: 5px;
  color: white;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.public-live-badge {
  top: 0.65rem;
  left: 0.65rem;
  padding: 0.32rem 0.46rem;
  background: oklch(0.54 0.21 25 / 0.94);
}

.public-live-audience {
  right: 0.65rem;
  bottom: 0.65rem;
  padding: 0.3rem 0.45rem;
  background: oklch(0.05 0 0 / 0.78);
  letter-spacing: 0;
}

.public-live-info {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0 0.15rem;
}

.public-live-avatar {
  width: 2.35rem;
  height: 2.35rem;
  display: grid !important;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--ink);
  background: var(--surface);
  font-size: 0.85rem;
  font-weight: 780;
}

.public-live-copy {
  min-width: 0;
}

.public-live-copy strong {
  overflow: hidden;
  font-size: 0.9rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.public-live-copy span {
  margin-top: 0.22rem;
  color: var(--muted);
  font-size: 0.77rem;
}

.public-live-arrow {
  color: var(--muted);
  font-size: 1.1rem;
  transition:
    color 180ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.public-live-card:hover .public-live-arrow {
  color: oklch(0.72 0.16 24);
  transform: translateX(3px);
}

.public-lives-empty {
  padding: 1.5rem 0.5rem;
  color: var(--muted);
  text-align: center;
}

.profile-field {
  display: grid;
  gap: 0.45rem;
  color: var(--muted-strong);
  font-size: 0.86rem;
  font-weight: 720;
}

.profile-field input {
  width: 100%;
  min-height: 2.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.78rem;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
}

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

.profile-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.55rem;
  min-width: 0;
  border: 0;
  margin: 0;
  padding: 0;
}

.profile-options legend {
  grid-column: 1 / -1;
  margin-bottom: 0.45rem;
  color: var(--muted-strong);
  font-size: 0.86rem;
  font-weight: 720;
}

.profile-options label {
  min-width: 0;
  cursor: pointer;
}

.profile-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.profile-options label > span {
  min-height: 3.05rem;
  display: flex;
  align-items: center;
  gap: 0.52rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.66rem 0.72rem;
  color: var(--muted-strong);
  background: var(--surface);
  font-size: 0.88rem;
  font-weight: 700;
}

.profile-options strong {
  width: 1.45rem;
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 1.18rem;
  line-height: 1;
  text-align: center;
}

.profile-options input:checked + span {
  border-color: oklch(0.63 0.16 150 / 0.72);
  color: var(--ink);
  background: oklch(0.18 0.04 150);
}

.profile-options input:focus-visible + span {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.profile-feedback {
  min-height: 1.15rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.profile-feedback.is-error {
  color: oklch(0.86 0.11 28);
}

.profile-submit {
  min-height: 2.8rem;
  border: 0;
  border-radius: 8px;
  padding: 0.72rem 0.9rem;
  color: white;
  background: var(--primary-strong);
  cursor: pointer;
  font-weight: 760;
}

.profile-submit:hover {
  background: var(--primary);
}

.chat-panel {
  position: absolute;
  left: 1.5rem;
  bottom: 1.5rem;
  z-index: 4;
  width: min(23rem, calc(100% - 3rem));
  max-height: min(29rem, calc(100% - 3rem));
  display: grid;
  grid-template-rows: auto minmax(4rem, 1fr) auto auto auto;
  overflow: hidden;
  border: 1px solid oklch(0.32 0.012 150);
  border-radius: 10px;
  background: oklch(0.09 0 0 / 0.9);
  box-shadow: 0 6px 8px oklch(0 0 0 / 0.34);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem 0.62rem;
  border-bottom: 1px solid oklch(0.26 0.01 150);
}

.chat-header h2 {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.2;
}

.chat-header span {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.chat-toggle-button {
  width: 2.15rem;
  height: 2.15rem;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted-strong);
  background: var(--surface-strong);
  cursor: pointer;
}

.chat-toggle-button:hover {
  border-color: oklch(0.63 0.16 150 / 0.6);
  color: var(--ink);
}

.chat-reopen-button {
  position: absolute;
  left: 1.5rem;
  bottom: 1.5rem;
  z-index: 4;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid oklch(0.32 0.012 150);
  border-radius: 999px;
  padding: 0.62rem 0.82rem;
  color: var(--ink);
  background: oklch(0.09 0 0 / 0.92);
  box-shadow: 0 6px 8px oklch(0 0 0 / 0.3);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  cursor: pointer;
  font-weight: 760;
}

.chat-reopen-button:hover {
  border-color: oklch(0.63 0.16 150 / 0.6);
}

.chat-reopen-count {
  min-width: 1.32rem;
  height: 1.32rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  padding: 0 0.28rem;
  color: white;
  background: var(--primary-strong);
  font-size: 0.72rem;
  line-height: 1;
}

.chat-messages {
  display: grid;
  align-content: start;
  gap: 0.55rem;
  min-height: 0;
  margin: 0;
  padding: 0.75rem;
  overflow-y: auto;
  list-style: none;
}

.chat-empty {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.chat-message {
  display: grid;
  justify-items: start;
  gap: 0.28rem;
}

.chat-message.is-mine {
  justify-items: end;
}

.chat-bubble {
  max-width: min(17rem, 86%);
  overflow: hidden;
  border: 1px solid oklch(0.28 0.01 150);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  color: var(--ink);
  background: var(--surface-strong);
}

.chat-message.is-mine .chat-bubble {
  border-color: oklch(0.56 0.15 150 / 0.6);
  background: oklch(0.34 0.11 150);
}

.chat-bubble p {
  margin: 0;
  color: inherit;
  font-size: 0.9rem;
  line-height: 1.42;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-image-button {
  display: block;
  max-width: 100%;
  margin-top: 0.45rem;
  border: 0;
  border-radius: 8px;
  padding: 0;
  color: inherit;
  background: transparent;
  cursor: zoom-in;
}

.chat-image-button:first-child {
  margin-top: 0;
}

.chat-image-button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.chat-image-button img {
  display: block;
  max-width: 100%;
  max-height: 12rem;
  border-radius: 8px;
  object-fit: cover;
}

.chat-view-once-tile,
.chat-destroyed-photo {
  min-width: min(12.5rem, 100%);
  min-height: 5.4rem;
  display: grid;
  place-items: center;
  gap: 0.45rem;
  border-radius: 8px;
  padding: 0.85rem;
  color: var(--muted-strong);
  background: oklch(0.11 0.006 150);
  text-align: center;
  font-size: 0.82rem;
  font-weight: 760;
}

.chat-view-once-tile svg {
  width: 1.6rem;
  height: 1.6rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.chat-image-button.is-view-once {
  cursor: pointer;
}

.chat-destroyed-photo {
  min-height: 3.2rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.chat-meta {
  color: var(--muted);
  font-size: 0.7rem;
}

.chat-feedback {
  min-height: 1.2rem;
  padding: 0 0.85rem;
  color: oklch(0.82 0.11 82);
  font-size: 0.78rem;
}

.chat-feedback.is-error {
  color: oklch(0.86 0.11 28);
}

.chat-image-preview {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0.75rem 0.65rem;
  padding: 0.5rem;
  border: 1px solid oklch(0.3 0.01 150);
  border-radius: 8px;
  background: oklch(0.13 0.006 150);
}

.chat-image-preview img {
  width: 3rem;
  height: 3rem;
  border-radius: 6px;
  object-fit: cover;
}

.chat-image-preview span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted-strong);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-view-once {
  min-height: 2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0.32rem 0.5rem;
  color: var(--muted-strong);
  background: oklch(0.18 0.006 150);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.chat-view-once input {
  width: 0.9rem;
  height: 0.9rem;
  margin: 0;
  accent-color: var(--primary);
}

.chat-view-once:has(input:checked) {
  border-color: oklch(0.63 0.16 150 / 0.72);
  color: var(--ink);
  background: oklch(0.18 0.04 150);
}

.chat-image-remove {
  min-height: 2rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0.32rem 0.5rem;
  color: var(--muted-strong);
  background: transparent;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 700;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2.55rem 2.55rem;
  gap: 0.45rem;
  padding: 0.72rem;
  border-top: 1px solid oklch(0.26 0.01 150);
}

.chat-form textarea {
  min-height: 2.55rem;
  max-height: 6.5rem;
  resize: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.68rem 0.72rem;
  color: var(--ink);
  background: oklch(0.13 0.006 150);
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.35;
}

.chat-form textarea::placeholder {
  color: var(--muted);
}

.chat-form textarea:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.chat-icon-button,
.chat-send-button {
  min-width: 2.55rem;
  min-height: 2.55rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface-strong);
  cursor: pointer;
}

.chat-send-button {
  border-color: var(--primary-strong);
  background: var(--primary-strong);
}

.chat-icon-button:hover,
.chat-send-button:hover {
  border-color: oklch(0.63 0.16 150 / 0.6);
}

.chat-icon-button:disabled,
.chat-send-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.chat-icon-button svg,
.chat-send-button svg,
.chat-toggle-button svg,
.chat-reopen-button svg,
.chat-image-dialog-close svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.chat-image-dialog {
  width: min(calc(100vw - 2rem), 58rem);
  max-height: calc(100dvh - 2rem);
  overflow: hidden;
  border: 1px solid oklch(0.32 0.012 150);
  border-radius: 10px;
  padding: 0;
  color: var(--ink);
  background: oklch(0.07 0 0);
}

.chat-image-dialog::backdrop {
  background: oklch(0.02 0 0 / 0.82);
}

.chat-image-dialog-inner {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: calc(100dvh - 2rem);
}

.chat-image-dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.25rem;
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 0.8rem;
}

.chat-image-dialog h2 {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.2;
}

.chat-image-dialog-close {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface-strong);
  cursor: pointer;
}

.chat-image-dialog-close:hover {
  border-color: oklch(0.63 0.16 150 / 0.6);
}

.chat-image-dialog img {
  display: block;
  width: 100%;
  max-height: calc(100dvh - 7.5rem);
  object-fit: contain;
  background: oklch(0.02 0 0);
}

.chat-image-dialog p {
  margin: 0;
  min-height: 2.3rem;
  padding: 0.62rem 0.85rem;
  color: var(--muted-strong);
  font-size: 0.78rem;
}

.controls {
  display: flex;
  align-items: start;
  justify-content: center;
  gap: clamp(0.9rem, 4vw, 4rem);
  min-height: 6.3rem;
}

.control-button {
  width: var(--control-size);
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  border: 0;
  color: var(--muted-strong);
  background: transparent;
  cursor: pointer;
}

.media-control-mobile {
  display: none;
}

body[data-media-control-mode="mobile"] .media-control-mobile:not([hidden]) {
  display: grid;
}

body[data-media-control-mode="mobile"] .media-control-desktop {
  display: none;
}

.media-control-feedback {
  position: fixed;
  left: 50%;
  bottom: max(7rem, calc(env(safe-area-inset-bottom) + 6rem));
  z-index: 30;
  max-width: min(28rem, calc(100vw - 2rem));
  margin: 0;
  border: 1px solid oklch(0.45 0.08 150);
  border-radius: 999px;
  padding: 0.58rem 0.85rem;
  color: var(--ink);
  background: oklch(0.13 0.02 150 / 0.96);
  box-shadow: 0 5px 18px oklch(0 0 0 / 0.32);
  font-size: 0.84rem;
  font-weight: 680;
  text-align: center;
  transform: translateX(-50%);
}

.media-control-feedback.is-error {
  border-color: oklch(0.55 0.16 25);
  background: oklch(0.16 0.06 25 / 0.97);
}

.control-button svg {
  width: var(--control-size);
  height: var(--control-size);
  padding: calc(var(--control-size) * 0.28);
  border-radius: 50%;
  color: var(--ink);
  background: var(--surface-strong);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, opacity 160ms ease;
}

.control-button span {
  font-size: 0.94rem;
  font-weight: 560;
}

.control-button:hover svg {
  transform: translateY(-1px);
  background: oklch(0.28 0.012 150);
}

.control-button.primary svg {
  color: white;
  background: var(--primary-strong);
}

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

.control-button.participation svg {
  color: oklch(0.12 0.02 150);
  background: var(--primary);
}

.control-button.participation:hover svg {
  background: var(--focus);
}

.control-button.participation.is-pending svg {
  color: var(--primary);
  background: oklch(0.17 0.025 150);
}

.control-button.feed svg {
  color: var(--primary);
  background: oklch(0.17 0.025 150);
}

.control-button.feed:hover svg {
  color: oklch(0.12 0.02 150);
  background: var(--primary);
}

.control-button.danger svg {
  color: white;
  background: var(--danger-strong);
}

.control-button.danger svg.material-call-end {
  padding: calc(var(--control-size) * 0.23);
  fill: currentColor;
  stroke: none;
}

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

.control-button[aria-pressed="false"] svg {
  color: var(--muted);
  background: oklch(0.18 0.006 150);
}

.control-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.control-button:disabled svg {
  transform: none;
}

@keyframes sweep {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes statusPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0.28rem oklch(0.63 0.16 150 / 0.1);
  }
  50% {
    box-shadow: 0 0 0 0.48rem oklch(0.63 0.16 150 / 0.18);
  }
}

@media (max-width: 760px) {
  :root {
    --control-size: 3.85rem;
  }

  .app-shell {
    padding: 0.8rem;
    padding-top: max(0.8rem, env(safe-area-inset-top));
    padding-right: max(0.8rem, env(safe-area-inset-right));
    padding-bottom: max(0.8rem, env(safe-area-inset-bottom));
    padding-left: max(0.8rem, env(safe-area-inset-left));
    gap: 0.8rem;
  }

  .topbar {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 0.65rem;
    padding: 0.2rem 0;
  }

  .brand {
    justify-self: start;
    font-size: 1.1rem;
  }

  .status {
    grid-column: 1;
    min-width: 0;
    font-size: 0.9rem;
  }

  .stage {
    min-height: 24rem;
  }

  .center-state {
    padding: 1.25rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .entry-actions {
    grid-template-columns: 1fr;
    gap: 0.55rem;
    width: min(100%, 32rem);
  }

  .mode-card {
    min-height: 0;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem;
  }

  .mode-card-icon {
    width: 2.55rem;
    height: 2.55rem;
  }

  .mode-card-content {
    grid-column: auto;
    align-self: center;
    gap: 0.25rem;
  }

  .mode-card-content > span {
    font-size: 0.8rem;
    line-height: 1.35;
  }

  .mode-card--quick {
    grid-template-rows: auto auto;
  }

  .mode-card--quick .mode-card-quick-actions {
    grid-column: 1 / -1;
  }

  .local-preview {
    top: 0.8rem;
    right: 0.8rem;
    bottom: auto;
    width: min(12.5rem, 42vw);
  }

  .live-requests-panel {
    top: 4.3rem;
    right: 0.8rem;
    width: min(20rem, calc(100% - 1.6rem));
  }

  .live-participation-feedback {
    bottom: 0.8rem;
  }

  .chat-panel {
    left: 0.8rem;
    right: 0.8rem;
    bottom: 0.8rem;
    width: auto;
    max-height: min(14rem, calc(100% - 7rem));
    grid-template-rows: auto minmax(2.8rem, 1fr) auto auto auto;
  }

  .chat-header {
    padding: 0.58rem 0.7rem 0.5rem;
  }

  .chat-messages {
    gap: 0.42rem;
    padding: 0.55rem 0.65rem;
  }

  .chat-form {
    grid-template-columns: minmax(0, 1fr) 2.35rem 2.35rem;
    gap: 0.38rem;
    padding: 0.55rem;
  }

  .chat-form textarea {
    min-height: 2.35rem;
    padding: 0.58rem 0.62rem;
  }

  .chat-icon-button,
  .chat-send-button {
    min-width: 2.35rem;
    min-height: 2.35rem;
  }

  .chat-reopen-button {
    left: 0.8rem;
    bottom: 0.8rem;
  }

  .chat-bubble {
    max-width: 92%;
  }

  .profile-dialog {
    width: min(calc(100vw - 1rem), 34rem);
  }

  .lives-dialog {
    width: min(calc(100vw - 1rem), 60rem);
  }

  .public-lives-list {
    grid-template-columns: 1fr;
    max-height: min(34rem, calc(100dvh - 15rem));
  }

  .profile-dialog-inner {
    padding: 0.9rem;
  }

  .profile-options {
    grid-template-columns: repeat(auto-fit, minmax(7.6rem, 1fr));
  }

  .controls {
    width: 100%;
    justify-content: space-between;
    gap: 0.25rem;
    min-height: 5.4rem;
  }

  .control-button {
    width: auto;
    min-width: 0;
    flex: 1 1 0;
  }

  .control-button span {
    width: 100%;
    overflow: hidden;
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .chat-form textarea,
  .code-entry-form input,
  .profile-field input {
    font-size: 16px;
  }
}

@media (max-width: 460px) {
  :root {
    --control-size: 3.25rem;
  }

  .stage {
    min-height: 22rem;
  }

  .room-meta {
    top: 0.7rem;
    left: 0.7rem;
    max-width: calc(100% - 1.4rem);
  }

  .live-requests-panel {
    top: 4rem;
    left: 0.7rem;
    right: 0.7rem;
    width: auto;
  }

  .room-code-button {
    min-width: 0;
    width: 100%;
  }

  .local-preview {
    width: 8.8rem;
  }

  .chat-panel {
    max-height: min(12rem, calc(100% - 8.5rem));
  }

  .center-state h1 {
    font-size: 1.22rem;
  }

  .center-state p {
    font-size: 0.9rem;
  }

  .center-state {
    gap: 0.7rem;
    padding: 1rem;
  }

  .mode-card {
    gap: 0.7rem;
    padding: 0.7rem;
  }

  .mode-card-icon {
    width: 2.35rem;
    height: 2.35rem;
  }

  .mode-card-icon svg {
    width: 1.35rem;
    height: 1.35rem;
  }

  .mode-card-content strong {
    font-size: 0.92rem;
  }

  .mode-card-content > span {
    font-size: 0.75rem;
  }

  .radar {
    width: 7.1rem;
    height: 7.1rem;
  }

  .control-button span {
    font-size: 0.68rem;
  }
}

@media (max-width: 340px) {
  .center-state {
    place-content: start center;
    gap: 0.55rem;
    padding: 0.75rem;
  }

  .center-state h1 {
    max-width: none;
    font-size: 1.05rem;
  }

  .center-state p {
    margin-top: 0;
    font-size: 0.82rem;
    line-height: 1.35;
  }

  .controls {
    gap: 0.15rem;
  }

  .mode-card {
    padding: 0.62rem;
  }

  .mode-card-content > span {
    display: none;
  }

  .mode-card--quick .mode-card-quick-actions {
    padding-top: 0.5rem;
  }

  .mode-card-quick-action {
    min-height: 2.75rem;
    padding: 0.45rem;
    font-size: 0.7rem;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  :root {
    --control-size: 3rem;
  }

  .app-shell {
    padding: 0.5rem;
    padding-top: max(0.5rem, env(safe-area-inset-top));
    padding-right: max(0.5rem, env(safe-area-inset-right));
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
    padding-left: max(0.5rem, env(safe-area-inset-left));
    gap: 0.5rem;
  }

  .topbar {
    min-height: 2.5rem;
    grid-template-columns: 1fr auto 1fr;
    justify-items: stretch;
    gap: 0.5rem;
    padding: 0 0.5rem;
  }

  .brand {
    grid-column: 1;
    justify-self: start;
    font-size: 1rem;
  }

  .brand-mark {
    width: 1.65rem;
    height: 1.65rem;
  }

  .status {
    grid-column: 2;
    min-width: 0;
    font-size: 0.82rem;
  }

  .stage {
    min-height: 15rem;
  }

  .center-state {
    place-content: center;
    gap: 0.45rem;
    padding: 0.65rem;
  }

  .center-state h1 {
    font-size: 1.12rem;
  }

  .center-state p {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.3;
  }

  .entry-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
    width: min(100%, 60rem);
    margin-top: 0.15rem;
  }

  .mode-card {
    min-height: 7rem;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem;
  }

  .mode-card-icon {
    width: 2.15rem;
    height: 2.15rem;
  }

  .mode-card-icon svg {
    width: 1.2rem;
    height: 1.2rem;
  }

  .mode-card-content {
    grid-column: auto;
    align-self: center;
    gap: 0.18rem;
  }

  .mode-card-content strong {
    font-size: 0.83rem;
  }

  .mode-card-content > span {
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.67rem;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .mode-card--quick {
    grid-template-rows: auto auto;
  }

  .mode-card--quick .mode-card-quick-actions {
    grid-column: 1 / -1;
    gap: 0.35rem;
    padding-top: 0.4rem;
  }

  .mode-card-quick-action {
    min-height: 2.5rem;
    padding: 0.4rem;
    font-size: 0.68rem;
  }

  .controls {
    min-height: 4rem;
    gap: 0.5rem;
  }

  .control-button {
    width: 4rem;
    gap: 0.25rem;
  }

  .control-button span {
    font-size: 0.66rem;
  }

  .profile-dialog,
  .chat-image-dialog {
    max-height: calc(100vh - 1rem);
    max-height: calc(100dvh - 1rem);
  }

  .profile-dialog-inner,
  .chat-image-dialog-inner {
    max-height: calc(100vh - 1rem);
    max-height: calc(100dvh - 1rem);
  }
}

@media (pointer: coarse) {
  .mode-card-quick-action,
  .dialog-close,
  .chat-toggle-button,
  .chat-icon-button,
  .chat-send-button,
  .chat-image-dialog-close,
  .live-request-action {
    min-width: 2.75rem;
    min-height: 2.75rem;
  }

  .brand {
    min-height: 2.75rem;
  }

  .mode-card:hover,
  .mode-card-quick-action:hover,
  .public-live-card:hover .public-live-thumbnail {
    transform: none;
  }
}

@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;
  }
}

.seo-content {
  border-top: 1px solid var(--border);
  background: oklch(0.075 0 0);
  color: var(--ink);
}

.seo-content[hidden] {
  display: none;
}

.seo-inner {
  width: min(100%, 74rem);
  margin: 0 auto;
  padding: 4.5rem 1.25rem 5rem;
}

.seo-lede {
  max-width: 50rem;
}

.seo-lede h1,
.seo-grid h3 {
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}

.seo-lede h1 {
  font-size: 1.75rem;
  line-height: 1.15;
}

.seo-lede p,
.seo-grid p,
.faq p {
  color: var(--muted-strong);
  line-height: 1.65;
  text-wrap: pretty;
}

.seo-lede p {
  margin: 1rem 0 0;
  max-width: 68ch;
}

.seo-note {
  color: var(--muted);
  font-size: 0.9rem;
}

.seo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 2.25rem;
}

.seo-grid article {
  padding: 1.1rem 0;
}

.seo-grid h3 {
  font-size: 1rem;
  line-height: 1.3;
}

.seo-grid p {
  margin: 0.7rem 0 0;
  font-size: 0.96rem;
}

.seo-related {
  display: grid;
  gap: 0.85rem;
  max-width: 52rem;
  margin-top: 1.75rem;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}

.seo-related h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.3;
}

.seo-related ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.seo-related a {
  min-height: 2.35rem;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.48rem 0.72rem;
  color: var(--muted-strong);
  background: var(--bg-elevated);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 700;
}

.seo-related a:hover {
  color: var(--ink);
  border-color: oklch(0.63 0.16 150 / 0.6);
}

.faq {
  display: grid;
  gap: 0.6rem;
  max-width: 52rem;
  margin-top: 2rem;
}

.faq details {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
}

.faq summary {
  cursor: pointer;
  padding: 0.95rem 1rem;
  color: var(--ink);
  font-weight: 700;
}

.faq summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.faq p {
  margin: 0;
  padding: 0 1rem 1rem;
  font-size: 0.95rem;
}

@media (max-width: 760px) {
  .seo-inner {
    padding: 3rem 0.9rem 3.5rem;
  }

  .seo-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

.seo-page {
  min-height: 100vh;
  background: var(--bg);
}

.seo-page-topbar {
  width: min(100%, 76rem);
  min-height: 4.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 auto;
  padding: 1rem 1.25rem;
}

.seo-topic-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.seo-topic-nav a,
.seo-breadcrumb a {
  color: var(--muted-strong);
  text-decoration: none;
}

.seo-topic-nav a {
  min-height: 2.35rem;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.48rem 0.72rem;
  background: var(--bg-elevated);
  font-size: 0.84rem;
  font-weight: 700;
}

.seo-topic-nav a:hover,
.seo-breadcrumb a:hover {
  color: var(--ink);
}

.seo-page-main {
  width: min(100%, 76rem);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 5rem;
}

.seo-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.seo-page-hero {
  max-width: 55rem;
  padding: 2.5rem 0 2.25rem;
}

.seo-page-hero h1 {
  max-width: 16ch;
  margin: 0;
  font-size: 2.25rem;
  line-height: 1.08;
  text-wrap: balance;
}

.seo-page-hero p {
  max-width: 68ch;
  margin: 1rem 0 0;
  color: var(--muted-strong);
  line-height: 1.65;
  text-wrap: pretty;
}

.seo-page-hero .join-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1.35rem;
  text-decoration: none;
}

.seo-topic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

.seo-topic-grid article {
  min-width: 0;
  padding-top: 0.25rem;
}

.seo-topic-grid h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.3;
  text-wrap: balance;
}

.seo-topic-grid p {
  margin: 0.72rem 0 0;
  color: var(--muted-strong);
  font-size: 0.96rem;
  line-height: 1.65;
  text-wrap: pretty;
}

.seo-topic-faq {
  margin-top: 2.5rem;
}

@media (max-width: 760px) {
  .seo-page-topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 0.85rem 0.9rem;
  }

  .seo-topic-nav {
    justify-content: flex-start;
  }

  .seo-page-main {
    padding: 2rem 0.9rem 3.5rem;
  }

  .seo-page-hero {
    padding: 2rem 0;
  }

  .seo-page-hero h1 {
    font-size: 1.65rem;
  }

  .seo-topic-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}
