:root {
  color-scheme: dark;
  --bg: #0e1116;
  --rail: #0a0d12;
  --sidebar: #131820;
  --panel: #171d26;
  --panel-soft: #10151d;
  --panel-strong: #202835;
  --border: #293241;
  --text: #f4f7fb;
  --muted: #97a3b3;
  --accent: #14b8a6;
  --accent-strong: #0f766e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.18);
  --app-height: 100vh;
  --watch-header-height: 56px;
}

@supports (height: 100dvh) {
  :root {
    --app-height: 100dvh;
  }
}

body[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f7fb;
  --rail: #e7edf5;
  --sidebar: #ffffff;
  --panel: #ffffff;
  --panel-soft: #eef3f8;
  --panel-strong: #e7edf5;
  --border: #d5deea;
  --text: #17202c;
  --muted: #657286;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --shadow: 0 18px 42px rgba(45, 58, 79, 0.14);
}

body[data-theme="pink"] {
  --bg: #171217;
  --rail: #120d13;
  --sidebar: #211922;
  --panel: #2a1f2c;
  --panel-soft: #1d1620;
  --panel-strong: #36273a;
  --border: #49364e;
  --accent: #f472b6;
  --accent-strong: #db2777;
}

body[data-theme="white"] {
  color-scheme: light;
  --bg: #ffffff;
  --rail: #f1f5f9;
  --sidebar: #ffffff;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --panel-strong: #eef2f7;
  --border: #d9e2ec;
  --text: #101828;
  --muted: #667085;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
}

body[data-theme="marine"] {
  --bg: #07151d;
  --rail: #041018;
  --sidebar: #0b1f2b;
  --panel: #102c3a;
  --panel-soft: #0a1c27;
  --panel-strong: #15394a;
  --border: #245064;
  --accent: #38bdf8;
  --accent-strong: #0284c7;
}

body[data-theme="pink-white"] {
  color-scheme: light;
  --bg: #fff7fb;
  --rail: #ffe7f1;
  --sidebar: #ffffff;
  --panel: #ffffff;
  --panel-soft: #fff0f6;
  --panel-strong: #ffe1ef;
  --border: #f7bad2;
  --text: #3a1f2d;
  --muted: #8a5d72;
  --accent: #ec4899;
  --accent-strong: #be185d;
  --danger: #e11d48;
  --warning: #d97706;
  --shadow: 0 18px 42px rgba(190, 24, 93, 0.14);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.boot-view {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--bg);
}

.boot-card {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 760;
}

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

button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--accent);
  color: #06110f;
  font-weight: 720;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, opacity 140ms ease;
}

button:hover {
  background: color-mix(in srgb, var(--accent) 88%, white);
}

button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-soft) 92%, black);
  color: var(--text);
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input,
select {
  padding: 0 12px;
}

textarea {
  min-height: 76px;
  resize: vertical;
  padding: 10px 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.secondary-button,
button.secondary-button {
  border-color: var(--border);
  background: color-mix(in srgb, var(--panel-strong) 82%, transparent);
  color: var(--text);
}

.secondary-button:hover,
button.secondary-button:hover {
  background: color-mix(in srgb, var(--panel-strong) 86%, var(--accent));
  border-color: color-mix(in srgb, var(--border) 65%, var(--accent));
}

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

.danger-button:hover {
  background: color-mix(in srgb, var(--danger) 88%, white);
}

button:disabled:hover,
button:not(.secondary-button):not(.danger-button):disabled:hover {
  background: var(--accent);
}

button.secondary-button:disabled:hover,
.secondary-button:disabled:hover {
  background: color-mix(in srgb, var(--panel-strong) 82%, transparent);
  border-color: var(--border);
}

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

.small-button {
  min-height: 30px;
  padding: 0 10px;
  border-color: var(--border);
  background: color-mix(in srgb, var(--panel-strong) 82%, transparent);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.icon-button {
  width: 38px;
  min-height: 38px;
  padding: 0;
  border-color: var(--border);
  background: color-mix(in srgb, var(--panel-strong) 82%, transparent);
  color: var(--text);
}

.auth-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth-panel {
  width: min(460px, 100%);
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 96%, white);
  box-shadow: var(--shadow);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.brand-mark,
.server-button {
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #04110f;
  font-weight: 820;
}

.brand-mark {
  width: 52px;
  height: 52px;
  font-size: 28px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 780;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  line-height: 1.12;
  letter-spacing: 0;
  font-weight: 780;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.auth-panel h1,
.stage-header h1 {
  margin-bottom: 0;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.tab {
  background: var(--panel-soft);
  color: var(--muted);
}

.tab.active {
  background: var(--accent);
  color: #04110f;
}

.auth-form,
.settings-form,
.picture-form {
  display: grid;
  gap: 12px;
}

.auth-form label,
.settings-form label,
.settings-row label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.form-message {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--warning);
  font-weight: 720;
}

.app-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 68px 292px minmax(0, 1fr);
}

.app-view.room-focus {
  grid-template-columns: 68px minmax(0, 1fr);
}

.app-view.room-focus .sidebar {
  display: none;
}

.app-view.room-focus.sidebar-open {
  grid-template-columns: 68px 292px minmax(0, 1fr);
}

.app-view.room-focus.sidebar-open .sidebar {
  display: block;
}

.server-rail {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  background: var(--rail);
  border-right: 1px solid var(--border);
}

.server-button {
  width: 48px;
  min-height: 48px;
  padding: 0;
  color: #04110f;
}

.server-button:not(.active) {
  background: var(--panel-strong);
  color: var(--text);
}

.server-button.add {
  margin-top: auto;
}

.room-rail {
  display: grid;
  gap: 10px;
}

.sidebar {
  min-width: 0;
  padding: 16px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.sidebar-header,
.stage-header,
.section-title,
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-header h2,
.section-title h3,
.chat-header h3 {
  margin-bottom: 0;
}

.profile-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin: 16px 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 82%, var(--panel-soft));
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--panel-strong);
  border: 1px solid var(--border);
}

.avatar.large {
  width: 64px;
  height: 64px;
}

.profile-copy {
  min-width: 0;
}

.profile-copy h3,
.profile-copy p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-copy h3 {
  margin-bottom: 2px;
}

.profile-copy p {
  margin-bottom: 7px;
  color: var(--muted);
}

.premium-badge,
.count-chip,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  width: fit-content;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 12px;
  font-weight: 740;
}

.premium-badge.premium {
  color: #fef3c7;
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.38);
}

.status-pill.online {
  color: #a7f3d0;
  border-color: rgba(20, 184, 166, 0.45);
}

.status-pill.offline {
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.45);
}

.sidebar-section {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.nav-list,
.friend-list,
.compact-list,
.online-list {
  display: grid;
  gap: 8px;
}

.nav-item,
.friend-item,
.pending-item,
.online-item,
.search-result-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-soft) 82%, var(--panel));
}

.nav-item {
  cursor: pointer;
}

.nav-item.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--panel-soft));
  box-shadow: inset 3px 0 0 var(--accent);
}

.item-copy {
  min-width: 0;
}

.item-copy strong,
.item-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-copy span {
  color: var(--muted);
  font-size: 12px;
}

.pending-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--muted);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--muted) 16%, transparent);
}

.status-dot.online {
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.search-form,
.inline-form,
.video-form,
.chat-form,
.transport-row,
.settings-row {
  display: flex;
  gap: 10px;
}

.search-form button,
.inline-form button,
.video-form button,
.chat-form button {
  flex: 0 0 auto;
}

.search-result {
  min-height: 0;
}

.main-stage {
  min-width: 0;
  padding: 14px 16px;
  overflow: hidden;
}

.stage-header {
  min-height: 50px;
  margin-bottom: 10px;
}

.stage-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.sidebar-toggle {
  display: none;
}

.app-view.room-focus .sidebar-toggle {
  display: inline-flex;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(280px, 440px) minmax(280px, 1fr);
  gap: 16px;
  align-items: start;
}

.panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 94%, var(--panel-soft));
  box-shadow: none;
}

.room-create-panel {
  grid-column: 1 / -1;
}

.room-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 12px;
  align-items: start;
}

.player-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #05070a;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.2);
}

.player-frame:fullscreen {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  background: #05070a;
}

.player-frame:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  background: #05070a;
}

#player,
#player iframe,
#localPlayer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#player,
#player iframe,
#localPlayer {
  pointer-events: none;
}

#localPlayer {
  background: #05070a;
  object-fit: contain;
}

#localPlayer:fullscreen,
#localPlayer:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  object-fit: contain;
}

.player-badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  max-width: calc(100% - 24px);
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(5, 7, 10, 0.78);
  color: #d8dee8;
  font-size: 13px;
  font-weight: 720;
}

.control-panel {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 92%, var(--panel-soft));
}

.control-panel-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.room-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.room-toolbar button {
  min-height: 38px;
  padding: 0 12px;
}

.controls-body {
  display: grid;
  gap: 10px;
}

.control-panel.collapsed .controls-body {
  display: none;
}

.timebar {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 58px;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 720;
}

input[type="range"] {
  accent-color: var(--accent);
}

.video-form {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) auto;
}

.settings-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 140px minmax(180px, 1fr);
  align-items: end;
}

.download-panel {
  display: grid;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
}

.download-panel > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#mediaDownloadHint,
.download-status,
.control-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.control-hint.host {
  color: var(--accent);
}

.sync-readout {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-soft) 86%, var(--panel));
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.chat-panel {
  height: calc(100vh - 88px);
  min-height: 560px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 94%, var(--panel-soft));
}

.chat-header,
.chat-form {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.chat-form {
  border-top: 1px solid var(--border);
  border-bottom: 0;
}

.online-list {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.invite-dialog-list {
  max-height: min(420px, 58vh);
  overflow-y: auto;
}

.invite-friend-item {
  grid-template-columns: 40px minmax(0, 1fr) auto;
}

.online-item {
  grid-template-columns: 34px minmax(0, 1fr) auto;
  padding: 7px;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
  background: color-mix(in srgb, var(--panel-soft) 90%, black);
}

.message {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.message-author {
  color: var(--accent);
}

.message-body {
  width: fit-content;
  max-width: 100%;
  padding: 9px 11px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-strong) 86%, var(--panel));
  color: var(--text);
  overflow-wrap: anywhere;
}

.message-avatar {
  width: 36px;
  height: 36px;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--border) 70%, transparent);
}

.message-content {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.message.mine {
  grid-template-columns: minmax(0, 1fr) 36px;
  justify-items: end;
}

.message.mine .message-body {
  background: color-mix(in srgb, var(--accent) 24%, var(--panel-strong));
}

.message.system .message-body {
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  color: var(--muted);
}

.message.system {
  display: flex;
  align-items: center;
  gap: 8px;
}

.message.system .system-message-time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  opacity: 0.72;
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 6px 14px;
  border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.typing-avatars {
  display: inline-flex;
  align-items: center;
}

.typing-avatar {
  width: 24px;
  height: 24px;
  margin-right: -7px;
  border: 2px solid var(--panel);
  box-shadow: none;
}

.typing-message {
  opacity: 0.92;
  pointer-events: none;
}

.typing-message .message-meta {
  opacity: 0.9;
}

.typing-message-body {
  color: color-mix(in srgb, var(--text) 78%, var(--muted));
  font-style: italic;
}

.message-image {
  display: block;
  max-width: min(320px, 100%);
  max-height: 260px;
  border-radius: 8px;
  object-fit: contain;
}

.modal {
  width: min(420px, calc(100% - 32px));
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 96%, var(--panel-soft));
  color: var(--text);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.36);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.58);
}

.modal-body {
  display: grid;
  gap: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
}

.playback-request-message .message-body {
  display: grid;
  width: min(360px, 100%);
  gap: 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--panel-strong) 92%, var(--accent) 8%);
}

.playback-request-copy {
  margin: 0;
  color: var(--text);
}

.playback-request-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.playback-request-actions button {
  min-height: 36px;
  padding: 7px 10px;
}

.playback-request-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.playback-request-message.resolved .message-body {
  opacity: 0.76;
}

@media (max-width: 1180px) {
  .app-view {
    grid-template-columns: 68px minmax(250px, 300px) minmax(0, 1fr);
  }

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

  .chat-panel {
    height: min(620px, 70vh);
  }
}

@media (max-width: 780px) {
  .app-view {
    grid-template-columns: 1fr;
  }

  .server-rail {
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .server-button.add {
    margin-top: 0;
    margin-left: auto;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .main-stage {
    padding: 14px;
  }

  .stage-header,
  .stage-actions,
  .search-form,
  .inline-form,
  .transport-row,
  .chat-form {
    align-items: stretch;
    flex-direction: column;
  }

  .video-form,
  .settings-row {
    grid-template-columns: 1fr;
  }
}

/* PDF lounge redesign */
:root {
  --bg: #080a12;
  --rail: #0b0d16;
  --sidebar: #11131d;
  --panel: #161925;
  --panel-soft: #0f111b;
  --panel-strong: #242839;
  --border: #303549;
  --text: #f7f3ff;
  --muted: #a8adbd;
  --accent: #e85fad;
  --accent-strong: #8b5cf6;
  --accent-cool: #22d3ee;
  --danger: #ff4d5e;
  --warning: #f7b84b;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

body[data-theme="dark"] {
  --bg: #080a12;
  --rail: #0b0d16;
  --sidebar: #11131d;
  --panel: #161925;
  --panel-soft: #0f111b;
  --panel-strong: #242839;
  --border: #303549;
  --text: #f7f3ff;
  --muted: #a8adbd;
  --accent: #e85fad;
  --accent-strong: #8b5cf6;
  --accent-cool: #22d3ee;
}

body {
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--bg) 88%, #12091a) 0%, var(--bg) 48%, color-mix(in srgb, var(--bg) 86%, #061b23) 100%);
}

button {
  box-shadow: none;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    opacity 160ms ease,
    transform 160ms ease;
}

button:not(:disabled):hover {
  transform: translateY(-1px);
}

button:not(.secondary-button):not(.danger-button):not(.small-button):not(.icon-button):not(.server-button) {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
}

button:not(.secondary-button):not(.danger-button):not(.small-button):not(.icon-button):not(.server-button):hover {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 82%, white), color-mix(in srgb, var(--accent-strong) 86%, white));
}

input,
select,
textarea {
  background: color-mix(in srgb, var(--panel-soft) 88%, black);
}

.boot-view,
.auth-view {
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--bg) 86%, #190b22), var(--bg) 54%, color-mix(in srgb, var(--bg) 86%, #041d26));
}

.auth-panel {
  border-color: color-mix(in srgb, var(--border) 70%, var(--accent));
  background: color-mix(in srgb, var(--panel) 92%, black);
}

.app-view {
  grid-template-columns: 76px 320px minmax(0, 1fr);
  min-height: 100vh;
}

.app-view.room-focus {
  grid-template-columns: 76px minmax(0, 1fr);
}

.app-view.room-focus.sidebar-open {
  grid-template-columns: 76px 320px minmax(0, 1fr);
}

.server-rail {
  gap: 12px;
  padding: 12px;
  background: color-mix(in srgb, var(--rail) 92%, black);
}

.primary-nav,
.room-rail {
  display: grid;
  gap: 10px;
}

.primary-nav {
  padding: 10px 0;
  border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.server-button {
  width: 52px;
  min-height: 52px;
  border: 1px solid transparent;
  background: color-mix(in srgb, var(--panel-strong) 78%, black);
  color: var(--muted);
}

.server-button.brand-server,
.server-button.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
  box-shadow: 0 14px 28px rgba(232, 95, 173, 0.2);
}

.server-button.add {
  border-color: color-mix(in srgb, var(--border) 70%, var(--accent));
}

.sidebar {
  padding: 20px;
  background: color-mix(in srgb, var(--sidebar) 94%, black);
}

.profile-card,
.panel,
.control-panel,
.chat-panel,
.nav-item,
.friend-item,
.pending-item,
.online-item,
.search-result-card,
.download-panel,
.sync-readout {
  border-color: color-mix(in srgb, var(--border) 84%, transparent);
}

.profile-card,
.panel,
.control-panel,
.chat-panel {
  background: color-mix(in srgb, var(--panel) 90%, black);
  box-shadow: var(--shadow);
}

.profile-card {
  grid-template-columns: 76px minmax(0, 1fr);
  padding: 16px;
}

.avatar.large {
  width: 76px;
  height: 76px;
}

.wide-secondary-button {
  width: 100%;
  border-color: var(--border);
  background: color-mix(in srgb, var(--panel-strong) 80%, transparent);
  color: var(--text);
}

.main-stage {
  height: 100vh;
  padding: 22px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent) 50%, var(--border)) transparent;
}

.stage-header {
  min-height: 58px;
  margin-bottom: 18px;
}

.stage-header h1 {
  font-size: clamp(30px, 3.2vw, 46px);
}

.page-panel {
  display: grid;
  gap: 18px;
}

.dashboard-page,
.social-page,
.rooms-page,
.settings-page {
  max-width: 1180px;
}

.lounge-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 22px;
  border: 1px solid color-mix(in srgb, var(--border) 70%, var(--accent));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--panel) 82%, var(--accent-strong)), color-mix(in srgb, var(--panel) 86%, var(--accent-cool)));
  box-shadow: var(--shadow);
}

.lounge-hero h2 {
  margin-bottom: 8px;
  font-size: clamp(28px, 3vw, 42px);
}

.hero-copy {
  max-width: 660px;
  margin-bottom: 0;
  color: color-mix(in srgb, var(--text) 78%, var(--muted));
}

.quick-actions,
.room-card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.stats-grid,
.history-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.history-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
}

.stat-card {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 90%, black);
}

.stat-card.compact {
  min-height: 92px;
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 740;
}

.stat-card strong {
  align-self: end;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1;
}

.room-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.room-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-soft) 78%, var(--panel));
}

.room-thumb {
  width: 58px;
  min-height: 58px;
  padding: 0;
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 72%, black), color-mix(in srgb, var(--accent-cool) 66%, black));
  color: white;
  font-size: 22px;
}

.room-card-copy,
.activity-item > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

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

.room-card-copy span,
.activity-item span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.room-card-actions {
  grid-column: 1 / -1;
  justify-content: space-between;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.12);
  color: #a5f3fc;
  font-size: 12px;
  font-weight: 820;
}

.live-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 999px;
  background: var(--accent-cool);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
}

.activity-list {
  display: grid;
  gap: 10px;
}

.activity-item {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-soft) 80%, var(--panel));
}

.activity-dot {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-cool));
}

.expanded-list .friend-item {
  grid-template-columns: 44px minmax(0, 1fr) auto;
  padding: 12px;
}

.room-grid {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: 18px;
}

.watch-column {
  min-width: 0;
}

.player-frame {
  border-color: color-mix(in srgb, var(--border) 60%, var(--accent));
  background: #020308;
}

.control-panel {
  padding: 12px;
}

.control-panel.collapsed {
  background: color-mix(in srgb, var(--panel) 76%, black);
}

.chat-panel {
  height: calc(100vh - 112px);
  min-height: 620px;
}

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

.chat-form textarea {
  min-height: 42px;
  max-height: 96px;
  resize: none;
  overflow-y: auto;
  padding: 10px 12px;
}

.message-body {
  white-space: pre-wrap;
}

.modal {
  border-color: color-mix(in srgb, var(--border) 70%, var(--accent));
}

@media (max-width: 1280px) {
  .app-view,
  .app-view.room-focus.sidebar-open {
    grid-template-columns: 72px 292px minmax(0, 1fr);
  }

  .room-grid,
  .dashboard-page,
  .social-page,
  .rooms-page,
  .settings-page {
    max-width: none;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .auth-view {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .brand-block.compact {
    margin-bottom: 28px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
    margin-top: 32px;
  }

  .app-view,
  .app-view.room-focus,
  .app-view.room-focus.sidebar-open {
    grid-template-columns: 1fr;
  }

  .primary-nav {
    display: flex;
    padding: 0;
    border: 0;
  }

  .server-rail {
    flex-direction: row;
    align-items: center;
  }

  .server-button {
    width: 48px;
    min-height: 48px;
  }

  .lounge-hero,
  .room-grid {
    grid-template-columns: 1fr;
  }

  .quick-actions {
    justify-content: flex-start;
  }

  .chat-panel {
    min-height: 520px;
    height: min(640px, 72vh);
  }
}

@media (max-width: 640px) {
  .main-stage {
    padding: 14px;
  }

  .stage-header,
  .stage-actions,
  .quick-actions,
  .search-form,
  .inline-form,
  .transport-row {
    align-items: stretch;
    flex-direction: column;
  }

  .stats-grid,
  .history-stats {
    grid-template-columns: 1fr;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }
}

/* Lovable preview parity */
:root {
  --bg: #0c0d17;
  --rail: #070913;
  --sidebar: #070913;
  --panel: #111320;
  --panel-soft: #0b0d18;
  --panel-strong: #181b2b;
  --border: #242538;
  --text: #f2f3f7;
  --muted: #9ca3b7;
  --accent: #895af6;
  --accent-strong: #4d82f5;
  --accent-cool: #22d3ee;
  --danger: #e64d4d;
  --warning: #f7b84b;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

body[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0d17;
  --rail: #070913;
  --sidebar: #070913;
  --panel: #111320;
  --panel-soft: #0b0d18;
  --panel-strong: #181b2b;
  --border: #242538;
  --text: #f2f3f7;
  --muted: #9ca3b7;
  --accent: #895af6;
  --accent-strong: #4d82f5;
  --accent-cool: #22d3ee;
  --danger: #e64d4d;
  --warning: #f7b84b;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

body[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f6fb;
  --rail: #e8edf6;
  --sidebar: #ffffff;
  --panel: #ffffff;
  --panel-soft: #eef2f8;
  --panel-strong: #e7edf6;
  --border: #d7dfec;
  --text: #182032;
  --muted: #647085;
  --accent: #895af6;
  --accent-strong: #4d82f5;
  --accent-cool: #0ea5e9;
  --danger: #dc2626;
  --warning: #d97706;
  --shadow: 0 20px 54px rgba(31, 41, 55, 0.12);
}

body[data-theme="pink"] {
  color-scheme: dark;
  --bg: #130912;
  --rail: #0d0610;
  --sidebar: #0d0610;
  --panel: #1d101d;
  --panel-soft: #140a14;
  --panel-strong: #2a172b;
  --border: #42253f;
  --text: #fff5fb;
  --muted: #c6a7ba;
  --accent: #f062b6;
  --accent-strong: #a855f7;
  --accent-cool: #fb7185;
  --danger: #fb7185;
  --warning: #fbbf24;
  --shadow: 0 24px 70px rgba(92, 16, 68, 0.34);
}

body[data-theme="white"] {
  color-scheme: light;
  --bg: #ffffff;
  --rail: #f6f7fb;
  --sidebar: #f6f7fb;
  --panel: #ffffff;
  --panel-soft: #f4f6fb;
  --panel-strong: #e9eef8;
  --border: #d8e0ec;
  --text: #111827;
  --muted: #667085;
  --accent: #2563eb;
  --accent-strong: #7c3aed;
  --accent-cool: #06b6d4;
  --danger: #dc2626;
  --warning: #d97706;
  --shadow: 0 20px 54px rgba(15, 23, 42, 0.1);
}

body[data-theme="marine"] {
  color-scheme: dark;
  --bg: #06131d;
  --rail: #031019;
  --sidebar: #031019;
  --panel: #0c2230;
  --panel-soft: #071923;
  --panel-strong: #123244;
  --border: #23495c;
  --text: #eefaff;
  --muted: #9fb8c6;
  --accent: #22d3ee;
  --accent-strong: #2563eb;
  --accent-cool: #14b8a6;
  --danger: #f87171;
  --warning: #fbbf24;
  --shadow: 0 24px 70px rgba(3, 16, 25, 0.42);
}

body[data-theme="pink-white"] {
  color-scheme: light;
  --bg: #fff7fb;
  --rail: #fff0f7;
  --sidebar: #fff0f7;
  --panel: #ffffff;
  --panel-soft: #fff0f7;
  --panel-strong: #ffe1ef;
  --border: #f3bfd7;
  --text: #331827;
  --muted: #8a5d72;
  --accent: #ec4899;
  --accent-strong: #8b5cf6;
  --accent-cool: #38bdf8;
  --danger: #e11d48;
  --warning: #d97706;
  --shadow: 0 20px 54px rgba(190, 24, 93, 0.14);
}

body {
  background:
    radial-gradient(circle at 20% 0%, rgba(78, 31, 158, 0.28), transparent 34%),
    radial-gradient(circle at 86% 18%, rgba(47, 96, 190, 0.14), transparent 28%),
    var(--bg);
}

.brand-mark.small {
  width: 36px;
  height: 36px;
  font-size: 20px;
  border-radius: 12px;
}

.auth-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 448px);
  gap: 48px;
  align-items: center;
  padding: 48px clamp(24px, 6vw, 80px);
  background:
    radial-gradient(circle at 18% 4%, rgba(137, 90, 246, 0.36), transparent 36%),
    radial-gradient(circle at 90% 100%, rgba(77, 130, 245, 0.22), transparent 34%),
    var(--bg);
}

.auth-landing {
  max-width: 760px;
}

.brand-block.compact {
  margin-bottom: 54px;
}

.brand-block.compact strong {
  color: color-mix(in srgb, var(--accent) 72%, white);
  font-size: 24px;
}

.beta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(17, 19, 32, 0.8);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.beta-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 999px;
  background: #00d485;
}

.landing-hero h1 {
  max-width: 860px;
  margin: 26px 0 20px;
  font-size: clamp(52px, 7vw, 92px);
  line-height: .98;
  letter-spacing: 0;
}

.landing-hero h1 span {
  display: block;
  color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  -webkit-background-clip: text;
  background-clip: text;
}

.landing-hero p {
  max-width: 660px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 56px;
}

.feature-grid article {
  min-height: 160px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 90%, black);
}

.feature-grid article span {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-size: 12px;
  font-weight: 820;
}

.feature-grid article strong {
  display: block;
  margin-bottom: 8px;
}

.feature-grid article p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.auth-panel {
  width: 100%;
  padding: 32px;
  border-radius: 22px;
  background: color-mix(in srgb, var(--panel) 92%, black);
}

.app-view,
.app-view.room-focus,
.app-view.room-focus.sidebar-open {
  grid-template-columns: 256px minmax(0, 1fr);
  background: var(--bg);
}

.utility-sidebar,
.app-view.room-focus.sidebar-open .utility-sidebar {
  display: none;
}

.server-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 18px 16px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--rail) 94%, black) 0%, var(--rail) 100%);
  border-right: 1px solid var(--border);
}

.rail-brand {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.rail-brand:hover {
  background: transparent;
}

.rail-brand strong,
.rail-brand small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-brand strong {
  color: color-mix(in srgb, var(--accent) 72%, white);
  font-size: 20px;
  line-height: 1.1;
}

.rail-brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.nav-label {
  margin: 30px 8px 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.primary-nav {
  display: grid;
  gap: 8px;
  padding: 0;
  border: 0;
}

.server-button {
  width: 100%;
  min-height: 44px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  justify-content: start;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: color-mix(in srgb, var(--text) 76%, var(--muted));
  text-align: left;
  box-shadow: none;
}

.server-button span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: currentColor;
  font-size: 12px;
  font-weight: 850;
}

.server-button.active,
.server-button:not(.active):hover {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: 0 16px 34px rgba(137, 90, 246, 0.22);
}

.server-button.add {
  margin-top: 18px;
  border-color: var(--border);
  background: color-mix(in srgb, var(--panel-strong) 72%, transparent);
}

.server-button.logout-link {
  margin-top: 12px;
  color: #fecaca;
}

.server-button.logout-link:hover {
  background: color-mix(in srgb, var(--danger) 24%, var(--panel-strong));
  color: #fff;
}

.rail-profile {
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  margin: auto -2px 0;
  padding: 10px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.rail-profile .avatar.large {
  width: 42px;
  height: 42px;
}

.rail-profile .profile-copy h3 {
  font-size: 14px;
}

.rail-profile .premium-badge {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.main-stage {
  height: 100vh;
  padding: 0;
  overflow-y: auto;
  background: var(--bg);
}

.stage-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 56px;
  margin: 0;
  padding: 0 32px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel-soft) 92%, transparent);
  backdrop-filter: blur(16px);
}

.stage-header .eyebrow {
  display: none;
}

.stage-header h1 {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 560;
}

.stage-header h1::before {
  content: "Welcome back";
  margin-right: 8px;
  color: var(--muted);
  font-weight: 500;
}

.stage-actions {
  gap: 8px;
}

.stage-actions .sidebar-toggle {
  display: none;
}

.page-panel,
.room-grid {
  padding: 32px;
}

.dashboard-page {
  max-width: 1120px;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  margin: 0 auto;
}

.social-page,
.rooms-page,
.history-page,
.settings-page {
  max-width: 1040px;
  margin: 0 auto;
}

.lounge-hero {
  grid-column: 1 / -1;
  grid-template-columns: 98px minmax(0, 1fr) auto;
  min-height: 186px;
  padding: 32px;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(137, 90, 246, 0.18), rgba(77, 130, 245, 0.08)),
    color-mix(in srgb, var(--panel) 92%, black);
}

.hero-avatar {
  width: 98px;
  height: 98px;
  border-radius: 20px;
  object-fit: cover;
  border: 2px solid color-mix(in srgb, var(--accent) 64%, var(--border));
  background: var(--panel-strong);
}

.lounge-hero h2 {
  margin-bottom: 8px;
  font-size: clamp(28px, 3vw, 34px);
}

.hero-copy {
  color: var(--muted);
  font-size: 16px;
}

.quick-actions {
  align-self: center;
  justify-content: flex-end;
}

.stats-grid {
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card,
.panel {
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 94%, black);
  border-color: var(--border);
  box-shadow: none;
}

.stat-card {
  min-height: 166px;
  align-content: start;
  padding: 20px;
}

.stat-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-size: 14px;
  font-weight: 850;
}

.stat-card > span:not(.stat-icon) {
  margin-top: auto;
  color: var(--muted);
  font-size: 14px;
}

.stat-card strong {
  font-size: 28px;
}

.live-section {
  grid-column: 1;
}

.activity-section {
  grid-column: 2;
}

.room-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(285px, 1fr));
  gap: 16px;
}

.room-card {
  grid-template-columns: 1fr;
  gap: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 94%, black);
  border-color: var(--border);
}

.room-thumb {
  position: relative;
  width: 100%;
  min-height: 172px;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(135deg, rgba(137, 90, 246, 0.42), rgba(77, 130, 245, 0.18)),
    linear-gradient(45deg, #232437, #0c0d17);
}

.room-thumb::after {
  content: attr(data-initial);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.32);
  font-size: 72px;
  font-weight: 900;
}

.viewer-chip,
.idle-chip,
.room-thumb .live-badge {
  position: absolute;
  z-index: 2;
}

.room-thumb .live-badge,
.idle-chip {
  top: 10px;
  left: 10px;
}

.viewer-chip {
  right: 10px;
  bottom: 10px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
  font-weight: 760;
}

.room-card-copy {
  padding: 16px 16px 10px;
}

.room-card-copy strong {
  font-size: 16px;
}

.room-card-actions {
  grid-column: auto;
  padding: 0 16px 16px;
  align-items: center;
}

.host-line {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.friend-tabs {
  display: inline-flex;
  width: fit-content;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel-strong) 70%, black);
}

.friend-tab {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
}

.friend-tab.active {
  background: color-mix(in srgb, var(--panel) 90%, black);
  color: var(--text);
}

.expanded-list {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 94%, black);
}

.expanded-list .friend-item {
  border: 0;
  background: transparent;
}

.history-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-page {
  max-width: 704px;
}

.settings-profile-card {
  grid-template-columns: 116px minmax(0, 1fr);
  align-items: center;
}

.avatar.xl {
  width: 116px;
  height: 116px;
  border-radius: 18px;
}

.settings-profile-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-profile-title h3 {
  margin: 0;
  font-size: 24px;
}

.muted-line,
.settings-profile-card p {
  margin: 4px 0 0;
  color: var(--muted);
}

.privacy-panel {
  gap: 16px;
}

.privacy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel-strong) 50%, transparent);
}

.privacy-row strong,
.privacy-row span {
  display: block;
}

.privacy-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.privacy-switch {
  position: relative;
  width: 44px;
  min-height: 26px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #202132;
}

.privacy-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #0c0d17;
  transition: transform 160ms ease, background 160ms ease;
}

.privacy-switch.active {
  background: var(--accent);
}

.privacy-switch.active::after {
  transform: translateX(18px);
  background: #fff;
}

.room-grid {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: 20px;
}

.player-frame,
.control-panel,
.chat-panel {
  border-radius: 14px;
  border-color: var(--border);
}

@media (max-width: 1180px) {
  .dashboard-page,
  .live-section,
  .activity-section {
    grid-template-columns: 1fr;
    grid-column: 1 / -1;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .app-view,
  .app-view.room-focus,
  .app-view.room-focus.sidebar-open {
    grid-template-columns: 1fr;
  }

  .server-rail {
    position: static;
    height: auto;
    padding: 12px;
  }

  .rail-brand {
    margin-bottom: 10px;
  }

  .nav-label,
  .rail-profile,
  .logout-link {
    display: none;
  }

  .primary-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .server-button {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 8px 4px;
    font-size: 12px;
  }

  .server-button.add {
    display: none;
  }

  .stage-header {
    padding: 0 18px;
  }

  .page-panel,
  .room-grid {
    padding: 18px;
  }

  .lounge-hero {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .hero-avatar {
    width: 78px;
    height: 78px;
  }

  .quick-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .primary-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stats-grid,
  .history-stats,
  .settings-profile-card {
    grid-template-columns: 1fr;
  }

  .lounge-hero {
    grid-template-columns: 1fr;
  }
}

/* Immersive watch room */
body.watch-mode {
  width: 100vw;
  height: var(--app-height);
  min-height: var(--app-height);
  overflow: hidden;
}

body.watch-mode .app-view,
body.watch-mode .app-view.room-focus,
body.watch-mode .app-view.room-focus.sidebar-open {
  width: 100vw;
  height: var(--app-height);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
}

body.watch-mode .server-rail,
body.watch-mode .utility-sidebar {
  display: none;
}

body.watch-mode .main-stage {
  width: 100vw;
  height: var(--app-height);
  padding: 0;
  overflow: hidden;
}

body.watch-mode .stage-header {
  position: static;
  height: var(--watch-header-height);
  min-height: var(--watch-header-height);
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel-soft) 94%, transparent);
  backdrop-filter: blur(14px);
}

body.watch-mode .stage-header .eyebrow {
  display: none;
}

body.watch-mode .stage-header h1 {
  color: var(--text);
  font-size: 18px;
  font-weight: 780;
}

body.watch-mode .stage-header h1::before {
  content: "";
  margin: 0;
}

body.watch-mode .stage-title-block {
  min-width: 0;
}

body.watch-mode .room-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

body.watch-mode .room-title-row h1 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.watch-mode .header-quit-button {
  min-height: 30px;
  padding: 0 10px;
  border-color: rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(20, 184, 166, 0.14);
  color: var(--text);
  font-size: 13px;
  font-weight: 760;
  flex: 0 0 auto;
}

body.watch-mode .header-quit-button:hover {
  background: rgba(20, 184, 166, 0.24);
}

body.watch-mode .stage-actions {
  flex-wrap: nowrap;
}

body.watch-mode .sidebar-toggle {
  display: inline-flex;
}

body.watch-mode .status-pill,
body.watch-mode .stage-actions .secondary-button {
  min-height: 34px;
}

body.watch-mode .room-grid {
  width: 100vw;
  height: calc(var(--app-height) - var(--watch-header-height));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 16px;
  align-items: stretch;
  padding: 16px 20px;
  overflow: hidden;
}

body.watch-mode .app-view.chat-closed .room-grid {
  grid-template-columns: minmax(0, 1fr);
}

body.watch-mode .app-view.chat-closed .chat-panel {
  display: none;
}

body.watch-mode .watch-column {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  overflow: hidden;
  position: relative;
}

body.watch-mode .player-frame {
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
  border-radius: 22px;
  border-color: color-mix(in srgb, var(--border) 78%, var(--accent));
  background:
    radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 28%),
    #05070f;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.34);
}

body.watch-mode .player-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5, 7, 15, 0.18), transparent 28%, rgba(5, 7, 15, 0.68)),
    linear-gradient(90deg, rgba(5, 7, 15, 0.20), transparent 18%, transparent 82%, rgba(5, 7, 15, 0.20));
  z-index: 1;
}

body.watch-mode .player-badge {
  z-index: 3;
  border-radius: 12px;
  background: rgba(8, 10, 20, 0.82);
}

body.watch-mode .control-panel {
  max-height: 46vh;
  margin-top: 0;
  padding: 10px;
  overflow: hidden;
  border-radius: 12px;
}

body.watch-mode .control-panel.collapsed {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 14px;
  z-index: 4;
  max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

body.watch-mode .control-panel.collapsed .control-panel-header {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  pointer-events: auto;
}

body.watch-mode .control-panel.collapsed .room-toolbar {
  display: none;
}

body.watch-mode .control-panel.collapsed .timebar {
  box-sizing: border-box;
  height: 40px;
  min-height: 40px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: rgba(8, 10, 20, 0.70);
  backdrop-filter: blur(14px);
}

body.watch-mode .control-panel.collapsed #controlsToggleBtn {
  box-sizing: border-box;
  height: 40px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  background: rgba(137, 90, 246, 0.22);
  backdrop-filter: blur(14px);
}

body.watch-mode .quick-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  height: 40px;
  min-height: 40px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: rgba(8, 10, 20, 0.70);
  backdrop-filter: blur(14px);
}

body.watch-mode .player-control-button {
  min-width: 42px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 820;
}

body.watch-mode .player-control-button:hover {
  background: rgba(255, 255, 255, 0.08);
}

body.watch-mode .player-control-button.primary {
  min-width: 58px;
  box-sizing: border-box;
  height: 40px;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(137, 90, 246, 0.28);
  backdrop-filter: blur(14px);
}

body.watch-mode .quick-volume {
  width: 72px;
}

body.watch-mode .controls-body {
  max-height: min(360px, 36vh);
  overflow-y: auto;
  padding-right: 2px;
}

body.watch-mode .chat-panel {
  width: 100%;
  height: 100%;
  min-height: 0;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  border-radius: 22px;
  border-color: color-mix(in srgb, var(--border) 82%, var(--accent));
  background: rgba(12, 14, 27, 0.96);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.26);
}

body.watch-mode .chat-header {
  padding: 24px 24px 18px;
}

body.watch-mode .chat-header h3 {
  margin: 0 0 4px;
  font-size: 24px;
  letter-spacing: 0;
}

body.watch-mode .chat-header span {
  color: var(--muted);
}

body.watch-mode .online-list {
  max-height: 118px;
  overflow-y: auto;
  padding: 10px 20px;
}

body.watch-mode .chat-log {
  min-height: 0;
  gap: 16px;
  padding: 20px;
  background: transparent;
}

body.watch-mode .chat-form {
  padding: 18px;
  background: color-mix(in srgb, var(--panel-soft) 92%, transparent);
}

body.watch-mode .chat-form textarea {
  border-radius: 16px;
  background: rgba(9, 11, 22, 0.92);
}

body.watch-mode .chat-form button[type="submit"] {
  min-width: 54px;
  border-radius: 16px;
}

body.watch-mode .typing-indicator {
  padding: 8px 20px;
}

body.watch-mode .video-form {
  grid-template-columns: 138px minmax(0, 1fr) auto;
}

body.watch-mode .transport-row {
  flex-wrap: wrap;
}

@media (max-width: 840px) {
  .control-panel-header {
    grid-template-columns: minmax(0, 1fr);
  }

  .room-toolbar {
    justify-content: stretch;
  }

  .room-toolbar button,
  #controlsToggleBtn {
    flex: 1 1 120px;
  }
}

@media (max-width: 920px) {
  body.watch-mode .room-grid {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(230px, 36vh);
  }

  body.watch-mode .app-view.chat-closed .room-grid {
    grid-template-rows: minmax(0, 1fr);
  }

  body.watch-mode .chat-panel {
    min-height: 0;
  }

  body.watch-mode .stage-header {
    padding: 0 10px;
  }
}

@media (max-width: 640px) {
  body.watch-mode {
    --watch-header-height: 50px;
    position: fixed;
    inset: 0;
    width: 100%;
  }

  body.watch-mode .stage-header {
    height: var(--watch-header-height);
    min-height: var(--watch-header-height);
    gap: 8px;
  }

  body.watch-mode .stage-header h1 {
    font-size: 15px;
  }

  body.watch-mode .copyInviteBtn,
  body.watch-mode #copyInviteBtn {
    display: none;
  }

  body.watch-mode .room-grid {
    width: 100%;
    height: calc(var(--app-height) - var(--watch-header-height));
    padding: 6px;
    gap: 6px;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 58%) minmax(190px, 1fr);
  }

  body.watch-mode .app-view.chat-closed .room-grid {
    grid-template-rows: minmax(0, 1fr);
  }

  body.watch-mode .watch-column {
    gap: 6px;
  }

  body.watch-mode .control-panel-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
  }

  body.watch-mode .control-panel {
    padding: 8px;
    border-radius: 10px;
  }

  body.watch-mode .control-panel.collapsed {
    max-height: 52px;
  }

  body.watch-mode .control-panel.collapsed .room-toolbar {
    display: none;
  }

  body.watch-mode .control-panel.collapsed .control-panel-header {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 6px;
  }

  body.watch-mode .timebar {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 6px;
    font-size: 12px;
  }

  body.watch-mode .quick-controls {
    gap: 4px;
    padding: 0 4px;
  }

  body.watch-mode .quick-volume,
  body.watch-mode #quickRateBtn {
    display: none;
  }

  body.watch-mode .player-control-button,
  body.watch-mode .player-control-button.primary,
  body.watch-mode #controlsToggleBtn {
    min-width: 40px;
    min-height: 36px;
    padding: 0 8px;
    font-size: 12px;
  }

  body.watch-mode .room-toolbar button,
  body.watch-mode #controlsToggleBtn {
    min-height: 34px;
    padding: 0 8px;
  }

  body.watch-mode .chat-panel {
    min-height: 0;
    border-radius: 10px;
  }

  body.watch-mode .online-list {
    max-height: 74px;
  }

  body.watch-mode .chat-form {
    padding: 8px;
  }

  body.watch-mode .video-form,
  body.watch-mode .settings-row {
    grid-template-columns: 1fr;
  }
}

/* Watch-room redesign: static cinema player, compact side panel, custom transport. */
body.watch-mode .room-grid {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 16px;
  padding: 14px 18px;
}

body.watch-mode .watch-column {
  grid-template-rows: minmax(0, 1fr);
}

body.watch-mode .player-frame {
  border-radius: 18px;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.38);
}

body.watch-mode .player-frame::after {
  content: none;
  display: none;
  background: none;
}

body.watch-mode .control-panel {
  margin: 0;
}

body.watch-mode .control-panel.collapsed {
  left: 18px;
  right: 18px;
  bottom: 16px;
}

body.watch-mode .control-panel.collapsed .control-panel-header {
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "bar bar bar"
    "play quick toggle";
  align-items: center;
  gap: 8px 12px;
  padding: 0;
}

body.watch-mode #quickPlayBtn {
  grid-area: play;
}

body.watch-mode .timebar {
  grid-area: bar;
  height: 20px;
  min-height: 20px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
}

body.watch-mode .control-panel.collapsed .timebar {
  height: 20px;
  min-height: 20px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
}

body.watch-mode .timebar input[type="range"] {
  height: 18px;
}

body.watch-mode .quick-controls {
  grid-area: quick;
  justify-self: end;
  height: 38px;
  min-height: 38px;
  border-radius: 999px;
  background: rgba(8, 10, 18, 0.62);
}

body.watch-mode .player-control-button.primary,
body.watch-mode #controlsToggleBtn {
  height: 38px;
  min-height: 38px;
  border-radius: 999px;
  background: rgba(8, 10, 18, 0.66);
  color: #fff;
}

body.watch-mode #controlsToggleBtn {
  grid-area: toggle;
  justify-self: end;
  min-width: 96px;
}

body.watch-mode .chat-panel {
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  border-radius: 18px;
  background: rgba(10, 12, 24, 0.97);
}

body.watch-mode .chat-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
}

.side-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel-soft) 82%, transparent);
}

.side-tab {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 780;
}

.side-tab.active {
  background: color-mix(in srgb, var(--accent) 86%, white);
  color: #060713;
}

.side-pane[hidden] {
  display: none !important;
}

.reply-preview[hidden],
.reaction-row[hidden] {
  display: none !important;
}

.side-pane {
  min-height: 0;
}

.chat-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.controls-pane {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
}

body.watch-mode .controls-pane .video-form,
body.watch-mode .controls-pane .settings-row {
  grid-template-columns: 1fr;
  gap: 10px;
}

body.watch-mode .controls-pane .room-toolbar,
body.watch-mode .controls-pane .transport-row {
  justify-content: stretch;
}

body.watch-mode .controls-pane .room-toolbar button,
body.watch-mode .controls-pane .transport-row button {
  flex: 1 1 90px;
}

.reply-preview {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 44%, var(--border));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 12%, var(--panel-soft));
}

.reply-preview div,
.reply-quote {
  min-width: 0;
}

.reply-preview strong,
.reply-preview span,
.reply-quote strong,
.reply-quote span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-preview strong,
.reply-quote strong {
  color: var(--accent);
  font-size: 12px;
}

.reply-preview span,
.reply-quote span {
  color: var(--muted);
  font-size: 13px;
}

.reply-preview button {
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 999px;
}

.reply-quote {
  display: grid;
  gap: 2px;
  width: min(100%, 340px);
  padding: 8px 10px;
  border: 0;
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-soft) 86%, transparent);
  text-align: left;
}

.message.highlight .message-body {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 82%, white);
}

.message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.message:hover .message-actions,
.message:focus-within .message-actions {
  opacity: 1;
  transform: translateY(0);
}

.message-action,
.emoji-button,
.reaction-chip {
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel-soft) 90%, transparent);
  color: var(--text);
  font-size: 12px;
  font-weight: 780;
}

.emoji-button {
  min-width: 28px;
  padding: 0 6px;
}

.reaction-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.reaction-chip.mine {
  border-color: color-mix(in srgb, var(--accent) 78%, white);
  background: color-mix(in srgb, var(--accent) 20%, var(--panel-soft));
}

/* Reply polish: compact WhatsApp-style context without making chat noisy. */
.reply-preview {
  grid-template-columns: 30px minmax(0, 1fr) 32px;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--border));
  border-left-width: 4px;
  border-radius: 12px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 14%, transparent), transparent 46%),
    color-mix(in srgb, var(--panel-soft) 92%, black);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.reply-preview .reply-preview-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
}

.reply-preview .reply-preview-icon::before {
  content: "\21A9";
  font-size: 17px;
  font-weight: 900;
}

.reply-preview strong {
  color: var(--accent);
  font-size: 12px;
  line-height: 1.1;
}

.reply-preview span {
  color: color-mix(in srgb, var(--text) 78%, var(--muted));
  font-size: 13px;
}

.reply-preview button {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  border: 0;
  background: color-mix(in srgb, var(--panel-strong) 80%, transparent);
  color: var(--muted);
}

.reply-preview button::before {
  content: "\00D7";
  font-size: 20px;
  line-height: 1;
}

.reply-preview button:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--danger) 18%, var(--panel-strong));
}

.message-content {
  position: relative;
}

.reply-quote {
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: min(100%, 300px);
  padding: 7px 9px;
  border: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent 54%),
    color-mix(in srgb, var(--panel-soft) 88%, black);
  color: var(--text);
}

.message.mine .reply-quote {
  justify-self: end;
}

.reply-quote:hover {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--border));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 18%, transparent), transparent 58%),
    color-mix(in srgb, var(--panel-soft) 94%, black);
}

.reply-quote .reply-quote-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
}

.reply-quote .reply-quote-icon::before {
  content: "\21A9";
  font-size: 14px;
  font-weight: 900;
}

.reply-quote-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.reply-quote strong {
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0;
}

.reply-quote span {
  color: color-mix(in srgb, var(--text) 72%, var(--muted));
  font-size: 12px;
}

.message-actions {
  width: fit-content;
  margin-top: 1px;
  padding: 3px;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 86%, black);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}

.message.mine .message-actions {
  justify-self: end;
}

.message-action,
.emoji-button {
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.message-action:hover,
.emoji-button:hover {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--text);
}

.message-action {
  color: var(--accent);
  font-size: 15px;
}

.reaction-row {
  margin-top: -1px;
}

.message.mine .reaction-row {
  justify-content: flex-end;
}

.reaction-chip {
  min-height: 24px;
  padding: 0 8px;
  border-color: color-mix(in srgb, var(--border) 62%, transparent);
  background: color-mix(in srgb, var(--panel-soft) 84%, black);
  font-size: 12px;
}

@media (max-width: 920px) {
  body.watch-mode .room-grid {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 58%) minmax(250px, 42%);
    padding: 8px;
  }

  body.watch-mode .chat-panel {
    border-radius: 14px;
  }
}

@media (max-width: 640px) {
  body.watch-mode .room-grid {
    grid-template-rows: minmax(0, 48%) minmax(260px, 52%);
  }

  body.watch-mode .control-panel.collapsed {
    left: 8px;
    right: 8px;
    bottom: 8px;
    max-height: none;
  }

  body.watch-mode .control-panel.collapsed .control-panel-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "bar bar bar"
      "play quick toggle";
  }

  body.watch-mode .timebar {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
  }

  body.watch-mode .quick-controls {
    gap: 3px;
  }

  body.watch-mode #quickMuteBtn,
  body.watch-mode #quickFullscreenBtn,
  body.watch-mode #controlsToggleBtn {
    min-width: 44px;
  }

  body.watch-mode #controlsToggleBtn {
    min-width: 74px;
  }

  .message-actions {
    opacity: 1;
    transform: none;
  }
}

/* Netflix-style custom player chrome. No full-video dim layer is used. */
body.watch-mode .netflix-controls.control-panel.collapsed {
  left: 24px;
  right: 24px;
  bottom: 18px;
}

body.watch-mode .netflix-controls .control-panel-header,
body.watch-mode .netflix-controls.collapsed .control-panel-header {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "bar"
    "row";
  gap: 12px;
}

body.watch-mode .netflix-controls .timebar {
  grid-area: bar;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  height: 22px;
  min-height: 22px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

body.watch-mode .netflix-control-row {
  grid-area: row;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 48px;
}

body.watch-mode .netflix-left-controls,
body.watch-mode .netflix-controls .quick-controls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

body.watch-mode .netflix-controls .quick-controls {
  justify-self: end;
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
}

body.watch-mode .netflix-controls .player-control-button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.58);
  color: #fff;
  font-size: 15px;
  font-weight: 850;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 8px 24px rgba(0, 0, 0, 0.24);
  transition: transform 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

body.watch-mode .netflix-controls .player-control-button:hover:not(:disabled) {
  transform: scale(1.08);
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24), 0 10px 28px rgba(0, 0, 0, 0.30);
}

body.watch-mode .netflix-controls .player-control-button:disabled {
  opacity: 0.44;
  cursor: not-allowed;
}

body.watch-mode .netflix-icon-button {
  font-size: 0;
}

body.watch-mode .netflix-icon-button::before {
  display: block;
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

body.watch-mode #quickPlayBtn::before {
  content: "\25B6";
  margin-left: 2px;
}

body.watch-mode #quickPlayBtn[data-state="playing"]::before {
  content: "\275A\275A";
  margin-left: 0;
  letter-spacing: 1px;
}

body.watch-mode #quickBackBtn,
body.watch-mode #quickForwardBtn {
  position: relative;
}

body.watch-mode #quickBackBtn::before {
  content: "\21BA";
  font-size: 24px;
}

body.watch-mode #quickForwardBtn::before {
  content: "\21BB";
  font-size: 24px;
}

body.watch-mode #quickBackBtn::after,
body.watch-mode #quickForwardBtn::after {
  content: "10";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding-top: 1px;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

body.watch-mode #quickMuteBtn::before {
  content: "\1F50A";
  font-size: 20px;
}

body.watch-mode #quickMuteBtn[aria-pressed="true"]::before {
  content: "\1F507";
}

body.watch-mode #quickFullscreenBtn::before {
  content: "\26F6";
  font-size: 22px;
}

body.watch-mode #quickFullscreenBtn[aria-pressed="true"]::before {
  content: "\2715";
  font-size: 20px;
}

body.watch-mode .netflix-controls .rate-button,
body.watch-mode .netflix-controls .controls-button {
  width: auto;
  min-width: 58px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.58);
}

body.watch-mode .netflix-controls .controls-button {
  min-width: 98px;
  background: rgba(229, 9, 20, 0.92);
  box-shadow: 0 10px 32px rgba(229, 9, 20, 0.22);
}

body.watch-mode .netflix-controls .controls-button[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.20);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

body.watch-mode .player-now-playing {
  display: grid;
  min-width: 0;
  max-width: min(34vw, 440px);
  margin-left: 4px;
  color: #fff;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.88);
}

body.watch-mode .player-now-playing strong,
body.watch-mode .player-now-playing span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.watch-mode .player-now-playing strong {
  font-size: 18px;
  line-height: 1.1;
}

body.watch-mode .player-now-playing span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 760;
}

body.watch-mode .netflix-controls input[type="range"] {
  accent-color: #e50914;
}

body.watch-mode .netflix-controls #progressRange {
  height: 16px;
}

body.watch-mode .netflix-controls #progressRange::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
}

body.watch-mode .netflix-controls #progressRange::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border-radius: 999px;
  background: #e50914;
  box-shadow: 0 0 0 4px rgba(229, 9, 20, 0.18);
}

body.watch-mode .netflix-controls #progressRange::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
}

body.watch-mode .netflix-controls #progressRange::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 999px;
  background: #e50914;
}

body.watch-mode .netflix-controls .quick-volume {
  width: 96px;
  height: 14px;
}

body.watch-mode .netflix-controls .quick-volume::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
}

body.watch-mode .netflix-controls .quick-volume::-webkit-slider-thumb {
  width: 13px;
  height: 13px;
  margin-top: -4.5px;
  border-radius: 999px;
  background: #fff;
}

body.watch-mode .netflix-controls .quick-volume::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
}

body.watch-mode .netflix-controls .quick-volume::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: 0;
  border-radius: 999px;
  background: #fff;
}

body.watch-mode .netflix-controls .control-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

body.watch-mode .control-panel.collapsed.netflix-controls .control-panel-header {
  grid-template-columns: 1fr;
  grid-template-areas:
    "bar"
    "row";
  gap: 10px;
}

body.watch-mode .control-panel.collapsed.netflix-controls .netflix-control-row {
  height: 48px;
  min-height: 48px;
  max-height: 48px;
  overflow: visible;
}

body.watch-mode .control-panel.collapsed.netflix-controls .netflix-left-controls,
body.watch-mode .control-panel.collapsed.netflix-controls .quick-controls {
  height: 44px;
  min-height: 44px;
  max-height: 44px;
}

body.watch-mode .control-panel.collapsed.netflix-controls .player-control-button,
body.watch-mode .control-panel.collapsed.netflix-controls #controlsToggleBtn {
  box-sizing: border-box;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  border-radius: 999px;
}

body.watch-mode .control-panel.collapsed.netflix-controls #controlsToggleBtn {
  grid-area: auto;
  justify-self: auto;
  min-width: 98px;
  padding: 0 16px;
  background: rgba(229, 9, 20, 0.92);
  color: #fff;
}

body.watch-mode .control-panel.collapsed.netflix-controls #controlsToggleBtn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.20);
}

@media (max-width: 980px) {
  body.watch-mode .player-now-playing {
    display: none;
  }
}

@media (max-width: 640px) {
  body.watch-mode .netflix-controls.control-panel.collapsed {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }

  body.watch-mode .netflix-controls .control-panel-header,
  body.watch-mode .netflix-controls.collapsed .control-panel-header {
    gap: 8px;
  }

  body.watch-mode .netflix-control-row {
    gap: 8px;
  }

  body.watch-mode .netflix-left-controls,
  body.watch-mode .netflix-controls .quick-controls {
    gap: 6px;
  }

  body.watch-mode .netflix-controls .player-control-button {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
  }

  body.watch-mode #quickBackBtn,
  body.watch-mode #quickForwardBtn,
  body.watch-mode .netflix-controls .quick-volume {
    display: none;
  }

  body.watch-mode .netflix-controls .rate-button {
    min-width: 48px;
    padding: 0 10px;
  }

  body.watch-mode .netflix-controls .controls-button {
    min-width: 78px;
    padding: 0 10px;
  }
}

/* Clean lounge player: video stays untouched, controls live under the player like the reference. */
body.watch-mode .watch-column {
  gap: 0;
  grid-template-rows: minmax(0, 1fr) auto;
}

body.watch-mode .player-frame {
  border-radius: 22px 22px 0 0;
  border-bottom: 0;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.30);
}

body.watch-mode .player-frame::after {
  content: none !important;
  display: none !important;
  background: none !important;
}

body.watch-mode .control-panel.collapsed.netflix-controls {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: auto;
  max-height: none;
  padding: 18px 24px 20px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, #7c5cff);
  border-top: 0;
  border-radius: 0 0 22px 22px;
  background:
    linear-gradient(180deg, rgba(14, 16, 31, 0.98), rgba(10, 12, 24, 0.98)),
    var(--panel);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.30);
  pointer-events: auto;
}

body.watch-mode .control-panel.collapsed.netflix-controls .control-panel-header {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "bar"
    "row";
  gap: 14px;
  pointer-events: auto;
}

body.watch-mode .control-panel.collapsed.netflix-controls .timebar {
  display: grid;
  grid-template-columns: minmax(52px, auto) minmax(0, 1fr) minmax(52px, auto);
  gap: 12px;
  align-items: center;
  height: 20px;
  min-height: 20px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: color-mix(in srgb, var(--text) 78%, var(--muted));
  font-size: 13px;
  font-weight: 760;
  text-shadow: none;
}

body.watch-mode .control-panel.collapsed.netflix-controls #progressRange {
  width: 100%;
  height: 16px;
  margin: 0;
}

body.watch-mode .control-panel.viewer-controls-locked #progressRange {
  pointer-events: none !important;
  cursor: not-allowed;
  touch-action: none;
  opacity: 0.82;
}

body.watch-mode .control-panel.viewer-controls-locked #progressRange::-webkit-slider-thumb,
body.watch-mode .control-panel.viewer-controls-locked #progressRange::-moz-range-thumb {
  pointer-events: none;
}

body.watch-mode .control-panel.collapsed.netflix-controls #progressRange::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, #7c5cff 30%, #25283d);
}

body.watch-mode .control-panel.collapsed.netflix-controls #progressRange::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  margin-top: -5px;
  border-radius: 999px;
  background: #f4f3ff;
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.22);
}

body.watch-mode .control-panel.collapsed.netflix-controls #progressRange::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, #7c5cff 30%, #25283d);
}

body.watch-mode .control-panel.collapsed.netflix-controls #progressRange::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 999px;
  background: #f4f3ff;
}

body.watch-mode .control-panel.collapsed.netflix-controls .netflix-control-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  height: auto;
  min-height: 48px;
  max-height: none;
}

body.watch-mode .control-panel.collapsed.netflix-controls .netflix-left-controls,
body.watch-mode .control-panel.collapsed.netflix-controls .quick-controls {
  height: auto;
  min-height: 44px;
  max-height: none;
  gap: 10px;
}

body.watch-mode .control-panel.collapsed.netflix-controls .quick-controls {
  justify-self: end;
  padding: 0;
  border: 0;
  background: transparent;
}

body.watch-mode .control-panel.collapsed.netflix-controls .player-control-button {
  width: 46px;
  min-width: 46px;
  height: 46px;
  min-height: 46px;
  max-height: 46px;
  border: 0;
  border-radius: 999px;
  background: #7c5cff;
  color: #fff;
  box-shadow: 0 10px 28px rgba(124, 92, 255, 0.20);
}

body.watch-mode .control-panel.collapsed.netflix-controls .player-control-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #8d75ff;
  box-shadow: 0 14px 34px rgba(124, 92, 255, 0.26);
}

body.watch-mode .control-panel.collapsed.netflix-controls #quickPlayBtn {
  width: 54px;
  min-width: 54px;
  height: 54px;
  min-height: 54px;
}

body.watch-mode .control-panel.collapsed.netflix-controls #quickPlayBtn::before {
  font-size: 26px;
}

body.watch-mode .control-panel.collapsed.netflix-controls #quickMuteBtn {
  background: color-mix(in srgb, var(--panel-strong) 88%, #7c5cff);
}

body.watch-mode .control-panel.collapsed.netflix-controls .quick-volume {
  width: 104px;
  height: 16px;
}

body.watch-mode .control-panel.collapsed.netflix-controls .quick-volume::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 999px;
  background: color-mix(in srgb, #7c5cff 46%, #d7d9e6);
}

body.watch-mode .control-panel.collapsed.netflix-controls .quick-volume::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  margin-top: -5.5px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
}

body.watch-mode .control-panel.collapsed.netflix-controls .quick-volume::-moz-range-track {
  height: 5px;
  border-radius: 999px;
  background: color-mix(in srgb, #7c5cff 46%, #d7d9e6);
}

body.watch-mode .control-panel.collapsed.netflix-controls .quick-volume::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 999px;
  background: #fff;
}

body.watch-mode .control-panel.collapsed.netflix-controls .player-now-playing {
  max-width: min(34vw, 460px);
  margin-left: 10px;
  color: var(--text);
  text-shadow: none;
}

body.watch-mode .control-panel.collapsed.netflix-controls .player-now-playing strong {
  font-size: 22px;
  line-height: 1.05;
}

body.watch-mode .control-panel.collapsed.netflix-controls .player-now-playing span {
  color: var(--muted);
  font-size: 14px;
}

body.watch-mode .control-panel.collapsed.netflix-controls .rate-button,
body.watch-mode .control-panel.collapsed.netflix-controls .controls-button,
body.watch-mode .control-panel.collapsed.netflix-controls #controlsToggleBtn {
  width: auto;
  min-width: 72px;
  padding: 0 16px;
  background: color-mix(in srgb, var(--panel-strong) 84%, #7c5cff);
  color: var(--text);
  box-shadow: none;
}

body.watch-mode .control-panel.collapsed.netflix-controls .controls-button,
body.watch-mode .control-panel.collapsed.netflix-controls #controlsToggleBtn {
  min-width: 108px;
  background: color-mix(in srgb, var(--panel-strong) 72%, #7c5cff);
}

body.watch-mode .control-panel.collapsed.netflix-controls #controlsToggleBtn[aria-expanded="true"] {
  background: #7c5cff;
  color: #fff;
}

@media (max-width: 920px) {
  body.watch-mode .watch-column {
    min-height: 0;
  }

  body.watch-mode .control-panel.collapsed.netflix-controls {
    padding: 12px 14px 14px;
    border-radius: 0 0 16px 16px;
  }

  body.watch-mode .player-frame {
    border-radius: 16px 16px 0 0;
  }

  body.watch-mode .control-panel.collapsed.netflix-controls .player-now-playing {
    display: none;
  }
}

@media (max-width: 640px) {
  body.watch-mode .control-panel.collapsed.netflix-controls {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    padding: 10px;
  }

  body.watch-mode .control-panel.collapsed.netflix-controls .control-panel-header {
    gap: 8px;
  }

  body.watch-mode .control-panel.collapsed.netflix-controls .timebar {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    gap: 8px;
    font-size: 12px;
  }

  body.watch-mode .control-panel.collapsed.netflix-controls .netflix-control-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  body.watch-mode .control-panel.collapsed.netflix-controls .netflix-left-controls,
  body.watch-mode .control-panel.collapsed.netflix-controls .quick-controls {
    gap: 6px;
  }

  body.watch-mode .control-panel.collapsed.netflix-controls #quickBackBtn,
  body.watch-mode .control-panel.collapsed.netflix-controls #quickForwardBtn,
  body.watch-mode .control-panel.collapsed.netflix-controls .quick-volume {
    display: none;
  }

  body.watch-mode .control-panel.collapsed.netflix-controls .player-control-button {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
  }

  body.watch-mode .control-panel.collapsed.netflix-controls #quickPlayBtn {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }

  body.watch-mode .control-panel.collapsed.netflix-controls .rate-button {
    min-width: 48px;
    padding: 0 10px;
  }

  body.watch-mode .control-panel.collapsed.netflix-controls #controlsToggleBtn {
    min-width: 76px;
    padding: 0 10px;
  }
}

/* Keep the under-player controls compact and close to the reference mockup. */
body.watch-mode .control-panel.collapsed.netflix-controls {
  padding: 12px 20px 14px;
}

body.watch-mode .control-panel.collapsed.netflix-controls .control-panel-header {
  gap: 10px;
}

body.watch-mode .control-panel.collapsed.netflix-controls .netflix-control-row {
  height: 56px;
  min-height: 56px;
  max-height: 56px;
  overflow: hidden;
}

body.watch-mode .control-panel.collapsed.netflix-controls .netflix-left-controls,
body.watch-mode .control-panel.collapsed.netflix-controls .quick-controls {
  height: 56px;
  min-height: 56px;
  max-height: 56px;
}

body.watch-mode .control-panel.collapsed.netflix-controls #quickPlayBtn {
  width: 50px;
  min-width: 50px;
  height: 50px;
  min-height: 50px;
}

body.watch-mode .control-panel.collapsed.netflix-controls .player-now-playing {
  align-content: center;
  gap: 3px;
}

@media (max-width: 640px) {
  body.watch-mode .control-panel.collapsed.netflix-controls {
    padding: 9px 10px 10px;
  }

  body.watch-mode .control-panel.collapsed.netflix-controls .control-panel-header {
    gap: 7px;
  }

  body.watch-mode .control-panel.collapsed.netflix-controls .netflix-control-row,
  body.watch-mode .control-panel.collapsed.netflix-controls .netflix-left-controls,
  body.watch-mode .control-panel.collapsed.netflix-controls .quick-controls {
    height: 46px;
    min-height: 46px;
    max-height: 46px;
  }
}

/* Final reference player chrome: clean video, compact controls below it. */
body.watch-mode .watch-column {
  gap: 0;
}

body.watch-mode .player-frame {
  border-radius: 18px 18px 0 0;
  border-bottom: 0;
  background: #000;
  box-shadow: none;
}

body.watch-mode .player-frame::before,
body.watch-mode .player-frame::after {
  content: none !important;
  display: none !important;
  background: none !important;
}

body.watch-mode .control-panel.collapsed.netflix-controls {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: auto;
  padding: 12px 24px 16px;
  border: 1px solid color-mix(in srgb, var(--border) 86%, #6d5dfc);
  border-top: 0;
  border-radius: 0 0 18px 18px;
  background: color-mix(in srgb, var(--panel) 94%, #050713);
  box-shadow: none;
  pointer-events: auto;
}

body.watch-mode .control-panel.collapsed.netflix-controls .control-panel-header {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "bar"
    "row";
  gap: 8px;
}

body.watch-mode .control-panel.collapsed.netflix-controls .timebar {
  grid-area: bar;
  display: grid;
  grid-template-columns: minmax(58px, auto) minmax(0, 1fr) minmax(58px, auto);
  gap: 12px;
  align-items: center;
  height: 18px;
  min-height: 18px;
  color: color-mix(in srgb, var(--text) 78%, var(--muted));
  font-size: 13px;
  font-weight: 760;
  text-shadow: none;
}

body.watch-mode .control-panel.collapsed.netflix-controls #progressRange {
  width: 100%;
  height: 16px;
  margin: 0;
  accent-color: #7b61ff;
}

body.watch-mode .control-panel.collapsed.netflix-controls #progressRange::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 999px;
  background: color-mix(in srgb, #7b61ff 34%, #2d3147);
}

body.watch-mode .control-panel.collapsed.netflix-controls #progressRange::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -4.5px;
  border-radius: 999px;
  background: #f6f7ff;
  box-shadow: 0 0 0 3px rgba(123, 97, 255, 0.20);
}

body.watch-mode .control-panel.collapsed.netflix-controls #progressRange::-moz-range-track {
  height: 5px;
  border-radius: 999px;
  background: color-mix(in srgb, #7b61ff 34%, #2d3147);
}

body.watch-mode .control-panel.collapsed.netflix-controls #progressRange::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 999px;
  background: #f6f7ff;
}

body.watch-mode .control-panel.collapsed.netflix-controls .netflix-control-row {
  grid-area: row;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  overflow: visible;
}

body.watch-mode .control-panel.collapsed.netflix-controls .netflix-left-controls,
body.watch-mode .control-panel.collapsed.netflix-controls .quick-controls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  min-width: 0;
}

body.watch-mode .control-panel.collapsed.netflix-controls .quick-controls {
  justify-self: end;
  padding: 0;
  border: 0;
  background: transparent;
  backdrop-filter: none;
}

body.watch-mode .control-panel.collapsed.netflix-controls #quickBackBtn,
body.watch-mode .control-panel.collapsed.netflix-controls #quickForwardBtn,
body.watch-mode .control-panel.collapsed.netflix-controls .player-now-playing {
  display: none !important;
}

body.watch-mode .control-panel.collapsed.netflix-controls .player-control-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  max-height: 38px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: color-mix(in srgb, var(--text) 92%, #fff);
  box-shadow: none;
  line-height: 1;
  transition: color 120ms ease, background 120ms ease, transform 120ms ease;
}

body.watch-mode .control-panel.collapsed.netflix-controls .player-control-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--panel-strong) 72%, #7b61ff);
  color: #fff;
  box-shadow: none;
}

body.watch-mode .control-panel.collapsed.netflix-controls .player-control-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

body.watch-mode .control-panel.collapsed.netflix-controls #quickPlayBtn {
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  border-radius: 12px;
}

body.watch-mode .control-panel.collapsed.netflix-controls #quickPlayBtn::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 3px;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 15px solid currentColor;
}

body.watch-mode .control-panel.collapsed.netflix-controls #quickPlayBtn[data-state="playing"]::before {
  width: 16px;
  height: 18px;
  margin-left: 0;
  border-top: 0;
  border-bottom: 0;
  border-left: 5px solid currentColor;
  border-right: 5px solid currentColor;
}

body.watch-mode .control-panel.collapsed.netflix-controls #quickMuteBtn::before {
  content: "";
  width: 18px;
  height: 17px;
  background: currentColor;
  clip-path: polygon(0 34%, 34% 34%, 78% 0, 78% 100%, 34% 66%, 0 66%);
}

body.watch-mode .control-panel.collapsed.netflix-controls #quickMuteBtn::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 13px;
  margin-left: 19px;
  border: 2px solid currentColor;
  border-left: 0;
  border-top-color: transparent;
  border-bottom-color: transparent;
  border-radius: 0 999px 999px 0;
}

body.watch-mode .control-panel.collapsed.netflix-controls #quickMuteBtn[aria-pressed="true"]::after {
  width: 22px;
  height: 2px;
  margin-left: 0;
  border: 0;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(-38deg);
}

body.watch-mode .control-panel.collapsed.netflix-controls #quickFullscreenBtn::before {
  content: "";
  width: 19px;
  height: 19px;
  background:
    linear-gradient(currentColor, currentColor) left top / 8px 2px no-repeat,
    linear-gradient(currentColor, currentColor) left top / 2px 8px no-repeat,
    linear-gradient(currentColor, currentColor) right top / 8px 2px no-repeat,
    linear-gradient(currentColor, currentColor) right top / 2px 8px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 8px 2px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 2px 8px no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / 8px 2px no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / 2px 8px no-repeat;
}

body.watch-mode .control-panel.collapsed.netflix-controls #quickFullscreenBtn[aria-pressed="true"]::before {
  width: 18px;
  height: 18px;
  background:
    linear-gradient(currentColor, currentColor) 4px 4px / 7px 2px no-repeat,
    linear-gradient(currentColor, currentColor) 4px 4px / 2px 7px no-repeat,
    linear-gradient(currentColor, currentColor) calc(100% - 4px) 4px / 7px 2px no-repeat,
    linear-gradient(currentColor, currentColor) calc(100% - 4px) 4px / 2px 7px no-repeat,
    linear-gradient(currentColor, currentColor) 4px calc(100% - 4px) / 7px 2px no-repeat,
    linear-gradient(currentColor, currentColor) 4px calc(100% - 4px) / 2px 7px no-repeat,
    linear-gradient(currentColor, currentColor) calc(100% - 4px) calc(100% - 4px) / 7px 2px no-repeat,
    linear-gradient(currentColor, currentColor) calc(100% - 4px) calc(100% - 4px) / 2px 7px no-repeat;
}

body.watch-mode .control-panel.collapsed.netflix-controls .rate-button,
body.watch-mode .control-panel.collapsed.netflix-controls #controlsToggleBtn {
  width: auto;
  min-width: 48px;
  height: 38px;
  min-height: 38px;
  max-height: 38px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--border) 82%, #7b61ff);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel-strong) 82%, #0b1022);
  color: var(--text);
  font-size: 14px;
  font-weight: 820;
}

body.watch-mode .control-panel.collapsed.netflix-controls #controlsToggleBtn {
  min-width: 86px;
}

body.watch-mode .control-panel.collapsed.netflix-controls #controlsToggleBtn[aria-expanded="true"] {
  background: color-mix(in srgb, #7b61ff 24%, var(--panel-strong));
  color: #fff;
}

body.watch-mode .control-panel.collapsed.netflix-controls .quick-volume {
  width: 110px;
  height: 16px;
  accent-color: #7b61ff;
}

body.watch-mode .control-panel.collapsed.netflix-controls .quick-volume::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, #7b61ff 38%, #d7d9e6);
}

body.watch-mode .control-panel.collapsed.netflix-controls .quick-volume::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.24);
}

body.watch-mode .control-panel.collapsed.netflix-controls .quick-volume::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, #7b61ff 38%, #d7d9e6);
}

body.watch-mode .control-panel.collapsed.netflix-controls .quick-volume::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 999px;
  background: #fff;
}

@media (max-width: 760px) {
  body.watch-mode .control-panel.collapsed.netflix-controls {
    padding: 10px 12px 12px;
    border-radius: 0 0 16px 16px;
  }

  body.watch-mode .player-frame {
    border-radius: 16px 16px 0 0;
  }

  body.watch-mode .control-panel.collapsed.netflix-controls .timebar {
    grid-template-columns: 46px minmax(0, 1fr) 46px;
    gap: 8px;
    font-size: 12px;
  }

  body.watch-mode .control-panel.collapsed.netflix-controls .netflix-control-row {
    gap: 8px;
    height: 38px;
    min-height: 38px;
    max-height: 38px;
  }

  body.watch-mode .control-panel.collapsed.netflix-controls .netflix-left-controls,
  body.watch-mode .control-panel.collapsed.netflix-controls .quick-controls {
    gap: 6px;
    height: 38px;
    min-height: 38px;
    max-height: 38px;
  }

  body.watch-mode .control-panel.collapsed.netflix-controls .player-control-button {
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    max-height: 34px;
  }

  body.watch-mode .control-panel.collapsed.netflix-controls #quickPlayBtn {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
  }

  body.watch-mode .control-panel.collapsed.netflix-controls .quick-volume {
    width: 74px;
  }

  body.watch-mode .control-panel.collapsed.netflix-controls .rate-button {
    min-width: 42px;
    padding: 0 8px;
  }

  body.watch-mode .control-panel.collapsed.netflix-controls #controlsToggleBtn {
    min-width: 68px;
    padding: 0 8px;
  }
}

@media (max-width: 430px) {
  body.watch-mode .control-panel.collapsed.netflix-controls .quick-volume,
  body.watch-mode .control-panel.collapsed.netflix-controls .rate-button {
    display: none;
  }
}

/* Chat cleanup: message actions float, people list opens on demand, theme colors stay readable. */
.chat-panel {
  position: relative;
  color: var(--text);
}

.people-toggle {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  margin-top: 4px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--border) 78%, var(--accent));
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel-soft) 82%, var(--panel));
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.people-toggle:hover,
.people-toggle[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--accent) 68%, var(--border));
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
  color: var(--text);
}

body.watch-mode .chat-pane {
  position: relative;
  min-height: 0;
}

body.watch-mode .online-list {
  position: absolute;
  top: 14px;
  left: 16px;
  right: 16px;
  z-index: 12;
  max-height: min(280px, 46vh);
  overflow-y: auto;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--border) 82%, var(--accent));
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 96%, var(--panel-soft));
  box-shadow: 0 22px 58px color-mix(in srgb, var(--bg) 32%, transparent);
}

body.watch-mode .online-list[hidden] {
  display: none !important;
}

body.watch-mode .chat-panel {
  background: color-mix(in srgb, var(--panel) 96%, var(--panel-soft));
  color: var(--text);
}

body.watch-mode .chat-header,
body.watch-mode .chat-form {
  background: color-mix(in srgb, var(--panel) 90%, var(--panel-soft));
}

body.watch-mode .chat-log {
  gap: 8px;
  background: color-mix(in srgb, var(--panel-soft) 72%, var(--panel));
}

body.watch-mode .chat-form textarea,
body.watch-mode .chat-form input {
  background: color-mix(in srgb, var(--panel) 84%, var(--panel-soft));
  color: var(--text);
  border-color: color-mix(in srgb, var(--border) 82%, transparent);
}

body.watch-mode .chat-form textarea::placeholder,
body.watch-mode .chat-form input::placeholder {
  color: color-mix(in srgb, var(--muted) 86%, transparent);
}

.message-content {
  gap: 3px;
}

.message .message-body {
  transition: background 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.message:not(.system):hover .message-body,
.message.actions-open:not(.system) .message-body {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 32%, transparent);
}

.message-actions {
  position: absolute;
  top: -12px;
  z-index: 9;
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 3px;
  width: auto;
  margin: 0;
  padding: 3px;
  border: 1px solid color-mix(in srgb, var(--border) 76%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 96%, var(--panel-soft));
  box-shadow: 0 14px 34px color-mix(in srgb, var(--bg) 34%, transparent);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.message:not(.mine) .message-actions {
  left: 0;
}

.message.mine .message-actions {
  right: 0;
  justify-self: auto;
}

.message:hover .message-actions,
.message:focus-within .message-actions,
.message.actions-open .message-actions {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.message-action,
.emoji-button {
  width: 26px;
  min-width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}

.message-action {
  color: var(--accent);
  font-size: 14px;
}

.message-action:hover,
.emoji-button:hover {
  background: color-mix(in srgb, var(--accent) 16%, var(--panel-soft));
  color: var(--text);
}

.reaction-row {
  margin-top: 0;
  gap: 4px;
}

.reaction-chip {
  min-height: 22px;
  padding: 0 7px;
  background: color-mix(in srgb, var(--panel) 76%, var(--panel-soft));
  color: var(--text);
}

body[data-theme="light"] .chat-panel,
body[data-theme="white"] .chat-panel,
body[data-theme="pink-white"] .chat-panel,
body[data-theme="light"] .online-list,
body[data-theme="white"] .online-list,
body[data-theme="pink-white"] .online-list,
body[data-theme="light"] .message-actions,
body[data-theme="white"] .message-actions,
body[data-theme="pink-white"] .message-actions {
  box-shadow: 0 18px 44px rgba(31, 41, 55, 0.12);
}

body[data-theme="light"].watch-mode .chat-panel,
body[data-theme="white"].watch-mode .chat-panel,
body[data-theme="pink-white"].watch-mode .chat-panel {
  background: color-mix(in srgb, var(--panel) 98%, var(--panel-soft));
}

body[data-theme="light"].watch-mode .chat-log,
body[data-theme="white"].watch-mode .chat-log,
body[data-theme="pink-white"].watch-mode .chat-log {
  background: color-mix(in srgb, var(--panel-soft) 82%, var(--panel));
}

body[data-theme="light"].watch-mode .chat-form textarea,
body[data-theme="white"].watch-mode .chat-form textarea,
body[data-theme="pink-white"].watch-mode .chat-form textarea {
  background: var(--panel);
  color: var(--text);
}

@media (max-width: 640px) {
  body.watch-mode .online-list {
    left: 10px;
    right: 10px;
    max-height: min(250px, 42vh);
  }

  .message-actions {
    top: -10px;
  }
}

/* Chat scroll lock: only messages scroll, header/tabs/online button/input stay fixed. */
body.watch-mode .chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

body.watch-mode .chat-header {
  position: relative;
  z-index: 5;
  flex: none;
}

body.watch-mode .chat-pane {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  min-height: 0;
  overflow: hidden;
}

body.watch-mode .chat-log {
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

body.watch-mode .typing-indicator,
body.watch-mode .chat-form {
  flex: none;
}

body.watch-mode .chat-form {
  position: relative;
  z-index: 4;
}

/* WhatsApp-like chat sides: own messages right, others left. */
.message.mine .message-content {
  justify-items: end;
}

.message.mine .message-meta {
  justify-content: flex-end;
  text-align: right;
}

.message:not(.mine) .message-content {
  justify-items: start;
}

.message:not(.mine) .message-meta {
  justify-content: flex-start;
  text-align: left;
}

.message.mine .message-body,
.message.mine .reply-quote,
.message.mine .reaction-row {
  justify-self: end;
}

.message:not(.mine) .message-body,
.message:not(.mine) .reply-quote,
.message:not(.mine) .reaction-row {
  justify-self: start;
}

body.watch-mode .chat-form:focus-within {
  scroll-margin-bottom: 0;
}

@supports (-webkit-touch-callout: none) {
  body.watch-mode {
    height: var(--app-height);
    min-height: var(--app-height);
  }

  body.watch-mode .room-grid {
    height: calc(var(--app-height) - var(--watch-header-height));
  }
}

/* Streaming-style control bar: full-width accurate timeline, no dead space at the ends. */
body.watch-mode .control-panel.collapsed.netflix-controls {
  padding: 4px 16px 6px;
}

body.watch-mode .control-panel.collapsed.netflix-controls .control-panel-header {
  gap: 4px;
}

body.watch-mode .control-panel.collapsed.netflix-controls .timebar {
  grid-area: bar;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "range range"
    "current duration";
  gap: 1px 10px;
  width: 100%;
  height: auto;
  min-height: 12px;
  padding: 0;
  font-size: 11px;
  line-height: 1;
}

body.watch-mode .control-panel.collapsed.netflix-controls #currentTimeText {
  grid-area: current;
  justify-self: start;
}

body.watch-mode .control-panel.collapsed.netflix-controls #durationText {
  grid-area: duration;
  justify-self: end;
}

body.watch-mode .control-panel.collapsed.netflix-controls #progressRange {
  --progress-percent: 0%;
  --buffer-percent: 0%;
  grid-area: range;
  display: block;
  width: 100%;
  height: 3px;
  min-height: 3px;
  margin: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 999px;
  background:
    linear-gradient(
      90deg,
      var(--accent) 0%,
      var(--accent-strong) var(--progress-percent),
      color-mix(in srgb, var(--text) 18%, transparent) var(--progress-percent),
      color-mix(in srgb, var(--text) 18%, transparent) 100%
    );
  cursor: pointer;
}

body.watch-mode .control-panel.collapsed.netflix-controls #progressRange::-webkit-slider-runnable-track {
  width: 100%;
  height: 3px;
  border: 0;
  border-radius: 999px;
  background: transparent;
}

body.watch-mode .control-panel.collapsed.netflix-controls #progressRange::-webkit-slider-thumb {
  width: 8px;
  height: 8px;
  margin-top: -2.5px;
  -webkit-appearance: none;
  border: 1px solid color-mix(in srgb, var(--panel) 84%, black);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.34);
}

body.watch-mode .control-panel.collapsed.netflix-controls #progressRange::-moz-range-track {
  width: 100%;
  height: 3px;
  border: 0;
  border-radius: 999px;
  background: transparent;
}

body.watch-mode .control-panel.collapsed.netflix-controls #progressRange::-moz-range-progress {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
}

body.watch-mode .control-panel.collapsed.netflix-controls #progressRange::-moz-range-thumb {
  width: 8px;
  height: 8px;
  border: 1px solid color-mix(in srgb, var(--panel) 84%, black);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.34);
}

body.watch-mode .control-panel.collapsed.netflix-controls .netflix-control-row {
  height: 30px;
  min-height: 30px;
  max-height: 30px;
}

body.watch-mode .control-panel.collapsed.netflix-controls .netflix-left-controls,
body.watch-mode .control-panel.collapsed.netflix-controls .quick-controls {
  height: 30px;
  min-height: 30px;
  max-height: 30px;
}

body.watch-mode .control-panel.collapsed.netflix-controls .player-control-button,
body.watch-mode .control-panel.collapsed.netflix-controls .player-control-button.primary,
body.watch-mode .control-panel.collapsed.netflix-controls #controlsToggleBtn {
  height: 28px;
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
}

body.watch-mode .control-panel.collapsed.netflix-controls .player-control-button.primary {
  min-width: 42px;
}

body.watch-mode .control-panel.collapsed.netflix-controls #controlsToggleBtn {
  min-width: 76px;
}

body.watch-mode .control-panel.collapsed.netflix-controls .quick-controls {
  padding: 0 5px;
}

body.watch-mode .control-panel.collapsed.netflix-controls .quick-volume {
  width: 76px;
  height: 10px;
  min-height: 10px;
}

/* Ultra-slim player override: beat the global input min-height and native range UI. */
body.watch-mode .control-panel.collapsed.netflix-controls {
  padding: 3px 16px 5px;
}

body.watch-mode .control-panel.collapsed.netflix-controls .control-panel-header {
  gap: 3px;
}

body.watch-mode .control-panel.collapsed.netflix-controls .timebar {
  min-height: 10px;
  gap: 1px 10px;
  font-size: 10px;
}

body.watch-mode .control-panel.collapsed.netflix-controls #progressRange {
  height: 3px !important;
  min-height: 3px !important;
  max-height: 3px !important;
  line-height: 3px;
  overflow: visible;
}

body.watch-mode .control-panel.collapsed.netflix-controls #progressRange::-webkit-slider-runnable-track {
  height: 3px !important;
}

body.watch-mode .control-panel.collapsed.netflix-controls #progressRange::-webkit-slider-thumb {
  width: 7px;
  height: 7px;
  margin-top: -2px;
}

body.watch-mode .control-panel.collapsed.netflix-controls #progressRange::-moz-range-track,
body.watch-mode .control-panel.collapsed.netflix-controls #progressRange::-moz-range-progress {
  height: 3px !important;
}

body.watch-mode .control-panel.collapsed.netflix-controls #progressRange::-moz-range-thumb {
  width: 7px;
  height: 7px;
}

body.watch-mode .control-panel.collapsed.netflix-controls .netflix-control-row,
body.watch-mode .control-panel.collapsed.netflix-controls .netflix-left-controls,
body.watch-mode .control-panel.collapsed.netflix-controls .quick-controls {
  height: 28px;
  min-height: 28px;
  max-height: 28px;
}

body.watch-mode .control-panel.collapsed.netflix-controls .player-control-button,
body.watch-mode .control-panel.collapsed.netflix-controls .player-control-button.primary,
body.watch-mode .control-panel.collapsed.netflix-controls #controlsToggleBtn {
  height: 26px;
  min-height: 26px;
  max-height: 26px;
  padding: 0 7px;
}

body.watch-mode .control-panel.collapsed.netflix-controls .quick-volume {
  height: 8px !important;
  min-height: 8px !important;
  max-height: 8px !important;
}

@media (max-width: 760px) {
  body.watch-mode .control-panel.collapsed.netflix-controls {
    padding: 3px 10px 5px;
  }

  body.watch-mode .control-panel.collapsed.netflix-controls .timebar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1px 8px;
  }
}

/* Exact compact streaming bar: progress on top, simple transport row below. */
body.watch-mode .control-panel.collapsed.netflix-controls {
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 38px 28px;
  border: 1px solid rgba(132, 119, 190, 0.22);
  border-radius: 0 0 18px 18px;
  background: #111220;
  box-shadow: none;
}

body.watch-mode .control-panel.collapsed.netflix-controls .control-panel-header {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "bar"
    "row";
  gap: 26px;
  align-items: center;
}

body.watch-mode .control-panel.collapsed.netflix-controls .timebar {
  grid-area: bar;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "range";
  width: 100%;
  min-height: 8px;
  padding: 0;
}

body.watch-mode .control-panel.collapsed.netflix-controls #currentTimeText,
body.watch-mode .control-panel.collapsed.netflix-controls #durationText {
  display: none;
}

body.watch-mode .control-panel.collapsed.netflix-controls #progressRange {
  --progress-percent: 0%;
  grid-area: range;
  display: block;
  width: 100%;
  height: 8px !important;
  min-height: 8px !important;
  max-height: 8px !important;
  padding: 0;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 999px;
  background:
    linear-gradient(
      90deg,
      #8b5cf6 0%,
      #3b82f6 var(--progress-percent),
      rgba(255, 255, 255, 0.34) var(--progress-percent),
      rgba(255, 255, 255, 0.34) var(--buffer-percent),
      rgba(255, 255, 255, 0.08) var(--buffer-percent),
      rgba(255, 255, 255, 0.08) 100%
    );
}

body.watch-mode .control-panel.collapsed.netflix-controls #progressRange::-webkit-slider-runnable-track {
  width: 100%;
  height: 8px !important;
  border: 0;
  border-radius: 999px;
  background: transparent;
}

body.watch-mode .control-panel.collapsed.netflix-controls #progressRange::-webkit-slider-thumb {
  width: 0;
  height: 0;
  margin-top: 0;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.watch-mode .control-panel.collapsed.netflix-controls #progressRange::-moz-range-track {
  width: 100%;
  height: 8px !important;
  border: 0;
  border-radius: 999px;
  background:
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.34) 0%,
      rgba(255, 255, 255, 0.34) var(--buffer-percent),
      rgba(255, 255, 255, 0.08) var(--buffer-percent),
      rgba(255, 255, 255, 0.08) 100%
    );
}

body.watch-mode .control-panel.collapsed.netflix-controls #progressRange::-moz-range-progress {
  height: 8px !important;
  border-radius: 999px;
  background: linear-gradient(90deg, #8b5cf6, #3b82f6);
}

body.watch-mode .control-panel.collapsed.netflix-controls #progressRange::-moz-range-thumb {
  width: 0;
  height: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.watch-mode .control-panel.collapsed.netflix-controls .netflix-control-row {
  grid-area: row;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  height: 32px;
  min-height: 32px;
  max-height: 32px;
  gap: 18px;
}

body.watch-mode .control-panel.collapsed.netflix-controls .netflix-left-controls {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 32px;
  min-height: 32px;
  max-height: 32px;
}

body.watch-mode .control-panel.collapsed.netflix-controls .quick-controls {
  display: flex;
  grid-area: auto;
  justify-self: end;
  align-self: center;
  align-items: center;
  gap: 22px;
  height: 32px;
  min-height: 32px;
  max-height: 32px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
}

body.watch-mode .control-panel.collapsed.netflix-controls #quickBackBtn,
body.watch-mode .control-panel.collapsed.netflix-controls #quickForwardBtn,
body.watch-mode .control-panel.collapsed.netflix-controls #quickRateBtn,
body.watch-mode .control-panel.collapsed.netflix-controls #controlsToggleBtn,
body.watch-mode .control-panel.collapsed.netflix-controls .player-now-playing {
  display: none !important;
}

body.watch-mode .control-panel.collapsed.netflix-controls .player-control-button,
body.watch-mode .control-panel.collapsed.netflix-controls .player-control-button.primary {
  position: relative;
  grid-area: auto;
  align-self: center;
  display: inline-grid;
  place-items: center;
  width: 26px;
  min-width: 26px;
  max-width: 26px;
  height: 26px;
  min-height: 26px;
  max-height: 26px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(245, 245, 255, 0.92);
  box-shadow: none;
  transform: none;
}

body.watch-mode .control-panel.collapsed.netflix-controls .player-control-button:hover:not(:disabled) {
  background: transparent;
  box-shadow: none;
  transform: none;
  color: #fff;
}

body.watch-mode .control-panel.collapsed.netflix-controls .netflix-icon-button::before {
  color: currentColor;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

body.watch-mode .control-panel.collapsed.netflix-controls #quickPlayBtn::before {
  content: "\25B6";
  font-size: 16px;
  margin-left: 1px;
}

body.watch-mode .control-panel.collapsed.netflix-controls #quickPlayBtn[data-state="playing"]::before {
  content: "\275A\275A";
  font-size: 16px;
  letter-spacing: 1px;
  margin-left: 0;
}

body.watch-mode .control-panel.collapsed.netflix-controls .netflix-left-controls::after {
  content: none;
}

body.watch-mode .control-panel.collapsed.netflix-controls .combined-time {
  color: rgba(245, 245, 255, 0.70);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
  white-space: nowrap;
}

body.watch-mode .control-panel.collapsed.netflix-controls #quickMuteBtn::before {
  content: "\1F50A";
  font-size: 17px;
}

body.watch-mode .control-panel.collapsed.netflix-controls #quickMuteBtn[aria-pressed="true"]::before {
  content: "\1F507";
}

body.watch-mode .control-panel.collapsed.netflix-controls .quick-volume {
  grid-area: auto;
  align-self: center;
  width: 96px;
  height: 9px !important;
  min-height: 9px !important;
  max-height: 9px !important;
  margin: 0 4px 0 -8px;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #8b5cf6 0%, #8b5cf6 66%, #f8f6ff 66%, #f8f6ff 100%);
}

body.watch-mode .control-panel.collapsed.netflix-controls .quick-volume::-webkit-slider-runnable-track {
  height: 9px;
  border-radius: 999px;
  background: transparent;
}

body.watch-mode .control-panel.collapsed.netflix-controls .quick-volume::-webkit-slider-thumb {
  width: 19px;
  height: 19px;
  margin-top: -5px;
  -webkit-appearance: none;
  border: 0;
  border-radius: 999px;
  background: #8b5cf6;
  box-shadow: none;
}

body.watch-mode .control-panel.collapsed.netflix-controls .quick-volume::-moz-range-track {
  height: 9px;
  border-radius: 999px;
  background: #f8f6ff;
}

body.watch-mode .control-panel.collapsed.netflix-controls .quick-volume::-moz-range-progress {
  height: 9px;
  border-radius: 999px;
  background: #8b5cf6;
}

body.watch-mode .control-panel.collapsed.netflix-controls .quick-volume::-moz-range-thumb {
  width: 19px;
  height: 19px;
  border: 0;
  border-radius: 999px;
  background: #8b5cf6;
}

body.watch-mode .control-panel.collapsed.netflix-controls #quickFullscreenBtn::before {
  content: "\26F6";
  font-size: 18px;
}

body.watch-mode .control-panel.collapsed.netflix-controls #quickFullscreenBtn[aria-pressed="true"]::before {
  content: "\2715";
  font-size: 17px;
}

@media (max-width: 760px) {
  body.watch-mode .control-panel.collapsed.netflix-controls {
    padding: 14px 18px 20px;
  }

  body.watch-mode .control-panel.collapsed.netflix-controls .control-panel-header {
    gap: 18px;
  }

  body.watch-mode .control-panel.collapsed.netflix-controls .netflix-left-controls {
    gap: 16px;
  }

  body.watch-mode .control-panel.collapsed.netflix-controls .combined-time {
    font-size: 12px;
  }

  body.watch-mode .control-panel.collapsed.netflix-controls .quick-volume {
    width: 72px;
  }
}

/* Player controls fix: clean icons, clickable fullscreen controls, live volume fill. */
body.watch-mode .watch-column:fullscreen,
body.watch-mode .watch-column:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  background: #05070a;
}

body.watch-mode .watch-column:fullscreen .player-frame,
body.watch-mode .watch-column:-webkit-full-screen .player-frame {
  width: 100vw;
  height: 100vh;
  border: 0;
  border-radius: 0;
}

body.watch-mode .watch-column:fullscreen .control-panel.collapsed.netflix-controls,
body.watch-mode .watch-column:-webkit-full-screen .control-panel.collapsed.netflix-controls,
body.watch-mode .control-panel.collapsed.netflix-controls {
  pointer-events: auto !important;
}

body.watch-mode .control-panel.collapsed.netflix-controls .control-panel-header,
body.watch-mode .control-panel.collapsed.netflix-controls .netflix-control-row,
body.watch-mode .control-panel.collapsed.netflix-controls .netflix-left-controls,
body.watch-mode .control-panel.collapsed.netflix-controls .quick-controls,
body.watch-mode .control-panel.collapsed.netflix-controls button,
body.watch-mode .control-panel.collapsed.netflix-controls input {
  pointer-events: auto !important;
}

body.watch-mode .control-panel.collapsed.netflix-controls .control-label,
body.watch-mode .control-panel.collapsed.netflix-controls .player-control-button span {
  display: none !important;
}

body.watch-mode .control-panel.collapsed.netflix-controls .player-control-button,
body.watch-mode .control-panel.collapsed.netflix-controls .player-control-button.primary {
  overflow: visible;
  font-size: 0 !important;
  line-height: 0;
}

body.watch-mode .control-panel.collapsed.netflix-controls #quickPlayBtn::before,
body.watch-mode .control-panel.collapsed.netflix-controls #quickPlayBtn::after,
body.watch-mode .control-panel.collapsed.netflix-controls #quickMuteBtn::before,
body.watch-mode .control-panel.collapsed.netflix-controls #quickMuteBtn::after,
body.watch-mode .control-panel.collapsed.netflix-controls #quickFullscreenBtn::before {
  box-sizing: border-box;
}

body.watch-mode .control-panel.collapsed.netflix-controls #quickPlayBtn::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 13px solid currentColor;
  background: transparent;
}

body.watch-mode .control-panel.collapsed.netflix-controls #quickPlayBtn[data-state="playing"]::before {
  content: "";
  width: 16px;
  height: 17px;
  margin-left: 0;
  border-top: 0;
  border-bottom: 0;
  border-left: 5px solid currentColor;
  border-right: 5px solid currentColor;
  background: transparent;
}

body.watch-mode .control-panel.collapsed.netflix-controls #quickMuteBtn {
  width: 28px;
  min-width: 28px;
  max-width: 28px;
  background: transparent !important;
  box-shadow: none !important;
}

body.watch-mode .control-panel.collapsed.netflix-controls #quickMuteBtn::before {
  content: "";
  width: 17px;
  height: 16px;
  background: currentColor;
  clip-path: polygon(0 35%, 32% 35%, 76% 5%, 76% 95%, 32% 65%, 0 65%);
}

body.watch-mode .control-panel.collapsed.netflix-controls #quickMuteBtn::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 13px;
  margin-left: 18px;
  border: 2px solid currentColor;
  border-left: 0;
  border-top-color: transparent;
  border-bottom-color: transparent;
  border-radius: 0 999px 999px 0;
  background: transparent;
}

body.watch-mode .control-panel.collapsed.netflix-controls #quickMuteBtn[aria-pressed="true"]::after {
  width: 22px;
  height: 2px;
  margin-left: 0;
  border: 0;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(-38deg);
}

body.watch-mode .control-panel.collapsed.netflix-controls .quick-volume {
  --volume-percent: 60%;
  --volume-thumb-size: 20px;
  width: 126px;
  height: 24px !important;
  min-height: 24px !important;
  max-height: 24px !important;
  background: transparent !important;
  touch-action: none;
  cursor: pointer;
}

body.watch-mode .control-panel.collapsed.netflix-controls .quick-volume::-webkit-slider-runnable-track {
  height: 8px !important;
  border-radius: 999px;
  background:
    linear-gradient(
      90deg,
      #8b5cf6 0%,
      #8b5cf6 var(--volume-percent),
      #f4f1ff var(--volume-percent),
      #f4f1ff 100%
    ) !important;
}

body.watch-mode .control-panel.collapsed.netflix-controls .quick-volume::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
  margin-top: -6px;
  background: #8b5cf6;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
}

body.watch-mode .control-panel.collapsed.netflix-controls .quick-volume::-moz-range-track {
  height: 8px !important;
  background: #f4f1ff;
}

body.watch-mode .control-panel.collapsed.netflix-controls .quick-volume::-moz-range-progress {
  height: 8px !important;
  background: #8b5cf6;
}

body.watch-mode .control-panel.collapsed.netflix-controls .quick-volume::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #8b5cf6;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
}

body.watch-mode .control-panel.collapsed.netflix-controls .quick-volume-control {
  --volume-percent: 60%;
  position: relative;
  width: 126px;
  height: 24px;
  flex: 0 0 126px;
  display: block;
  cursor: pointer;
  touch-action: none;
  outline: none;
}

body.watch-mode .control-panel.collapsed.netflix-controls .quick-volume-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 8px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: #f4f1ff;
  overflow: hidden;
}

body.watch-mode .control-panel.collapsed.netflix-controls .quick-volume-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--volume-percent);
  border-radius: inherit;
  background: #8b5cf6;
}

body.watch-mode .control-panel.collapsed.netflix-controls .quick-volume-thumb {
  position: absolute;
  left: var(--volume-percent);
  top: 50%;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #8b5cf6;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

body.watch-mode .control-panel.collapsed.netflix-controls .quick-volume-control:focus-visible .quick-volume-thumb {
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.28);
}

body.watch-mode .control-panel.collapsed.netflix-controls .quick-volume-control .quick-volume {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100% !important;
  min-height: 100% !important;
  max-height: 100% !important;
  opacity: 0;
  pointer-events: none;
}

body.watch-mode .control-panel.collapsed.netflix-controls #quickFullscreenBtn {
  width: 30px;
  min-width: 30px;
  max-width: 30px;
  background: transparent !important;
  box-shadow: none !important;
}

body.watch-mode .control-panel.collapsed.netflix-controls #quickFullscreenBtn::before {
  content: "";
  width: 20px;
  height: 20px;
  background:
    linear-gradient(currentColor, currentColor) left top / 8px 2px no-repeat,
    linear-gradient(currentColor, currentColor) left top / 2px 8px no-repeat,
    linear-gradient(currentColor, currentColor) right top / 8px 2px no-repeat,
    linear-gradient(currentColor, currentColor) right top / 2px 8px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 8px 2px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 2px 8px no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / 8px 2px no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / 2px 8px no-repeat;
}

/* Compact player controls: give the video a little more vertical room. */
body.watch-mode .control-panel.collapsed.netflix-controls {
  padding: 14px 38px 18px;
}

body.watch-mode .control-panel.collapsed.netflix-controls .control-panel-header {
  gap: 18px;
}

body.watch-mode .control-panel.collapsed.netflix-controls .netflix-control-row {
  height: 28px;
  min-height: 28px;
  max-height: 28px;
}

body.watch-mode .control-panel.collapsed.netflix-controls .netflix-left-controls,
body.watch-mode .control-panel.collapsed.netflix-controls .quick-controls {
  height: 28px;
  min-height: 28px;
  max-height: 28px;
}

body.watch-mode .control-panel.collapsed.netflix-controls .player-control-button,
body.watch-mode .control-panel.collapsed.netflix-controls .player-control-button.primary {
  height: 24px;
  min-height: 24px;
  max-height: 24px;
}

body.watch-mode .control-panel.collapsed.netflix-controls .combined-time {
  font-size: 14px;
}

body.watch-mode .control-panel.collapsed.netflix-controls .quick-volume {
  width: 118px;
}

body.watch-mode .control-panel.collapsed.netflix-controls .quick-volume-control {
  width: 118px;
  flex-basis: 118px;
}

/* Clean fullscreen icon: four balanced corners, no collapsed glyph artifacts. */
body.watch-mode .control-panel.collapsed.netflix-controls #quickFullscreenBtn {
  width: 32px;
  min-width: 32px;
  max-width: 32px;
  height: 32px;
  min-height: 32px;
  max-height: 32px;
  display: inline-grid;
  place-items: center;
  color: rgba(245, 245, 255, 0.92);
}

body.watch-mode .control-panel.collapsed.netflix-controls #quickFullscreenBtn::before {
  content: "";
  width: 21px;
  height: 21px;
  background:
    linear-gradient(currentColor, currentColor) left top / 8px 2px no-repeat,
    linear-gradient(currentColor, currentColor) left top / 2px 8px no-repeat,
    linear-gradient(currentColor, currentColor) right top / 8px 2px no-repeat,
    linear-gradient(currentColor, currentColor) right top / 2px 8px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 8px 2px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 2px 8px no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / 8px 2px no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / 2px 8px no-repeat;
}

body.watch-mode .control-panel.collapsed.netflix-controls #quickFullscreenBtn[aria-pressed="true"]::before {
  width: 21px;
  height: 21px;
  background:
    linear-gradient(currentColor, currentColor) 4px 4px / 8px 2px no-repeat,
    linear-gradient(currentColor, currentColor) 4px 4px / 2px 8px no-repeat,
    linear-gradient(currentColor, currentColor) calc(100% - 4px) 4px / 8px 2px no-repeat,
    linear-gradient(currentColor, currentColor) calc(100% - 4px) 4px / 2px 8px no-repeat,
    linear-gradient(currentColor, currentColor) 4px calc(100% - 4px) / 8px 2px no-repeat,
    linear-gradient(currentColor, currentColor) 4px calc(100% - 4px) / 2px 8px no-repeat,
    linear-gradient(currentColor, currentColor) calc(100% - 4px) calc(100% - 4px) / 8px 2px no-repeat,
    linear-gradient(currentColor, currentColor) calc(100% - 4px) calc(100% - 4px) / 2px 8px no-repeat;
}

@media (max-width: 760px) {
  body.watch-mode .control-panel.collapsed.netflix-controls {
    padding: 12px 16px 16px;
  }

  body.watch-mode .control-panel.collapsed.netflix-controls .control-panel-header {
    gap: 14px;
  }
}

/* Fullscreen layout: keep the custom controls as a real bottom bar. */
body.watch-mode .watch-column:fullscreen,
body.watch-mode .watch-column:-webkit-full-screen {
  position: relative !important;
  width: 100vw !important;
  height: 100vh !important;
  min-width: 100vw !important;
  min-height: 100vh !important;
  display: block !important;
  overflow: hidden !important;
  background: #05070a !important;
}

body.watch-mode .watch-column:fullscreen .player-frame,
body.watch-mode .watch-column:-webkit-full-screen .player-frame {
  position: absolute !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  min-height: 100vh !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #05070a !important;
}

body.watch-mode .watch-column:fullscreen #player,
body.watch-mode .watch-column:fullscreen #player iframe,
body.watch-mode .watch-column:fullscreen #localPlayer,
body.watch-mode .watch-column:-webkit-full-screen #player,
body.watch-mode .watch-column:-webkit-full-screen #player iframe,
body.watch-mode .watch-column:-webkit-full-screen #localPlayer {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

body.watch-mode .watch-column:fullscreen .control-panel.collapsed.netflix-controls,
body.watch-mode .watch-column:-webkit-full-screen .control-panel.collapsed.netflix-controls {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  top: auto !important;
  z-index: 2147483647 !important;
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  padding: 14px 38px 18px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: rgba(17, 18, 32, 0.96) !important;
  pointer-events: auto !important;
}

body.watch-mode .watch-column:fullscreen .control-panel.collapsed.netflix-controls .control-panel-header,
body.watch-mode .watch-column:-webkit-full-screen .control-panel.collapsed.netflix-controls .control-panel-header {
  display: grid !important;
  grid-template-columns: 1fr !important;
  grid-template-areas:
    "bar"
    "row" !important;
  gap: 18px !important;
  align-items: center !important;
  height: auto !important;
  min-height: 0 !important;
}

body.watch-mode .watch-column:fullscreen .control-panel.collapsed.netflix-controls .timebar,
body.watch-mode .watch-column:-webkit-full-screen .control-panel.collapsed.netflix-controls .timebar {
  grid-area: bar !important;
  width: 100% !important;
  height: 8px !important;
  min-height: 8px !important;
}

body.watch-mode .watch-column:fullscreen .control-panel.collapsed.netflix-controls .netflix-control-row,
body.watch-mode .watch-column:-webkit-full-screen .control-panel.collapsed.netflix-controls .netflix-control-row {
  grid-area: row !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  height: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
}

body.watch-mode .watch-column:fullscreen .control-panel.collapsed.netflix-controls .netflix-left-controls,
body.watch-mode .watch-column:fullscreen .control-panel.collapsed.netflix-controls .quick-controls,
body.watch-mode .watch-column:-webkit-full-screen .control-panel.collapsed.netflix-controls .netflix-left-controls,
body.watch-mode .watch-column:-webkit-full-screen .control-panel.collapsed.netflix-controls .quick-controls {
  position: static !important;
  display: flex !important;
  align-items: center !important;
  height: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
}

body.watch-mode .watch-column:fullscreen .control-panel.collapsed.netflix-controls .quick-controls,
body.watch-mode .watch-column:-webkit-full-screen .control-panel.collapsed.netflix-controls .quick-controls {
  justify-self: end !important;
}

/* Exact timeline seeking: make the whole visible bar the pointer target. */
body.watch-mode .control-panel.collapsed.netflix-controls #progressRange {
  touch-action: none;
}

body.watch-mode .watch-column:fullscreen .control-panel.collapsed.netflix-controls #progressRange,
body.watch-mode .watch-column:-webkit-full-screen .control-panel.collapsed.netflix-controls #progressRange {
  touch-action: none;
}

/* Controls tab cleanup: compact, scrollable, and no dead-looking lower area. */
body.watch-mode .controls-pane {
  align-self: stretch;
  height: 100%;
  min-height: 0;
  max-height: none !important;
  align-content: start;
  gap: 10px;
  padding: 12px;
  overflow-y: auto;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel-soft) 36%, transparent), transparent 220px),
    color-mix(in srgb, var(--panel) 94%, black);
}

body.watch-mode #chatPanel.show-controls {
  grid-template-rows: auto minmax(0, 1fr) !important;
}

body.watch-mode #chatPanel.show-controls #controlsBody {
  height: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
}

body.watch-mode .controls-pane .room-toolbar,
body.watch-mode .controls-pane .transport-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

body.watch-mode .controls-pane .room-toolbar #deleteRoomBtn {
  grid-column: 1 / -1;
}

body.watch-mode .controls-pane .room-toolbar button,
body.watch-mode .controls-pane .transport-row button {
  width: 100%;
  min-height: 48px;
  justify-content: center;
  flex-basis: auto;
}

body.watch-mode .controls-pane .download-panel {
  gap: 8px;
  padding: 10px;
}

body.watch-mode .controls-pane .download-panel > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
  gap: 3px;
}

body.watch-mode .controls-pane #mediaDownloadHint {
  font-size: 12px;
  line-height: 1.25;
}

body.watch-mode .controls-pane #mediaDownloadForm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 8px;
  align-items: stretch;
}

body.watch-mode .controls-pane #mediaDownloadInput,
body.watch-mode .controls-pane #mediaDownloadButton {
  min-width: 0;
  height: 46px;
}

body.watch-mode .controls-pane .download-status {
  min-height: 18px;
  line-height: 1.25;
}

body.watch-mode .controls-pane .settings-row {
  grid-template-columns: 1fr;
  gap: 9px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-soft) 82%, black);
}

body.watch-mode .controls-pane .settings-row label {
  width: 100%;
}

body.watch-mode .controls-pane #volumeRange,
body.watch-mode .controls-pane #rateSelect {
  width: 100%;
  min-width: 0;
}

body.watch-mode .controls-pane .sync-readout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 760px) {
  body.watch-mode .controls-pane #mediaDownloadForm,
  body.watch-mode .controls-pane .room-toolbar,
  body.watch-mode .controls-pane .transport-row,
  body.watch-mode .controls-pane .sync-readout {
    grid-template-columns: 1fr;
  }
}


/* Friends filters and mobile watch layout fixes. */
.friend-tab {
  white-space: nowrap;
}

.friend-tab:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 80%, white);
  outline-offset: 2px;
}

.expanded-list .pending-item,
.expanded-list .friend-item {
  min-height: 72px;
}

.expanded-list .pending-actions {
  margin-left: auto;
}

@media (max-width: 700px) {
  .social-page .panel {
    padding: 14px;
  }

  .search-form {
    grid-template-columns: 1fr;
  }

  .search-form button {
    width: 100%;
  }

  .friend-tabs {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
  }

  .friend-tab {
    flex: 1 0 max-content;
  }

  .expanded-list {
    padding: 10px;
  }

  .expanded-list .friend-item,
  .expanded-list .pending-item,
  .compact-list .pending-item {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }

  .expanded-list .friend-item > :last-child,
  .expanded-list .pending-actions,
  .compact-list .pending-actions {
    grid-column: 2;
    margin-left: 0;
    justify-content: flex-start;
  }

  .pending-actions {
    flex-wrap: wrap;
  }
}

@media (orientation: portrait) and (max-width: 1024px) {
  body.watch-mode {
    overflow: hidden;
  }

  body.watch-mode .stage-header {
    height: 52px;
    min-height: 52px;
    padding: 0 10px;
  }

  body.watch-mode .stage-actions .status-pill,
  body.watch-mode #copyInviteBtn {
    display: none;
  }

  body.watch-mode .room-grid,
  body.watch-mode .app-view.chat-closed .room-grid {
    width: 100%;
    height: calc(var(--app-height) - 52px);
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(190px, 42svh) minmax(0, 1fr) !important;
    gap: 8px;
    padding: 8px;
    overflow: hidden;
  }

  body.watch-mode .watch-column {
    min-height: 0;
    grid-template-rows: minmax(0, 1fr);
  }

  body.watch-mode .player-frame {
    min-height: 0;
    height: 100%;
    border-radius: 12px;
  }

  body.watch-mode .chat-panel {
    display: grid !important;
    min-height: 0;
    height: 100%;
    grid-template-rows: auto minmax(0, 1fr) auto auto !important;
    border-radius: 12px;
  }

  body.watch-mode .chat-header {
    padding: 8px;
    gap: 6px;
  }

  body.watch-mode .chat-header h3 {
    font-size: 17px;
  }

  body.watch-mode .side-tabs {
    min-height: 34px;
  }

  body.watch-mode .chat-pane {
    min-height: 0;
    grid-template-rows: minmax(0, 1fr) auto auto;
  }

  body.watch-mode .online-list {
    display: none;
  }

  body.watch-mode .chat-log {
    min-height: 0;
    padding: 10px;
    gap: 10px;
    overflow-y: auto;
  }

  body.watch-mode .chat-form {
    grid-template-columns: minmax(0, 1fr) 46px;
    gap: 6px;
    padding: 8px;
  }

  body.watch-mode .chat-form textarea {
    min-height: 42px;
    max-height: 92px;
    font-size: 16px;
  }

  body.watch-mode .chat-form button[type="submit"],
  body.watch-mode #imageBtn {
    min-width: 42px;
    min-height: 42px;
    padding: 0 8px;
  }

  body.watch-mode .control-panel.collapsed {
    left: 8px;
    right: 8px;
    bottom: 8px;
  }

  body.watch-mode .control-panel.collapsed.netflix-controls .control-panel-header,
  body.watch-mode .control-panel.collapsed .control-panel-header {
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-areas:
      "bar bar"
      "play toggle" !important;
    gap: 6px;
  }

  body.watch-mode .quick-controls {
    display: none !important;
  }

  body.watch-mode #quickPlayBtn,
  body.watch-mode #controlsToggleBtn {
    min-width: 84px;
    height: 34px;
    min-height: 34px;
    font-size: 12px;
  }
}

@media (orientation: portrait) and (max-width: 520px) {
  body.watch-mode .room-grid,
  body.watch-mode .app-view.chat-closed .room-grid {
    grid-template-rows: minmax(160px, 34svh) minmax(0, 1fr) !important;
    padding: 6px;
    gap: 6px;
  }

  body.watch-mode .stage-header h1 {
    font-size: 14px;
  }

  body.watch-mode .header-quit-button,
  body.watch-mode .sidebar-toggle {
    min-height: 30px;
    padding: 0 8px;
    font-size: 12px;
  }
}


.friend-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.expanded-list .friend-actions .status-dot {
  margin-right: 2px;
}

@media (max-width: 700px) {
  .expanded-list .friend-actions {
    grid-column: 2;
    justify-content: flex-start;
    margin-left: 0;
  }
}


/* iOS/iPadOS keyboard repair: use the visible viewport and keep chat attached above the keyboard. */
body.watch-mode.keyboard-open {
  position: fixed;
  inset: var(--visual-offset-top) 0 auto 0;
  width: 100%;
  height: var(--app-height);
  min-height: var(--app-height);
  overflow: hidden;
}

body.watch-mode.keyboard-open .main-stage,
body.watch-mode.keyboard-open .app-view,
body.watch-mode.keyboard-open .app-view.room-focus {
  height: var(--app-height);
  min-height: var(--app-height);
  overflow: hidden;
}

@media (orientation: portrait) and (max-width: 1024px) {
  body.watch-mode.keyboard-open .stage-header {
    display: none;
  }

  body.watch-mode.keyboard-open .room-grid,
  body.watch-mode.keyboard-open .app-view.chat-closed .room-grid {
    height: var(--app-height) !important;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    padding: 6px;
    gap: 0;
    overflow: hidden;
  }

  body.watch-mode.keyboard-open .watch-column {
    display: none !important;
  }

  body.watch-mode.keyboard-open .chat-panel {
    display: grid !important;
    height: 100%;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr) auto auto !important;
    border-radius: 12px 12px 0 0;
  }

  body.watch-mode.keyboard-open .chat-header {
    padding: 8px;
  }

  body.watch-mode.keyboard-open .chat-header h3,
  body.watch-mode.keyboard-open .chat-header span,
  body.watch-mode.keyboard-open .online-list {
    display: none !important;
  }

  body.watch-mode.keyboard-open .side-tabs {
    min-height: 36px;
  }

  body.watch-mode.keyboard-open .chat-pane {
    min-height: 0;
    grid-template-rows: minmax(0, 1fr) auto auto;
  }

  body.watch-mode.keyboard-open .chat-log {
    min-height: 0;
    padding: 8px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.watch-mode.keyboard-open .typing-indicator {
    min-height: 0;
    padding: 2px 8px;
  }

  body.watch-mode.keyboard-open .chat-form {
    position: sticky;
    bottom: 0;
    z-index: 10;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 6px;
    padding: 8px calc(8px + env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) calc(8px + env(safe-area-inset-left));
    background: color-mix(in srgb, var(--panel-soft) 96%, black);
  }

  body.watch-mode.keyboard-open .chat-form textarea {
    min-height: 40px;
    max-height: 88px;
    font-size: 16px;
    line-height: 1.25;
  }

  body.watch-mode.keyboard-open #imageBtn,
  body.watch-mode.keyboard-open .chat-form button[type="submit"] {
    min-width: 40px;
    min-height: 40px;
  }
}


/* Local audio and subtitle controls. Track choices stay local to each browser. */
#localPlayer::cue {
  color: #fff;
  background: rgba(0, 0, 0, 0.82);
  font-family: Inter, Arial, sans-serif;
  font-size: clamp(13px, 1.35vw, 20px);
  font-weight: 650;
  line-height: 1.18;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.95);
}

#localPlayer.subtitle-resetting::cue {
  color: transparent;
  background: transparent;
  text-shadow: none;
}

.partner-invite-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: color-mix(in srgb, var(--bg) 92%, var(--accent) 8%);
}

.partner-invite-shell {
  width: min(560px, 100%);
  padding: clamp(24px, 5vw, 44px);
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 96%, var(--accent) 4%);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  text-align: center;
}

.partner-invite-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 26px;
}

.partner-invite-brand .brand-mark {
  width: 42px;
  height: 42px;
  font-size: 22px;
}

.partner-invite-portrait {
  position: relative;
  width: 104px;
  height: 104px;
  margin: 0 auto 20px;
}

.partner-invite-portrait img {
  width: 100%;
  height: 100%;
  border: 3px solid color-mix(in srgb, var(--accent) 76%, white);
  border-radius: 50%;
  object-fit: cover;
}

.partner-heart {
  position: absolute;
  right: -4px;
  bottom: 2px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 3px solid var(--panel);
  border-radius: 50%;
  background: #e85f8f;
  color: white;
  font-size: 17px;
}

.partner-invite-shell h1 {
  margin-bottom: 12px;
  font-size: clamp(26px, 5vw, 40px);
}

.partner-invite-shell > p:not(.eyebrow):not(.form-message) {
  color: var(--muted);
}

.partner-invite-meta {
  min-height: 24px;
  margin-top: 18px;
  color: var(--text);
  font-size: 13px;
  font-weight: 720;
}

.partner-invite-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 22px;
}

.partner-invite-actions button:only-child {
  grid-column: 1 / -1;
}

.text-button {
  min-height: 36px;
  margin-top: 16px;
  padding: 4px 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.room-access-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, 0.7fr);
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: color-mix(in srgb, var(--panel-soft) 88%, transparent);
}

.room-access-controls > div {
  display: grid;
  align-content: center;
  gap: 3px;
}

.room-access-controls > div span,
.room-type-label {
  color: var(--muted);
  font-size: 12px;
}

.room-access-controls #partnerFriendSelect,
.room-access-controls #roomTypeStatus {
  grid-column: 1 / -1;
}

.room-access-controls #saveRoomTypeBtn {
  grid-column: 2;
}

.room-type-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, var(--panel-soft));
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
}

@media (max-width: 680px) {
  .partner-invite-view {
    padding: 14px;
  }

  .partner-invite-shell {
    padding: 24px 18px;
  }

  .partner-invite-actions,
  .room-access-controls {
    grid-template-columns: 1fr;
  }

  .room-access-controls #saveRoomTypeBtn {
    grid-column: 1;
  }
}

body.watch-mode .control-panel.collapsed.netflix-controls .netflix-left-controls {
  gap: 16px;
}

body.watch-mode .control-panel.collapsed.netflix-controls .media-track-button:not([hidden]) {
  display: inline-grid;
}

body.watch-mode .control-panel.collapsed.netflix-controls .media-track-button {
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  height: 26px;
  min-height: 26px;
  max-height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.94);
  font-size: 10px !important;
  font-weight: 800;
  line-height: 1 !important;
}

body.watch-mode .control-panel.collapsed.netflix-controls .media-track-button:hover:not(:disabled),
body.watch-mode .control-panel.collapsed.netflix-controls .media-track-button:focus-visible {
  border-color: #fff;
  color: #fff;
}

body.watch-mode .control-panel.collapsed.netflix-controls .subtitle-track-button.active {
  border-color: #fff;
  background: #fff;
  color: #11131a;
}

body.watch-mode .control-panel.collapsed.netflix-controls .media-track-button:disabled {
  opacity: 0.45;
}

@media (orientation: portrait) and (max-width: 1024px) {
  body.watch-mode .control-panel.collapsed.netflix-controls .netflix-left-controls {
    gap: 9px;
    max-width: 100%;
  }

  body.watch-mode .control-panel.collapsed.netflix-controls .media-track-button {
    width: 32px;
    min-width: 32px;
    max-width: 32px;
    height: 28px;
    min-height: 28px;
    max-height: 28px;
    font-size: 9px !important;
  }

  body.watch-mode .control-panel.collapsed.netflix-controls .combined-time {
    font-size: 11px;
  }
}

@media (orientation: portrait) and (max-width: 520px) {
  body.watch-mode .control-panel.collapsed.netflix-controls .combined-time {
    display: none;
  }

  #localPlayer::cue {
    font-size: 14px;
    line-height: 1.16;
  }
}
