:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-soft: #fafafc;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --accent: #0066cc;
  --accent-hover: #004f9f;
  --accent-soft: #eaf4ff;
  --accent-border: rgba(0, 102, 204, 0.18);
  --danger: #d92d20;
  --danger-soft: #fff1f0;
  --danger-border: rgba(217, 45, 32, 0.32);
  --danger-hover-soft: #ffe4e1;
  --border: #e0e0e0;
  --border-strong: #c7c7cc;
  --disabled-bg: #f2f2f2;
  --disabled-text: #8e8e93;
  --label: #333333;
  --nav-bg: #000000;
  --on-accent: #ffffff;
  --placeholder: #86868b;
  --radius-card: 18px;
  --radius-control: 999px;
  --shadow-card: none;
  --focus: 0 0 0 3px rgba(0, 113, 227, 0.24);
  --video-bg: #000000;
  --video-border: #252527;
  --overlay-strong: rgba(0, 0, 0, 0.72);
}

html[data-theme="midnight"] {
  color-scheme: dark;
  --bg: #111113;
  --surface: #1d1d1f;
  --surface-soft: #272729;
  --text: #ffffff;
  --muted: #c7c7cc;
  --accent: #2997ff;
  --accent-hover: #6bb6ff;
  --accent-soft: rgba(41, 151, 255, 0.16);
  --accent-border: rgba(41, 151, 255, 0.26);
  --danger: #ff453a;
  --danger-soft: rgba(240, 68, 56, 0.14);
  --danger-border: rgba(255, 69, 58, 0.38);
  --danger-hover-soft: rgba(240, 68, 56, 0.24);
  --border: #3a3a3c;
  --border-strong: #515154;
  --disabled-bg: #2c2c2e;
  --disabled-text: #8e8e93;
  --label: #f5f5f7;
  --nav-bg: #000000;
  --on-accent: #ffffff;
  --placeholder: #8e8e93;
  --shadow-card: none;
  --focus: 0 0 0 3px rgba(41, 151, 255, 0.26);
}

html[data-theme="sakura"] {
  --bg: #FBF7FA;
  --surface: #FFFFFF;
  --surface-soft: #FFF5F8;
  --text: #251926;
  --muted: #745C68;
  --accent: #DB2777;
  --accent-hover: #BE185D;
  --accent-soft: #FDF2F8;
  --accent-border: rgba(219, 39, 119, 0.18);
  --border: #EED8E3;
  --border-strong: #D8B6C8;
  --label: #5E3F50;
  --nav-bg: rgba(255, 255, 255, 0.94);
  --focus: 0 0 0 3px rgba(219, 39, 119, 0.18);
}

html[data-theme="ocean"] {
  --bg: #F3F8FC;
  --surface: #FFFFFF;
  --surface-soft: #F0F8FF;
  --text: #132335;
  --muted: #5C6F83;
  --accent: #0369A1;
  --accent-hover: #075985;
  --accent-soft: #E0F2FE;
  --accent-border: rgba(3, 105, 161, 0.18);
  --border: #D8E8F3;
  --border-strong: #B8D1E4;
  --label: #2D4D68;
  --nav-bg: rgba(255, 255, 255, 0.94);
  --focus: 0 0 0 3px rgba(3, 105, 161, 0.18);
}

html[data-theme="amber"] {
  --bg: #FAF8F3;
  --surface: #FFFFFF;
  --surface-soft: #FFF8EB;
  --text: #251D13;
  --muted: #766555;
  --accent: #B45309;
  --accent-hover: #92400E;
  --accent-soft: #FEF3C7;
  --accent-border: rgba(180, 83, 9, 0.18);
  --border: #EADFCF;
  --border-strong: #D7C2A6;
  --label: #60461F;
  --nav-bg: rgba(255, 255, 255, 0.94);
  --focus: 0 0 0 3px rgba(180, 83, 9, 0.18);
}

html[data-theme="pastel-mint"] {
  --bg: #F1FBF7;
  --surface: #FFFFFF;
  --surface-soft: #ECFDF5;
  --text: #18322B;
  --muted: #60746C;
  --accent: #0F766E;
  --accent-hover: #115E59;
  --accent-soft: #DDFBF1;
  --accent-border: rgba(15, 118, 110, 0.2);
  --border: #D6EEE5;
  --border-strong: #AEDCCF;
  --label: #2D5B50;
  --nav-bg: rgba(255, 255, 255, 0.94);
  --focus: 0 0 0 3px rgba(15, 118, 110, 0.18);
}

html[data-theme="pastel-lavender"] {
  --bg: #F8F6FF;
  --surface: #FFFFFF;
  --surface-soft: #F3F0FF;
  --text: #241F33;
  --muted: #6B627B;
  --accent: #6D28D9;
  --accent-hover: #5B21B6;
  --accent-soft: #EDE9FE;
  --accent-border: rgba(109, 40, 217, 0.18);
  --border: #E2DAF8;
  --border-strong: #C8B8EF;
  --label: #50426A;
  --nav-bg: rgba(255, 255, 255, 0.94);
  --focus: 0 0 0 3px rgba(109, 40, 217, 0.18);
}

html[data-theme="pastel-peach"] {
  --bg: #FFF7F1;
  --surface: #FFFFFF;
  --surface-soft: #FFF1E7;
  --text: #332117;
  --muted: #766559;
  --accent: #C2410C;
  --accent-hover: #9A3412;
  --accent-soft: #FFEDD5;
  --accent-border: rgba(194, 65, 12, 0.18);
  --border: #F2D8C7;
  --border-strong: #E1B99E;
  --label: #684632;
  --nav-bg: rgba(255, 255, 255, 0.94);
  --focus: 0 0 0 3px rgba(194, 65, 12, 0.18);
}

html[data-theme="pastel-sky"] {
  --bg: #F1FAFF;
  --surface: #FFFFFF;
  --surface-soft: #EAF7FF;
  --text: #172A38;
  --muted: #5E7180;
  --accent: #0369A1;
  --accent-hover: #075985;
  --accent-soft: #E0F2FE;
  --accent-border: rgba(3, 105, 161, 0.18);
  --border: #D3EAF7;
  --border-strong: #B1D7ED;
  --label: #315B75;
  --nav-bg: rgba(255, 255, 255, 0.94);
  --focus: 0 0 0 3px rgba(3, 105, 161, 0.18);
}

html[data-theme="pastel-rose"] {
  --bg: #FFF6F9;
  --surface: #FFFFFF;
  --surface-soft: #FFF0F6;
  --text: #321C28;
  --muted: #755D69;
  --accent: #BE185D;
  --accent-hover: #9D174D;
  --accent-soft: #FCE7F3;
  --accent-border: rgba(190, 24, 93, 0.18);
  --border: #F0D4E1;
  --border-strong: #DFAFC6;
  --label: #653A50;
  --nav-bg: rgba(255, 255, 255, 0.94);
  --focus: 0 0 0 3px rgba(190, 24, 93, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="cinema-teal"] body.room-page {
  color-scheme: dark;
  --bg: #111113;
  --surface: #1d1d1f;
  --surface-soft: #272729;
  --text: #ffffff;
  --muted: #c7c7cc;
  --accent: #2997ff;
  --accent-hover: #6bb6ff;
  --accent-soft: rgba(41, 151, 255, 0.16);
  --accent-border: rgba(41, 151, 255, 0.26);
  --danger: #ff453a;
  --danger-soft: rgba(255, 69, 58, 0.14);
  --danger-border: rgba(255, 69, 58, 0.38);
  --danger-hover-soft: rgba(255, 69, 58, 0.22);
  --border: #3a3a3c;
  --border-strong: #515154;
  --disabled-bg: #2c2c2e;
  --disabled-text: #8e8e93;
  --label: #f5f5f7;
  --nav-bg: #000000;
  --on-accent: #ffffff;
  --placeholder: #8e8e93;
  --shadow-card: none;
  --focus: 0 0 0 3px rgba(41, 151, 255, 0.26);
  --video-bg: #000000;
  --video-border: #252527;
}

button,
input,
select {
  font: inherit;
}

button,
.button-link {
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  cursor: pointer;
  display: inline-flex;
  font-size: 14px;
  font-weight: 600;
  height: 44px;
  justify-content: center;
  line-height: 1;
  padding: 0 16px;
  text-decoration: none;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    transform 120ms ease;
  white-space: nowrap;
}

button {
  background: var(--accent);
  color: var(--on-accent);
}

button:hover,
button:focus-visible {
  background: var(--accent-hover);
}

button:active,
.button-link:active {
  transform: scale(0.98);
}

button:focus-visible,
.button-link:focus-visible,
input:focus-visible,
select:focus-visible,
.upload-zone:focus-visible,
.nav-links a:focus-visible,
.action-menu summary:focus-visible {
  box-shadow: var(--focus);
  outline: none;
}

button:disabled {
  background: var(--disabled-bg);
  border-color: var(--border);
  color: var(--disabled-text);
  cursor: not-allowed;
}

button.ghost,
.button-link.ghost {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}

button.ghost:hover,
button.ghost:focus-visible,
.button-link.ghost:hover,
.button-link.ghost:focus-visible {
  background: var(--surface-soft);
  border-color: var(--accent);
  color: var(--accent-hover);
}

button.danger,
.button-link.danger {
  background: var(--danger-soft);
  border-color: var(--danger-border);
  color: var(--danger);
}

button.danger:hover,
button.danger:focus-visible,
.button-link.danger:hover,
.button-link.danger:focus-visible {
  background: var(--danger-hover-soft);
  border-color: var(--danger);
}

input {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  color: var(--text);
  min-height: 44px;
  outline: none;
  padding: 0 13px;
  width: 100%;
}

select {
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) right 15px center / 6px 6px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) right 10px center / 6px 6px no-repeat,
    var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  color: var(--text);
  min-height: 44px;
  outline: none;
  padding: 0 34px 0 13px;
  width: 100%;
}

input::placeholder {
  color: var(--placeholder);
}

input:focus-visible {
  border-color: var(--accent);
}

select:focus-visible {
  border-color: var(--accent);
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

a {
  color: var(--accent);
}

svg {
  display: block;
}

.hidden {
  display: none !important;
}

.app-nav {
  align-items: center;
  background: var(--nav-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  gap: 18px;
  grid-template-columns: auto 1fr auto;
  min-height: 48px;
  padding: 0 max(24px, calc((100vw - 1280px) / 2));
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  align-items: center;
  color: #ffffff;
  display: inline-flex;
  font-size: 15px;
  font-weight: 600;
  gap: 11px;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  background: var(--accent);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  box-shadow: none;
  color: var(--on-accent);
  display: grid;
  flex: 0 0 30px;
  height: 30px;
  place-items: center;
  width: 30px;
}

.brand-logo {
  height: 23px;
  width: 23px;
}

.brand-logo-screen {
  fill: none;
  stroke: currentColor;
  stroke-linejoin: round;
  stroke-width: 2.7;
}

.brand-logo-play,
.brand-logo-dot {
  fill: currentColor;
}

.brand-logo-dot {
  opacity: 0.78;
}

.mobile-nav-toggle {
  display: none;
}

.nav-links {
  align-items: center;
  display: flex;
  gap: 4px;
}

.nav-links a {
  align-items: center;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.72);
  display: inline-flex;
  font-size: 12px;
  font-weight: 400;
  gap: 7px;
  padding: 10px 14px;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a.active,
.nav-links a.room-active-link {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.nav-badge {
  align-items: center;
  background: var(--accent);
  border-radius: 999px;
  color: var(--on-accent);
  display: inline-flex;
  font-size: 11px;
  font-weight: 600;
  height: 20px;
  justify-content: center;
  min-width: 20px;
  padding: 0 6px;
}

.session {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  min-width: 0;
}

#adminEmail {
  background: #1d1d1f;
  border: 1px solid #333333;
  border-radius: var(--radius-control);
  color: #f5f5f7;
  font-size: 12px;
  font-weight: 400;
  max-width: 240px;
  overflow: hidden;
  padding: 9px 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-nav button.ghost,
.app-nav .button-link.ghost {
  background: #1d1d1f;
  border-color: #333333;
  color: #ffffff;
}

.app-nav button.ghost:hover,
.app-nav button.ghost:focus-visible,
.app-nav .button-link.ghost:hover,
.app-nav .button-link.ghost:focus-visible {
  background: #2a2a2c;
  border-color: rgba(255, 255, 255, 0.36);
  color: #ffffff;
}

.settings-wrapper {
  position: relative;
}

.settings-button,
.icon-button {
  flex: 0 0 40px;
  padding: 0;
  width: 40px;
}

.settings-button svg,
.icon-button svg {
  height: 18px;
  width: 18px;
}

.settings-button path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.icon-button path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

.settings-popover {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.16);
  display: grid;
  gap: 16px;
  padding: 16px;
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  width: min(360px, calc(100vw - 32px));
  z-index: 40;
}

.settings-popover-header {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.settings-popover h2,
.settings-popover h3 {
  color: var(--text);
  line-height: 1.2;
}

.settings-popover h2 {
  font-size: 18px;
  font-weight: 600;
}

.settings-popover h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.settings-popover p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin-top: 3px;
}

.theme-options {
  display: grid;
  gap: 8px;
}

.theme-option {
  align-items: center;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  color: var(--text);
  display: grid;
  gap: 11px;
  grid-template-columns: auto minmax(0, 1fr);
  height: auto;
  justify-content: stretch;
  min-height: 54px;
  padding: 10px;
  text-align: left;
  width: 100%;
}

.theme-option:hover,
.theme-option:focus-visible,
.theme-option.selected {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
}

.theme-swatch {
  background: var(--theme-swatch);
  border: 3px solid var(--surface);
  border-radius: 999px;
  box-shadow: 0 0 0 1px var(--border-strong);
  height: 28px;
  width: 28px;
}

.theme-option strong,
.theme-option small {
  display: block;
}

.theme-option strong {
  font-size: 13px;
  font-weight: 600;
}

.theme-option small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
  margin-top: 3px;
}

.shell {
  margin: 0 auto;
  max-width: 1280px;
  padding: 48px 24px;
  width: 100%;
}

.app-main {
  display: grid;
  gap: 20px;
}

.page-header {
  align-items: end;
  display: flex;
  justify-content: space-between;
}

.page-header h1 {
  color: var(--text);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.08;
}

.page-header p,
.section-heading p,
.login-panel p,
.empty,
.muted {
  color: var(--muted);
}

.page-header p {
  font-size: 15px;
  line-height: 1.55;
  margin-top: 8px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.login-panel {
  display: grid;
  gap: 26px;
  grid-template-columns: minmax(220px, 0.8fr) minmax(280px, 1.2fr);
  max-width: 800px;
  padding: 26px;
}

.login-panel h2,
.section-heading h2 {
  color: var(--text);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 6px;
}

.form-grid {
  display: grid;
  gap: 14px;
}

label {
  color: var(--label);
  display: grid;
  font-size: 13px;
  font-weight: 600;
  gap: 8px;
}

.field-help {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}

.workspace {
  display: grid;
  gap: 18px;
}

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

.dashboard-card {
  display: grid;
  gap: 8px;
  min-height: 160px;
  padding: 18px;
}

.dashboard-card strong {
  color: var(--text);
  display: block;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.05;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.dashboard-link {
  align-self: end;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.dashboard-link:hover,
.dashboard-link:focus-visible {
  color: var(--accent-hover);
}

.dashboard-action {
  align-self: end;
  justify-self: start;
}

.dashboard-activity-card {
  grid-column: span 2;
}

.admin-event-list {
  display: grid;
  gap: 8px;
}

.admin-event-list p {
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  padding-bottom: 8px;
}

.main-layout {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
}

.search-panel,
.room-panel,
.storage-panel {
  padding: 20px;
}

.section-heading {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.room-panel-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.room-panel-actions select {
  min-width: 160px;
}

.storage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.search-row {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 16px;
}

.result-list,
.room-list,
.storage-list {
  display: grid;
  gap: 12px;
}

.empty-state {
  align-items: center;
  background: var(--surface-soft);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-card);
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 38px 24px;
  text-align: center;
}

.empty-state.compact {
  padding: 24px 18px;
}

.empty-state svg {
  color: var(--accent);
  height: 34px;
  width: 34px;
}

.empty-state svg path,
.upload-icon svg path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.empty-state strong {
  color: var(--text);
  font-size: 16px;
}

.empty-state p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  max-width: 440px;
}

.movie-row {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  display: grid;
  gap: 14px;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  padding: 12px;
}

.movie-poster {
  align-items: center;
  aspect-ratio: 2 / 3;
  background: var(--accent-soft);
  border: 1px solid rgba(0, 102, 204, 0.18);
  border-radius: 12px;
  color: var(--accent);
  display: flex;
  font-size: 22px;
  font-weight: 600;
  justify-content: center;
  overflow: hidden;
}

.movie-poster img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.movie-content {
  min-width: 0;
}

.movie-title-row {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-bottom: 6px;
  min-width: 0;
}

.movie-title-row h3 {
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.movie-year,
.status-badge {
  background: var(--accent-soft);
  border: 1px solid rgba(0, 102, 204, 0.18);
  border-radius: 999px;
  color: var(--accent-hover);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 6px 8px;
  white-space: nowrap;
}

.movie-overview {
  color: var(--muted);
  display: -webkit-box;
  font-size: 14px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.meta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.meta-list span {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 8px;
}

.room-card,
.created-room,
.storage-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.room-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.room-card-header {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.room-card h3,
.storage-copy h3 {
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-card-header p,
.room-empty {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.invite-line {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  color: var(--muted);
  font-size: 13px;
  min-width: 0;
  padding: 10px 12px;
}

.invite-line span,
.created-room-actions span,
.storage-copy h3 {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-actions {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}

.created-room {
  background: var(--accent-soft);
  border-color: rgba(0, 102, 204, 0.18);
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 14px;
}

.created-room strong {
  color: var(--accent-hover);
}

.created-room p {
  color: var(--text);
  font-weight: 600;
  margin-top: 4px;
}

.created-room-actions {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.created-room-actions span {
  color: var(--muted);
  font-size: 13px;
}

.request-list {
  border-top: 1px solid var(--border);
  display: grid;
  gap: 10px;
  padding-top: 12px;
}

.request-list h4 {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.request-row {
  align-items: center;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px;
}

.request-name {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.request-email {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-actions {
  display: flex;
  gap: 8px;
}

.action-menu {
  position: relative;
}

.action-menu summary {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  gap: 3px;
  height: 40px;
  justify-content: center;
  list-style: none;
  width: 40px;
}

.action-menu summary::-webkit-details-marker {
  display: none;
}

.action-menu summary span {
  background: currentColor;
  border-radius: 999px;
  height: 4px;
  width: 4px;
}

.action-menu-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  box-shadow: none;
  min-width: 160px;
  padding: 6px;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 5;
}

.menu-button {
  justify-content: flex-start;
  width: 100%;
}

.storage-overview {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  margin-bottom: 16px;
  padding: 16px;
}

.storage-summary {
  display: grid;
  gap: 14px;
}

.storage-summary-main {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.eyebrow,
.storage-facts span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.storage-summary-main strong {
  color: var(--text);
  display: block;
  font-size: 20px;
  font-weight: 600;
  margin-top: 4px;
}

.storage-summary-main > span {
  color: var(--accent-hover);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.storage-progress {
  background: #EAECF0;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.storage-progress span {
  background: var(--accent);
  border-radius: inherit;
  display: block;
  height: 100%;
}

.storage-facts {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.storage-facts div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  padding: 12px;
}

.storage-facts strong {
  color: var(--text);
  display: block;
  font-size: 15px;
  font-weight: 600;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
}

.upload-zone {
  align-items: center;
  background: var(--surface-soft);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-card);
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 8px;
  justify-items: center;
  min-height: 154px;
  padding: 26px;
  text-align: center;
}

.upload-zone.drag-over,
.upload-zone:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.upload-icon {
  align-items: center;
  background: var(--accent-soft);
  border: 1px solid rgba(0, 102, 204, 0.18);
  border-radius: 999px;
  color: var(--accent);
  display: flex;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.upload-icon svg {
  height: 22px;
  width: 22px;
}

.upload-zone strong {
  font-size: 17px;
  font-weight: 600;
}

.upload-zone span {
  color: var(--muted);
  font-size: 14px;
}

.upload-detail {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  display: grid;
  gap: 10px;
  padding: 12px;
}

.upload-file-row {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.upload-file-row strong {
  color: var(--text);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-file-row span,
.upload-progress-text {
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin-top: 3px;
}

.progress-track {
  background: #EAECF0;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.progress-bar {
  background: var(--accent);
  border-radius: inherit;
  height: 100%;
  transition: width 160ms ease;
  width: 0%;
}

.upload-controls {
  display: flex;
  justify-content: flex-end;
}

.storage-toolbar {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) 180px;
  margin-bottom: 14px;
}

.storage-row {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  padding: 12px;
}

.storage-thumb {
  align-items: center;
  background: var(--accent-soft);
  border: 1px solid rgba(0, 102, 204, 0.18);
  border-radius: 12px;
  color: var(--accent);
  display: flex;
  font-size: 18px;
  font-weight: 600;
  height: 56px;
  justify-content: center;
  overflow: hidden;
  width: 56px;
}

.storage-thumb img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

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

.storage-copy p {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 8px;
  margin-top: 6px;
}

.status {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  min-height: 22px;
}

.status.error {
  color: var(--danger);
}

.confirm-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: none;
  color: var(--text);
  max-width: min(440px, calc(100vw - 32px));
  padding: 0;
  width: 100%;
}

.confirm-dialog::backdrop {
  background: rgba(23, 32, 51, 0.28);
}

.confirm-dialog form {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.confirm-dialog h2 {
  font-size: 20px;
  font-weight: 600;
}

.confirm-dialog p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.friend-room-shell {
  gap: 18px;
}

.room-session {
  justify-self: end;
}

.room-access-card,
.room-wait-card {
  align-items: center;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 0.95fr) minmax(280px, 1.05fr);
  margin: 10px auto 0;
  max-width: 860px;
  padding: 28px;
  width: 100%;
}

.room-wait-card {
  grid-template-columns: minmax(0, 1fr) auto;
}

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

.room-access-copy h2,
.room-meta-card h2,
.sync-status-card h2 {
  color: var(--text);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 600;
  line-height: 1.1;
}

.room-access-copy p,
.room-meta-card p,
.sync-status-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.room-state-label {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.room-note-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.room-note-list span {
  background: var(--accent-soft);
  border: 1px solid rgba(0, 102, 204, 0.18);
  border-radius: 999px;
  color: var(--accent-hover);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 10px;
}

.friend-watch-layout {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
}

.friend-watch-stage {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.friend-watch-screen {
  aspect-ratio: 16 / 9;
  background: var(--video-bg);
  border: 1px solid var(--video-border);
  border-radius: var(--radius-card);
  box-shadow: none;
  min-height: clamp(260px, 36vw, 430px);
  min-width: 0;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.movie-video {
  background: var(--video-bg);
  height: 100%;
  inset: 0;
  object-fit: contain;
  position: absolute;
  width: 100%;
}

.video-fallback {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-card);
  box-shadow: none;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 16px 18px;
}

.video-fallback.overlay-compact {
  background: var(--surface-soft);
}

.watch-header-copy {
  min-width: 0;
}

#watchEyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.watch-header h2 {
  color: var(--text);
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.08;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#streamStatusText {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  margin-top: 8px;
}

.playback-readout {
  align-items: baseline;
  background: var(--accent-soft);
  border: 1px solid rgba(0, 102, 204, 0.18);
  border-radius: var(--radius-control);
  color: var(--text);
  display: flex;
  gap: 10px;
  justify-self: end;
  min-height: 42px;
  padding: 10px 14px;
  white-space: nowrap;
}

.playback-readout span {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.friend-watch-controls {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: none;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.playback-control-row,
.room-utility-row {
  align-items: start;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.playback-control-row {
  align-items: end;
  grid-template-columns:
    minmax(72px, max-content)
    minmax(82px, max-content)
    minmax(70px, max-content)
    minmax(180px, 1fr)
    minmax(70px, max-content);
}

.playback-control-row > button {
  align-self: start;
  margin-top: 25px;
}

.room-utility-row {
  align-items: end;
  grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
  justify-content: stretch;
}

.room-utility-actions {
  align-items: end;
  align-self: end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 0;
}

.friend-watch-controls .seek-field,
.friend-watch-controls .subtitle-field {
  min-width: 0;
}

.subtitle-field {
  color: var(--text);
  display: grid;
  font-size: 0.82rem;
  font-weight: 800;
  gap: 6px;
  min-width: 160px;
}

.subtitle-field select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font: inherit;
  min-height: 40px;
  padding: 0 12px;
}

.subtitle-field select:disabled {
  background: var(--surface);
  color: var(--muted);
}

.countdown-overlay {
  align-items: center;
  background: rgba(23, 32, 51, 0.74);
  color: #FFFFFF;
  display: grid;
  gap: 8px;
  inset: 0;
  justify-items: center;
  place-content: center;
  position: absolute;
  text-align: center;
  z-index: 4;
}

.countdown-overlay span {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
}

.countdown-overlay strong {
  font-size: clamp(64px, 12vw, 120px);
  font-variant-numeric: tabular-nums;
  line-height: 0.9;
}

.watch-party-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: none;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.watch-party-actions,
.reaction-list,
.shortcut-hint,
.room-chat-form {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.watch-party-actions {
  justify-content: space-between;
}

.shortcut-hint {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  color: var(--muted);
  font-size: 13px;
  padding: 10px 12px;
}

.shortcut-hint span {
  color: var(--text);
  font-weight: 600;
}

.shortcut-hint strong {
  background: var(--accent-soft);
  border: 1px solid rgba(0, 102, 204, 0.2);
  border-radius: 7px;
  color: var(--accent-hover);
  font-size: 12px;
  min-width: 26px;
  padding: 4px 7px;
  text-align: center;
}

.reaction-list {
  align-items: stretch;
}

.reaction-button {
  min-width: 96px;
}

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

.room-chat-form label {
  min-width: 0;
}

.fun-status {
  color: var(--muted);
  font-size: 13px;
  min-height: 18px;
}

.fun-status.error {
  color: var(--danger);
}

.stream-recovery {
  align-items: center;
  background: var(--danger-soft);
  border: 1px solid rgba(217, 45, 32, 0.24);
  border-radius: var(--radius-card);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 14px;
}

.stream-recovery strong {
  color: var(--text);
  display: block;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.stream-recovery p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.stream-recovery-actions {
  display: flex;
  gap: 8px;
}

.seek-field {
  min-width: 0;
}

.friend-watch-sidebar {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.side-panel {
  padding: 18px;
}

.side-panel h2 {
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
}

.room-meta-card,
.sync-status-card {
  display: grid;
  gap: 16px;
}

.room-meta-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.room-meta-list div {
  align-items: center;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 12px;
}

.room-meta-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.room-meta-list dd {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-status-card {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
}

.sync-status-error {
  border-left-color: var(--danger);
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.viewer-pill {
  background: var(--accent-soft);
  border: 1px solid rgba(0, 102, 204, 0.18);
  border-radius: 999px;
  color: var(--accent-hover);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 10px;
}

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

.activity-list p {
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  padding-bottom: 10px;
}

@media (max-width: 1180px) {
  .friend-watch-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 900px) {
  .main-layout {
    grid-template-columns: 1fr;
  }

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

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

  .dashboard-activity-card {
    grid-column: span 2;
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 22px 16px;
  }

  .app-nav {
    padding: 0 16px;
  }

  .login-panel,
  .movie-row,
  .search-row,
  .storage-toolbar {
    grid-template-columns: 1fr;
  }

  .movie-row > button,
  .search-row > button,
  .upload-controls > button {
    width: 100%;
  }

  .movie-poster {
    width: 72px;
  }

  .section-heading,
  .page-header {
    align-items: stretch;
    display: grid;
  }

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

  .room-panel-actions {
    display: grid;
  }

  .storage-actions button {
    flex: 1;
  }
}

@media (max-width: 600px) {
  button,
  .button-link,
  input,
  select {
    min-height: 44px;
  }

  .app-nav {
    gap: 12px;
    grid-template-columns: 1fr auto;
    min-height: 64px;
  }

  .mobile-nav-toggle {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    color: var(--text);
    display: inline-flex;
    gap: 5px;
    padding: 0 12px;
  }

  .menu-bars {
    display: grid;
    gap: 3px;
  }

  .menu-bars span {
    background: currentColor;
    border-radius: 999px;
    display: block;
    height: 2px;
    width: 12px;
  }

  .nav-links {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: none;
    display: none;
    gap: 4px;
    grid-column: 1 / -1;
    padding: 8px;
  }

  body.nav-open .nav-links {
    display: grid;
  }

  .nav-links a {
    border-radius: var(--radius-control);
    padding: 12px;
  }

  .session {
    grid-column: 1 / -1;
    justify-content: space-between;
  }

  .settings-popover {
    position: fixed;
    right: 16px;
    top: 72px;
    width: calc(100vw - 32px);
  }

  #adminEmail {
    max-width: min(230px, 58vw);
  }

  .search-panel,
  .room-panel,
  .storage-panel,
  .login-panel,
  .room-access-card,
  .room-wait-card {
    padding: 16px;
  }

  .room-actions,
  .created-room-actions,
  .confirm-actions,
  .request-row,
  .request-actions,
  .room-access-card,
  .room-wait-card,
  .stream-recovery,
  .friend-watch-sidebar,
  .upload-file-row,
  .storage-row {
    grid-template-columns: 1fr;
  }

  .playback-control-row,
  .room-utility-row,
  .room-utility-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .playback-control-row > button,
  .room-utility-actions {
    margin-top: 0;
    padding-top: 0;
  }

  .watch-party-actions,
  .reaction-list,
  .room-chat-form {
    display: grid;
    grid-template-columns: 1fr;
  }

  .room-actions button,
  .room-actions .button-link,
  .confirm-actions button,
  .request-actions button,
  .created-room-actions button,
  .room-access-card button,
  .room-wait-card button,
  .friend-watch-controls button,
  .watch-party-actions button,
  .reaction-list button,
  .room-chat-form button,
  .stream-recovery-actions,
  .stream-recovery-actions button,
  .upload-file-row button {
    width: 100%;
  }

  .action-menu,
  .action-menu summary,
  .action-menu-panel {
    width: 100%;
  }

  .action-menu-panel {
    position: static;
    margin-top: 6px;
  }

  .storage-facts {
    grid-template-columns: 1fr;
  }

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

  .dashboard-activity-card {
    grid-column: span 1;
  }

  .stream-recovery-actions {
    display: grid;
  }

  .friend-watch-screen {
    min-height: 0;
  }

  .video-fallback {
    align-items: stretch;
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .playback-readout {
    justify-content: space-between;
    justify-self: stretch;
    width: 100%;
  }
}
