:root {
  color-scheme: dark;
  --bg: #08090b;
  --surface: #0f1115;
  --surface-2: #15181e;
  --line: rgba(240, 236, 222, 0.12);
  --line-strong: rgba(240, 236, 222, 0.22);
  --text: #f0ecde;
  --muted: #8e8f8c;
  --dim: #5f6267;
  --accent: #d7ff6a;
  --accent-ink: #11140a;
  --cool: #69d7ff;
  --danger: #ff806e;
  --radius: 7px;
  --font-display: "Avenir Next Condensed", "DIN Condensed", "Helvetica Neue", sans-serif;
  --font-body: -apple-system, "SF Pro Text", "PingFang SC", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 46% -30%, rgba(105, 215, 255, 0.08), transparent 38%),
    linear-gradient(rgba(255,255,255,0.014) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 100% 56px, auto;
}

button, input, select { font: inherit; }
button { color: inherit; }

button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.topbar {
  height: 74px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 9, 11, 0.78);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 30;
}

.brand {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.brand-mark {
  width: 30px;
  height: 22px;
  display: flex;
  gap: 3px;
  align-items: flex-end;
  transform: skew(-9deg);
}

.brand-mark i {
  width: 7px;
  background: var(--text);
  display: block;
}

.brand-mark i:nth-child(1) { height: 12px; opacity: 0.45; }
.brand-mark i:nth-child(2) { height: 18px; opacity: 0.72; }
.brand-mark i:nth-child(3) { height: 22px; }

.brand-word {
  font-family: var(--font-display);
  letter-spacing: 0.2em;
  font-size: 14px;
  font-weight: 700;
}

.room-identity {
  display: grid;
  justify-items: center;
  gap: 2px;
  position: relative;
}

.eyebrow {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.room-code {
  appearance: none;
  border: 0;
  color: var(--text);
  background: transparent;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.14em;
  cursor: pointer;
  padding: 0;
}

.copy-feedback {
  position: absolute;
  top: 39px;
  white-space: nowrap;
  color: var(--dim);
  font-size: 10px;
  opacity: 0;
  transition: opacity 180ms ease;
}

.room-identity:hover .copy-feedback, .copy-feedback.visible { opacity: 1; }

.topbar-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
}

.network-pill {
  height: 34px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.network-pill strong { color: var(--text); font-variant-numeric: tabular-nums; }
.network-pill[data-quality="good"] .signal-bars i { background: var(--accent); }
.network-pill[data-quality="fair"] .signal-bars i:nth-child(-n+2) { background: #ffd66a; }
.network-pill[data-quality="poor"] .signal-bars i:first-child { background: var(--danger); }

.signal-bars {
  height: 13px;
  display: flex;
  align-items: end;
  gap: 2px;
}

.signal-bars i {
  width: 2px;
  background: var(--dim);
}
.signal-bars i:nth-child(1) { height: 5px; }
.signal-bars i:nth-child(2) { height: 9px; }
.signal-bars i:nth-child(3) { height: 13px; }

.quiet-button, .avatar-button {
  border: 1px solid var(--line);
  background: transparent;
  height: 34px;
  cursor: pointer;
}

.quiet-button {
  padding: 0 15px;
  font-size: 12px;
}

.avatar-button {
  width: 34px;
  border-radius: 50%;
  border-color: rgba(215, 255, 106, 0.5);
  background: rgba(215, 255, 106, 0.1);
  color: var(--accent);
  font-weight: 700;
}

.layout {
  width: min(1680px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 336px;
  min-height: calc(100vh - 74px);
}

.theater-panel {
  padding: clamp(24px, 3.5vw, 52px);
  min-width: 0;
}

.theater-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.theater-heading h1 {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.5vw, 40px);
  line-height: 1;
  margin: 6px 0 0;
  letter-spacing: 0.02em;
  font-weight: 600;
}

.live-state {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.live-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(215,255,106,.09);
}

.screen-shell {
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  background: #030405;
  border: 1px solid var(--line-strong);
  box-shadow:
    0 28px 90px rgba(0,0,0,.55),
    0 0 0 1px rgba(255,255,255,.025) inset;
}

.screen-shell::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: radial-gradient(ellipse at 50% 115%, rgba(215,255,106,.08), transparent 48%);
  pointer-events: none;
  z-index: 1;
}

#video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  opacity: 0;
  transition: opacity 400ms ease;
}

.screen-shell.has-media #video { opacity: 1; }

.screen-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: .08;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.28'/%3E%3C/svg%3E");
}

.empty-state {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
  background:
    linear-gradient(110deg, transparent 0 44%, rgba(255,255,255,.015) 44% 44.2%, transparent 44.2%),
    #050608;
  transition: opacity 300ms ease, visibility 300ms ease;
}

.has-media .empty-state { opacity: 0; visibility: hidden; }

.aperture {
  width: 58px;
  height: 58px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  position: relative;
  margin-bottom: 24px;
}

.aperture::before, .aperture::after, .aperture span {
  content: "";
  position: absolute;
  width: 1px;
  height: 34px;
  background: var(--line-strong);
  left: 28px;
  top: 11px;
}
.aperture::before { transform: rotate(60deg); }
.aperture::after { transform: rotate(-60deg); }

.empty-kicker {
  color: var(--accent);
  letter-spacing: .23em;
  font-size: 9px;
  font-weight: 700;
  margin: 0 0 12px;
}

.empty-state h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(23px, 3vw, 44px);
  margin: 0;
  max-width: 780px;
}

.empty-state > p:not(.empty-kicker) {
  color: var(--muted);
  font-size: 13px;
  margin: 14px 0 24px;
}

.empty-state .primary-button {
  position: relative;
  z-index: 9;
  pointer-events: auto;
}

.primary-button, .secondary-button {
  min-height: 42px;
  padding: 0 20px;
  border-radius: 2px;
  cursor: pointer;
  border: 1px solid transparent;
  font-weight: 650;
  font-size: 12px;
}

.primary-button {
  background: var(--accent);
  color: var(--accent-ink);
}

.primary-button:disabled { opacity: .5; cursor: wait; }
.secondary-button { background: transparent; border-color: var(--line-strong); }

.center-play {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(.9);
  width: 72px;
  height: 72px;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 50%;
  background: rgba(5,6,8,.42);
  backdrop-filter: blur(8px);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
}

.has-media.paused .center-play {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.center-play span,
.play-button span {
  display: block;
  width: 12px;
  height: 14px;
  border: 0;
  background: currentColor;
  clip-path: polygon(12% 0, 100% 50%, 12% 100%);
  transform: translateX(1px);
}

.screen-shell:not(.paused) .play-button span {
  width: 12px;
  height: 14px;
  background:
    linear-gradient(to right,
      currentColor 0 4px,
      transparent 4px 8px,
      currentColor 8px 12px);
  clip-path: none;
  transform: none;
}

.center-play span {
  width: 18px;
  height: 22px;
  transform: translateX(2px);
}

.play-button {
  width: 36px;
  min-width: 36px;
  padding: 0;
}

.video-controls {
  position: absolute;
  z-index: 6;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 60px 22px 18px;
  background: linear-gradient(transparent, rgba(0,0,0,.86));
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.screen-shell:not(.has-media) .video-controls {
  pointer-events: none;
}

.has-media:hover .video-controls, .has-media.controls-visible .video-controls {
  opacity: 1;
  transform: none;
}

.timeline-wrap { display: grid; gap: 7px; }

input[type="range"] {
  --value: 0%;
  appearance: none;
  height: 3px;
  margin: 0;
  background: linear-gradient(to right, var(--accent) var(--value), rgba(255,255,255,.24) var(--value));
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(215,255,106,.12);
}

.timeline-meta {
  display: flex;
  justify-content: space-between;
  color: rgba(255,255,255,.65);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.control-row, .control-group {
  display: flex;
  align-items: center;
}

.control-row {
  justify-content: space-between;
  gap: 16px;
  margin-top: 6px;
}

.control-group { gap: 4px; }
.control-group-right { gap: 10px; }

.control-button {
  min-width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: rgba(255,255,255,.84);
  font-size: 10px;
}

.control-button:hover { color: var(--accent); }

.volume-button span {
  width: 9px;
  height: 11px;
  display: block;
  background: currentColor;
  clip-path: polygon(0 30%, 38% 30%, 100% 0, 100% 100%, 38% 70%, 0 70%);
}

.volume-slider { width: 62px; }
.fullscreen-button span { width: 14px; height: 14px; border: 1px solid currentColor; }
.text-control { width: auto; padding: 0 8px; }

.sync-badge {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--accent);
  padding: 5px 8px;
  background: rgba(215,255,106,.08);
  border: 1px solid rgba(215,255,106,.18);
}

.reaction-layer {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  overflow: hidden;
}

.floating-reaction {
  position: absolute;
  left: var(--x);
  bottom: 7%;
  font-family: var(--font-display);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  border: 1px solid rgba(215,255,106,.4);
  padding: 7px 10px;
  animation: float-away 1.8s ease-out forwards;
}

@keyframes float-away {
  to { transform: translateY(-170px) rotate(var(--rotate)); opacity: 0; }
}

.under-screen {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 18px 2px 0;
}

.source-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.source-icon {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--muted);
  font: 700 8px var(--font-display);
  letter-spacing: .1em;
}

.source-summary > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.source-summary strong { font-size: 12px; }
.source-summary span:last-child {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 45vw;
}

.reaction-bar { display: flex; align-items: center; gap: 6px; }
.reaction-bar > span { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }

.reaction-bar button {
  height: 32px;
  min-width: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}
.reaction-bar button:hover { border-color: var(--line-strong); color: var(--text); }
.reaction-bar .take-control-button { color: var(--accent); }

.side-panel {
  border-left: 1px solid var(--line);
  background: rgba(15,17,21,.62);
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 74px);
}

.side-tabs {
  height: 58px;
  padding: 0 18px;
  display: flex;
  gap: 20px;
  align-items: end;
  border-bottom: 1px solid var(--line);
}

.side-tab {
  height: 58px;
  padding: 0 2px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  position: relative;
}

.side-tab.active { color: var(--text); border-color: var(--accent); }
.side-tab span:not(.unread-dot) { color: var(--dim); margin-left: 4px; }

.unread-dot {
  display: none;
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  right: -7px;
  top: 15px;
}
.unread-dot.visible { display: block; }

.tab-content {
  display: none;
  padding: 22px 18px;
  flex: 1;
  min-height: 0;
}
.tab-content.active { display: flex; flex-direction: column; }

.section-label {
  display: flex;
  justify-content: space-between;
  color: var(--dim);
  font-size: 9px;
  letter-spacing: .14em;
  margin-bottom: 14px;
}

.member-list { display: grid; gap: 4px; }

.member-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 5px 7px;
}

.member-item.you { background: rgba(255,255,255,.025); }

.member-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: hsl(var(--hue) 18% 20%);
  border: 1px solid hsl(var(--hue) 35% 34%);
  color: hsl(var(--hue) 60% 76%);
  font-size: 11px;
  font-weight: 700;
}

.member-copy { display: grid; gap: 3px; min-width: 0; }
.member-copy strong { font-size: 11px; font-weight: 600; }
.member-copy span {
  color: var(--dim);
  font-size: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-role {
  color: var(--accent);
  font-size: 8px;
  letter-spacing: .1em;
}

.member-latency {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.member-latency i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.latency-card {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.latency-card-head { display: flex; justify-content: space-between; align-items: start; }
.latency-card-head > div { display: grid; gap: 5px; }
.latency-card-head strong { font: 600 14px var(--font-display); letter-spacing: .03em; }

.engine-state {
  color: var(--accent);
  font-size: 9px;
  padding: 4px 6px;
  border: 1px solid rgba(215,255,106,.2);
}

.latency-graph {
  height: 52px;
  display: flex;
  align-items: end;
  gap: 3px;
  margin: 18px 0 16px;
  border-bottom: 1px solid var(--line);
}

.latency-graph i {
  flex: 1;
  height: var(--height);
  min-height: 3px;
  background: linear-gradient(to top, rgba(105,215,255,.18), rgba(105,215,255,.7));
  transition: height 300ms ease;
}

.latency-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.latency-stats div { display: grid; gap: 4px; }
.latency-stats span { color: var(--dim); font-size: 8px; }
.latency-stats strong { font: 500 12px var(--font-display); font-variant-numeric: tabular-nums; }
.latency-card p { color: var(--dim); font-size: 9px; line-height: 1.7; margin: 14px 0 0; }

#chat-tab { padding-bottom: 16px; }
.chat-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 260px;
  max-height: calc(100vh - 220px);
}

.chat-empty {
  margin: auto;
  color: var(--dim);
  font-size: 11px;
  text-align: center;
}

.chat-item { display: grid; gap: 4px; }
.chat-item-head { display: flex; justify-content: space-between; color: var(--dim); font-size: 9px; }
.chat-item.you .chat-item-head strong { color: var(--accent); }
.chat-item p { font-size: 11px; line-height: 1.7; margin: 0; color: #c9c7bd; overflow-wrap: anywhere; }

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.chat-form input, .chat-form button {
  height: 38px;
  border: 1px solid var(--line);
}
.chat-form input { min-width: 0; background: #0b0d10; color: var(--text); padding: 0 10px; }
.chat-form button { background: var(--accent); color: var(--accent-ink); padding: 0 12px; cursor: pointer; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  place-items: center;
  padding: 16px;
  background: rgba(0,0,0,.74);
  backdrop-filter: blur(7px);
  color: var(--text);
  overflow-y: auto;
}

.modal.open { display: grid; }
.modal[hidden] { display: none; }

.modal-card {
  width: min(620px, calc(100vw - 32px));
  background: #111319;
  border: 1px solid var(--line-strong);
  padding: 28px;
  box-shadow: 0 30px 100px rgba(0,0,0,.7);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 24px;
}

.modal-head h2 {
  font: 500 30px var(--font-display);
  margin: 5px 0 0;
}

.close-button {
  border: 0;
  background: transparent;
  font-size: 26px;
  color: var(--muted);
  cursor: pointer;
}

.source-tabs {
  display: flex;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}

.source-tab {
  height: 38px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
}
.source-tab.active { color: var(--text); border-color: var(--accent); }

.source-pane { display: none; gap: 16px; }
.source-pane.active { display: grid; }

.modal label { display: grid; gap: 7px; }
.modal label > span, .modal summary { color: var(--muted); font-size: 10px; }
.modal input, .modal select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #090b0e;
  color: var(--text);
  padding: 0 12px;
}

.modal input:focus, .modal select:focus { border-color: rgba(215,255,106,.6); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth-grid { margin-top: 14px; }
.modal details { border-top: 1px solid var(--line); padding-top: 14px; }
.modal summary { cursor: pointer; }
.field-hint { color: var(--dim); font-size: 10px; line-height: 1.7; margin: 0; }
.field-hint code { color: var(--muted); }

.form-error {
  min-height: 16px;
  margin-top: 16px;
  color: var(--danger);
  font-size: 10px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.compact-modal .modal-card { width: min(420px, calc(100vw - 32px)); }
.compact-modal .modal-card { display: grid; gap: 16px; }
.compact-modal .modal-head { margin: 0; }

.room-modal-card {
  width: min(560px, calc(100vw - 32px));
}

.room-modal-card .modal-head h2 {
  font-size: clamp(27px, 4vw, 38px);
}

.room-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  margin-bottom: 22px;
}

.room-mode-tab {
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
}

.room-mode-tab + .room-mode-tab { border-left: 1px solid var(--line); }
.room-mode-tab.active { background: var(--text); color: #101114; }

.room-mode-pane { display: none; gap: 15px; }
.room-mode-pane.active { display: grid; }
.room-primary-action { width: 100%; margin-top: 5px; }

.room-preview {
  min-height: 58px;
  border: 1px solid rgba(215,255,106,.22);
  background: rgba(215,255,106,.045);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 12px 14px;
}

.room-preview > div { display: grid; gap: 5px; }
.room-preview strong { font: 600 15px var(--font-display); }
.room-preview > span { color: var(--muted); font-size: 10px; }

.openlist-connect { display: grid; gap: 8px; }

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

.connected-input .secondary-button { height: 42px; }

.file-browser {
  display: grid;
  gap: 11px;
  border: 1px solid var(--line);
  background: #0a0c0f;
  padding: 12px;
}

.file-browser[hidden] { display: none; }

.browser-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.breadcrumb button {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 3px 4px;
  font-size: 9px;
  cursor: pointer;
}

.breadcrumb button:last-child { color: var(--text); }
.breadcrumb i { color: var(--dim); font-style: normal; font-size: 9px; }

.browser-link {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 9px;
  cursor: pointer;
}

.browser-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.browser-search input { height: 36px; }
.browser-search .secondary-button { min-height: 36px; padding: 0 13px; }

.file-list-head,
.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px;
  gap: 10px;
  align-items: center;
}

.file-list-head {
  color: var(--dim);
  font-size: 8px;
  letter-spacing: .12em;
  padding: 0 9px;
}

.file-list {
  min-height: 176px;
  max-height: 280px;
  overflow-y: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.file-row {
  width: 100%;
  min-height: 43px;
  border: 0;
  border-bottom: 1px solid rgba(240,236,222,.065);
  background: transparent;
  color: var(--text);
  padding: 6px 9px;
  text-align: left;
  cursor: pointer;
}

.file-row:hover,
.file-row.selected { background: rgba(255,255,255,.04); }
.file-row.selected { box-shadow: inset 2px 0 var(--accent); }

.file-name {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.file-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--muted);
  font: 700 7px var(--font-display);
}

.file-icon.folder { color: var(--accent); border-color: rgba(215,255,106,.25); }
.file-name strong {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 10px;
  font-weight: 500;
}

.file-row > span:last-child {
  color: var(--dim);
  font-size: 9px;
  text-align: right;
}

.file-state {
  height: 176px;
  display: grid;
  place-items: center;
  color: var(--dim);
  font-size: 10px;
  text-align: center;
  line-height: 1.7;
  padding: 20px;
}

.selected-file {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px solid rgba(215,255,106,.26);
}

.selected-file[hidden] { display: none; }
.selected-file-type { color: var(--accent); font: 700 7px var(--font-display); }
.selected-file > div { display: grid; gap: 3px; min-width: 0; }
.selected-file strong,
.selected-file > div span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.selected-file strong { font-size: 10px; }
.selected-file > div span { color: var(--dim); font-size: 8px; }
.selected-file button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; }

.toast-stack {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 22px;
  display: grid;
  gap: 8px;
  width: min(340px, calc(100vw - 44px));
}

.toast {
  padding: 13px 15px;
  border: 1px solid var(--line-strong);
  background: rgba(20,23,28,.95);
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
  color: #d5d2c8;
  font-size: 11px;
  animation: toast-in 220ms ease both;
}
.toast.error { border-color: rgba(255,128,110,.38); color: #ffc0b6; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .theater-panel { padding: 30px 24px; }
  .network-pill span:not(.signal-bars) { display: none; }
}

@media (max-width: 820px) {
  .topbar { grid-template-columns: 1fr auto; padding: 0 16px; }
  .room-identity { display: none; }
  .quiet-button { display: none; }
  .layout { display: block; }
  .side-panel { border-left: 0; border-top: 1px solid var(--line); min-height: 560px; }
  .theater-panel { padding: 24px 14px 34px; }
  .under-screen { align-items: start; }
  .source-summary span:last-child { max-width: 55vw; }
}

@media (max-width: 560px) {
  .brand-word { display: none; }
  .network-pill { padding: 0 8px; }
  .theater-heading { align-items: start; }
  .live-state { display: none; }
  .screen-shell { margin: 0 -14px; border-left: 0; border-right: 0; }
  .empty-state h2 { font-size: 24px; }
  .empty-state > p:not(.empty-kicker) { display: none; }
  .aperture { margin-bottom: 14px; }
  .video-controls { padding: 45px 10px 8px; }
  .volume-slider, .sync-badge, #back-button, #forward-button { display: none; }
  .under-screen { display: grid; }
  .reaction-bar { justify-content: space-between; }
  .source-summary span:last-child { max-width: 75vw; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-card { padding: 22px 18px; }
}

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