/* ══════════════════════════════════════════════════════
   StreamDock — Premium Dark Cinematic UI
   ══════════════════════════════════════════════════════ */

:root {
  --bg:            #080a0f;
  --bg-2:          #0d1117;
  --bg-3:          #161b26;
  --bg-card:       #111620;
  --accent:        #e50914;
  --accent-h:      #ff1a1a;
  --accent-dim:    rgba(229, 9, 20, 0.15);
  --text:          #ffffff;
  --text-2:        rgba(255,255,255,0.65);
  --text-3:        rgba(255,255,255,0.35);
  --border:        rgba(255,255,255,0.07);
  --border-h:      rgba(255,255,255,0.14);
  --glass:         rgba(255,255,255,0.04);
  --glass-h:       rgba(255,255,255,0.08);
  --radius:        14px;
  --radius-sm:     8px;
  --radius-lg:     20px;
  --header-h:      68px;
  --nav-h:         78px;
  --trans:         0.25s ease;
}

/* ── Reset ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; }

/* ── Custom instant tooltip (replaces browser title delay) ───────────── */
.sd-tooltip {
  position: fixed; z-index: 10000;
  max-width: 320px;
  padding: 6px 10px; border-radius: 6px;
  background: #0a0b10; color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 6px 18px rgba(0,0,0,0.5);
  font: 500 11px/1.35 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
  letter-spacing: 0.01em;
  pointer-events: none; opacity: 0; visibility: hidden;
  transition: opacity 0.08s ease-out;
  white-space: pre-wrap; word-wrap: break-word;
}
.sd-tooltip-visible { opacity: 1; visibility: visible; }

/* ── Global scrollbars — grey, minimal, consistent everywhere.
   Individual rules further down still win by specificity when a
   surface needs a custom width (e.g. 3px profile sidebars). */
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--border-h);
  border-radius: 3px;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.24); }
*::-webkit-scrollbar-corner { background: transparent; }
/* Firefox */
* { scrollbar-width: thin; scrollbar-color: var(--border-h) transparent; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
button { background: none; border: none; cursor: pointer; color: inherit; font: inherit; }
input, select { font: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Grain Texture ───────────────────────────────────── */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 9999;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 300px 300px;
  mix-blend-mode: overlay;
  animation: grain-shift 8s steps(8) infinite;
}
@keyframes grain-shift {
  0%   { transform: translate(0,0); }
  12%  { transform: translate(-3%,-7%); }
  25%  { transform: translate(-8%,4%); }
  37%  { transform: translate(5%,-12%); }
  50%  { transform: translate(-4%,10%); }
  62%  { transform: translate(8%,-3%); }
  75%  { transform: translate(-6%,7%); }
  87%  { transform: translate(3%,-5%); }
  100% { transform: translate(0,0); }
}

/* ── Screens ─────────────────────────────────────────── */
.screen {
  position: fixed; inset: 0;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.screen.active { opacity: 1; visibility: visible; }
.hidden { display: none !important; }

/* ── Quick-log prompt (post-streaming) ──────────────── */
.quicklog-prompt {
  position: fixed; bottom: 24px; right: 24px; z-index: 10000;
  width: 340px; max-height: 420px;
  background: rgba(14,16,22,0.96); backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
  display: flex; flex-direction: column;
  animation: quicklog-in 0.3s ease;
}
@keyframes quicklog-in {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.quicklog-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 0;
}
.quicklog-title { font-size: 13px; font-weight: 700; color: var(--text); }
.quicklog-close {
  width: 24px; height: 24px; border-radius: 6px;
  background: rgba(255,255,255,0.06); border: none;
  color: var(--text-3); font-size: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.quicklog-close:hover { background: rgba(255,255,255,0.12); color: var(--text); }
.quicklog-search {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
}
.quicklog-input {
  flex: 1; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; padding: 8px 12px;
  color: var(--text); font: inherit; font-size: 12px; outline: none;
}
.quicklog-input:focus { border-color: rgba(229,9,20,0.4); }
.quicklog-spinner {
  width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--cd-accent, #e50914); border-radius: 50%;
  animation: spin 0.6s linear infinite; flex-shrink: 0;
}
.quicklog-results {
  max-height: 280px; overflow-y: auto; padding: 0 8px 8px;
}
.quicklog-results::-webkit-scrollbar { width: 3px; }
.quicklog-results::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.quicklog-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: 8px; cursor: pointer;
  transition: background 0.15s;
}
.quicklog-item:hover { background: rgba(255,255,255,0.06); }
.quicklog-item img {
  width: 36px; height: 54px; border-radius: 4px; object-fit: cover; flex-shrink: 0;
}
.quicklog-item-info { flex: 1; min-width: 0; }
.quicklog-item-title {
  font-size: 12px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.quicklog-item-meta { font-size: 10px; color: var(--text-3); margin-top: 2px; }
.quicklog-item-added {
  font-size: 10px; color: #22c55e; font-weight: 600;
}

/* ══════════════════════════════════════════════════════
   WEBVIEW OVERLAY
   ══════════════════════════════════════════════════════ */
.webview-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: #000;
  /* Default (hidden) state: fully off-screen to the right */
  transform: translateX(100%);
  transition: transform 0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}
/* .hidden keeps display:none before any interaction — overrides transform */
.webview-overlay.hidden { display: none !important; }
/* Fully visible, slid into view */
.webview-overlay.show   { transform: translateX(0); }
.webview-bar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  height: 52px;
  background: rgba(8,10,15,0.92);
  backdrop-filter: blur(24px);
  border-bottom: 2px solid transparent; /* colored dynamically by JS */
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  transition: border-color 0.3s ease, opacity 0.5s ease, transform 0.5s ease;
}
.webview-bar.autohide {
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
}
.webview-center {
  flex: 1;
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-2);
  overflow: hidden;
}
.webview-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-3); flex-shrink: 0;
  transition: background var(--trans);
}
.webview-dot.loading { background: #f5c518; animation: pulse 1s ease infinite; }
.webview-dot.loaded  { background: #1db954; }
.webview-dot.error   { background: var(--accent); }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

#webview-service-name { font-weight: 600; color: var(--text); font-size: 14px; }
.webview-url { color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.webview-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 13px; font-weight: 500;
  transition: all var(--trans);
}
.webview-btn:hover { background: var(--glass-h); color: var(--text); }
.webview-btn.icon-only { padding: 6px 8px; }
.webview-actions { display: flex; gap: 4px; }

/* Service brand badge in the webview bar */
.webview-service-badge {
  width: 28px; height: 28px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 900;
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.5px; color: #fff;
  transition: background 0.3s ease;
}

#webview-container {
  position: absolute; inset: 0; /* fills the full overlay — behind the floating bar */
  background: #000;
}

#streaming-webview {
  width: 100%; height: 100%;
  border: none;
  background: #000;
}

/* ══════════════════════════════════════════════════════
   PROFILE SELECTION SCREEN
   ══════════════════════════════════════════════════════ */
.profile-bg {
  position: absolute; inset: 0; overflow: hidden;
  background: var(--bg);
}
.profile-bg-gradient {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 30%, rgba(229,9,20,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 70%, rgba(100,0,200,0.08) 0%, transparent 60%);
}
.profile-content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 100%;
  padding: 40px;
}
.logo-mark {
  display: flex; align-items: center; gap: 12px; margin-bottom: 48px;
}
.logo-play {
  font-size: 36px; color: var(--accent);
  text-shadow: 0 0 30px rgba(229,9,20,0.6);
}
.logo-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 52px; letter-spacing: 6px; color: var(--text);
  line-height: 1;
}
.profile-heading {
  font-size: 24px; font-weight: 400; color: var(--text-2);
  margin-bottom: 40px; letter-spacing: 0.5px;
}
.profile-grid {
  display: flex; gap: 28px; flex-wrap: wrap;
  justify-content: center; margin-bottom: 40px;
}
.profile-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; cursor: pointer;
  transition: transform var(--trans);
}
.profile-card:hover { transform: scale(1.05); }
.profile-card-visual {
  position: relative; width: 130px; height: 130px;
  border-radius: 18px; overflow: hidden;
  border: 2px solid rgba(255,255,255,0.1);
  transition: border-color var(--trans), box-shadow var(--trans);
}
.profile-card:hover .profile-card-visual {
  border-color: rgba(255,255,255,0.32);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.profile-card-bg { position: absolute; inset: 0; }
.profile-card-avatar-wrap {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  font-size: 52px; line-height: 1;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
  pointer-events: none;
}
.profile-card-edit-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s ease;
  backdrop-filter: blur(3px);
}
.profile-card-visual:hover .profile-card-edit-overlay { opacity: 1; }
.profile-card-edit-btn {
  display: flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.35);
  color: #fff; font-size: 12px; font-weight: 600;
  padding: 6px 14px; border-radius: 8px; cursor: pointer;
  transition: background 0.15s ease;
}
.profile-card-edit-btn:hover { background: rgba(255,255,255,0.28); }
.profile-card-name {
  font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.85);
  max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: color var(--trans);
}
.profile-card:hover .profile-card-name { color: #fff; }
/* .profile-avatar still used by header avatar small & settings list */
.profile-avatar {
  width: 100px; height: 100px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 44px; line-height: 1;
  border: 2px solid transparent;
  transition: all var(--trans);
}
.btn-add-profile {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: var(--radius);
  background: var(--glass); border: 1px solid var(--border);
  color: var(--text-2); font-size: 15px; font-weight: 500;
  transition: all var(--trans);
}
.btn-add-profile:hover { background: var(--glass-h); border-color: var(--border-h); color: var(--text); }
.add-icon { font-size: 20px; font-weight: 300; }

/* ══════════════════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════════════════ */
.header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: linear-gradient(to bottom, rgba(8,10,15,0.98) 0%, rgba(8,10,15,0.85) 100%);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  z-index: 100;
  -webkit-app-region: drag;
}
.header button, .header .lang-switcher, .header .win-controls, .header .profile-toggle {
  -webkit-app-region: no-drag;
}
.logo-compact {
  display: flex; align-items: center; gap: 8px;
  cursor: default;
}
.logo-play-sm { font-size: 18px; color: var(--accent); }
.logo-text-sm {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 26px; letter-spacing: 3px; color: var(--text);
}
.header-right { display: flex; align-items: center; gap: 16px; }

/* Language Switcher */
/* Top-bar refresh — re-renders/re-fetches whichever tab is active. */
.header-refresh-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--trans), color var(--trans), border-color var(--trans);
}
.header-refresh-btn:hover {
  background: var(--glass-h); color: var(--text); border-color: var(--border-h);
}
.header-refresh-btn:active { transform: scale(0.94); }
.header-refresh-btn:disabled { opacity: 0.55; cursor: progress; }
.header-refresh-btn svg { width: 15px; height: 15px; transition: transform .2s; }
.header-refresh-btn.spinning svg { animation: header-refresh-spin .6s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes header-refresh-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Report a bug: header button + modal ── */
.header-bug-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  border-radius: var(--radius-sm);
  background: var(--glass); border: 1px solid var(--border);
  color: var(--text-2); cursor: pointer;
  transition: background var(--trans), color var(--trans), border-color var(--trans);
}
.header-bug-btn:hover { background: var(--glass-h); color: var(--text); border-color: var(--border-h); }
.header-bug-btn:active { transform: scale(0.94); }
.header-bug-btn svg { width: 16px; height: 16px; }

.cd-bug-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.cd-bug-modal.hidden { display: none; }
.cd-bug-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(6px); }
.cd-bug-box {
  position: relative; z-index: 1;
  background: var(--bg-2); border: 1px solid var(--border-h);
  border-radius: 18px; padding: 22px 20px; width: 420px; max-width: 100%;
  display: flex; flex-direction: column; gap: 12px;
  animation: cd-modal-in 0.22s cubic-bezier(0.34,1.4,0.64,1);
}
.cd-bug-header { display: flex; align-items: center; justify-content: space-between; }
.cd-bug-header h3 { margin: 0; font-size: 18px; font-weight: 700; color: var(--text); }
.cd-bug-close {
  width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-3); border: 1px solid var(--border); color: var(--text-3); cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.cd-bug-close:hover { background: rgba(229,9,20,0.4); color: #fff; }
.cd-bug-sub { margin: 0; font-size: 13px; color: var(--text-3); line-height: 1.45; }
.cd-bug-textarea, .cd-bug-input {
  width: 100%; box-sizing: border-box;
  background: var(--bg-3); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font-size: 14px; font-family: inherit; padding: 10px 12px;
}
.cd-bug-textarea { resize: vertical; min-height: 90px; }
.cd-bug-textarea:focus, .cd-bug-input:focus { outline: none; border-color: var(--border-h); }
.cd-bug-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 2px; }
.cd-bug-status { font-size: 12px; color: var(--text-3); }
.cd-bug-status.ok  { color: #22c55e; }
.cd-bug-status.err { color: #ef4444; }
.cd-bug-send {
  padding: 9px 16px; border-radius: 10px; border: none;
  background: #e50914; color: #fff; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: filter 0.15s, opacity 0.15s; white-space: nowrap;
}
.cd-bug-send:hover { filter: brightness(1.1); }
.cd-bug-send:disabled { opacity: 0.6; cursor: progress; }

/* ── Get the TV app — home promo banner + install modal ── */
.tv-promo {
  display: flex; align-items: center; gap: 14px;
  width: calc(100% - 72px); margin: 8px 36px 4px;
  padding: 14px 18px; border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(229,9,20,0.14), rgba(229,9,20,0.05));
  border: 1px solid rgba(229,9,20,0.28);
  cursor: pointer; text-align: left;
  transition: background var(--trans), border-color var(--trans), transform 0.12s;
}
.tv-promo:hover { background: linear-gradient(135deg, rgba(229,9,20,0.2), rgba(229,9,20,0.08)); border-color: rgba(229,9,20,0.45); }
.tv-promo:active { transform: scale(0.995); }
.tv-promo-icon { flex-shrink: 0; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: rgba(229,9,20,0.18); color: #ff4953; }
.tv-promo-icon svg { width: 22px; height: 22px; }
.tv-promo-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tv-promo-title { font-size: 14px; font-weight: 700; color: var(--text); }
.tv-promo-sub { font-size: 12px; color: var(--text-3); }
.tv-promo-cta { flex-shrink: 0; padding: 8px 16px; border-radius: var(--radius-sm); background: #e50914; color: #fff; font-size: 13px; font-weight: 600; }

.tv-install-box { width: 460px; }
.tv-benefits { margin: 2px 0 4px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 9px; }
.tv-benefits li { position: relative; padding-left: 26px; font-size: 13.5px; color: var(--text-2); line-height: 1.45; }
.tv-benefits li::before { content: "✓"; position: absolute; left: 0; top: -1px; color: #22c55e; font-weight: 800; }
.tv-install-howto { margin: 14px 0 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-3); }
.tv-install-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 9px; }
.tv-install-steps li { font-size: 13.5px; color: var(--text-2); line-height: 1.5; }
.tv-install-note { margin: 14px 0 0; font-size: 12px; color: var(--text-3); font-style: italic; }

.lang-switcher { position: relative; }
.lang-toggle {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: var(--radius-sm);
  background: var(--glass); border: 1px solid var(--border);
  color: var(--text-2); font-size: 13px; font-weight: 500;
  transition: all var(--trans);
}
.lang-toggle:hover { background: var(--glass-h); color: var(--text); border-color: var(--border-h); }
.lang-chevron { transition: transform var(--trans); }
.lang-switcher.open .lang-chevron { transform: rotate(180deg); }
.lang-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  display: flex; flex-direction: column;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 160px; z-index: 500;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
  animation: dropdown-in 0.15s ease;
  overflow: hidden;
}
.lang-opts-list {
  padding: 6px; max-height: 280px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent;
}
@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.lang-opt {
  display: block; width: 100%;
  padding: 8px 12px; border-radius: var(--radius-sm);
  text-align: left; font-size: 14px; color: var(--text-2);
  transition: all var(--trans);
}
.lang-opt:hover { background: var(--glass-h); color: var(--text); }
.lang-opt.active { color: var(--accent); }
.lang-dropdown-hint { padding: 8px 12px; border-top: 1px solid var(--border); font-size: 11px; color: var(--text-3); line-height: 1.4; flex-shrink: 0; }

/* Profile Toggle */
.profile-toggle {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: var(--radius-sm);
  background: var(--glass); border: 1px solid var(--border);
  color: var(--text-2); font-size: 13px; font-weight: 500;
  transition: all var(--trans);
}
.profile-toggle:hover { background: var(--glass-h); color: var(--text); }
.profile-avatar-sm {
  width: 26px; height: 26px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; line-height: 1;
}

/* Window Controls */
.win-controls { display: flex; gap: 4px; margin-left: 8px; }
.wc {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--text-3);
  transition: all var(--trans);
}
.wc:hover { background: var(--glass-h); color: var(--text); }
.wc-close:hover { background: var(--accent); color: #fff; }
.wc-close { font-size: 12px; }

/* ══════════════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════════════ */
.main-content {
  position: fixed;
  top: var(--header-h); bottom: var(--nav-h); left: 0; right: 0;
  overflow-y: auto; overflow-x: hidden;
  scroll-behavior: smooth;
}
.main-content::-webkit-scrollbar { width: 4px; }
.main-content::-webkit-scrollbar-track { background: transparent; }
.main-content::-webkit-scrollbar-thumb { background: var(--border-h); border-radius: 2px; }

/* Tab Panes */
.tab-pane { padding: 0 0 40px; display: none; }
.tab-pane.active { display: block; }

/* ── Hero — personal, time-aware ────────────────────────────────────── */
.hero {
  position: relative;
  padding: 44px 36px 36px;
  overflow: hidden;
  margin-bottom: 8px;
  isolation: isolate;
}
.hero-bg {
  position: absolute; inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 520px at 8% 0%, rgba(229,9,20,0.20), transparent 55%),
    radial-gradient(640px 420px at 95% 110%, rgba(76,90,238,0.12), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,0.025), transparent 55%);
}
/* Subtle film-grain to break the perfectly flat gradient surface. Inline
   SVG keeps it self-contained; very low opacity so it reads as texture
   rather than noise. */
.hero-bg::after {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/></svg>");
  opacity: 0.5;
  mix-blend-mode: overlay;
  pointer-events: none;
}
.hero-content {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  max-width: 1320px;
}
.hero-left { flex: 1; min-width: 0; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 2.4px;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  margin-bottom: 14px;
  padding: 5px 11px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  font-variant-numeric: tabular-nums;
}
.hero-clock-sep { opacity: 0.45; }
.hero-day { letter-spacing: 1.6px; }

.hero-title {
  font-size: 52px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: #fff;
  margin-bottom: 10px;
  text-wrap: balance;
  /* Soft top-down sheen so the headline lifts off the panel without the
     heavy text-shadow look of the previous hero. */
  background: linear-gradient(180deg, #fff 0%, rgba(255,255,255,0.78) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-greeting {
  /* Use the same gradient fill as the title so they read as one phrase. */
  background: inherit;
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-name {
  background: linear-gradient(180deg, var(--accent-h), var(--accent));
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-comma { -webkit-text-fill-color: rgba(255,255,255,0.78); }
.hero-sub {
  font-size: 14px;
  color: var(--text-2);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  max-width: 60ch;
}

/* Right column: profile avatar with a soft pulsing halo. The halo is a
   purely decorative accent that subtly draws the eye without competing
   with the headline. */
.hero-right {
  position: relative;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  width: 96px; height: 96px;
}
.hero-avatar {
  position: relative;
  z-index: 1;
  width: 80px; height: 80px;
  display: flex; align-items: center; justify-content: center;
  font-size: 38px;
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(229,9,20,0.3), rgba(176,4,12,0.2));
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow:
    0 16px 40px -12px rgba(229,9,20,0.45),
    inset 0 1px 0 rgba(255,255,255,0.18);
}
.hero-avatar-pulse {
  position: absolute;
  inset: -6px;
  border-radius: 28px;
  background: radial-gradient(circle at center, rgba(229,9,20,0.32), transparent 70%);
  filter: blur(10px);
  animation: hero-avatar-pulse 4.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes hero-avatar-pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.95); }
  50%      { opacity: 0.85; transform: scale(1.08); }
}

@media (max-width: 720px) {
  .hero { padding: 32px 24px 24px; }
  .hero-title { font-size: 38px; }
  .hero-right { width: 72px; height: 72px; }
  .hero-avatar { width: 60px; height: 60px; font-size: 28px; border-radius: 16px; }
}

/* ── Sections ────────────────────────────────────────── */
.section { padding: 28px 36px 0; }
.section-hd {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.section-title {
  font-size: 19px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 10px;
}
.section-link {
  display: flex; align-items: center; gap: 4px;
  font-size: 13px; color: var(--text-3); font-weight: 500;
  padding: 5px 0;
  transition: color var(--trans);
}
.section-link:hover { color: var(--accent); }

/* ── My Services — section heading furniture ──────────────────────────── */
.services-section .section-title {
  font-size: 20px; font-weight: 700;
  letter-spacing: -0.005em;
  color: #fff;
}
.services-count {
  display: inline-flex; align-items: center;
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 11px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.4px;
  color: var(--text-3);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
}

.btn-add-more {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text-2);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.15s;
}
.btn-add-more:hover {
  background: rgba(229,9,20,0.10);
  color: var(--accent);
  border-color: rgba(229,9,20,0.35);
}
.btn-add-more:active { transform: scale(0.96); }

/* ── Services Grid ───────────────────────────────────── */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}
.services-grid.grid-zoomable {
  transition: grid-template-columns 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Card: cinematic, brand-aware, cursor-tracked spotlight, parallax sheen.
   --mx/--my are set by JS pointermove for the spotlight + parallax light;
   --svc-color and --svc-glow drive the brand-tinted hover shadow. */
.service-card {
  --svc-color: rgba(255,255,255,0.20);
  --svc-glow:  rgba(0,0,0,0.45);
  --mx: 50%; --my: 50%;
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  cursor: pointer; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.04);
  transition:
    transform 0.32s cubic-bezier(0.22,1,0.36,1),
    border-color 0.2s,
    box-shadow 0.32s cubic-bezier(0.22,1,0.36,1);
  container-type: inline-size;
  isolation: isolate;
}
/* Spotlight border — illuminates dynamically under the cursor with the
   service's own brand colour. Built from a gradient on the padding ring
   masked into a hairline. */
.service-card::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(160px circle at var(--mx) var(--my),
              var(--svc-color), transparent 60%);
  -webkit-mask: linear-gradient(#000,#000) content-box, linear-gradient(#000,#000);
          mask: linear-gradient(#000,#000) content-box, linear-gradient(#000,#000);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.28s;
  z-index: 3;
}
.service-card:hover {
  transform: translateY(-4px) scale(1.015);
  border-color: rgba(255,255,255,0.10);
  box-shadow:
    0 22px 50px -18px rgba(0,0,0,0.7),
    0 0 0 1px rgba(255,255,255,0.05) inset,
    0 28px 56px -28px var(--svc-glow);
}
.service-card:hover::before { opacity: 1; }

/* Background gradient (per-service) + a soft inner-light overlay that
   tracks the cursor for a subtle parallax / sheen effect. */
.service-card-bg {
  position: absolute; inset: 0;
  transition: transform 0.6s cubic-bezier(0.22,1,0.36,1);
}
.service-card:hover .service-card-bg {
  transform: scale(1.04);
}
.service-card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(0,0,0,0.28) 0%, rgba(0,0,0,0.05) 50%, rgba(0,0,0,0.45) 100%);
  pointer-events: none;
}
/* Cursor-following inner-light — replaces the old static glow layer.
   Same --mx/--my from the spotlight border so the highlight and the rim
   move together. */
.service-card-glow {
  position: absolute; inset: 0;
  opacity: 0.55;
  background: radial-gradient(280px circle at var(--mx) var(--my),
              rgba(255,255,255,0.16), transparent 55%);
  transition: opacity 0.3s;
  pointer-events: none;
  mix-blend-mode: overlay;
}
.service-card:hover .service-card-glow { opacity: 0.95; }

.service-card-body {
  position: relative; z-index: 2;
  height: 100%; padding: 16px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.service-card-logo {
  font-size: 32px; font-weight: 900; line-height: 1;
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
/* Vendored SVG wordmark from simple-icons (MIT). Painted WHITE on
   the service's brand gradient — this is the sanctioned treatment
   in every major streaming brand guideline ("white logo on brand
   colour"). mask-image is set INLINE per-card in renderServicesGrid
   rather than via a CSS custom property: browsers resolve url() in
   custom properties relative to the .css file location, not the
   document, which 404s from a stylesheet under /src/css/. */
.service-card-logo .svc-logo {
  display: inline-block;
  width: 110px; height: 32px;
  background-color: #fff;
  mask-size: contain; -webkit-mask-size: contain;
  mask-repeat: no-repeat; -webkit-mask-repeat: no-repeat;
  mask-position: left center; -webkit-mask-position: left center;
  text-shadow: none;
}
.service-card-name {
  font-size: 12px; font-weight: 600;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.3px;
  display: flex; align-items: center; gap: 7px;
}
/* Optional subtitle: shown when the card has extra context (e.g. last-
   used timestamp on hover). Keeps the resting state clean. */
.service-card-meta {
  display: block;
  font-size: 10px; font-weight: 500;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.3px;
  margin-top: 3px;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.22s, transform 0.22s;
}
.service-card:hover .service-card-meta { opacity: 1; transform: translateY(0); }

/* Live dot — pulses for services the user has opened recently
   (rendered conditionally by JS via the .is-live class). */
.service-card-live {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #5ad17b;
  box-shadow: 0 0 0 0 rgba(90,209,123,0.7);
  animation: service-live-pulse 1.8s ease-out infinite;
  flex-shrink: 0;
}
@keyframes service-live-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(90,209,123,0.7); }
  70%  { box-shadow: 0 0 0 9px rgba(90,209,123,0.0); }
  100% { box-shadow: 0 0 0 0   rgba(90,209,123,0.0); }
}

/* CTA arrow — SVG icon, slides in on hover. */
.service-card-arrow {
  position: absolute; right: 14px; bottom: 14px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 999px;
  background: rgba(0,0,0,0.42);
  border: 1px solid rgba(255,255,255,0.14);
  color: #fff;
  opacity: 0; transform: translateX(-6px);
  transition: opacity 0.22s, transform 0.22s, background 0.22s, border-color 0.22s;
  z-index: 2;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.service-card:hover .service-card-arrow {
  opacity: 1; transform: translateX(0);
}
.service-card-arrow:hover {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.25);
}

/* Drag handle — six dots top-centre, fades in on hover so the user knows
   the cards are reorderable. */
.service-card-drag {
  position: absolute; top: 8px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 3px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.10);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  z-index: 2;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.service-card-drag span {
  display: block;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: rgba(255,255,255,0.7);
}
.service-card:hover .service-card-drag { opacity: 1; }

/* Pro: per-service edit button — SVG icon, premium chip. */
.service-card-edit {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  width: 30px; height: 30px;
  border-radius: 999px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.75);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.22s, background 0.22s, border-color 0.22s, color 0.22s;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.service-card:hover .service-card-edit { opacity: 1; }
.service-card-edit:hover {
  background: rgba(0,0,0,0.78);
  color: #fff;
  border-color: rgba(255,255,255,0.30);
}

/* Drop target highlight while reordering. */
.service-card.drag-over {
  outline: 2px dashed rgba(229,9,20,0.6);
  outline-offset: -3px;
}
.service-card.dragging { opacity: 0.45; }

/* When the grid is zoomable, scale inner content proportionally with card
   width. Baseline is card width 190px → original px sizes; everything
   grows from there. */
.services-grid.grid-zoomable .service-card-body {
  padding: 8.4cqi;
}
.services-grid.grid-zoomable .service-card-logo {
  font-size: 16.8cqi;
}
.services-grid.grid-zoomable .service-card-name {
  font-size: 6.3cqi;
}
.services-grid.grid-zoomable .service-card-meta {
  font-size: 5.3cqi;
}
.services-grid.grid-zoomable .service-card-arrow {
  right: 7.4cqi; bottom: 7.4cqi;
  width: 16.8cqi; height: 16.8cqi;
  border-radius: 999px;
}
.services-grid.grid-zoomable .service-card-edit {
  top: 5.3cqi; right: 5.3cqi;
  width: 15.8cqi; height: 15.8cqi;
}

/* Empty state — composed CTA instead of bare text. */
.services-empty {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 48px 24px;
  border: 1.5px dashed rgba(255,255,255,0.10);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.02);
  text-align: center;
}
.services-empty-icon {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(229,9,20,0.18), rgba(76,90,238,0.10));
  border: 1px solid rgba(255,255,255,0.10);
  color: #fff;
}
.services-empty-text {
  font-size: 14px; color: var(--text-2);
  max-width: 38ch;
}
.services-empty-cta {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-h), var(--accent));
  color: #fff;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 8px 18px -8px rgba(229,9,20,0.6);
  transition: filter 0.18s, transform 0.15s, box-shadow 0.18s;
}
.services-empty-cta:hover { filter: brightness(1.07); box-shadow: 0 12px 24px -8px rgba(229,9,20,0.65); }
.services-empty-cta:active { transform: scale(0.97); }

/* ── Service edit modal — premium card editor ─────────────────────── */
.svc-edit-box {
  width: 460px;
  max-width: 92vw;
  padding: 0;
  overflow: hidden;
  background:
    radial-gradient(620px 360px at 0% 0%, rgba(229,9,20,0.10), transparent 55%),
    var(--bg-3);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow:
    0 48px 96px -24px rgba(0,0,0,0.85),
    0 0 0 1px rgba(255,255,255,0.04) inset;
}
.svc-edit-header {
  padding: 26px 28px 6px;
  text-align: left;
}
.svc-edit-eyebrow {
  display: inline-block;
  padding: 3px 10px;
  font-size: 10px; font-weight: 700;
  letter-spacing: 2.4px;
  color: rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  margin-bottom: 12px;
}
.svc-edit-title {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.018em;
  color: #fff;
  text-wrap: balance;
}

/* Live preview — same shape as the real home card so the user sees
   exactly what they're shaping. */
.svc-edit-preview-wrap {
  padding: 18px 28px 24px;
  display: flex; justify-content: center;
}
.svc-edit-preview-card {
  width: 100%;
  max-width: 280px;
  cursor: default !important;
  pointer-events: none; /* preview-only — clicks belong to the form below */
}

/* Form fields */
.svc-edit-fields {
  padding: 0 28px 8px;
  display: flex; flex-direction: column;
  gap: 18px;
}
.svc-edit-fields .modal-field { margin-bottom: 0; }
.svc-edit-hint {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.5;
}

/* Color picker row: preset swatches + custom-colour wedge + hex code */
.svc-edit-color-row {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
}
.svc-edit-color-swatches {
  display: flex; flex-wrap: wrap;
  gap: 6px;
  flex: 1; min-width: 0;
}
.svc-edit-swatch {
  position: relative;
  width: 26px; height: 26px;
  border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,0.10);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  isolation: isolate;
}
.svc-edit-swatch:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.40);
}
.svc-edit-swatch.is-active {
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.10),
              0 6px 14px -4px var(--swatch-color, rgba(0,0,0,0.4));
}
.svc-edit-swatch.is-active::after {
  content: '';
  position: absolute; inset: 4px;
  border-radius: 50%;
  border: 1.5px solid rgba(0,0,0,0.4);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.6);
  pointer-events: none;
}

/* Custom-colour control: native <input type="color"> hidden behind a
   styled label so the OS picker doesn't leak its default chrome. */
.svc-edit-color-custom {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}
.svc-edit-color-input {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
  border: none; padding: 0;
}
.svc-edit-color-custom-label {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px;
  font-size: 11px; font-weight: 600;
  color: var(--text-2);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.svc-edit-color-custom:hover .svc-edit-color-custom-label {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-color: rgba(255,255,255,0.20);
}

.svc-edit-color-hex {
  font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 11px; font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Footer actions */
.svc-edit-actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 18px 28px 24px;
  margin-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.svc-edit-actions-right {
  display: flex; gap: 8px;
}

.svc-edit-reset,
.svc-edit-cancel,
.svc-edit-save {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.15s, box-shadow 0.18s;
  border: 1px solid transparent;
}
.svc-edit-reset {
  color: var(--text-3);
  background: transparent;
}
.svc-edit-reset:hover {
  color: var(--text);
  background: rgba(255,255,255,0.04);
}
.svc-edit-cancel {
  color: var(--text-2);
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.10);
}
.svc-edit-cancel:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.18);
}
.svc-edit-save {
  color: #fff;
  background: linear-gradient(135deg, var(--accent-h), var(--accent));
  border-color: rgba(255,255,255,0.10);
  box-shadow: 0 6px 14px -6px rgba(229,9,20,0.6);
}
.svc-edit-save:hover {
  filter: brightness(1.07);
  box-shadow: 0 10px 22px -8px rgba(229,9,20,0.7);
}
.svc-edit-save:active,
.svc-edit-cancel:active,
.svc-edit-reset:active { transform: scale(0.96); }

/* Subtitle under the modal title — used by the "add custom service" flow
   to explain what the form is for without bloating the title itself. */
.svc-edit-subtitle {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.55;
  max-width: 52ch;
}

/* Inline field error (under each input) and modal-level error (below the
   form). Both share the same red, just different placement. */
.cs-field-error {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #ff8e94;
  line-height: 1.4;
}
.cs-error-block {
  margin: 0 28px 16px;
  padding: 10px 14px;
  background: rgba(229,9,20,0.08);
  border: 1px solid rgba(229,9,20,0.30);
  border-radius: 10px;
  color: #ff8e94;
  font-size: 12px;
  font-weight: 600;
}
/* Highlight inputs in error state with a red border + soft red focus
   ring. The .has-error class is toggled by app.js validation. */
.modal-input.has-error {
  border-color: rgba(229,9,20,0.55) !important;
  box-shadow: 0 0 0 3px rgba(229,9,20,0.10);
}

/* Drag-and-drop reordering */
.service-card[draggable] { cursor: grab; }
.service-card[draggable]:active { cursor: grabbing; }
.service-card.dragging {
  opacity: 0.35;
  transform: scale(0.95) !important;
  transition: none;
  box-shadow: none !important;
}
.service-card.drag-over {
  transform: translateY(-6px) scale(1.04) !important;
  box-shadow: 0 0 0 2px var(--accent), 0 20px 40px rgba(0,0,0,0.5) !important;
  border-color: var(--accent) !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* Empty services state */
.services-empty {
  grid-column: 1/-1;
  padding: 40px; text-align: center; color: var(--text-3);
}

/* ── AI Badge ────────────────────────────────────────── */
.badge-ai {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #7c3aed, #e50914);
  color: #fff; font-size: 10px; font-weight: 800;
  letter-spacing: 1px; padding: 2px 7px; border-radius: 4px;
}
.badge-ai-lg {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #7c3aed, #e50914);
  color: #fff; font-size: 13px; font-weight: 800;
  letter-spacing: 1px; padding: 4px 10px; border-radius: 6px;
}

/* ── AI Placeholder ──────────────────────────────────── */
.ai-placeholder {
  display: flex; flex-direction: column; align-items: center;
  gap: 16px; padding: 48px 24px; text-align: center;
}
.ai-placeholder-icon {
  font-size: 40px; opacity: 0.4;
  background: linear-gradient(135deg, #7c3aed, #e50914);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.ai-placeholder-text { color: var(--text-2); max-width: 360px; font-size: 14px; }

/* ── Loading Spinner ─────────────────────────────────── */
.recs-loading {
  display: flex; align-items: center; gap: 14px;
  padding: 40px; color: var(--text-2);
}
.recs-spinner {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes cd-fade-in { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:translateY(0); } }

/* ── Recommendations Grid ────────────────────────────── */
.recs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.recs-grid-full { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.rec-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  display: flex; flex-direction: column; gap: 10px;
  transition: all var(--trans); cursor: pointer;
  position: relative; overflow: hidden;
}
.rec-card:hover {
  border-color: var(--border-h);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}
.rec-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; border-radius: 3px 0 0 3px;
  background: var(--accent, #e50914);
}
.rec-card-content { flex: 1; display: flex; flex-direction: column; padding-left: 8px; }
.rec-card-content .rec-actions { margin-top: auto; padding-top: 10px; }
.rec-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.rec-title { font-size: 15px; font-weight: 600; line-height: 1.3; }
.rec-rating {
  font-size: 12px; color: #f5c518; font-weight: 600;
  flex-shrink: 0; white-space: nowrap;
}
.rec-badges { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rec-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 3px;
  font-weight: 500;
}
.rec-badge-platform {
  background: var(--glass); color: var(--text-2);
  border: 1px solid var(--border);
}
.rec-badge-type {
  background: var(--glass); color: var(--text-3);
}
.rec-badge-genre { color: var(--text-3); font-size: 11px; }
.rec-desc { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.rec-actions { display: flex; gap: 8px; margin-top: 4px; }
.rec-watch-btn {
  flex: 1; padding: 7px 14px; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff;
  font-size: 12px; font-weight: 600; letter-spacing: 0.3px;
  transition: background var(--trans); text-align: center;
  border: none; cursor: pointer;
}
.rec-watch-btn:hover { background: var(--accent-h); }

/* Launch screen */
#launch-screen {
  position: fixed; inset: 0; z-index: 9000;
  background: #0a0a0a;
  display: flex; align-items: center; justify-content: center;
  animation: launchFadeIn 0.18s ease;
}
@keyframes launchFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.launch-screen-inner {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.launch-screen-bar {
  width: 48px; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, #b91c1c, #ef4444);
}
.launch-screen-label {
  font-size: 13px; font-weight: 500; letter-spacing: 2px;
  text-transform: uppercase; color: #6b7280;
}
.launch-screen-name {
  font-size: 28px; font-weight: 700; color: #f9fafb;
  letter-spacing: 0.5px;
}

/* Offline gate — boot-time warning when navigator.onLine is false.
   Single accent (red), tinted shadow, custom signal-loss SVG, staggered
   entry, live re-probe countdown with tabular nums. */
.offline-gate {
  position: fixed; inset: 0; z-index: 9500;
  display: flex; align-items: center; justify-content: center;
  animation: offlineGateIn 0.36s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.offline-gate.offline-gate-out { animation: offlineGateOut 0.22s ease forwards; }
@keyframes offlineGateIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes offlineGateOut { to   { opacity: 0; } }
.offline-gate-bg {
  position: absolute; inset: 0;
  /* Single red accent — no second color. Background is a deep tinted
     dark (slight red lift behind the card) without a second gradient. */
  background:
    radial-gradient(ellipse 70% 50% at 50% 40%, rgba(229,9,20,0.16) 0%, transparent 70%),
    #07080c;
}
/* SVG turbulence grain replaces the old scanlines — feels organic instead
   of "fake terminal". Inline so it works fully offline. */
.offline-gate-bg::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/></svg>");
  opacity: 0.06; mix-blend-mode: overlay;
}
.offline-gate-card {
  position: relative; z-index: 1;
  width: min(440px, 90vw); padding: 44px 36px 32px;
  background: rgba(14,16,22,0.72);
  backdrop-filter: blur(22px) saturate(1.1); -webkit-backdrop-filter: blur(22px) saturate(1.1);
  border: 1px solid rgba(255,255,255,0.06); border-radius: 22px;
  /* Tinted red shadow that sits on the brand accent instead of generic
     black; inner top highlight to fake edge refraction (glassmorphism). */
  box-shadow:
    0 40px 100px -10px rgba(229,9,20,0.18),
    0 20px 40px rgba(0,0,0,0.55),
    inset 0 1px 0 rgba(255,255,255,0.05);
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
}
/* Staggered entry — each child cascades in on a small delay so the card
   doesn't pop into existence all at once. */
.offline-gate-card > * {
  opacity: 0; transform: translateY(6px);
  animation: offlineGateChildIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.offline-gate-card > *:nth-child(1) { animation-delay: 0.05s; }
.offline-gate-card > *:nth-child(2) { animation-delay: 0.13s; }
.offline-gate-card > *:nth-child(3) { animation-delay: 0.21s; }
.offline-gate-card > *:nth-child(4) { animation-delay: 0.29s; }
.offline-gate-card > *:nth-child(5) { animation-delay: 0.37s; }
@keyframes offlineGateChildIn { to { opacity: 1; transform: translateY(0); } }

/* Custom signal-loss SVG: 3 concentric arcs that fade from the outermost
   inward, then reset — reads as "signal degrading to nothing". Replaces
   the generic Lucide wifi-off cliché. */
.offline-gate-signal {
  width: 96px; height: 64px; color: var(--cd-accent, #e50914);
  margin-bottom: 22px;
}
.offline-gate-signal .sig-dot  { fill: currentColor; }
.offline-gate-signal .sig-arc  { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.offline-gate-signal .sig-arc-1 { animation: sigArcFade 2.4s ease-in-out -0.0s infinite; }
.offline-gate-signal .sig-arc-2 { animation: sigArcFade 2.4s ease-in-out -0.4s infinite; }
.offline-gate-signal .sig-arc-3 { animation: sigArcFade 2.4s ease-in-out -0.8s infinite; }
.offline-gate-signal .sig-dot   { animation: sigDotPulse 2.4s ease-in-out infinite; }
@keyframes sigArcFade {
  0%, 12%   { opacity: 0; transform: scale(0.8); }
  20%       { opacity: 0.95; transform: scale(1); }
  40%, 100% { opacity: 0; transform: scale(1.05); }
}
.offline-gate-signal .sig-arc { transform-origin: 48px 52px; }
@keyframes sigDotPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

.offline-gate-title {
  /* Bigger, tighter, more confident. text-wrap balance prevents orphans. */
  font-size: 30px; font-weight: 700; color: #f9fafb;
  letter-spacing: -0.025em; line-height: 1.1; margin: 0 0 12px;
  text-wrap: balance;
}
.offline-gate-msg {
  font-size: 14px; font-weight: 400; line-height: 1.55;
  color: rgba(255,255,255,0.58);
  max-width: 32ch; margin: 0 0 26px;
  text-wrap: pretty;
}
.offline-gate-btn {
  padding: 11px 28px; border-radius: 10px;
  font: inherit; font-size: 13px; font-weight: 600; letter-spacing: 0.005em;
  /* Solid accent — no gradient flicker. Cleaner. */
  background: var(--cd-accent, #e50914);
  border: 1px solid rgba(255,255,255,0.04); color: #fff; cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.18s, box-shadow 0.18s;
  box-shadow: 0 10px 28px -6px rgba(229,9,20,0.55), inset 0 1px 0 rgba(255,255,255,0.12);
  margin-bottom: 18px;
}
.offline-gate-btn:hover  { filter: brightness(1.08); transform: translateY(-1px); }
.offline-gate-btn:active { transform: translateY(0); filter: brightness(0.95); }
.offline-gate-btn:focus-visible { outline: 2px solid rgba(255,255,255,0.5); outline-offset: 3px; }
@keyframes offlineGateBtnShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}
.offline-gate-btn-shake { animation: offlineGateBtnShake 0.4s ease-in-out; }
/* Probe line — replaces the old all-caps OFFLINE pill. Tabular-nums for
   the live countdown so the digit jitter doesn't make the text shift. */
.offline-gate-probe {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; font-weight: 500; color: rgba(255,255,255,0.32);
  letter-spacing: 0; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.offline-gate-probe-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cd-accent, #e50914);
  box-shadow: 0 0 8px rgba(229,9,20,0.6);
  animation: offlineProbeDot 1.4s ease-in-out infinite;
}
@keyframes offlineProbeDot {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.85); }
}
/* While re-probing, swap dot for spinner-style ring */
.offline-gate-probe.is-probing .offline-gate-probe-dot {
  animation: none;
  background: transparent;
  border: 1.5px solid rgba(229,9,20,0.4);
  border-top-color: var(--cd-accent, #e50914);
  width: 10px; height: 10px;
  box-shadow: none;
  animation: offlineProbeSpin 0.7s linear infinite;
}
@keyframes offlineProbeSpin { to { transform: rotate(360deg); } }

/* Platform picker */
.platform-pick-list { display: flex; flex-direction: column; gap: 8px; }
.platform-pick-btn {
  width: 100%; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--bg-4); border: 1px solid var(--border);
  color: var(--text); font-size: 13px; font-weight: 600;
  text-align: left; transition: background var(--trans);
  display: flex; align-items: center; gap: 8px;
}
.platform-pick-btn:hover { background: var(--bg-3); }
.platform-pick-name { flex: 1; min-width: 0; }
.platform-pick-badge {
  flex-shrink: 0; padding: 2px 7px; border-radius: 999px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.10);
  color: var(--text-3); font-size: 10px; font-weight: 600;
  letter-spacing: 0.02em; text-transform: lowercase;
  white-space: nowrap;
}
.platform-pick-country { font-weight: 400; color: var(--text-3); font-size: 11px; }

/* Inline badges on the single-platform Watch button + country picker pills */
.sc-watch-svc { font-weight: 700; }
.sc-watch-badge {
  display: inline-block; margin-left: 8px;
  padding: 1px 7px; border-radius: 999px;
  background: rgba(255,255,255,0.14);
  font-size: 10px; font-weight: 600; letter-spacing: 0.02em;
  text-transform: lowercase; vertical-align: middle;
}
.avail-badge-name { font-weight: 600; }
.avail-badge-tag {
  margin-left: 6px;
  font-size: 10px; font-weight: 600; opacity: 0.7;
  text-transform: lowercase;
}

/* ══════════════════════════════════════════════════════
   STREAM STORE
   ══════════════════════════════════════════════════════ */
.page-header { padding: 36px 36px 24px; }
.page-title-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.page-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 42px; letter-spacing: 2px; color: var(--text);
}
.page-sub { font-size: 14px; color: var(--text-2); }

/* ══════════════════════════════════════════════════════
   STREAMSTORE — premium redesign
   ══════════════════════════════════════════════════════ */

/* Hero: ambient gradient panel that introduces the store with character.
   Replaces the default page-header + descriptive paragraph that was
   indistinguishable from any other tab. */
.store-hero {
  position: relative;
  padding: 56px 36px 40px;
  margin-bottom: 12px;
  overflow: hidden;
  isolation: isolate;
}
.store-hero-bg {
  position: absolute; inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 480px at 12% -10%, rgba(229,9,20,0.18), transparent 55%),
    radial-gradient(700px 420px at 95% 110%, rgba(76,90,238,0.10), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,0.02), transparent 60%);
}
.store-hero-bg::after {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.55 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/></svg>");
  opacity: 0.55;
  mix-blend-mode: overlay;
  pointer-events: none;
}
.store-hero-content { position: relative; max-width: 1200px; }
.store-eyebrow {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  letter-spacing: 3.2px;
  color: rgba(255,255,255,0.55);
  margin-bottom: 14px;
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 4px;
  background: rgba(255,255,255,0.025);
}
.store-hero-title {
  font-size: 44px; font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.022em;
  color: #fff;
  text-wrap: balance;
  margin-bottom: 14px;
  /* subtle shimmer to lift it off the panel — colour-matched not generic white */
  background: linear-gradient(180deg, #fff 0%, rgba(255,255,255,0.78) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}
.store-hero-sub {
  font-size: 15px; line-height: 1.5;
  color: var(--text-2);
  max-width: 56ch;
  margin-bottom: 24px;
}

.store-toolbar {
  display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.store-search-bar {
  position: relative;
  display: flex; align-items: center;
  flex: 0 1 420px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 0 12px 0 14px;
  height: 40px;
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.store-search-bar:focus-within {
  background: rgba(255,255,255,0.07);
  border-color: rgba(229,9,20,0.45);
  box-shadow: 0 0 0 4px rgba(229,9,20,0.10);
}
.store-search-icon {
  flex-shrink: 0;
  color: var(--text-3);
  margin-right: 8px;
}
.store-search-bar:focus-within .store-search-icon { color: var(--text); }
.store-search-input {
  flex: 1;
  height: 100%;
  background: none; border: none; outline: none;
  color: var(--text);
  font-size: 13px;
  min-width: 0;
}
.store-search-input::placeholder { color: var(--text-3); }
.store-search-clear {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  color: var(--text-3);
  background: rgba(255,255,255,0.06);
  transition: background 0.15s, color 0.15s;
}
.store-search-clear:hover { background: rgba(255,255,255,0.12); color: var(--text); }

.store-counter {
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.store-counter strong {
  font-weight: 700;
  color: var(--text-2);
}

.store-filter-chips {
  display: flex; flex-wrap: wrap;
  gap: 8px;
}
.store-chip {
  padding: 6px 14px;
  font-size: 12px; font-weight: 600;
  color: var(--text-2);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.store-chip:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.13);
  color: #fff;
}
.store-chip:active { transform: scale(0.96); }
.store-chip.active {
  background: linear-gradient(135deg, rgba(229,9,20,0.85), rgba(176,4,12,0.85));
  border-color: rgba(229,9,20,0.55);
  color: #fff;
  box-shadow: 0 4px 14px -4px rgba(229,9,20,0.55);
}

/* Section heading + count. Subtle so it doesn't compete with the cards. */
.store-section { margin-bottom: 16px; }
.store-section-hd {
  display: flex; align-items: baseline; gap: 12px;
  padding: 0 36px;
  margin-bottom: 18px;
}
.store-section .section-title {
  font-size: 18px; font-weight: 700;
  letter-spacing: -0.005em;
  color: #fff;
}
.store-section-count {
  font-size: 12px; font-weight: 600;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* Grid: a hair larger than before so the cards have room to breathe. */
.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
  padding: 0 36px 40px;
}

/* Card: cinematic logo block on the left, info on the right, install
   button as the primary action. The whole card is a "spotlight" surface
   that responds to the cursor with a brand-tinted border + shadow. */
.store-card {
  --svc-color: var(--accent);
  --svc-glow:  rgba(229,9,20,0.4);
  --mx: 50%; --my: 50%;
  position: relative;
  background:
    radial-gradient(220px circle at var(--mx) var(--my), rgba(255,255,255,0.04), transparent 70%),
    var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; align-items: center; gap: 16px;
  padding: 16px 18px;
  isolation: isolate;
  transition: transform 0.25s cubic-bezier(0.22,1,0.36,1),
              border-color 0.2s, box-shadow 0.25s, background 0.2s;
}
.store-card::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(200px circle at var(--mx) var(--my), var(--svc-color), transparent 60%);
  -webkit-mask: linear-gradient(#000,#000) content-box, linear-gradient(#000,#000);
          mask: linear-gradient(#000,#000) content-box, linear-gradient(#000,#000);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
}
.store-card:hover {
  transform: translateY(-3px);
  background:
    radial-gradient(280px circle at var(--mx) var(--my), rgba(255,255,255,0.06), transparent 70%),
    var(--bg-3);
  box-shadow:
    0 14px 40px -14px rgba(0,0,0,0.7),
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 24px 48px -24px var(--svc-glow);
}
.store-card:hover::before { opacity: 1; }

/* Regional highlight — the platforms available in the user's detected country.
   A persistent brand-tinted ring + soft glow so they stand out from the global
   catalogue without hiding anything else. */
.store-card.is-regional {
  border-color: color-mix(in srgb, var(--svc-color) 55%, var(--border));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--svc-color) 40%, transparent) inset,
    0 10px 34px -20px var(--svc-glow);
}
.store-card.is-regional:hover {
  box-shadow:
    0 14px 40px -14px rgba(0,0,0,0.7),
    0 0 0 1px color-mix(in srgb, var(--svc-color) 55%, transparent) inset,
    0 24px 48px -24px var(--svc-glow);
}
.store-card-regional-badge {
  flex-shrink: 0;
  padding: 2px 8px;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.04em;
  line-height: 1.5;
  text-transform: uppercase;
  color: #fff;
  background: color-mix(in srgb, var(--svc-color) 85%, #000);
  border: 1px solid color-mix(in srgb, var(--svc-color) 60%, transparent);
  border-radius: 999px;
  box-shadow: 0 2px 8px -2px var(--svc-glow);
  pointer-events: none;
}

/* Logo: bigger, uses the service brand gradient + a soft inner light to
   feel three-dimensional rather than a flat colour swatch. */
.store-card-logo {
  position: relative;
  width: 64px; height: 64px;
  border-radius: 14px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 900;
  font-family: 'Bebas Neue', sans-serif; letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.55);
  box-shadow:
    0 8px 22px -10px var(--svc-glow),
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 -10px 22px rgba(0,0,0,0.30);
  overflow: hidden;
}
.store-card-logo::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(255,255,255,0.18), transparent 45%);
  pointer-events: none;
}

.store-card-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.store-card-name-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.store-card-name {
  font-size: 16px; font-weight: 700;
  letter-spacing: -0.005em;
  color: #fff;
  min-width: 0; flex: 0 1 auto;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.store-card-desc {
  font-size: 12px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  line-height: 1.4;
}

/* Action: pill button with SVG icon. Two states (install / installed)
   communicated with colour, weight, and a subtle border. */
.store-card-action {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.01em;
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.15s, box-shadow 0.18s;
  flex-shrink: 0;
  white-space: nowrap;
}
.store-card-action svg { flex-shrink: 0; }
.store-card-action:active { transform: scale(0.96); }
.store-card-action.install {
  background: linear-gradient(135deg, var(--accent-h), var(--accent));
  color: #fff;
  box-shadow: 0 6px 14px -6px rgba(229,9,20,0.6);
  border: 1px solid rgba(255,255,255,0.10);
}
.store-card-action.install:hover {
  filter: brightness(1.07);
  box-shadow: 0 10px 22px -8px rgba(229,9,20,0.7);
}
.store-card-action.installed {
  background: rgba(255,255,255,0.04);
  color: var(--text-2);
  border: 1px solid rgba(255,255,255,0.10);
}
.store-card-action.installed:hover {
  background: rgba(229,9,20,0.10);
  color: var(--accent);
  border-color: rgba(229,9,20,0.35);
}

/* "Add your own" gets a deliberately different treatment: dashed border
   + softer fill so it reads as a CTA, not a service. */
.add-custom-card {
  background: rgba(255,255,255,0.018);
  border: 1.5px dashed rgba(255,255,255,0.12);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.25s;
}
.add-custom-card:hover {
  border-color: rgba(229,9,20,0.4);
  background: rgba(229,9,20,0.04);
  transform: translateY(-3px);
}
.add-custom-card .store-card-logo {
  background: rgba(255,255,255,0.04);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
  font-size: 28px; color: var(--text-2);
  font-family: inherit; font-weight: 400;
}
.add-custom-card:hover .store-card-logo {
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(229,9,20,0.3);
}

/* Search empty state */
.store-empty {
  margin: 0 36px 36px;
  padding: 28px 24px;
  border: 1px dashed rgba(255,255,255,0.10);
  border-radius: var(--radius);
  text-align: center;
}
.store-empty p {
  font-size: 13px; color: var(--text-3);
  margin-bottom: 14px;
}
.store-empty-cta {
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-2);
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.store-empty-cta:hover {
  background: rgba(229,9,20,0.10);
  color: var(--accent);
  border-color: rgba(229,9,20,0.35);
}

/* When a card is filtered out by search/chips it just disappears — using
   display:none rather than visibility so the grid reflows tightly. */
.store-card.is-filtered-out { display: none; }

/* "NEW" pill on the Mini Apps heading — sharper than the previous
   inline-styled pill, with a brand-accent gradient that ties back to
   the rest of the StreamStore palette. */
.store-new-pill {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 3px 8px;
  font-size: 10px; font-weight: 800;
  letter-spacing: 1.4px;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #4c5aee);
  border-radius: 4px;
  box-shadow: 0 4px 12px -4px rgba(76,90,238,0.55);
}

/* Responsive: on narrower windows fall back to single-column so the
   bigger cards don't get squished. */
@media (max-width: 720px) {
  .store-hero { padding: 36px 24px 28px; }
  .store-hero-title { font-size: 32px; }
  .store-grid       { grid-template-columns: 1fr; padding: 0 24px 32px; }
  .store-section-hd { padding: 0 24px; }
}

/* ══════════════════════════════════════════════════════
   AI DISCOVERY PAGE
   ══════════════════════════════════════════════════════ */
.ai-page-controls { padding: 0 36px 28px; }
#ai-tab-grid { padding: 0 36px 40px; }
#ai-tab-loading { padding: 40px 36px; }

/* ══════════════════════════════════════════════════════
   SETTINGS
   ══════════════════════════════════════════════════════ */
.settings-layout { padding: 0 36px 40px; display: flex; flex-direction: column; gap: 2px; }
.settings-block {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  margin-bottom: 12px;
}
.settings-block-title {
  font-size: 14px; font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase;
  color: var(--text-2); margin-bottom: 20px;
}
.settings-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 24px; padding: 0 0 16px;
}
.settings-row:last-child { padding-bottom: 0; }
.settings-row-label { flex: 1; font-size: 14px; font-weight: 500; }
.settings-hint { font-size: 12px; color: var(--text-3); margin-top: 4px; line-height: 1.5; }
.settings-row-control { flex: 1; display: flex; flex-direction: column; gap: 8px; }

/* Cross-surface presence list — one row per surface, status pill on the
   right. Used by the "Linked surfaces" settings block. Same visual
   language the TV settings panel uses. */
.surface-list { display: flex; flex-direction: column; }
.surface-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.surface-row:last-child { border-bottom: 0; padding-bottom: 0; }
.surface-row:first-child { padding-top: 0; }
.surface-name { font-size: 14px; font-weight: 500; }
.surface-meta { margin-top: 3px; font-size: 12px; color: var(--text-3); }
.surface-status {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 500;
  color: var(--text-3);
}
.surface-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-3);
}
.surface-status[data-status="active"] { color: #34d399; }
.surface-status[data-status="active"] .surface-dot {
  background: #34d399;
  box-shadow: 0 0 10px rgba(52,211,153,0.55);
}
.surface-status[data-status="idle"]  { color: var(--text-2); }
.surface-status[data-status="idle"]  .surface-dot { background: var(--text-2); }
.surface-status[data-status="offline"], .surface-status[data-status="loading"] {
  color: var(--text-3);
}

/* Pro features checklist shown in the Subscription block. */
.sub-features {
  list-style: none; padding: 0; margin: 12px 0 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 24px;
}
.sub-features li {
  font-size: 13px; color: var(--text-2);
  padding-left: 22px; position: relative;
}
.sub-features li::before {
  content: '';
  position: absolute; left: 0; top: 6px;
  width: 12px; height: 6px;
  border-left: 2px solid #34d399;
  border-bottom: 2px solid #34d399;
  transform: rotate(-45deg);
}
.input-group { display: flex; gap: 8px; }
.text-input {
  flex: 1; padding: 9px 14px; border-radius: var(--radius-sm);
  background: var(--bg-2); border: 1px solid var(--border);
  color: var(--text); font-size: 14px;
  transition: border-color var(--trans);
}
.text-input:focus { border-color: var(--accent); outline: none; }
.text-input::placeholder { color: var(--text-3); }
.select-input {
  padding: 9px 14px; border-radius: var(--radius-sm);
  background: var(--bg-2); border: 1px solid var(--border);
  color: var(--text); font-size: 14px;
  cursor: pointer;
}
.api-status { font-size: 12px; min-height: 18px; }
.api-status.ok { color: #1db954; }
.api-status.err { color: var(--accent); }

/* Settings → Profile block: compact summary of the CineDock profile */
.settings-cd-profile {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 12px 14px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.settings-cd-profile-summary { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.settings-cd-profile-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--bg-3); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0; color: var(--text-2);
}
.settings-cd-profile-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.settings-cd-profile-text { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.settings-cd-profile-username {
  font-size: 14px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.settings-cd-profile-bio {
  font-size: 12px; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Profiles list in settings (legacy — kept for safety, element no longer rendered) */
.profiles-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.profile-list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--bg-2); border: 1px solid var(--border);
}
.profile-list-avatar { font-size: 22px; }
.profile-list-name { flex: 1; font-size: 14px; font-weight: 500; }
.profile-list-current {
  font-size: 11px; color: var(--accent); font-weight: 600;
  background: var(--accent-dim); padding: 2px 8px; border-radius: 3px;
}
.profile-list-delete {
  color: var(--text-3); padding: 4px 8px;
  transition: color var(--trans); font-size: 16px;
}
.profile-list-delete:hover { color: var(--accent); }

.settings-about {
  font-size: 16px; font-weight: 600; margin-bottom: 4px;
}
.settings-version { color: var(--text-3); font-weight: 400; }
.settings-about-sub { font-size: 13px; color: var(--text-3); }

/* ══════════════════════════════════════════════════════
   BOTTOM NAVIGATION
   ══════════════════════════════════════════════════════ */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(8,10,15,0.96);
  backdrop-filter: blur(24px);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  z-index: 100; padding: 0 24px;
}
.nav-btn {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 10px 32px; border-radius: var(--radius);
  color: var(--text-3); font-size: 11px; font-weight: 500;
  letter-spacing: 0.3px; transition: all var(--trans);
  position: relative; min-width: 100px;
}
.nav-btn:hover { color: var(--text-2); background: var(--glass); }
.nav-btn.active { color: var(--text); background: var(--glass-h); }
.nav-btn.active::after {
  content: ''; position: absolute; bottom: -1px; left: 50%; transform: translateX(-50%);
  width: 32px; height: 2px; background: var(--accent); border-radius: 1px;
}
.nav-icon { width: 22px; height: 22px; transition: all var(--trans); }
.nav-btn.active .nav-icon { stroke: var(--accent); }


/* ══════════════════════════════════════════════════════
   MODALS
   ══════════════════════════════════════════════════════ */
.modal {
  position: fixed; inset: 0; z-index: 3000;
  display: flex; align-items: center; justify-content: center;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
}
.modal-box {
  position: relative; z-index: 1;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px;
  width: 440px; max-width: 90vw;
  box-shadow: 0 40px 80px rgba(0,0,0,0.8);
  animation: modal-in 0.2s ease;
}

/* ── SubsTracker · Edit titles modal — redesigned ──────────────────────── */
.st-edit-titles-box {
  width: 1100px; max-width: 96vw;
  max-height: 92vh;
  display: flex; flex-direction: column;
  padding: 28px 30px 26px;
  background:
    radial-gradient(720px 320px at 0% 0%, rgba(229,9,20,0.06), transparent 55%),
    var(--bg-card, var(--bg-2));
  border-radius: 22px;
  font-variant-numeric: tabular-nums;
  isolation: isolate;
}
.st-edit-titles-box::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: -1;
  border-radius: inherit; opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* Header strip: service chip + month counts */
.st-edit-header {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 6px;
}
.st-edit-svc-chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 12px 6px 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--st-svc, #888) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--st-svc, #888) 28%, transparent);
}
.st-edit-svc-dot {
  width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Bebas Neue', sans-serif; font-weight: 900; font-size: 13px;
  color: #fff; background: var(--st-svc, #888);
}
.st-edit-svc-name { font-size: 13px; font-weight: 700; letter-spacing: -0.005em; }
.st-edit-month-pill {
  margin-left: auto;
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  font-size: 12px; color: var(--text-3);
}
.st-edit-month-pill b { color: var(--text-1); font-weight: 700; font-size: 13px; }

/* Search row — icon-led input + dedicated date picker */
.st-edit-search-wrap {
  display: grid; grid-template-columns: minmax(0,1fr) auto;
  gap: 10px; margin: 16px 0 10px;
  position: relative;
}
.st-edit-search-field {
  position: relative; display: flex; align-items: center;
}
.st-edit-search-field svg.st-edit-search-icon {
  position: absolute; left: 14px; width: 16px; height: 16px;
  color: var(--text-3); pointer-events: none;
}
.st-edit-search-wrap .modal-input {
  width: 100%;
  padding-left: 40px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  font-size: 14px;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}
.st-edit-search-wrap .modal-input:focus {
  border-color: color-mix(in srgb, var(--cd-accent) 60%, var(--border));
  background: rgba(255,255,255,0.05);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cd-accent) 18%, transparent);
  outline: none;
}
.st-edit-date-field {
  display: flex; flex-direction: column; gap: 3px;
}
.st-edit-date-label {
  font-size: 10px; letter-spacing: 0.7px; text-transform: uppercase;
  font-weight: 600; color: var(--text-3);
}
.st-edit-search-wrap .st-edit-date-input {
  flex: 0 0 auto; min-width: 150px; height: 32px;
  color-scheme: dark;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

/* Live search dropdown */
.st-edit-search-dropdown {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-2);
  max-height: 320px; overflow-y: auto;
  margin-bottom: 12px;
  box-shadow: 0 18px 40px -16px rgba(0,0,0,0.6);
}
.st-edit-search-dropdown::-webkit-scrollbar { width: 6px; }
.st-edit-search-dropdown::-webkit-scrollbar-thumb { background: var(--border-h); border-radius: 3px; }
.st-edit-search-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 10px 14px;
  background: transparent; border: none;
  cursor: pointer; color: var(--text-1); text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s, transform 0.15s;
}
.st-edit-search-row:last-child { border-bottom: 0; }
.st-edit-search-row:hover {
  background: rgba(255,255,255,0.05);
  transform: translateX(2px);
}
.st-edit-search-row img,
.st-edit-search-noposter {
  flex: 0 0 auto;
  width: 42px; height: 62px;
  border-radius: 6px; object-fit: cover;
  background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px -4px rgba(0,0,0,0.5);
}
.st-edit-search-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.st-edit-search-title {
  font-size: 14px; font-weight: 700;
  letter-spacing: -0.005em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.st-edit-search-sub { font-size: 11px; color: var(--text-3); display: flex; gap: 8px; align-items: center; }
.st-edit-search-mt {
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--cd-accent); font-weight: 800; font-size: 10px;
  padding: 2px 6px; border-radius: 4px;
  background: color-mix(in srgb, var(--cd-accent) 14%, transparent);
}
.st-edit-search-empty { padding: 22px; text-align: center; color: var(--text-3); font-size: 13px; }

/* Episode picker — sits in the same slot as the search dropdown */
.st-edit-episode-picker {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-2);
  padding: 12px;
  margin-bottom: 10px;
  max-height: 320px;
  display: flex; flex-direction: column; gap: 10px;
}
.st-edit-ep-header { display: flex; gap: 10px; align-items: center; }
.st-edit-ep-poster { width: 40px; height: 60px; border-radius: 4px; object-fit: cover; }
.st-edit-ep-meta { flex: 1; min-width: 0; }
.st-edit-ep-meta h3 { font-size: 14px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-edit-ep-meta p  { font-size: 11px; color: var(--text-3); margin: 2px 0 0; }
.st-edit-ep-back {
  width: 24px; height: 24px; border-radius: 6px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-3); cursor: pointer; font-size: 16px; line-height: 1;
}
.st-edit-ep-back:hover { background: rgba(255,255,255,0.06); }
.st-edit-ep-actions { display: flex; gap: 8px; }
.st-edit-ep-whole {
  flex: 0 0 auto; padding: 0 14px;
  background: var(--cd-accent); border: none; border-radius: 8px;
  color: #fff; font-size: 12px; font-weight: 600; cursor: pointer;
}
.st-edit-ep-whole:hover { filter: brightness(1.1); }
.st-edit-ep-season { flex: 1; }
.st-edit-ep-list {
  flex: 1; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px;
}
.st-edit-ep-list::-webkit-scrollbar { width: 6px; }
.st-edit-ep-list::-webkit-scrollbar-thumb { background: var(--border-h); border-radius: 3px; }
.st-edit-ep-item {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 6px;
  color: var(--text-1); cursor: pointer;
  font-size: 12px; text-align: left;
}
.st-edit-ep-item:hover { background: rgba(255,255,255,0.07); border-color: var(--border-h); }
.st-edit-ep-num { flex: 0 0 64px; font-weight: 700; color: var(--cd-accent); font-variant-numeric: tabular-nums; }
.st-edit-ep-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Calendar — bigger cells, poster-led cards, today highlight */
.st-edit-cal-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin: 6px 0 12px;
}
.st-edit-cal-arrow {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  color: var(--text-1); cursor: pointer; font-size: 18px; line-height: 1;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}
.st-edit-cal-arrow:hover {
  background: rgba(255,255,255,0.07);
  border-color: var(--border-h);
  transform: translateY(-1px);
}
.st-edit-cal-arrow:active { transform: translateY(0); }
.st-edit-cal-month-label {
  flex: 1; text-align: center;
  font-size: 22px; font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: capitalize;
  font-variant-numeric: tabular-nums;
}

.st-edit-cal-grid {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 4px 2px 4px 0;
}
.st-edit-cal-grid::-webkit-scrollbar { width: 6px; }
.st-edit-cal-grid::-webkit-scrollbar-thumb { background: var(--border-h); border-radius: 3px; }
.st-edit-cal-wd-row,
.st-edit-cal-days {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px;
}
.st-edit-cal-wd {
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text-3);
  text-align: center; padding: 6px 0 10px;
}
.st-edit-cal-wd:nth-child(6),
.st-edit-cal-wd:nth-child(7) { color: color-mix(in srgb, var(--cd-accent) 70%, var(--text-3)); }

.st-edit-cal-cell {
  position: relative;
  min-height: 112px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 8px 8px 8px 10px;
  overflow: hidden;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms cubic-bezier(.34,1.56,.64,1);
}
.st-edit-cal-cell:nth-child(7n+6),
.st-edit-cal-cell:nth-child(7n) {
  background: rgba(255,255,255,0.015);
}
.st-edit-cal-cell:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--border-h);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px -14px rgba(0,0,0,0.6);
}
.st-edit-cal-cell.st-edit-cal-blank {
  background: transparent; border-color: transparent;
  cursor: default; pointer-events: none;
}
.st-edit-cal-cell.is-today {
  background: color-mix(in srgb, var(--cd-accent) 8%, transparent);
  border-color: color-mix(in srgb, var(--cd-accent) 45%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cd-accent) 12%, transparent);
}
.st-edit-cal-cell.is-today .st-edit-cal-daynum {
  color: var(--cd-accent);
}
.st-edit-cal-cell.has-entries {
  background: rgba(255,255,255,0.035);
  border-color: rgba(255,255,255,0.1);
}
.st-edit-cal-daynum {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 800;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.st-edit-cal-daynum::after {
  content: attr(data-count);
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--cd-accent) 18%, transparent);
  color: var(--cd-accent);
}
.st-edit-cal-cell:not(.has-entries) .st-edit-cal-daynum::after { content: none; }

.st-edit-cal-cards {
  position: relative;
  margin-top: 6px;
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 4px;
}
.st-edit-cal-card {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-3);
  cursor: default;
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 220ms ease;
  animation: st-edit-card-pop 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}
@keyframes st-edit-card-pop {
  from { transform: translateY(6px) scale(0.9); opacity: 0; }
  to   { transform: translateY(0)   scale(1);   opacity: 1; }
}
.st-edit-cal-card:hover {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 12px 28px -8px rgba(0,0,0,0.65),
              0 0 0 1px color-mix(in srgb, var(--cd-accent) 55%, transparent);
  z-index: 5;
}
.st-edit-cal-card img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.st-edit-cal-card-empty {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--text-3);
}
.st-edit-cal-card-cd::after {
  content: ''; position: absolute; top: 4px; left: 4px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cd-accent);
  box-shadow: 0 0 8px var(--cd-accent);
}
.st-edit-cal-card-meta {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 12px 4px 3px;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.88) 70%);
  display: flex; flex-direction: column; gap: 1px;
  pointer-events: none;
}
.st-edit-cal-card-title {
  font-size: 9px; font-weight: 700; color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.9);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  letter-spacing: -0.005em;
}
.st-edit-cal-card-sub {
  font-size: 8px; font-weight: 700;
  color: color-mix(in srgb, var(--cd-accent) 80%, white);
  font-variant-numeric: tabular-nums; letter-spacing: 0.04em;
}
.st-edit-cal-remove {
  position: absolute; top: 3px; right: 3px;
  width: 18px; height: 18px; padding: 0;
  background: rgba(0,0,0,0.6); border: none;
  border-radius: 50%;
  color: #fff; cursor: pointer;
  font-size: 12px; line-height: 1;
  opacity: 0; transform: scale(0.8);
  transition: opacity 160ms ease, transform 160ms ease, background 160ms ease;
}
.st-edit-cal-card:hover .st-edit-cal-remove {
  opacity: 1; transform: scale(1);
}
.st-edit-cal-remove:hover {
  background: var(--cd-accent);
}
.st-edit-cal-more {
  align-self: end;
  font-size: 11px; font-weight: 800;
  color: var(--cd-accent);
  padding: 4px 0 0 4px;
  letter-spacing: -0.01em;
}

/* ── Day editor (sub-modal) — redesigned ──────────────────────────────── */
.st-edit-day-overlay { z-index: 3010; }       /* stacks above the main Edit titles modal (z-index 3000) */
.st-edit-day-box {
  width: 720px; max-width: 92vw; max-height: 86vh;
  padding: 28px 30px 24px;
  display: flex; flex-direction: column;
  background:
    radial-gradient(520px 280px at 100% 0%, color-mix(in srgb, var(--cd-accent) 8%, transparent), transparent 60%),
    var(--bg-card, var(--bg-2));
  border-radius: 20px;
  font-variant-numeric: tabular-nums;
}
.st-edit-day-box .si-title {
  font-size: 22px; font-weight: 800; letter-spacing: -0.02em;
  text-transform: capitalize;
}
.st-edit-day-box .si-subtitle {
  font-size: 13px; color: var(--text-3);
}
.st-edit-day-list {
  flex: 1; min-height: 0; overflow-y: auto;
  margin-top: 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.st-edit-day-list::-webkit-scrollbar { width: 6px; }
.st-edit-day-list::-webkit-scrollbar-thumb { background: var(--border-h); border-radius: 3px; }
.st-edit-day-item {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms cubic-bezier(.34,1.56,.64,1);
  animation: st-edit-day-row-in 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.st-edit-day-item:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--border-h);
  transform: translateX(2px);
}
@keyframes st-edit-day-row-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.st-edit-day-item-cd {
  background: color-mix(in srgb, var(--cd-accent) 8%, rgba(255,255,255,0.03));
  border-color: color-mix(in srgb, var(--cd-accent) 22%, rgba(255,255,255,0.05));
}
.st-edit-day-poster {
  flex: 0 0 auto;
  width: 60px; height: 90px;
  border-radius: 8px; object-fit: cover;
  background: var(--bg-3);
  box-shadow: 0 6px 18px -6px rgba(0,0,0,0.6);
}
.st-edit-day-poster-empty {
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
}
.st-edit-day-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.st-edit-day-title {
  font-size: 15px; font-weight: 700; letter-spacing: -0.005em;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.st-edit-day-sub { font-size: 11px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-edit-day-se {
  font-weight: 800; letter-spacing: 0.04em; font-size: 10px;
  color: var(--cd-accent);
  background: color-mix(in srgb, var(--cd-accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--cd-accent) 30%, transparent);
  padding: 2px 8px; border-radius: 999px;
  text-transform: uppercase;
}
.st-edit-day-remove {
  flex: 0 0 auto;
  width: 32px; height: 32px; border-radius: 10px;
  background: transparent;
  color: var(--text-3); border: 1px solid var(--border);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; line-height: 1;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms ease;
}
.st-edit-day-remove:hover {
  background: color-mix(in srgb, var(--cd-accent) 14%, transparent);
  color: var(--cd-accent);
  border-color: color-mix(in srgb, var(--cd-accent) 35%, transparent);
  transform: rotate(90deg);
}

/* Make CineDock-sourced day-items obviously clickable */
.st-edit-day-item[data-cd-tmdb] { cursor: pointer; }
.st-edit-day-item[data-cd-tmdb]:hover {
  background: color-mix(in srgb, var(--cd-accent) 10%, rgba(255,255,255,0.04));
}
.st-edit-cal-card[data-cd-tmdb] { cursor: pointer; }

/* ── CineDock-source remove modal — stacks above the Edit titles modal ── */
.st-cd-remove-overlay { z-index: 3020; }
.st-cd-remove-box {
  width: 580px; max-width: 92vw;
  padding: 22px 26px 24px;
  border-radius: 20px;
  background:
    radial-gradient(420px 280px at 100% 0%, color-mix(in srgb, var(--cd-accent) 10%, transparent), transparent 60%),
    var(--bg-card, var(--bg-2));
  font-variant-numeric: tabular-nums;
}
.st-cd-remove-grid {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 22px; align-items: start;
  padding-top: 6px;
}
.st-cd-remove-poster {
  width: 132px; aspect-ratio: 2/3;
  border-radius: 12px; object-fit: cover;
  background: var(--bg-3);
  box-shadow: 0 16px 36px -14px rgba(0,0,0,0.7);
}
.st-cd-remove-poster-empty {
  display: flex; align-items: center; justify-content: center;
  font-size: 38px; color: var(--text-3);
}
.st-cd-remove-meta { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.st-cd-remove-source-tag {
  align-self: flex-start;
  font-size: 10px; font-weight: 800; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--cd-accent);
  padding: 3px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--cd-accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--cd-accent) 30%, transparent);
}
.st-cd-remove-title {
  margin: 2px 0 0;
  font-size: 22px; font-weight: 800;
  letter-spacing: -0.02em; line-height: 1.15;
  text-wrap: balance;
}
.st-cd-remove-sub {
  display: flex; gap: 6px; color: var(--text-3);
  font-size: 12px; margin: 0;
}
.st-cd-remove-explain {
  font-size: 13px; color: var(--text-2);
  line-height: 1.55; margin: 6px 0 4px;
  max-width: 60ch;
}
.st-cd-remove-explain b { color: var(--text-1); font-weight: 700; }
.st-cd-remove-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 12px;
}
.st-cd-remove-actions .btn-primary {
  background: var(--cd-accent);
  border-color: var(--cd-accent);
  color: #fff;
}
.st-cd-remove-actions .btn-primary:hover {
  filter: brightness(1.08);
}
.st-cd-remove-actions .btn-primary:disabled {
  opacity: 0.55; cursor: wait;
}

@media (max-width: 560px) {
  .st-cd-remove-grid { grid-template-columns: 1fr; }
  .st-cd-remove-poster { width: 110px; margin: 0 auto; }
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-title {
  font-size: 22px; font-weight: 700; margin-bottom: 6px;
}
.modal-subtitle {
  font-size: 13px; color: var(--text-3); margin: 0 0 20px 0;
}
.modal-field {
  margin-bottom: 14px;
}
.modal-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.modal-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.modal-input::placeholder { color: var(--text-3); }
.modal-input:focus { border-color: var(--border-h); }
.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px;
}
.field-group { margin-bottom: 16px; }
.field-label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.color-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.color-pill {
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; transition: border-color 0.15s, transform 0.1s;
}
.color-pill:hover { transform: scale(1.15); }
.color-pill.selected { border-color: #fff; }
.store-card-delete {
  background: none; border: none; cursor: pointer; font-size: 16px;
  opacity: 0.5; transition: opacity 0.15s; padding: 4px;
}
.store-card-delete:hover { opacity: 1; }
.add-custom-card {
  border: 1.5px dashed var(--border) !important;
  cursor: pointer; opacity: 0.7; transition: opacity 0.2s;
}
.add-custom-card:hover { opacity: 1; }

/* Avatar picker */
.avatar-section { margin-bottom: 8px; }
.selected-avatar {
  width: 72px; height: 72px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 38px; background: var(--bg-2); border: 1px solid var(--border);
  margin: 0 auto 16px;
}
.avatar-grid { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.av-opt {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; background: var(--bg-2); border: 2px solid transparent;
  transition: all var(--trans); cursor: pointer;
}
.av-opt:hover { border-color: var(--border-h); transform: scale(1.1); }
.av-opt.selected { border-color: var(--accent); background: var(--accent-dim); }

/* ══════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════ */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all var(--trans); border: none;
}
.btn-primary:hover { background: var(--accent-h); transform: translateY(-1px); box-shadow: 0 8px 20px rgba(229,9,20,0.35); }
.btn-primary:active { transform: none; }
.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  background: var(--glass); border: 1px solid var(--border);
  color: var(--text-2); font-size: 14px; font-weight: 500;
  transition: all var(--trans);
}
.btn-secondary:hover { background: var(--glass-h); color: var(--text); }
.btn-ghost {
  padding: 10px 18px; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 14px; font-weight: 500;
  transition: color var(--trans);
}
.btn-ghost:hover { color: var(--text); }
.btn-small {
  padding: 8px 16px; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff;
  font-size: 13px; font-weight: 600;
  transition: all var(--trans); flex-shrink: 0;
}
.btn-small:hover { background: var(--accent-h); }

/* ══════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ══════════════════════════════════════════════════════ */
.toast-container {
  position: fixed; bottom: calc(var(--nav-h) + 16px); right: 24px;
  z-index: 10000; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 18px;
  font-size: 14px; font-weight: 500; color: var(--text);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  animation: toast-in 0.25s ease;
  max-width: 340px; pointer-events: auto;
}
.toast.success { border-left: 3px solid #1db954; }
.toast.error   { border-left: 3px solid var(--accent); }
.toast.info    { border-left: 3px solid #00a8e0; }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(20px); }
}

/* ══════════════════════════════════════════════════════
   PRO / FREEMIUM COMPONENTS
   ══════════════════════════════════════════════════════ */

/* ── Pro badges ──────────────────────────────────────── */
.badge-pro {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff; font-size: 10px; font-weight: 800;
  letter-spacing: 1px; padding: 2px 7px; border-radius: 4px;
}
.badge-pro-lg {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.92);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 4px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-variant-numeric: tabular-nums;
}
.badge-pro-lg::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: var(--cd-accent, #e50914);
  box-shadow: 0 0 6px var(--cd-accent, #e50914);
}

/* ── Ad Banner ───────────────────────────────────────── */
.ad-banner {
  display: flex; align-items: center; gap: 12px;
  margin: 24px 36px 16px;
  padding: 12px 16px; border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(168,85,247,0.08));
  border: 1px solid rgba(124,58,237,0.3);
}
.ad-label {
  flex-shrink: 0;
  font-size: 9px; font-weight: 800; letter-spacing: 1.5px;
  padding: 2px 6px; border-radius: 3px;
  background: rgba(124,58,237,0.4); color: rgba(255,255,255,0.7);
}
.ad-text { flex: 1; font-size: 13px; color: var(--text-2); }
.ad-text strong { color: var(--text); }
.btn-upgrade-sm {
  flex-shrink: 0;
  padding: 6px 14px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff; font-size: 12px; font-weight: 600;
  transition: opacity var(--trans); border: none; cursor: pointer;
}
.btn-upgrade-sm:hover { opacity: 0.85; }
.ad-close-btn {
  flex-shrink: 0;
  color: var(--text-3); font-size: 14px; padding: 4px 6px;
  transition: color var(--trans);
}
.ad-close-btn:hover { color: var(--text); }

/* ── Smart Search Tab — centered hero → compact-on-search ────────────
   Two-state layout. Empty/idle: tall centered hero (title + big rounded
   search bar + chips, like Weather's pick-a-city). After the first
   search of the session JS adds `.has-results` to #tab-search and CSS
   animates the same elements down to a slimmer top-aligned bar, then
   the loading skeleton + cards flow under it.

   We animate `padding`, `font-size`, `max-width`, `border-radius` on the
   shared elements (no layout-thrash properties like height) using a
   single eased cubic-bezier so the collapse feels one motion. */
#tab-search .page-header {
  padding: clamp(56px, 7vw, 96px) 36px 18px;
  text-align: center;
  transition: padding 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
#tab-search .page-header .page-title-row {
  justify-content: center;
  margin-bottom: 12px;
  transition: margin-bottom 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
#tab-search .page-header .page-title {
  font-size: clamp(40px, 5.4vw, 64px);
  letter-spacing: 1px;
  text-wrap: balance;
  transition: font-size 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              letter-spacing 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
#tab-search .page-header .page-sub {
  max-width: 56ch;
  margin-left: auto;
  margin-right: auto;
  max-height: 80px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.35s ease,
              margin-top 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.search-bar-wrap {
  padding: 0 36px 32px;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  transition: max-width 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              padding 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.search-bar {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  padding: 5px 5px 5px 20px;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s,
              border-radius 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              padding 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.search-bar:focus-within {
  border-color: rgba(229,9,20,0.42);
  box-shadow: 0 0 0 4px rgba(229,9,20,0.10);
  background: rgba(255,255,255,0.06);
}
.search-input {
  flex: 1; padding: 13px 6px;
  background: transparent; border: none; outline: none;
  color: var(--text);
  font-size: clamp(14px, 1.4vw, 16px);
  font-family: inherit;
  transition: padding 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              font-size 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.search-input::placeholder { color: var(--text-3); }
.search-submit-btn {
  padding: 11px 22px;
  background: var(--cd-accent, #e50914);
  color: #fff; font-size: 13px; font-weight: 700;
  letter-spacing: 0.04em;
  border: none; border-radius: 13px; cursor: pointer; flex-shrink: 0;
  transition: background 0.15s, transform 0.1s,
              padding 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              border-radius 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              font-size 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.search-submit-btn:hover:not(:disabled) { background: #f01a25; }
.search-submit-btn:active:not(:disabled) { transform: scale(0.97); }
.search-submit-btn:disabled { opacity: 0.45; cursor: not-allowed; }
/* Examples row — chips in a single horizontal strip + a refresh button.
   The chips overflow horizontally and the user drag-scrolls them via the
   handler in app.js. Refresh button sits at the trailing edge and stays
   visible regardless of scroll. Strip persists in compact (`.has-results`)
   state too. */
.search-examples-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  transition: margin-top 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.search-examples {
  display: flex; gap: 8px; flex-wrap: nowrap;
  flex: 1; min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  cursor: grab;
  user-select: none;
  /* Soft fade on the edges so it reads as "more chips to the right" */
  mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
}
.search-examples::-webkit-scrollbar { display: none; }
.search-examples.grabbing { cursor: grabbing; }
.search-examples > * { flex-shrink: 0; }

.search-examples-refresh {
  flex-shrink: 0;
  width: 38px; height: 38px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.18s, color 0.18s, border-color 0.18s,
              transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.search-examples-refresh:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.18);
  color: #fff;
}
.search-examples-refresh:active { transform: scale(0.92); }
.search-examples-refresh svg { width: 15px; height: 15px; transition: transform .15s; }
.search-examples-refresh.spin svg { animation: search-refresh-spin .55s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes search-refresh-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Compact state — fires when JS adds .has-results to #tab-search ──
   Same elements, slimmer values. CSS transitions defined above carry the
   change as one smooth collapse. */
#tab-search.has-results .page-header {
  padding: 28px 36px 10px;
}
#tab-search.has-results .page-header .page-title-row {
  margin-bottom: 6px;
}
#tab-search.has-results .page-header .page-title {
  font-size: clamp(26px, 2.8vw, 34px);
  letter-spacing: 1.2px;
}
#tab-search.has-results .page-header .page-sub {
  max-height: 0;
  opacity: 0;
  margin-top: 0 !important;
}
#tab-search.has-results .search-bar-wrap {
  max-width: 100%;
  padding: 0 36px 20px;
}
#tab-search.has-results .search-bar {
  border-radius: 14px;
  padding: 4px 4px 4px 18px;
}
#tab-search.has-results .search-input {
  padding: 12px 6px;
  font-size: 14.5px;
}
#tab-search.has-results .search-submit-btn {
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 12.5px;
}
#tab-search.has-results .search-examples-row {
  margin-top: 12px;
}
.search-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px 7px 12px; border-radius: 999px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.09);
  color: var(--text-2); font-size: 12.5px;
  font-family: inherit; cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.18s;
}
.search-chip:hover {
  background: rgba(229,9,20,0.08);
  border-color: rgba(229,9,20,0.32);
  color: var(--text);
  transform: translateY(-1px);
}
.search-chip:active { transform: translateY(0); }
.search-chip-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; flex-shrink: 0;
  color: rgba(255,255,255,0.5);
  transition: color 0.18s;
}
.search-chip-icon svg { width: 100%; height: 100%; display: block; }
.search-chip:hover .search-chip-icon { color: rgba(255,255,255,0.9); }

/* Quota pill — promotes "X / Y Smart searches left today" from quiet
   grey text into a small status chip so the limit isn't easy to miss. */
.search-quota {
  display: none;
  margin-top: 14px;
  align-self: center;
  padding: 5px 11px 5px 9px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  color: var(--text-2); font-size: 11.5px;
  line-height: 1.4; align-items: center; gap: 6px;
  font-variant-numeric: tabular-nums;
  width: fit-content; max-width: 100%;
}
.search-quota:not(.hidden) { display: inline-flex; }
.search-quota::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,0.45);
  flex-shrink: 0;
}
.search-quota.sq-warning {
  color: #fcd34d;
  background: rgba(245,158,11,0.08);
  border-color: rgba(245,158,11,0.22);
}
.search-quota.sq-warning::before {
  background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,0.5);
}
.search-quota.sq-exhausted {
  color: #fca5a5;
  background: rgba(239,68,68,0.08);
  border-color: rgba(239,68,68,0.28);
}
.search-quota.sq-exhausted::before {
  background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,0.55);
}

/* ── Smart Search skeleton loading state ──────────────────────────────
   Mirrors the .sc-grid + .sc-card layout so the user sees the eventual
   result shape immediately instead of a centred spinner. */
.search-loading {
  padding: 0 36px 40px;
}
.search-loading.hidden { display: none; }
.search-loading-status {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 4px 0 18px;
  padding: 6px 12px 6px 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  color: var(--text-2); font-size: 12.5px;
}
.search-loading-pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--cd-accent, #e50914);
  box-shadow: 0 0 8px var(--cd-accent, #e50914);
  animation: search-loading-pulse 1.4s ease-in-out infinite;
}
@keyframes search-loading-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50%      { opacity: 1;   transform: scale(1.15); }
}
.search-loading-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}
.sc-skel-card {
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #181a22 0%, #0f1116 100%);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 14px; overflow: hidden;
}
.sc-skel-poster {
  width: 100%; aspect-ratio: 2 / 3;
  background: rgba(255,255,255,0.04);
  position: relative; overflow: hidden;
}
.sc-skel-poster::after,
.sc-skel-line::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg,
              transparent 0%,
              rgba(255,255,255,0.05) 50%,
              transparent 100%);
  transform: translateX(-100%);
  animation: skel-shimmer 1.6s ease-in-out infinite;
}
.sc-skel-body {
  padding: 12px 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.sc-skel-line {
  position: relative; overflow: hidden;
  height: 10px; border-radius: 4px;
  background: rgba(255,255,255,0.04);
}
.sc-skel-line.w30 { width: 30%; }
.sc-skel-line.w35 { width: 35%; }
.sc-skel-line.w38 { width: 38%; }
.sc-skel-line.w40 { width: 40%; }
.sc-skel-line.w42 { width: 42%; }
.sc-skel-line.w45 { width: 45%; }
.sc-skel-line.w50 { width: 50%; }
.sc-skel-line.w55 { width: 55%; }
.sc-skel-line.w60 { width: 60%; }
.sc-skel-line.w70 { width: 70%; }
.sc-skel-line.w75 { width: 75%; }
.sc-skel-line.w80 { width: 80%; }
.sc-skel-line:not([class*='w']) { width: 100%; }
@keyframes skel-shimmer {
  0%   { transform: translateX(-100%); }
  60%  { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}

/* ── Pro Gate ────────────────────────────────────────── */
.pro-gate {
  display: flex; flex-direction: column; align-items: center;
  gap: 16px; padding: 60px 36px; text-align: center;
  max-width: 480px; margin: 0 auto;
}
.pro-gate-icon {
  font-size: 48px; opacity: 0.5;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.pro-gate-title { font-size: 22px; font-weight: 700; }
.pro-gate-desc { font-size: 14px; color: var(--text-2); line-height: 1.6; }
.pro-gate-hint { font-size: 13px; color: var(--text-3); }
.btn-upgrade-lg {
  width: 100%; padding: 13px 24px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff; font-size: 15px; font-weight: 600;
  transition: opacity var(--trans); text-align: center;
  border: none; cursor: pointer; display: block;
}
.btn-upgrade-lg:hover { opacity: 0.85; }
.link-btn {
  background: none; border: none; cursor: pointer;
  color: rgba(168,85,247,0.9); font: inherit;
  text-decoration: underline; transition: color var(--trans);
}
.link-btn:hover { color: #a855f7; }

/* ── Search Results ──────────────────────────────────── */
.search-results { padding: 0; }
.search-match-card {
  margin: 0 36px 24px;
  background: var(--bg-card); border: 1px solid rgba(229,9,20,0.3);
  border-radius: var(--radius); padding: 20px;
  position: relative; overflow: hidden;
}
.search-match-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--accent, #e50914);
}
.search-match-eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: 0.5px;
  color: var(--accent, #e50914); margin-bottom: 8px; padding-left: 8px;
}
.search-match-body {
  padding-left: 8px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
}
.search-match-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.search-match-watch {
  flex-shrink: 0;
  padding: 9px 18px; border-radius: var(--radius-sm);
  background: var(--accent, #e50914);
  color: #fff; font-size: 13px; font-weight: 600;
  transition: opacity var(--trans); border: none; cursor: pointer;
}
.search-match-watch:hover { opacity: 0.85; }
.search-suggestions-heading {
  font-size: 14px; font-weight: 600; color: var(--text-2);
  padding: 0 36px 16px; letter-spacing: 0.3px;
}
.search-in-library {
  background: rgba(29,185,84,0.15); color: #1db954;
  border: 1px solid rgba(29,185,84,0.3);
  font-size: 11px; padding: 2px 8px; border-radius: 3px; font-weight: 500;
}
.search-not-library {
  background: var(--glass); color: var(--text-3);
  border: 1px solid var(--border);
  font-size: 11px; padding: 2px 8px; border-radius: 3px; font-weight: 500;
}

/* ── Search Poster Images ───────────────────────────────────────────────── */
.rec-card-poster {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
  object-position: center top;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
}
.search-match-poster {
  flex-shrink: 0;
  width: 90px;
  height: 132px;
  object-fit: cover;
  object-position: center top;
  border-radius: var(--radius-sm);
}
.search-match-info {
  flex: 1;
  min-width: 0;
}

/* ── Streaming Availability Text ────────────────────────────────────────── */
.rec-avail-local {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 500;
  color: #1db954;
}
.rec-avail-foreign {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-3);
}

/* ── Streaming Availability Pills ───────────────────────────────────── */
.avail-row { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.avail-label {
  font-size: 10px; font-weight: 500; color: var(--text-3);
  white-space: nowrap; margin-right: 2px;
}
.avail-label::before { content: '●'; color: #1db954; margin-right: 4px; font-size: 7px; vertical-align: middle; }
.avail-label-none { color: var(--text-3); }
.avail-label-none::before { color: var(--text-3); }
.avail-badge {
  font-size: 10px; font-weight: 500;
  padding: 2px 8px; border-radius: 4px;
  white-space: nowrap;
  background: var(--glass); color: var(--text-2);
  border: 1px solid var(--border);
}

/* ──────────────────────────────────────────────────────────────────────
   AI SEARCH CARDS — cinematic, brand-aware
   ────────────────────────────────────────────────────────────────────── */
.sc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}

.sc-card {
  --mx: 50%; --my: 50%;
  position: relative;
  display: flex; flex-direction: column;
  background:
    radial-gradient(180px circle at var(--mx) var(--my), rgba(255,255,255,0.05), transparent 70%),
    linear-gradient(180deg, #181a22 0%, #0f1116 100%);
  border-radius: 14px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.04) inset,
    0 18px 44px -18px rgba(0,0,0,0.65);
  transition: transform 0.32s cubic-bezier(0.22,1,0.36,1),
              box-shadow 0.32s cubic-bezier(0.22,1,0.36,1),
              border-color 0.2s;
}
/* Spotlight border that follows the cursor */
.sc-card::before {
  content: ''; position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(180px circle at var(--mx) var(--my),
              rgba(229,9,20,0.55), transparent 60%);
  -webkit-mask: linear-gradient(#000,#000) content-box, linear-gradient(#000,#000);
          mask: linear-gradient(#000,#000) content-box, linear-gradient(#000,#000);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none; opacity: 0;
  transition: opacity 0.3s;
}
.sc-card:hover {
  transform: translateY(-3px);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.05) inset,
    0 32px 80px -20px rgba(0,0,0,0.85);
}
.sc-card:hover::before { opacity: 1; }

/* ── Stage (poster + overlays) ──────────────────────────────────────── */
.sc-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #0a0c11;
}
.sc-stage.sc-no-poster {
  background:
    radial-gradient(circle at 50% 30%, rgba(229,9,20,0.18), transparent 60%),
    linear-gradient(180deg, #1a1d25 0%, #0a0c11 100%);
}
.sc-stage.sc-no-poster::after {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='6' width='18' height='13' rx='2'/><path d='M3 9.5h18'/><path d='M7 6L4.5 9.5M11 6 8.5 9.5M15 6l-2.5 3.5M19 6l-2.5 3.5'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 48px 48px;
  opacity: 0.20;
}
.sc-poster {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.6s cubic-bezier(0.22,1,0.36,1), filter 0.4s;
}
.sc-card:hover .sc-poster {
  transform: scale(1.04);
  filter: saturate(1.10) contrast(1.05);
}

/* Top floating chips */
.sc-stage-top {
  position: absolute; top: 12px; left: 12px; right: 12px;
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 8px; z-index: 2;
  pointer-events: none;
}
.sc-rating-pill {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 7px;
  font-size: 10px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #fde047;
  background: rgba(0,0,0,0.62);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  border: 1px solid rgba(253,224,71,0.22);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
.sc-rating-pill svg { display: block; flex-shrink: 0; }
.sc-type-pill {
  margin-left: auto;
  padding: 3px 7px;
  font-size: 8.5px; font-weight: 800; letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0,0,0,0.62);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 4px;
}

/* Bottom gradient + title */
.sc-overlay {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 40px 12px 11px;
  background: linear-gradient(180deg,
    rgba(15,17,22,0) 0%,
    rgba(15,17,22,0.55) 35%,
    rgba(15,17,22,0.92) 100%);
  z-index: 1;
}
.sc-title {
  margin: 0;
  font-size: 14.5px; font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: #fff;
  text-wrap: balance;
  text-shadow: 0 2px 10px rgba(0,0,0,0.6);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sc-overlay .sc-meta {
  margin-top: 3px;
  font-size: 10.5px; font-weight: 600;
  color: rgba(255,255,255,0.72);
  letter-spacing: 0.02em;
  display: flex; gap: 6px; flex-wrap: wrap;
}

/* ── Body (plot + watch row) ───────────────────────────────────────── */
.sc-body {
  padding: 11px 12px 12px;
  display: flex; flex-direction: column;
  gap: 10px;
  flex: 1;
}
.sc-plot {
  margin: 0;
  font-size: 11.5px;
  color: rgba(255,255,255,0.60);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-wrap: pretty;
}

/* ── Watch row (primary CTA + chips) ───────────────────────────────── */
.sc-watch-row {
  margin-top: auto;
  display: flex; flex-direction: column;
  gap: 7px;
}
.sc-watch-primary {
  --svc-color: #e50914;
  --svc-glow:  rgba(229,9,20,0.42);
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 9px 11px;
  font: inherit; font-size: 12px; font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
  background: linear-gradient(180deg, var(--svc-color) 0%, color-mix(in srgb, var(--svc-color) 75%, #000) 100%);
  border: none; border-radius: 10px;
  cursor: pointer;
  box-shadow:
    0 5px 14px -4px var(--svc-glow),
    inset 0 1px 0 rgba(255,255,255,0.18);
  transition: transform 0.12s, box-shadow 0.2s, filter 0.18s;
  position: relative; overflow: hidden;
}
.sc-watch-primary::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,0.18) 50%, transparent 65%);
  transform: translateX(-100%);
  transition: transform 0.6s cubic-bezier(0.22,1,0.36,1);
  pointer-events: none;
}
.sc-watch-primary:hover {
  filter: brightness(1.06);
  box-shadow:
    0 10px 28px -4px var(--svc-glow),
    inset 0 1px 0 rgba(255,255,255,0.20);
}
.sc-watch-primary:hover::after { transform: translateX(100%); }
.sc-watch-primary:active { transform: scale(0.97); }
.sc-watch-primary.is-loading { pointer-events: none; opacity: 0.75; }
.sc-watch-primary.is-loading::before {
  content: ''; position: absolute; right: 14px; top: 50%;
  width: 14px; height: 14px; margin-top: -7px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: sc-spin 0.7s linear infinite;
}
@keyframes sc-spin { to { transform: rotate(360deg); } }

.sc-watch-primary-logo {
  width: 18px; height: 18px;
  border-radius: 4px; flex-shrink: 0;
  background: rgba(255,255,255,0.10);
  object-fit: cover;
}
.sc-watch-primary-glyph {
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  background: rgba(255,255,255,0.16);
  font-size: 10px; flex-shrink: 0;
}
.sc-watch-primary-text {
  flex: 1; min-width: 0;
  text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sc-watch-primary-text strong { font-weight: 800; }
.sc-watch-primary-tag {
  flex-shrink: 0;
  padding: 2px 6px;
  font-size: 9px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: lowercase;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
}

/* "Apre il film sbagliato?" — inline report link below the primary
   watch button on each Smart-Search card. Subtle so it doesn't compete
   with the CTA, but visible enough to be discovered when needed. */
.sc-watch-report-link {
  align-self: flex-start;
  margin-top: 2px;
  padding: 2px 0;
  background: transparent; border: 0;
  font: inherit; font-size: 10.5px; font-weight: 500;
  color: rgba(255,255,255,0.32);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.16s;
}
.sc-watch-report-link:hover { color: #ffb84d; }

/* "also on" chip row */
.sc-watch-also {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  /* Reserve the chip-row height even when there are no extra platforms
     so the country chip below lines up across all cards in the grid. */
  min-height: 26px;
}
.sc-watch-also-placeholder {
  /* Empty placeholder — keeps the slot occupied without showing anything. */
  pointer-events: none;
}
.sc-watch-also-label {
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(255,255,255,0.38);
}
.sc-watch-chip {
  --chip-color: rgba(255,255,255,0.22);
  position: relative;
  width: 26px; height: 26px;
  padding: 0;
  border-radius: 7px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  transition: transform 0.18s, border-color 0.18s, background 0.18s;
}
.sc-watch-chip:hover {
  transform: translateY(-1px) scale(1.08);
  border-color: var(--chip-color);
  background: rgba(255,255,255,0.09);
}
.sc-watch-chip:active { transform: scale(0.94); }
/* While the chip is resolving its deep link — blocks re-clicks visually. */
.sc-watch-chip.is-loading { pointer-events: none; opacity: 0.55; }
.sc-watch-chip img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 6px;
}
.sc-watch-chip-glyph {
  font-size: 10px; font-weight: 800;
  color: #fff;
}
.sc-watch-chip-dot {
  position: absolute; top: 2px; right: 2px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #f4c430;
  box-shadow: 0 0 0 1.5px #0f1116;
}
.sc-watch-chip-more {
  font-size: 10px; font-weight: 700;
  color: rgba(255,255,255,0.7);
  letter-spacing: -0.01em;
}

/* Subtle country chip below the watch row */
.sc-country-chip {
  align-self: flex-start;
  display: inline-flex; align-items: center;
  margin-top: 2px;
  padding: 2px 8px;
  font-size: 8.5px; font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
}

/* Not-available block */
.sc-not-avail-block {
  margin-top: auto;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px dashed rgba(255,255,255,0.10);
  display: flex; flex-direction: column; gap: 4px;
}
.sc-not-avail-label {
  font-size: 11px; font-weight: 600;
  color: rgba(255,255,255,0.65);
}

/* ── IMDb (top-left) + Community (top-right) rating slots on AI cards ──
   Slots are always rendered so async fetches just populate them — keeps
   the top-row layout stable. Empty slots render nothing.                */
.sc-imdb-slot, .sc-community-slot, .sc-type-spacer { display: inline-flex; }
.sc-type-spacer { width: 0; height: 0; }
.sc-imdb-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f5c518, #d4a514);
  color: #0a0a0a;
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.2px;
  box-shadow: 0 3px 10px -3px rgba(0,0,0,0.5), 0 0 0 1px rgba(0,0,0,0.12) inset;
  pointer-events: none;
}
.sc-imdb-mark {
  font-size: 9px; font-weight: 900;
  letter-spacing: 0.5px;
  background: #0a0a0a;
  color: #f5c518;
  padding: 1px 4px;
  border-radius: 3px;
}
.sc-community-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(229,9,20,0.95), rgba(176,4,12,0.95));
  color: #fff;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.2px;
  box-shadow: 0 3px 12px -3px rgba(229,9,20,0.55), 0 0 0 1px rgba(255,255,255,0.10) inset;
  pointer-events: none;
}
.sc-community-pill .sc-cr-count,
.sc-hero-community .sc-cr-count {
  font-weight: 600; opacity: 0.85; font-size: 10px;
}
.sc-hero-imdb {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f5c518, #d4a514);
  color: #0a0a0a;
  font-size: 12px; font-weight: 800;
}

/* Card is now clickable to open CineDock modal */
.sc-card { cursor: pointer; }
/* But interactive children should not bubble up the card click */
.sc-card .sc-watch-row,
.sc-card .sc-watch-row * { cursor: default; }
.sc-card .sc-watch-primary,
.sc-card .sc-watch-chip,
.sc-card .sc-country-select { cursor: pointer; }

/* ──────────────────────────────────────────────────────────────────────
   AI SEARCH — Specific-title horizontal hero card + Similar choices row
   ────────────────────────────────────────────────────────────────────── */
.sc-hero {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  background:
    radial-gradient(420px circle at 0% 0%, rgba(229,9,20,0.12), transparent 60%),
    linear-gradient(180deg, #181a22 0%, #0f1116 100%);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.07);
  overflow: hidden;
  margin: 0 36px 24px;
  box-shadow: 0 24px 60px -22px rgba(0,0,0,0.7);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.2s;
}
.sc-hero:hover {
  transform: translateY(-2px);
  border-color: rgba(229,9,20,0.35);
  box-shadow: 0 32px 80px -22px rgba(0,0,0,0.85), 0 0 0 1px rgba(229,9,20,0.18);
}
.sc-hero-poster-wrap {
  position: relative;
  background: #0a0c11;
  aspect-ratio: 2 / 3;
  overflow: hidden;
}
.sc-hero-poster {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.sc-hero-poster-empty {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 60px; opacity: 0.2;
}
.sc-hero-body {
  padding: 22px 24px 22px 0;
  display: flex; flex-direction: column;
  min-width: 0;
}
.sc-hero-meta-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.sc-hero-year {
  font-size: 12px; color: var(--text-3); font-weight: 600;
}
.sc-hero-rating, .sc-hero-community {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.92);
}
.sc-hero-community {
  background: linear-gradient(135deg, rgba(229,9,20,0.85), rgba(176,4,12,0.85));
  color: #fff;
}
.sc-hero-community .sc-cr-count {
  font-weight: 600; opacity: 0.85; font-size: 10px;
}
.sc-hero-type-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(229,9,20,0.18);
  color: #ff8e94;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.4px; text-transform: uppercase;
}
.sc-hero-title {
  font-size: 26px; font-weight: 800;
  line-height: 1.15;
  margin: 4px 0 10px;
  color: #fff;
}
.sc-hero-plot {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-2);
  margin: 0 0 16px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sc-hero-actions {
  margin-top: auto;
  display: flex; flex-direction: column; gap: 10px;
}

/* Similar-choices section under the hero */
.sc-similar-section {
  margin: 8px 0 24px;
}
.sc-similar-heading {
  margin: 0 36px 14px;
  font-size: 15px; font-weight: 700;
  color: rgba(255,255,255,0.86);
  letter-spacing: 0.2px;
}
.sc-similar-grid {
  padding: 0 36px 8px;
}

/* "Show watched" toggle in the search bar */
.search-watched-toggle {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 16px;
  align-self: center;
  padding: 6px 10px 6px 8px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
  transition: color 0.2s, background 0.2s;
}
.search-watched-toggle:hover {
  color: #fff;
  background: rgba(255,255,255,0.04);
}
.search-watched-toggle input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}
.search-watched-toggle-track {
  position: relative;
  width: 32px; height: 18px;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  transition: background 0.2s;
  flex-shrink: 0;
}
.search-watched-toggle-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.search-watched-toggle input:checked + .search-watched-toggle-track {
  background: linear-gradient(135deg, #e50914, #b00811);
}
.search-watched-toggle input:checked + .search-watched-toggle-track .search-watched-toggle-thumb {
  transform: translateX(14px);
}
.search-watched-toggle input:focus-visible + .search-watched-toggle-track {
  box-shadow: 0 0 0 2px rgba(229,9,20,0.45);
}

/* ──────────────────────────────────────────────────────────────────────
   PLATFORM PICKER MODAL — premium reveal
   ────────────────────────────────────────────────────────────────────── */
.pp-modal {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.22s ease;
}
.pp-modal.pp-open { opacity: 1; pointer-events: auto; }
.pp-backdrop {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(229,9,20,0.10), transparent 60%),
    rgba(3,4,8,0.78);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
}
.pp-panel {
  position: relative; z-index: 1;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  display: flex; flex-direction: column;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(229,9,20,0.06), transparent 50%),
    linear-gradient(180deg, #15171f 0%, #0c0e14 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  box-shadow:
    0 60px 120px -24px rgba(0,0,0,0.92),
    0 0 0 0.5px rgba(229,9,20,0.18),
    inset 0 1px 0 rgba(255,255,255,0.07);
  overflow: hidden;
  transform: translateY(18px) scale(0.97);
  transition: transform 0.32s cubic-bezier(0.22,1,0.36,1);
}
.pp-modal.pp-open .pp-panel { transform: translateY(0) scale(1); }

/* Close button */
.pp-close {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.65);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.18s;
}
.pp-close:hover { background: rgba(255,255,255,0.14); color: #fff; transform: scale(1.06); }
.pp-close:active { transform: scale(0.94); }

/* Header */
.pp-header {
  display: flex; align-items: center; gap: 14px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: relative;
}
.pp-header::after {
  content: ''; position: absolute; left: 24px;
  bottom: -1px; width: 36px; height: 2px;
  background: linear-gradient(90deg, var(--cd-accent, #e50914), transparent);
  border-radius: 2px;
}
.pp-poster {
  flex-shrink: 0;
  width: 56px; height: 84px;
  border-radius: 7px;
  object-fit: cover;
  background: rgba(255,255,255,0.04);
  box-shadow: 0 6px 18px -6px rgba(0,0,0,0.6),
              0 0 0 1px rgba(255,255,255,0.06);
}
.pp-poster-empty {
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; opacity: 0.4;
}
.pp-meta {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.pp-eyebrow {
  font-size: 9.5px; font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--cd-accent, #e50914);
}
.pp-title {
  margin: 0;
  font-size: 16px; font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.18;
  color: #fff;
  text-wrap: balance;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pp-meta-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 2px;
  font-size: 11px; font-weight: 600;
}
.pp-meta-year   { color: rgba(255,255,255,0.55); }
.pp-meta-rating { color: #fde047; font-variant-numeric: tabular-nums; }
.pp-meta-country {
  margin-left: auto;
  padding: 2px 8px;
  font-size: 9px; font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.50);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
}

/* Body — scrollable list of grouped sections */
.pp-body {
  padding: 14px 18px 22px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.18) transparent;
}
.pp-body::-webkit-scrollbar { width: 6px; }
.pp-body::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.14); border-radius: 999px;
}

.pp-section + .pp-section { margin-top: 16px; }
.pp-section-label {
  margin: 0 4px 8px;
  font-size: 9.5px; font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.40);
}
.pp-rows {
  display: flex; flex-direction: column;
  gap: 6px;
}

/* Row — branded, hoverable, animated */
.pp-row {
  --svc: rgba(255,255,255,0.20);
  --svc-glow: rgba(255,255,255,0.10);
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px 10px 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  color: #fff;
  text-align: left;
  transition: background 0.18s, border-color 0.18s, transform 0.12s;
  overflow: hidden;
}
/* Brand-coloured left rail (3px) */
.pp-row::before {
  content: ''; position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--svc);
  box-shadow: 0 0 8px -1px var(--svc-glow);
  transition: width 0.18s, top 0.18s, bottom 0.18s;
}
.pp-row:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.14);
  transform: translateX(2px);
}
.pp-row:hover::before { top: 0; bottom: 0; width: 4px; }
.pp-row:active { transform: translateX(1px) scale(0.99); }

.pp-row.is-loading { pointer-events: none; opacity: 0.6; }
.pp-row.is-loading::after {
  content: ''; position: absolute; right: 16px; top: 50%;
  width: 14px; height: 14px; margin-top: -7px;
  border: 2px solid rgba(255,255,255,0.30);
  border-top-color: #fff;
  border-radius: 50%;
  animation: sc-spin 0.7s linear infinite;
}

.pp-row-logo {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 7px;
  object-fit: cover;
  background: rgba(255,255,255,0.08);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06);
}
.pp-row-glyph {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06);
}
.pp-row-name {
  flex: 1; min-width: 0;
  font-size: 13.5px; font-weight: 700;
  letter-spacing: -0.005em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pp-row-badge {
  flex-shrink: 0;
  padding: 3px 8px;
  font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: rgba(255,255,255,0.62);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
}
.pp-row-arrow {
  flex-shrink: 0;
  color: rgba(255,255,255,0.30);
  transition: transform 0.18s, color 0.18s;
}
.pp-row:hover .pp-row-arrow {
  color: var(--svc);
  transform: translateX(2px);
}

/* Footer with the "report wrong deeplink" toggle */
.pp-footer {
  padding: 10px 18px 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; justify-content: center;
}
.pp-report-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  color: rgba(255,255,255,0.48);
  font: inherit; font-size: 11.5px; font-weight: 600;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}
.pp-report-toggle:hover {
  color: rgba(255,255,255,0.85);
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.04);
}
.pp-report-toggle[data-mode="on"] {
  color: #ffb84d;
  border-color: rgba(255,184,77,0.40);
  background: rgba(255,184,77,0.10);
}

/* Visual cue when picker is in "report wrong film" mode */
.pp-modal--report .pp-panel { box-shadow: 0 0 0 1px rgba(255,184,77,0.35), 0 24px 64px rgba(0,0,0,0.55); }
.pp-modal--report .pp-row {
  border-color: rgba(255,184,77,0.18);
}
.pp-modal--report .pp-row:hover {
  background: rgba(255,184,77,0.08);
  border-color: rgba(255,184,77,0.45);
}

@media (max-width: 480px) {
  .pp-header { padding: 18px 18px 14px; gap: 12px; }
  .pp-poster { width: 48px; height: 72px; }
  .pp-title  { font-size: 15px; }
  .pp-body   { padding: 12px 14px 18px; }
}

.platform-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-h);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  min-width: 160px;
  z-index: 100;
  overflow: hidden;
}
.platform-menu.open { display: block; }
.platform-menu-item {
  display: block;
  width: 100%;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text-1);
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  transition: background var(--trans);
}
.platform-menu-item:hover { background: var(--glass); }

/* Not available / country picker */
.sc-not-avail  { font-size: 11px; color: var(--text-3); }
.sc-vpn-hint   { font-size: 11px; color: var(--text-3); opacity: 0.6; display: block; margin-top: 2px; }
.sc-not-avail-wrap {
  /* Mirrors .sc-watch-row so cards without a streaming platform line
     up vertically with cards that have one: combo on the top row
     (same baseline as "Watch on …"), spacer in the middle (same as
     "also on"), and the "Not available in <country>" label at the
     bottom (same baseline as the country chip). */
  margin-top: auto;
  display: flex; flex-direction: column;
  gap: 7px;
}

/* ── Searchable country combobox (replaces native <select>) ──────────── */
.sc-country-combo {
  position: relative;
  width: 100%;
}
.sc-country-combo-input {
  width: 100%;
  padding: 8px 32px 8px 12px;
  font-size: 12px;
  color: var(--text-1, #e6e6ea);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  outline: none;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.sc-country-combo-input::placeholder {
  color: var(--text-3, rgba(230,230,234,0.45));
}
.sc-country-combo-input:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.13);
}
.sc-country-combo.open .sc-country-combo-input,
.sc-country-combo-input:focus {
  background: rgba(255,255,255,0.08);
  border-color: rgba(229,9,20,0.45);
  box-shadow: 0 0 0 3px rgba(229,9,20,0.10);
}
.sc-country-combo-caret {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  color: var(--text-3, rgba(230,230,234,0.55));
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.18s ease, color 0.15s;
  padding: 4px;
}
.sc-country-combo-caret:hover { color: #fff; }
.sc-country-combo.open .sc-country-combo-caret {
  transform: translateY(-50%) rotate(180deg);
  color: #fff;
}
.sc-country-combo-panel {
  position: fixed;
  z-index: 9999;
  max-height: 240px;
  overflow-y: auto;
  background: #1a1d25;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  box-shadow: 0 16px 40px -12px rgba(0,0,0,0.7);
  padding: 4px;
}
.sc-country-combo-panel::-webkit-scrollbar { width: 6px; }
.sc-country-combo-panel::-webkit-scrollbar-track { background: transparent; }
.sc-country-combo-panel::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
}
.sc-country-combo-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.15);
}
.sc-country-combo-row {
  padding: 7px 10px;
  font-size: 12px;
  color: var(--text-2, rgba(230,230,234,0.78));
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.sc-country-combo-row:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
}
.sc-country-combo-empty {
  padding: 10px;
  text-align: center;
  font-size: 11px;
  color: var(--text-3, rgba(230,230,234,0.45));
}
.sc-country-platforms {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.sc-avail-loading {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  color: var(--text-3, rgba(230,230,234,0.45));
  font-style: italic;
}

/* ── Home: CineDock-driven sections (Watchlist + Suggestions) ───────── */
/* Push the section away from the services grid above. The previous 0
   padding-top let the filter chips overlap the bottom of the services
   row when the chips wrapped onto a second line. */
.home-cd-section { padding-top: 18px; margin-top: 8px; }
.home-cd-section-hd {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  /* Same horizontal padding as the section title so the chips line up
     with everything else and don't visually crash into the services row. */
  margin-bottom: 10px;
}
.home-cd-filter-chips {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.home-cd-chip {
  padding: 5px 11px;
  font-size: 11px; font-weight: 600;
  color: var(--text-2, rgba(230,230,234,0.78));
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.home-cd-chip:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-color: rgba(255,255,255,0.13);
}
.home-cd-chip.active {
  background: linear-gradient(135deg, rgba(229,9,20,0.85), rgba(176,4,12,0.85));
  color: #fff;
  border-color: rgba(229,9,20,0.55);
  box-shadow: 0 2px 10px -2px rgba(229,9,20,0.45);
}
/* Legacy grid layout — kept in case some callers still reference it. */
.home-cd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  padding: 4px 36px 24px;
}

/* ── Drag-to-scroll horizontal row ─────────────────────────────────── */
.home-cd-row-wrap {
  position: relative;
  padding: 4px 0 24px;
}
.home-cd-row {
  display: flex;
  gap: 14px;
  padding: 4px 36px;
  overflow-x: auto;
  overflow-y: hidden;
  cursor: grab;                   /* hint: drag to scroll */
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* IE / old Edge */
  -webkit-user-select: none;
          user-select: none;
}
.home-cd-row::-webkit-scrollbar { display: none; } /* Chromium */
.home-cd-row.home-cd-row-grabbing {
  cursor: grabbing;
}
.home-cd-row > .home-cd-card,
.home-cd-row > .home-cd-card-skel {
  flex: 0 0 168px;                /* fixed width, no shrink */
  width: 168px;
}
.home-cd-row > .home-cd-empty {
  flex: 1 1 auto;
  margin: 0 36px;
}
/* Disable native image dragging inside cards so the drag-to-scroll
   gesture doesn't start a ghost-image drag of the poster. */
.home-cd-row img { -webkit-user-drag: none; user-drag: none; }
.home-cd-card {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(180deg, #181a22, #0f1116);
  border: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.22,1,0.36,1),
              border-color 0.2s, box-shadow 0.25s;
  box-shadow: 0 8px 24px -10px rgba(0,0,0,0.6);
}
.home-cd-card:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: rgba(229,9,20,0.35);
  box-shadow: 0 18px 40px -14px rgba(0,0,0,0.85), 0 0 0 1px rgba(229,9,20,0.18);
}
/* "In progress" badge — partially-watched series in the home watchlist row. */
.home-cd-inprogress {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  padding: 3px 7px; border-radius: 5px;
  background: var(--cd-accent, #e50914); color: #fff;
  font-size: 9px; font-weight: 800; letter-spacing: 0.4px; text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5); pointer-events: none;
  max-width: calc(100% - 16px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.home-cd-poster {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: filter 0.3s, transform 0.5s cubic-bezier(0.22,1,0.36,1);
}
.home-cd-card:hover .home-cd-poster {
  filter: saturate(1.10) contrast(1.05);
  transform: scale(1.04);
}
/* "Not interested" button — sits in the top-right corner of suggestion
   cards, revealed on hover so it never competes with the rating badges. */
.home-cd-dismiss {
  position: absolute; top: 6px; right: 6px;
  z-index: 4;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  border: none; border-radius: 50%;
  background: rgba(8,9,12,0.82);
  color: #fff;
  cursor: pointer;
  opacity: 0; transform: scale(0.8);
  transition: opacity 0.14s, transform 0.14s, background 0.14s;
}
.home-cd-card:hover .home-cd-dismiss { opacity: 1; transform: scale(1); }
.home-cd-dismiss:hover { background: rgba(229,9,20,0.92); }
/* Collapse-out animation when a suggestion is dismissed. */
.home-cd-card-removing {
  opacity: 0; transform: scale(0.86);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
/* IMDb (top-left) + community (top-right) slots — same visual language
   as the AI-search cards, smaller scale because home posters are smaller. */
.home-cd-stage-top {
  position: absolute; top: 8px; left: 8px; right: 8px;
  z-index: 2;
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 6px;
  pointer-events: none;
}
.home-cd-imdb-slot, .home-cd-community-slot { display: inline-flex; }
.home-cd-poster-empty {
  display: flex; align-items: center; justify-content: center;
  font-size: 38px;
  opacity: 0.25;
  background:
    radial-gradient(circle at 50% 30%, rgba(229,9,20,0.15), transparent 60%),
    linear-gradient(180deg, #1a1d25 0%, #0a0c11 100%);
}
.home-cd-overlay {
  position: absolute; inset: auto 0 0 0;
  padding: 28px 12px 10px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.85) 70%);
  pointer-events: none;
}
.home-cd-title {
  font-size: 12px; font-weight: 700;
  color: #fff;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.home-cd-year {
  margin-top: 2px;
  font-size: 10px;
  color: rgba(255,255,255,0.65);
  font-weight: 600;
}
/* "Why we recommend this" — server-localized one-liner on suggestion
   cards. Accent-tinted so it reads as insight, not metadata. */
.home-cd-reason {
  margin-top: 3px;
  font-size: 9.5px;
  font-style: italic;
  color: rgba(255, 159, 159, 0.92);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.home-cd-skeleton {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  padding: 4px 36px 24px;
}
.home-cd-card-skel {
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  background: linear-gradient(110deg, rgba(255,255,255,0.04) 30%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 70%);
  background-size: 200% 100%;
  animation: home-cd-shimmer 1.4s ease-in-out infinite;
}
@keyframes home-cd-shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.home-cd-empty {
  padding: 24px 36px 32px;
  font-size: 12px;
  color: var(--text-3, rgba(230,230,234,0.5));
  font-style: italic;
}

/* (i) info button next to the Suggestions section title */
.home-cd-info-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  margin-left: 6px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  color: var(--text-2, rgba(230,230,234,0.7));
  cursor: pointer;
  vertical-align: middle;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.home-cd-info-btn:hover {
  background: rgba(255,255,255,0.10);
  color: #fff;
  border-color: rgba(255,255,255,0.18);
}
.home-cd-info-popover {
  position: fixed;
  z-index: 9999;
  max-width: 320px;
  padding: 12px 14px;
  background: #1a1d25;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  box-shadow: 0 16px 40px -12px rgba(0,0,0,0.7);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-2, rgba(230,230,234,0.85));
}

/* ── Letterboxd-import username collision picker ───────────────────────── */
.cd-uname-picker-modal {
  position: fixed; inset: 0;
  z-index: 10000;
  display: flex; align-items: center; justify-content: center;
}
.cd-uname-picker-backdrop {
  position: absolute; inset: 0;
  background: rgba(3,4,8,0.78);
  backdrop-filter: blur(12px) saturate(1.10);
  -webkit-backdrop-filter: blur(12px) saturate(1.10);
}
.cd-uname-picker-box {
  position: relative;
  width: min(440px, 92vw);
  max-height: 86vh;
  overflow-y: auto;
  padding: 24px;
  border-radius: 16px;
  background: linear-gradient(180deg, #181a22 0%, #0f1116 100%);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 32px 80px -20px rgba(0,0,0,0.85);
}
.cd-uname-picker-title {
  margin: 0 0 8px;
  font-size: 17px; font-weight: 800;
  color: #fff;
}
.cd-uname-picker-desc {
  margin: 0 0 16px;
  font-size: 13px; line-height: 1.55;
  color: var(--text-2, rgba(230,230,234,0.78));
}
.cd-uname-picker-suggestions {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 18px;
}
.cd-uname-suggestion {
  padding: 7px 12px;
  font-size: 13px; font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, rgba(229,9,20,0.20), rgba(176,4,12,0.18));
  border: 1px solid rgba(229,9,20,0.32);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, border-color 0.15s;
}
.cd-uname-suggestion:hover {
  background: linear-gradient(135deg, rgba(229,9,20,0.85), rgba(176,4,12,0.85));
  border-color: rgba(229,9,20,0.7);
  transform: translateY(-1px);
}
.cd-uname-picker-custom {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding-top: 16px;
  margin-bottom: 18px;
}
.cd-uname-picker-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px; font-weight: 600;
  color: var(--text-3, rgba(230,230,234,0.6));
}
.cd-uname-picker-input {
  width: 100%;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text-1, #e6e6ea);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.cd-uname-picker-input:focus {
  background: rgba(255,255,255,0.08);
  border-color: rgba(229,9,20,0.45);
  box-shadow: 0 0 0 3px rgba(229,9,20,0.10);
}
.cd-uname-picker-status {
  min-height: 16px;
  margin-top: 6px;
  font-size: 11px; font-weight: 600;
  color: var(--text-3);
}
.cd-uname-picker-status-ok  { color: #5ad17b; }
.cd-uname-picker-status-bad { color: #ff8e94; }
.cd-uname-picker-actions {
  display: flex; gap: 10px; justify-content: flex-end;
}
.cd-uname-picker-actions .btn-secondary,
.cd-uname-picker-actions .btn-primary {
  padding: 9px 18px;
  font-size: 13px;
}

/* Pro gate shown to free users in place of the watchlist + suggestions */
.home-cd-pro-gate {
  margin: 8px 36px 24px;
  padding: 28px 28px 26px;
  background:
    radial-gradient(420px circle at 0% 0%, rgba(229,9,20,0.10), transparent 60%),
    linear-gradient(180deg, #181a22 0%, #0f1116 100%);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.07);
  box-shadow: 0 24px 60px -22px rgba(0,0,0,0.7);
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  gap: 6px;
}
.home-cd-pro-gate-icon {
  font-size: 26px;
  background: linear-gradient(135deg, #ff8e94, #e50914);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
  margin-bottom: 6px;
}
.home-cd-pro-gate-title {
  margin: 0;
  font-size: 16px; font-weight: 800;
  color: #fff;
  letter-spacing: -0.2px;
}
.home-cd-pro-gate-desc {
  margin: 4px 0 14px;
  font-size: 12px; line-height: 1.55;
  color: var(--text-2, rgba(230,230,234,0.78));
  max-width: 540px;
}

/* ── Home History (Continue Watching / Suggested For You) — legacy ──── */
.home-history-section { padding-top: 0; }
.home-history-scroll {
  display: flex; gap: 12px; overflow-x: auto;
  padding: 4px 36px 20px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.home-history-scroll::-webkit-scrollbar { height: 4px; }
.home-history-scroll::-webkit-scrollbar-track { background: transparent; }
.home-history-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.home-hist-card {
  flex-shrink: 0;
  width: 130px; height: 190px;
  border-radius: 8px; overflow: hidden;
  cursor: pointer; position: relative;
  scroll-snap-align: start;
  transition: transform 0.2s ease, border-color 0.2s;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.home-hist-card:hover { transform: scale(1.04); border-color: var(--border-h); }
.home-hist-thumb { position: absolute; inset: 0; }
.home-hist-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.home-hist-thumb-noposter {
  display: flex; align-items: center; justify-content: center;
  height: 100%;
  font-size: 40px; font-weight: 800; color: rgba(255,255,255,0.1);
  text-transform: uppercase;
}
.home-hist-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.25) 55%, transparent 100%);
  padding: 10px;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.home-hist-play {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,0.15); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #fff; opacity: 0;
  transition: opacity 0.2s;
  border: 1px solid rgba(255,255,255,0.25);
}
.home-hist-card:hover .home-hist-play { opacity: 1; }
.hist-card-unavailable {
  position: absolute; inset: 0; z-index: 4;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 8px;
  border-radius: 8px;
}
.hist-card-unavailable span {
  font-size: 10px; font-weight: 600; color: rgba(255,255,255,0.7);
  line-height: 1.4;
}
.hist-card-dismiss {
  position: absolute; top: 5px; right: 5px; z-index: 10;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.7); font-size: 9px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0;
  transition: opacity 0.15s, background 0.15s;
}
.home-hist-card:hover .hist-card-dismiss { opacity: 1; }
.hist-card-dismiss:hover { background: rgba(200,40,40,0.75); color: #fff; }
@keyframes hist-card-out {
  to { opacity: 0; transform: scale(0.85); }
}
.hist-card-dismissed { animation: hist-card-out 0.2s ease forwards; pointer-events: none; }
.home-hist-title {
  font-size: 11px; font-weight: 700; color: #fff; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.home-hist-meta { display: flex; gap: 5px; align-items: center; margin-top: 3px; }
.home-hist-platform { font-size: 10px; font-weight: 600; }
.home-hist-year { font-size: 10px; color: rgba(255,255,255,0.45); }

/* ── Pro Required (search gate) ─────────────────────────────────────────── */
.pro-required-modal {
  margin: 24px 36px;
  padding: 32px 24px;
  background: var(--bg-card);
  border: 1px solid rgba(124,58,237,0.3);
  border-radius: var(--radius);
  text-align: center;
}
.pro-required-msg {
  font-size: 15px;
  color: var(--text-2);
  margin-bottom: 20px;
}
.upgrade-btn {
  padding: 11px 28px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity var(--trans);
}
.upgrade-btn:hover { opacity: 0.85; }

/* ── Upgrade Modal ───────────────────────────────────── */
.upgrade-modal-box { text-align: center; }
.upgrade-header {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  margin-bottom: 24px;
}
.upgrade-features {
  list-style: none; text-align: left;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--bg-2); border-radius: var(--radius-sm);
  padding: 16px 20px; margin-bottom: 20px;
}
.upgrade-features li { font-size: 14px; color: var(--text-2); }
.upgrade-currency-row {
  display: flex; justify-content: flex-end; margin-bottom: 10px;
}
.currency-select {
  background: var(--surface-2, #1e2130); border: 1px solid var(--border);
  color: var(--text-2); font-size: 12px; padding: 5px 8px; border-radius: 6px;
  cursor: pointer; outline: none; transition: border-color .2s;
}
.currency-select:hover, .currency-select:focus { border-color: var(--accent); }
.currency-select option { background: var(--bg); }
.upgrade-plans {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-bottom: 4px;
}
.upgrade-plan {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 20px 16px 16px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.upgrade-plan-popular {
  border-color: rgba(124,58,237,0.7);
  background: linear-gradient(160deg, rgba(124,58,237,0.13), rgba(168,85,247,0.06));
  box-shadow: 0 0 0 1px rgba(124,58,237,0.25), 0 8px 28px rgba(124,58,237,0.18);
  padding-top: 28px;
}
.upgrade-plan-savings {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  padding: 3px 10px; border-radius: 20px; white-space: nowrap;
}
.upgrade-plan-name {
  font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-2);
}
.upgrade-plan-price {
  display: flex; align-items: baseline; gap: 3px;
}
.upgrade-plan-amount { font-size: 28px; font-weight: 700; }
.upgrade-plan-period { font-size: 13px; color: var(--text-2); }
.upgrade-plan-then  { font-size: 11px; color: var(--text-3); font-weight: 500; }
.upgrade-plan-equiv { font-size: 11px; color: var(--text-3); }
.upgrade-plan-save-badge {
  display: inline-block; vertical-align: middle;
  font-size: 10px; font-weight: 700; letter-spacing: 0.3px;
  color: #a855f7; background: rgba(168,85,247,0.14);
  border: 1px solid rgba(168,85,247,0.35);
  border-radius: 4px; padding: 1px 6px;
  margin-left: 5px; text-transform: none;
}
.upgrade-plan-trial-badge {
  font-size: 11px; font-weight: 600; letter-spacing: 0.3px;
  color: #a855f7; background: rgba(168,85,247,0.10);
  border: 1px solid rgba(168,85,247,0.28);
  border-radius: 20px; padding: 3px 11px;
}
.upgrade-plan-trial-note {
  font-size: 10px; color: var(--text-3);
  margin: 0; text-align: center; line-height: 1.4;
}
.btn-upgrade-outline {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid rgba(168,85,247,0.5);
  color: #a855f7; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background var(--trans), border-color var(--trans);
}
.btn-upgrade-outline:hover { background: rgba(168,85,247,0.1); border-color: #a855f7; }

/* ── License Modal ───────────────────────────────────── */
.license-error {
  font-size: 13px; color: var(--accent);
  background: var(--accent-dim); padding: 8px 12px; border-radius: var(--radius-sm);
}

/* ── Settings Plan Badges ────────────────────────────── */
.plan-badge {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; letter-spacing: 1px;
  padding: 4px 12px; border-radius: 6px;
}
.plan-badge-free {
  background: var(--glass); color: var(--text-2); border: 1px solid var(--border);
}
.plan-badge-pro {
  background: linear-gradient(135deg, #7c3aed, #a855f7); color: #fff;
}
.pro-active-text {
  font-size: 13px; color: #a855f7; margin-top: 8px;
}

/* ══════════════════════════════════════════════════════
   PROFILE EDITOR MODAL
   ══════════════════════════════════════════════════════ */

.profile-editor-box {
  position: relative; z-index: 1;
  background: #0e1018;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  width: 620px; max-width: 95vw;
  max-height: 90vh; overflow-y: auto;
  display: flex; flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.profile-editor-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 28px 0; flex-shrink: 0;
}
.profile-editor-title { font-size: 20px; font-weight: 700; color: #fff; }
.profile-editor-close {
  background: rgba(255,255,255,0.07); border: none;
  color: rgba(255,255,255,0.5); font-size: 16px; cursor: pointer;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.profile-editor-close:hover { background: rgba(255,255,255,0.14); color: #fff; }

/* Live preview */
.profile-editor-preview {
  position: relative; height: 160px;
  margin: 20px 28px 0; border-radius: 18px; overflow: hidden;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  flex-shrink: 0;
}
.profile-editor-preview-bg {
  position: absolute; inset: 0;
  transition: background 0.35s ease;
}
.profile-editor-preview-avatar {
  font-size: 58px; line-height: 1; position: relative; z-index: 1;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.6));
  transition: transform 0.15s ease;
  pointer-events: none;
}
.profile-editor-name-input {
  position: relative; z-index: 1;
  background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.22);
  border-radius: 10px; color: #fff; font-size: 16px; font-weight: 600;
  padding: 7px 18px; text-align: center; width: 210px;
  backdrop-filter: blur(10px);
  transition: border-color 0.15s;
}
.profile-editor-name-input::placeholder { color: rgba(255,255,255,0.38); }
.profile-editor-name-input:focus { outline: none; border-color: rgba(255,255,255,0.55); }

/* Section wrapper */
.profile-editor-section { padding: 22px 28px 0; }
.profile-editor-section-title {
  font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.4);
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 14px;
}

/* Avatar category pills */
.avatar-categories { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.avatar-cat-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  color: rgba(255,255,255,0.5); font-size: 12px; font-weight: 500;
  padding: 4px 13px; border-radius: 999px; cursor: pointer;
  transition: all 0.15s ease;
}
.avatar-cat-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.avatar-cat-btn.active {
  background: rgba(255,255,255,0.14); color: #fff;
  border-color: rgba(255,255,255,0.28);
}

/* Avatar grid */
.avatar-picker-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 6px; max-height: 152px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.avatar-picker-btn {
  width: 46px; height: 46px; font-size: 22px;
  background: rgba(255,255,255,0.04);
  border: 2px solid transparent; border-radius: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s ease;
}
.avatar-picker-btn:hover { background: rgba(255,255,255,0.1); transform: scale(1.12); }
.avatar-picker-btn.selected {
  border-color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.14);
}

/* Background grid */
.bg-picker-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 10px; padding-bottom: 2px;
}
.bg-picker-btn {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  background: none; border: 2px solid transparent;
  border-radius: 14px; cursor: pointer; padding: 4px;
  transition: border-color 0.15s ease;
}
.bg-picker-btn:hover .bg-picker-swatch { transform: scale(1.06); }
.bg-picker-btn.selected { border-color: rgba(255,255,255,0.65); }
.bg-picker-swatch {
  width: 68px; height: 44px; border-radius: 10px;
  transition: transform 0.15s ease;
}
.bg-picker-name { font-size: 11px; color: rgba(255,255,255,0.55); font-weight: 500; }

/* Footer */
.profile-editor-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 20px 28px 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 22px; flex-shrink: 0;
}

/* ── Auth Screen ──────────────────────────────────────────────────────────── */
.auth-content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 100%;
  padding: 40px;
}
.auth-box {
  width: 100%; max-width: 380px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 28px 28px 24px;
}
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-3); font-size: 12px;
}
.auth-divider::before,
.auth-divider::after {
  content: ''; flex: 1;
  height: 1px; background: rgba(255,255,255,0.08);
}
/* Auth panel titles */
.auth-title {
  font-size: 20px; font-weight: 700; color: var(--text);
  margin: 0 0 4px; letter-spacing: -0.2px;
}
.auth-subtitle {
  font-size: 13px; color: var(--text-3);
  margin: 0 0 20px; line-height: 1.4;
}
/* "New here? / Already have an account?" row */
.auth-switch {
  text-align: center; font-size: 13px; color: var(--text-3);
  margin: 14px 0 0;
}
.auth-link-btn {
  background: none; border: none; padding: 0;
  color: var(--accent); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: opacity 0.15s;
}
.auth-link-btn:hover { opacity: 0.75; }
/* Email confirmation icon */
.auth-confirm-icon {
  display: flex; justify-content: center;
  margin: 8px 0 18px; color: var(--accent);
}

/* Settings profile list — edit button */
.profile-list-edit {
  margin-left: auto; background: none; border: none;
  color: rgba(255,255,255,0.3); font-size: 15px; cursor: pointer;
  padding: 4px 6px; transition: color 0.15s;
}
.profile-list-edit:hover { color: #fff; }

/* ══════════════════════════════════════════════════════
   CINEDOCK
   ══════════════════════════════════════════════════════ */

:root {
  --cd-accent:     #e50914;
  --cd-accent-h:   #ff2233;
  --cd-accent-dim: rgba(229,9,20,0.12);
  --cd-accent-bdr: rgba(229,9,20,0.22);
}

/* Auth wall — shown when user is not signed in */
.cd-auth-wall {
  position: absolute; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
.cd-auth-wall-inner {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; padding: 40px 24px; text-align: center; max-width: 280px;
}
.cd-auth-wall-icon  { font-size: 52px; line-height: 1; }
.cd-auth-wall-title { font-size: 18px; font-weight: 700; color: var(--text); margin: 0; }
.cd-auth-wall-sub   { font-size: 13px; color: var(--text-3); margin: 0; line-height: 1.5; }

/* Nav accent override for CineDock button */
#nav-cinedock.active .nav-icon { stroke: var(--cd-accent); }
#nav-cinedock.active::after { background: var(--cd-accent); }

/* ── Tab layout ─────────────────────────────── */
#tab-cinedock.active {
  display: flex !important;
  flex-direction: column;
  height: calc(100vh - var(--header-h) - var(--nav-h));
  padding: 0;
  overflow: hidden;
  position: relative;
}
.main-content.cd-lock { overflow: hidden !important; }

/* ── Header & sub-tabs ──────────────────────── */
.cd-header {
  flex-shrink: 0;
  padding: 14px 20px 0;
  background: rgba(8,10,15,0.94);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.cd-logo {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px; letter-spacing: 1.5px;
  color: var(--text); margin-bottom: 12px;
}
.cd-logo svg { stroke: var(--cd-accent); flex-shrink: 0; }
.cd-tabs {
  display: flex; gap: 4px; padding-bottom: 0;
  overflow-x: auto; scrollbar-width: none;
}
.cd-tabs::-webkit-scrollbar { display: none; }
.cd-tab {
  padding: 7px 16px; border-radius: 8px 8px 0 0;
  font-size: 12px; font-weight: 600; letter-spacing: 0.3px;
  color: var(--text-3); background: transparent;
  border: none; cursor: pointer; white-space: nowrap;
  transition: color 0.18s, background 0.18s;
  position: relative;
  display: inline-flex; align-items: center; gap: 5px;
}
.cd-tab:hover { color: var(--text-2); background: var(--glass); }
.cd-tab.active { color: var(--cd-accent); background: var(--cd-accent-dim); }
.cd-tab.active::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 2px; background: var(--cd-accent); border-radius: 1px 1px 0 0;
}

/* ── Panels ─────────────────────────────────── */
.cd-panel {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scroll-behavior: smooth;
}
.cd-panel::-webkit-scrollbar { width: 3px; }
.cd-panel::-webkit-scrollbar-track { background: transparent; }
.cd-panel::-webkit-scrollbar-thumb { background: var(--border-h); border-radius: 2px; }
.cd-panel.active { display: flex; }


.cd-ratings-btn-count {
  font-size: 10px; font-weight: 700; background: rgba(255,255,255,0.08);
  padding: 1px 6px; border-radius: 4px; color: rgba(255,255,255,0.5);
}

/* ── Reviews tab ──────────────────────────────────────── */
.cd-ratings-list { display: flex; flex-direction: column; gap: 10px; padding: 10px 20px 16px; }
.cd-review-card {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.cd-review-card:hover { border-color: var(--cd-accent-bdr); background: var(--bg-3); }
.cd-review-poster { width: 52px; height: 78px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.cd-review-poster-ph { width: 52px; height: 78px; border-radius: 6px; background: var(--bg-3); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.cd-review-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cd-review-title { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-review-stars { display: flex; gap: 2px; }
.cd-review-text { font-size: 12px; color: var(--text-2); margin: 0; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cd-review-date { font-size: 11px; color: var(--text-3); margin-top: auto; }

/* ── Half star display ────────────────────────────────── */
.cd-star.cd-star-half, .cd-star-static.cd-star-half {
  background: linear-gradient(to right, #f59e0b 50%, var(--border-h) 50%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

/* ── Comment panel ────────────────────────────────────── */
.cd-comment-panel {
  position: absolute; inset: 0; z-index: 12;
  background: var(--bg); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .3s ease;
}
.cd-comment-panel.cd-comment-open { transform: translateX(0); }
.cd-comment-nav {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px 8px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.cd-comment-movie-title { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.cd-comment-body { flex: 1; overflow-y: auto; padding: 10px 14px; display: flex; flex-direction: column; gap: 10px; }
.cd-comment-empty { font-size: 13px; color: var(--text-3); text-align: center; margin-top: 24px; }
.cd-comment { display: flex; gap: 10px; align-items: flex-start; }
.cd-comment-reply { margin-left: 28px; padding-left: 10px; border-left: 2px solid var(--border); }
.cd-comment-avatar { font-size: 20px; flex-shrink: 0; line-height: 1; margin-top: 2px; }
.cd-comment-avatar-img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; font-size: 0; }
.cd-comment-content { flex: 1; min-width: 0; }
.cd-comment-header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.cd-comment-name { font-size: 12px; font-weight: 600; color: var(--text); }
.cd-comment-time { font-size: 10px; color: var(--text-3); }
.cd-comment-text { font-size: 12px; color: var(--text-2); margin: 0; line-height: 1.5; word-break: break-word; }
.cd-comment-reply-btn { font-size: 11px; color: var(--cd-accent); background: none; border: none; cursor: pointer; padding: 4px 0 0; }
.cd-comment-footer { flex-shrink: 0; border-top: 1px solid var(--border); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.cd-comment-reply-banner { font-size: 11px; color: var(--cd-accent); background: var(--cd-accent-dim); border-radius: 6px; padding: 4px 10px; }
.cd-comment-input-row { display: flex; gap: 8px; align-items: flex-end; }
.cd-comment-textarea {
  flex: 1; background: var(--bg-3); border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 12px; color: var(--text); font: inherit; font-size: 12px;
  outline: none; resize: none; transition: border-color .18s;
}
.cd-comment-textarea:focus { border-color: var(--cd-accent); }
.cd-comment-submit-btn {
  padding: 8px 14px; border-radius: 10px; background: var(--cd-accent); border: none;
  color: #fff; font-size: 12px; font-weight: 600; cursor: pointer; flex-shrink: 0;
  transition: opacity .15s;
}
.cd-comment-submit-btn:hover { opacity: .85; }
.cd-comment-submit-btn:disabled { opacity: .5; cursor: default; }

/* ── Import drag-drop ─────────────────────────────────── */
.cd-import-drag-hint { font-size: 11px; color: var(--text-3); margin: 2px 0 6px; }
.cd-import-card { transition: border-color .15s, background .15s; }
.cd-import-card.cd-drop-active { border-color: var(--cd-accent) !important; background: var(--cd-accent-dim) !important; }
.cd-import-card.cd-drop-active .cd-import-drag-hint { color: var(--cd-accent); }

/* ── Import instructions ──────────────────────────────── */
.cd-import-instructions {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px 20px; margin-bottom: 14px;
}
.cd-import-inst-title { font-size: 13px; font-weight: 700; color: var(--text); margin: 0 0 12px; }
.cd-import-inst-list { margin: 0 0 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.cd-import-inst-list li { font-size: 12px; color: var(--text-2); line-height: 1.5; }
.cd-import-inst-list strong { color: var(--text); }
.cd-import-inst-list code { background: var(--bg-3); padding: 1px 5px; border-radius: 4px; font-size: 11px; color: var(--cd-accent); }
.cd-import-note { font-size: 11px; color: var(--text-3); padding-top: 10px; border-top: 1px solid var(--border); }
.cd-import-note strong { color: var(--text-2); }

/* ── Legal bar ──────────────────────────────── */
.cd-legal {
  flex-shrink: 0;
  padding: 6px 20px 8px;
  font-size: 10px; color: var(--text-3);
  text-align: center; line-height: 1.5;
}
#cdtab-mindsearch.active ~ .cd-legal { display: none;
  border-top: 1px solid var(--border);
}

/* ── Search bar ─────────────────────────────── */
.cd-search-wrap { padding: 14px 20px 10px; flex-shrink: 0; }
.cd-search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 14px;
  transition: border-color 0.2s;
}
.cd-search-bar:focus-within { border-color: var(--cd-accent); box-shadow: 0 0 0 3px var(--cd-accent-dim); }
.cd-search-icon { color: var(--text-3); flex-shrink: 0; }
.cd-search-input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 14px; font-family: inherit;
}
.cd-search-input::placeholder { color: var(--text-3); }
.cd-spinner {
  width: 14px; height: 14px; border: 2px solid var(--border-h);
  border-top-color: var(--cd-accent); border-radius: 50%;
  animation: cd-spin 0.65s linear infinite; flex-shrink: 0;
}
@keyframes cd-spin { to { transform: rotate(360deg); } }

/* ── Movie grid ─────────────────────────────── */
.cd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px; padding: 4px 20px 16px;
}

/* ── Movie card ─────────────────────────────── */
.cd-card {
  position: relative; cursor: pointer;
  border-radius: 10px; overflow: hidden;
  background: var(--bg-3); border: 1px solid var(--border);
  aspect-ratio: 2/3;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.2s;
  container-type: inline-size;
  /* Skip layout/paint for cards scrolled out of the viewport. Massive
     win when a profile has hundreds of posters in a horizontal row —
     the browser only paints the few cards currently visible. */
  content-visibility: auto;
  contain-intrinsic-size: 180px 270px;
}
.cd-card:hover {
  transform: translateY(-4px) scale(1.025);
  border-color: var(--border-h);
  box-shadow: 0 16px 40px rgba(0,0,0,0.55);
}
/* Red "aura" on titles the signed-in user has already watched — shown inside
   open section/playlist views alongside the "you've watched X%" stat. The ring
   is an outer box-shadow (not clipped by the card's overflow:hidden). */
.cd-card-watched-aura {
  border-color: #e0352b;
  box-shadow: 0 0 0 2px #e0352b, 0 0 16px 2px rgba(224, 53, 43, 0.55);
}
.cd-card-watched-aura:hover {
  border-color: #ef4d44;
  box-shadow: 0 0 0 2px #ef4d44, 0 16px 40px rgba(0,0,0,0.55), 0 0 20px 3px rgba(224, 53, 43, 0.72);
}

/* ── Free public beta ────────────────────────────────────────────────────────
   Hide every Pro / upgrade / Stripe UI surface. Toggled by the `free-beta`
   class on <html> (set in js/config.js from window.FREE_BETA). The backend
   FREE_BETA flag unlocks the actual features; this only hides the paywall UI.
   To restore paid Pro: set window.FREE_BETA = false. No markup is removed. */
.free-beta .btn-upgrade-lg,
.free-beta .btn-upgrade-sm,
.free-beta #upgrade-modal,
.free-beta .badge-pro,
.free-beta .badge-pro-lg,
.free-beta .pro-gate,
.free-beta #subscription-settings-block,
.free-beta #manage-subscription-block {
  display: none !important;
}
/* Founder badge (.badge-founder) is intentionally NOT hidden — founders keep
   their badge during the beta. The [data-pro-badge-slot] wrapper stays visible
   so the founder badge inside it shows; only .badge-pro* inside it is hidden. */
.cd-card img {
  width: 100%; height: 100%; object-fit: cover;
  display: block; transition: opacity 0.3s;
}
.cd-card-no-poster {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: var(--text-3);
  background: var(--bg-3);
}
.cd-card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, transparent 55%);
  opacity: 0; transition: opacity 0.2s;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 8px;
}
.cd-card:hover .cd-card-overlay { opacity: 1; }
.cd-card-remove {
  position: absolute; top: 5px; right: 5px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,0.75); border: 1px solid rgba(255,255,255,0.12);
  color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.15s, background 0.15s; cursor: pointer;
}
.cd-card:hover .cd-card-remove { opacity: 1; }
.cd-card-remove:hover { background: rgba(229,9,20,0.75); }
.cd-card-watched-on {
  position: absolute; bottom: 4px; left: 4px;
  padding: 2px 6px; border-radius: 4px;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(4px);
  font-size: 8px; font-weight: 600; color: rgba(255,255,255,0.8);
  letter-spacing: 0.3px; cursor: pointer;
  max-width: calc(100% - 8px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.cd-card:hover .cd-card-watched-on { opacity: 0; }
.cd-card-watched-on { transition: opacity 0.2s, background 0.15s, color 0.15s; }
/* "In progress" badge — partially-watched series in the Watchlist.
   Moved to bottom-left now that the community rating lives top-left. */
.cd-card-inprogress {
  position: absolute; bottom: 6px; left: 6px;
  padding: 3px 7px; border-radius: 5px;
  background: var(--cd-accent, rgba(229,9,20,0.92)); backdrop-filter: blur(4px);
  font-size: 9px; font-weight: 800; color: #fff;
  letter-spacing: 0.4px; text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(0,0,0,0.45); pointer-events: none;
  max-width: calc(100% - 12px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: opacity 0.2s;
}
.cd-card:hover .cd-card-inprogress { opacity: 0; }
.cd-card-add-platform {
  position: absolute; bottom: 36px; left: 4px;
  padding: 1px 5px; border-radius: 3px;
  background: rgba(0,0,0,0.5);
  font-size: 7px; font-weight: 600; color: rgba(255,255,255,0.35);
  letter-spacing: 0.3px; cursor: pointer;
  opacity: 0; transition: opacity 0.15s, color 0.15s;
  white-space: nowrap;
}
.cd-card:hover .cd-card-add-platform { opacity: 1; }
.cd-card-add-platform:hover { color: rgba(255,255,255,0.7); }
.cd-platform-dropdown {
  position: fixed; z-index: 99999;
  background: rgba(14,16,24,0.98); backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1); border-top: none;
  border-radius: 0 0 8px 8px;
  overflow: hidden; box-shadow: 0 8px 28px rgba(0,0,0,0.6);
}
.cd-platform-opt {
  padding: 8px 12px; font-size: 11px; cursor: pointer;
  color: rgba(255,255,255,0.82); transition: background 0.1s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cd-platform-opt:hover, .cd-platform-opt.active { background: rgba(255,255,255,0.09); color: #fff; }
.cd-wb-clear {
  width: 100%; padding: 5px 10px; border-radius: 6px; cursor: pointer;
  font: inherit; font-size: 10px; font-weight: 600;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.4); transition: all 0.15s; text-align: center;
}
.cd-wb-clear:hover { color: rgba(255,100,100,0.9); border-color: rgba(255,100,100,0.25); }

/* ── Horizontal scroll (trending) ───────────── */
.cd-h-scroll {
  display: flex; gap: 10px;
  overflow-x: auto; padding: 4px 20px 16px;
  scroll-snap-type: x mandatory; scrollbar-width: none;
}
.cd-h-scroll::-webkit-scrollbar { display: none; }
.cd-h-scroll .cd-card { flex: 0 0 110px; scroll-snap-align: start; }

/* ── Library sections ───────────────────────── */
.cd-lib-section { padding-bottom: 8px; }
.cd-lib-title {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 20px 10px;
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  color: var(--text-2); text-transform: uppercase;
}
.cd-lib-title svg { stroke: var(--cd-accent); flex-shrink: 0; }
/* Centered + clickable section titles on profile view */
.cd-lib-title-centered { justify-content: center; }
.cd-lib-title-click { cursor: pointer; transition: color 0.15s, transform 0.15s; user-select: none; }
.cd-lib-title-click:hover { color: var(--cd-accent); transform: translateY(-1px); }
.cd-lib-title-click:hover svg { stroke: var(--cd-accent); }
.cd-lib-title-click:focus-visible { outline: 2px solid var(--cd-accent); outline-offset: 2px; border-radius: 4px; }
.cd-lib-subsection { padding-bottom: 4px; }
.cd-lib-subtitle {
  padding: 6px 20px 4px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.5px;
  color: var(--text-3); text-transform: uppercase;
}
.cd-empty {
  padding: 8px 20px 16px; font-size: 13px;
  color: var(--text-3); font-style: italic;
}
.cd-lib-loading {
  display: flex; justify-content: center; padding: 20px;
}
.cd-lib-loading .cd-spinner { width: 20px; height: 20px; }

/* ── Skeleton shimmer (placeholder while loading) ─────────── */
@keyframes cdShimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
.cd-skeleton-card {
  background: linear-gradient(90deg,
    var(--bg-3) 25%, rgba(255,255,255,0.045) 50%, var(--bg-3) 75%);
  background-size: 200% 100%;
  animation: cdShimmer 1.5s ease-in-out infinite;
  border-radius: 10px;
  aspect-ratio: 2/3;
  border: 1px solid var(--border);
}
/* Skeleton cards used inside the horizontal poster rows (profile sections,
   library previews) — match the real card width so the placeholder layout
   reads as the same row when the data resolves. */
.cd-lib-preview-row > .cd-skeleton-card {
  width: 120px; flex-shrink: 0;
}
.cd-lib-preview-row-skel { pointer-events: none; }
.cd-skeleton-row {
  height: 44px;
  background: linear-gradient(90deg,
    var(--bg-3) 25%, rgba(255,255,255,0.045) 50%, var(--bg-3) 75%);
  background-size: 200% 100%;
  animation: cdShimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
  border: 1px solid var(--border);
}
/* ── Smooth content entrance ───────────────────────────────── */
@keyframes cdFadeIn {
  from { opacity: 0; transform: translateY(3px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cd-fade-in { animation: cdFadeIn 0.18s ease both; }

/* ── Section-view search ─────────────────────── */
.cd-secview-search-wrap {
  display: flex; align-items: center; gap: 7px;
  margin: 4px 16px 6px;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 8px; padding: 5px 10px;
}
.cd-secview-search-wrap .cd-search-icon { flex-shrink: 0; color: var(--text-3); }
.cd-secview-search-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text-1); font-size: 12px;
}
.cd-secview-search-input::placeholder { color: var(--text-3); }

/* ── Feed ───────────────────────────────────── */
.cd-feed-list {
  flex: 1; overflow-y: auto;
  padding: 12px 16px 20px; display: flex; flex-direction: column; gap: 14px;
  scroll-snap-type: y proximity;
  scrollbar-width: none;
}
.cd-feed-list::-webkit-scrollbar { display: none; }
.cd-feed-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 60px 20px;
  text-align: center; color: var(--text-2);
}
.cd-feed-empty-icon { margin-bottom: 14px; display: flex; justify-content: center; }
.cd-feed-empty-icon svg { stroke: var(--text-3); }

/* Feed zoom — list-level CSS variables scale everything */
.cd-feed-list { --fz-scale: 1; --fz-poster: 78px; --fz-title: 16px; --fz-overview: 12px; --fz-avatar: 36px; --fz-pad: 16px; --fz-gap: 14px; }
.cd-feed-list[data-zoom="0"] { --fz-scale: 0.88; --fz-poster: 62px; --fz-title: 14px; --fz-overview: 11px; --fz-avatar: 30px; --fz-pad: 12px; --fz-gap: 10px; }
.cd-feed-list[data-zoom="2"] { --fz-scale: 1.12; --fz-poster: 100px; --fz-title: 18px; --fz-overview: 13px; --fz-avatar: 42px; --fz-pad: 18px; --fz-gap: 18px; }

/* Feed card — Letterboxd-style */
.cd-feed-item {
  display: flex; flex-direction: column;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: var(--fz-pad); cursor: pointer;
  scroll-snap-align: start;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  animation: cd-feed-in 0.35s ease;
  gap: var(--fz-gap);
}
@keyframes cd-feed-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cd-feed-item:hover {
  border-color: var(--border-h);
  background: var(--bg-card-h, var(--bg-card));
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -12px rgba(0,0,0,0.5);
}

.cd-feed-head { display: flex; align-items: center; gap: 10px; }
.cd-feed-user-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cd-feed-userline { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.cd-feed-action-verb {
  font-size: 12px; color: var(--text-3); font-weight: 500;
}
.cd-feed-time { font-size: 11px; color: var(--text-3); }

.cd-feed-body {
  display: flex; gap: 14px; align-items: flex-start;
}
.cd-feed-poster {
  width: var(--fz-poster); height: calc(var(--fz-poster) * 1.5);
  border-radius: 10px; object-fit: cover; flex-shrink: 0;
  box-shadow: 0 4px 14px -6px rgba(0,0,0,0.5);
  transition: transform 0.25s ease, width 0.2s ease, height 0.2s ease;
}
.cd-feed-item:hover .cd-feed-poster { transform: scale(1.03); }
.cd-feed-poster-ph {
  width: var(--fz-poster); height: calc(var(--fz-poster) * 1.5);
  border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-3); color: var(--text-3);
  transition: width 0.2s ease, height 0.2s ease;
}
.cd-feed-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cd-feed-title {
  font-size: var(--fz-title); font-weight: 700; color: var(--text);
  line-height: 1.3; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  transition: font-size 0.2s ease;
}
.cd-feed-year { font-weight: 500; color: var(--text-3); font-size: calc(var(--fz-title) - 2px); }
.cd-feed-overview {
  font-size: var(--fz-overview); color: var(--text-3); line-height: 1.55; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}

.cd-feed-actions {
  display: flex; gap: 4px; padding-top: 4px;
  border-top: 1px solid var(--border);
  margin-top: 2px; padding-top: 12px;
}
.cd-feed-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 10px;
  background: transparent; border: none;
  font-size: 12px; color: var(--text-3); cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
  font-family: inherit; font-weight: 600;
}
.cd-feed-btn:hover { color: var(--text); background: var(--glass-h); }
.cd-feed-btn:active { transform: scale(0.94); }
.cd-feed-btn.cd-liked { color: #f87171; }
.cd-feed-btn.cd-liked:hover { background: rgba(248,113,113,0.10); }
@keyframes cd-like-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.cd-feed-btn.cd-liked svg { animation: cd-like-pop 0.3s ease; }
.cd-feed-btn .cd-like-count:empty,
.cd-feed-btn .cd-comment-count:empty { display: none; }

/* ── Import ─────────────────────────────────── */
.cd-import-wrap {
  display: flex; flex-direction: column; align-items: center;
  padding: 28px 20px; gap: 20px;
}
.cd-import-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 18px; padding: 30px 28px; text-align: center;
  max-width: 400px; width: 100%;
}
.cd-import-icon {
  width: 62px; height: 62px; border-radius: 50%;
  background: var(--cd-accent-dim); border: 1px solid var(--cd-accent-bdr);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px; color: var(--cd-accent);
}
.cd-import-title { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.cd-import-desc { font-size: 13px; color: var(--text-3); line-height: 1.65; margin-bottom: 22px; }
.cd-import-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: 10px;
  background: var(--cd-accent); color: #fff;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: opacity 0.2s; border: none;
}
.cd-import-btn:hover { opacity: 0.85; }
.cd-import-progress { max-width: 400px; width: 100%; }
.cd-import-prog-hd {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-2); margin-bottom: 8px;
}
.cd-import-prog-track {
  height: 5px; background: var(--bg-3); border-radius: 3px; overflow: hidden;
}
.cd-import-prog-fill {
  height: 100%; background: var(--cd-accent); border-radius: 3px;
  transition: width 0.35s ease; width: 0;
}
/* ── Import progress popup (floating, persists across tab nav) ── */
.cd-import-popup {
  position: fixed;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 200;
  width: 420px; max-width: calc(100vw - 32px);
  background: #12141c;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 12px;
  padding: 14px 16px 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  display: flex; flex-direction: column; gap: 8px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.cd-import-popup.hidden { display: none; }
.cd-import-popup.cd-import-popup-done { opacity: 0.7; }
.cd-import-popup-hd {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.cd-import-popup-hd span {
  font-size: 12px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1;
}
.cd-import-popup-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-3); font-size: 13px; line-height: 1;
  padding: 2px 4px; border-radius: 4px; flex-shrink: 0;
}
.cd-import-popup-close:hover { color: var(--text); background: rgba(255,255,255,0.07); }
.cd-import-popup-track-wrap .cd-import-prog-track { margin: 0; }
.cd-import-popup-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--text-3);
}
.cd-import-popup-meta span:first-child { flex: 1; }
.cd-import-popup-note {
  font-size: 10px; color: var(--text-3); margin: 0; line-height: 1.4;
  border-top: 1px solid rgba(255,255,255,0.06); padding-top: 6px;
}
.cd-import-prog-eta {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text-3); margin-top: 6px;
}
#cd-import-prog-pct { font-weight: 600; color: var(--cd-accent); }
#cd-import-prog-time { font-variant-numeric: tabular-nums; }
.cd-import-done {
  display: flex; flex-direction: column; gap: 12px;
  font-size: 13px; font-weight: 600; color: #22c55e;
}
.cd-import-done-row {
  display: flex; align-items: center; gap: 10px;
}
.cd-import-disclaimer {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 13px; border-radius: 10px;
  border: 1px solid rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  font-size: 13px; font-weight: 500;
  line-height: 1.45;
}
.cd-import-disclaimer svg {
  flex-shrink: 0; margin-top: 1px;
}
.cd-import-disclaimer span {
  color: var(--text-1, #f3f4f6);
  font-weight: 600;
}
/* Always-visible copy shown inside the import instructions (before upload) */
.cd-import-disclaimer-top { margin: 14px 0 2px; }
.cd-import-danger-zone {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 20px; padding: 12px 14px;
  border: 1px solid rgba(239,68,68,0.2); border-radius: 10px;
  background: rgba(239,68,68,0.04);
}
.cd-import-danger-label {
  font-size: 12px; color: var(--text-3);
}
.cd-import-clear-btn {
  flex-shrink: 0;
  padding: 6px 14px; border-radius: 7px; border: 1px solid rgba(239,68,68,0.4);
  background: transparent; color: #ef4444; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.cd-import-clear-btn:hover {
  background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.7);
}

/* ── Movie detail modal — Cinema OS ─────────── */
.cd-modal-box {
  position: relative; z-index: 1;
  width: 660px; max-width: 94vw; max-height: 90vh;
  background: linear-gradient(168deg, #0c1018 0%, #080c14 40%, #0a0e18 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(229,9,20,0.06), 0 24px 80px rgba(0,0,0,0.9), 0 0 120px rgba(229,9,20,0.04);
  animation: cd-modal-in 0.35s cubic-bezier(0.16,1,0.3,1);
  display: flex; flex-direction: column;
}
@keyframes cd-modal-in {
  from { opacity: 0; transform: scale(0.94) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.cd-modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 20;
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7); font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.cd-modal-close:hover { background: var(--cd-accent); color: #fff; border-color: var(--cd-accent); }

/* Hero / backdrop */
.cd-mhero {
  position: relative; height: 220px; flex-shrink: 0; overflow: hidden;
  background: linear-gradient(135deg, #0a0e16 0%, #12182a 100%);
}
.cd-mhero-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; filter: brightness(0.7) saturate(1.2);
}
.cd-mhero-gradient {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, transparent 0%, rgba(8,12,20,0.4) 50%, rgba(8,12,20,0.98) 100%),
    linear-gradient(90deg, rgba(8,12,20,0.7) 0%, transparent 50%);
}
.cd-mhero-content {
  position: absolute; inset: 0; display: flex; align-items: flex-end;
  padding: 0 24px 20px; gap: 18px;
}
.cd-mhero-poster-wrap { flex-shrink: 0; position: relative; cursor: pointer; }
.cd-poster-edit-overlay {
  position: absolute; inset: 0; border-radius: 6px;
  background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.15s; pointer-events: none;
  color: #fff;
}
.cd-mhero-poster-wrap:hover .cd-poster-edit-overlay { opacity: 1; pointer-events: auto; }
.cd-poster-remove-btn {
  position: absolute; top: -6px; right: -6px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(229,9,20,0.9); border: 2px solid rgba(0,0,0,0.6);
  color: #fff; font-size: 10px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0; transition: opacity 0.15s;
  z-index: 2;
}
.cd-mhero-poster-wrap:hover .cd-poster-remove-btn:not(.hidden) { opacity: 1; }
.cd-poster-remove-btn:hover { background: #e50914; transform: scale(1.1); }

/* Poster Picker Modal */
.cd-poster-picker-box {
  max-width: 480px; width: 92%; padding: 24px;
  max-height: 80vh; display: flex; flex-direction: column;
}
.cd-poster-picker-title {
  font-size: 16px; font-weight: 700; color: #fff; margin: 0 0 4px;
}
.cd-poster-picker-limit {
  font-size: 11px; color: rgba(255,255,255,0.4); margin-bottom: 16px;
}
.cd-poster-picker-limit.cd-poster-limit-full { color: var(--cd-accent); }
.cd-poster-picker-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px;
  overflow-y: auto; max-height: 55vh; padding-right: 4px;
}
.cd-poster-picker-grid::-webkit-scrollbar { width: 3px; height: 3px; }
.cd-poster-picker-grid::-webkit-scrollbar-track { background: transparent; }
.cd-poster-picker-grid::-webkit-scrollbar-thumb { background: var(--border-h); border-radius: 2px; }
/* New picker wraps the grid in .cd-poster-picker-body which owns the scroll;
   the grid itself must not scroll or its own native bar shows on top. */
.cd-poster-picker-body .cd-poster-picker-grid {
  overflow: visible; max-height: none; padding-right: 0;
}
.cd-poster-pick-img {
  width: 100%; aspect-ratio: 2/3; object-fit: cover; border-radius: 6px;
  cursor: pointer; border: 2px solid transparent;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.cd-poster-pick-img:hover {
  border-color: rgba(255,255,255,0.4); transform: scale(1.03);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
.cd-poster-pick-img.cd-poster-pick-active {
  border-color: var(--cd-accent); box-shadow: 0 0 0 1px var(--cd-accent);
}
.cd-modal-poster {
  width: 90px; height: 135px; object-fit: cover;
  border-radius: 6px; display: block;
  box-shadow: 0 8px 32px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.06);
}
.cd-modal-poster-ph {
  width: 90px; height: 135px; border-radius: 6px;
  background: rgba(255,255,255,0.04); display: flex; align-items: center;
  justify-content: center; font-size: 28px; color: var(--text-3);
  border: 1px solid rgba(255,255,255,0.06);
}
.cd-mhero-text { flex: 1; min-width: 0; }
.cd-modal-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 4px;
  background: rgba(229,9,20,0.15); border: 1px solid rgba(229,9,20,0.25);
  color: #ff3344; font-size: 9px; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase; margin-bottom: 8px;
}
.cd-modal-title {
  font-size: 22px; font-weight: 800; line-height: 1.15;
  color: #fff; margin-bottom: 6px; letter-spacing: -0.02em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.cd-modal-meta {
  font-size: 11px; color: rgba(255,255,255,0.45); margin-bottom: 8px;
  letter-spacing: 0.04em; font-weight: 500;
}
/* TMDB rating pill — uses TMDB brand teal so users recognize the source.
   Will revisit (or drop) once CineDock's own rating database is strong. */
.cd-modal-tmdb {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 8px; border-radius: 6px;
  background: rgba(1, 180, 228, 0.15);
  border: 1px solid rgba(1, 180, 228, 0.35);
  vertical-align: baseline;
}
.cd-modal-tmdb-brand {
  font-size: 10px; font-weight: 800; letter-spacing: 0.1em;
  color: #01b4e4;
}
.cd-modal-tmdb-score {
  font-size: 12px; font-weight: 700; color: #fff;
  font-variant-numeric: tabular-nums;
}
/* When the pill is upgraded to IMDb (after OMDb lookup) it swaps to the
   IMDb yellow/black brand. Same <span> element, different class. */
.cd-modal-tmdb.cd-modal-imdb {
  background: rgba(245, 197, 24, 0.18);
  border-color: rgba(245, 197, 24, 0.5);
}
.cd-modal-imdb-brand {
  font-size: 10px; font-weight: 800; letter-spacing: 0.1em;
  color: #f5c518;
}
.cd-modal-imdb-score {
  font-size: 12px; font-weight: 700; color: #fff;
  font-variant-numeric: tabular-nums;
}
/* Community-rating pill beside the IMDb one in the modal meta row. */
.cd-modal-tmdb.cd-modal-community-pill {
  background: rgba(229, 9, 20, 0.14);
  border-color: rgba(229, 9, 20, 0.45);
  color: #fff; font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.cd-modal-cr-count { font-size: 10px; font-weight: 600; color: rgba(255,255,255,0.6); }
.cd-modal-genres { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.cd-mhero-genre {
  padding: 3px 10px; border-radius: 4px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
  font-size: 10px; color: rgba(255,255,255,0.65); font-weight: 500;
  letter-spacing: 0.02em;
}
.cd-modal-tagline {
  font-size: 11px; color: rgba(255,255,255,0.3); font-style: italic;
  letter-spacing: 0.01em;
}

/* Tabs — segmented control style */
.cd-modal-tabs {
  display: flex; flex-shrink: 0; padding: 10px 24px 0;
  background: transparent; gap: 2px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.cd-modal-tab {
  padding: 9px 18px; font-size: 11px; font-weight: 600;
  color: rgba(255,255,255,0.35); background: none; border: none;
  cursor: pointer; transition: all 0.2s; position: relative;
  font-family: inherit; letter-spacing: 0.05em; text-transform: uppercase;
  border-radius: 6px 6px 0 0;
}
.cd-modal-tab:hover { color: rgba(255,255,255,0.65); }
.cd-modal-tab.active {
  color: #fff;
  background: rgba(255,255,255,0.04);
}
.cd-modal-tab.active::after {
  content: ''; position: absolute; bottom: -1px; left: 8px; right: 8px; height: 2px;
  background: var(--cd-accent); border-radius: 2px 2px 0 0;
}

/* Scrollable body */
.cd-modal-body {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 20px 24px 24px;
}
.cd-modal-body::-webkit-scrollbar { width: 2px; }
.cd-modal-body::-webkit-scrollbar-track { background: transparent; }
.cd-modal-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.cd-mtab-panel { display: flex; flex-direction: column; gap: 16px; }
.cd-mtab-panel.hidden { display: none; }

/* Overview tab */
.cd-modal-overview {
  font-size: 13px; color: rgba(255,255,255,0.6); line-height: 1.75; margin: 0;
  letter-spacing: 0.01em;
}
.cd-overview-lang-notice {
  margin-top: 6px;
  font-size: 11px;
  color: rgba(255,200,80,0.7);
  display: flex; align-items: center; gap: 5px;
}
.cd-overview-lang-notice::before {
  content: 'ⓘ';
  font-size: 12px;
}
.cd-modal-divider {
  height: 1px; margin: 4px 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.08) 20%, rgba(255,255,255,0.08) 80%, transparent 100%);
}
.cd-modal-rating-section { display: flex; flex-direction: column; gap: 10px; }
.cd-modal-rating-label {
  font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.3);
  text-transform: uppercase; letter-spacing: 0.12em;
}
.cd-stars { display: flex; gap: 6px; }
.cd-star {
  font-size: 24px; color: rgba(255,255,255,0.1); cursor: pointer;
  transition: all .15s; user-select: none; line-height: 1;
}
.cd-star:hover { transform: scale(1.15); }
.cd-star.cd-star-filled, .cd-star.cd-star-hover { color: #f59e0b; text-shadow: 0 0 12px rgba(245,158,11,0.3); }
.cd-star-static { font-size: 13px; color: rgba(255,255,255,0.12); line-height: 1; }
.cd-star-static.cd-star-filled { color: #f59e0b; }
.cd-star.cd-star-half, .cd-star-static.cd-star-half {
  background: linear-gradient(to right, #f59e0b 50%, rgba(255,255,255,0.1) 50%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
@keyframes cd-stars-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.cd-stars.cd-stars-shake, .cd-wb-stars.cd-stars-shake { animation: cd-stars-shake 0.45s ease-in-out; }
.cd-rating-required-msg {
  font-size: 11px; color: #f59e0b; opacity: 0;
  transform: translateY(-4px); transition: opacity .2s, transform .2s;
  pointer-events: none;
}
.cd-rating-required-msg.cd-rating-required-msg-show { opacity: 1; transform: translateY(0); }

/* Shared rating-prompt overlay (auto-log return, quicklog, series mirror, diary edit) */
.cd-rate-prompt-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,0.66); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  animation: cd-rate-prompt-in 0.18s ease;
}
@keyframes cd-rate-prompt-in { from { opacity: 0; } to { opacity: 1; } }
.cd-rate-prompt-card {
  width: min(360px, 92vw);
  background: rgba(18,20,28,0.98); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px; padding: 20px; box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  animation: cd-rate-prompt-slide 0.22s ease;
}
@keyframes cd-rate-prompt-slide { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.cd-rate-prompt-poster {
  width: 80px; height: 120px; object-fit: cover; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
}
/* Taste-onboarding quiz — same card chrome as the rating prompt, with a
   bigger poster (the title needs to be recognizable at a glance) and a
   progress counter. */
.cd-quiz-card { max-width: 380px; }
/* Taste card (Wrapped) — story-format canvas scaled down for preview. */
.cd-wrapped-card { max-width: 380px; }
.cd-wrapped-canvas {
  width: 280px; height: 498px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  margin: 10px 0 4px;
}
.cd-quiz-poster { width: 120px; height: 180px; }
.cd-quiz-progress {
  font-size: 11px; color: var(--text-3);
  letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700;
  margin: 2px 0 6px;
}
.cd-quiz-title-line {
  font-size: 14.5px; font-weight: 600; color: var(--text);
  text-align: center; margin-top: 8px; line-height: 1.3;
}
.cd-quiz-card .cd-rate-prompt-star { font-size: 30px; }
.cd-rate-prompt-title {
  font-size: 15px; font-weight: 700; color: var(--text);
  text-align: center; line-height: 1.25;
}
.cd-rate-prompt-msg {
  font-size: 12px; color: var(--text-3); text-align: center;
  line-height: 1.4; max-width: 280px;
}
.cd-rate-prompt-stars { display: flex; gap: 6px; margin-top: 4px; }
.cd-rate-prompt-star {
  font-size: 26px; color: rgba(255,255,255,0.12); cursor: pointer;
  transition: transform .15s; user-select: none; line-height: 1;
}
.cd-rate-prompt-star:hover { transform: scale(1.18); }
.cd-rate-prompt-star.cd-star-filled { color: #f59e0b; text-shadow: 0 0 12px rgba(245,158,11,0.3); }
.cd-rate-prompt-star.cd-star-half {
  background: linear-gradient(to right, #f59e0b 50%, rgba(255,255,255,0.12) 50%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
/* Season/episode selectors in the series-progress prompt. */
.cd-ep-prompt-selects { display: flex; gap: 8px; width: 100%; margin-top: 2px; }
.cd-ep-prompt-selects select {
  flex: 1; min-width: 0; padding: 9px 10px; border-radius: 8px;
  background: #1c1f28; border: 1px solid rgba(255,255,255,0.10);
  color: var(--text); font: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer; appearance: none; -webkit-appearance: none;
  text-overflow: ellipsis;
}
/* The native option popup doesn't inherit the select's colours on
   Chromium/Electron — it defaults to a white background, which left the
   episode list unreadable. Force the same dark grey + light text. */
.cd-ep-prompt-selects option {
  background: #1c1f28;
  color: var(--text);
}
.cd-ep-prompt-selects select:focus { outline: none; border-color: var(--cd-accent, #e50914); }
.cd-rate-prompt-actions { display: flex; gap: 8px; width: 100%; margin-top: 6px; }
.cd-rate-prompt-cancel, .cd-rate-prompt-confirm {
  flex: 1; padding: 9px 12px; border-radius: 8px;
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all .15s;
}
.cd-rate-prompt-cancel {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: var(--text);
}
.cd-rate-prompt-cancel:hover { background: rgba(255,255,255,0.08); }
.cd-rate-prompt-confirm {
  background: var(--cd-accent); border: 1px solid transparent; color: #fff;
}
.cd-rate-prompt-confirm:hover:not(:disabled) { filter: brightness(1.1); }
.cd-rate-prompt-confirm:disabled {
  opacity: 0.4; cursor: not-allowed;
}
.cd-ep-prompt-rewatch {
  width: 100%; margin-top: 8px; padding: 8px 12px; border-radius: 8px;
  background: transparent; border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.6); font: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all .15s;
}
.cd-ep-prompt-rewatch:hover {
  background: rgba(255,255,255,0.05); color: var(--text);
  border-color: rgba(255,255,255,0.18);
}
.cd-modal-review-textarea {
  width: 100%; background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px; padding: 10px 14px; color: var(--text); font: inherit;
  font-size: 12px; outline: none; resize: none; transition: border-color .2s;
}
.cd-modal-review-textarea:focus { border-color: rgba(229,9,20,0.4); background: rgba(255,255,255,0.04); }
.cd-modal-save-review-btn {
  align-self: flex-start; padding: 8px 20px; border-radius: 6px;
  background: var(--cd-accent); border: none;
  color: #fff; font-size: 11px; font-weight: 700; cursor: pointer;
  transition: all .2s; font-family: inherit; letter-spacing: 0.04em;
  text-transform: uppercase;
}
.cd-modal-save-review-btn:hover { background: var(--cd-accent-h); box-shadow: 0 4px 20px rgba(229,9,20,0.25); }
.cd-modal-save-review-btn:disabled { opacity: .4; cursor: default; }

/* ── Review options (spoiler toggle + tags) ─────────────────────────── */
.cd-review-opts {
  display: flex; flex-direction: column; gap: 8px; margin-top: 8px;
}
.cd-review-toggle {
  display: inline-flex; align-items: center; gap: 10px;
  cursor: pointer; user-select: none;
  font-size: 12px; color: var(--text-2);
}
.cd-review-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.cd-review-toggle-track {
  position: relative; width: 32px; height: 18px; border-radius: 999px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.08);
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.cd-review-toggle-thumb {
  position: absolute; top: 1px; left: 1px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
.cd-review-toggle input:checked + .cd-review-toggle-track {
  background: var(--cd-accent);
  border-color: var(--cd-accent);
}
.cd-review-toggle input:checked + .cd-review-toggle-track .cd-review-toggle-thumb {
  transform: translateX(14px);
}
.cd-review-toggle-label { font-weight: 600; }
.cd-modal-review-tags-input {
  width: 100%; background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px; padding: 8px 12px;
  color: var(--text); font: inherit; font-size: 12px;
  outline: none; transition: border-color .2s;
}
.cd-modal-review-tags-input:focus { border-color: rgba(229,9,20,0.4); background: rgba(255,255,255,0.04); }

/* Spoiler badge + tags chips on review cards */
.cd-review-spoiler-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; margin-right: 6px;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #ffb454;
  background: rgba(255,180,84,0.12);
  border: 1px solid rgba(255,180,84,0.25);
  border-radius: 4px;
}
.cd-review-text-blur {
  filter: blur(4px); cursor: pointer;
  transition: filter 0.2s;
}
.cd-review-text-blur:hover { filter: blur(3px); }
.cd-review-text-blur.cd-revealed { filter: none; cursor: default; }
.cd-review-tags {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px;
}
.cd-review-tag {
  font-size: 10px; padding: 2px 8px; border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-2);
}

/* Availability countries */
.cd-availability { margin-bottom: 12px; }
.cd-avail-toggle {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 10px 14px; border-radius: 10px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7); font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: all 0.15s;
}
.cd-avail-toggle:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.9); }
.cd-avail-toggle-label { flex: 1; text-align: left; }
.cd-avail-toggle-count {
  font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.06); padding: 2px 7px; border-radius: 4px;
}
.cd-avail-arrow { transition: transform 0.2s; flex-shrink: 0; opacity: 0.4; }
.cd-avail-toggle.open .cd-avail-arrow { transform: rotate(180deg); }
.cd-avail-dropdown {
  margin-top: 6px; padding: 6px 0; border-radius: 10px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
  max-height: 180px; overflow-y: auto;
}
.cd-avail-dropdown.hidden { display: none; }
.cd-avail-list { list-style: none; margin: 0; padding: 0; }
.cd-avail-list li {
  padding: 7px 14px; font-size: 12px; color: rgba(255,255,255,0.6);
  transition: background 0.1s;
}
.cd-avail-list li:hover { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.85); }
.cd-availability-hint {
  font-size: 10px; color: rgba(255,255,255,0.25); font-style: italic;
  padding: 6px 14px 4px;
}
.cd-avail-status {
  padding: 10px 14px; font-size: 12px; font-weight: 600;
  color: rgba(255,255,255,0.5); display: flex; align-items: center; gap: 8px;
}

/* Watch Now button */
.cd-watch-now-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px 20px; border-radius: 10px;
  background: var(--cd-accent); border: none; color: #fff;
  font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit;
  letter-spacing: 0.02em; transition: all 0.2s;
  margin-bottom: 12px;
}
.cd-watch-now-btn:hover { background: var(--cd-accent-h); box-shadow: 0 4px 20px rgba(229,9,20,0.25); transform: translateY(-1px); }
.cd-watch-now-btn:active { transform: translateY(0); }

/* Action buttons — horizontal grid */
.cd-modal-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cd-action-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 8px 12px; border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.5); font-size: 10px; font-weight: 600;
  cursor: pointer; transition: all 0.2s; font-family: inherit;
  letter-spacing: 0.02em;
}
.cd-action-btn svg { flex-shrink: 0; stroke: rgba(255,255,255,0.35); transition: all 0.2s; }
.cd-action-btn:hover {
  background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.12);
  color: #fff; transform: translateY(-1px);
}
.cd-action-btn:hover svg { stroke: #fff; }
.cd-action-btn.cd-added {
  background: rgba(229,9,20,0.1); border-color: rgba(229,9,20,0.3);
  color: #ff3344;
}
.cd-action-btn.cd-added svg { stroke: #ff3344; }

/* Community rating stats */
.cd-modal-community {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px; padding: 18px 20px;
  display: flex; align-items: stretch; gap: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.cd-modal-community.hidden { display: none; }
.cd-mcom-left {
  display: flex; flex-direction: column; gap: 2px; flex-shrink: 0;
  min-width: 72px; justify-content: center;
  padding-right: 18px;
  border-right: 1px solid rgba(255,255,255,0.06);
}
.cd-mcom-right { flex: 1; display: flex; flex-direction: column; gap: 0; min-width: 0; padding-left: 18px; }
.cd-mcom-header { display: flex; flex-direction: column; gap: 1px; }
.cd-mcom-title {
  font-size: 8px; font-weight: 700; color: rgba(255,255,255,0.2);
  text-transform: uppercase; letter-spacing: .18em;
}
.cd-mcom-count {
  font-size: 9px; color: rgba(255,255,255,0.18); font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.cd-mcom-avg-row { display: flex; align-items: baseline; gap: 3px; margin-top: 6px; }
.cd-mcom-avg {
  font-size: 34px; font-weight: 900; color: #f59e0b; line-height: 1;
  letter-spacing: -0.04em; font-variant-numeric: tabular-nums;
}
.cd-mcom-max { font-size: 11px; color: rgba(255,255,255,0.12); font-weight: 600; }
.cd-mcom-stars { display: flex; gap: 2px; margin-top: 5px; }

/* Segmented tab control */
.cd-mcom-tabs {
  position: relative; display: inline-flex; gap: 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 7px; padding: 3px; margin-bottom: 10px;
  flex-shrink: 0; align-self: flex-start;
}
.cd-mcom-tab-slider {
  position: absolute; top: 3px; left: 3px; height: calc(100% - 6px); width: 0;
  background: rgba(245,158,11,0.13);
  border: 1px solid rgba(245,158,11,0.26);
  border-radius: 5px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              width   0.28s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.cd-mcom-tab {
  position: relative; z-index: 1;
  font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 5px; cursor: pointer;
  border: none; background: transparent;
  color: rgba(255,255,255,0.28);
  transition: color 0.2s;
}
.cd-mcom-tab:hover:not(.active) { color: rgba(255,255,255,0.58); }
.cd-mcom-tab.active { color: #f59e0b; }

/* Distribution bar chart */
.cd-mcom-chart {
  flex: 1; display: flex; align-items: flex-end; gap: 3px;
  min-height: 80px; padding-bottom: 18px; position: relative;
}
.cd-mcom-chart.hidden { display: none !important; }
.cd-vbar-col {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 0; position: relative; cursor: default;
}
.cd-vbar-track {
  width: 100%; height: 68px; position: relative;
  background: rgba(255,255,255,0.025); border-radius: 3px 3px 0 0;
  overflow: hidden; display: flex; align-items: flex-end;
}
.cd-vbar-fill {
  width: 100%; height: 0; border-radius: 3px 3px 0 0;
  background: linear-gradient(0deg, rgba(245,158,11,0.44) 0%, rgba(251,191,36,0.8) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07);
  transition: height 0s, filter 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.cd-vbar-accent {
  background: linear-gradient(0deg, rgba(229,9,20,0.78) 0%, rgba(255,68,85,0.94) 100%);
  box-shadow: 0 0 8px rgba(229,9,20,0.18), inset 0 1px 0 rgba(255,255,255,0.1);
}
.cd-vbar-animate .cd-vbar-fill {
  height: var(--h) !important;
  transition: height 0.55s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.22s;
  transition-delay: var(--delay), 0s;
}
.cd-vbar-cnt {
  font-size: 8px; font-weight: 700; color: rgba(255,255,255,0.28);
  height: 14px; display: flex; align-items: center;
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
  transition: color 0.18s;
}
.cd-vbar-lbl {
  font-size: 7px; font-weight: 600; color: rgba(255,255,255,0.18);
  margin-top: 4px; position: absolute; bottom: -16px;
}
.cd-vbar-col:has(.cd-vbar-accent) .cd-vbar-lbl { color: var(--cd-accent); }
.cd-vbar-col:hover .cd-vbar-fill { filter: brightness(1.45); }
.cd-vbar-col:hover .cd-vbar-cnt { color: rgba(255,255,255,0.85); }

/* History chart */
.cd-mcom-hist-wrap { flex: 1; position: relative; min-height: 80px; display: flex; flex-direction: column; }
.cd-mcom-hist-wrap.hidden { display: none !important; }
#cd-mcom-hist-svg { display: block; flex: 1; }

/* Tooltip — glassmorphism with inner refraction */
.cd-hist-tooltip {
  position: absolute; pointer-events: none; z-index: 10;
  background: rgba(14,14,20,0.86);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 8px; padding: 7px 11px;
  font-size: 10px; color: rgba(255,255,255,0.82);
  line-height: 1.65; white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,0.48),
              inset 0 1px 0 rgba(255,255,255,0.08);
}
.cd-hist-tooltip.hidden { display: none; }
.cd-hist-tooltip strong { color: #f59e0b; display: block; margin-bottom: 1px; font-size: 10px; }

/* Cast tab */
.cd-mcast-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(85px, 1fr)); gap: 14px;
}
.cd-mcast-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center; padding: 10px 4px; border-radius: 10px;
  transition: background 0.2s;
}
.cd-mcast-card:hover { background: rgba(255,255,255,0.03); }
.cd-mcast-photo {
  width: 60px; height: 60px; border-radius: 50%; object-fit: cover;
  background: rgba(255,255,255,0.04); flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.06);
}
.cd-mcast-nophoto { display: flex; align-items: center; justify-content: center; font-size: 22px; }
.cd-mcast-name { font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.8); line-height: 1.3; }
.cd-mcast-char { font-size: 9px; color: rgba(255,255,255,0.3); line-height: 1.3; font-weight: 500; }
.cd-mcast-loading { display: flex; justify-content: center; padding: 24px 0; }

/* Details tab */
.cd-mdetails { display: flex; flex-direction: column; gap: 0; }
.cd-mdetail-row {
  display: flex; gap: 16px; padding: 11px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04); align-items: flex-start;
}
.cd-mdetail-row:last-child { border-bottom: none; }
.cd-mdetail-key {
  font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.25);
  width: 76px; flex-shrink: 0; text-transform: uppercase;
  letter-spacing: 0.08em;
}
.cd-mdetail-val { font-size: 12px; color: rgba(255,255,255,0.6); flex: 1; font-weight: 500; }
.cd-mdetails-empty { font-size: 12px; color: rgba(255,255,255,0.2); text-align: center; padding: 32px 0; }

/* Trailer tab */
.cd-mtrailer { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.cd-mtrailer-thumb-wrap {
  position: relative; width: 100%; aspect-ratio: 16/9;
  border-radius: 10px; overflow: hidden; cursor: pointer; background: #000;
  border: 1px solid rgba(255,255,255,0.06);
}
.cd-mtrailer-thumb { width: 100%; height: 100%; object-fit: cover; display: block; transition: all 0.3s; }
.cd-mtrailer-thumb-wrap:hover .cd-mtrailer-thumb { opacity: 0.6; filter: blur(1px); }
.cd-mtrailer-play-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
}
.cd-mtrailer-play-btn {
  width: 60px; height: 60px; border-radius: 50%;
  background: rgba(229,9,20,0.9); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff; padding-left: 4px;
  box-shadow: 0 8px 32px rgba(229,9,20,0.3); transition: all 0.2s;
}
.cd-mtrailer-thumb-wrap:hover .cd-mtrailer-play-btn {
  transform: scale(1.1); box-shadow: 0 8px 40px rgba(229,9,20,0.5);
}
.cd-mtrailer-link {
  font-size: 11px; color: var(--cd-accent); text-decoration: none;
  padding: 8px 20px; border-radius: 6px;
  border: 1px solid rgba(229,9,20,0.25); background: rgba(229,9,20,0.08);
  transition: all 0.2s; font-weight: 600; letter-spacing: 0.03em;
}
.cd-mtrailer-link:hover { background: rgba(229,9,20,0.18); border-color: rgba(229,9,20,0.4); }

/* Episodes tab (TV) */
.cd-mepisodes { display: flex; flex-direction: column; gap: 10px; }
.cd-eps-header {
  display: flex; align-items: center; justify-content: flex-end;
  padding: 4px 2px 2px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.cd-eps-progress {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: rgba(255,255,255,0.35);
}
.cd-eps-list { display: flex; flex-direction: column; gap: 6px; }

/* ── Episode rating heat-map dropdown ───────────────────────────────── */
.cd-eps-heatmap-wrap {
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  overflow: hidden;
  transition: background 0.15s, border-color 0.15s;
}
.cd-eps-heatmap-wrap.hidden { display: none; }
.cd-eps-heatmap-wrap.open { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08); }
.cd-eps-heatmap-head {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: transparent; border: none; cursor: pointer;
  color: inherit; font: inherit; text-align: left;
}
.cd-eps-heatmap-head:hover { background: rgba(255,255,255,0.03); }
.cd-eps-heatmap-title {
  flex: 1; font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: rgba(255,255,255,0.8);
}
.cd-eps-heatmap-hint {
  font-size: 9px; font-weight: 600; color: rgba(255,255,255,0.3);
  letter-spacing: 0.06em; text-transform: uppercase;
}
.cd-eps-heatmap-chev {
  color: rgba(255,255,255,0.3); flex-shrink: 0;
  transition: transform 0.2s;
}
.cd-eps-heatmap-wrap.open .cd-eps-heatmap-chev { transform: rotate(180deg); }
.cd-eps-heatmap-body { padding: 10px 12px 14px; }
.cd-eps-heatmap-body.hidden { display: none; }

.cd-eps-hm-legend {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  padding-bottom: 10px; margin-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 9px; font-weight: 600; color: rgba(255,255,255,0.4);
  letter-spacing: 0.04em;
}
.cd-eps-hm-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cd-eps-hm-legend i {
  display: inline-block; width: 10px; height: 10px; border-radius: 2px;
}
/* Info button at the end of the legend — explains the IMDb / TMDB
   fallback. Click toggles an inline caption below the legend. */
.cd-eps-hm-info-btn {
  margin-left: auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; padding: 0;
  background: transparent; border: none; cursor: pointer;
  color: rgba(255,255,255,0.5); border-radius: 50%;
  transition: color .15s, background .15s;
}
.cd-eps-hm-info-btn:hover { color: var(--cd-accent, #e50914); background: rgba(255,255,255,0.05); }
.cd-eps-hm-info-pop {
  margin: -6px 0 10px;
  padding: 8px 12px; border-radius: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
  font-size: 11px; line-height: 1.45;
}
.cd-eps-hm-info-pop.hidden { display: none; }

/* Vertical grid: columns = seasons, cells stack downward by episode.
   Cells are short rectangles (wide, low profile) so the whole grid
   fits without vertical scroll even on 20+ episode seasons; each cell
   carries its own rating number in place of an external legend lookup. */
.cd-eps-hm-grid {
  display: flex; gap: 3px; overflow-x: auto; padding-bottom: 4px;
  /* `safe center` falls back to flex-start when the content overflows,
     otherwise browsers clip the first columns and the scrollbar can't
     reach them (Simpsons with 37 seasons hits this). Supported in
     Chromium since v93 — Electron 33 is well past that. */
  justify-content: safe center;
  align-items: flex-start;
  width: 100%;
}
.cd-eps-hm-col {
  display: flex; flex-direction: column; gap: 2px;
  flex: 1 1 0; min-width: 48px; max-width: 88px;
}
.cd-eps-hm-col-index { flex: 0 0 auto; max-width: none; min-width: 30px; }
.cd-eps-hm-col-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  color: rgba(255,255,255,0.55); text-align: center;
  height: 18px; display: flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums;
  margin-bottom: 2px;
}
.cd-eps-hm-col-cells { display: flex; flex-direction: column; gap: 2px; }
.cd-eps-hm-cell {
  width: 100%; height: 22px;
  border-radius: 4px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  gap: 2px;
  font-size: 10px; font-weight: 700;
  color: #fff; letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(0,0,0,0.55);
  transition: transform 0.12s, box-shadow 0.12s;
}
.cd-eps-hm-cell-star { font-size: 8px; opacity: 0.85; }
.cd-eps-hm-cell-empty {
  background: rgba(255,255,255,0.02) !important;
  cursor: default; color: transparent; text-shadow: none;
}
/* TMDB-fallback cell — same color scale as IMDb but a subtle dashed
   ring to signal "rating from TMDB, not IMDb" without disrupting the
   visual rhythm of the heat-map. */
.cd-eps-hm-cell-tmdb {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
}
.cd-eps-hm-cell[data-s]:hover {
  transform: scale(1.12);
  box-shadow: 0 4px 14px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.25);
  z-index: 2; position: relative;
}
/* Leftmost column: episode-number index */
.cd-eps-hm-col-index .cd-eps-hm-col-cells { gap: 2px; }
.cd-eps-hm-ep-label {
  width: 28px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600;
  color: rgba(255,255,255,0.4); font-variant-numeric: tabular-nums;
}
.cd-eps-season {
  border-radius: 8px; background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05); overflow: hidden;
  transition: background 0.15s, border-color 0.15s;
}
.cd-eps-season.open { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08); }
.cd-eps-season-head {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; background: transparent; border: none; cursor: pointer;
  color: inherit; text-align: left;
}
.cd-eps-season-head:hover { background: rgba(255,255,255,0.03); }
.cd-eps-season-poster {
  width: 38px; height: 56px; object-fit: cover; border-radius: 4px;
  background: rgba(255,255,255,0.04); flex-shrink: 0;
}
.cd-eps-season-noposter { background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01)); }
.cd-eps-season-info { flex: 1; min-width: 0; }
.cd-eps-season-title {
  font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.9);
  margin-bottom: 2px;
}
.cd-eps-season-sub {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 11px; color: rgba(255,255,255,0.4); font-weight: 500;
}
.cd-eps-dot { color: rgba(255,255,255,0.2); }
.cd-eps-season-count { color: var(--cd-accent); font-weight: 600; }
.cd-eps-chevron {
  color: rgba(255,255,255,0.3); flex-shrink: 0;
  transition: transform 0.2s;
}
.cd-eps-season.open .cd-eps-chevron { transform: rotate(180deg); }
.cd-eps-season-body {
  display: flex; flex-direction: column; gap: 4px;
  padding: 4px 8px 8px;
}
.cd-eps-season.cd-eps-season-full .cd-eps-season-count { color: #4caf50; }
.cd-eps-season-bulk-bar {
  display: flex; justify-content: flex-end;
  padding: 4px 4px 8px;
}
.cd-eps-season-bulk {
  background: rgba(229,9,20,0.08); border: 1px solid rgba(229,9,20,0.2);
  color: var(--cd-accent); font-size: 10px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 5px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.cd-eps-season-bulk:hover { background: rgba(229,9,20,0.16); border-color: rgba(229,9,20,0.35); }
.cd-eps-season-bulk:disabled { opacity: 0.5; cursor: default; }
.cd-ep-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px; border-radius: 6px; cursor: pointer;
  transition: background 0.12s;
}
.cd-ep-row:hover { background: rgba(255,255,255,0.035); }
.cd-ep-check {
  appearance: none; -webkit-appearance: none;
  width: 16px; height: 16px; flex-shrink: 0; margin-top: 4px;
  border-radius: 4px; cursor: pointer;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.18);
  transition: background 0.12s, border-color 0.12s;
  position: relative;
}
.cd-ep-check:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.28); }
.cd-ep-check:checked {
  background: var(--cd-accent);
  border-color: var(--cd-accent);
}
.cd-ep-check:checked::after {
  content: ''; position: absolute;
  left: 4px; top: 0px; width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.cd-ep-check:disabled { cursor: default; opacity: 0.85; }
.cd-ep-check:disabled:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.18); }
.cd-ep-check:disabled:checked:hover { background: var(--cd-accent); border-color: var(--cd-accent); }
.cd-ep-row-readonly { cursor: default; }
.cd-ep-row-readonly:hover { background: transparent; }
.cd-ep-still {
  width: 96px; height: 54px; object-fit: cover; border-radius: 4px;
  background: rgba(255,255,255,0.04); flex-shrink: 0;
}
.cd-ep-still-empty { background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01)); }
.cd-ep-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cd-ep-title {
  font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.88);
  line-height: 1.35;
}
.cd-ep-num {
  color: rgba(255,255,255,0.35); font-weight: 700;
  font-size: 10px; letter-spacing: 0.04em; margin-right: 4px;
}
.cd-ep-meta {
  font-size: 10px; font-weight: 600; color: rgba(255,255,255,0.35);
  letter-spacing: 0.04em;
}
.cd-ep-overview {
  font-size: 11px; color: rgba(255,255,255,0.5); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Watched date row */
.cd-watched-date-row { display: flex; flex-direction: column; gap: 7px; padding: 10px 0 0; grid-column: 1 / -1; }
.cd-watched-date-label { font-size: 10px; color: rgba(255,255,255,0.3); font-weight: 600; letter-spacing: 0.04em; }
.cd-watched-date-input {
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); border-radius: 6px;
  padding: 8px 12px; color: var(--text); font: inherit; font-size: 12px; outline: none;
}
.cd-watched-date-input:focus { border-color: rgba(229,9,20,0.4); }
/* Watched-where row (modal) */
.cd-watched-where-row { display: flex; gap: 6px; align-items: center; }
.cd-watched-on-input {
  flex: 1; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); border-radius: 6px;
  padding: 8px 12px; color: var(--text); font: inherit; font-size: 12px; outline: none;
}
.cd-watched-on-input:focus { border-color: rgba(229,9,20,0.4); }
/* Shared theater button style */
.cd-wp-theater {
  padding: 7px 14px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03); color: var(--text); font: inherit;
  font-size: 11px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: all 0.15s;
  display: inline-flex; align-items: center; gap: 5px;
}
.cd-wp-theater svg { stroke: var(--cd-accent); }
.cd-wp-theater:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.12); }
.cd-watched-date-confirm { align-self: flex-start; }

/* ── CineDock Social Layer additions ────────────────────────────────────── */

/* Header row (logo + my-profile button) */
.cd-header-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
/* Release-tracker notifications bell + dropdown. */
.cd-notif-wrap { position: relative; }
.cd-notif-bell {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  color: var(--text-2); cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.cd-notif-bell:hover { background: rgba(255,255,255,0.10); color: #fff; }
.cd-notif-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 99px; background: var(--accent, #e50914);
  color: #fff; font-size: 9px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.cd-notif-panel {
  position: absolute; top: 36px; right: 0; z-index: 80;
  width: 320px; max-height: 420px; overflow-y: auto;
  background: #16161a;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.55);
  padding: 12px;
}
.cd-notif-panel-title {
  font-size: 10px; font-weight: 700; letter-spacing: 0.14em;
  color: rgba(255,255,255,0.5); text-transform: uppercase;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.cd-notif-list { display: flex; flex-direction: column; gap: 6px; }
.cd-notif-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: 9px;
  background: transparent; border: none;
  text-align: left; cursor: pointer; color: inherit; font: inherit;
  transition: background 0.12s;
}
.cd-notif-item:hover { background: rgba(255,255,255,0.06); }
.cd-notif-item.cd-notif-unread { background: rgba(229,9,20,0.07); }
.cd-notif-poster {
  flex: 0 0 auto; width: 34px; height: 51px;
  object-fit: cover; border-radius: 5px;
  border: 1px solid rgba(255,255,255,0.08);
}
.cd-notif-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cd-notif-item-title {
  font-size: 12.5px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cd-notif-item-line { font-size: 11.5px; color: var(--text-2); }
.cd-notif-item-when { font-size: 10px; color: var(--text-3); }

/* Card action buttons (scorecard overlay) */
.cd-card-actions {
  display: flex; gap: 5px; margin-bottom: 7px; justify-content: center;
}
.cd-ca-btn {
  width: 20px; height: 20px; border-radius: 5px;
  background: rgba(0,0,0,0.72); border: 1px solid rgba(255,255,255,0.15);
  color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s; flex-shrink: 0;
}
.cd-ca-btn:hover { background: var(--cd-accent); border-color: transparent; }
.cd-ca-btn.cd-ca-done { background: rgba(34,197,94,0.8); border-color: transparent; }
/* Watchlist button greyed out when the film is already Watched — mutual
   exclusion with Watched. Hover cursor signals the button is inert. */
.cd-ca-btn.cd-ca-disabled {
  opacity: 0.35; cursor: not-allowed; pointer-events: none;
}

/* Scale overlay proportionally with card width using container units */
.cd-grid-zoomable .cd-card-overlay,
.cd-lib-preview-row .cd-card-overlay {
  padding: min(30px, 28cqi) min(8px, 7cqi) min(8px, 7cqi);
}
.cd-grid-zoomable .cd-card-actions,
.cd-lib-preview-row .cd-card-actions {
  gap: min(5px, 4cqi); margin-bottom: min(7px, 5cqi);
}
.cd-grid-zoomable .cd-ca-btn,
.cd-lib-preview-row .cd-ca-btn {
  width: min(20px, 18cqi); height: min(20px, 18cqi); border-radius: min(5px, 4cqi);
}
.cd-grid-zoomable .cd-ca-btn svg,
.cd-lib-preview-row .cd-ca-btn svg {
  width: min(9px, 8cqi); height: min(9px, 8cqi);
}
.cd-grid-zoomable .cd-card-remove,
.cd-lib-preview-row .cd-card-remove {
  width: min(20px, 18cqi); height: min(20px, 18cqi);
  font-size: min(10px, 9cqi); top: min(5px, 4cqi); right: min(5px, 4cqi);
}
.cd-grid-zoomable .cd-card-rating,
.cd-lib-preview-row .cd-card-rating {
  font-size: min(10px, 8cqi); padding: min(3px, 2cqi) min(5px, 4cqi);
}

/* Watched bar — drops below card */
.cd-card.cd-bar-open { overflow: visible; z-index: 6; }
.cd-watched-bar {
  position: absolute; top: 100%; left: -1px; right: -1px; z-index: 6;
  background: rgba(12,14,20,0.97); backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08); border-top: none;
  border-radius: 0 0 10px 10px;
  padding: 10px; display: flex; flex-direction: column; gap: 8px;
  animation: cd-wb-in 0.2s ease;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}
@keyframes cd-wb-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.cd-watched-bar.cd-wb-out { animation: cd-wb-out 0.2s ease forwards; }
@keyframes cd-wb-out { to { opacity: 0; transform: translateY(-4px); } }
.cd-wb-pill {
  padding: 7px 10px; border-radius: 6px; cursor: pointer; width: 100%; box-sizing: border-box;
  font: inherit; font-size: 11px; font-weight: 600; white-space: nowrap;
  transition: all 0.15s; display: flex; align-items: center; justify-content: center; gap: 5px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.06); color: var(--text);
}
.cd-wb-theater svg { stroke: var(--cd-accent); }
.cd-wb-theater:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.12); }
.cd-wb-or { font-size: 9px; color: var(--text-3); text-align: center; }
.cd-wb-stars-label {
  font-size: 9px; font-weight: 700; color: rgba(255,255,255,0.35);
  text-transform: uppercase; letter-spacing: 0.1em; text-align: center;
}
.cd-wb-stars { display: flex; gap: 4px; justify-content: center; }
.cd-wb-star {
  font-size: 18px; color: rgba(255,255,255,0.12); cursor: pointer;
  transition: transform .15s; user-select: none; line-height: 1;
}
.cd-wb-star:hover { transform: scale(1.2); }
.cd-wb-star.cd-star-filled { color: #f59e0b; text-shadow: 0 0 8px rgba(245,158,11,0.3); }
.cd-wb-star.cd-star-half {
  background: linear-gradient(to right, #f59e0b 50%, rgba(255,255,255,0.12) 50%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.cd-wb-input {
  width: 100%; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px; padding: 7px 10px; color: var(--text); font: inherit; font-size: 11px; outline: none;
  box-sizing: border-box;
}
.cd-wb-input:focus { border-color: rgba(229,9,20,0.4); }
.cd-wb-input::placeholder { color: rgba(255,255,255,0.25); }
.cd-card-rating {
  position: absolute; top: 6px; left: 6px;
  background: rgba(0,0,0,0.82); border-radius: 5px;
  padding: 2px 6px; font-size: 10px; font-weight: 700;
  color: #fbbf24; pointer-events: none; letter-spacing: 0.2px;
}
.cd-rs-f { font-size: 10px; color: #fbbf24; }
.cd-rs-h { font-size: 10px; color: #fbbf24; opacity: 0.5; }
.cd-rs-e { font-size: 10px; color: rgba(255,255,255,0.18); }

/* Community (global) rating badge */
.cd-community-rating {
  position: absolute; top: 6px; left: 6px;
  background: rgba(0,0,0,0.82); border-radius: 5px;
  padding: 2px 6px; font-size: 10px; font-weight: 700;
  color: #fbbf24; pointer-events: none; letter-spacing: 0.2px;
  display: flex; align-items: center; gap: 4px;
  transition: opacity 0.2s;
}
.cd-card:hover .cd-community-rating { opacity: 0; }
/* IMDb badge: ALWAYS top-right, independent of the community badge. */
.cd-imdb-rating {
  position: absolute; top: 6px; right: 6px;
  background: rgba(0,0,0,0.82); border-radius: 5px;
  padding: 2px 6px; font-size: 10px; font-weight: 700;
  color: #fff; pointer-events: none; letter-spacing: 0.2px;
  display: flex; align-items: center; gap: 3px;
  transition: opacity 0.2s;
}
.cd-card:hover .cd-imdb-rating { opacity: 0; }
.cd-imdb-rating b { color: #f5c518; font-weight: 800; }
.cd-cr-count {
  font-size: 9px; font-weight: 500; color: rgba(255,255,255,0.55);
}
/* Small red notice under "Search Results": IMDb rating may be missing on very
   recent titles (OMDb hasn't indexed them yet). */
.cd-imdb-recent-note {
  padding: 0 20px 6px;
  font-size: 11px; font-weight: 500;
  color: var(--cd-accent, #e50914); opacity: 0.9;
}

/* Delete-account: danger button + confirmation overlay */
.btn-danger { color: #ff5a5f; border-color: rgba(255,90,95,0.4); }
.btn-danger:hover { background: rgba(255,90,95,0.12); }
.btn-danger:disabled { opacity: 0.45; pointer-events: none; }
.da-overlay {
  position: fixed; inset: 0; z-index: 100000; display: grid; place-items: center;
  background: rgba(3,5,10,0.82); backdrop-filter: blur(6px);
}
.da-overlay.hidden { display: none; }
.da-card {
  max-width: 460px; width: 90vw; background: #12141b;
  border: 1px solid rgba(255,255,255,0.1); border-radius: 16px; padding: 32px 28px;
}
.da-title { font-size: 1.35rem; font-weight: 700; margin: 0 0 12px; }
.da-warn { color: var(--text-2, #cbd5e1); font-size: 0.95rem; line-height: 1.6; margin: 0 0 18px; }
.da-ack { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9rem; color: var(--text-2,#cbd5e1); margin-bottom: 22px; cursor: pointer; }
.da-ack input { margin-top: 3px; flex-shrink: 0; }
.da-actions { display: flex; gap: 12px; justify-content: flex-end; }

/* Filter dropdowns */
.cd-filter-dropdowns {
  display: flex; gap: 6px; padding: 4px 0 0;
  overflow-x: auto; scrollbar-width: none;
}
.cd-filter-dropdowns::-webkit-scrollbar { display: none; }
.cd-fd-wrap { position: relative; flex-shrink: 0; }
.cd-fd-btn {
  padding: 4px 9px; border-radius: 20px;
  background: none; border: 1px solid var(--border);
  font-size: 10px; font-weight: 600; color: var(--text-3);
  cursor: pointer; white-space: nowrap; font-family: inherit;
  transition: all 0.15s;
}
.cd-fd-btn:hover, .cd-fd-btn.cd-fd-open { border-color: var(--border-h); color: var(--text-2); }
.cd-fd-btn.cd-fd-active {
  background: var(--cd-accent-dim); border-color: var(--cd-accent-bdr); color: var(--cd-accent);
}
/* "Clear filters" reset pill — only shown when any filter is active. */
.cd-fd-clear {
  display: inline-flex; align-items: center; gap: 5px;
  margin-left: 4px; padding: 4px 9px; border-radius: 20px;
  background: none; border: 1px solid var(--cd-accent-bdr);
  color: var(--cd-accent); font-size: 10px; font-weight: 600;
  cursor: pointer; white-space: nowrap; font-family: inherit;
  flex-shrink: 0; transition: all 0.15s;
}
.cd-fd-clear:hover { background: var(--cd-accent-dim); }
/* Inline (i) disclaimer inside a range-slider filter panel */
.cd-fd-slider-info-btn {
  width: 14px; height: 14px; padding: 0; margin-left: 6px;
  border-radius: 50%; border: 1px solid var(--border);
  background: transparent; color: var(--text-3); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  vertical-align: middle;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.cd-fd-slider-info-btn:hover { color: var(--text); border-color: var(--border-h); }
.cd-fd-slider-info-btn.cd-fd-slider-info-open {
  color: var(--cd-accent); border-color: var(--cd-accent-bdr);
  background: var(--cd-accent-dim);
}
/* Floating disclaimer banner anchored to a slider panel's (i) button.
   Rendered on document.body so it can overlap other UI without being
   clipped by the slider panel's own box. */
.cd-fd-slider-info-banner {
  position: fixed; z-index: 10000;
  max-width: 280px; padding: 10px 12px;
  background: var(--bg-card); border: 1px solid var(--border-h);
  border-radius: 10px;
  box-shadow: 0 10px 32px rgba(0,0,0,0.45);
  font-size: 11.5px; line-height: 1.5; color: var(--text-2);
}
.cd-fd-panel {
  position: fixed; z-index: 9999;
  background: var(--bg-card); border: 1px solid var(--border-h);
  border-radius: 10px; padding: 4px; min-width: 140px; max-height: 220px;
  overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.cd-fd-opt {
  display: block; width: 100%; text-align: left;
  padding: 7px 10px; border-radius: 7px;
  background: none; border: none; font-size: 11px;
  color: var(--text-2); cursor: pointer; font-family: inherit;
  transition: background 0.12s, color 0.12s; white-space: nowrap;
}
.cd-fd-opt:hover { background: var(--bg-3); color: var(--text-1); }
.cd-fd-opt.active { background: var(--cd-accent-dim); color: var(--cd-accent); font-weight: 600; }

/* Range slider variant (used by the TMDB ★ filter) */
.cd-fd-slider-panel { min-width: 240px; padding: 10px 12px; }

/* Collection (franchise) card — small "stack" badge marks it as a group */
.cd-collection-badge {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  width: 22px; height: 22px; border-radius: 5px;
  background: rgba(0,0,0,0.65); color: #fff;
  display: flex; align-items: center; justify-content: center;
}

/* Collection view panel — franchise detail page */
.cd-collectionview-header { padding: 18px 20px 4px; }
.cd-collectionview-overview {
  margin: 6px 0 12px; color: var(--text-3); font-size: 12px;
  line-height: 1.5; max-width: 720px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Discover pagination bar */
.cd-discover-pager {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 6px; padding: 16px 20px 28px;
}
.cd-discover-pager.hidden { display: none; }
.cd-dp-btn {
  min-width: 30px; padding: 5px 10px; border-radius: 8px;
  background: none; border: 1px solid var(--border);
  color: var(--text-2); font: inherit; font-size: 11px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.cd-dp-btn:hover:not(:disabled):not(.cd-dp-active) {
  border-color: var(--border-h); color: var(--text);
}
.cd-dp-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.cd-dp-active {
  background: var(--cd-accent-dim); border-color: var(--cd-accent-bdr);
  color: var(--cd-accent); cursor: default;
}
.cd-dp-nav { padding: 5px 12px; }
.cd-dp-gap {
  color: var(--text-3); font-size: 11px; padding: 0 2px;
}
.cd-fd-slider-wrap { display: flex; flex-direction: column; gap: 6px; }
.cd-fd-slider-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.cd-fd-slider-label { font-size: 10px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; }
.cd-fd-slider-val   { font-size: 14px; font-weight: 700; color: var(--cd-accent); font-variant-numeric: tabular-nums; }
/* Range slider (dual-thumb): two <input type="range"> stacked on one track.
   Both inputs are transparent; the track + fill are separate elements we
   position behind them. pointer-events: none on the input itself lets
   clicks pass to the track, then pointer-events: auto on the thumb grabs
   them for dragging. */
.cd-fd-range { position: relative; height: 18px; margin: 6px 0; }
.cd-fd-range-track {
  position: absolute; top: 50%; left: 0; right: 0; height: 4px;
  margin-top: -2px; background: var(--bg-3); border-radius: 4px;
}
.cd-fd-range-fill {
  position: absolute; top: 50%; height: 4px;
  margin-top: -2px; background: var(--cd-accent); border-radius: 4px;
  pointer-events: none;
}
.cd-fd-slider {
  -webkit-appearance: none; appearance: none;
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  background: transparent; outline: none; pointer-events: none;
}
.cd-fd-slider::-webkit-slider-runnable-track { height: 18px; background: transparent; }
.cd-fd-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  pointer-events: auto;
  width: 14px; height: 14px; margin-top: 0;
  border-radius: 50%; background: var(--cd-accent);
  border: 2px solid var(--bg-card); cursor: grab;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.cd-fd-slider::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.1); }
.cd-fd-slider-lo { z-index: 3; }
.cd-fd-slider-hi { z-index: 2; }
.cd-fd-slider-ticks {
  display: flex; justify-content: space-between;
  font-size: 9px; color: var(--text-3); margin: -2px 2px 0;
}
.cd-fd-slider-clear {
  margin-top: 4px; padding: 5px 8px; border-radius: 6px;
  background: none; border: 1px solid var(--border);
  color: var(--text-3); font-size: 10px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: all 0.15s;
}
.cd-fd-slider-clear:hover { border-color: var(--border-h); color: var(--text-2); }

/* Search type filter pills */
.cd-search-filters {
  display: flex; gap: 6px; padding: 8px 0 4px;
  overflow-x: auto; scrollbar-width: none;
}
.cd-search-filters::-webkit-scrollbar { display: none; }
.cd-sf-pill {
  padding: 4px 10px; border-radius: 20px;
  background: none; border: 1px solid var(--border);
  font-size: 10px; font-weight: 600; color: var(--text-3);
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: all 0.15s; font-family: inherit;
}
.cd-sf-pill:hover { border-color: var(--border-h); color: var(--text-2); }
.cd-sf-pill.active {
  background: var(--cd-accent-dim); border-color: var(--cd-accent-bdr); color: var(--cd-accent);
}

/* People search */
.cd-people-wrap {
  padding: 0 16px 10px; flex-shrink: 0;
}
.cd-people-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 10px; padding: 7px 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.cd-people-bar:focus-within {
  border-color: var(--cd-accent); box-shadow: 0 0 0 3px var(--cd-accent-dim);
}
.cd-people-input {
  flex: 1; background: none; border: none; outline: none;
  font-size: 12px; color: var(--text-1); min-width: 0; font-family: inherit;
}
.cd-people-input::placeholder { color: var(--text-3); }
.cd-people-results {
  margin-top: 6px; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}
.cd-people-result {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; transition: background 0.15s;
}
.cd-people-result + .cd-people-result { border-top: 1px solid var(--border); }
.cd-people-result:hover { background: var(--bg-3); }
.cd-people-avatar { font-size: 20px; flex-shrink: 0; }
.cd-people-avatar-img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; font-size: 0; }
.cd-people-name { font-size: 12px; font-weight: 600; color: var(--text-1); }
.cd-people-sub { font-size: 10px; color: var(--text-3); margin-top: 1px; }
.cd-pf-btn {
  padding: 4px 10px; border-radius: 6px; font-size: 10px; font-weight: 600;
  background: var(--cd-accent-dim); border: 1px solid var(--cd-accent-bdr);
  color: var(--cd-accent); cursor: pointer; white-space: nowrap;
  flex-shrink: 0; transition: background 0.15s; font-family: inherit;
}
.cd-pf-btn.cd-following {
  background: var(--bg-3); border-color: var(--border); color: var(--text-2);
}
.cd-people-empty { font-size: 12px; color: var(--text-3); padding: 12px 14px; }

/* Feed filter pills */
.cd-feed-filter {
  display: flex; gap: 6px; padding: 12px 16px 8px; flex-shrink: 0; align-items: center;
}
.cd-filter-pill {
  padding: 6px 14px; border-radius: 99px;
  background: var(--bg-3); border: 1px solid var(--border);
  font-size: 12px; font-weight: 600; color: var(--text-3);
  cursor: pointer; transition: all 0.18s; font-family: inherit;
  display: inline-flex; align-items: center; gap: 5px;
}
.cd-filter-pill svg { stroke: var(--cd-accent); flex-shrink: 0; }
.cd-filter-pill:hover { color: var(--text-2); border-color: var(--border-h); }
.cd-filter-pill.active {
  background: var(--cd-accent-dim); border-color: var(--cd-accent-bdr); color: var(--cd-accent);
}
.cd-filter-pill.active svg { stroke: #fff; }

/* Feed zoom controls */
.cd-feed-zoom {
  margin-left: auto; display: inline-flex; gap: 0;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 99px; padding: 2px;
}
.cd-feed-zoom-btn {
  width: 26px; height: 26px; border-radius: 50%;
  background: transparent; border: none; color: var(--text-3);
  cursor: pointer; transition: color 0.15s, background 0.15s;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: inherit; padding: 0;
}
.cd-feed-zoom-btn:hover:not(:disabled) { color: var(--text); background: var(--glass-h); }
.cd-feed-zoom-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* Content-type sub-filter (second row) */
.cd-feed-subfilter {
  display: flex; gap: 6px; padding: 0 16px 10px;
  flex-shrink: 0; overflow-x: auto; scrollbar-width: none;
}
.cd-feed-subfilter::-webkit-scrollbar { display: none; }
.cd-subfilter-pill {
  padding: 5px 12px; border-radius: 99px;
  background: transparent; border: 1px solid var(--border);
  font-size: 11px; font-weight: 600; color: var(--text-3);
  cursor: pointer; transition: all 0.15s; font-family: inherit;
  white-space: nowrap; flex-shrink: 0;
}
.cd-subfilter-pill:hover { color: var(--text-2); border-color: var(--border-h); }
.cd-subfilter-pill.active {
  background: var(--text); border-color: var(--text); color: var(--bg);
}

/* Review entries in feed */
.cd-feed-item-review .cd-feed-body { align-items: flex-start; }
.cd-feed-review {
  display: flex; flex-direction: column; gap: 8px; margin-top: 4px;
}
.cd-feed-rating {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 700; color: #fbbf24;
  align-self: flex-start;
}
.cd-feed-rating-max { color: var(--text-3); font-weight: 500; font-size: 11px; margin-left: 1px; }
.cd-feed-review-text {
  font-size: var(--fz-overview); color: var(--text-2); line-height: 1.55;
  margin: 0; padding: 8px 10px 8px 12px;
  border-left: 2px solid var(--cd-accent-bdr);
  background: rgba(255,255,255,0.02);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden;
  position: relative;
}
.cd-feed-review-text.cd-feed-spoiler {
  cursor: pointer;
  -webkit-line-clamp: 2;
}
.cd-feed-review-text.cd-feed-spoiler .cd-feed-review-body { filter: blur(6px); user-select: none; }
.cd-feed-spoiler-warn {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--cd-accent);
  background: rgba(12,14,20,0.7); border-radius: 0 8px 8px 0;
  font-style: normal; z-index: 1;
  transition: opacity 0.2s;
}
.cd-feed-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.cd-feed-tag {
  font-size: 10px; font-weight: 600; color: var(--text-3);
  padding: 2px 7px; border-radius: 99px;
  background: var(--bg-3); border: 1px solid var(--border);
}

/* Feed user attribution */
.cd-feed-user {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; min-width: 0; flex: 1;
}
.cd-feed-user:hover .cd-feed-handle { color: var(--cd-accent); }
.cd-feed-user-emoji {
  width: var(--fz-avatar); height: var(--fz-avatar); border-radius: 50%;
  background: var(--bg-3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: calc(var(--fz-avatar) * 0.47); flex-shrink: 0;
  transition: width 0.2s ease, height 0.2s ease;
}
.cd-feed-user-img {
  width: var(--fz-avatar); height: var(--fz-avatar); border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--border);
  transition: width 0.2s ease, height 0.2s ease;
}
.cd-feed-handle {
  font-size: 13px; font-weight: 700; color: var(--text);
  transition: color 0.15s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Feed "load more" */
.cd-feed-more-btn {
  margin: 4px 16px 16px; padding: 10px;
  border-radius: 10px; background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text-3); font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all 0.15s; font-family: inherit; width: calc(100% - 32px);
}
.cd-feed-more-btn:hover { border-color: var(--cd-accent); color: var(--cd-accent); }

/* ── Smart Search Akinator panel (slide-in from right) ──────────────────
   Sits inside the main-content frame so the StreamDock title bar (68px)
   and bottom navigation (78px) stay visible and the panel's own header
   + form input remain reachable. */
.akinator-panel {
  position: fixed;
  top: var(--header-h); right: 0; bottom: var(--nav-h);
  width: min(440px, 100vw);
  background: var(--bg-2);
  border-left: 1px solid var(--border);
  border-top-left-radius: 14px;
  z-index: 80;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -24px 0 60px rgba(0,0,0,0.5);
}
.akinator-panel.akinator-open { transform: translateX(0); }
.akinator-panel.hidden { display: none; }

/* Backdrop — dims the page behind the panel so it reads as a focused
   modal flow rather than floating UI. Click to dismiss. */
.akinator-backdrop {
  position: fixed;
  top: var(--header-h); bottom: var(--nav-h); left: 0; right: 0;
  background: rgba(0,0,0,0.5);
  opacity: 0; pointer-events: none;
  transition: opacity 0.28s ease;
  z-index: 79;
}
.akinator-backdrop.akinator-open { opacity: 1; pointer-events: auto; }
.akinator-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px 14px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0));
  flex-shrink: 0;
  border-top-left-radius: 14px;
}
.akinator-title {
  margin: 0; font-size: 14px; font-weight: 700; color: #fff;
  letter-spacing: 0.02em; flex: 1;
  display: flex; align-items: center; gap: 8px;
}
.akinator-title::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--cd-accent, #6366f1);
  box-shadow: 0 0 8px var(--cd-accent, #6366f1);
}
.akinator-turn-counter {
  font-size: 11px; color: rgba(255,255,255,0.6);
  font-variant-numeric: tabular-nums;
  background: rgba(255,255,255,0.05);
  padding: 3px 8px; border-radius: 999px;
}
.akinator-close {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.85);
  width: 30px; height: 30px; border-radius: 8px;
  font-size: 18px; line-height: 1; cursor: pointer;
  padding: 0; display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
  flex-shrink: 0;
}
.akinator-close:hover { background: rgba(255,255,255,0.12); color: #fff; border-color: rgba(255,255,255,0.18); }
.akinator-close:active { transform: scale(0.94); }
.akinator-messages {
  flex: 1; overflow-y: auto; min-height: 0;
  padding: 16px 18px; display: flex; flex-direction: column; gap: 10px;
}
.akinator-msg {
  max-width: 88%;
  padding: 10px 13px; border-radius: 14px;
  font-size: 13.5px; line-height: 1.45; word-wrap: break-word;
  animation: akinator-msg-in 0.24s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.akinator-msg-user {
  align-self: flex-end;
  background: var(--cd-accent, #6366f1); color: #fff;
  border-bottom-right-radius: 4px;
}
.akinator-msg-assistant {
  align-self: flex-start;
  background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.92);
  border-bottom-left-radius: 4px;
}
.akinator-msg-typing {
  align-self: flex-start;
  background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.5);
  display: inline-flex; gap: 4px; padding: 12px 14px;
}
.akinator-msg-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; animation: akinator-typing 1.2s ease-in-out infinite;
}
.akinator-msg-typing span:nth-child(2) { animation-delay: 0.15s; }
.akinator-msg-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes akinator-typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}
@keyframes akinator-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.akinator-candidates {
  border-top: 1px solid var(--border);
  padding: 14px 18px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 10px;
  max-height: 40vh; overflow-y: auto;
}
.akinator-candidates.hidden { display: none; }
.akinator-cand {
  cursor: pointer; border: none; background: none; padding: 0;
  display: flex; flex-direction: column; gap: 4px; text-align: center;
  transition: transform 0.15s;
}
.akinator-cand:hover { transform: translateY(-2px); }
.akinator-cand img {
  width: 100%; aspect-ratio: 2/3; object-fit: cover;
  border-radius: 8px; background: rgba(255,255,255,0.05);
}
.akinator-cand-title {
  font-size: 10.5px; color: rgba(255,255,255,0.85);
  line-height: 1.25; max-height: 2.5em; overflow: hidden;
}
.akinator-form {
  display: flex; gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: linear-gradient(0deg, rgba(255,255,255,0.03), rgba(255,255,255,0));
  flex-shrink: 0;
}
.akinator-input {
  flex: 1; min-width: 0;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px;
  color: #fff; font-family: inherit; font-size: 13px;
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.akinator-input::placeholder { color: rgba(255,255,255,0.35); }
.akinator-input:focus {
  border-color: var(--cd-accent, #6366f1);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.18);
}
.akinator-send {
  background: var(--cd-accent, #6366f1); color: #fff;
  border: none; border-radius: 10px;
  padding: 0 16px; min-width: 64px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.02em; cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.akinator-send:hover:not(:disabled) { opacity: 0.92; }
.akinator-send:active:not(:disabled) { transform: scale(0.97); }
.akinator-send:disabled { opacity: 0.35; cursor: not-allowed; }

/* One-tap refinement chips under discovery results — re-run the search
   with the previous query plus a qualifier. */
.search-refine-strip {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin: 4px 36px 6px;
}
.search-refine-label {
  font-size: 11.5px; color: var(--text-3);
  letter-spacing: 0.04em; text-transform: uppercase; font-weight: 600;
}
.search-refine-chip {
  padding: 6px 13px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  color: var(--text-2); font-size: 12.5px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.search-refine-chip:hover {
  background: rgba(255,255,255,0.10);
  border-color: rgba(229,9,20,0.5);
  color: #fff;
}
.search-refine-chip:active { transform: scale(0.97); }

/* CTA shown below ambiguous discovery results — opens the panel above. */
.search-akinator-cta {
  margin: 18px 36px 30px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(99,102,241,0.04));
  border: 1px solid rgba(99,102,241,0.32);
  border-radius: 12px;
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; color: rgba(255,255,255,0.85);
}
.search-akinator-cta-text { flex: 1; line-height: 1.4; }
.search-akinator-cta-btn {
  background: var(--cd-accent, #6366f1); color: #fff;
  border: none; border-radius: 8px;
  padding: 8px 14px; font-size: 12px; font-weight: 700; cursor: pointer;
  white-space: nowrap; transition: opacity 0.15s;
  font-family: inherit;
}
.search-akinator-cta-btn:hover { opacity: 0.9; }

/* ── Profile Panel ───────────────────────────────────────── */
.cd-profile-panel {
  position: absolute; inset: 0;
  background: var(--bg); z-index: 50;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
.cd-profile-panel.cd-profile-open { transform: translateX(0); }
/* The profile panel must sit above the group view (both share z-index 50 via
   .cd-profile-panel but the group view is later in the DOM and wins by default). */
#cd-profile-panel.cd-profile-open { z-index: 60; }
/* Statistics is opened FROM the profile panel (z-index 60), so it must sit
   above it — otherwise it slides in underneath and only shows after the
   profile is closed ("nothing happens on first open" bug). */
#cd-stats-view.cd-profile-open { z-index: 70; }
.cd-profile-scroll {
  flex: 1; overflow-y: auto; min-height: 0;
  /* Children stack as normal blocks so each section keeps its natural
     height. Making this a flex column with overflow-y:auto looked
     equivalent but turned .cd-profile-body (the lists) into a flex item
     with min-height:0 — flex then shrank it inside the viewport instead
     of letting it overflow, and the panel "couldn't scroll past the
     first section". */
  /* Match My Library's page bg so a visitor profile doesn't look grey
     next to own-profile darker surface. Both now use the same base. */
  background: var(--bg);
}
.cd-profile-scroll::-webkit-scrollbar { width: 3px; }
.cd-profile-scroll::-webkit-scrollbar-track { background: transparent; }
.cd-profile-scroll::-webkit-scrollbar-thumb { background: var(--border-h); border-radius: 2px; }

.cd-profile-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px; flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: rgba(8,10,15,0.94); backdrop-filter: blur(20px);
}
.cd-profile-back-btn {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--text-2);
  cursor: pointer; padding: 4px 0; transition: color 0.15s;
}
.cd-profile-back-btn:hover { color: var(--cd-accent); }
.cd-profile-share-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text-3); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.cd-profile-share-btn:hover { border-color: var(--cd-accent); color: var(--cd-accent); }

.cd-profile-dots {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text-3); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; position: relative;
}
.cd-profile-dots:hover { border-color: var(--border-h); color: var(--text-2); }
.cd-profile-dots-menu {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 60;
  background: var(--bg-2); border: 1px solid var(--border-h);
  border-radius: 10px; padding: 4px 0; min-width: 160px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5); display: none;
}
.cd-profile-dots-menu.open { display: block; }
.cd-profile-dots-menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 14px; background: none; border: none;
  color: rgba(255,255,255,0.7); font-size: 12px; cursor: pointer;
  font-family: inherit; transition: background 0.1s;
}
.cd-profile-dots-menu-item:hover { background: rgba(255,255,255,0.06); }
.cd-profile-dots-menu-item.cd-net-danger { color: #f87171; }
.cd-profile-dots-menu-item.cd-net-danger:hover { background: rgba(248,113,113,0.1); }

/* Report Modal */
.cd-report-box { max-width: 400px; width: 92%; padding: 24px; }
.cd-report-title { font-size: 16px; font-weight: 700; color: #fff; margin: 0 0 4px; }
.cd-report-sub { font-size: 12px; color: rgba(255,255,255,0.4); margin: 0 0 16px; }
.cd-report-reasons { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.cd-report-reason {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 8px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7); font-size: 13px; cursor: pointer;
  transition: all 0.15s;
}
.cd-report-reason:hover { border-color: rgba(255,255,255,0.12); background: rgba(255,255,255,0.05); }
.cd-report-reason:has(input:checked) { border-color: var(--cd-accent); background: var(--cd-accent-dim); color: #fff; }
.cd-report-reason input { accent-color: var(--cd-accent); }
.cd-report-details {
  width: 100%; background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; color: var(--text); font: inherit;
  font-size: 12px; resize: none; outline: none;
  margin-bottom: 14px;
}
.cd-report-details:focus { border-color: rgba(229,9,20,0.4); }
.cd-report-details::placeholder { color: rgba(255,255,255,0.25); }

.cd-profile-avatar-wrap { flex-shrink: 0; }
.cd-profile-avatar {
  width: 100%; height: 100%; border-radius: 50%;
  background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
}
.cd-profile-username {
  font-size: 17px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 4px;
}
.cd-profile-bio { font-size: 12px; color: var(--text-3); line-height: 1.5; }
.cd-member-since { display: block; font-size: 11px; color: var(--text-3); opacity: 0.6; margin-top: 4px; }
.cd-profile-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }

.cd-follow-btn {
  padding: 7px 18px; border-radius: 99px;
  background: var(--cd-accent); border: none; color: #fff;
  font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit;
  transition: opacity 0.15s, background 0.15s;
}
.cd-follow-btn:hover { opacity: 0.85; }
.cd-follow-btn.cd-following {
  background: transparent; border: 1px solid var(--border-h); color: var(--text-2);
}
.cd-follow-btn.cd-following:hover { border-color: #f87171; color: #f87171; }
.cd-edit-profile-btn {
  padding: 7px 14px; border-radius: 99px;
  background: var(--bg-3); border: 1px solid var(--border); color: var(--text-2);
  font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: border-color 0.15s;
}
.cd-edit-profile-btn:hover { border-color: var(--cd-accent); color: var(--cd-accent); }

.cd-profile-stats {
  display: flex; align-items: center; justify-content: center;
  gap: 0; padding: 12px 16px 14px;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  flex-shrink: 0; background: var(--bg-2);
}
.cd-stat {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.cd-stat-n { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1; }
.cd-stat-l { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px; }
.cd-stat-div { width: 1px; height: 28px; background: var(--border); flex-shrink: 0; }

.cd-profile-btns {
  display: flex; gap: 8px; padding: 12px 16px 0;
}
.cd-network-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  flex: 1; padding: 9px 0;
  border-radius: 8px; border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03); color: rgba(255,255,255,0.6);
  font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: all 0.15s;
}
.cd-network-btn:hover { border-color: rgba(255,255,255,0.15); color: #fff; background: rgba(255,255,255,0.06); }

.cd-profile-body {
  padding-bottom: 16px; min-height: 0;
}

/* Network Panel */
.cd-network-panel { display: flex; flex-direction: column; height: 100%; }
.cd-network-panel.hidden { display: none; }
.cd-network-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  margin-top: 8px;
}
.cd-network-back {
  background: none; border: none; color: rgba(255,255,255,0.5); cursor: pointer;
  padding: 4px; border-radius: 6px; display: flex; transition: color 0.15s;
}
.cd-network-back:hover { color: #fff; }
.cd-network-title { font-size: 15px; font-weight: 700; color: #fff; flex: 1; margin: 0; }
/* (i) badge in panel headers — tooltips clarify when reviews/diary appear */
.cd-tab-info {
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  color: rgba(255,255,255,0.65);
  font: 700 10px/1 'Georgia', 'Times New Roman', serif;
  font-style: italic;
  cursor: help; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.cd-tab-info:hover {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.28);
  color: #fff;
}
.cd-network-sort {
  background: var(--bg-3); border: 1px solid var(--border);
  color: rgba(255,255,255,0.7); font-size: 11px; padding: 5px 8px;
  border-radius: 6px; cursor: pointer; font-family: inherit;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
  padding-right: 22px;
}
.cd-network-sort option { background: var(--bg-2); color: var(--text); }
.cd-network-tabs {
  display: flex; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.cd-network-tab {
  flex: 1; padding: 10px 0; background: none; border: none;
  border-bottom: 2px solid transparent;
  color: rgba(255,255,255,0.4); font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: all 0.15s;
}
.cd-network-tab:hover { color: rgba(255,255,255,0.7); }
.cd-network-tab.active { color: #fff; border-bottom-color: var(--cd-accent); }
.cd-network-list {
  flex: 1; overflow-y: auto; padding: 8px 0;
}

/* Network User Row */
.cd-net-user {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; transition: background 0.1s; cursor: pointer;
  position: relative;
}
.cd-net-user:hover { background: rgba(255,255,255,0.03); }
.cd-net-avatar {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
  flex-shrink: 0; background: rgba(255,255,255,0.06);
}
.cd-net-avatar-ph {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,0.06); display: flex; align-items: center;
  justify-content: center; font-size: 18px;
}
.cd-net-info { flex: 1; min-width: 0; }
.cd-net-name {
  font-size: 13px; font-weight: 600; color: #fff;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.cd-net-meta {
  font-size: 10px; color: rgba(255,255,255,0.35); margin-top: 2px;
  display: flex; gap: 8px;
}
.cd-net-center {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  display: flex; align-items: center;
  pointer-events: none;
}
.cd-net-center .cd-net-stat { pointer-events: auto; }
.cd-net-stats {
  display: flex; gap: 18px;
}
.cd-net-stat {
  display: flex; align-items: center; gap: 5px;
}
.cd-net-stat svg {
  color: var(--cd-accent); flex-shrink: 0;
  width: 16px; height: 16px;
}
.cd-net-stat-n { font-size: 13px; font-weight: 700; color: rgba(255,255,255,0.85); }
.cd-net-right {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.cd-net-action {
  padding: 5px 12px; border-radius: 6px;
  font-size: 11px; font-weight: 600; cursor: pointer; font-family: inherit;
  border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.7); transition: all 0.15s;
}
.cd-net-action:hover { border-color: rgba(255,255,255,0.25); color: #fff; }
.cd-net-action.cd-net-following { background: var(--cd-accent); border-color: var(--cd-accent); color: #fff; }
.cd-net-action.cd-net-following:hover { background: #c00; }
.cd-net-action.cd-net-unblock { border-color: rgba(255,255,255,0.12); }
.cd-net-dots {
  background: none; border: none; color: rgba(255,255,255,0.3); cursor: pointer;
  padding: 4px; border-radius: 6px; display: flex; transition: color 0.15s;
  position: relative;
}
.cd-net-dots:hover { color: rgba(255,255,255,0.7); }
.cd-net-dots-menu {
  position: absolute; top: 100%; right: 0; z-index: 20;
  background: var(--bg-2); border: 1px solid var(--border-h);
  border-radius: 8px; padding: 4px 0; min-width: 140px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  display: none;
}
.cd-net-dots-menu.open { display: block; }
.cd-net-dots-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 14px; background: none; border: none;
  color: rgba(255,255,255,0.7); font-size: 12px; cursor: pointer;
  font-family: inherit; transition: background 0.1s;
}
.cd-net-dots-menu button:hover { background: rgba(255,255,255,0.06); }
.cd-net-dots-menu button.cd-net-danger { color: #f87171; }
.cd-net-dots-menu button.cd-net-danger:hover { background: rgba(248,113,113,0.1); }
.cd-net-empty {
  padding: 40px 16px; text-align: center;
  font-size: 13px; color: rgba(255,255,255,0.3);
}

/* ── Edit Profile Modal ──────────────────────────────────── */
.cd-edit-modal {
  position: absolute; inset: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.cd-edit-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(6px);
}
.cd-edit-box {
  position: relative; z-index: 1;
  background: var(--bg-2); border: 1px solid var(--border-h);
  border-radius: 18px; padding: 22px 20px; width: 360px; max-width: 100%;
  animation: cd-modal-in 0.22s cubic-bezier(0.34,1.4,0.64,1);
  display: flex; flex-direction: column; gap: 12px;
  /* Tall modals (poll create with random preview, etc.) need to scroll
     instead of pushing the body off-screen. Cap to viewport with a small
     gutter so the box never looks pinned. */
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.cd-edit-header {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 14px; border-bottom: 1px solid var(--border);
}
.cd-edit-header h3 {
  font-size: 14px; font-weight: 700; color: var(--text);
  letter-spacing: -0.01em;
}
.cd-edit-label {
  font-size: 10px; font-weight: 700; color: var(--text-3);
  letter-spacing: 0.1em; text-transform: uppercase; display: block;
}
.cd-edit-field { display: flex; flex-direction: column; gap: 6px; }
.cd-edit-hint { font-size: 11px; color: var(--text-3); line-height: 1.5; margin: 0; }
.cd-edit-footer { padding-top: 14px; border-top: 1px solid var(--border); }
.cd-edit-close {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text-3); font-size: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.cd-edit-close:hover { background: rgba(229,9,20,0.4); color: #fff; }
/* ── Profile image upload ─────────────────── */
.cd-edit-avatar-section {
  display: flex; gap: 14px; align-items: flex-start;
}
.cd-edit-avatar-drop {
  width: 72px; height: 72px; border-radius: 50%; flex-shrink: 0;
  position: relative; cursor: pointer; overflow: hidden;
  background: var(--bg-3); border: 2px solid var(--border);
  transition: border-color 0.2s;
}
.cd-edit-avatar-drop:hover, .cd-edit-avatar-drop.cd-drop-active {
  border-color: var(--cd-accent);
}
.cd-edit-avatar-preview {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
}
.cd-edit-avatar-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; border-radius: 50%;
}
.cd-edit-avatar-img.hidden { display: none; }
.cd-edit-avatar-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  background: rgba(0,0,0,0.6); opacity: 0; transition: opacity 0.2s;
  font-size: 9px; color: rgba(255,255,255,0.8); font-weight: 600;
}
.cd-edit-avatar-drop:hover .cd-edit-avatar-overlay { opacity: 1; }
.cd-edit-avatar-right { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.cd-edit-avatar-hint {
  font-size: 10px; color: var(--text-3); margin-bottom: 2px;
}
.cd-edit-avatar-clear {
  align-self: flex-start; background: none; border: none;
  color: var(--cd-accent); font-size: 10px; cursor: pointer;
  padding: 0; font-family: inherit;
}
.cd-edit-avatar-clear:hover { text-decoration: underline; }
.cd-edit-avatar-clear.hidden { display: none; }

/* ── Profile image crop overlay ──────────── */
.cd-crop-overlay {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 16px 0;
}
.cd-crop-overlay.hidden { display: none; }
.cd-crop-area {
  width: 200px; height: 200px; border-radius: 50%;
  overflow: hidden; position: relative; cursor: grab;
  background: var(--bg-3); border: 2px solid rgba(255,255,255,0.1);
  box-shadow: 0 0 0 4000px rgba(0,0,0,0.5);
}
.cd-crop-area:active { cursor: grabbing; }
.cd-crop-img {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%; object-fit: cover;
  transform-origin: center center;
  user-select: none; pointer-events: none;
}
.cd-crop-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  pointer-events: none;
}
.cd-crop-controls {
  display: flex; align-items: center; gap: 8px; width: 200px;
}
.cd-crop-zoom {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 3px; background: rgba(255,255,255,0.1); border-radius: 2px; outline: none;
}
.cd-crop-zoom::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px;
  border-radius: 50%; background: var(--cd-accent); cursor: pointer;
  border: 2px solid rgba(255,255,255,0.2);
}
.cd-crop-actions { display: flex; gap: 8px; }
.cd-crop-cancel {
  padding: 6px 16px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.1);
  background: none; color: var(--text-3); font: inherit; font-size: 11px;
  font-weight: 600; cursor: pointer;
}
.cd-crop-cancel:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }
.cd-crop-apply {
  padding: 6px 16px; border-radius: 6px; border: none;
  background: var(--cd-accent); color: #fff; font: inherit; font-size: 11px;
  font-weight: 600; cursor: pointer; transition: opacity 0.15s;
}
.cd-crop-apply:hover { opacity: 0.85; }

/* ── Library cover image ─────────────────── */
.cd-lib-cover {
  position: relative;
  /* Fluid height: scales with the viewport so the cover stays a real
     cinematic strip on big monitors (where 210px reads as a sliver
     against tall sidebars + stats) and a sensible band on laptops.
     Min keeps it usable on short windows; max stops it from eating
     the rest of the panel on 4K. */
  height: clamp(220px, 30vh, 380px);
  min-height: clamp(220px, 30vh, 380px);
  flex-shrink: 0;
  overflow: hidden;
  /* Fallback: warm-neutral surface tinted with a faint accent radial,
     instead of the old #0a0e16 → #12182a "AI blue" gradient. Shown
     while the cover image loads, or when no custom cover is set. */
  background:
    radial-gradient(120% 80% at 80% 0%, rgba(229,9,20,0.07) 0%, transparent 55%),
    radial-gradient(140% 100% at 20% 100%, rgba(255,255,255,0.03) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-3) 0%, var(--bg-2) 100%);
}
.cd-lib-cover-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  /* Subtle slow zoom on hover so the cover feels alive without taking
     focus from the rest of the panel. */
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.cd-lib-cover:hover .cd-lib-cover-img { transform: scale(1.025); }
.cd-lib-cover.cd-cover-repositioning .cd-lib-cover-img { transform: none; }

.cd-lib-cover-gradient {
  position: absolute; inset: 0;
  /* Multi-stop blend:
       1) Soft top vignette → keeps the Back-button row legible even
          when the cover photo has a bright sky / face in that band.
       2) Mid transparent window → the cover image reads at full
          strength through here.
       3) Long bottom blend through bg-2 to bg → no hard "where the
          image dies" seam; the avatar overlap sits in the deepest
          part of the blend so it reads as one continuous surface
          with the panel below.
       4) Side feather → trims the rectangular edge so the cover
          feels cropped, not pasted on. */
  background:
    /* Image stays at full strength through the middle 60% of the
       cover; the blend now only owns the last ~20% so on tall covers
       the photo dominates and the fade is a finishing band, not the
       main thing. Top vignette tightened so the nav-legibility
       protection doesn't eat into the focal area either. */
    linear-gradient(180deg,
      rgba(8, 10, 15, 0.42) 0%,
      rgba(8, 10, 15, 0.08) 10%,
      transparent 22%,
      transparent 70%,
      rgba(8, 10, 15, 0.30) 82%,
      var(--bg-2) 94%,
      var(--bg) 100%),
    radial-gradient(160% 70% at 50% 110%, rgba(0,0,0,0.30) 0%, transparent 55%);
  pointer-events: none; z-index: 1;
}
/* Grain overlay — kills the flat-AI-photo feel without darkening
   the image. Inline SVG turbulence; rendered above the image but
   below the gradient blend and the avatar. */
.cd-lib-cover::after {
  content: ''; position: absolute; inset: 0; z-index: 2;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.22 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.05; mix-blend-mode: overlay;
  pointer-events: none;
}
/* Cover action bar */
.cd-lib-cover-bar {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  display: flex; gap: 4px; opacity: 0; transition: opacity 0.2s;
}
.cd-lib-cover:hover .cd-lib-cover-bar { opacity: 1; }
.cd-lib-cover-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 6px;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7); cursor: pointer;
  font-size: 10px; font-weight: 600; font-family: inherit;
  transition: all 0.15s;
}
.cd-lib-cover-btn:hover { background: rgba(0,0,0,0.8); color: #fff; }
.cd-lib-cover-save { background: var(--cd-accent) !important; color: #fff !important; border-color: var(--cd-accent) !important; }

/* Reposition mode */
.cd-lib-cover-repo-bar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 4;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 6px 12px;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(8px);
}
.cd-lib-cover-repo-bar.hidden { display: none; }
.cd-lib-cover-repo-hint {
  font-size: 11px; color: rgba(255,255,255,0.6); margin-right: auto;
}
.cd-lib-cover.cd-cover-repositioning { cursor: grab; }
.cd-lib-cover.cd-cover-repositioning .cd-lib-cover-bar { display: none; }
.cd-lib-cover.cd-cover-repositioning .cd-lib-cover-gradient { opacity: 0.3; }
.cd-lib-cover.cd-cover-repositioning::after { opacity: 0; }
.cd-lib-cover.cd-cover-repositioning:active { cursor: grabbing; }

/* Own avatar with image support */
.cd-own-avatar-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; border-radius: 50%; display: block;
}
.cd-own-avatar-img.hidden { display: none !important; }
/* Avatar overlapping cover — LinkedIn style. Avatar sits centered on the
   cover's bottom edge so ~half shows over the cover image and ~half
   extends into the panel background below. */
.cd-lib-avatar-overlap {
  position: relative; z-index: 4; margin-top: -46px;
  padding: 0 20px; flex-shrink: 0;
  display: flex; align-items: flex-end; justify-content: space-between;
}
.cd-lib-avatar-overlap .cd-profile-actions {
  /* Column: [Share] [•••]  ← top row (Share + optional dots menu)
             [Follow / Edit Profile] ← bottom row */
  display: flex; flex-direction: column; gap: 6px;
  align-items: flex-end; padding-bottom: 4px;
}
.cd-profile-actions-top {
  display: flex; flex-direction: row; gap: 6px; align-items: center;
}
.cd-profile-info {
  padding: 6px 20px 0; flex-shrink: 0;
}
.cd-profile-info .cd-profile-username { font-size: 16px; font-weight: 700; color: var(--text); }
.cd-profile-info .cd-profile-bio { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.cd-profile-avatar-wrap {
  position: relative; width: 80px; height: 80px; flex-shrink: 0;
  border-radius: 50%; overflow: hidden;
  /* Ring matches the panel body bg (the avatar overlaps the cover→panel
     blend, so picking --bg keeps the lower half visually attached to
     the panel below). Layered shadow gives a real lift over the cover
     gradient + a whisper of the accent hue so it reads as one piece
     with the warm radial in the cover. */
  border: 3px solid var(--bg);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.05),
    0 14px 36px rgba(0,0,0,0.55),
    0 0 28px rgba(229,9,20,0.06);
}

/* ── Playlist cover upload ───────────────── */
.cd-pl-cover-drop {
  position: relative; height: 80px; border-radius: 10px;
  background: var(--bg-3); border: 1px dashed var(--border);
  cursor: pointer; overflow: hidden; transition: border-color 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.cd-pl-cover-drop:hover, .cd-pl-cover-drop.cd-drop-active {
  border-color: var(--cd-accent); border-style: solid;
}
.cd-pl-cover-preview {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
}
.cd-pl-cover-preview.hidden { display: none; }
.cd-pl-cover-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--text-3); font-size: 10px;
}

/* ── Playlist background selector ────────── */
.cd-pl-bg-section { display: flex; flex-direction: column; gap: 6px; }
.cd-pl-bg-section.hidden { display: none; }
.cd-pl-bg-label { font-size: 10px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.cd-pl-bg-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
}
.cd-pl-bg-opt {
  height: 40px; border-radius: 6px; cursor: pointer;
  border: 2px solid transparent; background-size: cover; background-position: center;
  transition: border-color 0.15s, transform 0.15s;
}
.cd-pl-bg-opt:hover { transform: scale(1.05); }
.cd-pl-bg-opt.cd-sel { border-color: var(--cd-accent); }
.cd-pl-bg-opt-none {
  background: var(--bg-3); display: flex; align-items: center; justify-content: center;
  font-size: 9px; color: var(--text-3);
}

/* ── Section view panel ─────────────────── */
#cd-section-view > *:not(.cd-plview-bg) { position: relative; z-index: 1; }
.cd-secview-header {
  padding: 14px 20px 4px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.cd-secview-header-text { min-width: 0; flex: 1; }
.cd-secview-count { font-size: 11px; color: var(--text-3); font-weight: 400; margin-left: 8px; }
.cd-secview-filters {
  display: flex; gap: 6px; padding: 8px 20px 12px; flex-shrink: 0;
}
.cd-secview-tab {
  padding: 5px 14px; border-radius: 99px; font-size: 11px; font-weight: 600;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-3); cursor: pointer; font-family: inherit;
  transition: all 0.15s;
}
.cd-secview-tab:hover { border-color: rgba(255,255,255,0.15); color: var(--text-2); }
.cd-secview-tab.active { background: var(--cd-accent); border-color: var(--cd-accent); color: #fff; }
/* Must sit above .cd-secview-scroll (same z-index:1 from the
   #cd-section-view > * rule) so open dropdown panels aren't painted
   behind the movie cards. Uses an ID-scoped selector so its specificity
   beats `#cd-section-view > *:not(.cd-plview-bg)` and the z:10 actually
   applies. */
.cd-secview-dropdowns { padding: 0 20px 10px; flex-shrink: 0; }

/* ── Watched-tab Pro stats ─────────────────────────────────────────────
   Rendered inside the dedicated Statistics slide-in panel, opened via
   the "Statistics" button next to Edit Profile. Locked for non-Pro
   owners; always visible on other users' profiles. */
.cd-watched-stats {
  display: flex; flex-direction: column; gap: 10px;
}

/* Statistics pill — sits inside the profile stats row after Following,
   separated by the usual divider. Uses the brand accent so it reads as
   the primary action among the stat counters. */
.cd-stat-btn-pill {
  padding: 7px 14px; border-radius: 999px;
  background: var(--cd-accent); border: 1px solid var(--cd-accent);
  color: #fff; font: inherit; font-size: 11px; font-weight: 700;
  letter-spacing: 0.02em; cursor: pointer; white-space: nowrap;
  align-self: center;
  transition: filter 0.15s, transform 0.1s;
}
.cd-stat-btn-pill:hover { filter: brightness(1.1); }
.cd-stat-btn-pill:active { transform: scale(0.97); }
.cd-stat-btn-pill.hidden { display: none; }

/* Statistics slide-in panel (follows the .cd-profile-panel chrome) */
.cd-statsview-header { padding: 14px 20px 4px; }
#cd-statsview-title  { font-size: 20px; font-weight: 700; }
.cd-statsview-segments {
  display: flex; gap: 6px; padding: 8px 20px 12px; flex-shrink: 0;
  overflow-x: auto; scrollbar-width: none;
}
.cd-statsview-segments::-webkit-scrollbar { display: none; }
.cd-statsview-seg {
  padding: 5px 14px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-3); cursor: pointer; font-family: inherit;
  transition: all 0.15s; white-space: nowrap; flex-shrink: 0;
}
.cd-statsview-seg:hover { border-color: rgba(255,255,255,0.15); color: var(--text-2); }
.cd-statsview-seg.active { background: var(--cd-accent); border-color: var(--cd-accent); color: #fff; }
.cd-statsview-scroll {
  flex: 1; overflow-y: auto; min-height: 0; padding: 0 20px 28px;
}
.cd-statsview-scroll::-webkit-scrollbar { width: 3px; }
.cd-statsview-scroll::-webkit-scrollbar-track { background: transparent; }
.cd-statsview-scroll::-webkit-scrollbar-thumb { background: var(--border-h); border-radius: 2px; }

/* Locked state — Pro upsell card */
.cd-ws-locked {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(229,9,20,0.12), rgba(229,9,20,0.04));
  border: 1px solid rgba(229,9,20,0.28);
}
.cd-ws-locked-icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(229,9,20,0.18); color: var(--cd-accent);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cd-ws-locked-text { flex: 1; min-width: 0; }
.cd-ws-locked-title { font-size: 13px; font-weight: 700; color: var(--text); }
.cd-ws-locked-sub { font-size: 11.5px; color: var(--text-3); line-height: 1.45; margin-top: 2px; }
.cd-ws-locked-sub b { color: var(--cd-accent); font-weight: 700; }
.cd-ws-locked-btn {
  padding: 6px 14px; border-radius: 20px;
  background: var(--cd-accent); border: none; color: #fff;
  font: inherit; font-size: 11px; font-weight: 700; letter-spacing: 0.03em;
  cursor: pointer; white-space: nowrap; transition: filter 0.15s;
}
.cd-ws-locked-btn:hover { filter: brightness(1.1); }

/* Hero watch-time card */
.cd-ws-hero {
  padding: 20px 20px 16px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(229,9,20,0.18) 0%, rgba(229,9,20,0.05) 55%, transparent 100%);
  border: 1px solid rgba(229,9,20,0.28);
  box-shadow: 0 0 40px -10px rgba(229,9,20,0.18);
  position: relative; overflow: hidden;
}
.cd-ws-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 10% 50%, rgba(229,9,20,0.09) 0%, transparent 65%);
  pointer-events: none;
}
.cd-ws-hero-label {
  font-size: 10px; font-weight: 700; color: var(--text-3);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.cd-ws-hero-eyebrow {
  font-size: 9.5px; font-weight: 700; color: var(--cd-accent);
  letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.9;
  margin-bottom: 6px;
}
.cd-ws-hero-value {
  font-size: 44px; font-weight: 900; color: var(--text);
  letter-spacing: -0.04em; line-height: 1;
  font-variant-numeric: tabular-nums; margin: 0 0 8px;
}
.cd-ws-hero-footer {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.cd-ws-hero-sub { font-size: 12px; color: var(--text-3); flex: 1; }
.cd-ws-export-inline { display: flex; gap: 6px; align-items: center; }
.cd-ws-export-inline .cd-ws-export-btn { padding: 5px 10px; font-size: 10.5px; }

/* Supporting stat cards */
.cd-ws-cards {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.cd-ws-card {
  padding: 10px 12px; border-radius: 10px;
  background: var(--bg-2); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.cd-ws-k {
  font-size: 10px; font-weight: 700; color: var(--text-3);
  letter-spacing: 0.06em; text-transform: uppercase;
}
.cd-ws-v {
  font-size: 15px; font-weight: 700; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.cd-ws-v-small { font-size: 13px; }
.cd-ws-v-sub {
  font-size: 11px; font-weight: 600; color: var(--text-3);
  letter-spacing: 0;
}

/* Top row: hero + export button */
.cd-ws-toprow { display: flex; align-items: stretch; gap: 10px; }
.cd-ws-toprow .cd-ws-hero { flex: 1; min-width: 0; }
.cd-ws-export-btn {
  align-self: flex-start; margin-top: 2px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 10px;
  background: var(--bg-2); border: 1px solid var(--border);
  color: var(--text-2); font: inherit; font-size: 11px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: all 0.15s;
}
.cd-ws-export-btn:hover { border-color: var(--cd-accent-bdr); color: var(--cd-accent); }
.cd-ws-export-group { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; margin-top: 2px; }
.cd-ws-export-group .cd-ws-export-btn { align-self: auto; margin-top: 0; }

/* Block headers + empty states */
.cd-ws-block {
  padding: 12px 14px; border-radius: 10px;
  background: var(--bg-2); border: 1px solid var(--border);
}
.cd-ws-block-title {
  font-size: 10px; font-weight: 700; color: var(--text-3);
  letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 8px;
}
.cd-ws-block-sub { font-weight: 500; color: var(--text-3); text-transform: none; letter-spacing: 0; font-size: 10px; }
.cd-ws-block-empty .cd-ws-empty {
  font-size: 11.5px; color: var(--text-3); line-height: 1.5;
}

/* Horizontal bar lists (decades + ratings) */
.cd-ws-bars { display: flex; flex-direction: column; gap: 5px; }
.cd-ws-bar {
  display: grid; grid-template-columns: 52px 1fr 32px;
  align-items: center; gap: 10px;
  font-size: 11px; font-variant-numeric: tabular-nums;
}
.cd-ws-bar-label { color: var(--text-2); font-weight: 600; }
.cd-ws-bar-track {
  height: 6px; border-radius: 4px; background: var(--bg-3); overflow: hidden;
}
.cd-ws-bar-fill {
  display: block; height: 100%; background: var(--cd-accent);
  border-radius: 4px;
}
.cd-ws-bar-count { color: var(--text-3); text-align: right; }

/* Two-column row for decades + ratings */
.cd-ws-grid2 {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

/* Sparkline */
.cd-ws-spark {
  display: flex; align-items: flex-end; gap: 4px; height: 80px;
  padding: 6px 2px 0;
}
.cd-ws-spark-col {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 4px; height: 100%; min-width: 0;
}
.cd-ws-spark-bar {
  width: 100%; min-height: 2px;
  background: var(--cd-accent); border-radius: 3px 3px 0 0;
}
.cd-ws-spark-lbl {
  font-size: 9px; color: var(--text-3); font-weight: 700;
}

/* Insight badges — inline flow */
.cd-ws-badges {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px;
}
.cd-ws-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--border);
  font-size: 11px;
}
.cd-ws-badge-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; color: var(--cd-accent);
}
.cd-ws-badge-icon svg { width: 14px; height: 14px; display: block; }
.cd-ws-badge-k { color: var(--text-3); font-weight: 600; letter-spacing: 0.02em; }
.cd-ws-badge-v { color: var(--text); font-weight: 700; }

/* ── Stats redesign: entrance animation ───────────────────────────── */
@keyframes cd-ws-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cd-ws-anim {
  animation: cd-ws-fade-up 0.45s cubic-bezier(0.16,1,0.3,1) both;
  animation-delay: var(--anim-d, 0ms);
}

/* Card-wide: spans full grid row */
.cd-ws-card-wide { grid-column: 1 / -1; }

/* Achievement cards grid */
.cd-ws-achv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}
.cd-ws-achv {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  background: var(--bg-2); border: 1px solid var(--border);
  min-width: 0;
}
.cd-ws-achv-icon {
  font-size: 18px; line-height: 1; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px;
  background: rgba(229,9,20,0.10);
}
.cd-ws-achv-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cd-ws-achv-k {
  font-size: 9.5px; font-weight: 700; color: var(--text-3);
  letter-spacing: 0.06em; text-transform: uppercase;
}
.cd-ws-achv-v {
  font-size: 13px; font-weight: 700; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Locked ghost preview + upgrade overlay */
.cd-ws-lock-wrap { position: relative; border-radius: 14px; overflow: hidden; }
.cd-ws-lock-ghost {
  filter: blur(4px); user-select: none; pointer-events: none; opacity: 0.5;
}
.cd-ws-lock-prompt {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 24px;
  background: rgba(10,10,12,0.70);
  backdrop-filter: blur(6px) saturate(1.2);
}
.cd-ws-lock-icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(229,9,20,0.18); border: 1px solid rgba(229,9,20,0.35);
  color: var(--cd-accent);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 2px;
}
.cd-ws-lock-title {
  font-size: 14px; font-weight: 800; color: var(--text);
  text-align: center; letter-spacing: -0.01em;
}
.cd-ws-lock-sub {
  font-size: 11.5px; color: var(--text-3); text-align: center;
  line-height: 1.5; max-width: 220px;
}

/* ── Stats share / export modal — premium reveal ─────────────────────── */
.cd-stats-share-modal {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.32s ease;
  pointer-events: none;
}
.cd-stats-share-modal.cd-ssm-open { opacity: 1; pointer-events: auto; }
.cd-ssm-backdrop {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(229,9,20,0.10), transparent 60%),
    rgba(3,4,8,0.86);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
}
.cd-ssm-panel {
  position: relative; z-index: 1;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(229,9,20,0.06), transparent 50%),
    linear-gradient(180deg, #15171f 0%, #0c0e14 100%);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 24px;
  box-shadow:
    0 60px 120px -24px rgba(0,0,0,0.92),
    0 0 0 0.5px rgba(229,9,20,0.18),
    inset 0 1px 0 rgba(255,255,255,0.08);
  overflow: hidden;
  transform: translateY(24px) scale(0.96);
  transition: transform 0.42s cubic-bezier(0.22,1,0.36,1);
  max-width: 760px; width: calc(100vw - 48px);
}
.cd-stats-share-modal.cd-ssm-open .cd-ssm-panel { transform: translateY(0) scale(1); }
.cd-ssm-close {
  position: absolute; top: 16px; right: 16px; z-index: 3;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.65);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.18s;
  backdrop-filter: blur(10px);
}
.cd-ssm-close:hover { background: rgba(255,255,255,0.14); color: #fff; transform: scale(1.06); }
.cd-ssm-close:active { transform: scale(0.94); }

.cd-ssm-content {
  display: flex; align-items: stretch;
  min-height: 460px;
}

/* ── Preview side — vertical 9:16 stage with shadow + ambient glow ──── */
.cd-ssm-preview {
  flex-shrink: 0;
  width: 320px;
  position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 50% 35%, rgba(229,9,20,0.16), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(244,196,48,0.08), transparent 60%),
    #07080c;
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 32px 24px 22px;
  gap: 14px;
}
.cd-ssm-preview::before {
  content: ''; position: absolute; inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0px,
      transparent 2px,
      rgba(255,255,255,0.012) 2px,
      rgba(255,255,255,0.012) 3px
    );
  pointer-events: none;
}
.cd-ssm-preview-stage {
  position: relative;
  width: 252px; height: 448px;
  display: flex; align-items: center; justify-content: center;
  animation: ssm-float 6s ease-in-out infinite;
}
@keyframes ssm-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-6px) rotate(-0.4deg); }
}
.cd-ssm-preview-shadow {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 90%, rgba(0,0,0,0.85), transparent 65%);
  filter: blur(20px);
  transform: translateY(28px) scale(0.92);
  z-index: 0;
}
.cd-ssm-preview-frame {
  position: relative; z-index: 1;
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 24px 80px -16px rgba(0,0,0,0.85),
    0 0 0 0.5px rgba(255,255,255,0.10),
    0 0 0 6px rgba(255,255,255,0.02),
    0 0 0 7px rgba(255,255,255,0.04);
}
.cd-ssm-preview-frame canvas {
  display: block;
  border-radius: 16px;
}
.cd-ssm-preview-meta {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 10px;
  font-size: 9.5px; font-weight: 700;
  color: rgba(255,255,255,0.42);
  letter-spacing: 0.18em; text-transform: uppercase;
  font-family: "SF Mono","Consolas","Menlo",monospace;
}
.cd-ssm-format-tag {
  padding: 3px 7px;
  border-radius: 4px;
  background: rgba(229,9,20,0.16);
  border: 1px solid rgba(229,9,20,0.30);
  color: #ff5560;
}
.cd-ssm-format-dim { color: rgba(255,255,255,0.30); }

/* ── Body side ─────────────────────────────────────────────────────── */
.cd-ssm-body {
  flex: 1; min-width: 0;
  padding: 38px 36px 32px;
  display: flex; flex-direction: column; gap: 14px;
  position: relative;
}
.cd-ssm-body::before {
  content: ''; position: absolute; top: 38px; left: 0;
  width: 2px; height: 22px;
  background: linear-gradient(180deg, var(--cd-accent), transparent);
  border-radius: 2px;
}
.cd-ssm-eyebrow {
  font-size: 11px; font-weight: 800; color: var(--cd-accent);
  letter-spacing: 0.24em; text-transform: uppercase;
  display: inline-flex; align-items: center;
}
.cd-ssm-title {
  margin: 0; font-size: 26px; font-weight: 800;
  color: #fff; letter-spacing: -0.025em; line-height: 1.12;
  text-wrap: balance;
}
.cd-ssm-sub {
  margin: 0; font-size: 13.5px; color: rgba(255,255,255,0.55);
  line-height: 1.55; max-width: 38ch;
}
.cd-ssm-link-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 13px; border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  margin-top: 4px;
  transition: border-color 0.18s, background 0.18s;
}
.cd-ssm-link-row:hover {
  border-color: rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.05);
}
.cd-ssm-link-icon {
  flex-shrink: 0; color: rgba(255,255,255,0.32);
  display: inline-flex;
}
.cd-ssm-link-text {
  flex: 1; font-size: 12px; color: rgba(255,255,255,0.55);
  font-family: "SF Mono","Consolas","Menlo",monospace;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cd-ssm-copy-btn {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 8px;
  background: rgba(229,9,20,0.15);
  border: 1px solid rgba(229,9,20,0.30);
  color: var(--cd-accent); font: inherit; font-size: 11.5px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  transition: background 0.18s, transform 0.12s;
}
.cd-ssm-copy-btn:hover { background: rgba(229,9,20,0.25); }
.cd-ssm-copy-btn:active { transform: scale(0.96); }

.cd-ssm-actions { display: flex; gap: 10px; margin-top: 6px; }
.cd-ssm-btn-primary {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 16px; border-radius: 12px;
  background: linear-gradient(180deg, #ff1421 0%, #c0080f 100%);
  border: none; color: #fff;
  font: inherit; font-size: 13.5px; font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow:
    0 6px 20px -4px rgba(229,9,20,0.55),
    inset 0 1px 0 rgba(255,255,255,0.18);
  transition: filter 0.15s, transform 0.12s, box-shadow 0.18s;
  white-space: nowrap;
}
.cd-ssm-btn-primary:hover {
  filter: brightness(1.08);
  box-shadow:
    0 8px 28px -4px rgba(229,9,20,0.65),
    inset 0 1px 0 rgba(255,255,255,0.20);
}
.cd-ssm-btn-primary:active { transform: scale(0.97); }
.cd-ssm-btn-ghost {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 16px; border-radius: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.82);
  font: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: all 0.18s; white-space: nowrap;
}
.cd-ssm-btn-ghost:hover {
  border-color: rgba(255,255,255,0.24);
  color: #fff;
  background: rgba(255,255,255,0.09);
}
.cd-ssm-btn-ghost:active { transform: scale(0.97); }

.cd-ssm-tips {
  margin-top: 10px;
  display: flex; flex-direction: column; gap: 8px;
}
.cd-ssm-tip {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11.5px; color: rgba(255,255,255,0.42);
  letter-spacing: 0.005em;
}
.cd-ssm-tip svg { color: rgba(244,196,48,0.7); flex-shrink: 0; }

@media (max-width: 720px) {
  .cd-ssm-content { flex-direction: column; min-height: auto; }
  .cd-ssm-preview {
    width: 100%; padding: 28px 20px 18px;
    border-right: none; border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .cd-ssm-preview-stage { width: 200px; height: 356px; }
  .cd-ssm-preview-frame canvas { width: 200px !important; height: 356px !important; }
  .cd-ssm-body { padding: 28px 24px 22px; }
  .cd-ssm-title { font-size: 22px; }
}

#cd-section-view > .cd-secview-dropdowns { position: relative; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* "Randomize" button — visible only when Random order sort is active.
   Pushed to the right-hand edge of the dropdown row. */
.cd-secview-shuffle-btn {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 20px;
  background: var(--cd-accent-dim); border: 1px solid var(--cd-accent-bdr);
  color: var(--cd-accent); font: inherit; font-size: 10px; font-weight: 700;
  letter-spacing: 0.03em; cursor: pointer; white-space: nowrap;
  transition: transform 0.1s ease, background 0.15s;
}
.cd-secview-shuffle-btn:hover { background: var(--cd-accent); color: #fff; }
.cd-secview-shuffle-btn:active { transform: scale(0.97); }
.cd-secview-scroll { flex: 1; overflow-y: auto; min-height: 0; padding-bottom: 20px; }

/* ── Visitor overlap pill (inline with section title) ───────────────── */
.cd-secview-overlap {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px 7px 8px; border-radius: 24px;
  background: linear-gradient(135deg, rgba(229,9,20,0.22) 0%, rgba(229,9,20,0.06) 100%);
  border: 1px solid rgba(229,9,20,0.32);
  box-shadow: 0 4px 14px rgba(229,9,20,0.1), inset 0 1px 0 rgba(255,255,255,0.05);
  cursor: default; position: relative; overflow: hidden;
  transition: transform 0.18s, box-shadow 0.18s;
}
.cd-secview-overlap.hidden { display: none; }
.cd-secview-overlap::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,0.06) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.9s ease;
  pointer-events: none;
}
.cd-secview-overlap:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(229,9,20,0.18); }
.cd-secview-overlap:hover::before { transform: translateX(100%); }

/* SVG ring — smaller so the pill matches the title height */
.cd-secview-overlap-ring { width: 32px; height: 32px; flex-shrink: 0; transform: rotate(-90deg); }
.cd-secview-overlap-ring-track {
  fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 3.5;
}
.cd-secview-overlap-ring-fill {
  fill: none; stroke: var(--cd-accent); stroke-width: 3.5; stroke-linecap: round;
  stroke-dasharray: 100.53; stroke-dashoffset: 100.53;
  transition: stroke-dashoffset 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 0 4px rgba(229,9,20,0.45));
}

/* Text column */
.cd-secview-overlap-info { display: flex; flex-direction: column; gap: 5px; line-height: 1; }
.cd-secview-overlap-label {
  font-size: 8px; font-weight: 700; color: rgba(255,255,255,0.55);
  letter-spacing: 0.16em; text-transform: uppercase;
}
.cd-secview-overlap-value {
  display: flex; align-items: baseline; gap: 5px;
  font-variant-numeric: tabular-nums; color: #fff;
}
#cd-secview-overlap-count { font-size: 12px; font-weight: 700; letter-spacing: -0.01em; }
.cd-secview-overlap-sep { color: rgba(255,255,255,0.3); font-weight: 600; font-size: 10px; }
#cd-secview-overlap-pct {
  font-size: 14px; font-weight: 800; letter-spacing: -0.02em;
  color: var(--cd-accent);
}
.cd-secview-scroll::-webkit-scrollbar { width: 3px; }
.cd-secview-scroll::-webkit-scrollbar-track { background: transparent; }
.cd-secview-scroll::-webkit-scrollbar-thumb { background: var(--border-h); border-radius: 2px; }
.cd-secview-bg-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text-3); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.cd-secview-bg-btn:hover { border-color: var(--cd-accent); color: var(--cd-accent); }
.cd-secview-bg-picker {
  padding: 8px 20px 12px; flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.cd-secview-bg-picker.hidden { display: none; }
.cd-secview-bg-grid {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.cd-secview-bg-grid .cd-pl-bg-opt { width: 48px; height: 32px; }

/* Zoomable grid — smooth transition */
.cd-grid-zoomable {
  transition: grid-template-columns 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Library preview rows */
.cd-lib-preview-row {
  position: relative;
  display: flex; gap: 10px; padding: 0 20px 4px; overflow-x: auto;
  scrollbar-width: none;
  cursor: grab; user-select: none;
  -webkit-user-select: none;
  scroll-behavior: smooth;
  transition: -webkit-mask-image 0.4s ease, mask-image 0.4s ease;
}
.cd-lib-preview-row.cd-dragging { cursor: grabbing; scroll-behavior: auto; }
.cd-lib-preview-row.cd-dragging * { pointer-events: none; }
.cd-lib-preview-row .cd-card:hover { transform: scale(1.025); }
.cd-lib-preview-row::-webkit-scrollbar { display: none; }
.cd-lib-preview-row .cd-card { flex-shrink: 0; width: 100px; }

/* Auto-slideshow state — soft edge fade signals that the shelf is playing
   on its own. Any interaction (drag, wheel, leave) instantly drops out. */
.cd-lib-preview-row.cd-auto-scrolling {
  cursor: default;
  scroll-behavior: auto !important; /* override smooth from base */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 36px, #000 calc(100% - 60px), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 36px, #000 calc(100% - 60px), transparent 100%);
}
/* Promote cards to their own layers during the slideshow so the GPU
   can scroll them without per-frame paints — kills the jitter. */
.cd-lib-preview-row.cd-auto-scrolling .cd-card {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}
.cd-lib-preview-row.cd-auto-scrolling .cd-card:hover {
  transform: translateY(-3px) scale(1.04);
  z-index: 2;
}
@media (prefers-reduced-motion: reduce) {
  .cd-lib-preview-row.cd-auto-scrolling { -webkit-mask-image: none; mask-image: none; }
  .cd-lib-preview-row.cd-auto-scrolling .cd-card { will-change: auto; transform: none; }
}
.cd-lib-see-all {
  display: flex; align-items: center; gap: 4px;
  margin-left: auto; padding: 0 4px;
  font-size: 10px; font-weight: 600; color: var(--cd-accent);
  cursor: pointer; white-space: nowrap; transition: opacity 0.15s;
}
.cd-lib-see-all:hover { opacity: 0.7; }

/* ── "% watched" overlap badges (viewing other users' profiles) ─────── */
.cd-lib-pct {
  margin-left: 8px; padding: 2px 8px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.3px;
  color: var(--cd-accent);
  background: color-mix(in srgb, var(--cd-accent) 14%, transparent);
  border-radius: 999px; text-transform: none; white-space: nowrap;
}
.cd-lib-title .cd-lib-see-all + .cd-lib-pct,
.cd-lib-pct + .cd-lib-see-all { margin-left: 8px; }
.cd-secview-pct {
  margin-left: 8px; padding: 2px 8px;
  font-size: 11px; font-weight: 600;
  color: var(--cd-accent);
  background: color-mix(in srgb, var(--cd-accent) 14%, transparent);
  border-radius: 999px; white-space: nowrap;
}
.cd-playlist-card-pct { color: var(--cd-accent); font-weight: 600; }

/* ── Clickable cast / person chips ─────────────────────────────────── */
.cd-mcast-card { cursor: pointer; transition: transform 0.15s; }
.cd-mcast-card:hover { transform: translateY(-2px); }
.cd-mcast-card:hover .cd-mcast-name { color: var(--cd-accent); }
.cd-person-chip {
  display: inline-block; cursor: pointer;
  color: var(--cd-accent); transition: opacity 0.15s;
}
.cd-person-chip:hover { opacity: 0.7; text-decoration: underline; }

/* ── Person view panel ─────────────────────────────────────────────── */
/* Sits above every other slide-in panel — a user can drill into a cast
   member from anywhere: their own profile (z-index 60), a section view
   like "Watchlist" or a group / playlist (z-index 65), or directly from
   the movie modal (z-index 3000, which we close before showing the
   person view). 70 keeps it on top in every entry path. */
#cd-person-view { z-index: 70; }
#cd-profile-reviews-view { z-index: 60; }
#cd-section-view { z-index: 65; }
#cd-profile-diary-view { z-index: 65; }
#cd-group-view { z-index: 65; }
#cd-playlist-view { z-index: 65; }
.cd-profile-btns-other {
  display: flex; justify-content: center;
  padding: 14px 16px 12px;
}

/* ── Compatibility card (visitor profile) ────────────────────────────── */
.cd-compat {
  margin: 10px 20px 4px;
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px 18px; border-radius: 14px;
  flex-shrink: 0;
  background:
    radial-gradient(ellipse at top right, rgba(255,255,255,0.04), transparent 60%),
    linear-gradient(135deg, rgba(229,9,20,0.18) 0%, rgba(229,9,20,0.04) 100%);
  border: 1px solid rgba(229,9,20,0.32);
  box-shadow: 0 6px 18px rgba(229,9,20,0.1), inset 0 1px 0 rgba(255,255,255,0.05);
  position: relative; overflow: hidden;
}
.cd-compat.hidden { display: none; }
.cd-compat::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,0.05) 50%, transparent 60%);
  transform: translateX(-100%);
  pointer-events: none; animation: cd-compat-shimmer 6s ease-in-out infinite;
}
@keyframes cd-compat-shimmer {
  0%, 100% { transform: translateX(-100%); }
  55%      { transform: translateX(100%); }
}

/* Info button (top-right) — tooltip explains how the score is computed */
.cd-compat-info {
  position: absolute; top: 10px; right: 10px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.7);
  font: 700 11px/1 'Georgia', 'Times New Roman', serif;
  font-style: italic;
  cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  z-index: 2;
}
.cd-compat-info:hover,
.cd-compat-info-active {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.24);
  color: #fff;
}
.cd-compat-info-active {
  background: var(--cd-accent);
  border-color: var(--cd-accent);
}

/* Click-toggle explainer panel */
.cd-compat-explain {
  padding: 14px 0 2px;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 4px;
  display: flex; flex-direction: column; gap: 14px;
}
.cd-compat-explain.hidden { display: none; }
.cd-compat-explain-title {
  margin: 0; font-size: 11px; font-weight: 700;
  color: rgba(255,255,255,0.85); letter-spacing: 0.12em;
  text-transform: uppercase;
}
.cd-compat-explain-lead {
  margin: 0; font-size: 12px; color: rgba(255,255,255,0.6); line-height: 1.5;
}
.cd-compat-explain-title #cd-compat-explain-total {
  color: var(--cd-accent); font-variant-numeric: tabular-nums;
}
.cd-compat-explain-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 12px;
}
.cd-compat-explain-list li { display: flex; }
.cd-compat-explain-list li.cd-compat-explain-muted { opacity: 0.55; }
.cd-compat-explain-row { flex: 1; min-width: 0; }
.cd-compat-explain-row-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin-bottom: 4px;
}
.cd-compat-explain-row-head b {
  font-size: 13px; font-weight: 700; color: #fff;
}
.cd-compat-explain-pts {
  flex-shrink: 0;
  font-size: 11px; font-weight: 800; color: var(--cd-accent);
  letter-spacing: 0.02em; font-variant-numeric: tabular-nums;
  padding: 3px 8px; border-radius: 99px;
  background: rgba(229,9,20,0.12);
  border: 1px solid rgba(229,9,20,0.28);
}
.cd-compat-explain-list li small {
  display: block; font-size: 11px; font-weight: 500;
  color: rgba(255,255,255,0.6); line-height: 1.5;
}
.cd-compat-explain-list li small b {
  color: #fff; font-weight: 700; font-variant-numeric: tabular-nums;
}
.cd-compat-explain-labels {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding-top: 4px;
}
.cd-compat-explain-labels span {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: 99px;
  background: rgba(229,9,20,0.12); border: 1px solid rgba(229,9,20,0.28);
  font-size: 10px; font-weight: 600; color: rgba(255,255,255,0.7);
}
.cd-compat-explain-labels b {
  font-size: 11px; font-weight: 800; color: var(--cd-accent);
  font-variant-numeric: tabular-nums;
}

/* Row 1: ring (with score INSIDE) + kicker/label text */
.cd-compat-top { display: flex; align-items: center; gap: 16px; padding-right: 32px; }
.cd-compat-ring {
  width: 72px; height: 72px; flex-shrink: 0;
  overflow: visible;
}
.cd-compat-ring-track { fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 5; }
.cd-compat-ring-fill {
  fill: none; stroke: var(--cd-accent); stroke-width: 5; stroke-linecap: round;
  stroke-dasharray: 194.78; stroke-dashoffset: 194.78;
  transform: rotate(-90deg); transform-origin: center;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 0 6px rgba(229,9,20,0.5));
}
.cd-compat-ring-text {
  font-family: 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
  font-size: 22px; font-weight: 800; fill: #fff;
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}

.cd-compat-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cd-compat-kicker {
  font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.5);
  letter-spacing: 0.2em; text-transform: uppercase;
}
.cd-compat-label {
  font-size: 22px; font-weight: 800; letter-spacing: 0.01em;
  color: var(--cd-accent);
  text-shadow: 0 0 16px rgba(229,9,20,0.35);
}

/* Row 2: breakdown tiles, each with a label above a big value.
   Hairline dividers between tiles instead of cramming commas. */
.cd-compat-breakdown {
  display: flex; gap: 0;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.cd-compat-breakdown:empty { display: none; }
.cd-compat-bd-item {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 4px;
  padding: 0 12px;
  border-right: 1px solid rgba(255,255,255,0.06);
  text-align: center;
}
.cd-compat-bd-item:first-child { padding-left: 0; }
.cd-compat-bd-item:last-child  { padding-right: 0; border-right: none; }
.cd-compat-bd-k {
  font-size: 9px; font-weight: 700; color: rgba(255,255,255,0.4);
  letter-spacing: 0.14em; text-transform: uppercase;
}
.cd-compat-bd-v {
  font-size: 16px; font-weight: 700; color: #fff;
  letter-spacing: -0.01em; font-variant-numeric: tabular-nums;
}
.cd-profile-reviews-header {
  padding: 14px 20px 10px;
  display: flex; align-items: center; justify-content: center;
}
#cd-profile-reviews-list {
  flex: 1; overflow-y: auto; min-height: 0;
  padding: 8px 16px 24px;
}
.cd-personview-header {
  display: flex; align-items: center; gap: 18px;
  padding: 56px 20px 20px;
}
.cd-personview-photo {
  width: 90px; height: 135px; border-radius: 10px;
  object-fit: contain;
  flex-shrink: 0;
  background: rgba(255,255,255,0.05);
}
.cd-personview-meta { min-width: 0; flex: 1; }
.cd-personview-known {
  font-size: 12px; color: var(--text-3);
  margin-top: 2px; text-transform: uppercase; letter-spacing: 0.5px;
}
.cd-personview-stats {
  margin-top: 8px; display: flex; align-items: center; gap: 8px;
}
.cd-personview-count { font-size: 12px; color: var(--text-2); }
.cd-personview-pct {
  padding: 2px 8px; font-size: 11px; font-weight: 600;
  color: var(--cd-accent);
  background: color-mix(in srgb, var(--cd-accent) 14%, transparent);
  border-radius: 999px; white-space: nowrap;
}

/* Playlist view background */
.cd-plview-bg {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center;
  opacity: 0.15; pointer-events: none;
}
#cd-playlist-view > *:not(.cd-plview-bg) { position: relative; z-index: 1; }
/* The grid owns the remaining vertical space and scrolls internally.
   Keeps zoomed-in cards reachable without the whole panel scrolling.
   Scrollbar itself inherits the global grey style from the top of the
   stylesheet — no per-surface override needed. */
#cd-plview-grid {
  flex: 1; min-height: 0; overflow-y: auto;
  padding-bottom: 40px;
}

/* ── Playlist drag reorder ───────────────── */
.cd-card.cd-dragging { opacity: 0.4; transform: scale(0.95); }
.cd-card.cd-drag-over { box-shadow: 0 0 0 2px var(--cd-accent); border-radius: 8px; }
.cd-plview-grid-reorderable .cd-card { cursor: grab; }
.cd-plview-grid-reorderable .cd-card:active { cursor: grabbing; }

/* Ranked playlist — rank number as an Apple "Dynamic Island"-style frosted
   capsule floating in the poster's top-left. It used to hang below the card,
   which broke in the new display:grid layout (no space under cards → painted
   into the page background, invisible). The dark frosted glass blends with
   the artwork underneath via backdrop blur, with a 1px edge + inner top
   highlight for the glass-refraction look. Always legible on any poster. */
.cd-rank-badge {
  position: absolute; top: 8px; left: 50%; right: auto; bottom: auto;
  transform: translateX(-50%);
  min-width: 24px; height: 24px; padding: 0 9px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(14, 14, 18, 0.5);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 2px rgba(0, 0, 0, 0.3);
  font-size: 13px; font-weight: 700; color: #fff; line-height: 1;
  font-variant-numeric: tabular-nums; letter-spacing: 0.2px;
  z-index: 4; pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* Subtle squeeze-in when a ranked playlist opens, echoing the Dynamic Island.
   Keep the translateX(-50%) centering in every frame so the pop doesn't drift. */
.cd-plview-ranked .cd-card .cd-rank-badge { animation: cd-rank-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes cd-rank-pop {
  0%   { transform: translateX(-50%) scale(0.6);  opacity: 0; }
  60%  { transform: translateX(-50%) scale(1.08); opacity: 1; }
  100% { transform: translateX(-50%) scale(1);    opacity: 1; }
}
.cd-edit-emoji-grid {
  display: flex; flex-wrap: wrap; gap: 5px; flex: 1;
}
.cd-edit-emoji-btn {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--bg-3); border: 1px solid var(--border);
  font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: border-color 0.12s, background 0.12s;
}
.cd-edit-emoji-btn:hover, .cd-edit-emoji-btn.cd-sel { background: var(--cd-accent-dim); border-color: var(--cd-accent-bdr); }
.cd-edit-input {
  width: 100%; background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; color: var(--text); font: inherit; font-size: 13px;
  outline: none; transition: border-color 0.18s;
}
.cd-edit-input:focus { border-color: var(--cd-accent); }
.cd-edit-select { appearance: none; cursor: pointer; }
.cd-edit-select option { background: var(--bg-3); color: var(--text); }
.cd-edit-field-error { font-size: 11px; color: var(--cd-accent); min-height: 14px; margin-top: -4px; }
.cd-edit-textarea {
  width: 100%; background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; color: var(--text); font: inherit; font-size: 13px;
  outline: none; resize: none; transition: border-color 0.18s;
}
.cd-edit-textarea:focus { border-color: var(--cd-accent); }

/* ── Edit modal: social links ──────────────────────────────────────────── */
.cd-edit-social { display: flex; flex-direction: column; gap: 6px; margin-top: 2px; }
.cd-edit-social-label {
  font-size: 11px; color: var(--text-3); text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 2px;
}
.cd-edit-social-row {
  position: relative; display: flex; align-items: center; gap: 8px;
}
.cd-edit-social-ico {
  width: 16px; height: 16px; flex-shrink: 0; color: var(--text-3);
}
.cd-edit-social-row .cd-edit-social-input { padding-left: 12px; }

/* ── Profile "Followed by" ─────────────────────────────────────────────── */
.cd-profile-followed-by {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px; font-size: 11px; color: var(--text-3);
}
.cd-fb-avatars { display: inline-flex; flex-shrink: 0; }
.cd-fb-avatar-img, .cd-fb-avatar-emoji {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--bg-2); object-fit: cover;
  background: var(--bg-3);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; margin-left: -6px;
}
.cd-fb-avatars > :first-child { margin-left: 0; }
.cd-fb-text { line-height: 1.4; }
.cd-fb-text b { color: var(--text); font-weight: 700; }

/* ── Profile social chips (display) ────────────────────────────────────── */
.cd-profile-socials {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px;
}
.cd-social-chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text-2); text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.cd-social-chip:hover {
  border-color: var(--cd-accent-bdr);
  background: var(--cd-accent-dim);
  color: var(--text);
}
.cd-social-chip svg { width: 14px; height: 14px; }

.cd-edit-save-btn {
  padding: 11px; border-radius: 10px;
  background: var(--cd-accent); border: none; color: #fff;
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  transition: opacity 0.15s;
}
.cd-edit-save-btn:hover { opacity: 0.85; }

/* ── Playlist Picker (floating popup) ───── */
.cd-playlist-picker {
  position: fixed; z-index: 3100;
  background: var(--bg-2); border: 1px solid var(--border-h);
  border-radius: 14px; padding: 10px 0; width: 200px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  animation: cd-modal-in 0.18s cubic-bezier(0.34,1.4,0.64,1);
}
.cd-pp-header {
  padding: 4px 14px 8px; font-size: 11px; font-weight: 700;
  color: var(--text-2); text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}
.cd-pp-list { max-height: 180px; overflow-y: auto; }
.cd-pp-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; cursor: pointer; transition: background 0.12s;
}
.cd-pp-row:hover { background: var(--bg-3); }
.cd-pp-name { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.cd-pp-count { font-size: 11px; color: var(--text-3); margin-left: 8px; flex-shrink: 0; }
.cd-pp-adding { opacity: 0.5; pointer-events: none; }
.cd-pp-added .cd-pp-name::after { content: ' ✓'; color: var(--cd-accent); }
.cd-pp-empty { padding: 12px 14px; font-size: 12px; color: var(--text-3); font-style: italic; }
.cd-pp-create {
  display: block; width: 100%; padding: 8px 14px;
  background: none; border: none; border-top: 1px solid var(--border);
  color: var(--cd-accent); font: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer; text-align: left; transition: background 0.12s;
}
.cd-pp-create:hover { background: var(--bg-3); }

/* ── Playlist toggle (public/private) ───── */
.cd-playlist-toggle {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text-2); cursor: pointer;
  user-select: none;
}
.cd-playlist-toggle input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  width: 16px; height: 16px; flex-shrink: 0;
  margin: 0; padding: 0;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 4px; cursor: pointer;
  position: relative;
  transition: background 0.15s, border-color 0.15s;
}
.cd-playlist-toggle input[type="checkbox"]:hover { border-color: var(--border-h); }
.cd-playlist-toggle input[type="checkbox"]:checked {
  background: var(--cd-accent); border-color: var(--cd-accent);
}
.cd-playlist-toggle input[type="checkbox"]:checked::after {
  content: '';
  position: absolute; left: 4px; top: 1px;
  width: 5px; height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ── Playlist card (library grid) ───────── */
.cd-playlist-card { position: relative; }

/* ── Playlist list view (My Library + visitor profiles) ──────────────── */
.cd-pl-list {
  display: flex; flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
  margin: 2px 20px 12px;
}
.cd-playlist-row {
  display: flex; gap: 14px; align-items: stretch;
  padding: 12px; background: var(--bg-2);
  cursor: pointer;
  transition: background 0.15s;
}
.cd-playlist-row:hover { background: var(--bg-3); }
.cd-playlist-row-thumb {
  width: 64px; height: 96px; border-radius: 6px; overflow: hidden;
  object-fit: cover; flex-shrink: 0;
  background: rgba(255,255,255,0.04);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.cd-playlist-row-thumb.cd-playlist-mosaic { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 1px; background: rgba(255,255,255,0.04); }
.cd-playlist-row-thumb.cd-playlist-mosaic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cd-playlist-row-thumb-empty { display: flex; align-items: center; justify-content: center; color: var(--text-3); }
.cd-playlist-row-body {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px;
  justify-content: center;
}
.cd-playlist-row-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.cd-playlist-row-name {
  font-size: 14px; font-weight: 700; color: var(--text);
  letter-spacing: -0.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1; min-width: 0;
}
.cd-playlist-row-badges { display: flex; gap: 4px; flex-shrink: 0; }
.cd-playlist-row-badge {
  font-size: 9px; font-weight: 700; letter-spacing: 0.08em;
  padding: 2px 6px; border-radius: 3px;
  background: rgba(255,255,255,0.06); color: var(--text-3);
}
.cd-playlist-row-badge-public  { color: #4caf50; background: rgba(76,175,80,0.1); }
.cd-playlist-row-badge-private { color: var(--text-3); }
.cd-playlist-row-badge-ranked  { color: var(--cd-accent); background: var(--cd-accent-dim); }
.cd-playlist-row-desc {
  font-size: 12px; color: var(--text-2); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.cd-playlist-row-meta {
  font-size: 10px; font-weight: 600; color: var(--text-3);
  letter-spacing: 0.04em; display: flex; gap: 8px; align-items: center;
}
.cd-playlist-row-pct { color: var(--cd-accent); font-weight: 700; }

/* ── Group list (shares the playlist-row skeleton) ───────────────────── */
.cd-group-list {
  display: flex; flex-direction: column; gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
  margin: 2px 20px 12px;
}
.cd-group-list .cd-playlist-row:only-child { border-radius: 0; }

/* ── Group discover feed ─────────────────────────────────────────────── */
#cd-groups-feed-list {
  gap: 8px; padding: 10px 12px 20px;
  scroll-snap-type: none;
}
.cd-group-discover-row {
  align-items: center;
  background: rgba(255,255,255,0.035) !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 14px !important;
  transition: background 0.15s, border-color 0.15s !important;
}
.cd-group-discover-row:hover {
  background: rgba(255,255,255,0.065) !important;
  border-color: rgba(255,255,255,0.13) !important;
}
.cd-group-discover-row .cd-playlist-row-thumb,
.cd-group-discover-row .cd-playlist-row-thumb-empty {
  width: 52px; height: 52px; border-radius: 10px;
}
.cd-group-discover-join-btn {
  flex-shrink: 0; margin-left: 8px;
  padding: 6px 14px; border-radius: 7px;
  background: var(--cd-accent); color: #fff;
  font-size: 12px; font-weight: 700;
  border: none; cursor: pointer; transition: opacity 0.15s;
}
.cd-group-discover-join-btn:hover:not(:disabled) { opacity: 0.85; }
.cd-group-discover-join-btn:disabled { opacity: 0.4; cursor: default; }

/* ── Group view panel ────────────────────────────────────────────────── */
.cd-group-scroll {
  flex: 1; overflow-y: auto; overflow-x: hidden; min-height: 0;
  padding: 0 0 40px;
  display: flex; flex-direction: column; gap: 18px;
}
.cd-group-cover-banner {
  position: relative; height: 420px; flex-shrink: 0;
  margin-left: -8px; margin-right: -8px; width: calc(100% + 16px);
  overflow: hidden;
  background: linear-gradient(135deg, #0a0e16 0%, #12182a 100%);
  border-radius: 0 0 50% 50% / 0 0 32px 32px;
  transform: translateZ(0);
}
.cd-group-cover-banner::after {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
}

.cd-group-cover-banner.hidden { display: none; }
.cd-group-cover-banner img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  object-position: center 30%;
}
.cd-group-cover-banner.cd-cover-repositioning img {
  cursor: ns-resize; user-select: none;
}
.cd-group-cover-repo-btn {
  position: absolute; bottom: 90px; right: 10px; z-index: 1;
  opacity: 0; transition: opacity 0.15s; pointer-events: none;
}
.cd-group-cover-banner:hover .cd-group-cover-repo-btn:not(.hidden) {
  opacity: 1; pointer-events: auto;
}
.cd-group-cover-banner.cd-cover-repositioning .cd-group-cover-repo-btn {
  opacity: 0; pointer-events: none;
}
.cd-group-cover-repo-bar {
  position: absolute; bottom: 90px; right: 10px; z-index: 1;
  display: flex; gap: 8px;
}
.cd-group-cover-repo-bar.hidden { display: none; }
.cd-group-header {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  align-self: center;
  width: calc(100% - 80px); max-width: 320px;
  position: relative; z-index: 1;
  background: rgba(12, 14, 21, 0.48);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-radius: 16px;
  border: 1px solid #e50914;
  padding: 20px 24px 16px;
  text-align: center;
}
/* Header card overlaps bottom of cover arch */
#cd-group-view:has(#cd-group-cover-banner:not(.hidden)) .cd-group-header {
  margin-top: -80px;
}
.cd-group-header h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.cd-group-header p  { font-size: 12px; color: var(--text-3); line-height: 1.55; }
.cd-group-meta {
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
  margin-top: 4px;
  font-size: 11px; color: var(--text-3); font-weight: 500;
}
.cd-group-role-badge { background: var(--cd-accent-dim) !important; color: var(--cd-accent) !important; }

.cd-group-section {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px 18px;
  margin: 0 10px;
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1.5px solid rgba(255,255,255,0.10);
  border-radius: 14px;
}
.cd-group-section-title {
  font-size: 10px; font-weight: 700; letter-spacing: 0.14em;
  color: rgba(255,255,255,0.5); text-transform: uppercase;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
/* "What shall we watch tonight?" — taste-crossing group pick. */
.cd-group-pick-hint {
  margin: 6px 0 0; font-size: 11.5px; color: var(--text-3); line-height: 1.4;
}
.cd-group-pick-results {
  display: flex; flex-direction: column; gap: 10px; margin-top: 12px;
}
.cd-group-pick-card {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 14px 10px 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 12px;
  text-align: left; cursor: pointer; color: inherit; font: inherit;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}
.cd-group-pick-card:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(229,9,20,0.45);
  transform: translateY(-1px);
}
.cd-group-pick-rank {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
  background: var(--cd-accent-dim, rgba(229,9,20,0.18));
  border: 1px solid var(--cd-accent-bdr, rgba(229,9,20,0.4));
  color: #fff; font-size: 11px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.cd-group-pick-poster {
  flex: 0 0 auto; width: 46px; height: 69px;
  object-fit: cover; border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.08);
}
.cd-group-pick-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cd-group-pick-title { font-size: 13.5px; font-weight: 700; color: var(--text); }
.cd-group-pick-reason {
  font-size: 12px; font-style: italic; color: var(--text-2); line-height: 1.4;
}
.cd-group-propose-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 99px;
  background: var(--cd-accent-dim); border: 1px solid var(--cd-accent-bdr);
  color: #fff; font-size: 10px; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  cursor: pointer; font-family: inherit;
  transition: background 0.15s;
}
.cd-group-propose-btn:hover { background: rgba(229,9,20,0.22); color: #fff; }

/* Members */
.cd-group-members {
  display: flex; flex-direction: column; gap: 6px;
}
.cd-group-member {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.04);
}
.cd-group-member-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: #1a1d28; overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.cd-group-member-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cd-group-member-emoji { font-size: 18px; }
.cd-group-letter-avatar {
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-size: 14px;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.cd-chat-avatar.cd-group-letter-avatar { font-size: 12px; }
.cd-propose-thumb-round.cd-group-letter-avatar {
  width: 30px; height: 30px; border-radius: 50%; font-size: 12px;
}
.cd-propose-thumb-round {
  border-radius: 50% !important;
  width: 30px !important; height: 30px !important;
  object-fit: cover; flex-shrink: 0;
}
img.cd-propose-thumb-round { object-fit: cover; }
.cd-group-member-info { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.cd-group-member-name {
  font-size: 13px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cd-group-member-role {
  font-size: 9px; font-weight: 800; letter-spacing: 0.1em;
  padding: 2px 6px; border-radius: 3px;
  background: rgba(255,255,255,0.06); color: var(--text-3);
}
.cd-group-member-role-host    { color: var(--cd-accent); background: var(--cd-accent-dim); }
.cd-group-member-role-admin   { color: #4caf50; background: rgba(76,175,80,0.12); }
.cd-group-member-role-subhost { color: #4caf50; background: rgba(76,175,80,0.12); }
.cd-group-member-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.cd-group-member-btn {
  padding: 4px 8px; border-radius: 5px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-3);
  font-size: 10px; font-weight: 600; letter-spacing: 0.02em;
  cursor: pointer; font-family: inherit;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.cd-group-member-btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.18);
  color: var(--text);
}
.cd-group-member-btn.cd-net-danger:hover {
  background: rgba(248,113,113,0.12);
  border-color: rgba(248,113,113,0.3);
  color: #f87171;
}
.cd-group-member-btn.cd-net-ban { color: #c0392b; border-color: rgba(192,57,43,0.3); }
.cd-group-member-btn.cd-net-ban:hover {
  background: rgba(192,57,43,0.15);
  border-color: rgba(192,57,43,0.5);
  color: #e74c3c;
}
.cd-group-member-btn:disabled { opacity: 0.5; cursor: default; }

/* ── Members viz: orbital hierarchy ──────────────────────────────────── */
.cd-group-section-members .cd-group-section-title {
  align-items: center;
}
.cd-members-controls {
  display: flex; gap: 8px; align-items: center;
  text-transform: none; letter-spacing: 0;
}
.cd-members-search {
  width: 180px; padding: 6px 10px; border-radius: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text); font-size: 11px; font-family: inherit;
  letter-spacing: 0;
  transition: border-color 0.15s, background 0.15s;
}
.cd-members-search:focus {
  outline: none;
  border-color: var(--cd-accent-bdr);
  background: rgba(255,255,255,0.08);
}
/* Reusable input + leading SVG icon wrapper. The icon sits inside the
   input's padding-left so they read as one element regardless of the
   inner input class (members search, edit-input, etc.). */
.cd-icon-input-wrap {
  position: relative;
  display: flex; align-items: stretch;
  flex: 1 1 auto; min-width: 0;
}
.cd-icon-input-wrap > .cd-search-with-icon {
  flex: 1 1 auto; min-width: 0;
  padding-left: 30px;
}
.cd-search-wrap-icon {
  position: absolute;
  left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
  transition: color 0.15s;
}
.cd-icon-input-wrap > .cd-search-with-icon:focus + .cd-search-wrap-icon,
.cd-icon-input-wrap:focus-within .cd-search-wrap-icon {
  color: var(--text-2);
}
.cd-members-random {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 10px; border-radius: 99px;
  background: var(--cd-accent-dim); border: 1px solid var(--cd-accent-bdr);
  color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  cursor: pointer; font-family: inherit;
  transition: background 0.15s;
}
.cd-members-random:hover { background: rgba(229,9,20,0.22); color: #fff; }
.cd-members-random > span { text-transform: uppercase; }
.cd-members-viz-wrap {
  display: none;
}
.cd-group-members {
  display: flex; flex-direction: column;
  max-height: 260px; overflow-y: auto;
  margin-top: 4px;
}
.cd-members-list-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px; border-radius: 8px;
  cursor: pointer; transition: background 0.12s;
}
.cd-members-list-row:hover { background: rgba(255,255,255,0.05); }
.cd-members-list-name {
  flex: 1; font-size: 12px; color: var(--text); min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cd-members-list-actions {
  display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s;
  flex-shrink: 0;
}
.cd-members-list-row:hover .cd-members-list-actions { opacity: 1; }
.cd-members-list-btn {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.4); padding: 4px 5px;
  border-radius: 4px; line-height: 1; transition: color 0.12s, background 0.12s;
}
.cd-members-list-btn:hover { color: var(--text); background: rgba(255,255,255,0.08); }
.cd-members-list-ban:hover { color: #e74c3c !important; background: rgba(192,57,43,0.12) !important; }

/* ── Ban list rows ───────────────────────────────────────────────────── */
.cd-ban-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 4px; border-bottom: 1px solid var(--border);
}
.cd-ban-row:last-child { border-bottom: none; }
.cd-ban-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; object-fit: cover;
}
.cd-ban-avatar-init {
  background: rgba(255,255,255,0.08); display: flex; align-items: center;
  justify-content: center; font-size: 12px; font-weight: 600; color: var(--text-3);
}
.cd-ban-info { flex: 1; min-width: 0; }
.cd-ban-name { font-size: 12px; font-weight: 600; color: var(--text); }
.cd-ban-meta { font-size: 10px; color: var(--text-3); margin-top: 1px; }
.cd-members-fg {
  width: 100%; height: 360px; display: block;
}
.cd-member-detail {
  position: absolute;
  bottom: 10px; left: 10px; right: 10px;
  background: rgba(10,11,16,0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}
.cd-member-detail.hidden { display: none; }
.cd-member-detail-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  flex-shrink: 0; overflow: hidden;
}
.cd-member-detail-avatar.cd-group-letter-avatar { font-size: 14px; }
.cd-member-detail-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cd-member-detail-name {
  font-size: 13px; font-weight: 700; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cd-member-detail-actions {
  display: flex; gap: 4px; flex-wrap: wrap; flex-shrink: 0;
}
.cd-member-detail-close {
  background: none; border: none; color: var(--text-3);
  font-size: 16px; cursor: pointer; padding: 4px 8px;
  font-family: inherit;
}
.cd-member-detail-close:hover { color: var(--text); }

@media (max-width: 520px) {
  .cd-members-search { width: 100px; }
  .cd-members-fg { height: 300px; }
}

/* ── Members fullscreen panel ────────────────────────────────────────── */
.cd-members-fs-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  color: var(--text-2); cursor: pointer; font-family: inherit;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.cd-members-fs-btn:hover {
  color: var(--text);
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.20);
}
.cd-neuron-btn {
  width: 32px; height: 32px;
  color: #fff;
  border-color: rgba(229,9,20,0.2);
  background: rgba(229,9,20,0.06);
}
.cd-neuron-btn:hover {
  color: #fff;
  border-color: rgba(229,9,20,0.7);
  background: rgba(229,9,20,0.45);
  box-shadow: 0 0 10px rgba(229,9,20,0.25);
}
.cd-members-fs {
  position: fixed; inset: 0; z-index: 90;
  background: radial-gradient(ellipse at center, #0b0d13 0%, #05060a 80%);
  display: flex; flex-direction: column;
  opacity: 0; pointer-events: none;
  transition: opacity 0.22s ease;
}
.cd-members-fs.cd-members-fs-open {
  opacity: 1; pointer-events: auto;
}
.cd-members-fs.hidden { display: none; }
.cd-members-fs-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.cd-members-fs-title {
  display: flex; flex-direction: column; gap: 2px;
}
.cd-members-fs-eyebrow {
  font-size: 9px; font-weight: 700; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--text-3);
}
.cd-members-fs-group {
  font-size: 18px; font-weight: 700; color: var(--text);
  letter-spacing: -0.01em;
}
.cd-members-fs-controls {
  display: flex; align-items: center; gap: 8px;
}
.cd-members-fs-controls .cd-members-search { width: 220px; }
.cd-members-fs-stage {
  position: relative; flex: 1; min-height: 0;
  overflow: hidden;
  /* Subtle radial halo behind the orbits — gives the stage depth */
  background:
    radial-gradient(circle at center, rgba(229,9,20,0.05) 0%, transparent 55%);
}
.cd-members-fg-fs {
  position: absolute; inset: 0;
  display: block;
  animation: cd-fs-pop 0.36s cubic-bezier(0.34, 1.4, 0.64, 1);
}
@keyframes cd-fs-pop {
  from { transform: scale(0.96); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
/* Detail card recentered for the fullscreen stage */
.cd-members-fs #cd-member-fs-detail {
  position: absolute;
  bottom: 32px; left: 50%; transform: translateX(-50%);
  width: min(640px, calc(100% - 64px));
  background: rgba(10,11,16,0.92);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.6);
}
.cd-members-fs-hint {
  position: absolute;
  top: 16px; left: 50%; transform: translateX(-50%);
  font-size: 9px; font-weight: 700; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--text-3);
  pointer-events: none;
  opacity: 0.7;
}
@media (max-width: 720px) {
  .cd-members-fs-header { padding: 12px 16px; }
  .cd-members-fs-controls .cd-members-search { width: 140px; }
  .cd-members-fs-group { font-size: 14px; }
  .cd-members-fg-fs { inset: 0; }
}

/* ── Polls ───────────────────────────────────────────────────────────── */
.cd-group-polls {
  display: flex; flex-direction: column; gap: 12px;
}
/* ── Poll diary panel ────────────────────────────────────────────────────── */
.cd-polls-diary {
  position: absolute; inset: 0; z-index: 70;
  display: flex; flex-direction: column;
  background: #0b0d13;
  transform: translateY(100%); transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
}
.cd-polls-diary:not(.hidden) { transform: translateY(0); }
.cd-polls-diary.hidden { pointer-events: none; }
.cd-polls-diary-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.cd-polls-diary-title { font-size: 14px; font-weight: 700; color: var(--text); }
.cd-polls-diary-body {
  flex: 1; overflow-y: auto; padding: 16px 18px 40px;
  display: flex; flex-direction: column; gap: 24px;
}
.cd-diary-day-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4); text-transform: uppercase;
  margin-bottom: 6px;
}
.cd-diary-poll {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px; padding: 10px 12px;
  margin-bottom: 6px;
}
.cd-diary-poll:last-child { margin-bottom: 0; }
.cd-diary-winner-poster {
  width: 36px; height: 54px; border-radius: 4px;
  object-fit: cover; flex-shrink: 0;
  background: rgba(255,255,255,0.06);
}
.cd-diary-info { flex: 1; min-width: 0; }
.cd-diary-poll-title {
  font-size: 12px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cd-diary-winner-name {
  font-size: 11px; color: rgba(255,255,255,0.65);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 2px;
}
.cd-diary-votes {
  font-size: 10px; color: rgba(255,255,255,0.4); margin-top: 3px;
}
.cd-diary-crown {
  font-size: 11px; color: #f0c040; flex-shrink: 0;
}
.cd-diary-empty {
  font-size: 13px; color: rgba(255,255,255,0.35);
  text-align: center; margin-top: 40px;
}
.cd-diary-poll { cursor: pointer; }
.cd-diary-poll:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.12); }
.cd-diary-poll-delete {
  flex-shrink: 0; background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.3); font-size: 11px; padding: 4px 6px;
  border-radius: 4px; line-height: 1; opacity: 0; transition: opacity 0.15s, color 0.15s;
}
.cd-diary-poll:hover .cd-diary-poll-delete { opacity: 1; }
.cd-diary-poll-delete:hover { color: #ff4d4d; }

/* ── Confirm dialog ─────────────────────────────────────────────────── */
.cd-confirm-modal {
  position: absolute; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
}
.cd-confirm-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
}
.cd-confirm-box {
  position: relative; z-index: 1;
  background: var(--bg-2); border: 1px solid var(--border-h);
  border-radius: 10px; padding: 20px 22px 16px;
  width: 280px; max-width: calc(100% - 32px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.cd-confirm-msg {
  font-size: 13px; color: var(--text); line-height: 1.5;
  margin: 0 0 18px;
}
.cd-confirm-actions {
  display: flex; gap: 8px; justify-content: flex-end;
}

/* ── Poll detail sub-panel ───────────────────────────────────────────── */
.cd-poll-detail {
  position: absolute; inset: 0; z-index: 72;
  background: #0b0d13;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.24s cubic-bezier(0.4,0,0.2,1);
}
.cd-poll-detail:not(.hidden) { transform: translateX(0); }
.cd-poll-detail.hidden { pointer-events: none; }
.cd-poll-detail-body {
  flex: 1; overflow-y: auto; padding: 14px 16px 40px;
  display: flex; flex-direction: column; gap: 8px;
}
.cd-poll-detail-meta {
  font-size: 11px; color: rgba(255,255,255,0.38);
  padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 4px;
}
.cd-poll-result-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  position: relative; overflow: hidden;
}
.cd-poll-result-row.is-winner {
  border-color: rgba(229,9,20,0.35);
  background: rgba(229,9,20,0.05);
}
.cd-poll-result-bar {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: rgba(229,9,20,0.08);
  pointer-events: none;
}
.cd-poll-result-row.is-winner .cd-poll-result-bar { background: rgba(229,9,20,0.15); }
.cd-poll-result-poster {
  width: 28px; height: 42px; border-radius: 4px; object-fit: cover;
  flex-shrink: 0; background: rgba(255,255,255,0.06);
  position: relative; z-index: 1;
}
.cd-poll-result-info {
  flex: 1; min-width: 0; position: relative; z-index: 1;
}
.cd-poll-result-title {
  font-size: 12px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cd-poll-result-year { font-size: 10px; color: rgba(255,255,255,0.38); margin-top: 2px; }
.cd-poll-result-nums {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
  flex-shrink: 0; position: relative; z-index: 1;
}
.cd-poll-result-pct { font-size: 15px; font-weight: 800; color: var(--cd-accent); line-height: 1; }
.cd-poll-result-count { font-size: 10px; color: rgba(255,255,255,0.38); }
.cd-poll-result-crown { font-size: 11px; color: #f0c040; flex-shrink: 0; position: relative; z-index: 1; }

.cd-poll {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.cd-poll-closed { opacity: 0.72; }
.cd-poll-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px;
}
.cd-poll-head-actions { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }
.cd-poll-title { font-size: 13px; font-weight: 700; color: var(--text); }
.cd-poll-meta {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 10px; color: var(--text-3); font-weight: 600;
  letter-spacing: 0.04em; margin-top: 3px;
}
.cd-poll-countdown { color: var(--cd-accent); font-variant-numeric: tabular-nums; }
.cd-poll-status-closed {
  font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-3);
}
/* ── Poll card row ───────────────────────────────────────────────────── */
.cd-poll-meta-dot { color: rgba(255,255,255,0.2); }
.cd-poll-deck {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 4px;
  /* Cards never overlap anymore. Allow overflow so the hover-pop
     scale isn't clipped by the deck's box. */
  overflow: visible;
  padding: 6px 2px 16px;
}
.cd-poll-card {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  /* Cap so 2-card polls don't render 525px-tall posters. With aspect-ratio
     2/3 the implicit height is ~300px max, which sits well in the panel. */
  max-width: 200px;
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: #12141b;
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  transition:
    transform 0.28s cubic-bezier(0.34, 1.4, 0.64, 1),
    box-shadow 0.28s ease,
    border-color 0.2s ease;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}
.cd-poll-card:hover {
  transform: translateY(-6px) scale(1.05);
  z-index: 4;
  box-shadow: 0 14px 32px rgba(0,0,0,0.6);
  border-color: rgba(255,255,255,0.25);
}
.cd-poll-card-poster {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.55);
  transition: filter 0.2s;
}
.cd-poll-card:hover .cd-poll-card-poster { filter: brightness(0.85); }
.cd-poll-card-noposter {
  background: linear-gradient(135deg, #1a1d28, #0f1119);
}
/* Vertical fill bar visualizing the vote percentage */
.cd-poll-card-fill {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(0deg, rgba(229,9,20,0.55) 0%, rgba(229,9,20,0.0) 100%);
  pointer-events: none;
  transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.cd-poll-card-grad {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 60%);
}
.cd-poll-card-body {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 8px 10px 10px;
  z-index: 2;
  color: #fff;
}
.cd-poll-card-title {
  font-size: 12px; font-weight: 700; line-height: 1.25;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.cd-poll-card-year { font-size: 10px; color: rgba(255,255,255,0.6); margin-top: 2px; }
.cd-poll-card-meter {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.cd-poll-card-pct {
  font-size: 18px; font-weight: 800; color: var(--cd-accent);
  letter-spacing: -0.02em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}
.cd-poll-card-count { font-size: 10px; font-weight: 600; color: rgba(255,255,255,0.7); }
.cd-poll-card-tick {
  position: absolute; top: 8px; right: 8px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--cd-accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px;
  z-index: 3;
  box-shadow: 0 0 0 2px #12141b;
}
.cd-poll-card-crown {
  position: absolute; top: 8px; left: 8px;
  font-size: 9px; font-weight: 800; letter-spacing: 0.1em;
  padding: 3px 7px; border-radius: 99px;
  background: var(--cd-accent); color: #fff;
  z-index: 3;
}
.cd-poll-card-voted {
  border-color: var(--cd-accent) !important;
  box-shadow: 0 0 0 2px var(--cd-accent-bdr) inset, 0 4px 14px rgba(229,9,20,0.25) !important;
}
.cd-poll-card-winner {
  border-color: var(--cd-accent);
  box-shadow: 0 0 0 1px var(--cd-accent-bdr) inset, 0 8px 24px rgba(229,9,20,0.18);
}
.cd-poll-hint {
  margin-top: 6px;
  font-size: 9px; font-weight: 600; letter-spacing: 0.08em;
  color: var(--text-3); text-transform: uppercase;
  text-align: center;
}

/* ── Poll create modal — redesigned ──────────────────────────────────── */
.cd-poll-box {
  max-width: 540px;
  /* Override the vh-based max-height from .cd-edit-box so the poll modal
     stays within its positioned ancestor (the group panel) instead of
     potentially extending beyond it when random preview fills up. */
  max-height: calc(100% - 40px);
}
.cd-poll-modes {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; margin-bottom: 16px;
}
.cd-poll-mode {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 12px 14px; border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  cursor: pointer; font-family: inherit;
  color: var(--text-2);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  text-align: left;
}
.cd-poll-mode > svg { color: var(--text-3); }
.cd-poll-mode > span {
  font-size: 13px; font-weight: 700; letter-spacing: -0.01em;
}
.cd-poll-mode > small {
  font-size: 10px; font-weight: 500; color: var(--text-3);
}
.cd-poll-mode:hover {
  border-color: rgba(255,255,255,0.18);
  color: var(--text);
}
.cd-poll-mode.active {
  background: var(--cd-accent-dim);
  border-color: var(--cd-accent-bdr);
  color: var(--text);
}
.cd-poll-mode.active > svg,
.cd-poll-mode.active > small { color: var(--cd-accent); }

.cd-poll-body { display: flex; flex-direction: column; gap: 10px; }
.cd-poll-body.hidden { display: none; }
.cd-poll-title.cd-edit-input { font-size: 14px; font-weight: 600; }

.cd-poll-categories {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-top: 8px;
}
.cd-poll-category {
  padding: 5px 11px; border-radius: 99px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.10);
  color: var(--text-3); cursor: pointer; font-family: inherit;
  font-size: 10px; font-weight: 600; letter-spacing: 0.04em;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.cd-poll-category:hover {
  color: var(--text); border-color: rgba(255,255,255,0.20);
}
.cd-poll-category.active {
  background: var(--cd-accent-dim);
  border-color: var(--cd-accent-bdr);
  color: var(--cd-accent);
}
.cd-poll-search-results {
  max-height: 200px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
  margin-top: 6px;
}
.cd-poll-search-results:empty { display: none; }
.cd-poll-search-empty {
  font-size: 11px; color: var(--text-3); font-style: italic;
  padding: 10px 4px;
}

.cd-poll-picked-label {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 4px;
}
.cd-poll-picked-count {
  font-size: 10px; font-weight: 700; color: var(--cd-accent);
  font-variant-numeric: tabular-nums;
}
.cd-poll-picked {
  display: flex; flex-direction: column; gap: 6px;
  min-height: 40px;
}
.cd-poll-picked-empty {
  font-size: 11px; color: var(--text-3); font-style: italic;
  padding: 12px; text-align: center;
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: 8px;
}
.cd-poll-pick {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px 6px 6px; border-radius: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}
.cd-poll-pick img {
  width: 30px; height: 44px; border-radius: 4px; object-fit: cover;
  background: rgba(255,255,255,0.04); flex-shrink: 0;
}
.cd-poll-pick-noposter {
  width: 30px; height: 44px; border-radius: 4px;
  background: linear-gradient(135deg, #1a1d28, #0f1119);
  flex-shrink: 0;
}
.cd-poll-pick-info { flex: 1; min-width: 0; }
.cd-poll-pick-title {
  font-size: 12px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cd-poll-pick-year { font-size: 10px; color: var(--text-3); margin-top: 1px; }
.cd-poll-pick-remove {
  background: transparent; border: 1px solid transparent;
  color: var(--text-3); font-size: 11px; padding: 4px 8px;
  border-radius: 6px; cursor: pointer; font-family: inherit;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.cd-poll-pick-remove:hover {
  background: rgba(248,113,113,0.1);
  color: #f87171; border-color: rgba(248,113,113,0.3);
}

/* Random preview block + Roll button */
.cd-poll-random-preview {
  min-height: 60px;
  /* The preview now stacks compact rows (thumbnail + title + year). Cap
     so 5 picks scroll inside the box instead of pushing the modal out
     of bounds, and use flex-column so rows space cleanly. */
  max-height: 220px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  margin-top: 4px;
  display: flex; flex-direction: column; gap: 6px;
}
.cd-poll-random-preview .cd-poll-pick { flex-shrink: 0; }
.cd-poll-random-preview:has(.cd-poll-random-empty) {
  display: block;
}
.cd-poll-random-empty {
  font-size: 11px; color: var(--text-3); font-style: italic;
  text-align: center; padding: 16px 8px;
}
.cd-poll-random-empty b { color: var(--cd-accent); font-style: normal; }
.cd-poll-random-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}
.cd-poll-random-card {
  display: flex; flex-direction: column; gap: 6px;
}
.cd-poll-random-card img {
  width: 100%; aspect-ratio: 2/3; border-radius: 6px; object-fit: cover;
  background: rgba(255,255,255,0.04);
}
.cd-poll-random-noposter {
  width: 100%; aspect-ratio: 2/3; border-radius: 6px;
  background: linear-gradient(135deg, #1a1d28, #0f1119);
}
.cd-poll-random-title {
  font-size: 10px; font-weight: 600; color: var(--text);
  line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.cd-poll-random-year { font-size: 9px; color: var(--text-3); }
.cd-poll-roll-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 8px;
  padding: 10px 16px; border-radius: 99px;
  background: var(--cd-accent); color: #fff;
  border: none; cursor: pointer; font-family: inherit;
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  align-self: flex-start;
  transition: background 0.15s, transform 0.15s;
}
.cd-poll-roll-btn:hover { background: var(--cd-accent-h); transform: translateY(-1px); }
.cd-poll-roll-btn:disabled { opacity: 0.7; cursor: default; }
.cd-poll-roll-spinning svg { animation: cd-spin 0.6s linear infinite; }
@keyframes cd-spin { to { transform: rotate(360deg); } }

/* Pill groups for count / duration / max-votes */
.cd-poll-params {
  display: flex; flex-direction: column; gap: 12px;
  padding: 12px 0; margin-top: 14px;
  border-top: 1px solid var(--border);
}
.cd-poll-param {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.cd-poll-param-label {
  font-size: 10px; font-weight: 700; color: var(--text-3);
  letter-spacing: 0.1em; text-transform: uppercase;
  min-width: 90px;
}
.cd-poll-pillgroup {
  display: flex; gap: 4px; flex-wrap: wrap;
}
.cd-poll-pillgroup-scroll {
  flex-wrap: nowrap; overflow-x: auto; max-width: 100%;
  scrollbar-width: none;
}
.cd-poll-pillgroup-scroll::-webkit-scrollbar { display: none; }
.cd-poll-pillgroup button {
  padding: 5px 10px; border-radius: 99px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-2);
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  cursor: pointer; font-family: inherit;
  white-space: nowrap; flex-shrink: 0;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.cd-poll-pillgroup button:hover { color: var(--text); border-color: rgba(255,255,255,0.18); }
.cd-poll-pillgroup button.active {
  background: var(--cd-accent);
  border-color: var(--cd-accent);
  color: #fff;
}

/* Poll save button — full red button with a subtle white border for distinction */
#cd-poll-save { border: 1.5px solid rgba(255,255,255,0.18); }
#cd-poll-save:hover { border-color: rgba(255,255,255,0.35); opacity: 0.9; }
.cd-poll-rand-title-wrap { margin-top: 4px; }
.cd-poll-rand-title-wrap.hidden { display: none; }

/* Poll-create modal */
/* (legacy duration/votes select grid replaced by pill groups above) */
.cd-poll-search-results {
  max-height: 220px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
  margin-top: 6px;
}
.cd-poll-picked {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px;
}
.cd-poll-picked-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px 4px 4px; border-radius: 99px;
  background: rgba(229,9,20,0.12);
  border: 1px solid rgba(229,9,20,0.28);
  font-size: 11px; font-weight: 600; color: var(--text);
}
.cd-poll-picked-chip img { width: 22px; height: 32px; border-radius: 3px; object-fit: cover; }
.cd-poll-picked-chip button {
  background: none; border: none; color: var(--text-3);
  font-size: 12px; cursor: pointer; padding: 0 4px;
}
.cd-poll-picked-chip button:hover { color: var(--text); }

/* ── Chat ────────────────────────────────────────────────────────────── */
.cd-chat-title-actions { display: flex; align-items: center; gap: 6px; }
/* ── Chat modal ─────────────────────────────────────────────────────────── */
.cd-chat-modal {
  position: absolute; inset: 0; z-index: 80;
  display: flex; align-items: flex-end; justify-content: flex-end;
  padding: 16px;
  pointer-events: none;
}
.cd-chat-modal:not(.hidden) .cd-chat-modal-box { pointer-events: all; }
.cd-chat-modal-backdrop {
  position: absolute; inset: 0; pointer-events: none;
}
.cd-chat-modal-box {
  position: relative; z-index: 1;
  width: 360px; height: 520px;
  display: flex; flex-direction: column;
  border-radius: 14px; overflow: hidden;
  background: #0e1018;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  animation: cd-chat-slide-in 0.22s cubic-bezier(0.34,1.26,0.64,1);
}
.cd-chat-modal.hidden .cd-chat-modal-box { animation: none; }
@keyframes cd-chat-slide-in {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
/* Poster background layer */
.cd-chat-modal-box::before {
  content: ''; position: absolute; inset: 0; z-index: 0;
  background-image: var(--chat-bg, none);
  background-size: cover; background-position: center;
  opacity: 0.18; pointer-events: none;
}
.cd-chat-modal-box > * { position: relative; z-index: 1; }
.cd-chat-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.cd-chat-modal-title {
  font-size: 13px; font-weight: 600; color: var(--text);
}
.cd-group-chat-messages {
  display: flex; flex-direction: column; gap: 8px;
  flex: 1; overflow-y: auto;
  padding: 12px 14px;
}
.cd-chat-msg {
  display: flex; gap: 8px; align-items: flex-start;
}
.cd-chat-msg-me { flex-direction: row-reverse; }
.cd-chat-msg-me .cd-chat-msg-head { justify-content: flex-end; }
.cd-chat-msg-me .cd-chat-msg-text {
  background: rgba(229,9,20,0.15);
  border-color: rgba(229,9,20,0.28);
}
.cd-chat-msg-body { position: relative; }
.cd-chat-msg-del {
  position: absolute;
  top: -2px; right: -2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(20, 22, 28, 0.92);
  color: var(--text-3);
  font: 600 13px/1 var(--font-ui, inherit); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(0.92);
  transition: opacity 0.14s, transform 0.14s, color 0.14s, background 0.14s, border-color 0.14s;
}
.cd-chat-msg:hover .cd-chat-msg-del,
.cd-chat-msg-del:focus-visible {
  opacity: 1; transform: scale(1);
}
.cd-chat-msg-del:hover {
  color: #f87171;
  background: rgba(248,113,113,0.14);
  border-color: rgba(248,113,113,0.5);
}
.cd-chat-msg-me .cd-chat-msg-del { right: auto; left: -2px; }
.cd-chat-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: #1a1d28; overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.cd-chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cd-chat-msg-body { max-width: 75%; min-width: 0; }
.cd-chat-msg-head {
  display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px;
  font-size: 10px; font-weight: 600;
}
.cd-chat-msg-name { color: var(--text-2); }
.cd-chat-msg-time { color: var(--text-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.cd-chat-msg-text {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px; color: var(--text); line-height: 1.4;
  word-wrap: break-word; white-space: pre-wrap;
}
.cd-group-chat-compose {
  display: flex; gap: 6px; align-items: stretch;
  padding: 10px 14px 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.cd-group-chat-compose input { flex: 1; }
.cd-group-chat-send {
  width: 36px; border-radius: 8px;
  background: var(--cd-accent); border: none; color: #fff;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.cd-group-chat-send:hover { background: var(--cd-accent-h); }

/* ── Group images (uploaders inside settings modal) ──────────────────── */
.cd-group-images {
  display: flex; gap: 10px; margin-bottom: 14px;
}
.cd-group-cover-drop {
  flex: 1; height: 100px; border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px dashed rgba(255,255,255,0.18);
  cursor: pointer; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.cd-group-avatar-drop {
  width: 72px; height: 108px; border-radius: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px dashed rgba(255,255,255,0.18);
  cursor: pointer; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  position: relative; flex-shrink: 0;
}
.cd-group-cover-drop img,
.cd-group-avatar-drop img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.cd-group-cover-drop img.hidden,
.cd-group-avatar-drop img.hidden { display: none; }
.cd-group-image-hint {
  font-size: 10px; color: var(--text-3); font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  text-align: center; padding: 4px 8px;
  position: relative; z-index: 1;
}
.cd-group-cover-drop:has(img:not(.hidden)) .cd-group-image-hint,
.cd-group-avatar-drop:has(img:not(.hidden)) .cd-group-image-hint { opacity: 0; }
.cd-group-cover-drop:hover, .cd-group-avatar-drop:hover {
  border-color: var(--cd-accent-bdr);
}
.cd-group-image-drag {
  border-color: var(--cd-accent) !important;
  background: var(--cd-accent-dim) !important;
}

/* ── Invite / Settings modal bits ────────────────────────────────────── */
.cd-group-invite-row { margin-top: 8px; }
.cd-group-invite-code {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 8px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
  margin-top: 4px;
}
.cd-group-invite-code code {
  flex: 1; min-width: 0;
  font-family: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
  font-size: 12px; color: var(--text); letter-spacing: 0.02em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.cd-group-copy-invite {
  background: var(--cd-accent-dim) !important;
  color: #fff !important;
  border-color: var(--cd-accent-bdr) !important;
}

/* Propose modal — search results list */
.cd-propose-results {
  max-height: 360px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px;
  margin-top: 8px;
}
.cd-propose-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s;
}
.cd-propose-row:hover { background: rgba(255,255,255,0.05); }
.cd-propose-thumb {
  width: 40px; height: 60px; border-radius: 4px; object-fit: cover;
  background: rgba(255,255,255,0.05); flex-shrink: 0;
}
.cd-propose-info { flex: 1; min-width: 0; }
.cd-propose-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cd-propose-meta {
  font-size: 10px; font-weight: 500; color: var(--text-3);
  letter-spacing: 0.02em; margin-top: 2px;
}
.cd-playlist-mosaic {
  width: 100%; height: 100%; display: grid;
  grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
  gap: 1px; background: rgba(255,255,255,0.04);
}
.cd-playlist-mosaic img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.cd-playlist-mosaic-empty {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));
}
.cd-playlist-card-info {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 24px 8px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  border-radius: 0 0 10px 10px;
}
.cd-playlist-card-name {
  font-size: 12px; font-weight: 700; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cd-playlist-card-meta {
  font-size: 10px; color: rgba(255,255,255,0.6); margin-top: 2px;
}

/* ── New playlist button in lib title ───── */
.cd-pl-new-btn {
  margin-left: auto; padding: 3px 10px;
  background: var(--cd-accent-dim); border: 1px solid var(--cd-accent-bdr);
  border-radius: 8px; color: var(--cd-accent); font: inherit;
  font-size: 11px; font-weight: 600; cursor: pointer;
  transition: background 0.15s;
}
.cd-pl-new-btn:hover { background: var(--cd-accent); color: #fff; }
.cd-lib-title-actions {
  margin-left: auto; display: flex; align-items: center; gap: 6px;
}
.cd-lib-title-actions .cd-pl-new-btn { margin-left: 0; }
.cd-pl-join-btn {
  background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.12); color: var(--text-2);
}
.cd-pl-join-btn:hover { background: rgba(255,255,255,0.1); color: var(--text); }
/* "Discover" jump to the Groups feed — icon + label, accent style as the
   section's primary action. */
.cd-pl-discover-btn { display: inline-flex; align-items: center; gap: 5px; }
.cd-pl-discover-btn svg { flex-shrink: 0; }
.cd-pl-discover-btn:hover svg { stroke: #fff; }

/* Playlist filter pills */
.cd-pl-filters {
  display: flex; gap: 6px; padding: 0 20px 10px;
}
.cd-pl-filter {
  padding: 4px 12px; border-radius: 20px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.5); font-size: 11px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: all 0.15s;
}
.cd-pl-filter:hover { border-color: rgba(255,255,255,0.15); color: rgba(255,255,255,0.8); }
.cd-pl-filter.active {
  background: var(--cd-accent); border-color: var(--cd-accent); color: #fff;
}

/* ── Playlist view panel ────────────────── */
.cd-plview-header { padding: 12px 20px 4px; }
.cd-plview-actions { display: flex; gap: 8px; margin-left: auto; }
.cd-plview-badge {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; margin-top: 6px;
}
.cd-plview-public { background: rgba(46,204,113,0.15); color: #2ecc71; }
.cd-plview-private { background: rgba(255,255,255,0.08); color: var(--text-3); }
.cd-plview-delete {
  padding: 5px 12px; border-radius: 8px;
  background: rgba(229,9,20,0.15); border: 1px solid rgba(229,9,20,0.3);
  color: #fff; font: inherit; font-size: 11px; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
}
.cd-plview-delete:hover { background: rgba(229,9,20,0.35); color: #fff; }

/* ── MindSearch tab ─────────────────────── */
#cdtab-mindsearch {
  position: relative; overflow: hidden !important;
  background: #080a0f;
}
.cd-ms-splash {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
  background: #080a0f;
  transition: opacity 0.6s ease;
}
.cd-ms-splash.cd-ms-splash-hide {
  opacity: 0; pointer-events: none;
}
.cd-ms-splash-title {
  font-size: 28px; font-weight: 800; letter-spacing: 1px;
  color: #e50914;
}
.cd-ms-splash-loading {
  font-size: 13px; color: rgba(255,255,255,0.7);
}
.cd-ms-dots::after {
  content: '';
  animation: cd-ms-dots-anim 1.4s steps(4, end) infinite;
}
@keyframes cd-ms-dots-anim {
  0%  { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}
.cd-ms-iframe {
  flex: 1; width: 100%; height: 100%; border: none;
  background: #080a0f; min-height: 0;
}
.cd-ms-loading {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 40px; color: var(--text-3); font-size: 13px;
}
.cd-ms-loading.hidden { display: none; }
.cd-ms-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px; background: rgba(8,10,15,0.92);
  border-top: 1px solid var(--border); gap: 12px;
  position: absolute; bottom: 20px; left: 0; right: 0; z-index: 5;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  animation: cd-ms-slide-up 0.2s ease-out;
}
.cd-ms-toolbar.hidden { display: none; }
@keyframes cd-ms-slide-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes cd-ms-slide-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cd-ms-film-info {
  display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1;
}
.cd-ms-poster {
  width: 32px; height: 48px; object-fit: cover; border-radius: 4px; flex-shrink: 0;
}
.cd-ms-film-text {
  display: flex; flex-direction: column; min-width: 0;
}
.cd-ms-film-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cd-ms-film-year { font-size: 11px; color: var(--text-3); }
.cd-ms-actions {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.cd-ms-open-modal {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 6px;
  border: 1px solid var(--border); background: transparent;
  color: var(--text-3); cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.cd-ms-open-modal:hover {
  background: var(--cd-accent-dim); border-color: var(--cd-accent-bdr);
  color: var(--cd-accent);
}
.cd-ms-disclaimer {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 5;
  padding: 6px 16px;
  font-size: 10px; color: var(--text-3); text-align: center;
  background: rgba(8,10,15,0.8); border-top: 1px solid var(--border);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
}

/* Username + badge layout (CineDock own profile) */
.cd-profile-nameline {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.cd-profile-nameline .cd-profile-username {
  margin: 0; line-height: 1.1;
}
.cd-profile-badge-slot { display: inline-flex; align-items: center; }
.cd-profile-badge-slot:empty { display: none; }

/* ── Pro poster picker (shared modal) ──────────────────────────────────── */
.cd-poster-picker-modal {
  position: fixed; inset: 0; z-index: 4000;
  display: flex; align-items: center; justify-content: center;
}
.cd-poster-picker-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.65); backdrop-filter: blur(4px);
  animation: cd-fade-in 0.2s ease;
}
.cd-poster-picker-box {
  position: relative; z-index: 1;
  width: min(640px, 92vw); max-height: 82vh;
  display: flex; flex-direction: column; gap: 12px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 18px; padding: 18px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.7);
  animation: cd-pop-in 0.22s ease;
}
@keyframes cd-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes cd-pop-in { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.cd-poster-picker-head { display: flex; align-items: center; justify-content: space-between; }
.cd-poster-picker-head h3 { font-size: 14px; font-weight: 700; margin: 0; color: var(--text); }
.cd-poster-picker-close,
.cd-poster-picker-back {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text-2); cursor: pointer; font-size: 14px; line-height: 1;
  font-family: inherit;
}
.cd-poster-picker-close:hover,
.cd-poster-picker-back:hover { color: var(--text); background: var(--glass-h); }
.cd-poster-picker-title { font-size: 14px; font-weight: 700; margin: 0; color: var(--text); flex: 1; text-align: center; }
.cd-poster-picker-input {
  width: 100%; padding: 10px 14px; border-radius: 10px;
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text); font: inherit; font-size: 13px; outline: none;
  transition: border-color 0.15s;
}
.cd-poster-picker-input:focus { border-color: var(--cd-accent); }
.cd-poster-picker-body {
  flex: 1; min-height: 120px; overflow: auto;
  display: flex; flex-direction: column;
}
.cd-poster-picker-body::-webkit-scrollbar { width: 3px; height: 3px; }
.cd-poster-picker-body::-webkit-scrollbar-track { background: transparent; }
.cd-poster-picker-body::-webkit-scrollbar-thumb { background: var(--border-h); border-radius: 2px; }
.cd-poster-picker-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}
.cd-poster-picker-grid.hidden { display: none; }
.cd-poster-picker-empty { display: flex; flex-direction: column; gap: 10px; }
.cd-poster-picker-empty.hidden { display: none; }
.cd-pp-sect-title {
  font-size: 10px; font-weight: 700; color: var(--text-3);
  letter-spacing: 0.08em; text-transform: uppercase; margin-top: 4px;
}
.cd-pp-sect-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px;
}
.cd-pp-sect-grid.cd-poster-picker-grid-wide { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.cd-pp-sect-grid.cd-poster-picker-grid-wide .cd-poster-picker-item img { aspect-ratio: 16/9; }
.cd-pp-noimg {
  width: 100%; aspect-ratio: 2/3; border-radius: 8px; background: var(--bg-3);
}
/* Favorite star overlay on picker cells */
.cd-poster-picker-item { position: relative; }
.cd-pp-star {
  position: absolute; top: 6px; right: 6px;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(0,0,0,0.55); border: none;
  color: rgba(255,255,255,0.55); font-size: 14px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, background 0.15s, transform 0.15s;
  z-index: 2;
}
.cd-pp-star:hover { background: rgba(0,0,0,0.75); transform: scale(1.08); }
.cd-pp-star.active { color: #f5c518; }
.cd-poster-picker-item {
  display: flex; flex-direction: column; gap: 6px;
  background: transparent; border: 2px solid transparent;
  border-radius: 10px; padding: 0; cursor: pointer; font-family: inherit;
  text-align: left; transition: border-color 0.15s, transform 0.15s;
}
.cd-poster-picker-item:hover { border-color: var(--cd-accent); transform: translateY(-2px); }
.cd-poster-picker-item img {
  width: 100%; aspect-ratio: 2/3; object-fit: cover;
  border-radius: 8px; background: var(--bg-3);
}
/* Landscape variant: wider cells + 16:9 thumbnails for background pickers. */
.cd-poster-picker-grid-wide { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.cd-poster-picker-grid-wide .cd-poster-picker-item img { aspect-ratio: 16/9; }
.cd-poster-picker-item span {
  font-size: 11px; color: var(--text-2); padding: 0 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cd-poster-picker-hint {
  font-size: 11px; color: var(--text-3); margin: 0; text-align: center;
}

/* "Movie poster" tile in the bg picker grid — red clapperboard */
.cd-pl-bg-opt-poster {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(239,68,68,0.22), rgba(239,68,68,0.06));
  border-color: rgba(239,68,68,0.4); color: #ef4444;
  position: relative;
}
.cd-pl-bg-opt-poster:hover { border-color: #ef4444; }
.cd-pl-bg-opt-poster.cd-sel { border-color: var(--cd-accent); }
.cd-pl-bg-opt-poster svg { display: block; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.35)); }
.cd-pl-bg-opt-lock {
  position: absolute; top: 4px; right: 4px;
  font-size: 8px; font-weight: 800; letter-spacing: 0.08em;
  padding: 2px 5px; border-radius: 6px;
  background: var(--cd-accent); color: #fff;
}

/* Playlist cover — "Use movie poster" button */
.cd-pl-cover-poster-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 12px; border-radius: 10px;
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text-2); font: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: border-color 0.15s, color 0.15s, background 0.15s;
  align-self: flex-start;
}
.cd-pl-cover-poster-btn:hover { color: var(--text); border-color: var(--cd-accent-bdr); background: var(--cd-accent-dim); }
.cd-pl-cover-pro-badge {
  font-size: 9px; font-weight: 800; letter-spacing: 0.08em;
  padding: 2px 6px; border-radius: 99px;
  background: var(--cd-accent); color: #fff;
}

/* Diary toolbar toggle (Custom posters) */
.cd-diary-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 99px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-3); font: inherit; font-size: 11px; font-weight: 600;
  cursor: pointer; transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.cd-diary-toggle:hover { color: var(--text-2); border-color: var(--border-h); }
.cd-diary-toggle.is-on {
  background: var(--cd-accent-dim); border-color: var(--cd-accent-bdr); color: var(--cd-accent);
}

/* ── Diary (Letterboxd-style) ───────────────────────────────────────────── */
.cd-diary-list {
  display: flex; flex-direction: column;
  flex: 1; min-height: 0;
  padding: 12px 16px 40px;
  overflow-y: auto;
  scrollbar-width: none;
}
.cd-diary-list::-webkit-scrollbar { display: none; }

/* Filter toolbar */
.cd-diary-toolbar {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 6px 0 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.cd-diary-select {
  padding: 5px 28px 5px 10px;
  font-size: 11px; font-weight: 600; color: var(--text-2);
  background: var(--bg-3) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='none' stroke='%239aa0ae' stroke-width='1.6' d='M1 1l4 4 4-4'/></svg>") no-repeat right 10px center;
  border: 1px solid var(--border); border-radius: 99px;
  cursor: pointer; font-family: inherit;
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
}
.cd-diary-select:hover { border-color: var(--border-h); color: var(--text); }
.cd-diary-reset {
  padding: 5px 12px; font-size: 11px; font-weight: 600;
  background: transparent; border: 1px solid var(--border); border-radius: 99px;
  color: var(--text-3); cursor: pointer; font-family: inherit;
  transition: border-color 0.15s, color 0.15s;
}
.cd-diary-reset:hover { color: var(--cd-accent); border-color: var(--cd-accent-bdr); }

/* 9-column grid for the table — header and rows share the same template */
.cd-diary-head,
.cd-diary-row {
  display: grid;
  grid-template-columns: 52px 30px 40px minmax(0, 1fr) 50px 72px 28px 22px 28px;
  align-items: center; gap: 10px;
}
.cd-diary-head {
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
  color: var(--text-3); text-transform: uppercase;
  padding: 10px 4px; border-bottom: 1px solid var(--border);
}
.cd-diary-head > div { text-align: center; }
.cd-diary-head > div:nth-child(4) { text-align: left; }
.cd-diary-head > div:nth-child(5) { text-align: right; }

.cd-diary-row {
  padding: 10px 4px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.15s;
}
.cd-diary-row:hover { background: rgba(255,255,255,0.03); }

.cd-diary-cal { display: flex; align-items: center; justify-content: center; min-height: 54px; }
.cd-diary-cal-card {
  width: 46px; height: 52px; border-radius: 8px;
  background: var(--bg-3); border: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.cd-diary-cal-card::before,
.cd-diary-cal-card::after {
  content: ''; position: absolute; top: -3px;
  width: 4px; height: 7px; border-radius: 2px;
  background: var(--text-3); opacity: 0.55;
}
.cd-diary-cal-card::before { left: 10px; }
.cd-diary-cal-card::after  { right: 10px; }
.cd-diary-cal-month {
  font-size: 10px; font-weight: 800; letter-spacing: 0.1em;
  color: var(--cd-accent); line-height: 1; padding-top: 6px;
}
.cd-diary-cal-year { font-size: 9px; color: var(--text-3); font-weight: 600; margin-top: 2px; }

.cd-diary-day {
  font-size: 20px; font-weight: 700; color: var(--text-3);
  text-align: center; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.cd-diary-poster {
  width: 40px; height: 60px; border-radius: 5px;
  object-fit: cover; background: var(--bg-3);
  box-shadow: 0 2px 6px -2px rgba(0,0,0,0.5);
  justify-self: center;
}
.cd-diary-poster-empty { background: var(--bg-3); }

.cd-diary-title {
  font-size: 14px; font-weight: 700; color: var(--text);
  min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cd-diary-released {
  font-size: 12px; color: var(--text-3); text-align: right;
  font-variant-numeric: tabular-nums;
}
.cd-diary-rating { text-align: center; }
.cd-diary-stars { display: inline-flex; gap: 1px; }

.cd-diary-liked,
.cd-diary-review-cell,
.cd-diary-edit {
  display: flex; align-items: center; justify-content: center; gap: 3px;
  color: var(--text-3); position: relative;
}
.cd-diary-edit-btn, .cd-diary-date-btn {
  width: 26px; height: 26px; border-radius: 6px;
  background: transparent; border: 1px solid transparent;
  color: var(--text-3); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.cd-diary-edit-btn:hover, .cd-diary-date-btn:hover,
.cd-diary-date-btn.is-open {
  color: var(--cd-accent); border-color: var(--cd-accent-bdr);
  background: var(--cd-accent-dim);
}
.cd-diary-date-picker {
  position: absolute; right: 0; top: 100%; z-index: 200;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; min-width: 180px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  display: flex; flex-direction: column; gap: 8px;
}
.cd-diary-dp-label {
  font-size: 10px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.cd-diary-dp-input {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 8px; color: var(--text-1);
  font-size: 12px; width: 100%; outline: none;
  color-scheme: dark;
}
.cd-diary-dp-input:focus { border-color: var(--cd-accent-bdr); }
.cd-diary-dp-actions { display: flex; gap: 6px; }
.cd-diary-dp-save {
  flex: 1; padding: 5px 0; border-radius: 6px; border: none; cursor: pointer;
  background: var(--cd-accent); color: #fff; font-size: 11px; font-weight: 600;
}
.cd-diary-dp-cancel {
  flex: 1; padding: 5px 0; border-radius: 6px; cursor: pointer;
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text-2); font-size: 11px;
}

/* ── Pro loyalty badge — 8 tier ──────────────────────────────────────────── */
.badge-pro {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.3px;
  padding: 4px 9px;
  border-radius: 20px;
  text-transform: uppercase;
  line-height: 1;
  vertical-align: middle;
  white-space: nowrap;
}
.badge-pro svg { flex-shrink: 0; }

/* Info (i) button sitting next to a Pro badge — opens the tier ladder modal. */
.badge-info-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; margin-left: 4px;
  padding: 0; border-radius: 50%;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-3); cursor: pointer; font-family: inherit;
  vertical-align: middle;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.badge-info-btn:hover {
  color: var(--text); border-color: var(--cd-accent);
  background: var(--glass-h);
}
.badge-info-btn svg { display: block; }

/* Tier ladder modal opened by the (i) button. */
.badge-info-modal {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
}
.badge-info-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.65); backdrop-filter: blur(4px);
  animation: cd-fade-in 0.2s ease;
}
.badge-info-box {
  position: relative; z-index: 1;
  width: min(440px, 92vw); max-height: 82vh;
  display: flex; flex-direction: column; gap: 12px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 18px; padding: 20px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.7);
  animation: cd-pop-in 0.22s ease;
  overflow-y: auto;
}
.badge-info-box h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--text); }
.badge-info-intro { margin: 0; font-size: 12px; color: var(--text-2); line-height: 1.5; }
.badge-info-close {
  position: absolute; top: 14px; right: 14px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text-2); cursor: pointer; font-size: 14px; line-height: 1;
  font-family: inherit;
}
.badge-info-close:hover { color: var(--text); background: var(--glass-h); }
.badge-info-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.badge-info-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; border-radius: 10px;
  background: var(--bg-3); border: 1px solid var(--border);
}
.badge-info-range { font-size: 11px; color: var(--text-2); letter-spacing: 0.5px; }

/* Founder badge — overrides any Pro tier badge when the profile owner has
   is_founder=true. Icon-only on purpose: the absence of a label is part of
   the meaning. color: #ff3545 tints the SVG via fill=currentColor. */
.badge-founder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 20px;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
  color: #ff3545;
  box-shadow:
    inset 0 0 0 1px rgba(229, 9, 20, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(229, 9, 20, 0.25),
    0 0 10px rgba(229, 9, 20, 0.3);
  line-height: 1;
  vertical-align: middle;
}
.badge-founder svg { display: block; }

/* Shared metallic finish for gold + emerald tiers */
.badge-pro-metal {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.35),
    inset 0 -1px 0 rgba(0,0,0,0.22);
}

/* Purple · novice */
.badge-pro-t1 { background: linear-gradient(135deg,#6d28d9 0%,#8b5cf6 55%,#a855f7 100%); color:#fff; }
.badge-pro-t2 { background: linear-gradient(135deg,#5b21b6 0%,#9333ea 50%,#c026d3 100%); color:#fff; }
.badge-pro-t3 { background: linear-gradient(135deg,#a21caf 0%,#d946ef 50%,#ec4899 100%); color:#fff; }

/* Gold · veteran */
.badge-pro-t4 { background: linear-gradient(135deg,#b45309 0%,#fbbf24 50%,#eab308 100%); color:#3a2408; }
.badge-pro-t5 { background: linear-gradient(135deg,#d97706 0%,#fbbf24 40%,#f472b6 100%); color:#3a1a2a; }
.badge-pro-t6 { background: linear-gradient(135deg,#7c2d12 0%,#ea580c 50%,#fbbf24 100%); color:#2a1206; }

/* Legend · elite */
.badge-pro-t7 { background: linear-gradient(135deg,#064e3b 0%,#10b981 50%,#6ee7b7 100%); color:#042c1e; }
.badge-pro-t8 {
  background: linear-gradient(120deg,#06b6d4 0%,#8b5cf6 30%,#ec4899 60%,#fbbf24 100%);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.45),
    inset 0 -1px 0 rgba(0,0,0,0.25),
    0 0 0 1px rgba(236,72,153,0.3);
}

/* ── First-login onboarding ──────────────────────────────────────────────────
   Reuses the Edit Profile modal (.onboarding) but focuses it on the username
   (+ optional avatar): hide bio, social links and the close button, and the
   backdrop can't dismiss it (closeEditModal no-ops in onboarding mode). */
.cd-edit-modal.onboarding .cd-edit-close,
.cd-edit-modal.onboarding .cd-edit-bio,
.cd-edit-modal.onboarding .cd-edit-social { display: none !important; }
