:root {
  color-scheme: dark;
  --bg: #0e0e0e;
  --panel: rgba(17, 20, 30, 0.66);
  --panel-strong: rgba(18, 22, 33, 0.92);
  --border: rgba(255, 255, 255, 0.09);
  --text: #fafbff;
  --muted: #b7bdca;
  --accent: #ff8f73;
  --accent-strong: #ff6f42;
  --warning: #ffd27f;
  --danger: #ff8f93;
  --shadow: 0 32px 100px rgba(0, 0, 0, 0.42);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }

body {
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
}

button, input, a { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

/* ── Background layers ── */

.bg {
  position: fixed; inset: 0; z-index: 0;
  background: url("https://lh3.googleusercontent.com/aida-public/AB6AXuAbeQC3UGXvWQ0uJNwHNU8eIc5MvfKsqPAEAKU3D-t3y-a8G37AXO0k1HVcRL3ARUwsQCL0lxkdqtVjukcFN3UEP0nf0N_r2MlzFTU0DIv_HfElAX3YHnv76iuzyRH9xxhULcBiByPMbmI7TSf2v-wW4W7HlG3cZhwULsJkhbkVBpBDPBP-wYE941wq3xCo-keFJhOzf_bs_SdreFxvAlpNnJHNJrgTCqWNZK_Lh7juOtUHdccC5A5MqrWWj6x6yjRKHw_gltnLF8vM") center/cover;
}

.bg-backdrop {
  position: fixed; inset: 0; z-index: 0;
  background-size: cover; background-position: center;
  opacity: 0;
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.bg-backdrop.visible { opacity: 0.6; }

.bg-overlay {
  position: fixed; inset: 0; z-index: 0;
  background: linear-gradient(to top, #0e0e0e, transparent 50%, rgba(14,14,14,0.85));
  opacity: 0.9;
  pointer-events: none;
}

/* ── App shell ── */

.app-shell {
  position: relative;
  min-height: 100vh;
  z-index: 1;
}

/* ── Topbar ── */

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 20px 28px;
  pointer-events: none;
}

.brand, .hero-panel h2 {
  font-family: "Space Grotesk", Inter, sans-serif;
  letter-spacing: -0.04em;
}

.brand-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  justify-self: start;
  text-align: left;
  pointer-events: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.brand-logo {
  height: clamp(2.2rem, 4vw, 3rem);
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.brand { margin: 0; font-size: clamp(1.9rem, 3.8vw, 2.9rem); }
.brand-ai { color: #4EA8FF; }

.topbar-actions {
  pointer-events: auto;
  display: flex;
  gap: 12px;
}

.topbar-icon-btn {
  position: relative;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  display: grid; place-items: center;
  color: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  transition: color 300ms ease, background 300ms ease;
}

.topbar-icon-btn:hover {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.1);
}

/* ── Canvas ── */

.tree-stage {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  isolation: isolate;
}

#tree-canvas {
  position: absolute; inset: 0;
  z-index: 1;
  display: block;
}

/* ── Hero / search ── */

.hero-panel {
  position: absolute;
  z-index: 10;
  top: 38%; left: 50%;
  width: min(680px, calc(100vw - 40px));
  transform: translate(-50%, -50%);
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
  transition: opacity 800ms cubic-bezier(0.16, 1, 0.3, 1), transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-panel.fade-out {
  opacity: 0;
  transform: translate(-50%, -50%) translateY(-30px);
  pointer-events: none;
}

.hero-panel h2 {
  margin: 0 0 28px;
  font-size: clamp(2.8rem, 8vw, 5.8rem);
  line-height: 0.94;
  transition: opacity 400ms ease, transform 400ms ease;
}

.hero-panel.has-results h2 {
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
}

.poster-row {
  display: flex; justify-content: center; gap: 20px;
  margin-bottom: 18px;
}

.poster-row.exact-match {
  width: auto;
  max-width: calc(100vw - 40px);
}

.poster-row.hidden { display: none; }

.poster-card {
  width: 150px;
  border: 0; padding: 0;
  background: transparent;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  animation: posterCardIn 500ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 400ms ease;
}

.poster-card:nth-child(1) { animation-delay: 0ms; }
.poster-card:nth-child(2) { animation-delay: 80ms; }
.poster-card:nth-child(3) { animation-delay: 160ms; }
.poster-card:nth-child(4) { animation-delay: 240ms; }

@keyframes posterCardIn {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.poster-card:hover {
  transform: translateY(-6px) scale(1.05);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), 0 0 24px rgba(255, 143, 115, 0.18);
}

.poster-media-wrap {
  position: relative;
  display: block;
  border-radius: 18px;
  overflow: hidden;
}

.poster-card .poster-media-wrap .poster-main-img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  display: block;
}

.poster-placeholder-tall {
  aspect-ratio: 2/3;
  background: #222;
  border-radius: 16px;
}

.poster-provider-corner-img {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 8px;
  pointer-events: none;
}

.exact-match-poster .poster-media-wrap .poster-main-img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  display: block;
}

.exact-match-row {
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: flex-start;
  justify-content: center;
  margin: 0 auto;
  gap: 20px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 24px;
  background: transparent;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  animation: posterCardIn 500ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 400ms ease, border-color 300ms ease;
}

.exact-match-row,
.exact-match-row * {
  cursor: pointer;
}

.exact-match-row:hover,
.exact-match-row:focus-visible {
  cursor: pointer;
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), 0 0 24px rgba(255, 143, 115, 0.18);
  outline: none;
}

.exact-match-poster {
  width: 164px;
  border-radius: 18px;
  overflow: hidden;
}

.exact-match-meta {
  flex: 1 1 auto;
  max-width: 360px;
  padding-top: 6px;
  text-align: left;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.48);
}

.exact-match-meta-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.92rem;
  line-height: 1.3;
}

.exact-match-meta-line-stack {
  align-items: flex-start;
}

.exact-match-bullet {
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.2;
}

.exact-match-label {
  color: rgba(255, 255, 255, 0.96);
  font-weight: 700;
}

.exact-match-value {
  color: rgba(255, 255, 255, 0.92);
}

.exact-match-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.exact-match-sublist {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 14px;
}

.exact-match-subitem {
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.9rem;
  line-height: 1.25;
}

.search-input {
  width: 100%;
  padding: 18px 24px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(20px);
  outline: none;
  font-size: 1rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.search-input-wrap {
  width: 100%;
  position: relative;
}

.search-input-wrap.has-cta .search-input {
  padding-right: 210px;
}

.watchtree-cta {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  height: calc(100% - 12px);
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 200ms ease, border-color 200ms ease;
}

.watchtree-cta:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
}

.search-input::placeholder { color: rgba(255, 255, 255, 0.55); }

.search-input:focus {
  border-color: rgba(255, 143, 115, 0.5);
  box-shadow: 0 0 0 4px rgba(255, 143, 115, 0.12);
}

/* ── Speed buttons (trending titles) ─────────────────────────────── */

.speed-buttons-row {
  width: 90%;
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 400ms ease, transform 400ms ease;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0 2px;
}

.speed-buttons-row.overflows {
  justify-content: flex-start;
  cursor: grab;
}

.speed-buttons-row.overflows.dragging {
  cursor: grabbing;
}

.speed-buttons-row::-webkit-scrollbar {
  display: none;
}

.speed-buttons-row.loaded {
  opacity: 1;
  transform: translateY(0);
}

.hero-panel.has-results .speed-buttons-row,
.hero-panel.fade-out .speed-buttons-row {
  opacity: 0;
  pointer-events: none;
}

.speed-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  color: rgba(255, 255, 255, 0.9);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background 200ms ease, border-color 200ms ease, color 200ms ease, transform 120ms ease, box-shadow 200ms ease;
}

.speed-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 143, 115, 0.45);
  box-shadow: 0 0 8px rgba(255, 143, 115, 0.2);
  color: #fff;
}

.speed-btn:active {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 143, 115, 0.6);
  transform: scale(0.95);
}

.speed-btn-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.speed-btn-icon svg {
  width: 14px;
  height: 14px;
}

.speed-btn-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── End speed buttons ───────────────────────────────────────────── */

.search-subtitle {
  margin: 12px 0 0;
  color: #292b23;
  font-size: 1.25rem;
  font-family: "Space Grotesk", Inter, sans-serif;
  line-height: 1.4;
}

.powered-by-fixed {
  position: fixed;
  bottom: 16px;
  right: 20px;
  z-index: 5;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  pointer-events: auto;
  cursor: pointer;
  transition: opacity 0.3s ease;
  user-select: none;
}

.powered-by-brand { display: inline-flex; align-items: center; gap: 4px; }
.search-powered-by-icon { width: 20px; height: 20px; display: block; object-fit: contain; }

/* ── Status banner ── */

.message-row {
  margin-top: 14px; padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  width: 100%;
}

.message-row.error { color: var(--danger); }
.message-row.warning { color: var(--warning); }

/* ── Branch loading status ── */

.branch-loading-layer {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
}

.branch-loading-indicator {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  transform: translate(-50%, 0);
  color: #ffffff;
  white-space: nowrap;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

.branch-loading-sparkle {
  width: 24px;
  height: 24px;
  color: #ffffff;
  display: block;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.35));
  animation: branchSparklePulse 1400ms ease-in-out infinite;
}

.branch-loading-text {
  font-size: 19.5px;
  line-height: 30px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.7);
}

@keyframes branchSparklePulse {
  0%, 100% {
    opacity: 0.72;
    transform: scale(0.92);
  }
  50% {
    opacity: 1;
    transform: scale(1.18);
  }
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .branch-loading-text {
    color: transparent;
    -webkit-text-fill-color: transparent;
    background: linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.42) 0%,
      rgba(255, 255, 255, 0.95) 50%,
      rgba(255, 255, 255, 0.42) 100%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    animation: branchStatusShimmer 1400ms linear infinite;
  }
}

@keyframes branchStatusShimmer {
  0% {
    background-position: -100% 0;
  }
  100% {
    background-position: 100% 0;
  }
}

/* ── Help card (interaction hints) ── */

.help-card {
  position: absolute;
  z-index: 12;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  width: min(300px, calc(100vw - 40px));
  padding: 22px 22px 18px;
  border-radius: 20px;
  background: rgba(14, 14, 14, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(24px);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.82rem;
  line-height: 1.4;
  pointer-events: auto;
  opacity: 1;
  transition: opacity 500ms ease, transform 500ms ease;
}

.help-card.fade-out {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.95);
}

.help-card-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease;
}

.help-card-close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.help-card-header {
  margin: 0 0 14px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  letter-spacing: -0.01em;
}

.help-card-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.help-card-item + .help-card-item {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.help-card-action {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.84rem;
}

.help-card-desc {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.78rem;
}

/* ── Provider dock ── */

.provider-dock {
  position: absolute; z-index: 8;
  left: 50%; bottom: 26px;
  transform: translateX(-50%);
  display: grid; justify-items: center; gap: 6px;
}

.provider-filter-toggle {
  display: none;
  border: 0;
  color: inherit;
}

.provider-pills {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 999px;
  background: rgba(38, 38, 38, 0.58);
  border: 1px solid var(--border);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(22px);
}

.provider-pill {
  width: 58px; height: 58px; padding: 0;
  border-radius: 999px;
  border: 1.5px solid var(--provider-border, rgba(255, 255, 255, 0.14));
  background: var(--provider-surface, var(--provider-bg, #000000));
  display: grid; place-items: center;
  box-shadow: var(--provider-shadow, none);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.provider-pill.active {
  border-color: #ff8f73;
  box-shadow: none;
}

.provider-pill:not(.active) { opacity: 0.25; filter: grayscale(80%); }
.provider-pill:hover { transform: translateY(-1px); }
.provider-logo { width: 34px; height: 34px; object-fit: contain; display: block; }

.provider-pill[data-provider-id="hulu"] { overflow: hidden; }
.provider-pill[data-provider-id="hulu"] .provider-logo { width: 100%; height: 100%; object-fit: cover; }
.provider-pill[data-provider-id="disney"] { overflow: hidden; }
.provider-pill[data-provider-id="disney"] .provider-logo { width: 90%; height: 90%; object-fit: contain; }
.provider-pill[data-provider-id="peacock"] { overflow: hidden; background: #000000; }
.provider-pill[data-provider-id="peacock"] .provider-logo { width: 95%; height: 95%; object-fit: contain; }

.provider-label {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.provider-filter-hint {
  margin: 0; font-size: 0.62rem; line-height: 1;
  letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.46); text-align: center;
}

/* ── Detail panel ── */

.detail-panel {
  position: fixed;
  z-index: 10;
  left: 2rem;
  right: 2rem;
  top: calc(var(--poster-bottom, 60%) + 2rem);
  bottom: 3rem;
  background: rgba(14, 14, 14, 0.92);
  backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  color: #fff;
  font-family: 'Inter', 'Manrope', system-ui, sans-serif;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.97);
  transition:
    opacity 350ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 350ms cubic-bezier(0.16, 1, 0.3, 1);
}

.detail-panel.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.root-article-panel {
  position: fixed;
  z-index: 11;
  left: var(--root-article-left, calc(50vw + 180px));
  right: 2rem;
  top: var(--root-article-top, 160px);
  height: var(--root-article-height, 360px);
  padding: 28px 32px 32px;
  background: #faf9f7;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  color: #1a1a1a;
  box-sizing: border-box;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
  opacity: 0;
  pointer-events: none;
  transform: translateX(12px) scale(0.97);
  transition:
    opacity 300ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.06),
    0 12px 40px rgba(0, 0, 0, 0.12);
}

.root-article-panel.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) scale(1);
}

.root-article-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: transparent;
  color: rgba(0, 0, 0, 0.4);
  font-size: 16px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color 150ms ease;
}

.root-article-close:hover {
  color: #1a1a1a;
}

.root-article-kicker {
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e0ddd8;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #888;
}

.root-article-title {
  margin: 0;
  padding-right: 34px;
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  font-weight: 700;
  line-height: 1.15;
  color: #121212;
  letter-spacing: -0.01em;
}

.root-article-subtitle {
  margin: 14px 0 0;
  font-family: 'Lora', Georgia, serif;
  font-style: italic;
  color: #555;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.4;
}

.root-article-body {
  margin: 20px 0 0;
  font-family: 'Lora', Georgia, serif;
  color: #333;
  font-size: 1.02rem;
  line-height: 1.78;
  letter-spacing: 0.005em;
}

.root-article-body p {
  margin: 0;
}

.root-article-body p + p {
  margin-top: 1em;
}

.root-article-title:empty,
.root-article-subtitle:empty,
.root-article-body:empty {
  display: none;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
  padding: 20px;
  height: 100%;
  overflow: hidden;
}

.detail-left-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}

.detail-right-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}

.detail-close {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.5);
  color: rgba(255, 255, 255, 0.8);
  font-size: 18px; line-height: 1;
  display: grid; place-items: center;
  z-index: 4;
  backdrop-filter: blur(8px);
  transition: background 200ms ease, color 200ms ease;
}

.detail-close:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }

/* ── Hero media (trailer / poster) ── */

.detail-media-wrap {
  position: relative;
  width: 100%;
  flex-shrink: 0;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
  border-radius: 12px;
}

.detail-media-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }
.detail-media-wrap .detail-hero-main {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-hero-provider-badge {
  position: absolute;
  bottom: 10px;
  right: 12px;
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 10px;
  z-index: 3;
  pointer-events: none;
}

.detail-rating {
  position: absolute; bottom: 10px; left: 12px;
  background: #ff8f73; color: #1e0904;
  font-weight: 700; font-size: 11px;
  padding: 4px 10px; border-radius: 999px;
  z-index: 4;
}

/* ── Body (legacy, replaced by detail-grid columns) ── */

/* ── Meta bar ── */

.detail-meta-bar {
  display: flex; gap: 6px;
  align-items: center; flex-wrap: wrap;
}

.detail-meta-item {
  font-size: 11px; font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
}

.detail-meta-sep {
  font-size: 11px; color: rgba(255, 255, 255, 0.2);
  padding: 0 2px;
}

.detail-meta-bar:empty { display: none; }

/* ── Genres ── */

.detail-genres { display: flex; gap: 8px; flex-wrap: wrap; }

.detail-genre {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em;
  color: #ff8f73; border: 1px solid rgba(255,143,115,0.3);
  padding: 3px 10px; border-radius: 999px; font-weight: 600;
}

/* ── Title / tagline ── */

.detail-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 26px; font-weight: 700; margin: 0; line-height: 1.1;
}

.detail-tagline {
  font-size: 12px; font-style: italic;
  color: rgba(255, 255, 255, 0.4);
  margin: -4px 0 0; line-height: 1.4;
}

.detail-tagline:empty { display: none; }

/* ── Reason ── */

.detail-reason {
  font-size: 13px; font-weight: 600;
  color: rgba(109, 216, 139, 0.85);
  margin: -2px 0 0; line-height: 1.4;
}

/* ── Overview ── */

.detail-overview {
  font-size: 13px; line-height: 1.55; color: rgba(255,255,255,0.65);
  margin: 0;
}

.detail-overview p { margin: 0; }
.detail-overview p + p { margin-top: 0.75em; }

.detail-overview:empty { display: none; }

/* ── External links ── */

.detail-links {
  display: flex; gap: 10px; flex-wrap: wrap;
}

.detail-links:empty { display: none; }

.detail-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600;
  padding: 6px 14px; border-radius: 8px;
  text-decoration: none;
  transition: background 200ms ease, border-color 200ms ease;
}

.detail-link-rt {
  color: rgba(250, 80, 30, 1);
  background: rgba(250, 50, 10, 0.12);
  border: 1px solid rgba(250, 50, 10, 0.4);
}

.detail-link-rt:hover {
  background: rgba(250, 50, 10, 0.22);
  border-color: rgba(250, 50, 10, 0.6);
}

.detail-link-reddit {
  color: rgba(255, 69, 0, 1);
  background: rgba(255, 69, 0, 0.12);
  border: 1px solid rgba(255, 69, 0, 0.4);
}

.detail-link-reddit:hover {
  background: rgba(255, 69, 0, 0.22);
  border-color: rgba(255, 69, 0, 0.6);
}

/* ── Providers ── */

.detail-providers-row {
  display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap;
}

.detail-providers { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.detail-providers-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em;
  font-weight: 700; color: rgba(255,255,255,0.45); width: 100%;
}

.detail-provider-icon {
  width: 32px; height: 32px; border-radius: 8px;
  object-fit: cover; border: 1px solid rgba(255,255,255,0.06);
}

.detail-buy-providers:empty { display: none; }

.detail-buy-providers {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}

/* ── Cast ── */

.detail-cast-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em;
  font-weight: 700; color: rgba(255,255,255,0.45); margin: 0;
}

.detail-cast {
  display: flex; gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}

.detail-cast-item {
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  flex-shrink: 0; width: 64px;
  text-align: center;
}

.detail-cast-item.shimmer {
  width: 64px; height: 88px;
  border-radius: 10px;
  background: linear-gradient(110deg, rgba(255,255,255,0.04) 40%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

.detail-cast-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  overflow: hidden;
  background: rgba(255,143,115,0.1); border: 1.5px solid rgba(255,255,255,0.08);
  display: grid; place-items: center; flex-shrink: 0;
}

.detail-cast-photo { width: 100%; height: 100%; object-fit: cover; display: block; }

.detail-cast-initials {
  font-size: 12px; font-weight: 700; color: rgba(255,143,115,0.7);
}

.detail-cast-name {
  font-size: 10px; font-weight: 600; color: rgba(255,255,255,0.8);
  display: block; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; max-width: 64px;
}

.detail-cast-role {
  font-size: 9px; color: rgba(255,255,255,0.38);
  display: block; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; max-width: 64px;
}

/* ── Section label (shared) ── */

.detail-section-label {
  font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.14em; font-weight: 700;
  color: rgba(255,255,255,0.45); margin: 0 0 4px;
}

/* ── Keywords ── */

.detail-keywords-section { display: flex; flex-direction: column; gap: 6px; }

.detail-keywords { display: flex; gap: 6px; flex-wrap: wrap; }

.detail-keyword {
  font-size: 10px;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
}

/* ── TV info bar ── */

.detail-tv-info {
  display: flex; gap: 8px; flex-wrap: wrap;
  align-items: center; padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.detail-tv-item {
  font-size: 11px; color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
}

.detail-tv-item + .detail-tv-item::before {
  content: '\00b7'; padding-right: 8px;
  color: rgba(255, 255, 255, 0.2);
}

/* ── Error modal ── */

.error-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
}

.error-modal-overlay.hidden { display: none; }

.error-modal {
  position: relative;
  width: min(380px, calc(100vw - 40px));
  padding: 36px 28px 28px;
  border-radius: 24px;
  background: rgba(14, 14, 14, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  color: #fff;
  font-family: 'Inter', system-ui, sans-serif;
  animation: posterCardIn 400ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.error-modal-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px; line-height: 1;
  cursor: pointer;
}

.error-modal-close:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

.error-modal-face {
  font-size: 3rem;
  margin-bottom: 12px;
}

.error-modal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.2;
}

.error-modal-subtitle {
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0 20px;
  line-height: 1.4;
}

.error-modal-btn {
  padding: 10px 28px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 200ms ease;
}

.error-modal-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ── Promo modal ── */

.promo-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
  opacity: 1;
  transition: opacity 300ms ease;
}

.promo-modal-overlay.hidden {
  display: none;
}

.promo-modal {
  position: relative;
  width: min(420px, calc(100vw - 40px));
  padding: 40px 32px 36px;
  border-radius: 28px;
  background: rgba(14, 14, 14, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  color: #fff;
  font-family: 'Inter', system-ui, sans-serif;
  animation: posterCardIn 400ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.promo-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.promo-modal-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.promo-modal-icon {
  width: auto;
  max-width: 220px;
  height: auto;
  margin-bottom: 20px;
}

.promo-modal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 10px;
  line-height: 1.2;
}

.promo-modal-subtitle {
  font-size: 0.94rem;
  color: rgba(255, 255, 255, 0.65);
  margin: 0 0 24px;
  line-height: 1.45;
}

.promo-modal-app-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}

.promo-inline-icon {
  width: 88px;
  height: 88px;
  border-radius: 20px;
}

.promo-mc-name {
  color: #b22222;
  font-weight: 700;
}

.promo-modal-badges {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.promo-badge img {
  height: 44px;
  display: block;
}

.promo-badge-btn {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ── Share menu ── */

.share-btn-wrap {
  position: relative;
}

.share-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(22, 22, 28, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  z-index: 70;
}

.share-menu.hidden {
  display: none;
}

.share-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.88rem;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  transition: background 150ms ease;
}

.share-menu-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.share-menu-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

/* ── Toast ── */

.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  z-index: 200;
  padding: 10px 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 1;
  transition: opacity 300ms ease;
}

.toast.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ── History badge ── */

.history-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #1a0a06;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
}

/* ── History drawer ── */

.history-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  opacity: 1;
  transition: opacity 300ms ease;
}

.history-drawer-overlay.hidden {
  display: none;
}

.history-drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: min(400px, 90vw);
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.history-drawer.open {
  transform: translateX(0);
}

.history-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.history-drawer-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0;
}

.history-drawer-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
}

.history-drawer-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.history-drawer-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.history-empty {
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
  padding: 40px 16px;
  line-height: 1.5;
}

.history-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 14px;
  cursor: pointer;
  transition: background 200ms ease;
}

.history-card:hover {
  background: rgba(255, 255, 255, 0.06);
}

.history-card + .history-card {
  margin-top: 4px;
}

.history-card-poster {
  width: 48px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
}

.history-card-poster .history-card-poster-wrap {
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

.history-card-poster .history-card-poster-wrap .history-card-poster-main {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.history-card-poster .history-poster-provider-img {
  width: 22px;
  height: 22px;
  bottom: 3px;
  right: 3px;
  border-radius: 5px;
}

.history-card-poster-placeholder {
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.06);
}

.history-card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.history-card-title {
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-card-meta {
  font-size: 0.78rem;
  color: var(--muted);
}

.history-card-delete {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.3);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: color 200ms ease, background 200ms ease, border-color 200ms ease;
}

.history-card-delete:hover {
  color: var(--danger);
  background: rgba(255, 143, 147, 0.1);
  border-color: rgba(255, 143, 147, 0.2);
}

.history-drawer-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: center;
}

.history-drawer-clear {
  padding: 8px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.82rem;
  font-weight: 600;
  transition: background 200ms ease, color 200ms ease;
}

.history-drawer-clear:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* ── Constrained page-view ── */

.constrained-page-view {
  position: fixed;
  inset: 0;
  z-index: 80;
  background:
    linear-gradient(to top, rgba(8, 8, 8, 0.95), rgba(8, 8, 8, 0.75) 50%, rgba(8, 8, 8, 0.92)),
    url("https://lh3.googleusercontent.com/aida-public/AB6AXuAbeQC3UGXvWQ0uJNwHNU8eIc5MvfKsqPAEAKU3D-t3y-a8G37AXO0k1HVcRL3ARUwsQCL0lxkdqtVjukcFN3UEP0nf0N_r2MlzFTU0DIv_HfElAX3YHnv76iuzyRH9xxhULcBiByPMbmI7TSf2v-wW4W7HlG3cZhwULsJkhbkVBpBDPBP-wYE941wq3xCo-keFJhOzf_bs_SdreFxvAlpNnJHNJrgTCqWNZK_Lh7juOtUHdccC5A5MqrWWj6x6yjRKHw_gltnLF8vM") center/cover;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 380ms cubic-bezier(0.16, 1, 0.3, 1), visibility 0ms 380ms;
}

.constrained-page-view.visible {
  transform: translateX(0);
  visibility: visible;
  transition: transform 380ms cubic-bezier(0.16, 1, 0.3, 1), visibility 0ms;
}

.constrained-page-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(14, 14, 14, 0.94);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.constrained-back-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  display: grid; place-items: center;
  color: rgba(255, 255, 255, 0.7);
  flex-shrink: 0;
  transition: color 200ms ease, background 200ms ease;
}

.constrained-back-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.constrained-page-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.constrained-page-content {
  flex: 1;
  padding: 20px 16px 48px;
}

.cpv-hero { border-radius: 16px; overflow: hidden; margin-bottom: 16px; }
.cpv-hero img { width: 100%; display: block; object-fit: cover; }
.cpv-meta { font-size: 0.82rem; color: var(--muted); margin-bottom: 10px; }
.cpv-genres { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }

.cpv-genre {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--accent); border: 1px solid rgba(255, 143, 115, 0.3);
  padding: 3px 10px; border-radius: 999px; font-weight: 600;
}

.cpv-editorial {
  margin-bottom: 18px; padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
}

.cpv-editorial-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem; font-weight: 700; margin: 0 0 8px; line-height: 1.2;
}

.cpv-editorial-body {
  font-size: 0.92rem; line-height: 1.6;
  color: rgba(255, 255, 255, 0.7); margin: 0;
}

.cpv-overview {
  font-size: 0.92rem; line-height: 1.6;
  color: rgba(255, 255, 255, 0.65); margin: 0 0 16px;
}

.cpv-providers { margin-bottom: 16px; }

.cpv-providers-label {
  display: block; font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.14em; font-weight: 700;
  color: rgba(255, 255, 255, 0.45); margin-bottom: 8px;
}

.cpv-provider-row { display: flex; gap: 8px; flex-wrap: wrap; }

.cpv-provider-icon {
  width: 36px; height: 36px; border-radius: 8px;
  object-fit: cover; border: 1px solid rgba(255, 255, 255, 0.06);
}

.cpv-cast-section { margin-bottom: 16px; }

.cpv-cast-label {
  display: block; font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.14em; font-weight: 700;
  color: rgba(255, 255, 255, 0.45); margin-bottom: 8px;
}

.cpv-cast { display: flex; gap: 8px; flex-wrap: wrap; }

.cpv-cast-name {
  font-size: 0.82rem; font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 5px 12px; border-radius: 999px;
}

.cpv-grow-btn {
  display: block;
  width: 100%;
  margin-top: 24px;
  padding: 14px 20px;
  border: 1px solid rgba(255, 143, 115, 0.4);
  border-radius: 14px;
  background: rgba(255, 143, 115, 0.12);
  color: var(--accent);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease;
}

.cpv-grow-btn:hover {
  background: rgba(255, 143, 115, 0.22);
  border-color: rgba(255, 143, 115, 0.6);
}

/* ── Responsive ── */

@media (max-width: 720px) {
  body { overflow: auto; }
  .app-shell { min-height: 100vh; min-height: 100dvh; }
  .tree-stage { min-height: 100vh; min-height: 100dvh; }
  .topbar { padding: 10px 14px 0; grid-template-columns: 1fr auto; align-items: start; }
  .topbar-actions { flex-direction: column; gap: 8px; }
  .topbar-icon-btn { width: 36px; height: 36px; }
  .brand { font-size: 1.6rem; }
  .brand-logo { height: 1.8rem; }
  .hero-panel { top: 42%; width: calc(100vw - 24px); }
  .app-shell.has-tree .hero-panel { top: 72px; width: calc(100vw - 24px); }
  .hero-panel h2 { font-size: clamp(2.2rem, 10vw, 3.2rem); margin-bottom: 18px; }
  .poster-card { width: 90px; }
  .poster-row { gap: 12px; }
  .exact-match-row {
    padding: 10px;
    gap: 0;
  }
  .exact-match-meta { display: none; }
  .exact-match-poster { width: 100px; }
  .bg-overlay {
    opacity: 0.5;
  }
  .exact-match-meta { max-width: min(92vw, 460px); }
  .search-row { grid-template-columns: 1fr; }
  .search-powered-by { justify-content: center; padding-right: 0; }
  .powered-by-fixed {
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    font-size: 0.68rem;
    right: 8px;
    bottom: 10px;
  }
  .powered-by-brand { display: inline-flex; align-items: center; gap: 2px; }
  .powered-by-fixed .search-powered-by-icon { width: 18px; height: 18px; }
  .branch-loading-indicator { transform: translate(-50%, 0) scale(0.75); }
  .branch-loading-sparkle { width: 18px; height: 18px; }
  .branch-loading-text { font-size: 13px; line-height: 20px; }
  .provider-dock {
    width: min(calc(100vw - 12px), 420px);
    bottom: 6rem;
    min-height: 78px;
    gap: 0;
    transition:
      width 260ms cubic-bezier(0.16, 1, 0.3, 1),
      opacity 600ms ease;
  }
  .provider-filter-toggle {
    position: absolute;
    left: 50%;
    top: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 58px;
    padding: 0 18px;
    border-radius: 999px;
    background: rgba(38, 38, 38, 0.58);
    border: 1px solid var(--border);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(22px);
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) scale(1);
    transition:
      opacity 180ms ease,
      transform 260ms cubic-bezier(0.16, 1, 0.3, 1),
      background 180ms ease;
  }
  .provider-filter-toggle-text {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: rgba(255, 255, 255, 0.9);
  }
  .provider-filter-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.84);
    font-size: 1rem;
    line-height: 1;
  }
  .provider-dock:not(.is-expanded) {
    width: min(240px, calc(100vw - 44px));
  }
  .provider-dock:not(.is-expanded) .provider-filter-toggle {
    opacity: 1;
    pointer-events: auto;
  }
  .provider-dock:not(.is-expanded) .provider-pills,
  .provider-dock:not(.is-expanded) .provider-filter-hint {
    opacity: 0;
    pointer-events: none;
  }
  .provider-dock:not(.is-expanded) .provider-filter-hint {
    max-height: 0;
  }
  .provider-dock:not(.is-expanded) .provider-pills {
    transform: translateX(-50%) scaleX(0.78);
  }
  .provider-dock.is-expanded .provider-filter-toggle {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) scale(0.96);
  }
  .provider-pills {
    position: absolute;
    left: 50%;
    top: 0;
    width: 100%;
    min-height: 58px;
    gap: 6px;
    justify-content: center;
    padding: 8px;
    flex-wrap: nowrap;
    transform: translateX(-50%) scaleX(1);
    transition:
      opacity 180ms ease,
      transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
  }
  .provider-pill { width: 42px; height: 42px; }
  .provider-logo { width: 26px; height: 26px; }
  .provider-filter-hint {
    position: absolute;
    top: 64px;
    left: 50%;
    width: max-content;
    max-height: 20px;
    overflow: hidden;
    transform: translateX(-50%);
    transition:
      opacity 180ms ease,
      max-height 180ms ease;
  }
  .detail-panel {
    left: 1rem;
    right: 1rem;
    top: auto;
    bottom: 1rem;
    max-height: 70vh;
  }
  .detail-grid {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .root-article-panel {
    left: 20px !important;
    right: 20px;
    top: auto;
    height: auto;
    max-height: min(46vh, 360px);
  }
  .history-drawer {
    width: 100vw;
  }
  .help-card {
    width: min(280px, calc(100vw - 32px));
    padding: 18px 18px 14px;
  }
}
