/* Afterglow styles — generated by npm run build. Edit styles/, not this file. */
:root {
  color-scheme: dark;
  --font-sans:
    system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-emoji:
    "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  --accent: #d6ef9a;
  --chat-width: 260px;
  --chat-opacity: 0.78;
  --sub-size: 24px;
  --sub-bottom: 7%;
  --sub-color: #fff;
  --sub-bg: rgba(0, 0, 0, 0.65);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px var(--font-sans);
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 13px;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.ui-icon {
  width: 16px;
  height: 16px;
  display: block;
  pointer-events: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ui-icon-fill {
  fill: currentColor;
  stroke: none;
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
input,
select {
  color: var(--text);
  border: 1px solid var(--line);
  padding: 9px;
  border-radius: 6px;
}
input[type="range"] {
  accent-color: var(--accent);
  padding: 0;
  cursor: pointer;
}
input[type="checkbox"] {
  accent-color: var(--accent);
}
header {
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font: 800 25px var(--font-sans);
  letter-spacing: -1px;
  color: var(--text);
  text-decoration: none;
}
.brand-icon {
  color: var(--accent);
  margin-right: 10px;
}
.version {
  font: 400 13px var(--font-sans);
  color: var(--muted);
  margin-left: 16px;
  letter-spacing: 0;
}
.header-actions {
  display: flex;
  align-items: center;
}
.pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 8px 11px;
  white-space: nowrap;
}
.pill i {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}
main {
  margin: auto;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.8px;
  font-weight: 700;
}
h1 {
  font: 600 clamp(20px, 2.3vw, 32px) var(--font-sans);
}
h2,
h3 {
  font-family: var(--font-sans);
  margin: 0;
}
.avatar {
  color: var(--accent);
  border: 1px solid #586c40;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
}
.screen {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #080b09;
  position: relative;
}
.movie-column {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.stage {
  aspect-ratio: 16/9;
  position: relative;
  background: #080b09;
  min-height: 230px;
  overflow: hidden;
  display: grid;
  place-items: center;
}
video {
  width: 100%;
  height: 100%;
  position: absolute;
  object-fit: contain;
}
#empty {
  text-align: center;
  position: relative;
  padding: 30px;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#empty .orb {
  height: 75px;
  width: 75px;
  border: 1px solid #8a9d6b55;
  border-radius: 50%;
  margin: 0 0 24px;
  box-shadow:
    0 0 60px #b8df5d12,
    inset 0 0 25px #b8df5d0d;
  background: linear-gradient(140deg, #88996733, transparent);
}
#empty h2 {
  color: var(--player-text, #f2f4f6);
  font-size: clamp(25px, 3vw, 42px);
  letter-spacing: -1.5px;
  margin-top: 13px;
}
#empty p {
  color: var(--player-muted, #bac3cc);
  line-height: 1.5;
}
.primary {
  background: var(--accent);
  color: #202a17;
  border: 0;
  font-weight: 700;
  margin-top: 15px;
  padding: 12px 22px;
}
.fine {
  font-size: 11px;
  margin-top: 14px;
}
#seek {
  height: 4px;
  margin: 6px 0 12px;
}
.control-row {
  display: flex;
  align-items: center;
}
.control-row button {
  border: 0;
  background: transparent;
}
.control-row button:hover {
  background: #303a2b;
}
#play {
  color: var(--accent);
}
.spacer {
  flex: 1;
}
#time {
  color: var(--muted);
}
#volume {
  height: 4px;
}
.chat {
  flex: 0 0 var(--chat-width);
  width: var(--chat-width);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  container-type: inline-size;
}
.chat-header {
  justify-content: space-between;
  align-items: center;
}
.chat-header button {
  background: transparent;
  border: 0;
  padding: 2px;
}
.count {
  font-size: 10px;
  color: var(--muted);
  margin-left: 6px;
}
#messages {
  flex: 1;
  overflow: auto;
  min-height: 150px;
  max-height: 460px;
  padding: 18px;
  scrollbar-width: thin;
}
.chat-welcome {
  text-align: center;
}
.chat-welcome > span {
  font-size: 30px;
  color: var(--accent);
}
.chat-welcome h3 {
  line-height: 1.6;
  margin: 16px 0;
}
.chat-welcome p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}
#chatForm {
  display: flex;
  border: 1px solid #404a38;
  border-radius: 8px;
  gap: 2px;
}
#message {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
}
#chatForm button {
  border: 0;
  background: transparent;
  padding: 4px 7px;
}
#chatForm .send {
  background: var(--accent);
  color: #192112;
  border-radius: 5px;
  margin: 3px;
}
#emotes button {
  border: 0;
  background: transparent;
}
.message {
  overflow-wrap: anywhere;
}
.message time {
  color: var(--muted);
}
.message p {
  white-space: pre-wrap;
}
.muted {
  color: var(--muted);
}
dialog {
  width: min(620px, 94vw);
  max-height: 88vh;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  padding: 24px 28px;
  box-shadow: 0 20px 100px #0009;
}
dialog::backdrop {
  background: #000a;
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 22px;
}
.dialog-head h2 {
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 0;
}
.dialog-head button {
  background: transparent;
  border: 0;
}
nav {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  flex-wrap: wrap;
}
nav button {
  font-size: 12px;
  background: transparent;
  border: 0;
}
.setting {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin: 22px 0;
}
.setting label {
  flex: 1;
}
.setting small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  margin-top: 5px;
}
.setting input[type="range"] {
  width: 140px;
}
.setting select {
  max-width: 220px;
}
.setting input[type="number"] {
  width: 95px;
}
.note {
  padding: 13px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.7;
}
.dialog-bottom {
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 15px;
  color: var(--muted);
  font-size: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.dialog-bottom button {
  font-size: 10px;
}
#infoBody {
  line-height: 1.8;
}
#infoBody dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 12px;
}
#infoBody dd {
  margin: 0;
  overflow-wrap: anywhere;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 22px;
  border-radius: 8px;
  z-index: 30;
  display: none;
  max-width: 90vw;
  font-size: 13px;
}
.picture-subtitle {
  position: absolute;
  left: 50%;
  top: 50%;
  pointer-events: none;
  z-index: 2;
}
.subtitle {
  position: absolute;
  bottom: var(--sub-bottom);
  left: 6%;
  width: 88%;
  text-align: center;
  font-size: var(--sub-size);
  color: var(--sub-color);
  line-height: 1.4;
  white-space: pre-line;
  pointer-events: none;
  text-shadow: 1px 2px 3px #000;
  z-index: 2;
}
.subtitle span {
  background: var(--sub-bg);
  padding: 3px 8px;
  border-radius: 4px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
body.subtitle-no-bg .subtitle {
  text-shadow:
    0 1px 3px #000,
    0 0 8px #000;
}
#mediaStatus {
  position: absolute;
  top: 15px;
  left: 15px;
  max-width: 80%;
  background: #191f16dd;
  border-radius: 6px;
  padding: 9px;
  font-size: 12px;
}
#mediaStatus:empty {
  display: none;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
body.theater main {
  max-width: none;
  padding-left: 16px;
  padding-right: 16px;
}
.screen.chat-left .chat {
  order: -1;
  border-left: 0;
  border-right: 1px solid var(--line);
}
.screen.chat-overlay .chat {
  position: absolute;
  border: 1px solid #ffffff20;
  border-radius: 10px;
  z-index: 4;
}
.screen.chat-hidden .chat {
  display: none;
}
.screen:fullscreen {
  border: 0;
  width: 100vw;
}
.screen:fullscreen #messages {
  max-height: none;
}
body.compact .message {
  margin-bottom: 8px;
}
body.compact .message p {
  line-height: 1.3;
}
body.hide-times .message time {
  display: none;
}
@media (max-width: 800px) {
  .screen {
    flex-direction: column;
  }
  .chat {
    flex-basis: auto;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .chat-welcome {
    margin-top: 10px;
  }
  .chat-welcome h3 {
    display: none;
  }
  .screen.chat-left .chat {
    order: 0;
  }
  .screen.chat-overlay .chat {
    top: 12px;
    bottom: 100px;
  }
  .screen:fullscreen:not(.chat-overlay) .chat {
    flex-shrink: 0;
  }
  .setting {
    gap: 10px;
  }
  .setting select {
    max-width: 170px;
  }
}

/* v0.4 room layout: chat is constrained by the player, never by its messages. */
:root {
  --theme-color: #d6ef9a;
  --bg: color-mix(in srgb, var(--theme-color) 4%, #101113);
  --panel: color-mix(in srgb, var(--theme-color) 7%, #17191c);
  --line: color-mix(in srgb, var(--theme-color) 15%, #282c30);
  --text: #edf0ee;
  --muted: #a0aaa5;
}
input,
select {
  background: color-mix(in srgb, var(--theme-color) 4%, #111318);
}
header {
  height: 58px;
  padding: 0 3vw;
  gap: 12px;
}
.brand {
  font-size: 22px;
}
.brand-icon {
  font-size: 27px;
}
.header-actions {
  gap: 8px;
}
.header-actions button {
  padding: 7px 11px;
  font-size: 12px;
}
.header-actions .pill {
  font-size: 10px;
  padding: 6px 9px;
}
main {
  padding: 14px 3vw 0;
  max-width: 1640px;
}
h1 {
  font-size: 18px;
  margin: 2px 0;
  letter-spacing: -0.35px;
}
.avatar {
  background: var(--panel);
  border-color: var(--line);
}
.screen {
  align-items: stretch;
  isolation: isolate;
}
.stage {
  flex-shrink: 0;
}
.chat {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: visible;
  background: rgb(23 26 29 / var(--chat-opacity));
}
.chat-header {
  flex-shrink: 0;
}
.watching-names {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  overflow-wrap: anywhere;
  flex-shrink: 0;
}
.chat #messages {
  height: 0;
  flex: 1 1 0;
  min-height: 0;
  max-height: none;
  overscroll-behavior: contain;
  overflow-anchor: none;
  scrollbar-color: var(--line) transparent;
}
#chatForm {
  flex-shrink: 0;
  background: rgb(9 12 15 / var(--chat-opacity));
  border-color: var(--line);
}
.chat-header,
.watching-names {
  background: transparent;
}
.message {
  margin: 10px 0 0;
  padding-top: 2px;
}
.message:first-child {
  margin-top: 0;
}
.message p {
  margin: 3px 0;
  line-height: 1.5;
  font-size: 13px;
}
.message.continuation {
  margin-top: 0;
  padding-top: 0;
}
.message.continuation p {
  margin-top: 0;
}
.message.continuation time {
  display: none;
}
.message.continuation:hover time {
  position: absolute;
  right: 0;
  top: 0;
  padding: 2px;
  border-radius: 3px;
  font-size: 8px;
}
.hide-times .message.continuation:hover time {
  display: none;
}
.chat-welcome {
  margin-top: 24px;
}
.chat-welcome h3 {
  font-size: 16px;
}
.jump-latest {
  position: absolute;
  z-index: 8;
  border-radius: 18px;
  font-size: 11px;
  padding: 7px;
  background: var(--accent);
  color: #101317;
  box-shadow: 0 3px 16px #0007;
}
.jump-latest[hidden] {
  display: none;
}
.chat-resizer {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 12;
  cursor: col-resize;
  touch-action: none;
}
.chat-resizer:hover,
.chat-resizer:focus-visible {
  background: color-mix(in srgb, var(--accent) 38%, transparent);
  outline: 0;
}
.chat-left .chat-resizer {
  left: auto;
}
.resizing-chat {
  cursor: col-resize;
  user-select: none;
}
.resizing-chat video {
  pointer-events: none;
}
.screen.chat-overlay .chat {
  background: rgb(18 21 25 / var(--chat-opacity));
}
.screen.chat-overlay .chat-header,
.screen.chat-overlay .watching-names {
  background: transparent;
}
.screen.chat-overlay .chat-resizer {
  left: -5px;
  right: auto;
}
.screen.chat-overlay #chatForm {
  background: rgb(8 10 13 / var(--chat-opacity));
}
.screen.chat-overlay .chat-welcome {
  margin-top: 15px;
}
.player-controls {
  padding: 6px 13px;
}
.primary,
#chatForm .send {
  background: var(--accent);
  color: #11151a;
}
.primary:hover {
  background: color-mix(in srgb, var(--accent) 85%, white);
}
dialog {
  border-color: var(--line);
}
nav button.active {
  background: color-mix(in srgb, var(--accent) 14%, #222);
  color: var(--accent);
}
#toast {
  background: var(--accent);
  color: #101317;
}
#empty {
  background: radial-gradient(
    ellipse at 50% 95%,
    color-mix(in srgb, var(--theme-color) 13%, #111518) 0,
    transparent 65%
  );
}
body.theater .screen {
  margin-top: 0;
}
body.theater main {
  padding-top: 12px;
}
body.theater .stage {
  max-height: calc(100vh - 170px);
}
.screen:fullscreen .stage {
  flex: 1 1 0;
  min-height: 0;
  max-height: none;
  aspect-ratio: auto;
}
.screen:fullscreen.auto-hide-controls .player-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 5;
  background: linear-gradient(transparent, rgb(5 7 10 / 0.86));
  padding: 24px 14px 12px;
}
.screen:fullscreen.auto-hide-controls.controls-idle .player-controls {
  opacity: 0;
  pointer-events: none;
}
.screen:fullscreen.auto-hide-controls.cursor-idle .stage {
  cursor: none;
}
.screen:fullscreen.auto-hide-controls .stage {
  height: 100%;
}
#emotes {
  position: absolute;
  left: 10px;
  right: 10px;
  z-index: 9;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px;
  box-shadow: 0 8px 24px #0008;
  max-height: min(330px, 75%);
}
#emotes[hidden] {
  display: none;
}
.emoji-tabs {
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 5px;
  flex-shrink: 0;
}
.emoji-tabs button {
  border-radius: 5px;
}
#emotes .emoji-tabs button.active {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}
.emoji-title {
  font-size: 11px;
  color: var(--muted);
  padding: 7px 3px;
}
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(30px, 1fr));
  overflow: auto;
  min-height: 0;
  scrollbar-width: thin;
}
.emoji-grid button {
  font: 22px var(--font-emoji);
  padding: 4px 0;
  line-height: 1.3;
}
#emotes .emoji-grid button:hover {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}
.theme-settings {
  border-bottom: 1px solid var(--line);
  padding: 17px 0 0;
}
.theme-settings h3 {
  font-size: 14px;
}
input[type="color"] {
  width: 62px;
  height: 38px;
  padding: 3px;
}
.name-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}
.name-buttons .primary {
  margin: 0;
}
#nameDialog {
  max-width: 430px;
}
#displayName {
  display: block;
  width: 100%;
  margin-top: 9px;
}
.form-error {
  color: #ffb3ba;
  font-size: 12px;
  min-height: 16px;
}
.chat-hidden .chat-resizer {
  display: none;
}
@media (max-width: 800px) {
  header {
    padding: 0 12px;
    height: 54px;
  }
  .version {
    display: none;
  }
  .header-actions {
    gap: 4px;
  }
  .header-actions button {
    font-size: 10px;
    padding: 6px;
  }
  .brand {
    font-size: 18px;
  }
  .brand-icon {
    margin-right: 4px;
    font-size: 22px;
  }
  main {
    padding: 12px 12px 0;
  }
  .chat {
    height: 320px;
    flex: 0 0 320px;
    width: 100%;
  }
  .chat-resizer {
    display: none;
  }
  .screen.chat-overlay .chat {
    flex-basis: auto;
  }
  .screen.chat-overlay .chat-resizer {
    display: block;
  }
  .screen:fullscreen .stage {
    flex: 1 1 0;
  }
  .screen.chat-overlay #messages {
    padding: 10px;
  }
  body.theater main {
    padding-left: 8px;
    padding-right: 8px;
  }
  .header-actions .pill {
    display: none;
  }
}
#emotes {
  flex-wrap: nowrap;
}
.emoji-grid {
  width: 100%;
  flex: 1 1 auto;
}
.emoji-tabs,
.emoji-title {
  width: 100%;
}
/* v0.5: one near-edge viewing surface and a quiet room strip underneath. */
main,
body.theater main {
  max-width: none;
  padding: 5px 5px 0;
}
.screen,
body.theater .screen {
  height: calc(100dvh - 66px);
  min-height: 360px;
  margin: 0;
  border-radius: 6px;
}
.movie-column {
  height: 100%;
  min-height: 0;
}
.screen .stage,
body.theater .screen .stage {
  aspect-ratio: auto;
  flex: 1 1 0;
  min-height: 0;
  max-height: none;
}
.screen .player-controls {
  flex-shrink: 0;
}
.screen:fullscreen {
  height: 100dvh;
  min-height: 0;
  border-radius: 0;
}
header.room-bar {
  height: 52px;
  min-height: 52px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: transparent;
}
.room-bar .brand {
  position: relative;
  font-size: 19px;
  letter-spacing: -0.8px;
  isolation: isolate;
}
.room-bar .brand::before {
  content: "";
  position: absolute;
  width: 75px;
  height: 20px;
  left: 0;
  top: 5px;
  background: var(--accent);
  filter: blur(19px);
  opacity: 0.16;
  z-index: -1;
}
.room-bar .brand-icon {
  font-size: 24px;
  text-shadow: 0 0 15px color-mix(in srgb, var(--accent) 45%, transparent);
}
.room-bar .version {
  display: none;
}
.room-bar .header-actions .pill {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.room-bar .header-actions button {
  font-size: 11px;
  padding: 6px 10px;
}
.chat-header {
  column-gap: 8px;
}
.chat-header #identityButton {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  grid-column: 1;
  grid-row: 1;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  justify-self: start;
  max-width: 100%;
  color: var(--name-color);
}
.profile-initial {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--name-color) 32%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--name-color) 8%, transparent);
  font-size: 11px;
  flex-shrink: 0;
}
.profile-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
}
.chat-header .viewer-count {
  margin-left: 33px;
  font-weight: 400;
  line-height: 1;
}
.chat-header .count {
  margin: 0;
  font-size: 9px;
  color: var(--muted);
}
.chat-header #settingsButton {
  grid-column: 2;
  grid-row: 1/3;
  align-self: center;
  background: none;
  border: 0;
}
.watching-names {
  padding: 0 12px 7px;
  font-size: 10px;
  gap: 7px;
  flex-wrap: wrap;
}
.chat #messages {
  padding: 8px 8px 5px;
}
.message,
body.compact .message {
  margin: 5px 0 0;
  padding: 4px 7px 2px;
  background: color-mix(
    in srgb,
    var(--message-color) var(--message-tint, 6%),
    transparent
  );
  border-radius: 5px 5px 0 0;
  border: 0;
}
.message.own-message {
  background: color-mix(in srgb, var(--message-color) 10%, transparent);
}
.message strong {
  color: var(--message-color);
  font-size: 11px;
}
.message p,
body.compact .message p {
  font-size: 12px;
  line-height: 1.27;
  margin: 1px 0 0;
}
.message.continuation,
body.compact .message.continuation {
  margin: 0;
  padding: 1px 7px 2px;
  border-radius: 0;
}
.message time {
  font-size: 8px;
  margin-left: 6px;
}
.message.continuation:hover time {
  background: var(--panel);
}
#chatForm {
  margin: 6px 8px 8px;
  padding: 2px;
}
#message {
  font-size: 12px;
  padding: 8px 7px;
}
.jump-latest {
  bottom: 60px;
  left: 12px;
  right: 12px;
}
.chat-welcome {
  display: none;
}
.chat-resizer,
.chat-resizer:hover {
  cursor: grab;
  background: transparent;
}
.chat-resizer:active,
.resizing-chat,
.resizing-chat .chat-resizer {
  cursor: grabbing;
}
.chat-resizer:focus-visible {
  background: transparent;
  outline: 1px dotted var(--muted);
  outline-offset: -3px;
}
.screen.chat-overlay .chat,
.screen:fullscreen.chat-overlay .chat,
.screen:fullscreen.chat-overlay.auto-hide-controls.controls-idle .chat {
  left: var(--overlay-x, 0px);
  top: var(--overlay-y, 0px);
  right: auto;
  bottom: auto;
  width: var(--overlay-width, var(--chat-width));
  height: var(--overlay-height, 100%);
  max-height: none;
  transition: none;
  border-radius: 5px;
}
.screen.chat-overlay .chat-header {
  cursor: grab;
  touch-action: none;
}
.screen.chat-overlay .player-controls {
  padding-right: 13px;
}
.screen:fullscreen.chat-overlay.auto-hide-controls .player-controls {
  right: 0;
  padding-right: 14px;
}
.chat,
.screen.chat-overlay .chat {
  background: color-mix(
    in srgb,
    var(--panel) calc(var(--chat-opacity) * 100%),
    transparent
  );
}
.player-controls {
  background: var(--control-bg);
}
#chatForm,
.screen.chat-overlay #chatForm,
input,
select {
  background: var(--input-bg);
}
button {
  background: var(--control-bg);
}
button:hover {
  background: var(--hover-bg);
  border-color: var(--line);
}
.note {
  background: var(--soft-panel);
  color: var(--text);
}
#infoBody {
  color: var(--text);
}
.pill {
  color: var(--muted);
}
.primary,
#chatForm .send,
.jump-latest,
#toast {
  color: var(--accent-ink, #10151b);
}
.profile-colors {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}
.profile-colors button {
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--line);
}
#nameDialog label[for="nameColor"] {
  display: block;
  margin-top: 18px;
  font-size: 12px;
}
.theme-settings .setting input[type="range"] {
  width: 150px;
}
.setting small {
  max-width: 310px;
}
#emotes {
  bottom: 59px;
}
.light-theme .eyebrow {
  color: var(--muted);
}
.light-theme .control-row button:hover {
  background: var(--hover-bg);
}
@media (max-width: 800px) {
  main,
  body.theater main {
    padding: 3px;
  }
  .screen,
  body.theater .screen {
    height: calc(100dvh - 62px);
    min-height: 480px;
  }
  .screen:not(.chat-overlay) {
    flex-direction: column;
  }
  .screen:not(.chat-overlay) .movie-column {
    flex: 1 1 0;
    min-height: 0;
    height: auto;
  }
  .screen:not(.chat-overlay) .chat {
    width: 100%;
    flex: 0 0 32%;
    height: auto;
    min-height: 150px;
  }
  .screen.chat-overlay .movie-column {
    height: 100%;
  }
  header.room-bar {
    height: 50px;
    padding: 0 8px;
  }
  .room-bar .header-actions button {
    font-size: 10px;
  }
  .chat-header {
    padding-top: 7px;
    min-height: 48px;
  }
  .chat-header .watching-names {
    padding-bottom: 4px;
  }
  .screen.chat-overlay .chat {
    width: var(--overlay-width);
    height: var(--overlay-height);
  }
  .screen:fullscreen:not(.chat-overlay) .chat {
    height: auto;
    flex: 0 0 30%;
  }
}
.emoji-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 2px;
  min-width: 0;
}
.emoji-tabs button {
  width: 100%;
  min-width: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-emoji);
  font-size: 18px;
  line-height: 1.3;
  padding: 5px 0;
}
.emoji-grid button {
  display: grid;
  place-items: center;
  min-width: 0;
}
body.compact .message.own-message {
  background: color-mix(in srgb, var(--message-color) 11%, transparent);
}
body.theater .screen {
  height: calc(100dvh - 10px);
}
body.theater header.room-bar {
  display: none;
}
body.theater .screen:fullscreen {
  height: 100dvh;
  min-height: 0;
}
/* v0.6: sidebars outside the picture; fullscreen chat over a full-width picture. */
.screen:not(:fullscreen),
body.theater .screen:not(:fullscreen) {
  height: auto;
  min-height: 0;
}
.screen:not(:fullscreen) .movie-column {
  height: auto;
  flex: 1 1 0;
  min-width: 0;
}
.screen:not(:fullscreen) .stage,
body.theater .screen:not(:fullscreen) .stage {
  width: 100%;
  flex: 0 0 auto;
  min-height: 0;
  max-height: none;
}
.screen:not(:fullscreen) .chat {
  background: var(--panel);
}
.screen:fullscreen .movie-column {
  height: 100%;
  width: 100%;
  flex: 1 1 100%;
}
.screen:fullscreen .stage,
body.theater .screen:fullscreen .stage {
  height: 100%;
  width: 100%;
  flex: 1 1 0;
  aspect-ratio: auto;
  min-height: 0;
  max-height: none;
}
.screen:fullscreen .player-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 5;
  background: linear-gradient(transparent, rgb(5 7 10 / 0.86));
  padding: 16px 10px 7px;
}
.screen:fullscreen.chat-overlay .chat {
  background: color-mix(
    in srgb,
    var(--panel) calc(var(--chat-opacity, 0.6) * 100%),
    transparent
  );
}
.screen:fullscreen .control-row {
  color: #f2f4f6;
}
.screen:fullscreen #time {
  color: #c8cfd7;
}
.screen:not(:fullscreen) .chat-header {
  cursor: default;
}
header.room-bar {
  display: grid;
  align-items: center;
}
.room-bar .brand {
  justify-self: start;
}
.screen .player-controls {
  padding: 3px 10px 5px;
}
.control-row {
  gap: 4px;
  min-height: 29px;
}
.control-row button {
  width: 28px;
  height: 28px;
  padding: 3px;
  font-size: 15px;
  display: grid;
  place-items: center;
  border-radius: 5px;
}
#play {
  font-size: 17px;
}
#time {
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.control-row svg {
  width: 20px;
  height: 20px;
  display: block;
  pointer-events: none;
}
.control-row .ui-icon {
  width: 16px;
  height: 16px;
}
#play .ui-icon {
  width: 17px;
  height: 17px;
}
#previousMedia svg,
#nextMedia svg {
  width: 16px;
  height: 16px;
}
.control-row svg text {
  font: 600 7px var(--font-sans);
}
#mute svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.timeline-wrap {
  position: relative;
  height: 14px;
  display: flex;
  align-items: center;
}
#seek,
#volume {
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  border-radius: 0;
  outline: none;
  height: 14px;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
#seek {
  width: 100%;
  display: block;
}
#volume {
  width: 66px;
  flex-shrink: 0;
}
#seek::-webkit-slider-runnable-track,
#volume::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(
    to right,
    var(--slider-fill, var(--accent)) 0 var(--range-fill, 0%),
    var(--slider-track, color-mix(in srgb, var(--muted) 38%, transparent))
      var(--range-fill, 0%) 100%
  );
}
#seek::-webkit-slider-thumb,
#volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 4px;
  height: 10px;
  border: 0;
  border-radius: 2px;
  background: var(--slider-fill, var(--accent));
  margin-top: -4px;
  box-shadow: 0 0 7px color-mix(in srgb, var(--accent) 36%, transparent);
}
#seek:hover::-webkit-slider-thumb,
#volume:hover::-webkit-slider-thumb {
  height: 12px;
  margin-top: -5px;
}
#seek:focus-visible,
#volume:focus-visible {
  outline: 1px dotted var(--muted);
  outline-offset: 2px;
}
#seek::-moz-range-track,
#volume::-moz-range-track {
  height: 2px;
  background: var(--slider-track, var(--line));
}
#seek::-moz-range-progress,
#volume::-moz-range-progress {
  height: 2px;
  background: var(--slider-fill, var(--accent));
}
#seek::-moz-range-thumb,
#volume::-moz-range-thumb {
  width: 4px;
  height: 10px;
  border: 0;
  border-radius: 2px;
  background: var(--slider-fill, var(--accent));
}
.seek-preview {
  position: absolute;
  bottom: 21px;
  transform: translateX(-50%);
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: var(--text);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 10px #0004;
  pointer-events: none;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.seek-preview-image {
  position: relative;
  width: 160px;
  height: 90px;
  overflow: hidden;
  border-radius: 3px;
}
.seek-preview-image[hidden] {
  display: none;
}
.seek-preview-image img {
  position: absolute;
  max-width: none;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.seek-preview-status {
  color: var(--muted);
  font-size: 10px;
}
.seek-preview-status[hidden] {
  display: none;
}
/* Queue overlays the picture at the chat seam; room dimensions never change. */
.queue-overlay {
  position: absolute;
  inset: 0;
  z-index: 24;
  pointer-events: none;
}
.queue-overlay[hidden],
.queue-tongue[hidden],
.queue-up-next[hidden] {
  display: none !important;
}
.queue-drawer-clip {
  position: absolute;
  overflow: hidden;
  pointer-events: none;
}
.queue-drawer {
  position: absolute;
  inset: 0;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  background: color-mix(
    in srgb,
    var(--panel) calc(var(--queue-opacity, 0.82) * 100%),
    transparent
  );
  border: 1px solid var(--line);
  box-shadow: 0 4px 24px #0005;
  opacity: 0;
  transform: translateX(100%);
  transition:
    transform 200ms ease,
    opacity 200ms ease;
  pointer-events: none;
}
.queue-overlay[data-side="right"] .queue-drawer {
  transform: translateX(-100%);
}
.queue-overlay.queue-mobile .queue-drawer {
  transform: translateY(100%);
  border-radius: 12px 12px 4px 4px;
}
.queue-overlay.is-open .queue-drawer {
  transform: translate(0);
  opacity: 1;
  pointer-events: auto;
}
.queue-drawer-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
}
.queue-drawer-heading h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}
.queue-drawer-heading-text {
  min-width: 0;
}
.queue-drawer-heading-text .queue-up-next {
  display: block;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 13px;
}
.queue-drawer-heading button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  width: 26px;
  height: 26px;
  padding: 0;
}
.queue-drawer-list {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
  list-style: none;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  margin: 0;
}
.queue-drawer-item:first-child {
  margin-top: 0;
}
.queue-drawer-item {
  display: grid;
  grid-template-rows: auto auto;
  flex-shrink: 0;
  border: 1px solid transparent;
  border-radius: 5px;
}
.queue-drawer-item.is-current {
  border-color: color-mix(in srgb, var(--accent) 16%, transparent);
}
.queue-drawer-item.is-next .queue-label {
  font-weight: 600;
  color: var(--text);
}
.queue-drawer-play {
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.queue-drawer-item.is-current .queue-drawer-play {
  color: var(--text);
}
.queue-drawer-status {
  grid-row: 2;
  color: var(--muted);
  font-size: 10px;
  padding-top: 3px;
  align-self: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.queue-drawer-item.is-current .queue-drawer-status {
  color: var(--accent);
}
.queue-drawer .queue-drop-before {
  border-top-color: var(--accent);
}
.queue-drawer .queue-drop-after {
  border-bottom-color: var(--accent);
}
.queue-tongue {
  position: absolute;
  width: 14px;
  height: 72px;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: auto;
  z-index: 2;
}
.queue-tongue::before {
  content: "";
  position: absolute;
  inset: 8px 4px;
  transition: background 180ms ease;
}
.screen:fullscreen.auto-hide-controls.controls-idle .queue-tongue {
  opacity: 0;
  pointer-events: none;
}
@media (max-width: 800px) {
  .queue-tongue {
    display: none;
  }
  .queue-drawer-play {
    font-size: 13px;
    min-height: 28px;
  }
  .queue-drawer-heading button {
    width: 36px;
    height: 36px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .queue-drawer,
  .queue-tongue::before {
    transition: none;
  }
}
.seek-preview::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: calc(50% - 3px);
  width: 6px;
  height: 6px;
  transform: rotate(45deg);
  background: var(--panel);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.seek-preview[hidden] {
  display: none;
}
.screen:fullscreen .seek-preview {
  background: #171b20;
  color: #eef0f4;
}
.screen:fullscreen .seek-preview::after {
  background: #171b20;
}
@media (max-width: 800px) {
  .screen:not(:fullscreen) .movie-column {
    height: auto;
    flex: 0 0 auto;
    width: 100%;
  }
  .screen:not(:fullscreen) .chat {
    height: 280px;
    flex: 0 0 280px;
    min-height: 180px;
  }
  .screen:fullscreen:not(.chat-hidden) .chat {
    position: absolute;
    height: var(--overlay-height);
    width: var(--overlay-width);
    flex: none;
  }
  .room-bar .brand {
    font-size: 16px;
  }
  .control-row {
    gap: 1px;
  }
  #volume {
    width: 44px;
  }
}
.screen:fullscreen.auto-hide-controls .player-controls,
.screen:fullscreen.chat-overlay.auto-hide-controls .player-controls {
  padding: 14px 10px 6px;
  right: 0;
}
.control-row svg text {
  font-size: 8.5px;
}
/* v0.7: fit the complete normal room, controls included, above the brand strip. */
.room-bar {
  margin-inline: auto;
}
.screen:not(:fullscreen) .player-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 5;
  background: linear-gradient(transparent, rgb(5 7 10 / 0.86));
  padding: 10px 10px 6px;
}
.screen:not(:fullscreen) .control-row {
  color: #f0f3f6;
}
.screen:not(:fullscreen) #time {
  color: #c8d0d8;
}
.screen .control-row button:hover {
  background: var(--hover-bg);
  border-color: var(--line);
}
.control-row #theater.mode-selected {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent);
  color: var(--accent);
}
body.theater main {
  display: flex;
}
.chat-header {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  padding: 11px 31px 8px 10px;
  gap: 7px;
}
.chat-identities {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  grid-column: 1;
  grid-row: 1;
}
.chat-header #identityButton,
.peer-identity {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: calc(50% - 15px);
  flex: 0 1 auto;
}
.chat-identities > #identityButton:only-child {
  max-width: 100%;
}
.peer-identity[hidden],
.pair-rings[hidden] {
  display: none;
}
.peer-identity {
  color: var(--name-color);
  font-size: 12px;
  font-weight: 600;
}
.chat-header .viewer-count {
  grid-column: 1;
  grid-row: 2;
  margin: 0;
  text-align: center;
}
.chat-header #settingsButton {
  position: absolute;
  top: 7px;
  right: 5px;
  width: 22px;
  height: 22px;
  font-size: 17px;
  padding: 1px;
  display: grid;
  place-items: center;
  grid-area: auto;
}
.watching-names {
  display: none !important;
}
.pair-rings {
  position: relative;
  flex: 0 0 22px;
  width: 22px;
  height: 12px;
  opacity: 0.65;
}
.pair-rings::before,
.pair-rings::after {
  content: "";
  position: absolute;
  width: 11px;
  height: 11px;
  border: 1px solid color-mix(in srgb, var(--accent) 65%, var(--muted));
  border-radius: 50%;
  left: 1px;
  top: 0;
}
.pair-rings::after {
  left: 9px;
  border-color: var(--muted);
}
.avatar-shell {
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.avatar-shell img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--panel);
}
.avatar-editor {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 15px 0;
}
.editor-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--soft-panel);
  font-size: 18px;
}
.avatar-editor button {
  font-size: 11px;
  padding: 5px 8px;
}
.message-avatar {
  display: none;
}
body.chat-avatars .message-avatar {
  display: grid;
  place-items: center;
  position: absolute;
  left: 7px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--message-color) 10%, var(--panel));
  color: var(--message-color);
}
.chat-resizer {
  width: 4px;
  left: -2px;
}
.chat-left .chat-resizer {
  right: -2px;
}
.screen:fullscreen.chat-overlay .chat-header {
  cursor: default;
}
.chat-height-handle {
  display: none;
}
.screen:fullscreen.chat-overlay .chat-height-handle {
  display: block;
  position: absolute;
  top: 0;
  left: calc(50% - 18px);
  width: 36px;
  height: 7px;
  z-index: 14;
  cursor: ns-resize;
  touch-action: none;
}
.chat-height-handle::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 8px;
  width: 20px;
  height: 2px;
  border-radius: 1px;
  background: var(--muted);
  opacity: 0.28;
}
.chat-height-handle:hover::before,
.chat-height-handle:focus-visible::before {
  opacity: 0.65;
}
.chat-height-handle:focus-visible {
  outline: 1px dotted var(--muted);
  outline-offset: -1px;
}
.quality-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  width: 28px;
  min-width: 0;
}
.quality-control #playbackSettings {
  width: 28px;
  height: 25px;
  font-size: 18px;
}
.quality-control #qualityBadge {
  display: block;
  border: 0;
  padding: 0;
  font-size: 8px;
  line-height: 10px;
  height: 10px;
  color: #c8d0d8;
  max-width: 142px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.quick-settings {
  position: absolute;
  bottom: calc(100% + 5px);
  right: 42px;
  width: 230px;
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  color: var(--text);
  padding: 6px;
  box-shadow: 0 9px 35px #0007;
  z-index: 25;
}
.quick-settings[hidden] {
  display: none;
}
.quick-settings button {
  display: flex;
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 5px;
  padding: 9px 10px;
  font-size: 12px;
  text-align: left;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.quick-settings button:hover {
  background: var(--hover-bg);
}
.quick-audio .setting {
  display: grid;
  gap: 5px;
  padding: 6px 10px;
  font-size: 12px;
}
.quick-audio select {
  width: 100%;
  min-width: 0;
  min-height: 30px;
}
.quick-settings .quick-more,
.quick-settings .quick-back {
  color: var(--muted);
  font-size: 11px;
  border-top: 1px solid var(--line);
  border-radius: 0;
  margin-top: 3px;
  padding-top: 10px;
}
.quick-settings .quick-back {
  border-top: 0;
  border-bottom: 1px solid var(--line);
  margin-top: 0;
  margin-bottom: 3px;
}
.quick-choice[aria-checked="true"] {
  color: var(--accent);
}
.quick-settings .quick-choice {
  display: grid;
  grid-template-columns: 8ch minmax(0, 1fr) 12px;
  column-gap: 8px;
}
.quick-choice::after {
  content: "";
  grid-column: 3;
}
.quick-choice[aria-checked="true"]::after {
  content: "✓";
  font-size: 12px;
}
.settings-help {
  font-size: 11px;
  line-height: 1.5;
}
.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin: 6px 0;
  font-size: 12px;
}
.shortcut-binding {
  font-size: 11px;
  padding: 4px 10px;
  min-width: 90px;
  text-align: center;
}
.shortcut-binding.capturing {
  border-color: var(--accent);
  color: var(--accent);
}
@media (max-width: 800px) {
  body.theater main {
    display: block;
  }
  .quality-control {
    flex: 0 0 44px;
    width: 44px;
  }
  .quality-control #qualityBadge {
    max-width: 120px;
    font-size: 7px;
  }
  .quick-settings {
    width: 230px;
    right: 18px;
  }
  .chat-identities {
    gap: 5px;
  }
  .chat-header #identityButton,
  .peer-identity {
    max-width: calc(50% - 12px);
  }
  .chat-header .profile-initial {
    width: 22px;
    height: 22px;
  }
  .screen:not(:fullscreen) .player-controls {
    padding: 7px 6px 4px;
  }
  .room-bar {
    width: 100%;
  }
}
.chat-identities.no-peer > #identityButton {
  max-width: 100%;
}
/* v0.8: stationary room edges, fullscreen control clearance and title selection. */
.screen:not(:fullscreen),
body.theater .screen:not(:fullscreen) {
  width: 100%;
  margin-inline: 0;
}
.screen:not(:fullscreen) .stage,
body.theater .screen:not(:fullscreen) .stage {
  height: var(--room-height);
  aspect-ratio: auto;
}
header.room-bar {
  width: 100%;
  border-bottom: 0;
  grid-template-columns: minmax(125px, 1fr) minmax(0, 2fr) auto;
}
.room-bar .header-actions {
  align-items: center;
}
.room-bar .header-actions #invite {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
}
.room-bar .header-actions button:hover {
  background: var(--hover-bg);
}
main {
  padding-bottom: 0;
}
.folder-choice {
  display: block;
  width: 100%;
  text-align: left;
  margin-top: 8px;
  font-size: 12px;
}
.screen:fullscreen .player-controls,
.screen:fullscreen.chat-overlay .player-controls,
.screen:fullscreen.auto-hide-controls .player-controls {
  right: 0;
  width: 100%;
}
.screen:fullscreen .chat {
  max-height: calc(100% - 72px);
}
@media (max-width: 800px) {
  .screen:not(:fullscreen) .stage {
    height: auto;
    aspect-ratio: var(--video-aspect, 1.7777778);
  }
  .room-bar {
    height: auto;
    min-height: 64px;
    grid-template-columns: 1fr auto;
    gap: 5px;
    padding: 7px;
  }
  .room-bar .header-actions #invite {
    font-size: 10px;
    padding: 5px 7px;
  }
}
/* v0.9: title centered on the picture, compact matching room buttons. */
header.room-bar {
  grid-template-columns: minmax(0, 1fr) var(--chat-width);
  position: relative;
  gap: 0;
  padding-inline: 0;
}
.room-bar .brand {
  grid-column: 1;
  grid-row: 1;
  margin-left: 12px;
  z-index: 1;
}
.room-bar .header-actions {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  justify-content: flex-end;
  gap: 5px;
  width: 220px;
  max-width: 100%;
  padding: 0 6px;
}
.room-bar .header-actions #invite {
  flex: 1 1 0;
  min-width: 0;
  white-space: normal;
  line-height: 13px;
  height: 34px;
  padding: 3px 4px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.room-bar.chat-bar-left {
  grid-template-columns: var(--chat-width) minmax(0, 1fr);
}
.room-bar.chat-bar-left .brand {
  grid-column: 2;
}
.room-bar.chat-bar-left .header-actions {
  grid-column: 1;
  justify-self: start;
}
.room-bar.chat-bar-hidden {
  grid-template-columns: 1fr;
}
.room-bar.chat-bar-hidden .header-actions {
  position: absolute;
  right: 0;
}
.screen .player-controls {
  background: linear-gradient(transparent, rgb(5 7 10 / 0.86));
}
.screen:fullscreen.auto-hide-controls.controls-idle .player-controls,
body.theater .screen.auto-hide-controls.controls-idle .player-controls {
  opacity: 0;
  pointer-events: none;
}
.message {
  position: relative;
}
.message-actions {
  position: absolute;
  right: 3px;
  top: 1px;
  display: flex;
  gap: 1px;
  opacity: 0;
  pointer-events: none;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  box-shadow: 0 2px 6px #0003;
  z-index: 3;
}
.message:hover .message-actions,
.message:focus-within .message-actions {
  opacity: 1;
  pointer-events: auto;
}
.message-actions button {
  padding: 2px 4px;
  font-size: 12px;
  line-height: 16px;
  border: 0;
  background: transparent;
  border-radius: 3px;
}
.message-actions button:hover {
  background: var(--hover-bg);
}
.message-reply {
  display: block;
  border: 0;
  border-left: 2px solid var(--muted);
  border-radius: 0;
  background: transparent;
  padding: 1px 5px;
  margin: 3px 0 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  color: var(--muted);
  text-align: left;
}
.edited-label {
  font-size: 9px;
  color: var(--muted);
}
.message-reactions {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  margin-top: 3px;
}
.message-reactions button {
  font-size: 11px;
  padding: 2px 5px;
  background: var(--soft-panel);
  border-radius: 8px;
}
.message-reactions button[aria-pressed="true"] {
  border-color: var(--accent);
}
.composer-notice {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 3px 8px 0;
  padding: 5px 7px;
  font-size: 10px;
  background: var(--soft-panel);
  border-radius: 5px;
  flex-shrink: 0;
}
.composer-notice[hidden] {
  display: none;
}
.composer-notice span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.composer-notice button {
  border: 0;
  background: transparent;
  padding: 1px 4px;
}
.reply-highlight {
  outline: 1px solid var(--accent);
}
.video-reactions {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 8;
}
.video-reactions span {
  position: absolute;
  left: var(--reaction-x);
  bottom: 16%;
  font-size: clamp(28px, 3.2vw, 50px);
  filter: drop-shadow(0 2px 5px #0006);
  animation: reaction-float 2.3s ease-out forwards;
  opacity: 0;
}
@keyframes reaction-float {
  0% {
    opacity: 0;
    transform: translate(-50%, 10px) scale(0.7);
  }
  15% {
    opacity: 0.9;
    transform: translate(-50%, -10px) scale(1);
  }
  65% {
    opacity: 0.8;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + 22px), -150px) scale(1.08);
  }
}
@media (prefers-reduced-motion: reduce) {
  .video-reactions span {
    animation: reaction-still 1.8s forwards;
  }
  @keyframes reaction-still {
    0%,
    100% {
      opacity: 0;
    }
    15%,
    80% {
      opacity: 0.9;
    }
  }
}
@media (max-width: 800px) {
  header.room-bar {
    grid-template-columns: minmax(0, 1fr) 220px;
    min-height: 64px;
  }
  .room-bar .brand {
    display: none;
  }
  .room-bar .header-actions {
    grid-row: 1;
    grid-column: 2;
  }
  .room-bar.chat-bar-left {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .room-bar.chat-bar-left .header-actions {
    grid-column: 1;
  }
}
/* Quick settings: what is playing and why, and preset choices with a note. */
.quick-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  font-size: 12px;
  line-height: 1.4;
}
.quick-viewing-detail {
  padding: 0 10px 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}
.quick-settings .quick-choice small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  grid-column: 2;
  text-align: left;
}
.quick-settings .quick-choice:disabled {
  opacity: 0.5;
}
.quick-note {
  margin: 4px 10px;
  color: var(--muted);
  font-size: 11px;
}

/* v0.9.1: visible cursor, downward shadow and personal chat text sizes. */
.screen:fullscreen.auto-hide-controls.cursor-idle .stage,
.screen:fullscreen.auto-hide-controls.cursor-idle video {
  cursor: default;
}
.screen .player-controls {
  box-shadow: 0 10px 22px -6px #0009;
}
.message p,
.compact .message p,
body.compact .message p,
#message {
  font-size: var(--chat-font-size, 12px);
}
/* Keep every playback action on the same centerline; the quality label is separate. */
.screen .control-row {
  align-items: center;
  min-height: 28px;
}
.screen .control-row button {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  min-height: 28px;
  line-height: 1;
  padding: 3px;
  vertical-align: middle;
}
.screen .quality-control {
  position: relative;
  height: 28px;
  min-height: 28px;
  align-self: center;
  justify-content: center;
}
.screen .quality-control #playbackSettings {
  height: 28px;
  min-height: 28px;
  line-height: 1;
}
.screen .quality-control #qualityBadge {
  position: absolute;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  line-height: 10px;
}
.screen:not(:fullscreen) .player-controls {
  padding-bottom: 15px;
}
body.theater .screen:not(:fullscreen) .player-controls {
  padding-bottom: 14px;
}
.screen #volume {
  align-self: center;
  margin-block: 0;
}
.screen #time {
  align-self: center;
  line-height: 1;
}
/* Normal view uses a fixed safe sidebar; other modes retain their saved resize width. */
body:not(.theater) .screen:not(:fullscreen) .chat {
  width: var(--normal-chat-width, 220px);
  flex-basis: var(--normal-chat-width, 220px);
}
body:not(.theater) header.room-bar {
  grid-template-columns: minmax(0, 1fr) var(--normal-chat-width, 220px);
}
body:not(.theater) header.room-bar.chat-bar-left {
  grid-template-columns: var(--normal-chat-width, 220px) minmax(0, 1fr);
}
body:not(.theater) header.room-bar.chat-bar-hidden {
  grid-template-columns: 1fr;
}
.screen .quality-control {
  flex: 0 0 28px;
  width: 28px;
}
.screen .control-row {
  gap: 4px;
}
@media (max-width: 800px) {
  body:not(.theater) .screen:not(:fullscreen) .chat {
    width: 100%;
    flex-basis: 280px;
  }
}
/* Larger chat type and profile portraits. Timestamps follow the personal text size. */
.message time,
.compact .message time {
  font-size: calc(var(--chat-font-size, 14px) - 3px);
  line-height: 1.25;
}
.chat-header .profile-name {
  font-size: 14px;
  line-height: 1.25;
}
.chat-header .peer-identity {
  font-size: 14px;
}
.chat-header {
  row-gap: 6px;
}
body.chat-avatars .message-avatar {
  width: 25px;
  height: 25px;
  font-size: 12px;
  top: 4px;
}
body.chat-avatars.compact .message,
body.chat-avatars.compact .message.continuation {
  padding-left: 39px;
}
/* Message actions track the text, rather than the author heading. */
.message-content {
  position: relative;
  min-width: 0;
  min-height: 0;
}
.message-content .message-actions {
  right: 0;
  top: calc(var(--chat-font-size, 14px) * 0.67);
  transform: translateY(-50%);
  gap: 1px;
  padding: 0;
}
.message-content .message-actions button {
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.message strong,
.compact .message strong {
  font-size: var(--chat-font-size, 14px);
  line-height: 1.3;
}
body.theme-gradient {
  background-image: linear-gradient(135deg, var(--bg), var(--gradient-end));
  background-attachment: fixed;
}
body.theme-gradient .screen:not(:fullscreen) .chat,
body.theme-gradient dialog,
body.theme-gradient .quick-settings,
body.theme-gradient header.room-bar {
  background-image: linear-gradient(135deg, var(--panel), var(--gradient-end));
}
body.theme-gradient .screen:fullscreen.chat-overlay .chat {
  background-image: linear-gradient(
    135deg,
    color-mix(
      in srgb,
      var(--panel) calc(var(--chat-opacity, 0.6) * 100%),
      transparent
    ),
    color-mix(
      in srgb,
      var(--gradient-end) calc(var(--chat-opacity, 0.6) * 100%),
      transparent
    )
  );
  background-color: transparent;
}
/* Compact messages with a floating toolbar; continuation timestamps no longer form a second box. */
.message.continuation:hover time {
  display: none;
}
.chat-header .profile-initial {
  width: 44px;
  height: 44px;
  font-size: 18px;
}
.chat-header .profile-name,
.chat-header .peer-identity {
  font-size: 16px;
}
.chat-header {
  min-height: 85px;
}
/* Anchor actions to the hovered text line and make the target message visible. */
.message-content .message-actions button {
  width: 24px;
  height: 24px;
  padding: 2px;
  font-size: 16px;
}
/* Quiet text-only hover feedback and persistent settings chrome. */
.message-content:hover {
  background: color-mix(in srgb, var(--accent) 4%, transparent);
  border-radius: 3px;
}
.connection-notice {
  position: absolute;
  right: calc(var(--normal-chat-width, var(--chat-width)) + 10px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  font-size: 10px;
  border: 0;
  background: var(--panel);
  color: #d6a246;
  max-width: 135px;
  z-index: 4;
}
.connection-notice[hidden] {
  display: none;
}
.connection-notice svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  flex-shrink: 0;
}
.connection-notice.severe {
  color: #e18181;
}
.room-bar.chat-bar-left .connection-notice {
  right: 12px;
}
.room-bar.chat-bar-hidden .connection-notice {
  right: 230px;
}
@media (max-width: 800px) {
  .connection-notice {
    font-size: 9px;
    max-width: 105px;
  }
}
.custom-theme-box {
  border: 1px solid var(--line);
  border-radius: 7px;
  margin-top: 12px;
  padding: 0 10px;
}
.custom-theme-box summary {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 12px;
  padding: 10px 0;
  list-style: none;
}
.custom-theme-box summary::-webkit-details-marker {
  display: none;
}
.custom-theme-box summary::after {
  content: "⌄";
  margin-left: auto;
  color: var(--muted);
}
.custom-theme-box[open] summary::after {
  transform: rotate(180deg);
}
.custom-color-chip {
  width: 22px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid var(--line);
}
.custom-theme-box[open] summary {
  border-bottom: 1px solid var(--line);
}

/* Official daisyUI palettes mapped onto Afterglow's existing layout. */
.theme-selection {
  margin: 5px 0 12px;
  color: var(--muted);
  font-size: 12px;
}
.theme-browser-tools {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.theme-browser-tools input {
  min-width: 0;
  flex: 1;
}
.theme-browser-tools select {
  width: 128px;
  padding: 6px 8px;
}
.theme-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 245px;
  overflow: auto;
  padding: 3px;
  scrollbar-width: thin;
}
.theme-gallery .theme-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 8px;
  font-size: 11px;
  text-align: left;
  background: var(--control-bg);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
}
.theme-gallery .theme-card:hover {
  background: var(--hover-bg);
}
.theme-card-preview {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 8px;
  border-radius: 4px;
  background: var(--preview-bg);
  box-shadow: inset 0 0 0 1px
    color-mix(in srgb, var(--preview-text) 12%, transparent);
}
.theme-card-preview i {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}
.theme-gallery .theme-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.theme-card-check {
  position: absolute;
  bottom: 6px;
  right: 8px;
  color: var(--accent);
  visibility: hidden;
}
.theme-card.active .theme-card-check {
  visibility: visible;
}
.theme-settings [hidden] {
  display: none !important;
}
.theme-settings input[type="color"] {
  width: 48px;
  height: 30px;
  padding: 2px;
}
.theme-settings .custom-theme-box {
  margin-bottom: 14px;
}
.theme-settings .custom-theme-box > button {
  margin: 8px 0 12px;
  font-size: 12px;
}
.screen .control-row button:hover {
  color: var(--text);
}
.screen .control-row #theater.mode-selected:hover {
  color: var(--text);
}
.screen .seek-preview,
.screen .seek-preview::after {
  background: var(--panel);
  color: var(--text);
}
.screen .quick-settings button {
  color: var(--text);
}
.eyebrow {
  color: var(--muted);
}
input::placeholder {
  color: var(--muted);
  opacity: 0.8;
}
.primary:hover,
#chatForm .send:hover,
.jump-latest:hover {
  background: var(--accent);
  color: var(--accent-ink);
  filter: brightness(1.08);
}
@media (max-width: 500px) {
  .theme-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.light-theme .message strong {
  color: color-mix(
    in srgb,
    var(--message-color, var(--accent)) 55%,
    var(--text)
  );
}
.light-theme .chat-header .profile-name {
  color: color-mix(in srgb, var(--name-color, var(--accent)) 55%, var(--text));
}

/* Theater starts at the viewport origin; chat stops narrowing at full player height. */
body.theater main {
  padding: 0;
  align-items: flex-start;
  justify-content: flex-start;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
}
body.theater .screen:not(:fullscreen) {
  border: 0;
  border-radius: 0;
  height: 100dvh;
  min-height: 0;
  max-height: 100dvh;
}
body.theater .screen:not(:fullscreen) .movie-column {
  height: 100%;
  min-height: 0;
}
/* Dialog dismiss buttons share a centered icon box. */
.dialog-head button,
#settings .dialog-head [data-close] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
.subtitle-quick {
  right: 60px;
  width: 285px;
  max-height: min(430px, 75vh);
}
.subtitle-quick > label {
  display: grid;
  gap: 6px;
  padding: 7px 5px;
  font-size: 12px;
}
.subtitle-quick select {
  width: 100%;
  min-width: 0;
  padding: 6px;
}
.subtitle-quick .setting {
  padding: 7px 5px;
  gap: 8px;
}
.subtitle-quick .setting input[type="range"] {
  width: 105px;
}
.subtitle-quick .note {
  margin: 4px;
  padding: 6px;
  font-size: 11px;
}
.people-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.person-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.person-row > div {
  display: flex;
  gap: 6px;
}
.person-row > .person-who {
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.person-created {
  color: var(--muted);
  font-size: 11px;
}
.person-row button {
  padding: 5px 9px;
  font-size: 12px;
}
#profileEditor {
  padding: 0;
  width: min(700px, 94vw);
  max-height: 88dvh;
}
#profileEditor form {
  margin: 0;
  display: flex;
  flex-direction: column;
  max-height: calc(88dvh - 2px);
}
#profileEditor .dialog-head {
  padding: 17px 20px;
  flex-shrink: 0;
}
#profileEditor .dialog-head button {
  width: 30px;
  height: 30px;
}
.profile-editor-body {
  padding: 0 20px 15px;
  overflow: auto;
  min-height: 0;
}
.profile-editor-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}
.profile-editor-columns fieldset {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.profile-editor-columns legend {
  font-size: 12px;
  color: var(--muted);
  padding: 0 5px;
}
.profile-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  padding: 8px 0;
}
.profile-check input {
  margin: 2px 0 0;
}
.profile-choice {
  display: grid;
  gap: 5px;
  font-size: 12px;
  padding: 6px 0;
}
.profile-choice select {
  padding: 5px 7px;
  width: 100%;
}
.managed-identity {
  display: grid;
  grid-template-columns: 1fr 60px;
  align-items: center;
  gap: 7px 12px;
}
.managed-identity label:first-child {
  grid-column: 1;
  grid-row: 1;
}
.managed-identity input[type="text"],
.managed-identity input:not([type]) {
  grid-column: 1;
  grid-row: 2;
}
.managed-identity label[for="managed-color"] {
  grid-column: 2;
  grid-row: 1;
  font-size: 11px;
}
.managed-identity input[type="color"] {
  grid-column: 2;
  grid-row: 2;
  width: 55px;
  height: 34px;
  padding: 2px;
}
.profile-error {
  color: var(--text);
  font-size: 12px;
  margin: 0;
}
#profileEditor .dialog-bottom {
  padding: 12px 20px;
  gap: 10px;
  flex-shrink: 0;
}
#infoBody input[readonly] {
  width: 100%;
  margin: 7px 0;
}
@media (max-width: 600px) {
  .profile-editor-columns {
    grid-template-columns: 1fr;
  }
}
#tabs [hidden] {
  display: none !important;
}
#profileEditor {
  overflow: hidden;
}
.subtitle-quick .setting {
  margin: 3px 0;
  font-size: 12px;
}
.header-actions [hidden],
#playbackCaptions [hidden] {
  display: none !important;
}
.profile-backup-help {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  margin: 5px 0;
}
#profileEditor .dialog-bottom > button:first-child:not(:last-child) {
  margin-right: auto;
}
/* Room power lives within the logo column without moving Now Playing. */
.room-bar {
  position: relative;
}
.room-power {
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  padding: 0;
  z-index: 2;
  color: var(--accent);
}
.room-bar .brand {
  padding-left: 36px;
  transition:
    filter 0.65s,
    opacity 0.65s,
    text-shadow 0.65s;
}
.brand.room-offline {
  filter: grayscale(1);
  opacity: 0.45;
  text-shadow: none;
}
.brand.room-offline .brand-icon {
  box-shadow: none;
  text-shadow: none;
}
.profile-save-status {
  position: absolute;
  bottom: 2px;
  right: 8px;
  padding: 1px 4px;
  font-size: 10px;
  opacity: 0.65;
  border: 0;
  background: transparent;
}
.profile-save-status:disabled {
  cursor: default;
}
.retry-playback {
  font-size: 12px;
  padding: 3px 8px;
}
/* Preset rows (Streaming quality, Performance, Playback quality): one
   segmented choice, a summary line and an "Advanced" section. */
.preset-control {
  margin: 10px 0 4px;
}
.preset-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.preset-choice {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 999px;
}
.preset-choice[aria-checked="true"] {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  border-color: var(--accent);
  color: var(--text);
}
.preset-choice[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}
.preset-divider {
  width: 1px;
  align-self: stretch;
  margin: 2px 4px;
  background: var(--line);
}
.preset-note {
  margin: 8px 0 0;
}
.preset-advanced {
  margin-top: 8px;
}
.preset-advanced > summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  padding: 4px 0;
}
.host-detect-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
}
.host-detect-row .note {
  flex: 1 1 220px;
  margin: 0;
}
.host-detect-row button {
  font-size: 12px;
  padding: 5px 10px;
}
.encoder-reasons {
  margin: 4px 0 8px;
  padding-left: 18px;
  font-size: 12px;
  color: var(--muted);
}
/* Keep the identity header distinct without changing chat geometry. */
.chat-header {
  background: linear-gradient(
    110deg,
    color-mix(in srgb, var(--accent) 5%, transparent),
    transparent 75%
  );
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
}
.chat-header::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 12px;
  right: 12px;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--accent) 35%, transparent),
    transparent
  );
}
.room-welcome > p {
  margin: 0;
}
.room-welcome > .note {
  padding: 0;
  background: transparent;
}
.room-privacy summary {
  cursor: pointer;
}
.room-privacy .note {
  padding: 0;
  background: transparent;
}
.room-welcome > .note:empty {
  display: none;
}
.remote-setup {
  display: grid;
  gap: 12px;
}
.remote-setup input,
.remote-setup select {
  width: 100%;
  min-width: 0;
}
.remote-setup input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
}
.remote-setup details {
  padding: 10px 0;
}
.remote-setup .forwarding-rules {
  border-collapse: collapse;
  margin: 4px 0 8px;
  font-size: 13px;
}
.remote-setup .forwarding-rules th,
.remote-setup .forwarding-rules td {
  border-bottom: 1px solid var(--border);
  padding: 4px 12px 4px 0;
  text-align: left;
}
.remote-setup .forwarding-rules th {
  color: var(--muted);
  font-weight: 600;
}
.hosting-settings {
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 16px;
}
/* The header follows the chat's width, including a narrow fullscreen sidebar. */
.chat-identities:not(.no-peer) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr);
  align-items: start;
  gap: 6px;
}
.chat-identities:not(.no-peer) .pair-rings {
  align-self: center;
}
.chat-identities:not(.no-peer) > #identityButton,
.chat-identities:not(.no-peer) > .peer-identity {
  max-width: none;
  width: 100%;
  justify-content: center;
}
.chat-header .profile-name {
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  min-width: 0;
}
@container (max-width: 340px) {
  .chat-identities:not(.no-peer) > #identityButton,
  .chat-identities:not(.no-peer) > .peer-identity {
    flex-direction: column;
    text-align: center;
    gap: 4px;
  }
  .chat-identities:not(.no-peer) .profile-initial {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  .chat-identities:not(.no-peer) .profile-name {
    font-size: 14px;
  }
}
#app :focus:not(:focus-visible) {
  outline: none;
}
#screen :focus-visible,
.room-bar :focus-visible,
#info :focus-visible,
#nameDialog :focus-visible,
#profileEditor :focus-visible {
  outline: 1px dotted var(--text);
  outline-offset: 2px;
}
/* Text entry keeps its existing border; avoid a bright frame while typing. */
#screen #message:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--text) 45%, var(--panel));
}
/* Keep timeline focus on the thumb instead of framing the entire player row. */
#screen #seek:focus-visible {
  outline: none;
}
#seek:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 2px var(--text);
}
#seek:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 2px var(--text);
}
#empty .eyebrow {
  color: var(--player-muted, #bac3cc);
}
#mediaStatus {
  color: var(--player-text, #f2f4f6);
}
.chat-delivery-notice {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  font-size: 12px;
}
.chat-delivery-notice[hidden] {
  display: none;
}
.chat-delivery-notice button {
  padding: 3px 6px;
  font-size: 12px;
}
@container (max-width: 260px) {
  .chat-identities:not(.no-peer) .profile-name {
    font-size: 13px;
  }
}
#settings .chat-notification-settings .setting small {
  display: block;
}
.screen.auto-hide-controls.controls-idle .player-controls {
  opacity: 0;
  pointer-events: none;
}
/* Quick reveal, gentle fade; the video and controls never shift on idle. */
.screen {
  --controls-fade: 120ms;
  --controls-ease: cubic-bezier(0.16, 1, 0.3, 1);
}
.screen.auto-hide-controls.controls-idle {
  --controls-fade: 380ms;
  --controls-ease: ease-out;
}
.screen .player-controls,
.screen:fullscreen.auto-hide-controls .player-controls,
body.theater .screen .player-controls {
  transform: none;
  transition: opacity var(--controls-fade) var(--controls-ease);
}
.screen.auto-hide-controls.controls-idle .player-controls,
.screen:fullscreen.auto-hide-controls.controls-idle .player-controls,
body.theater .screen.auto-hide-controls.controls-idle .player-controls {
  transform: none;
}
.screen.auto-hide-controls.cursor-idle .stage,
body.theater .screen.auto-hide-controls.cursor-idle .stage {
  cursor: none;
}
/* A guest driving the shared browser always needs its pointer: its moves
   over the picture never reach the idle timer, which would hide it. */
body.browser-driving .screen.auto-hide-controls.cursor-idle .stage,
body.browser-driving.theater .screen.auto-hide-controls.cursor-idle .stage,
body.browser-driving .screen.cursor-idle .stage,
body.browser-driving .screen.cursor-idle video {
  cursor: default;
}
@media (prefers-reduced-motion: reduce) {
  .screen,
  .screen.auto-hide-controls.controls-idle {
    --controls-fade: 80ms;
  }
}
.typing-indicator {
  flex: 0 0 auto;
  min-height: 20px;
  padding: 2px 10px;
  font-size: calc(var(--chat-font-size, 14px) - 2px);
  line-height: 16px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.setup-error {
  border: 1px solid #df9a65;
  background: color-mix(in srgb, var(--panel) 95%, #df9a65);
  border-radius: 9px;
  padding: 14px;
}
.setup-error strong {
  color: var(--text);
}
.setup-error p {
  margin: 8px 0 0;
}
.setup-error:empty {
  display: none;
}
.room-power.hosting-pending {
  animation: hosting-pulse 1s ease-in-out infinite;
}
@keyframes hosting-pulse {
  50% {
    opacity: 0.4;
  }
}
@media (prefers-reduced-motion: reduce) {
  .room-power.hosting-pending {
    animation: none;
  }
}
/* Remains visible over the player in every viewing mode. */
.peer-connection-indicator {
  position: absolute;
  z-index: 12;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 24px);
  white-space: nowrap;
  padding: 5px 9px;
  border-radius: 6px;
  background: rgb(0 0 0 / 65%);
  color: #f3f5f7;
  font-size: 12px;
  pointer-events: auto;
}
.peer-connection-indicator[data-route="relay"] {
  border-left: 3px solid #e7b85a;
}
.peer-connection-indicator[data-route="direct"] {
  border-left: 3px solid #8bcba0;
}
/* Source controls share the footer action area without overflowing the chat. */
.screen-audio-status {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
}
#info[open] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#info .dialog-head {
  flex-shrink: 0;
}
#infoBody {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.queue-draggable,
.queue-draggable > button:first-child {
  cursor: grab;
}
.queue-draggable:active,
.queue-draggable > button:first-child:active {
  cursor: grabbing;
}

/* Settings: stable navigation and chrome, one scrolling content pane. */
#settings[open] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: min(800px, calc(100vw - 40px));
  height: min(640px, calc(100dvh - 40px));
  max-height: calc(100dvh - 40px);
  padding: 0;
  border-color: var(--line);
  border-radius: 14px;
}
#settings .dialog-head {
  flex-shrink: 0;
  margin: 0;
  padding: 20px 20px 10px;
  border-bottom: 0;
}
#settings .dialog-head h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
}
#settings .dialog-head [data-close] {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 8px;
  line-height: 1;
}
#settings .dialog-head [data-close]:hover {
  background: var(--hover-bg);
}
.settings-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  flex: 1;
  min-height: 0;
}
.settings-sidebar {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(
        110deg,
        color-mix(in srgb, var(--accent) 5%, transparent),
        transparent 75%
      )
      top / 100% 100% no-repeat,
    color-mix(in srgb, var(--bg) 55%, var(--panel));
}
#settings #tabs {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  min-width: 0;
  padding: 0 10px 16px;
  border: 0;
  background: transparent;
}
#settings #tabs button {
  min-height: 32px;
  padding: 6px 10px;
  text-align: left;
  font-size: 13px;
  line-height: 1.4;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
}
#settings #tabs button:hover {
  background: var(--hover-bg);
  color: var(--text);
}
#settings #tabs button.active {
  background: var(--hover-bg);
  color: var(--text);
  font-weight: 600;
  box-shadow: none;
}
.settings-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: var(--panel);
}
.settings-page-head {
  position: relative;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  background: linear-gradient(
    110deg,
    color-mix(in srgb, var(--accent) 5%, transparent),
    transparent 75%
  );
}
.settings-page-head::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 12px;
  right: 12px;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--accent) 35%, transparent),
    transparent
  );
}
.settings-page-head h3 {
  /* The selected tab names the page visually; retain its accessible region name. */
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.settings-page-head p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
#settings #settingsBody {
  min-height: 0;
  padding: 10px 22px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-gutter: stable;
  scroll-padding: 12px;
}
#settings .settings-group {
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 0;
  background: transparent;
}
#settings .settings-section-title {
  display: none;
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
  line-height: 1.5;
}
#settings .setting {
  margin: 0;
  padding: 8px 0;
  min-height: 42px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
}
#settings .setting + .setting {
  border-top: 0;
}
#settings .setting label {
  min-width: 0;
  font-size: 13px;
  color: color-mix(in srgb, var(--text) 65%, var(--muted));
  font-weight: 500;
  line-height: 1.45;
}
#settings .setting small {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  max-width: 44ch;
}
#settings .settings-value {
  display: inline-block;
  font-size: 12px;
  color: var(--muted);
  margin-left: 8px;
  font-variant-numeric: tabular-nums;
}
#settings select,
#settings input[type="number"],
#settings input[type="search"] {
  min-height: 34px;
  height: auto;
  padding: 6px 9px;
  font-size: 14px;
  border-radius: 8px;
}
#settings .setting select {
  width: 180px;
  max-width: 48%;
  flex-shrink: 0;
}
#settings .setting input[type="number"] {
  width: 76px;
}
#settings .setting input[type="range"] {
  width: 140px;
  max-width: 40%;
}
#settings .settings-help,
#settings .note {
  margin: 8px 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
  background: transparent;
  padding: 0;
}
#settings button {
  min-height: 34px;
  font-size: 14px;
}
#settings .settings-disclosure {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  margin: 12px 0;
}
#settings .settings-disclosure > summary {
  padding: 12px 0;
  cursor: pointer;
  font-weight: 500;
}
#settings .settings-disclosure[open] > summary {
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
#settings .settings-disclosure.settings-group {
  margin: 0;
  padding: 0 0 12px;
}
#settings .settings-disclosure.settings-group:not([open]) {
  padding-bottom: 0;
}
#settings .theme-settings {
  margin: 0;
}
#settings .theme-selection {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}
#settings .theme-gallery {
  max-height: none;
  overflow: visible;
  padding: 2px 2px 12px;
}
#settings .theme-browser-tools {
  flex-wrap: wrap;
}
#settings .theme-browser-tools input {
  width: 120px;
}
#settings .theme-browser-tools select {
  max-width: 100%;
  width: 110px;
}
#settings .custom-theme-box {
  margin-bottom: 0;
}
#settings .shortcut-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  gap: 16px;
  font-size: 13px;
}
#settings .shortcut-binding {
  min-width: 70px;
}
#settings .settings-danger > button {
  color: var(--text);
  border-color: color-mix(in srgb, #d96868 50%, var(--line));
}
#settings .host-settings-content form > label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 14px;
}
#settings .host-settings-content form > button {
  margin-top: 12px;
}
#settings .person-row {
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 0;
}
#settings .person-row > div {
  display: flex;
  gap: 8px;
}
#settings .dialog-bottom {
  flex-shrink: 0;
  justify-content: space-between;
  margin: 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  background: color-mix(in srgb, var(--bg) 55%, var(--panel));
}
#settings .dialog-bottom button {
  font-size: 14px;
  margin: 0;
  padding: 8px 16px;
  flex-shrink: 0;
}
#settings :focus-visible {
  outline: 1px dotted var(--text);
  outline-offset: 3px;
}
@media (max-width: 650px) {
  #settings[open] {
    width: calc(100vw - 16px);
    height: calc(100dvh - 24px);
    max-height: calc(100dvh - 24px);
  }
  .settings-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }
  .settings-sidebar {
    overflow: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  #settings #tabs {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 8px 12px;
    border-right: 0;
  }
  #settings #tabs button {
    flex-shrink: 0;
    padding: 8px 10px;
  }
  #settings .dialog-head {
    padding: 16px;
  }
  .settings-page-head {
    padding: 16px 16px 12px;
  }
  #settings #settingsBody {
    padding: 0 12px 16px;
  }
  #settings .settings-group {
    padding: 0;
  }
  #settings .setting {
    gap: 10px;
  }
  #settings .dialog-bottom {
    padding: 10px 16px;
  }
  #settings .dialog-bottom span {
    max-width: none;
    flex-basis: 100%;
  }
  #settings .dialog-bottom {
    flex-wrap: wrap;
    gap: 8px;
  }
  #settings .dialog-bottom .primary {
    margin-left: auto;
  }
}
.screen-audio-status[hidden] {
  display: none;
}
.screen .control-row .enable-sound {
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
  padding-inline: 8px;
  font-size: 12px;
  white-space: nowrap;
}
.screen .control-row .enable-sound[hidden] {
  display: none;
}
.sound-prompt {
  position: absolute;
  left: 50%;
  bottom: 18%;
  transform: translateX(-50%);
  z-index: 3;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 0.35);
  background: rgb(10 12 14 / 0.78);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 24px rgb(0 0 0 / 0.45);
}
.sound-prompt[hidden] {
  display: none;
}
.room-bar .header-actions #shareScreenButton,
.room-bar .header-actions #stopShareButton,
.room-bar .header-actions #screenPreviewButton {
  flex: 1 1 0;
  min-width: 0;
  height: 34px;
  padding: 3px 4px;
  font-size: 10px;
  line-height: 13px;
  white-space: normal;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
}

.shortcut-help {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 1.5rem;
  margin: 0;
}
.shortcut-help dt,
.shortcut-help dd {
  margin: 0;
}
.shortcut-help dd {
  font-weight: 600;
  text-align: right;
}
.shortcut-help p {
  grid-column: 1 / -1;
  margin: 0.5rem 0 0;
}

/* Fill desktop windows while preserving the video's own aspect ratio. */
@media (min-width: 801px) {
  body:not(.theater) #screen:not(:fullscreen) {
    height: var(--room-height);
  }
  body:not(.theater) #screen:not(:fullscreen) #stage {
    height: auto;
    flex: 1 1 0;
  }
}
/* YouTube remains unobscured: its native controls/captions stay inside the frame,
   and Afterglow's shared controls and feedback sit outside it. */
#screen.youtube-source .movie-column {
  min-width: 200px;
  display: flex;
  flex-direction: column;
  height: 100%;
}
#screen.youtube-source #stage {
  flex: 1 1 0;
  height: auto;
  min-height: 200px;
  aspect-ratio: auto;
}
.youtube-box {
  position: absolute;
  inset: 0;
  min-width: 200px;
  min-height: 200px;
}
.youtube-box[hidden],
.youtube-notice[hidden] {
  display: none;
}
.youtube-box iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
#screen.youtube-source #video,
#screen.youtube-source #qualityBadge,
#screen.youtube-source #subtitle,
#screen.youtube-source #subtitleButton,
#screen.youtube-source .quality-control,
#screen.youtube-source #mediaStatus,
#screen.youtube-source .video-reactions {
  display: none;
}
/* YouTube controls sit below the iframe on .screen's dark surface with the
   same dark gradient as video controls, and light ink/slider tokens so every
   theme (dark, light, pale-accent and dark-accent) stays crisp and legible. */
#screen.youtube-source .player-controls {
  position: relative;
  inset: auto;
  width: 100%;
  flex: 0 0 auto;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  padding: 5px 10px;
  background: linear-gradient(transparent, rgb(5 7 10 / 0.86));
  --slider-fill: color-mix(in srgb, var(--accent) 40%, #f0f3f6);
  --slider-track: rgb(255 255 255 / 0.24);
}
#screen.youtube-source .quick-settings {
  position: static;
  width: 100%;
  max-height: 180px;
  overflow: auto;
}
#screen.youtube-source .control-row,
#screen.youtube-source .control-row button {
  color: #f0f3f6;
}
#screen.youtube-source .control-row button:hover {
  background: rgb(255 255 255 / 0.14);
  color: #fff;
}
#screen.youtube-source .control-row button:disabled:hover {
  background: transparent;
  color: #f0f3f6;
}
#screen.youtube-source .control-row #theater.mode-selected {
  background: color-mix(in srgb, var(--slider-fill) 18%, transparent);
  box-shadow: inset 0 0 0 1px
    color-mix(in srgb, var(--slider-fill) 36%, transparent);
  color: var(--slider-fill);
}
#screen.youtube-source #time {
  color: #c8d0d8;
}
/* Focus rings on the bar itself; the settings panels keep the theme's ring. */
#screen.youtube-source .control-row :focus-visible,
#screen.youtube-source .peer-connection-indicator:focus-visible {
  outline-color: #f0f3f6;
}
#screen.youtube-source #seek:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 2px #f0f3f6;
}
#screen.youtube-source #seek:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 2px #f0f3f6;
}
#screen.youtube-source:fullscreen {
  flex-direction: row;
}
#screen.youtube-source:fullscreen .movie-column {
  flex: 1 1 0;
  width: auto;
}
#screen.youtube-source:fullscreen:not(.chat-hidden) .chat {
  position: relative;
  inset: auto;
  width: clamp(220px, var(--chat-width, 300px), 40vw);
  height: 100%;
  max-height: 100%;
  flex: 0 0 auto;
  background: var(--panel);
}
#screen.youtube-source .chat-height-handle {
  display: none;
}
.youtube-notice {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  z-index: 6;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  background: var(--panel);
  color: var(--text);
  padding: 6px 10px;
  font-size: 12px;
}
.youtube-notice button,
.youtube-notice a {
  padding: 4px 7px;
  font-size: 12px;
}
body:has(dialog[open]) #screen.youtube-source .youtube-box {
  visibility: hidden;
}
#screen.youtube-source:not(:fullscreen) {
  height: var(--room-height);
  min-height: 254px;
}
body.theater #screen.youtube-source:not(:fullscreen) {
  height: 100dvh;
}
#screen.youtube-source .peer-connection-indicator {
  top: auto;
  right: auto;
  bottom: 5px;
  left: 50%;
  display: block;
  width: fit-content;
  padding: 2px 5px;
  font-size: 10px;
}
#screen.youtube-source .peer-connection-indicator[hidden] {
  display: none;
}
.quality-control:has(#playbackSettings:disabled) {
  cursor: help;
}
#playbackSettings:disabled {
  opacity: 0.3;
  cursor: help;
}
#playbackSettings:disabled:hover {
  background: transparent;
  box-shadow: none;
}
.queue-label {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Skip intro: offered inside a detected intro, above subtitles and reactions. */
.skip-intro {
  position: absolute;
  right: 4%;
  bottom: 12%;
  z-index: 9;
  padding: 10px 18px;
  border: 1px solid #fff6;
  border-radius: 6px;
  background: #111c;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.skip-intro:hover,
.skip-intro:focus-visible {
  background: var(--accent);
  color: #202a17;
}
.skip-intro[hidden] {
  display: none;
}
.shared-browser-driver {
  position: absolute;
  z-index: 6;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--accent);
  pointer-events: none;
}
.shared-browser-driver[hidden] {
  display: none;
}
/* Address strip: its own row at the top of the player column, above the
   picture in every view (normal, theater, full screen), so it never covers
   the shared page. One slim row; tabs move to a second row when narrow. */
.shared-browser-bar {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
}
.shared-browser-bar[hidden] {
  display: none;
}
/* Theater and full screen give the picture the whole column height; with
   the strip shown, the picture takes what is left instead of overflowing. */
body.theater
  #screen:not(:fullscreen)
  .movie-column:has(> #sharedBrowserBar:not([hidden]))
  > #stage,
#screen:fullscreen
  .movie-column:has(> #sharedBrowserBar:not([hidden]))
  > #stage {
  height: auto;
  flex: 1 1 0;
  min-height: 0;
}
.shared-browser-bar .button {
  min-height: 28px;
  padding: 2px 8px;
  font-size: 13px;
  line-height: 1;
}
.shared-browser-bar > button {
  flex: none;
}
.shared-browser-bar > form {
  order: 1;
}
.shared-browser-tabs {
  order: 2;
  display: flex;
  flex: 0 1 auto;
  max-width: 45%;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}
/* Narrow: address on the first row; tabs on the second (the empty item
   breaks the row). */
@media (max-width: 700px) {
  .shared-browser-bar::after {
    content: "";
    order: 2;
    flex-basis: 100%;
    height: 0;
    margin-block: -2px;
  }
  .shared-browser-tabs {
    order: 3;
    flex: 1 1 0;
    max-width: none;
  }
}
.shared-browser-tab {
  display: flex;
  flex: 0 1 160px;
  min-width: 70px;
  border: 1px solid var(--line);
  border-radius: 6px;
  opacity: 0.7;
}
.shared-browser-tab.active {
  border-color: var(--accent);
  opacity: 1;
}
.shared-browser-tab > button:first-child {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}
.shared-browser-bar form {
  display: flex;
  flex: 1 1 220px;
  min-width: 160px;
}
.shared-browser-bar input {
  flex: 1;
  min-width: 0;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
}
.shared-browser-bar input:read-only {
  opacity: 0.75;
}
/* The remote in the player's controls: dimmed while the guest has no
   control, filled in the guest's colour while they do. */
.control-row .shared-browser-remote {
  --remote-fill: transparent;
  --remote-ink: currentColor;
  display: inline-grid;
  place-items: center;
  opacity: 0.5;
}
.control-row .shared-browser-remote[hidden] {
  display: none;
}
.control-row .shared-browser-remote.on {
  --remote-fill: var(--remote-color, var(--accent));
  --remote-ink: #111;
  opacity: 1;
}
.control-row .shared-browser-remote[aria-disabled="true"] {
  cursor: default;
}
/* The other person's cursor over the picture: an arrow in their colour
   with their name. Never takes clicks. */
.shared-browser-cursors {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}
.shared-browser-cursor {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: flex-start;
  gap: 2px;
  transition:
    transform 60ms linear,
    opacity 400ms ease;
  filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.5));
}
.shared-browser-cursor[hidden] {
  display: none;
}
.shared-browser-cursor.idle {
  opacity: 0;
}
.shared-browser-cursor-name {
  margin-top: 16px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--cursor-color);
  color: #111;
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
  .shared-browser-cursor {
    transition: none;
  }
}

/* The row is draggable; titles and action buttons remain click targets. */
.queue-drawer .queue-draggable {
  cursor: grab;
}
.queue-drawer .queue-draggable:active {
  cursor: grabbing;
}
.queue-drawer .queue-draggable > .queue-drawer-play,
.queue-drawer .queue-draggable > .queue-drawer-play:active {
  cursor: pointer;
}
.queue-drawer-duration {
  grid-row: 2;
  align-self: center;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
/* The pinned queue owns the player surface until dismissed. */
.screen:has(.queue-overlay.is-open) .player-controls {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
/* Decorative queue artwork reuses cached, authenticated posters. */
.queue-drawer-item {
  position: relative;
}
.queue-drawer-play {
  grid-column: 2 / -1;
  cursor: inherit;
}
.queue-drawer-status {
  grid-column: 2;
}
.queue-drawer-duration {
  grid-column: 3;
}
.queue-poster {
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: center;
  position: relative;
  overflow: hidden;
  border-radius: 3px;
  background: color-mix(in srgb, var(--muted) 12%, transparent);
  border: 1px solid var(--line);
}
.queue-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: absolute;
  inset: 0;
  opacity: 0;
}
.queue-poster.has-image img {
  opacity: 1;
}
.queue-poster-placeholder {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--muted);
  font-size: 13px;
  opacity: 0.5;
}
.queue-poster.has-image .queue-poster-placeholder {
  visibility: hidden;
}
/* Playlist controls: artwork plays; text and row space drag. */
.queue-drawer-list {
  padding: 8px 5px;
}
.queue-drawer-item {
  grid-template-columns: 40px minmax(0, 1fr) auto;
  column-gap: 6px;
  padding: 5px 3px;
  background: color-mix(
    in srgb,
    var(--queue-owner-color, transparent) 9%,
    transparent
  );
}
.queue-drawer .queue-draggable > .queue-drawer-play,
.queue-drawer .queue-draggable > .queue-drawer-play:active {
  cursor: inherit;
}
.queue-drawer-play .queue-label {
  min-width: 0;
  display: block;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.queue-poster {
  width: 40px;
  height: 32px;
  padding: 0;
  cursor: pointer;
}
.queue-drawer .queue-poster:active {
  cursor: pointer;
}
.queue-poster:disabled {
  cursor: default;
  opacity: 0.55;
}
/* Quiet author tint and one reserved top-right remove control. */
.queue-drawer-item.is-current {
  background: color-mix(
    in srgb,
    var(--queue-owner-color, var(--accent)) 13%,
    transparent
  );
}
@media (max-width: 800px) {
  .queue-bar-link input {
    font-size: 16px;
  }
}
/* A phone sheet covers chat, so keep its text and controls isolated. */
.queue-overlay.queue-mobile .queue-drawer {
  background: var(--panel);
}
/* Selection and deletion share the quiet queue header. */
.queue-drawer-play {
  padding-right: 0;
}
.queue-drawer-heading .queue-trash {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 4px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--panel) 70%, transparent);
}
.queue-trash svg {
  width: 17px;
  height: 17px;
}
.queue-drawer-heading .queue-trash:hover:not(:disabled),
.queue-drawer-heading .queue-trash.is-drop-target {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.queue-trash:disabled {
  opacity: 0.35;
  cursor: default;
}
.queue-drawer-item.is-selected {
  border-color: color-mix(in srgb, var(--muted) 30%, transparent);
}
.queue-drawer-item.is-current.is-selected {
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}
/* The fixed handle stays at the middle chat seam. */
.queue-tongue {
  transition: none;
}
.queue-overlay.is-open .queue-tongue {
  transform: none;
}
.queue-tongue::before {
  top: 8px;
  bottom: auto;
  height: 56px;
  width: 3px;
  left: 5.5px;
  right: auto;
  border-radius: 1px;
  box-shadow: none;
}
.queue-drawer-heading .queue-trash.is-drag-ready {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 22%, var(--panel));
  color: var(--text);
}
@media (prefers-reduced-motion: reduce) {
  .queue-tongue {
    transition: none;
  }
}
.queue-overlay.is-open .queue-tongue::after {
  position: absolute;
  left: 5px;
  top: 34px;
  width: 3px;
  height: 3px;
  border-right: 1px solid var(--text);
  border-bottom: 1px solid var(--text);
  opacity: 0.55;
  transform: rotate(-45deg);
  content: none;
}
.queue-overlay.is-open[data-side="right"] .queue-tongue::after {
  transform: rotate(135deg);
}
/* Subtle seam control and thumbnail play affordance. */
.queue-tongue:hover,
.queue-tongue:focus-visible {
  background: transparent;
}
.queue-tongue:hover::before,
.queue-tongue:focus-visible::before {
  background: color-mix(in srgb, var(--accent) 29%, var(--panel));
}
.queue-tongue::before {
  background: color-mix(in srgb, var(--accent) 22%, var(--panel));
}
.queue-overlay.is-open .queue-tongue::before {
  background: color-mix(in srgb, var(--accent) 35%, var(--panel));
}
.queue-drawer .queue-poster.has-image:hover img,
.queue-drawer .queue-poster.has-image:focus-visible img {
  filter: brightness(0.78);
}
.queue-drawer .queue-poster.has-image:hover .queue-poster-placeholder,
.queue-drawer .queue-poster.has-image:focus-visible .queue-poster-placeholder {
  visibility: visible;
  position: relative;
  z-index: 1;
  opacity: 0.9;
  color: white;
}
.local-copy-notice {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  max-width: calc(100% - 24px);
  min-height: 44px;
}

/* Reserve real space for the brand instead of painting it over the title. */
.room-settings-button {
  display: none;
}
.room-bar.chat-bar-hidden .room-settings-button {
  display: flex;
  flex: 0 0 36px;
  width: 36px;
  align-items: center;
  justify-content: center;
}
#screen.youtube-source .peer-connection-indicator {
  position: static;
  transform: none;
  max-width: 100%;
  margin: 3px auto 0;
  white-space: normal;
  text-align: center;
}
.screen .control-row {
  min-width: 0;
  flex-wrap: wrap;
}
body:not(.theater) .room-bar.chat-bar-left .room-power {
  left: calc(var(--normal-chat-width, 220px) + 4px);
}
body.theater .room-bar.chat-bar-left .room-power {
  left: calc(var(--chat-width, 300px) + 4px);
}
@media (max-width: 1100px) {
  .room-bar .brand {
    display: none;
  }
}
@media (max-width: 800px) {
  /* The stacked chat contributes to document height, rather than spilling out
     of a screen sized only for the video and covering the room footer. */
  #screen:not(:fullscreen),
  body.theater #screen:not(:fullscreen),
  #screen.youtube-source:not(:fullscreen),
  body.theater #screen.youtube-source:not(:fullscreen) {
    height: auto;
    min-height: 0;
    max-height: none;
  }
  #screen:not(:fullscreen) .movie-column {
    height: auto;
    width: 100%;
    flex: 0 0 auto;
  }
  #screen:not(:fullscreen) #stage,
  #screen.youtube-source:not(:fullscreen) #stage {
    height: auto;
    aspect-ratio: 16 / 9;
    min-height: min(200px, max(120px, calc(100dvh - 104px)));
    max-height: max(120px, calc(100dvh - 104px));
    flex: 0 0 auto;
  }
  #screen:not(:fullscreen) .chat {
    position: relative;
    inset: auto;
    order: 0;
    width: 100%;
    height: clamp(240px, 40dvh, 360px);
    flex: 0 0 auto;
    max-height: none;
  }
  #screen:not(:fullscreen) #messages {
    min-height: 0;
    max-height: none;
  }
  #screen:not(:fullscreen) .player-controls {
    position: relative;
    inset: auto;
    width: 100%;
  }
  #screen .control-row > button {
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
    height: 44px;
  }
  #screen #volume {
    flex: 0 1 56px;
    width: 56px;
    min-width: 40px;
  }
  #screen #time {
    white-space: nowrap;
  }
  header.room-bar,
  body:not(.theater) header.room-bar,
  header.room-bar.chat-bar-left,
  body:not(.theater) header.room-bar.chat-bar-left,
  header.room-bar.chat-bar-hidden,
  body:not(.theater) header.room-bar.chat-bar-hidden {
    grid-template-columns: 48px minmax(0, 1fr);
    grid-template-rows: minmax(44px, auto) auto;
    height: auto;
    min-height: 96px;
    padding-block: 6px;
    row-gap: 8px;
  }
  .room-bar .header-actions,
  .room-bar.chat-bar-left .header-actions,
  .room-bar.chat-bar-hidden .header-actions {
    position: static;
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    max-width: 100%;
    justify-self: stretch;
    flex-wrap: wrap;
  }
  .room-bar .header-actions button {
    min-height: 44px;
  }
  .room-bar .room-power,
  body:not(.theater) .room-bar.chat-bar-left .room-power,
  body.theater .room-bar.chat-bar-left .room-power {
    left: 4px;
    top: 6px;
    width: 44px;
    height: 44px;
    transform: none;
  }
}
@media (max-width: 800px) and (min-height: 500px) {
  #screen:fullscreen,
  #screen.youtube-source:fullscreen {
    flex-direction: column;
  }
  #screen:fullscreen .movie-column {
    width: 100%;
    height: auto;
    min-width: 0;
    min-height: 0;
    flex: 1 1 0;
  }
  #screen:fullscreen .chat,
  #screen.youtube-source:fullscreen .chat,
  #screen.youtube-source:fullscreen:not(.chat-hidden) .chat {
    position: relative;
    inset: auto;
    width: 100%;
    height: clamp(160px, 30dvh, 240px);
    flex: 0 0 auto;
    min-height: 0;
  }
  #screen:fullscreen #messages {
    min-height: 0;
    max-height: none;
  }
}

/* Shared overlay controls: the selected theme owns every surface and accent. */
dialog {
  --dialog-raised: color-mix(in srgb, var(--soft-panel) 45%, var(--panel));
  background: var(--panel);
  line-height: 1.5;
}
dialog button,
dialog button.primary,
dialog .avatar-editor button {
  min-height: 36px;
  max-width: 100%;
  width: auto;
  margin: 0;
  padding: 7px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--dialog-raised);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  transition:
    background-color 160ms ease,
    border-color 160ms ease;
}
dialog button:hover:not(:disabled) {
  background: var(--hover-bg);
  border-color: color-mix(in srgb, var(--text) 35%, var(--line));
}
dialog button.primary,
#settings .dialog-bottom .primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
  font-weight: 700;
}
dialog button.primary:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 90%, var(--accent-ink));
}
dialog .dialog-head [data-close],
#settings .settings-page-head [data-close] {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
}
#settings .settings-page-head [data-close]:hover {
  background: var(--hover-bg);
  color: var(--text);
}
dialog .setting input[type="checkbox"],
dialog input[type="checkbox"] {
  appearance: none;
  position: relative;
  display: inline-block;
  vertical-align: middle;
  flex: 0 0 44px;
  width: 44px;
  height: 26px;
  min-height: 26px;
  padding: 2px;
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--text) 35%, var(--panel));
  border-radius: 13px;
  background: var(--soft-panel);
  cursor: pointer;
}
dialog input[type="checkbox"]::before {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text);
  transition: transform 180ms ease;
}
dialog input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
dialog input[type="checkbox"]:checked::before {
  transform: translateX(18px);
  background: var(--accent-ink);
}
dialog input[type="checkbox"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
dialog input:not([type="checkbox"]):not([type="range"]):not([type="color"]),
dialog select {
  min-height: 34px;
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text);
}
dialog .note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
dialog .note:empty {
  display: none;
}
dialog details > summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}
dialog .remote-setup {
  gap: 14px;
}
dialog .remote-setup > button {
  justify-self: start;
  width: fit-content;
  max-width: 100%;
}
dialog .remote-setup > button.primary {
  justify-self: end;
}
dialog .remote-setup details {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
#settings .settings-help,
#settings .note,
#settings .settings-disclosure > summary {
  font-size: 13px;
}
#settings #tabs button[data-tab="host"]::after,
#settings #tabs button[data-tab="users"]::after,
#settings #tabs button[data-tab="screen"]::after,
#settings #tabs button[data-tab="browser"]::after {
  content: "Host";
  margin-left: auto;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
#settings #tabs button {
  display: flex;
  align-items: center;
  gap: 8px;
}
#settings #reset {
  padding-inline: 6px;
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  font-size: 12px;
}
#settings #reset:hover {
  color: var(--text);
}
@media (max-width: 850px) and (min-width: 651px) {
  .settings-layout {
    grid-template-columns: 170px minmax(0, 1fr);
  }
  #settings .dialog-bottom {
    padding-left: 192px;
    flex-wrap: wrap;
    gap: 8px;
  }
  #settings .dialog-bottom span {
    flex-basis: 100%;
  }
  #settings .dialog-bottom .primary {
    margin-left: auto;
  }
}
@media (max-width: 650px) {
  dialog {
    padding: 20px;
    max-height: calc(100dvh - 24px);
  }
  #settings .dialog-head {
    padding-block: 12px 4px;
  }
  #settings #tabs {
    border-bottom: 0;
  }
  #settings #tabs button {
    min-height: 44px;
  }
  #settings .settings-page-head {
    padding: 16px;
  }
  #settings .setting {
    flex-wrap: wrap;
  }
  #settings .setting > label {
    flex: 1 1 160px;
  }
  #settings .setting select {
    width: auto;
    max-width: 100%;
  }
  dialog button,
  #settings button,
  #settings select,
  #settings
    input:not([type="checkbox"]):not([type="range"]):not([type="color"]) {
    min-height: 44px;
  }
  #settings .setting input[type="checkbox"] {
    min-height: 26px;
  }
  dialog input:not([type="checkbox"]):not([type="range"]):not([type="color"]),
  dialog select {
    font-size: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  dialog button,
  dialog input[type="checkbox"]::before {
    transition: none;
  }
}
@media (forced-colors: active) {
  dialog .setting input[type="checkbox"],
  dialog input[type="checkbox"] {
    appearance: auto;
    flex-basis: 24px;
    width: 24px;
    height: 24px;
    padding: 0;
  }
  dialog input[type="checkbox"]::before {
    display: none;
  }
}
/* Color samples keep their circular shape instead of becoming action buttons. */
dialog .profile-colors button {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  border-radius: 50%;
}
.action-dialog h2 {
  margin: 0 0 12px;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.action-dialog p {
  color: var(--muted);
  margin: 0 0 22px;
}
.action-dialog input {
  width: 100%;
}
#settings .subtitle-track-actions {
  display: flex;
  gap: 5px;
  flex: 0 0 auto;
}
#settings #shared-caption,
#settings #pref-buffer {
  width: 132px;
  max-width: 100%;
  min-height: 30px;
  padding: 4px 8px;
  font-size: 12px;
}
#settings .subtitle-track-actions button {
  min-height: 26px;
  padding: 3px 8px;
  font-size: 12px;
}
@media (max-width: 650px) {
  #settings #shared-caption,
  #settings #pref-buffer,
  #settings .subtitle-track-actions button {
    min-height: 44px;
  }
  #settings #shared-caption,
  #settings #pref-buffer {
    font-size: 16px;
  }
}
/* "Share screen" chooser: two large options, then Cancel. */
.share-chooser {
  width: min(420px, calc(100vw - 32px));
}
.share-choices {
  display: grid;
  gap: 10px;
}
.share-chooser .share-choice {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: left;
  white-space: normal;
}
.share-chooser .share-choice strong {
  font-size: 15px;
}
.share-chooser .share-choice span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}
.share-chooser .share-choice[aria-current="true"] {
  border-color: var(--accent);
  opacity: 1;
}
.share-download-panel {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--dialog-raised);
}
.share-download-panel[hidden] {
  display: none;
}
.share-download-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.share-download-row[hidden] {
  display: none;
}
.share-download-text {
  font-size: 13px;
  color: var(--text);
}
.share-chooser .share-download-cancel {
  min-height: 28px;
  padding: 4px 10px;
  font-size: 12px;
  flex: 0 0 auto;
}
.share-download-progress,
.shared-browser-helper-progress progress {
  display: block;
  width: 100%;
  height: 6px;
  accent-color: var(--accent);
}
.share-download-progress[hidden],
.share-download-error[hidden],
.shared-browser-helper-progress[hidden],
.shared-browser-helper-error[hidden] {
  display: none;
}
.action-dialog .share-download-error,
.shared-browser-helper-error {
  margin: 0;
  font-size: 13px;
  color: var(--text);
  border-left: 3px solid var(--accent);
  padding-left: 10px;
}
.share-chooser > .note {
  margin: 14px 0 0;
}
.shared-browser-helper-progress {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}
.shared-browser-helper-progress-text {
  font-size: 13px;
  color: var(--text);
}
.shared-browser-helper-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.shared-browser-helper-actions:empty {
  display: none;
}
.action-dialog-buttons {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.invite-dialog {
  display: grid;
  gap: 12px;
}
.invite-dialog > p {
  margin: 0;
}
.invite-dialog > input[readonly] {
  margin: 0;
}
.invite-dialog .dialog-actions {
  margin-top: 0;
}
.invite-profile-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.invite-profile-picker:empty {
  display: none;
}
.invite-profile-picker select {
  flex: 1 1 180px;
  min-width: 0;
}
.invite-profile-picker .note {
  flex-basis: 100%;
  margin: 0;
}
.dialog-inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.dialog-inline-form input {
  flex: 1 1 200px;
  min-width: 0;
}
#app .action-dialog :focus-visible {
  outline: 1px dotted var(--text);
  outline-offset: 3px;
}
/* Keep each control beside its label; only the switch itself changes a toggle. */
#settings .setting {
  justify-content: flex-start;
  gap: 14px;
}
#settings .setting > label {
  flex: 0 1 auto;
}
#settings .setting small {
  display: none;
}
#settings .subtitle-track-setting {
  display: grid;
  grid-template-columns: max-content max-content;
  justify-content: start;
  column-gap: 14px;
  row-gap: 6px;
}
#settings .subtitle-track-actions {
  flex-direction: row;
  align-items: center;
  max-width: none;
}
#settings .subtitle-track-setting .subtitle-track-note {
  display: block;
  grid-column: 1 / -1;
  width: max-content;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  white-space: nowrap;
  overflow-x: auto;
}
@media (max-width: 650px) {
  #settings .subtitle-track-setting {
    grid-template-columns: minmax(0, 1fr);
  }
  #settings .subtitle-track-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}
@media (forced-colors: none) {
  #settings .setting input[type="checkbox"] {
    flex-basis: 32px;
    width: 32px;
    height: 18px;
    min-height: 18px;
    border-radius: 9px;
  }
  #settings .setting input[type="checkbox"]::before {
    width: 12px;
    height: 12px;
  }
  #settings .setting input[type="checkbox"]:checked::before {
    transform: translateX(14px);
  }
}
#settings .theme-picker-label {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 500;
  color: color-mix(in srgb, var(--text) 65%, var(--muted));
}
#settings .theme-browser {
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 0 0 12px;
}
#settings .theme-browser > summary {
  width: fit-content;
  padding: 4px 0;
  color: var(--text);
}
#settings .theme-browser[open] > summary {
  border: 0;
  margin-bottom: 8px;
}
#settings .theme-browser .theme-selection {
  display: inline;
  margin: 0;
  font-size: 13px;
}
#settings .dialog-bottom {
  display: grid;
  align-items: center;
}
#settings .dialog-bottom > span {
  max-width: none;
  font-size: 11px;
}
#settings .settings-footer-actions {
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: center;
}
#settings .settings-footer-actions #reset {
  font-size: 10px;
}
#settings .keyboard-settings.settings-disclosure.settings-group {
  margin-top: 22px;
  padding: 0;
  border: 0;
  border-radius: 0;
}
#settings .keyboard-settings.settings-disclosure > summary {
  padding: 6px 0;
}
#settings .keyboard-settings.settings-disclosure[open] > summary {
  border: 0;
}
#settings .settings-sidebar {
  display: flex;
  flex-direction: column;
}
#settings .settings-sidebar #diagnosticsButton {
  flex-shrink: 0;
  align-self: flex-start;
  margin: auto 12px 10px;
  padding: 4px 0;
  min-height: 28px;
  border: 0;
  background: transparent;
  font-size: 11px;
  text-align: left;
}
#settings .dialog-bottom {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}
#settings .dialog-bottom > span {
  grid-column: 2;
}
#settings .settings-footer-actions {
  grid-column: 3;
}
@media (max-width: 650px) {
  #settings .dialog-bottom {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  #settings .dialog-bottom > span {
    grid-column: 1;
    grid-row: 1;
  }
  #settings .settings-footer-actions {
    grid-column: 2;
    grid-row: 1;
  }
}
#info:has(.folder-picker) {
  width: min(880px, calc(100vw - 32px));
}
.folder-picker {
  display: grid;
  gap: 16px;
  min-width: 0;
}
.folder-picker > .note {
  margin: 0;
}
.folder-picker textarea {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  line-height: 1.5;
  overflow: hidden;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  resize: vertical;
}
@media (max-width: 650px) {
  .folder-picker textarea {
    font-size: 16px;
  }
}
/* A compact footer keeps the saved-state message close to the content. */
#settings .dialog-bottom {
  padding: 6px 12px;
  gap: 8px;
}
#settings .dialog-bottom > span {
  align-self: start;
  margin-top: 1px;
  text-align: center;
  line-height: 1.35;
}
#settings .settings-footer-actions {
  gap: 1px;
}
#settings .settings-footer-actions .primary {
  min-height: 26px;
  padding: 3px 14px;
  font-size: 12px;
  line-height: 1.4;
}
#settings .settings-footer-actions #reset {
  min-height: 18px;
  padding: 0;
  line-height: 1.4;
}
@media (max-width: 650px) {
  #settings .settings-footer-actions .primary {
    min-height: 36px;
  }
}
.room-welcome-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.room-welcome-actions > button:last-child {
  margin-left: auto;
}
.room-welcome-actions > details {
  padding: 0;
  border: 0;
}
.room-welcome-actions > details[open] {
  flex-basis: 100%;
  order: 1;
}
dialog .remote-setup .room-welcome-actions {
  border-top: 0;
  padding-top: 0;
  justify-content: flex-start;
}
dialog .remote-setup .room-welcome-actions > details {
  border: 0;
  padding: 0;
  margin: 0;
  align-self: center;
}
.room-ready-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
#info:has(.remote-setup-back) .dialog-head {
  margin-top: 40px;
}
#info .remote-setup-back {
  position: absolute;
  top: 14px;
  left: 28px;
  min-height: 30px;
  padding: 4px 8px;
  border: 0;
  background: transparent;
}
@media (max-width: 650px) {
  #info .remote-setup-back {
    left: 20px;
  }
}
/* Connection & diagnostics: sections, collapsible log lines, one Copy. */
.diagnostics h3 {
  margin: 18px 0 6px;
  font-size: 15px;
}
.diagnostics h3:first-child {
  margin-top: 0;
}
.diagnostics-logs details {
  margin-top: 8px;
}
.diagnostics-logs pre {
  max-height: 220px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 11px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.diagnostics-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}
.diagnostics-addresses {
  display: flex;
  align-items: center;
  gap: 6px;
}
.diagnostics textarea {
  width: 100%;
  margin-top: 10px;
  font-size: 11px;
}

/* Library V1 / compact room intake. */
.movie-column {
  position: relative;
}
/* Room footer: control bar and title under the player, actions under the chat. */
header.room-bar,
body:not(.theater) header.room-bar {
  height: auto;
  min-height: 0;
  grid-template-rows: 34px;
  row-gap: 4px;
  padding-block: 6px;
  align-items: center;
}
.queue-bar-v1 {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  padding-inline: 10px;
}
.queue-bar-v1:has(.room-live-actions button:not([hidden])) .queue-bar-link {
  margin-inline: auto;
  min-width: min(300px, 100%);
}
.room-live-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
}
.room-live-actions:not(:has(button:not([hidden]))) {
  display: none;
}
.room-bar.chat-bar-left .room-live-actions {
  order: -1;
}
/* One centered bar; every button sits inside its frame. */
.queue-bar-link {
  display: flex;
  align-items: center;
  flex: 0 1 50%;
  min-width: min(440px, 100%);
  height: 32px;
  box-sizing: border-box;
  gap: 1px;
  padding-inline: 2px 3px;
  background: color-mix(in srgb, var(--panel) 65%, transparent);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.queue-bar-field {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
}
/* The player shows the title, so this row is gone; other code still updates it. */
.room-bar .now-playing {
  display: none;
}
.queue-bar-link input {
  width: 100%;
  min-width: 0;
  height: 100%;
  box-sizing: border-box;
  padding: 0 8px;
  background: transparent;
  color: var(--text);
  border: 0;
  font-size: 13px;
}
.queue-bar-link input:focus {
  outline: none;
}
.queue-bar-icon {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 18px;
}
.queue-bar-icon[hidden] {
  display: none;
}
.queue-bar-icon svg {
  width: 17px;
  height: 17px;
}
.queue-bar-toggle {
  flex: 0 0 auto;
  height: 26px;
  margin-left: 3px;
  padding: 0 10px;
  border: 0;
  font-size: 12px;
  white-space: nowrap;
}
.queue-bar-link .queue-bar-toggle {
  margin-left: 0;
  background: transparent;
}
.queue-bar-link .queue-bar-toggle:hover:not(:disabled) {
  background: var(--hover-bg);
}
.queue-bar-link .queue-bar-toggle[aria-pressed="true"] {
  color: var(--accent);
}
.queue-bar-divider {
  flex: none;
  width: 1px;
  height: 16px;
  margin-inline: 2px;
  background: var(--line);
}
.queue-bar-v1 :disabled {
  opacity: 0.45;
  cursor: default;
}
.room-bar .brand {
  grid-row: 1;
}
.room-bar .room-power {
  top: 9px;
  transform: none;
}
.room-actions {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  gap: 4px;
  min-width: 0;
  padding-inline: 6px;
}
.room-share-actions {
  display: flex;
  min-width: 0;
  gap: 4px;
}
.room-actions button,
.room-live-actions button {
  width: 100%;
  min-width: 0;
  height: 28px;
  min-height: 0;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.room-live-actions button {
  flex: 0 0 auto;
  width: auto;
  padding-inline: 10px;
  overflow: visible;
}
/* Sized by their labels: three equal thirds cut "Share screen" and "Share
   browser" short under a narrow chat column. */
.room-share-actions {
  flex: 1 1 auto;
}
.room-share-actions button,
.room-actions > button {
  flex: 1 1 auto;
  width: auto;
  padding-inline: 6px;
}
.room-bar.chat-bar-hidden .room-actions button {
  flex: 1 1 0;
}
.room-actions button[hidden],
.room-live-actions button[hidden] {
  display: none;
}
.room-actions button:hover,
.room-live-actions button:hover {
  background: var(--hover-bg);
}
.room-bar .header-actions {
  display: none;
}
.room-bar.chat-bar-left .queue-bar-v1 {
  grid-column: 2;
}
.room-bar.chat-bar-left .room-actions {
  grid-column: 1;
}
.room-bar.chat-bar-hidden .queue-bar-v1,
.room-bar.chat-bar-hidden .brand {
  grid-column: 1;
}
.room-bar.chat-bar-hidden .room-actions {
  grid-column: 1;
  grid-row: 2;
}
.room-bar.chat-bar-hidden .room-share-actions {
  flex: 1 1 0;
}
header.room-bar.chat-bar-hidden,
body:not(.theater) header.room-bar.chat-bar-hidden {
  grid-template-rows: 34px 28px;
}
/* With the chat hidden, this is the only way back to settings. */
.room-bar.chat-bar-hidden .header-actions {
  display: flex;
  width: auto;
}
/* With the chat hidden there's no column to sit under, so these join the one row. */
@media (min-width: 801px) {
  header.room-bar.chat-bar-hidden,
  body:not(.theater) header.room-bar.chat-bar-hidden {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 34px;
  }
  .room-bar.chat-bar-hidden .room-actions {
    grid-column: 2;
    grid-row: 1;
    align-items: center;
    padding-inline: 0 44px;
  }
  .room-bar.chat-bar-hidden .room-share-actions {
    flex: none;
  }
  .room-bar.chat-bar-hidden .room-actions button {
    flex: 0 0 auto;
    width: auto;
    height: 28px;
    padding: 0 12px;
  }
}
.room-bar.chat-bar-hidden .header-actions {
  top: 0;
  bottom: 0;
  align-items: center;
}
.room-bar.chat-bar-hidden .room-settings-button {
  height: 28px;
}
.room-bar.chat-bar-hidden .header-actions .pill {
  display: none;
}
@media (max-width: 1100px) {
  .queue-bar-v1 {
    padding-inline: 44px 10px;
  }
}
@media (max-width: 800px) {
  header.room-bar,
  body:not(.theater) header.room-bar,
  header.room-bar.chat-bar-left,
  body:not(.theater) header.room-bar.chat-bar-left,
  header.room-bar.chat-bar-hidden,
  body:not(.theater) header.room-bar.chat-bar-hidden {
    grid-template-rows: auto auto;
    padding-block: 7px;
    padding-inline: 0;
  }
  .queue-bar-v1,
  .room-bar.chat-bar-left .queue-bar-v1,
  .room-bar.chat-bar-hidden .queue-bar-v1 {
    grid-column: 2;
    grid-row: 1;
    flex-wrap: wrap;
    justify-content: flex-end;
    padding-inline: 0 6px;
  }
  .room-live-actions {
    width: 100%;
  }
  .room-live-actions button {
    flex: 1 1 0;
    height: 40px;
  }
  .room-actions,
  .room-bar.chat-bar-left .room-actions,
  .room-bar.chat-bar-hidden .room-actions {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .room-share-actions {
    flex: 1 1 0;
  }
  .room-actions button {
    flex: 1 1 0;
    height: 44px;
  }
  .queue-bar-link {
    flex-basis: 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
    height: auto;
    padding: 3px;
  }
  .queue-bar-field {
    flex-basis: 100%;
    height: 42px;
  }
  .queue-bar-icon {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
  }
  .queue-bar-toggle {
    height: 40px;
  }
  .room-bar .room-power {
    top: 6px;
    bottom: auto;
  }
}
.library-v1 {
  position: absolute;
  inset: 0;
  background: var(--bg);
  z-index: 25;
  overflow: auto;
  padding: 24px;
  border-radius: 12px;
  color: var(--text);
}
.library-v1[hidden] {
  display: none;
}
.library-v1.has-backdrop {
  background: transparent;
}
.library-v1-backdrop {
  position: absolute;
  inset: 0;
  z-index: 24;
  overflow: hidden;
  border-radius: 12px;
  background: var(--bg);
}
.library-v1-backdrop[hidden] {
  display: none;
}
.library-v1-backdrop img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 500ms ease;
}
.library-v1-backdrop.is-visible img {
  opacity: 0.4;
}
.library-v1-backdrop.is-blurred img {
  filter: blur(28px);
  transform: scale(1.1);
}
.library-v1-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, transparent 10%, var(--bg) 78%),
    linear-gradient(
      to right,
      var(--bg),
      transparent 28%,
      transparent 72%,
      var(--bg)
    );
}
@media (prefers-reduced-motion: reduce) {
  .library-v1-backdrop img {
    transition: none;
  }
}
.library-v1 button:focus-visible,
.queue-bar-v1 button:focus-visible,
.room-actions button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.library-v1-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.library-v1-header h2 {
  margin-right: auto;
  font-size: 24px;
}
.library-v1-header button {
  font-size: 13px;
  min-height: 42px;
  background: var(--panel);
}
.library-v1-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.library-v1-toolbar input[type="search"] {
  flex: 1;
  min-width: 0;
  height: 36px;
  box-sizing: border-box;
  padding: 0 11px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
}
.library-v1-toolbar select,
.library-v1-toolbar button {
  flex: none;
  height: 36px;
  min-height: 0;
  background: var(--panel);
  font-size: 13px;
}
.library-v1-toolbar button.is-active {
  color: var(--accent);
  border-color: var(--accent);
}
.library-v1-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.library-v1-chips[hidden] {
  display: none;
}
.library-v1-chips button {
  min-height: 30px;
  padding: 3px 12px;
  border-radius: 999px;
  background: transparent;
  font-size: 13px;
}
.library-v1-chips [aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
}
.library-v1-more {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.library-v1-more[hidden] {
  display: none;
}
.library-v1-more label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
}
.library-v1-more select {
  min-height: 32px;
  background: var(--panel);
  font-size: 13px;
}
.library-v1-more button {
  min-height: 32px;
  margin-left: auto;
  font-size: 13px;
}
.library-v1-unsupported {
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
}
.library-v1-unsupported summary {
  cursor: pointer;
}
.library-v1-unsupported .note {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
}
.library-v1-card.is-returning {
  position: relative;
  z-index: 3;
}
.library-v1-art {
  transform-origin: top left;
}
.library-v1-focus-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}
.library-v1-focus-actions button {
  height: 36px;
  min-height: 0;
  margin: 0;
  font-size: 13px;
}
.library-v1-outlink {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}
.library-v1-outlink:hover {
  color: var(--text);
}
/* Typing never draws a coloured frame or glow, anywhere in the app. */
#app input:not([type="checkbox"], [type="radio"], [type="range"]):focus,
#app textarea:focus,
#app select:focus {
  outline: none;
  box-shadow: none;
}
.queue-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.queue-drawer-heading .queue-clear {
  flex: none;
  width: auto;
  height: 18px;
  min-height: 0;
  padding: 0 6px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  line-height: 18px;
}
.queue-clear:hover:not(:disabled) {
  color: var(--text);
  background: var(--hover-bg);
}
.library-v1-more-button,
.library-v1-episode-add {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 18px;
}
.library-v1-more-button[hidden] {
  display: none;
}
.library-v1-more-button:hover:not(:disabled),
.library-v1-episode-add:hover:not(:disabled) {
  background: var(--hover-bg);
}
.library-v1-menu {
  position: absolute;
  z-index: 4;
  display: flex;
  flex-direction: column;
  min-width: 190px;
  padding: 5px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px #0007;
}
.library-v1-menu > button {
  min-height: 32px;
  padding: 4px 10px;
  border: 0;
  background: transparent;
  text-align: left;
  font-size: 13px;
}
.library-v1-menu > button:hover,
.library-v1-menu > button:focus-visible {
  background: var(--hover-bg);
}
.library-v1-menu-types {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  padding: 7px 6px 3px;
  border-top: 1px solid var(--line);
}
.library-v1-menu-types span {
  flex-basis: 100%;
  font-size: 12px;
  color: var(--muted);
}
.library-v1-menu-types button {
  min-height: 28px;
  padding: 2px 8px;
  font-size: 12px;
}
.library-v1-menu-types [aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
}
.library-v1-menu-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 240px;
  padding: 3px;
}
.library-v1-menu-form input {
  height: 32px;
  box-sizing: border-box;
  padding: 0 8px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
}
.library-v1-menu-form button {
  min-height: 30px;
  font-size: 13px;
}
.library-v1-episode-play .library-v1-art {
  flex: 0 0 96px;
  width: 96px;
  border-radius: 5px;
}
.library-v1-episode-play .library-v1-art > span {
  display: none;
}
.library-v1-episode-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.library-v1-episode-text span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--muted);
}
.library-v1-episode-text span:empty,
.library-v1-episode-text p:empty {
  display: none;
}
.library-v1-episode-text p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}
.library-v1-overview {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  max-width: 620px;
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}
.library-v1-card {
  min-width: 0;
}
.library-v1-open {
  width: 100%;
  border: 0;
  padding: 0;
  text-align: left;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.library-v1-open strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.4;
}
.library-v1-open small {
  font-size: 12px;
  color: var(--muted);
}
.library-v1-art {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 100%;
  display: grid;
  place-items: center;
}
.library-v1-art > span:not(.library-v1-runtime) {
  font-size: 12px;
  color: var(--muted);
  padding: 10px;
}
.library-v1-art img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.library-v1-runtime {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: #000c;
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}
.library-v1-watch {
  position: absolute;
  height: 3px;
  background: var(--accent);
  left: 0;
  bottom: 0;
}
.library-v1-player-title {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 22px;
  font-size: 20px;
  color: white;
  background: linear-gradient(#000a, transparent);
  pointer-events: none;
  opacity: 0;
}
.library-v1-player-title-clip {
  overflow: hidden;
}
.library-v1-player-title-clip > span {
  display: block;
  width: fit-content;
  max-width: 100%;
  overflow-wrap: anywhere;
}
@media (any-hover: hover) {
  .movie-column:hover .library-v1-player-title-clip {
    pointer-events: auto;
  }
  .screen.auto-hide-controls.controls-idle
    .library-v1-player-title-clip:not(:hover) {
    pointer-events: none;
  }
}
@media (any-hover: hover) and (prefers-reduced-motion: no-preference) {
  .library-v1-player-title-clip {
    container-type: inline-size;
  }
  .library-v1-player-title-clip > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .library-v1-player-title-clip:hover > span {
    width: max-content;
    max-width: none;
    animation: reveal-player-title 4s 350ms linear both;
  }
  @keyframes reveal-player-title {
    to {
      transform: translateX(min(0px, calc(100cqi - 100%)));
    }
  }
}
.library-v1-neighbors {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 70px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
  opacity: 0;
}
.library-v1-neighbor {
  pointer-events: auto;
  background: #101511dd;
  color: white;
  padding: 0;
  width: fit-content;
  min-width: 170px;
  max-width: min(260px, 44vw);
  overflow: hidden;
  border-color: #ffffff40;
  text-align: left;
}
.library-v1-neighbor-prev {
  margin-right: auto;
}
.library-v1-neighbor-next {
  margin-left: auto;
}
.library-v1-neighbor .library-v1-art {
  aspect-ratio: auto;
  width: 100%;
  height: 56px;
  border: 0;
  border-radius: 0;
}
.library-v1-neighbor > span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}
.library-v1-neighbor.is-episode > span {
  display: block;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.library-v1-neighbor .library-v1-runtime {
  font-size: 12px;
  bottom: 3px;
  right: 3px;
  padding: 0 3px;
}
.library-v1-neighbor .library-v1-art > span:not(.library-v1-runtime) {
  font-size: 12px;
  padding: 3px;
}
.movie-column:hover .library-v1-player-title,
.movie-column:focus-within .library-v1-player-title,
.movie-column:hover .library-v1-neighbors,
.movie-column:focus-within .library-v1-neighbors {
  opacity: 1;
}
/* The title and cards fade with the player controls. */
.library-v1-player-title,
.library-v1-neighbors {
  transition: opacity var(--controls-fade, 120ms) var(--controls-ease, ease-out);
}
.screen.auto-hide-controls:not(.controls-idle) .library-v1-player-title,
.screen.auto-hide-controls:not(.controls-idle) .library-v1-neighbors {
  opacity: 1;
}
.screen.auto-hide-controls.controls-idle .library-v1-player-title,
.screen.auto-hide-controls.controls-idle .library-v1-neighbors {
  opacity: 0;
}
.screen.auto-hide-controls.controls-idle
  .library-v1-player-title:has(.library-v1-player-title-clip:hover) {
  opacity: 1;
}
.screen.auto-hide-controls.controls-idle .library-v1-neighbors {
  transform: none;
}
.screen.auto-hide-controls.controls-idle .library-v1-neighbor {
  pointer-events: none;
}
@media (max-width: 760px) {
  .library-v1-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
  }
  .library-v1-toolbar input[type="search"] {
    grid-column: 1 / 3;
    width: 100%;
  }
  .library-v1-toolbar .library-v1-settings {
    grid-column: 3;
    grid-row: 1;
  }
  .library-v1-toolbar select {
    min-width: 0;
    width: 100%;
  }
  .library-v1 {
    padding: 16px;
  }
  .library-v1-header {
    flex-wrap: wrap;
  }
  .library-v1-header h2 {
    font-size: 22px;
  }
  .library-v1-neighbor {
    min-width: 132px;
    max-width: min(210px, 45vw);
  }
  .library-v1-neighbor .library-v1-art {
    height: 44px;
  }
}
@media (hover: none) {
  .library-v1-neighbors,
  .library-v1-player-title {
    opacity: 1;
  }
}
.library-v1-preparation {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}
.library-v1-preparation:empty {
  display: none;
}
.library-v1-preparation progress {
  display: block;
  width: 100%;
  height: 3px;
  margin-top: 5px;
  accent-color: var(--muted);
}
/* Show view: the picked card sits centered, with its episodes beneath it. */
.library-v1-back {
  position: relative;
  z-index: 1;
  min-height: 30px;
  padding: 2px 10px 2px 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
}
.library-v1-back:hover {
  color: var(--text);
  background: var(--hover-bg);
}
.library-v1-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
}
.library-v1-close:hover {
  color: var(--text);
  background: var(--hover-bg);
}
.room-actions button[aria-pressed="true"],
.room-live-actions button[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
}
.library-v1-row {
  margin-bottom: 14px;
  padding: 10px 12px 8px;
  border-radius: 10px;
  background: color-mix(in srgb, #000 32%, transparent);
}
.library-v1-row-head {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 8px;
}
.library-v1-row-head h3 {
  flex: 1;
  margin: 0;
  font-size: 15px;
}
.library-v1-shelf-button {
  width: 28px;
  height: 26px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
}
.library-v1-shelf-button[hidden] {
  display: none;
}
.library-v1-shelf-button:hover {
  color: var(--text);
  background: var(--hover-bg);
}
.library-v1-shelf {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  padding-bottom: 6px;
}
.library-v1-shelf .library-v1-card {
  position: relative;
  flex: 0 0 200px;
  scroll-snap-align: start;
}
/* Sits beside the title, so the whole thumbnail stays a clean click target. */
.library-v1-quick {
  position: absolute;
  top: calc((200px * 9 / 16) + 6px);
  right: 0;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  min-height: 0;
  padding: 0 0 0 2px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--accent);
  font-size: 10px;
}
.library-v1-quick:hover {
  background: var(--accent);
  color: var(--bg);
}
.library-v1-shelf .library-v1-open strong {
  padding-right: 60px;
}
.library-v1-shelf .library-v1-more-button {
  position: absolute;
  top: calc((200px * 9 / 16) + 6px);
  right: 30px;
  width: 26px;
  height: 26px;
  font-size: 16px;
}
.library-v1-quick[hidden] {
  display: none;
}
.library-v1-episode.is-watched .library-v1-episode-text {
  opacity: 0.65;
}
.library-v1-match-results {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.library-v1-match-results button {
  min-height: 30px;
  padding: 3px 6px;
  border: 0;
  background: transparent;
  text-align: left;
  font-size: 13px;
}
.library-v1-match-results button:hover {
  background: var(--hover-bg);
}
.library-v1-match-results p {
  margin: 4px;
  font-size: 12px;
  color: var(--muted);
}
.library-v1-show {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  margin-top: -18px;
}
.library-v1-show .library-v1-art {
  width: min(300px, 34vh, 100%);
  margin-bottom: 8px;
  transform-origin: top left;
}
.library-v1-show h2 {
  max-width: 720px;
  overflow-wrap: anywhere;
  font-size: 24px;
  margin: 0;
}
.library-v1-show small {
  font-size: 12px;
  color: var(--muted);
}
.library-v1-seasons,
.library-v1-show-tools,
.library-v1-episodes {
  max-width: 720px;
  margin-inline: auto;
}
.library-v1-seasons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}
.library-v1-seasons:empty {
  display: none;
}
.library-v1-seasons button {
  font-size: 13px;
  min-height: 32px;
}
.library-v1-seasons [aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
}
.library-v1-show-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
}
.library-v1-show-tools button {
  flex: none;
  font-size: 12px;
  min-height: 30px;
}
.library-v1-episodes {
  margin-top: 8px;
}
.library-v1-episode {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--line);
}
.library-v1-episode-play {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 7px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  font-size: 14px;
}
.library-v1-episode-play:hover:not(:disabled) {
  background: var(--hover-bg);
}
.library-v1-episode-play small {
  flex: none;
  font-size: 12px;
  color: var(--muted);
}
.emoji-divider {
  grid-column: 1 / -1;
  height: 1px;
  margin-block: 3px;
  background: var(--line);
}
.media-menu {
  position: fixed;
  z-index: 40;
}
.library-v1-toolbar .library-v1-settings {
  width: 36px;
  padding: 0;
}
.library-folder {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.library-folder span {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.library-folder button {
  flex: none;
}
.library-folder-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
body.is-dropping::after {
  content: "Drop to add";
  position: fixed;
  inset: 12px;
  z-index: 60;
  display: grid;
  place-items: center;
  border: 2px dashed var(--accent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  color: var(--text);
  font-size: 20px;
  pointer-events: none;
}
/* Chat reading comfort. */
.message p,
body.compact .message p {
  line-height: 1.4;
}
.message,
body.compact .message {
  margin-top: 7px;
}
.message.continuation,
body.compact .message.continuation {
  margin-top: 0;
}
.message strong {
  font-size: calc(var(--chat-font-size, 14px) - 1px);
  font-weight: 600;
}
.message time,
.compact .message time {
  opacity: 0.7;
}
body.chat-avatars .message-avatar {
  left: 5px;
  width: 22px;
  height: 22px;
  font-size: 11px;
}
body.chat-avatars.compact .message,
body.chat-avatars.compact .message.continuation {
  padding-left: 33px;
}
body.theater {
  overflow: hidden;
}
#profileEditor .remove-profile {
  border-color: color-mix(in srgb, #d96868 50%, var(--line));
}
