:root {
  --bg: #050818;
  --panel: rgba(255,255,255,0.06);
  --panel-2: rgba(255,255,255,0.04);
  --text: #f7f7fa;
  --muted: rgba(247,247,250,0.6);
  --accent: #818cf8;
  --accent-2: #c084fc;
  --accent-pink: #d946ef;
  --accent-ink: #0a0a1a;
  --accent-gradient: linear-gradient(96deg, #6366f1 0%, #a855f7 100%);
  --accent-gradient-soft: linear-gradient(96deg, rgba(99,102,241,0.18), rgba(168,85,247,0.18));
  --p1: #6aa6ff;
  --p2: #ff7ab6;
  --both: #74e0a2;
  --danger: #ff6b6b;
  --imdb: #f5c518;
  --radius: 14px;
  --radius-sm: 14px;
  --radius-xs: 10px;
  --glass-bg: rgba(255,255,255,0.06);
  --glass-bg-strong: rgba(255,255,255,0.09);
  --glass-border: 1px solid rgba(255,255,255,0.12);
  --glass-border-strong: 1px solid rgba(255,255,255,0.18);
  --glass-blur: blur(24px) saturate(160%);
  --ring-accent: 0 0 0 3px rgba(168,85,247,0.24);
  --ring-blue: 0 0 0 3px rgba(99,102,241,0.24);
  --shadow-panel: 0 24px 64px rgba(0,0,0,0.32), 0 1px 0 rgba(255,255,255,0.06) inset;
  --shadow-btn: 0 12px 28px rgba(124,58,237,0.36), 0 1px 0 rgba(255,255,255,0.22) inset;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(1100px 700px at -10% -10%, #4c1d95 0%, transparent 55%),
    radial-gradient(1000px 600px at 110% 10%, #312e81 0%, transparent 50%),
    radial-gradient(900px 500px at 60% 95%, #6d28d9 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-feature-settings: "cv11", "ss01", "ss03";
  letter-spacing: -0.005em;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.hidden { display: none !important; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  flex-direction: column;
  padding: calc(env(safe-area-inset-top) + 16px) 16px 8px;
  gap: 10px;
  position: relative;
  z-index: 100;
}
.topbar-main, .navbar {
  background: var(--glass-bg);
  border: var(--glass-border);
  border-radius: var(--radius);
  padding: 12px 16px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.topbar-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.015em;
  background: linear-gradient(180deg, #fff 0%, rgba(255,255,255,0.7) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand .logo { display: inline-flex; align-items: center; }
.brand .logo svg { display: block; }
.brand-text { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.brand-text h1 { line-height: 1.1; }
.tagline {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.005em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.version {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 10px;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.05);
  white-space: nowrap;
}
.version:empty { display: none; }
.version:hover { background: rgba(255,255,255,0.12); color: var(--text); }

.navbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.navbar .who {
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  font-weight: 500;
  margin-right: 4px;
}

#app {
  max-width: 1080px;
  margin: 18px auto 64px;
  padding: 0 16px;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}

/* ---------- Panels / steps ---------- */
.step, .panel, .dashboard > section {
  background: var(--glass-bg);
  border: var(--glass-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-panel);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.step h2, .dashboard h2 {
  margin: 0 0 14px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #fff 0%, rgba(255,255,255,0.65) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.step h3 {
  margin: 20px 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: rgba(255,255,255,0.92);
  letter-spacing: -0.01em;
}
.hint { color: var(--muted); margin: 6px 0; }

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -3px;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hero { margin-bottom: 18px; }
.hero h2 { margin-bottom: 4px; }

.dashboard { display: grid; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.panel-head h3 { margin: 0; font-size: 16px; }

/* ---------- Forms ---------- */
.auth-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.tab {
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.auth-form input,
.auth-form textarea,
.row-form input,
#seen-search {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.auth-form textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.45;
}
.auth-form input::placeholder,
.auth-form textarea::placeholder,
.row-form input::placeholder,
#seen-search::placeholder { color: rgba(255,255,255,0.4); }
.auth-form input:focus,
.auth-form textarea:focus,
.row-form input:focus,
#seen-search:focus {
  border-color: rgba(129,140,248,0.7);
  background: rgba(255,255,255,0.08);
  box-shadow: var(--ring-blue);
}
.form-error {
  color: var(--danger);
  font-size: 13px;
  min-height: 16px;
  margin: 0;
}
.form-status {
  color: var(--both);
  font-size: 13px;
  margin: 10px 0 0;
}

.row-form {
  display: flex;
  gap: 8px;
  align-items: center;
}
.row-form input { flex: 1; }

/* ---------- Buttons ---------- */
button {
  font-family: inherit;
  font-size: 14px;
  padding: 11px 18px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, transform 0.06s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
button:active { transform: translateY(1px); }
button.primary {
  background: var(--accent-gradient);
  color: #fff;
  font-weight: 700;
  border: 0;
  box-shadow: var(--shadow-btn);
}
@media (hover: hover) {
  button.primary:hover { filter: brightness(1.08); }
  button.ghost:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.22); }
  button.danger:hover { background: rgba(255,107,107,0.14); }
}
button.primary:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
button.ghost {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border-color: rgba(255,255,255,0.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
button.small { padding: 7px 12px; font-size: 12.5px; }
button.danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(255,107,107,0.4);
}

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

.back-link { margin-bottom: 10px; }

/* ---------- Chips ---------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  padding: 7px 13px;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  .chip:hover {
    border-color: rgba(255,255,255,0.22);
    background: rgba(255,255,255,0.1);
  }
}
.chip.selected {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}

/* ---------- Connection rows ---------- */
.conn-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.1);
  margin-top: 8px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.conn-row .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--p1), var(--p2));
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  color: #0f1115;
}
.conn-row .who-info { flex: 1; min-width: 0; }
.conn-row .who-name { font-weight: 600; font-size: 14px; }
.conn-row .who-handle { color: var(--muted); font-size: 12px; }
.conn-row .conn-actions { display: flex; gap: 6px; }
.empty {
  text-align: center;
  padding: 18px;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- Seen list ---------- */
.seen-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 10px;
  flex-wrap: wrap;
}
.seen-controls #seen-search { flex: 1; min-width: 240px; }
.seen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
  max-height: 460px;
  overflow-y: auto;
  padding-right: 6px;
}
.seen-row {
  display: flex;
  align-items: stretch;
  gap: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 12px;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.seen-row .search-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.seen-row .search-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}
.seen-row .search-title .year { color: var(--muted); font-size: 13px; font-weight: 400; }
.seen-row .search-rating {
  display: inline-block;
  color: var(--imdb);
  font-size: 12.5px;
  font-weight: 700;
  margin-left: 6px;
  vertical-align: 1px;
  white-space: nowrap;
}
.seen-row .search-blurb {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: #c2c8d4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mode-toggle {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.mode-option {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@media (hover: hover) {
  .mode-option:hover { border-color: rgba(255,255,255,0.22); background: rgba(255,255,255,0.08); }
}
.mode-option.active {
  background: var(--accent-gradient-soft);
  border-color: rgba(168,85,247,0.45);
  box-shadow: 0 0 0 1px rgba(168,85,247,0.28) inset;
}
.mode-option .mode-label { font-weight: 600; font-size: 14px; letter-spacing: -0.005em; }
.mode-option .mode-sublabel { color: rgba(255,255,255,0.55); font-size: 12.5px; line-height: 1.35; }
.mode-option.active .mode-sublabel { color: rgba(255,255,255,0.78); }
.other-mode {
  margin: -8px 0 16px;
  font-size: 13px;
}

.load-more {
  display: block;
  margin: 20px auto 0;
  min-width: 200px;
}
.load-more.hidden { display: none; }
.load-more:disabled { opacity: 0.6; cursor: wait; }

.seen-by-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 2px;
}
.seen-by {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.78);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  padding: 3px 10px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.seeds-header {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
  padding-left: 2px;
}

.seen-row .search-poster {
  width: 80px;
  align-self: stretch;
  object-fit: cover;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.seen-row .search-poster.placeholder { display: inline-block; }
.seen-row .mini-rate {
  display: inline-flex;
  gap: 8px;
  margin-top: 4px;
}
.mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.05);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.mini-btn { -webkit-tap-highlight-color: transparent; }
@media (hover: hover) {
  .mini-btn:hover { background: rgba(255,255,255,0.05); }
}
.mini-like.on {
  background: rgba(116,224,162,0.2);
  border-color: var(--both);
}
.mini-seen.on {
  background: rgba(245,197,24,0.2);
  border-color: var(--imdb);
}
.mini-dislike.on {
  background: rgba(255,107,107,0.2);
  border-color: var(--danger);
}

/* ---------- Recommendation cards ---------- */
.results {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  max-width: 560px;
  margin: 0 auto;
}
.card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
@media (hover: hover) {
  .card:hover {
    transform: translateY(-3px);
    border-color: rgba(255,255,255,0.22);
    box-shadow: 0 16px 36px rgba(0,0,0,0.32);
  }
}
.card .poster {
  aspect-ratio: 2 / 3;
  width: 100%;
  display: block;
  background: #000;
  object-fit: cover;
}
.card .card-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.card .row1 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.card h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
}
.card .year { color: var(--muted); font-size: 12px; }
.card .imdb {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(245,197,24,0.16);
  border: 1px solid rgba(245,197,24,0.3);
  color: var(--imdb);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.card .badges { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.card .mpaa {
  font-size: 10.5px;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.18);
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}
.card .blurb {
  color: #cdd2dc;
  font-size: 13px;
  line-height: 1.4;
  margin: 4px 0 0;
}
.card .genres {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: auto;
  padding-top: 8px;
}
.card .genre {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 2px 8px;
  border-radius: 999px;
}
.card .genre.match-both { color: #aef1c8; border-color: rgba(116,224,162,0.5); }
.card .genre.match-me   { color: #cfe1ff; border-color: rgba(106,166,255,0.5); }
.card .genre.match-them { color: #ffd0e3; border-color: rgba(255,122,182,0.5); }
/* Group view: a genre everyone shares vs. only some members. */
.card .genre.match-all  { color: #aef1c8; border-color: rgba(116,224,162,0.5); }
.card .genre.match-some { color: #cfe1ff; border-color: rgba(106,166,255,0.35); }
.chip.active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}
.group-section-title { margin: 18px 0 8px; font-size: 14px; color: var(--muted); }
.group-editor { margin-top: 12px; }
.group-editor .group-name-input {
  width: 100%; margin: 8px 0; padding: 9px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px; color: inherit; font-size: 14px;
}
.group-member-chips { margin: 8px 0; }
.pref-select {
  width: 100%; max-width: 420px; margin: 4px 0 8px; padding: 9px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px; color: inherit; font-size: 14px;
}
.pref-select option, .pref-select optgroup { color: #111; }
.group-fit { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.want-pill {
  display: inline-block; margin-right: 6px; padding: 2px 8px;
  border-radius: 999px; font-size: 11px; font-weight: 600;
  color: #ffe9b3; background: rgba(255,196,84,0.16);
  border: 1px solid rgba(255,196,84,0.4);
}
.rating-roundup { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.roundup-row {
  font-size: 12px; color: var(--muted);
  padding: 6px 10px; border-radius: 8px;
  background: rgba(255,255,255,0.04);
}

.rate-row {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.rate-btn {
  flex: 1;
  padding: 8px 6px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.88);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.rate-btn { -webkit-tap-highlight-color: transparent; }
@media (hover: hover) {
  .rate-btn:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.22); }
}

.rate-btn.active { font-weight: 700; color: #fff; }
.rate-btn[data-rate="want"].active {
  background: var(--accent-gradient);
  border-color: transparent;
}
.rate-btn[data-rate="avoid"].active {
  background: rgba(255,107,107,0.22);
  border-color: var(--danger);
  color: #ffd6d6;
}
.rate-btn[data-rate="like"].active {
  background: rgba(116,224,162,0.2);
  border-color: var(--both);
  color: #b8f1ce;
}
.rate-btn[data-rate="seen"].active {
  background: rgba(245,197,24,0.2);
  border-color: var(--imdb);
  color: #ffe9a2;
}
.rate-btn[data-rate="dislike"].active {
  background: rgba(255,107,107,0.2);
  border-color: var(--danger);
  color: #ffd6d6;
}

.rate-row-intent { margin-bottom: 6px; }
.rate-row-intent + .rate-row {
  padding-top: 0;
  border-top: 0;
}
.rate-row.dimmed .rate-btn {
  opacity: 0.45;
  transition: opacity 0.15s ease;
}
.rate-row.dimmed .rate-btn.active { opacity: 1; }

.rate-icon {
  display: inline-block;
  font-weight: 700;
  font-size: 1.05em;
  line-height: 1;
}
.rate-icon.up    { color: var(--both); }
.rate-icon.dash  { color: var(--imdb); }
.rate-icon.down  { color: var(--danger); }
.rate-icon.want  { color: var(--accent); }
.rate-icon.avoid { color: var(--danger); }

.card.rating-in-flight { opacity: 0.55; pointer-events: none; }
.card.rating-dismissed {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20,20,30,0.78);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  font-size: 14px;
  font-weight: 500;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  z-index: 100;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  max-width: calc(100% - 32px);
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}
.toast.error { border-color: rgba(255,107,107,0.5); color: #ffd6d6; }

/* ---------- Mobile tuning ---------- */
@media (max-width: 560px) {
  .topbar { padding-left: 16px; padding-right: 16px; }
  .brand h1 { font-size: 18px; }
  .navbar .who {
    margin: 0 4px 0 auto;
    font-size: 13px;
  }
  .step, .panel, .dashboard > section { padding: 18px 16px; }
  .step h2, .dashboard h2 { font-size: 19px; }
  .chip { padding: 7px 11px; font-size: 13px; }
  .seen-row { padding: 10px; gap: 10px; }
  .seen-row .search-poster { width: 64px; }
  .seen-row .search-title { font-size: 14px; }
  .seen-row .search-blurb { font-size: 12px; -webkit-line-clamp: 4; }
  .conn-row { flex-wrap: wrap; }
  .conn-row .conn-actions { flex-basis: 100%; justify-content: flex-end; }
  .actions { flex-direction: column-reverse; }
  .actions button { width: 100%; }
  .results { gap: 12px; }
  .card h3 { font-size: 14px; }
}

/* ---------- Movie detail page ---------- */
.movie-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.movie-page .back-link { align-self: flex-start; }

.movie-hero {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  isolation: isolate;
  box-shadow: var(--shadow-panel);
}
.movie-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(24px) saturate(140%);
  opacity: 0.55;
  transform: scale(1.15);
  z-index: -1;
}
.movie-backdrop::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(5,8,24,0.2) 0%, rgba(5,8,24,0.85) 100%);
}
.movie-hero-inner {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 18px;
  padding: 20px;
  align-items: start;
}
.movie-poster {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04);
  box-shadow: 0 16px 36px rgba(0,0,0,0.4);
}
.movie-meta h1 {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #fff;
}
.movie-tagline {
  margin: 0 0 12px;
  font-style: italic;
  color: rgba(255,255,255,0.65);
  font-size: 14px;
  line-height: 1.35;
}
.movie-tagline:empty { display: none; }
.movie-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.movie-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.movie-pill.imdb { color: var(--imdb); border-color: rgba(245,197,24,0.4); background: rgba(245,197,24,0.16); }
.movie-rate-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.movie-rate-row .rate-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.movie-rate-row .rate-btn { flex: 0 1 auto; padding: 8px 16px; font-size: 13px; }
.movie-rate-section h3 { margin-bottom: 14px; }

@media (max-width: 540px) {
  .movie-hero-inner { grid-template-columns: 100px 1fr; padding: 16px; }
  .movie-meta h1 { font-size: 22px; }
}

.movie-section {
  background: var(--glass-bg);
  border: var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-panel);
}
.movie-section h3 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
}
.movie-overview {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: rgba(255,255,255,0.9);
}
.movie-director, .movie-cast {
  margin: 14px 0 0;
  font-size: 13px;
  color: rgba(255,255,255,0.65);
}
.movie-director:empty, .movie-cast:empty { display: none; }
.movie-director strong, .movie-cast strong {
  color: rgba(255,255,255,0.85);
  font-weight: 600;
  margin-right: 4px;
}

.providers-group { margin-bottom: 12px; }
.providers-group:last-child { margin-bottom: 0; }
.providers-group .label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-bottom: 8px;
}
.providers-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.provider {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  font-size: 13px;
  color: rgba(255,255,255,0.9);
}
.provider img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: cover;
  background: rgba(255,255,255,0.08);
}
.providers-empty {
  color: rgba(255,255,255,0.55);
  font-size: 14px;
  margin: 0;
}
.providers-link {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  border-bottom: 1px dashed rgba(255,255,255,0.3);
}
.providers-link:hover { color: #fff; }
.providers-region {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-bottom: 12px;
}
.providers-attribution {
  margin: 14px 0 0;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}

.rationale-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rationale-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(255,255,255,0.9);
}
.rationale-list li::before {
  content: "";
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-gradient);
  margin-top: 7px;
  box-shadow: 0 0 0 3px rgba(168,85,247,0.18);
}
.rationale-empty {
  color: rgba(255,255,255,0.55);
  font-size: 14px;
  margin: 0;
}

/* ---------- Auth: forgot password ---------- */
.auth-forgot {
  margin: 0;
  font-size: 13px;
  text-align: center;
}
.auth-forgot a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  border-bottom: 1px dashed rgba(255,255,255,0.25);
}
.auth-forgot a:hover { color: #fff; }
.auth-forgot-hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-gradient-soft);
  border: 1px solid rgba(168,85,247,0.3);
  color: rgba(255,255,255,0.9);
}

/* ---------- Preferences: change password ---------- */
.change-password-form {
  margin-top: 12px;
  gap: 10px;
}
.change-password-form .actions { margin-top: 4px; justify-content: flex-start; }

/* ---------- Admin page ---------- */
.admin-users {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}
.admin-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.admin-user-main { flex: 1 1 240px; min-width: 0; }
.admin-user-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 4px;
}
.admin-user-name .muted {
  color: rgba(255,255,255,0.5);
  font-weight: 400;
  font-size: 13px;
  margin-left: 4px;
}
.admin-user-meta {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  margin-bottom: 6px;
}
.admin-user-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.admin-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-gradient);
  color: #fff;
}
.admin-badge.you { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.85); }
.admin-user-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ---------- Feedback page ---------- */
.kind-toggle {
  display: flex;
  gap: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  padding: 4px;
  width: fit-content;
}
.kind-btn {
  background: transparent;
  border: 0;
  color: rgba(255,255,255,0.7);
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.kind-btn.active {
  background: var(--accent-gradient);
  color: #fff;
  font-weight: 600;
}

.feedback-section { margin-top: 18px; }
.feedback-section h3 {
  margin: 20px 0 12px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
}
.feedback-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.feedback-item {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.feedback-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  margin-bottom: 8px;
}
.feedback-kind, .feedback-status {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.feedback-kind-bug { background: rgba(255,107,107,0.16); color: #ffb0b0; border: 1px solid rgba(255,107,107,0.32); }
.feedback-kind-feature { background: rgba(129,140,248,0.16); color: #b9c2ff; border: 1px solid rgba(129,140,248,0.32); }
.feedback-status-open { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.85); border: 1px solid rgba(255,255,255,0.18); }
.feedback-status-accepted { background: rgba(245,197,24,0.16); color: #ffe9a2; border: 1px solid rgba(245,197,24,0.32); }
.feedback-status-completed { background: rgba(116,224,162,0.18); color: #b8f1ce; border: 1px solid rgba(116,224,162,0.32); }
.feedback-status-rejected { background: rgba(255,107,107,0.12); color: rgba(255,200,200,0.85); border: 1px solid rgba(255,107,107,0.22); }
.feedback-submitter {
  color: rgba(255,255,255,0.55);
  font-weight: 500;
}
.feedback-time {
  color: rgba(255,255,255,0.45);
  margin-left: auto;
}
.feedback-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text);
}
.feedback-body {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: rgba(255,255,255,0.82);
  white-space: pre-wrap;
}
.feedback-note {
  margin: 10px 0 0;
  padding: 8px 12px;
  background: rgba(255,255,255,0.05);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  font-size: 12.5px;
  line-height: 1.4;
  color: rgba(255,255,255,0.75);
  white-space: pre-wrap;
}
.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.feedback-form { margin-bottom: 24px; }

/* ---------- Tonight Mode filter strip ---------- */
.tonight-filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  margin: 0 0 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.vibe-row, .filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.filter-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}
.vibe-toggle {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  padding: 3px;
  flex-wrap: wrap;
}
.vibe-btn {
  background: transparent;
  border: 0;
  color: rgba(255,255,255,0.75);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}
.vibe-btn.active {
  background: var(--accent-gradient);
  color: #fff;
  font-weight: 600;
}
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  padding: 4px 6px 4px 12px;
  font-size: 12.5px;
  color: rgba(255,255,255,0.8);
}
.filter-pill select {
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 12.5px;
  font-family: inherit;
  padding: 4px 8px;
  border-radius: 999px;
  cursor: pointer;
  outline: none;
}
.filter-pill select option { background: #1a1a2e; color: #fff; }
.filter-pill.checkbox { padding: 6px 14px; cursor: pointer; }
.filter-pill.checkbox input { margin: 0; accent-color: #a855f7; }

/* ---------- Tonight's Pick hero card ---------- */
.tonight-hero {
  margin: 0 auto 14px;
  max-width: 560px;
}
.tonight-hero:empty { display: none; }
.card.hero-card {
  position: relative;
  border: 1px solid rgba(168,85,247,0.32);
  box-shadow: 0 0 0 1px rgba(168,85,247,0.18) inset,
              0 24px 60px rgba(0,0,0,0.4);
}
.card.hero-card::before {
  content: "Tonight's pick";
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 12px rgba(124,58,237,0.4);
}
.card.hero-card h3 { font-size: 19px; }
.card.hero-card .blurb {
  font-size: 14.5px;
  line-height: 1.5;
}

/* ---------- Invite link UI ---------- */
.invite-link-row {
  margin-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.invite-link-row > button { align-self: flex-start; }
.invite-link-result .hint { margin: 0 0 8px; font-size: 12.5px; }
.invite-link-box {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.invite-link-box input {
  flex: 1;
  min-width: 200px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

/* ---------- Join page ---------- */
.join-step { display: flex; flex-direction: column; gap: 16px; }
.invite-banner {
  background: var(--accent-gradient-soft);
  border: 1px solid rgba(168,85,247,0.4);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin-bottom: 6px;
}
.invite-banner-eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(168,85,247,0.85);
}
.invite-banner h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
  background: linear-gradient(180deg, #fff 0%, rgba(255,255,255,0.65) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.invite-banner .hint { margin: 0; font-size: 14px; }

/* ---------- Night prompts (above hero on compare) ---------- */
.night-prompts:empty { display: none; }
.night-prompt {
  background: var(--accent-gradient-soft);
  border: 1px solid rgba(168,85,247,0.32);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.night-prompt-text {
  font-size: 14.5px;
  margin-bottom: 10px;
  color: rgba(255,255,255,0.92);
}
.night-prompt .rate-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.night-prompt .rate-btn { flex: 0 1 auto; }
.night-prompt .rate-btn.ghost {
  background: transparent;
  border-color: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.55);
}

/* ---------- Hero "Decide" action bar ---------- */
.tonight-hero-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  max-width: 560px;
  margin: -4px auto 16px;
}
.tonight-hero-actions button {
  font-weight: 700;
  padding: 12px 22px;
}

/* ---------- View past nights link row ---------- */
.history-link-row {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

/* ---------- Watched-together button on movie page ---------- */
.watched-together-btn {
  align-self: flex-start;
  margin-top: 14px;
  font-weight: 600;
}

/* ---------- History page ---------- */
.nights-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}
.night-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px 10px 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
@media (hover: hover) {
  .night-row:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.18); }
}
.night-poster {
  width: 52px;
  aspect-ratio: 2/3;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(255,255,255,0.06);
  flex: 0 0 auto;
}
.night-poster-blank { background: rgba(255,255,255,0.04); }
.night-info { flex: 1; min-width: 0; }
.night-title {
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: -0.005em;
  margin-bottom: 2px;
}
.night-meta {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  margin-bottom: 4px;
}
.night-ratings {
  font-size: 12.5px;
  color: rgba(255,255,255,0.85);
}
.night-ratings .muted { color: rgba(255,255,255,0.45); }
.night-row [data-action="delete-night"] {
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 13px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid rgba(255,107,107,0.3);
  color: var(--danger);
  opacity: 0.5;
}
.night-row [data-action="delete-night"]:hover { opacity: 1; }

/* ---------- Avatar menu ---------- */
.avatar-wrap { position: relative; }
.avatar-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  border: 0;
  box-shadow: 0 4px 12px rgba(124,58,237,0.32);
}
.avatar-btn:hover { filter: brightness(1.1); }
.avatar-initial { line-height: 1; }
.avatar-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: rgba(15,15,30,0.95);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius-sm);
  padding: 6px;
  z-index: 50;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: 0 24px 48px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.avatar-menu-head {
  padding: 10px 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 4px;
}
.avatar-menu-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
}
.avatar-menu-handle {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  margin-top: 2px;
}
.avatar-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: rgba(255,255,255,0.88);
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}
.avatar-menu-item:hover { background: rgba(255,255,255,0.08); color: #fff; }

/* ---------- Tonight landing ---------- */
.tonight-empty {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
  margin-top: 8px;
}
.partner-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.partner-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.06s ease;
}
@media (hover: hover) {
  .partner-card:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(168,85,247,0.35);
    transform: translateY(-2px);
  }
}
.partner-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(124,58,237,0.3);
}
.partner-name { font-weight: 600; font-size: 15px; }
.partner-handle { font-size: 12px; color: rgba(255,255,255,0.55); }

/* ---------- Library ---------- */
.library-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 16px;
}
.lib-filter-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.lib-filter-btn.active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}
.lib-count {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  margin-left: 4px;
  opacity: 0.7;
}
.library-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lib-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px 10px 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
@media (hover: hover) {
  .lib-row:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.18);
  }
}
.lib-poster {
  width: 48px;
  aspect-ratio: 2/3;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(255,255,255,0.06);
  flex: 0 0 auto;
}
.lib-poster-blank { background: rgba(255,255,255,0.04); }
.lib-info { flex: 1; min-width: 0; }
.lib-title {
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: -0.005em;
  margin-bottom: 4px;
}
.lib-title .muted { color: rgba(255,255,255,0.55); font-weight: 400; }
.lib-meta { font-size: 12px; color: rgba(255,255,255,0.6); }

/* ---------- Shortlist (per-pair, inside Compare) ---------- */
.shortlist-section {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.shortlist-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 14px;
  user-select: none;
}
.shortlist-section summary::-webkit-details-marker { display: none; }
.shortlist-section summary::after {
  content: "▾";
  color: rgba(255,255,255,0.5);
  font-size: 13px;
  transition: transform 0.15s ease;
}
.shortlist-section[open] summary::after { transform: rotate(180deg); }
.shortlist-head-label {
  background: linear-gradient(180deg, #fff 0%, rgba(255,255,255,0.7) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.shortlist-count {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-left: auto;
  margin-right: 8px;
}
.shortlist-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 12px 12px;
}
.shortlist-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
@media (hover: hover) {
  .shortlist-row:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(168,85,247,0.32);
  }
}
.shortlist-poster {
  width: 40px;
  aspect-ratio: 2/3;
  border-radius: 6px;
  object-fit: cover;
  background: rgba(255,255,255,0.06);
  flex: 0 0 auto;
}
.shortlist-poster-blank { background: rgba(255,255,255,0.04); }
.shortlist-info { flex: 1; min-width: 0; }
.shortlist-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.shortlist-title .muted { color: rgba(255,255,255,0.55); font-weight: 400; }
.shortlist-by {
  font-size: 11.5px;
  color: rgba(255,255,255,0.55);
  margin-top: 2px;
}

/* ---------- Tonight's pick hero captions ---------- */
.hero-why {
  margin: 8px 0 6px;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  background: var(--accent-gradient-soft);
  border: 1px solid rgba(168,85,247,0.28);
  border-radius: 999px;
  color: rgba(255,255,255,0.88);
  display: inline-block;
  align-self: flex-start;
}
.hero-availability {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: rgba(255,255,255,0.78);
}
.hero-availability-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-right: 6px;
}

/* ---------- Tonight pair page ---------- */
.tonight-pair { display: flex; flex-direction: column; }
.tonight-footer {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

/* ---------- Partner context bar (Tonight + Together) ---------- */
.partner-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
  position: relative;
}
.partner-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--glass-bg);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  padding: 6px 12px 6px 6px;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
}
.partner-switch:hover { background: rgba(255,255,255,0.1); }
.partner-switch-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.partner-switch-caret { color: rgba(255,255,255,0.5); font-size: 11px; }
.partner-nights {
  flex: 0 0 auto;
  font-weight: 500;
}
.partner-switch-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 240px;
  background: rgba(15,15,30,0.96);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius-sm);
  padding: 6px;
  z-index: 40;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: 0 24px 48px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ps-section-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  padding: 8px 12px 6px;
}
.ps-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: transparent;
  border: 0;
  color: rgba(255,255,255,0.9);
  padding: 9px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
}
.ps-row:hover { background: rgba(255,255,255,0.08); }
.ps-row.current { color: #fff; font-weight: 600; }
.ps-row-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.ps-row.current .ps-row-avatar { background: var(--accent-gradient); color: #fff; }
.ps-row-name { flex: 1; }
.ps-row-check { color: var(--accent); font-weight: 700; }
.ps-empty {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  padding: 8px 12px;
}
.ps-divider {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 6px 4px;
}
.ps-manage {
  width: 100%;
  background: transparent;
  border: 0;
  color: rgba(255,255,255,0.85);
  padding: 9px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
}
.ps-manage:hover { background: rgba(255,255,255,0.08); color: #fff; }

/* ---------- Smart-engine badge + toggle ---------- */
.engine-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 3px 10px;
  border-radius: 999px;
  margin-right: 8px;
}
.engine-badge.smart {
  background: var(--accent-gradient);
  color: #fff;
}
.engine-badge.classic {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.16);
}
.engine-sub { color: rgba(255,255,255,0.6); font-size: 13px; }
.engine-toggle {
  background: transparent;
  border: 0;
  color: rgba(255,255,255,0.55);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 2px 4px;
  margin-left: 6px;
}
.engine-toggle:hover { color: #fff; }
.card-reason {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255,255,255,0.92);
  padding: 8px 12px;
  background: var(--accent-gradient-soft);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
}

/* ---------- Availability label (US, vs your services) ---------- */
/* Styled like the "why it matched" callout — a soft tinted block with a
   left accent, not an in-your-face pill. */
.card-availability {
  margin: 12px 0 0;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.01em;
}
.av-yes {
  color: #b8f1d2;
  background: rgba(116,224,162,0.12);
  border-left: 3px solid rgba(116,224,162,0.7);
}
.av-no {
  color: #f3d7b0;
  background: rgba(255,170,60,0.10);
  border-left: 3px solid rgba(255,170,60,0.55);
}
.av-info {
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.05);
  border-left: 3px solid rgba(255,255,255,0.25);
}
.av-none,
.av-pending {
  color: rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.04);
  border-left: 3px solid rgba(255,255,255,0.15);
  font-weight: 500;
}
/* Hero variant: plain text (no block), keeps the inline look there. */
.hero-availability {
  margin: 0;
  padding: 0;
  background: none;
  border-left: 0;
  border-radius: 0;
}
.hero-availability.av-yes { color: #8af0bb; }
.hero-availability.av-no { color: #ffc066; }
.hero-availability.av-info { color: rgba(255,255,255,0.7); }
.hero-availability.av-none { color: rgba(255,255,255,0.45); }

/* ---------- Admin: AI engine check ---------- */
.ai-check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.ai-check-result { font-size: 13px; font-weight: 600; }
.ai-check-result.pending { color: rgba(255,255,255,0.55); }
.ai-check-result.ok { color: #74e0a2; }
.ai-check-result.err { color: var(--danger); }

.engine-diag {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #ffc066;
}
.engine-diag.ok { color: rgba(255,255,255,0.5); }

/* Notifications inbox */
.notif-btn { position: relative; }
.notif-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ff5d5d;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
.notif-badge.hidden { display: none; }
.night-row.notif-unread { border-left: 3px solid #6aa6ff; }
.plan-box {
  border: 1px solid var(--line, #262c34);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 6px 0 4px;
}
.plan-box .muted { color: rgba(255,255,255,0.45); }
.night-row .night-meta.muted { color: rgba(255,255,255,0.45); }

/* Feedback comment thread */
.fb-thread { margin: 10px 0 4px; display: flex; flex-direction: column; gap: 8px; }
.fb-comment {
  border-left: 3px solid rgba(255,255,255,0.14);
  padding: 6px 10px;
  background: rgba(255,255,255,0.04);
  border-radius: 0 8px 8px 0;
}
.fb-comment-admin { border-left-color: #f5a623; }
.fb-comment-head {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 12px; color: var(--muted, #9aa3ad); margin-bottom: 2px;
}
.fb-comment-author { font-weight: 600; color: rgba(255,255,255,0.8); }
.fb-admin-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: #120d05; background: #f5a623; border-radius: 999px; padding: 1px 6px;
}
.fb-comment-body { margin: 0; font-size: 14px; white-space: pre-wrap; }
.fb-reply { margin: 8px 0 4px; display: flex; flex-direction: column; gap: 6px; }
.fb-reply-text {
  width: 100%; resize: vertical; padding: 8px 10px; font: inherit; font-size: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14); border-radius: 8px; color: inherit;
}
.fb-reply button { align-self: flex-start; }
.notif-fb-tile {
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #f5a623;
}
.shortlist-flags {
  margin-top: 4px;
  display: flex; flex-wrap: wrap; gap: 4px 6px;
}
.shortlist-flag {
  font-size: 11px;
  padding: 1px 7px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  color: rgba(255,255,255,0.65);
  background: rgba(255,255,255,0.04);
}
.shortlist-flag.flag-cap {
  color: #ff8f6b;
  border-color: rgba(255,143,107,0.4);
  background: rgba(255,143,107,0.10);
}
.shortlist-flag.flag-disliked {
  color: #ff8f6b;
  border-color: rgba(255,143,107,0.35);
}
.shortlist-flag.flag-avoid {
  color: #ff8f6b;
  border-color: rgba(255,143,107,0.35);
}

/* Honor the iOS/Android "Reduce Motion" accessibility setting:
 * collapse transitions and animations so users with vestibular
 * sensitivity get a still UI. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
