﻿/* FocusTube AI — Premium dark mode styles */

* { box-sizing: border-box; }

:root {
  /* ===== Color palette (dark, premium) ===== */
  --bg: #06060a;
  --bg-deep: #04040a;
  --surface: #0c0c12;
  --surface-2: #14141c;
  --card: rgba(255,255,255,0.04);
  --card-hover: rgba(255,255,255,0.07);
  --text: #f4f4f6;
  --text-muted: #9b9bab;
  --text-faint: #5e5e72;
  --red: #ef4444;
  --purple: #a855f7;
  --purple-hover: #9333ea;
  --purple-glow: rgba(168,85,247,0.35);
  --violet: #a78bfa;
  --blue: #60a5fa;
  --pink: #ec4899;
  --amber: #f59e0b;
  --green: #22c55e;
  --cyan: #22d3ee;
  --border: rgba(255,255,255,0.06);
  --border-strong: rgba(255,255,255,0.12);
  --border-hover: rgba(255,255,255,0.1);

  /* ===== Radii ===== */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* ===== Shadows ===== */
  --shadow-1: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-2: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-3: 0 12px 40px rgba(0,0,0,0.5);
  --shadow-card: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-glow: 0 8px 40px rgba(168,85,247,0.35);
  --shadow-glow-strong: 0 0 60px rgba(168,85,247,0.5);
  --shadow-glow-pink: 0 0 40px rgba(236,72,153,0.3);

  /* ===== Glass surfaces ===== */
  --glass-bg: rgba(12,12,18,0.6);
  --glass-border: rgba(255,255,255,0.08);

  /* ===== Easing & transitions ===== */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-fast: 150ms var(--ease-out);
  --transition: 250ms var(--ease-out);
  --transition-slow: 400ms var(--ease-out);

  /* ===== Gradients (premium) ===== */
  --grad-primary: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
  --grad-accent: linear-gradient(135deg, #ec4899 0%, #a855f7 50%, #f59e0b 100%);
  --grad-glow: radial-gradient(circle at 50% 0%, rgba(168,85,247,0.25), transparent 60%);
  --grad-mesh-1: radial-gradient(ellipse at top left, rgba(168,85,247,0.15), transparent 50%);
  --grad-mesh-2: radial-gradient(ellipse at top right, rgba(99,102,241,0.12), transparent 50%);
  --grad-mesh-3: radial-gradient(ellipse at bottom, rgba(236,72,153,0.08), transparent 50%);
}

/* Universal glass utility */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
}
.gradient-text {
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.gradient-border {
  position: relative;
  background: var(--surface);
  border: 1px solid transparent;
  background-clip: padding-box;
}
.gradient-border::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--grad-primary);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.4;
  transition: opacity var(--transition);
}
.gradient-border:hover::before { opacity: 1; }

/* Smooth focus ring */
:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Note: @media (prefers-reduced-motion: reduce) is consolidated at the bottom of the file
   (around line 5949) along with reveal/cursor-trail/etc. specifics. */

/* About and onboarding force dark variables regardless of the app's theme */
#about-view,
#onboarding-view {
  --bg: #06060a;
  --surface: #0c0c12;
  --card: rgba(255,255,255,0.04);
  --card-hover: rgba(255,255,255,0.07);
  --text: #e0e0e8;
  --text-muted: #8b8b9e;
  --border: rgba(255,255,255,0.06);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  height: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}
*, *::before, *::after {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.hidden { display: none !important; }

button { font-family: inherit; cursor: pointer; }

/* ============ Landing ============ */
.landing {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, #1c1c22 0%, #0f0f0f 70%);
  padding: 24px;
}

/* Reusable logo lockup (nav-small, hero-large, footer-small) */
.landing-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
  font-size: 1.15rem;
}
.landing-logo.logo-sm { font-size: 1.15rem; gap: 0.4rem; }
.landing-logo.logo-lg { font-size: clamp(1.9rem, 4.5vw, 2.5rem); gap: 0.6rem; }

.logo-play {
  color: var(--red);
  line-height: 1;
  filter: drop-shadow(0 0 10px rgba(255, 0, 0, 0.55));
  display: inline-flex;
  align-items: center;
}
.logo-play svg {
  display: block;
  width: 1em;
  height: 1em;
}
.logo-text { color: var(--text); }
.logo-accent {
  background: linear-gradient(135deg, #6366f1, #a855f7, #06b6d4);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 5s ease-in-out infinite;
}

.landing-copy {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

/* .btn-primary, .btn-secondary, .btn-ghost are defined later in the file
   (around line 5806) as the canonical premium buttons. The #landing-view /
   #about-view selectors later override them for the marketing pages. */

.btn-lg { padding: 1rem 2rem; font-size: 1.05rem; }

.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ---- Watch Together Room Bar (inline below video) ---- */
.room-bar {
  margin-top: 10px;
  padding: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  animation: roomBarIn 0.3s ease;
}
.room-bar.hidden { display: none; }
@keyframes roomBarIn {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 60px; }
}
.room-bar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(124,58,237,0.1);
  border: 1px solid rgba(124,58,237,0.25);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}
.room-bar-icon { font-size: 18px; }
.room-bar-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.room-bar-code {
  font-family: 'Courier New', monospace;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--violet);
}
.room-bar-status-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.room-bar-status-dot.dot-green { background: #34d399; box-shadow: 0 0 6px rgba(52,211,153,0.5); }
.room-bar-status-dot.dot-yellow { background: #fbbf24; box-shadow: 0 0 6px rgba(251,191,36,0.5); }
.room-bar-status-dot.dot-red { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,0.5); }
.room-bar-status-text { font-size: 13px; color: var(--text-muted); }
.room-bar-members { font-size: 13px; color: var(--text); margin-left: auto; }

/* Status row */
.room-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.room-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.room-status-dot.dot-green { background: #34d399; box-shadow: 0 0 8px rgba(52,211,153,0.6); }
.room-status-dot.dot-yellow { background: #fbbf24; box-shadow: 0 0 8px rgba(251,191,36,0.5); }
.room-status-dot.dot-red { background: #ef4444; box-shadow: 0 0 8px rgba(239,68,68,0.5); }
.room-status-text { font-size: 14px; color: var(--text-muted); flex: 1; }
.room-members { font-size: 14px; color: var(--text); }
.room-hint {
  font-size: 13px;
  color: var(--text-faint);
  padding: 8px 12px;
  background: rgba(124,58,237,0.08);
  border-radius: var(--radius-sm);
}
.room-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* .btn-secondary and .btn-ghost are defined later (around line 5828/5848) as
   the canonical premium button styles. The earlier definitions were overridden. */

/* ============ App shell ============ */
.app-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 30;
  max-width: 100vw;
  overflow: hidden;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}
.icon-btn:hover { background: var(--card); color: var(--text); }

.brand { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 18px; white-space: nowrap; }
.brand-play {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-play svg {
  display: block;
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 0 6px rgba(255, 0, 0, 0.45));
}
.brand-text { color: var(--text); }
.brand::after {
  content: "AI";
  background: linear-gradient(135deg, var(--purple), #3b82f6);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 6px;
  margin-left: 4px;
  vertical-align: middle;
}

.search-form {
  flex: 1;
  display: flex;
  min-width: 0;
  max-width: 640px;
  margin: 0 auto;
}

.search-form input {
  flex: 1;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px 0 0 999px;
  padding: 9px 16px;
  color: var(--text);
  outline: none;
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.search-form input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 2px rgba(124,58,237,0.15);
}

.search-submit {
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 999px 999px 0;
  background: var(--card);
  transition: background 0.2s ease, border-color 0.2s ease;
}
.search-submit:hover { background: var(--card-hover); border-color: var(--purple); }

.chip-btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}
.chip-btn:hover { background: var(--card-hover); border-color: var(--purple); color: var(--text); }

.avatar-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), #3b82f6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 0 12px rgba(124,58,237,0.2);
}

.sidebar {
  position: fixed;
  top: 56px;
  left: 0;
  bottom: 0;
  width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 16px 10px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.sidebar-item {
  background: transparent;
  border: none;
  color: var(--text-muted);
  text-align: left;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: all 0.2s ease;
}
.sidebar-item:hover { background: var(--card); color: var(--text); }
.sidebar-item.active {
  background: linear-gradient(135deg, rgba(124,58,237,0.12), rgba(124,58,237,0.05));
  color: var(--violet);
  font-weight: 600;
  border: 1px solid rgba(124,58,237,0.15);
}

.sidebar-action {
  font-size: 12px !important;
  padding: 6px 14px !important;
  color: var(--text-faint) !important;
  opacity: 0.7;
}
.sidebar-action:hover {
  opacity: 1;
  color: var(--text-muted) !important;
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 10px;
}

.file-label {
  position: relative;
  cursor: pointer;
}
.file-label input[type="file"] {
  position: absolute;
  left: 0; top: 0; width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* ============ 80/20 layout ============ */
.layout {
  display: flex;
  flex: 1;
  min-height: 0;
}

.main-panel {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  padding: 20px;
  overflow-y: auto;
}

.ai-panel {
  flex: 0 0 360px;
  min-width: 280px;
  max-width: 480px;
  border-left: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 57px);
  position: sticky;
  top: 57px;
  transition: flex-basis 0.2s ease;
}

/* Resize handle between main panel and AI panel */
.panel-resize-handle {
  width: 6px;
  cursor: col-resize;
  background: transparent;
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  transition: background 0.15s ease;
}
.panel-resize-handle:hover,
.panel-resize-handle.active {
  background: var(--purple);
}
.panel-resize-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 32px;
  border-radius: 2px;
  background: var(--border);
  transition: background 0.15s ease;
}
.panel-resize-handle:hover::after,
.panel-resize-handle.active::after {
  background: #fff;
}


/* Mobile: AI panel + layout (combined breakpoints) */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .main-panel { width: 100%; flex: none; padding: 16px; }
  .panel-resize-handle { display: none !important; }

  .ai-panel.mobile-chat-open {
    display: flex !important;
    flex-direction: column !important;
    position: fixed !important;
    top: auto !important;
    bottom: 90px !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    height: 65vh !important;
    max-height: 65vh !important;
    max-width: none !important;
    min-width: 0 !important;
    z-index: 300;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
    background: var(--surface);
  }
  .ai-panel.mobile-chat-open .ai-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
    border-radius: 16px 16px 0 0;
  }
  .ai-panel.mobile-chat-open #ai-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
    padding: 10px 14px;
  }
  .ai-panel.mobile-chat-open .ai-form {
    flex-shrink: 0;
    padding: 8px 12px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding-bottom: max(8px, env(safe-area-inset-bottom, 8px));
    border-radius: 0 0 16px 16px;
  }
  .ai-panel:not(.mobile-chat-open) { display: none !important; }

  /* Bubble shows on mobile when in a room (handled by body.wt-room-active .mobile-chat-btn above) */
  .mobile-chat-btn { z-index: 301; }
  .mobile-chat-btn:hover { transform: scale(1.08); }

  /* Hide the X close button — the floating toggle button is used to close */
  .ai-panel.mobile-chat-open .ai-header .mobile-close-btn {
    display: none !important;
  }
  .ai-header .mobile-close-btn {
    display: none;
  }
  /* Backdrop for mobile chat overlay */
  body.mobile-chat-active::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 299;
    pointer-events: auto;
  }
}
@media (min-width: 901px) {
  .mobile-chat-btn { display: none !important; }
  /* On desktop, AI panel is always visible — never hide it as a mobile overlay */
  .ai-panel.mobile-chat-open { display: flex !important; }
  .mobile-close-btn { display: none !important; }
}

@media (max-width: 1100px) {
  .main-panel { padding: 16px; }
}

/* =========================================================
   MOBILE RESPONSIVE — comprehensive, YouTube-like sizing
   ========================================================= */

/* Tablet: 768px–900px */
@media (max-width: 900px) and (min-width: 769px) {
  .app-header { padding: 12px 18px; gap: 14px; min-height: 60px; }
  .search-form input { padding: 12px 18px; font-size: 16px; border-radius: 24px 0 0 24px; }
  .chip-btn { padding: 8px 14px; font-size: 13px; }
  .icon-btn { padding: 6px 8px; font-size: 18px; }
  .avatar-circle { width: 34px; height: 34px; font-size: 13px; }
  .main-panel { padding: 16px; }
  .video-grid { gap: 14px; }
  .card-title { font-size: 14px; }
  
  .sidebar { width: 240px; z-index: 40; }
}

/* Phone: ≤768px — streamlined header */
@media (max-width: 768px) {
  .app-header {
    padding: 10px 12px;
    gap: 8px;
    min-height: 52px;
  }
  .brand-text { font-size: 16px; }
  .brand::after { font-size: 10px; padding: 1px 5px; }
  .brand-play svg { width: 22px; height: 22px; }
  .search-form { max-width: 100%; }
  .search-form input { padding: 8px 12px; font-size: 16px; border-radius: 20px 0 0 20px; }
  .search-submit { padding: 8px 10px; font-size: 15px; }
  .chip-btn { padding: 6px 10px; font-size: 12px; }
  .icon-btn { padding: 10px 12px; font-size: 22px; }
  #hamburger-btn { padding: 10px 14px; font-size: 24px; min-width: 48px; min-height: 48px; }
  .avatar-circle { width: 30px; height: 30px; font-size: 12px; }
  /* Hide less important buttons on mobile */
  #reload-btn { display: none; }
  #bell-btn { display: none; }
  #history-btn { display: none; }
  .main-panel { padding: 12px; }
  .video-grid { gap: 12px; }
  .card-title { font-size: 14px; }
  .card-body { padding: 10px 12px 14px; gap: 8px; }
  .avatar-mini { width: 28px; height: 28px; font-size: 10px; }
  .video-meta h1 { font-size: 18px; }
  .channel-avatar { width: 36px; height: 36px; }
  .channel-name { font-size: 14px; }
  
  .ai-header { padding: 10px 14px; gap: 8px; }
  .ai-title { font-size: 14px; }
  .ai-dot { width: 8px; height: 8px; }
  .points-badge { font-size: 12px; padding: 4px 12px; }
  #clear-chat-btn { font-size: 12px; padding: 4px 10px; }
  .ai-messages { padding: 20px 14px 12px; gap: 10px; }
  .msg { font-size: 14px; padding: 10px 14px; }
  .ai-form { padding: 10px 14px; gap: 8px; }
  .ai-form input { font-size: 16px; padding: 10px 14px; height: 40px; }
  .ai-form .btn-primary { font-size: 14px; padding: 10px 18px; height: 40px; }
  .overlay-card { padding: 24px; }
  #data-overlay .overlay-card { padding: 24px; }
  .onboarding-inner h1 { font-size: 26px; }
  .onboarding-inner > p { font-size: 15px; margin-bottom: 24px; }
  .onboarding-card { padding: 14px; }
  .onboarding-card h3 { font-size: 14px; }
  .onboarding-card p { font-size: 13px; }
  .settings-card { padding: 24px; }
  .history-card { padding: 24px; }
  .overlay-title { font-size: 17px; }
  .panel-header h2 { font-size: 17px; }
  .continue-title { font-size: 15px; }
  .continue-clear-all { font-size: 11px; padding: 4px 10px; }
  .watch-grid { gap: 14px; }
  .brand-play { display: flex; }

  /* New features responsive */
  .focus-timer { padding: 6px 10px; gap: 8px; }
  .focus-timer-countdown { font-size: 17px; }
  .notes-panel { padding: 10px; }
  .notes-list { max-height: 180px; }
  .skill-header h1 { font-size: 20px; }
  .skill-gap-name { min-width: 100px; font-size: 12px; }
  .blindspot-question { font-size: 14px; }
  .challenge-card { padding: 10px; }
  .challenges-header h1 { font-size: 18px; }

  /* Sidebar: slide-in overlay on mobile */
  .sidebar {
    width: 280px;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.4);
  }
  .sidebar:not(.hidden) {
    transform: translateX(0);
  }
  /* Sidebar backdrop */
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 49;
  }
  .sidebar:not(.hidden) + .sidebar-backdrop,
  .sidebar-backdrop:not(.hidden) {
    display: block !important;
  }

  /* AI panel: full-screen overlay on mobile (not a side panel) */
  .ai-panel:not(.mobile-chat-open) { display: none !important; }
  .ai-panel.mobile-chat-open {
    display: flex !important;
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    z-index: 500 !important;
    border-radius: 0 !important;
    flex-direction: column;
  }
  .ai-panel.mobile-chat-open .ai-header {
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
    flex-shrink: 0;
  }
  .ai-panel.mobile-chat-open .ai-messages { flex: 1 1 auto; overflow-y: auto; }
  .ai-panel.mobile-chat-open .ai-form {
    flex-shrink: 0;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }

  /* Touch targets ≥ 44px on mobile */
  .sidebar-item { min-height: 48px; }
  .chip { min-height: 36px; }
  .video-card-actions button { min-width: 44px; min-height: 44px; }

  /* Category chips: wrap to a second line on mobile so they're not all squashed
     and 13 of them fit comfortably.  */
  .chips {
    flex-wrap: wrap !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
    height: auto !important;
    padding-bottom: 8px;
  }

  /* Watch together room on mobile */
  .room-content { flex-direction: column !important; }
  .room-player { width: 100% !important; max-width: 100% !important; padding: 12px !important; gap: 12px; }
  .room-player #room-yt-player { min-height: 220px; aspect-ratio: 16/9; border-radius: 8px; }
  .room-sidebar { width: 100% !important; border-left: none; border-top: 1px solid var(--border); max-height: 50vh; }
  .room-members { padding: 12px !important; }
  .room-chat { padding: 12px !important; }
  .room-chat-input { width: 100% !important; min-height: 48px !important; }
  .room-host-controls { padding: 12px !important; }
  .room-video-input-row { flex-wrap: wrap; }
  .room-video-input-row input { min-height: 48px; flex: 1 1 100% !important; }
  .room-video-input-row button { min-height: 44px; }
  .room-header { padding: 8px 12px !important; gap: 8px !important; }
  .room-header .room-id { font-size: 13px !important; }
  .room-header .room-id .room-id-code { font-size: 12px; padding: 2px 6px; }

  /* Room recommendations on mobile: horizontal scroll */
  .room-rec-grid {
    grid-template-columns: none !important;
    display: flex !important;
    overflow-x: auto !important;
    gap: 12px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
  }
  .room-rec-card {
    flex: 0 0 70%;
    scroll-snap-align: start;
  }
}

/* Small phone: ≤500px — hide brand, bigger search */
@media (max-width: 500px) {
  .app-header { padding: 8px 10px; gap: 6px; min-height: 48px; }
  .brand-text { display: none; }
  .brand-play svg { width: 20px; height: 20px; }
  .search-form input { padding: 8px 10px; font-size: 16px; border-radius: 18px 0 0 18px; }
  .search-submit { padding: 8px 8px; font-size: 14px; }
  .icon-btn { padding: 8px 10px; font-size: 20px; }
  #hamburger-btn { padding: 10px 14px; font-size: 24px; }
  .avatar-circle { width: 26px; height: 26px; font-size: 10px; }
  .main-panel { padding: 10px; }
  .video-grid { gap: 10px; }
  .card-title { font-size: 13px; }
  .card-body { padding: 8px 10px 12px; gap: 6px; }
  .avatar-mini { width: 24px; height: 24px; font-size: 9px; }
  .video-meta h1 { font-size: 16px; }
  .channel-avatar { width: 32px; height: 32px; }
  
  .ai-header { padding: 8px 12px; gap: 6px; }
  .ai-title { font-size: 13px; }
  .ai-dot { width: 7px; height: 7px; }
  .points-badge { font-size: 11px; padding: 3px 10px; }
  #clear-chat-btn { font-size: 11px; padding: 3px 8px; }
  .ai-messages { padding: 10px 12px; gap: 8px; }
  .msg { font-size: 13px; padding: 8px 12px; }
  .ai-form { padding: 8px 12px; gap: 6px; }
  .ai-form input { font-size: 16px; padding: 8px 12px; height: 36px; }
  .ai-form .btn-primary { font-size: 13px; padding: 8px 16px; height: 36px; }
  .overlay-card { padding: 20px 18px; }
  .onboarding-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .onboarding-grid-compact { grid-template-columns: 1fr 1fr; gap: 8px; max-height: 260px; }
  .onboarding-inner h1 { font-size: 22px; }
  .onboarding-inner > p { font-size: 14px; margin-bottom: 18px; }
  .onboarding-card { padding: 12px; }
  .onboarding-card h3 { font-size: 13px; }
  .onboarding-card p { font-size: 12px; }
  .settings-card { padding: 20px 18px; width: 96%; }
  .history-card { padding: 20px 18px; width: 96%; }
  #data-overlay .overlay-card { padding: 20px 18px; max-width: 96%; }
  .overlay-title { font-size: 15px; }
  .panel-header h2 { font-size: 16px; }
  .continue-title { font-size: 14px; }
  .continue-clear-all { font-size: 10px; padding: 3px 8px; }
  .brand-play { display: none; }
}

/* Extra-small phone: ≤360px — minimum viable */
@media (max-width: 360px) {
  .app-header { padding: 8px 10px; gap: 8px; min-height: 48px; }
  .search-form input { padding: 8px 12px; font-size: 16px; border-radius: 24px 0 0 24px; }
  .chip-btn { padding: 7px 12px; font-size: 12px; }
  .icon-btn { padding: 4px 5px; font-size: 14px; }
  .avatar-circle { width: 26px; height: 26px; font-size: 10px; }
  .main-panel { padding: 8px; }
  .video-grid { gap: 8px; }
  .card-title { font-size: 12px; }
  .card-body { padding: 6px 8px 10px; gap: 5px; }
  .avatar-mini { width: 20px; height: 20px; font-size: 8px; }
  .video-meta h1 { font-size: 14px; }
  .channel-avatar { width: 28px; height: 28px; }
  
  .ai-header { padding: 6px 10px; gap: 4px; }
  .ai-title { font-size: 12px; }
  .ai-dot { width: 6px; height: 6px; }
  .points-badge { font-size: 10px; padding: 2px 8px; }
  #clear-chat-btn { font-size: 10px; padding: 2px 6px; }
  .ai-messages { padding: 8px 10px; gap: 6px; }
  .msg { font-size: 12px; padding: 6px 10px; }
  .ai-form { padding: 6px 10px; gap: 5px; }
  .ai-form input { font-size: 16px; padding: 6px 10px; height: 32px; }
  .ai-form .btn-primary { font-size: 12px; padding: 6px 14px; height: 32px; }
  .overlay-card { padding: 16px 14px; border-radius: 12px; }
  .onboarding-grid { grid-template-columns: 1fr; gap: 6px; }
  .onboarding-grid-compact { grid-template-columns: 1fr; gap: 6px; }
  .onboarding-inner h1 { font-size: 18px; }
  .onboarding-inner > p { font-size: 12px; margin-bottom: 14px; }
  .onboarding-card { padding: 10px; }
  .onboarding-card h3 { font-size: 12px; }
  .onboarding-card p { font-size: 11px; }
  .overlay-title { font-size: 14px; }
  .panel-header h2 { font-size: 15px; }
  .channel-header { flex-direction: column; text-align: center; gap: 8px; padding: 16px 0; }
  .channel-header-avatar { width: 60px; height: 60px; font-size: 22px; }
  .channel-header-name { font-size: 18px; }
  .focus-timer { flex-wrap: wrap; padding: 6px 8px; }
  .focus-timer-countdown { font-size: 15px; }
  .focus-timer-btn { font-size: 10px !important; padding: 3px 8px !important; }
  .notes-panel { padding: 8px; }
  .notes-list { max-height: 150px; }
  .notes-item { font-size: 12px; padding: 4px 6px; }
  .skill-grid { grid-template-columns: 1fr; gap: 10px; }
  .skill-card { padding: 12px; }
  .heatmap-month-row { padding-left: 25px; }
  .heatmap-grid { grid-template-columns: 25px repeat(12, 9px); grid-template-rows: repeat(7, 9px); gap: 1px; }
  .heatmap-cell { width: 9px; height: 9px; }
  .heatmap-month-label { width: 9px; font-size: 7px; }
}

/* Category chips: bigger touch targets on mobile */
@media (max-width: 768px) {
  .chips { gap: 8px; padding-bottom: 6px; }
  .chip { padding: 8px 16px; font-size: 13px; }
  .chip-dynamic { font-size: 12px; padding: 7px 13px; }
}
@media (max-width: 500px) {
  .chips { gap: 6px; padding-bottom: 4px; }
  .chip { padding: 7px 14px; font-size: 12px; }
  .chip-dynamic { font-size: 11px; padding: 6px 12px; }
}

/* ============ Category chips + grid ============ */
.chips-wrapper {
  margin-bottom: 12px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 0;
}

.chip {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.chip:hover {
  background: var(--card-hover);
  color: var(--text);
  border-color: rgba(124,58,237,0.3);
}
.chip.active {
  background: linear-gradient(135deg, var(--purple), #6d28d9);
  color: #fff;
  border-color: var(--purple);
  box-shadow: 0 2px 12px rgba(124,58,237,0.3);
}

/* Subtle separator between core and dynamic (learned) category chips */
.chip-sep {
  display: inline-flex;
  align-items: center;
  color: var(--text-faint, var(--text-muted));
  padding: 0 4px;
  font-size: 12px;
  user-select: none;
  cursor: default;
}

/* Dynamic (learned) categories — smaller, subtler */
.chip-dynamic {
  font-size: 11.5px;
  padding: 5px 11px;
  border-color: rgba(6, 182, 212, 0.2);
  color: rgba(6, 182, 212, 0.7);
}
.chip-dynamic:hover {
  border-color: rgba(6, 182, 212, 0.5);
  color: #06b6d4;
  background: rgba(6, 182, 212, 0.05);
}
.chip-dynamic.active {
  background: rgba(6, 182, 212, 0.15);
  color: #06b6d4;
  border-color: rgba(6, 182, 212, 0.4);
}

/* Separator between core and dynamic categories */
.chip-separator {
  display: inline-block;
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 4px;
  flex-shrink: 0;
  opacity: 0.4;
}

.results-summary {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 12px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

/* Sentinel element for infinite scroll — invisible trigger at the bottom of the grid */
.grid-sentinel {
  height: 1px;
  width: 100%;
  pointer-events: none;
}

/* Large screens: cap at 4 columns, wider cards */
@media (min-width: 1600px) {
  .video-grid {
    grid-template-columns: repeat(4, 1fr);
    max-width: 1400px;
  }
}
/* Medium-large: 3 columns */
@media (min-width: 1200px) and (max-width: 1599px) {
  .video-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
/* Tablet-ish: 2 columns */
@media (min-width: 700px) and (max-width: 1199px) {
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
}
/* Small tablets / large phones: 2 columns, slightly smaller cards */
@media (min-width: 500px) and (max-width: 699px) {
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}
/* Phones: 1 column, wider since it's full width */
@media (max-width: 499px) {
  .video-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

.video-card {
  background: var(--card);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all 0.25s ease;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.video-card:hover {
  transform: translateY(-4px);
  border-color: rgba(124,58,237,0.3);
  box-shadow: 0 8px 32px -8px rgba(124,58,237,0.25), 0 4px 16px rgba(0,0,0,0.3);
  background: var(--card-hover);
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 0;
}
.thumb { overflow: hidden; }
.thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.3s ease;
}
.video-card:hover .thumb img {
  transform: scale(1.06);
}
.thumb .duration-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0,0,0,0.8);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}
.thumb .category-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: linear-gradient(135deg, rgba(124,58,237,0.9), rgba(124,58,237,0.7));
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}

.card-body {
  padding: 12px 14px 16px;
  display: flex;
  gap: 10px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
}

.card-channel { font-size: 13px; color: var(--text-muted); cursor: pointer; }
.card-channel:hover { color: var(--text); }
.card-share-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 15px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
  align-self: flex-start;
  line-height: 1;
}
.card-share-btn:hover {
  background: var(--card);
  color: var(--text);
}

.avatar-mini {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

/* ============ Watch view ============ */
.back-btn { margin-bottom: 14px; }

.watch-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
}

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

.player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}
.player-wrap #yt-player { width: 100%; height: 100%; }

.player-error {
  position: absolute;
  inset: 0;
  background: rgba(15,15,15,0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 20px;
}
.player-error-reason {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  max-width: 300px;
  line-height: 1.5;
}
.player-error-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.time-readout {
  font-size: 12px;
  color: var(--text-muted);
  margin: 8px 2px;
}

.video-meta h1 { font-size: 20px; margin: 4px 0 10px; }

.video-category-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: linear-gradient(135deg, rgba(124,58,237,0.85), rgba(124,58,237,0.65));
  color: #fff;
  backdrop-filter: blur(4px);
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.video-category-badge.cat-1 {
  background: linear-gradient(135deg, rgba(59,130,246,0.85), rgba(59,130,246,0.65));
}
.video-category-badge.cat-2 {
  background: linear-gradient(135deg, rgba(16,185,129,0.85), rgba(16,185,129,0.65));
}
.video-category-badge.cat-3 {
  background: linear-gradient(135deg, rgba(239,68,68,0.85), rgba(239,68,68,0.65));
}
.video-category-badge.cat-4 {
  background: linear-gradient(135deg, rgba(245,158,11,0.85), rgba(245,158,11,0.65));
}
.video-category-badge.cat-5 {
  background: linear-gradient(135deg, rgba(34,211,238,0.85), rgba(34,211,238,0.65));
}
.video-category-badge.cat-6 {
  background: linear-gradient(135deg, rgba(168,85,247,0.85), rgba(168,85,247,0.65));
}
.video-category-badge.cat-7 {
  background: linear-gradient(135deg, rgba(124,58,237,0.85), rgba(124,58,237,0.65));
}

.video-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.channel-info { display: flex; align-items: center; gap: 10px; }
.channel-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.channel-name { font-weight: 600; font-size: 14px; }
.channel-subs { font-size: 12px; color: var(--text-muted); }

.btn-subscribe {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 600;
  font-size: 13px;
  margin-left: 8px;
}
.btn-subscribe.subscribed { background: var(--card); color: var(--text); border: 1px solid var(--border); }

.video-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.video-actions .btn-secondary.liked { background: linear-gradient(135deg, var(--purple), #6d28d9); border-color: var(--purple); color: #fff; }

.up-next h2 { font-size: 15px; margin: 0 0 12px; }
.up-next-list { display: flex; flex-direction: column; gap: 10px; }

.up-next-item {
  display: flex;
  gap: 10px;
  cursor: pointer;
  border-radius: 8px;
  padding: 6px;
  animation: upNextFadeIn 0.3s ease-out both;
}
.up-next-item:nth-child(2) { animation-delay: 0.05s; }
.up-next-item:nth-child(3) { animation-delay: 0.1s; }
.up-next-item:nth-child(4) { animation-delay: 0.15s; }
.up-next-item:nth-child(5) { animation-delay: 0.2s; }
.up-next-item:nth-child(6) { animation-delay: 0.25s; }
.up-next-item:nth-child(7) { animation-delay: 0.3s; }
.up-next-item:nth-child(8) { animation-delay: 0.35s; }
@keyframes upNextFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.up-next-item:hover {
  background: var(--card);
  border-left: 2px solid var(--purple);
  padding-left: 4px;
  border-radius: 0 8px 8px 0;
}
.up-next-item:hover .up-next-title {
  color: var(--purple);
}
.up-next-thumb {
  width: 120px;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}
.up-next-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.25s ease;
}
.up-next-item:hover .up-next-thumb img {
  transform: scale(1.05);
}
.up-next-title { font-size: 13px; font-weight: 600; line-height: 1.3; margin: 0 0 4px; }
.up-next-channel { font-size: 11px; color: var(--text-muted); }

/* ============ Channel view ============ */
.channel-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.channel-header-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
}
.channel-header-avatar img { width: 100%; height: 100%; object-fit: cover; }
.channel-header-info { display: flex; flex-direction: column; gap: 4px; }
.channel-header-name { font-size: 22px; margin: 0; }
.channel-header-subs { font-size: 13px; color: var(--text-muted); }
.channel-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 60px 20px;
  color: var(--text-muted);
}
.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Card fade-in animation for grid refresh */
@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes cardFadeOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-10px) scale(0.97); }
}
@keyframes chipSlideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

.video-card.animate-in {
  animation: cardFadeIn 0.4s ease both;
}
.video-card.animate-out {
  animation: cardFadeOut 0.25s ease both;
}
.chip.animate-in {
  animation: chipSlideIn 0.3s ease both;
}

.section-title { font-size: 16px; margin: 20px 0 12px; }
.youtube-results-section { margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--border); }

.up-next-title-row { display: flex; align-items: center; gap: 4px; }

/* --- Up-next autoplay countdown (YouTube-style) --- */
.up-next-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.up-next-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.up-next-shuffle-btn {
  font-size: 16px !important;
  padding: 4px 8px !important;
  transition: transform 0.3s ease !important;
  background: transparent !important;
  border: none !important;
  color: var(--text-muted) !important;
  cursor: pointer;
}
.up-next-shuffle-btn:hover {
  transform: rotate(180deg);
}
.up-next-shuffle-btn.spinning {
  animation: spin 0.6s linear infinite;
}
.up-next-header h2 { margin: 0; }
.autoplay-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}
.autoplay-label {
  font-size: 11px;
  color: var(--text-muted);
}
.autoplay-toggle input {
  display: none;
}
.autoplay-slider {
  width: 28px;
  height: 16px;
  background: var(--border);
  border-radius: 8px;
  position: relative;
  transition: background 0.2s;
}
.autoplay-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
.autoplay-toggle input:checked + .autoplay-slider {
  background: var(--purple);
}
.autoplay-toggle input:checked + .autoplay-slider::after {
  transform: translateX(12px);
}
.up-next-autoplay {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.up-next-autoplay-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.up-next-autoplay-label {
  font-weight: 700;
  color: var(--purple);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.up-next-autoplay-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  flex: 1;
}
.up-next-autoplay-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.up-next-autoplay-progress {
  height: 100%;
  width: 0%;
  background: var(--purple);
  border-radius: 2px;
  transition: width 0.1s linear;
}
.up-next-cancel-btn {
  font-size: 11px !important;
  padding: 2px 10px !important;
  align-self: flex-end;
  color: var(--text-muted) !important;
}

/* ============ YouTube badge ============ */
.youtube-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  background: #ff0000;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============ Search suggestions ============ */
.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0 0 12px 12px;
  max-height: 380px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.search-suggestion-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
}
.search-suggestion-item:hover { background: var(--bg); }
.search-suggestion-thumb {
  width: 60px;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}
.search-suggestion-thumb img { width: 100%; height: 100%; object-fit: cover; }
.search-suggestion-info { min-width: 0; }
.search-suggestion-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-suggestion-channel {
  font-size: 11px;
  color: var(--text-muted);
}
.search-form { position: relative; }

/* ============ FOCUS AI panel ============ */
.ai-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-title { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.ai-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 8px var(--purple);
}

.ai-mode {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  padding: 1px 7px;
  border-radius: 8px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin-left: 4px;
}

.points-badge {
  background: var(--purple);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
}
.points-badge .streak-indicator {
  margin-left: 8px;
  padding: 2px 6px;
  background: #ff6b35;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
}

.ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg { max-width: 90%; padding: 10px 13px; border-radius: 12px; font-size: 13.5px; line-height: 1.5; }
.msg p { margin: 0 0 6px; }
.msg p:last-child { margin-bottom: 0; }
.msg ul { margin: 4px 0; padding-left: 18px; }

.msg.user { align-self: flex-end; background: linear-gradient(135deg, var(--purple), #6d28d9); color: #fff; border-bottom-right-radius: 2px; box-shadow: 0 2px 8px rgba(124,58,237,0.2); }
.msg.assistant { align-self: flex-start; background: var(--card); border-bottom-left-radius: 2px; }
.msg.system-note { align-self: center; background: transparent; color: var(--text-muted); font-size: 12px; }

.msg.typing { align-self: flex-start; background: var(--card); display: flex; gap: 4px; padding: 12px 16px; }
.msg.typing span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted);
  animation: bounce 1.2s infinite ease-in-out;
}
.msg.typing span:nth-child(2) { animation-delay: 0.15s; }
.msg.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }

.msg.error-msg { align-self: flex-start; background: #3a1d1d; border: 1px solid #6b2b2b; color: #f0b0b0; }
.play-rec-btn {
  display: inline-block;
  margin: 4px 0;
  padding: 8px 16px 8px 12px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--purple), #7c3aed);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}
.play-rec-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.5);
}
.play-rec-btn:active { transform: scale(0.97); }
.retry-link { color: var(--purple); text-decoration: underline; background: none; border: none; padding: 0; font-size: 13px; cursor: pointer; }

.ai-form {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  align-items: center;
}
.ai-form input {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--text);
  outline: none;
  font-size: 13.5px;
  height: 36px;
  box-sizing: border-box;
}
.ai-form .btn-primary {
  padding: 8px 16px;
  font-size: 13px;
  height: 36px;
  box-sizing: border-box;
  line-height: 1;
  display: flex;
  align-items: center;
}
.ai-voice-btn {
  width: 36px !important;
  height: 36px !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border-radius: 50% !important;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.ai-voice-btn:hover {
  border-color: var(--purple) !important;
  color: var(--purple) !important;
  background: rgba(124,58,237,0.1) !important;
}
.ai-voice-btn.listening {
  border-color: var(--red) !important;
  color: #fff !important;
  background: var(--red) !important;
  animation: voicePulse 0.8s ease-in-out infinite;
}
@keyframes voicePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,0,0,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(255,0,0,0); }
}

/* ============ Checkpoint overlay ============ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  overflow-y: auto;
  padding: 16px;
}
.overlay-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 32px;
  text-align: center;
  max-width: 380px;
  width: 100%;
  margin: auto;
}
.overlay-title { font-size: 17px; font-weight: 600; margin: 0 0 14px; }
.overlay-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.overlay-followup { margin-top: 14px; color: var(--text-muted); font-size: 13px; }

/* ============ Filter label ============ */
.filter-label {
  font-size: 12px;
  color: var(--text-muted);
  margin: 8px 0 12px;
  padding: 4px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filter-label.hidden { display: none !important; }

/* ============ Toasts ============ */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.toast {
  background: var(--purple);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  animation: toast-in 0.2s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
/* ============ Landing + About page (ported design) ============ */
/* Ported from the React/Tailwind landing design into this project's plain-CSS
   architecture. Class names shared with the real app (.btn-primary, .btn-ghost,
   .chip) are overridden only within #landing-view / #about-view so the actual
   product (#app-view) is never reskinned. */

/* Scoped element resets (mirror the design's global h1-3 / p rules without
   touching #app-view) */
#landing-view h1, #landing-view h2, #landing-view h3,
#about-view h1, #about-view h2, #about-view h3 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
#landing-view p,
#about-view p {
  margin: 0;
  line-height: 1.65;
  color: var(--text-muted);
}

/* --- Collision scoping (see note above) --- */
#landing-view .btn-primary,
#about-view .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--purple), #8183f7);
  box-shadow: 0 6px 20px -6px rgba(99, 102, 241, 0.55);
}
#landing-view .btn-primary:hover,
#about-view .btn-primary:hover {
  background: linear-gradient(135deg, var(--purple), #9698ff);
  box-shadow: 0 10px 28px -6px rgba(99, 102, 241, 0.75);
}

#landing-view .btn-ghost,
#about-view .btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.65rem 1.3rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease, color 0.25s ease;
}
#landing-view .btn-ghost:hover,
#about-view .btn-ghost:hover {
  border-color: var(--purple);
  color: #fff;
  background: rgba(99, 102, 241, 0.1);
  transform: translateY(-2px);
}

#landing-view .chip,
#about-view .chip {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}
#landing-view .chip:hover,
#about-view .chip:hover {
  border-color: rgba(167, 139, 250, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px -8px rgba(167, 139, 250, 0.2);
}

/* ---------- nav-link ---------- */
.nav-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 0.25rem;
  transition: color 0.2s ease;
}
.nav-link:hover {
  color: var(--text);
}

/* ---------- shared layout ---------- */
.landing-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.landing-section {
  padding: 4.5rem 0;
  border-top: 1px solid var(--border);
  position: relative;
}

.landing-section:first-of-type {
  border-top: none;
}

.landing-section h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin-bottom: 1.5rem;
}

.section-lede {
  color: var(--text-muted);
  max-width: 700px;
  font-size: 1.05rem;
  margin-bottom: 1.75rem;
  transition: color 0.3s ease;
}
.landing-section:hover .section-lede {
  color: #c4b5fd;
}

/* Section CTA buttons row */
.section-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* --- Color accents for the landing page --- */

/* Gradient accent underline on section headings */
#landing-view .landing-section h2,
#about-view .landing-section h2 {
  position: relative;
  display: inline-block;
  margin-bottom: 1rem;
}
#landing-view .landing-section h2::after,
#about-view .landing-section h2::after {
  content: "";
  display: block;
  width: 50%;
  height: 3px;
  margin-top: 6px;
  background: linear-gradient(90deg, var(--purple), #a855f7, #06b6d4);
  border-radius: 4px;
  transition: width 0.4s ease;
}
#landing-view .landing-section:hover h2::after,
#about-view .landing-section:hover h2::after {
  width: 70%;
}

/* Gradient text accent on hero subtitle */
.hero-title-accent {
  background: linear-gradient(135deg, #a78bfa, #06b6d4, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Subtle border accent on hover for key sections */
.about-teaser:hover,
.privacy-block:hover,
.growing-block:hover {
  border-color: rgba(99, 102, 241, 0.3) !important;
  box-shadow: 0 16px 48px -24px rgba(99, 102, 241, 0.3), inset 0 0 60px -40px rgba(99, 102, 241, 0.08) !important;
}

/* FAQ active accent */
.faq-item:has(.faq-question[aria-expanded="true"]) {
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 4px 20px -12px rgba(99, 102, 241, 0.2);
}

/* Stats bar gradient accent */
.stat-number {
  background: linear-gradient(135deg, #6366f1, #a855f7, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
  animation: gradientShift 4s ease-in-out infinite;
}
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes heroShimmer {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* --- More color accents --- */

/* Colorful nav link hover */
#landing-view .nav-link:hover,
#about-view .nav-link:hover {
  color: #a78bfa;
  text-shadow: 0 0 20px rgba(167, 139, 250, 0.2);
}

/* Colored selection */
#landing-view ::selection,
#about-view ::selection {
  background: rgba(99, 102, 241, 0.3);
  color: #fff;
}

/* Landing page colored scrollbar */
#landing-view::-webkit-scrollbar,
#about-view::-webkit-scrollbar {
  width: 8px;
}
#landing-view::-webkit-scrollbar-track,
#about-view::-webkit-scrollbar-track {
  background: var(--bg);
}
#landing-view::-webkit-scrollbar-thumb,
#about-view::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #6366f1, #a855f7);
  border-radius: 4px;
}
#landing-view::-webkit-scrollbar-thumb:hover,
#about-view::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #818cf8, #c084fc);
}

/* Colorful step numbers */
.step-num {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #6366f1, #a855f7, #06b6d4);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 6s ease-in-out infinite;
}

/* Colorful comparison panel highlight */
.comparison-panel-highlight .comparison-label {
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: #fff;
  border: none;
}

/* Colorful feature list bullets */
.comparison-traits li::before {
  content: "✦";
  color: #a855f7;
  margin-right: 6px;
  font-size: 10px;
}
.comparison-panel-highlight .comparison-traits li::before {
  color: #34d399;
}

/* Colorful CTA section */
.landing-cta {
  background: radial-gradient(ellipse 60% 60% at 50% 50%, rgba(99, 102, 241, 0.04), transparent);
  border: 1px solid rgba(99, 102, 241, 0.1) !important;
  border-radius: 24px;
  padding: 3rem 2rem !important;
}

/* About hero gradient */
.about-hero {
  background: radial-gradient(ellipse 70% 50% at 30% 40%, rgba(99, 102, 241, 0.06), transparent 70%),
              radial-gradient(ellipse 50% 40% at 70% 60%, rgba(168, 85, 247, 0.04), transparent 60%);
}

/* Onboarding page gradient */
#onboarding-view {
  background: radial-gradient(ellipse 60% 50% at 50% 20%, rgba(99, 102, 241, 0.04), transparent 60%);
}

/* Colorful pillar cards */
.pillar-index {
  background: linear-gradient(135deg, #6366f1, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
  font-size: 1.2rem;
}

/* Primary button enhancement */
#landing-view .btn-primary,
#about-view .btn-primary {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #6366f1, #7c3aed, #6366f1);
  background-size: 200% 200%;
  animation: gradientShift 5s ease-in-out infinite;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#landing-view .btn-primary:hover,
#about-view .btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 30px -8px rgba(99, 102, 241, 0.5);
}

/* Ghost button hover enhancement */
#landing-view .btn-ghost:hover,
#about-view .btn-ghost:hover {
  border-color: #a78bfa;
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.08);
  box-shadow: 0 0 24px -8px rgba(167, 139, 250, 0.15);
}

/* Subtle gradient glow on the comet stage */
.comet-stage::after {
  content: "";
  position: absolute;
  bottom: -80px;
  left: 0;
  right: 0;
  height: 160px;
  background: linear-gradient(to top, rgba(99, 102, 241, 0.04), transparent);
  pointer-events: none;
}

/* More colorful comparison arrow */
.comparison-arrow {
  font-size: 2rem;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 16px rgba(168, 85, 247, 0.2));
}

/* Colorful footer accent */
.site-footer {
  border-top: 1px solid var(--border);
  position: relative;
}
.site-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--purple), #a855f7, #06b6d4, transparent);
  opacity: 0.4;
}

/* Colorful scroll cue */
.scroll-cue span {
  background: linear-gradient(135deg, #6366f1, #a855f7);
  border-radius: 4px;
  box-shadow: 0 0 16px -4px rgba(99, 102, 241, 0.3);
}

/* Checkbox-like chip selection accent */
.onboarding-card.selected {
  border-color: #7c3aed !important;
  box-shadow: 0 0 20px -8px rgba(124, 58, 237, 0.2), inset 0 0 20px -12px rgba(124, 58, 237, 0.1);
}

/* Subtle gradient background on about hero */
.about-hero {
  background: radial-gradient(ellipse 70% 50% at 30% 40%, rgba(99, 102, 241, 0.05), transparent 70%),
              radial-gradient(ellipse 50% 40% at 70% 60%, rgba(168, 85, 247, 0.03), transparent 60%);
}

/* Subtle gradient border on step line */
.step-line {
  background: linear-gradient(180deg, var(--purple), #a855f7, transparent) !important;
  opacity: 0.3;
}

/* Subtle gradient border on showcase cards */
.cat-card {
  position: relative;
  overflow: hidden;
}
.cat-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--purple), #a855f7, transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.cat-card:hover::before {
  opacity: 1;
}

/* Gamification card accent */
.gamification-card {
  position: relative;
  overflow: hidden;
}
.gamification-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #a855f7, #06b6d4, transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.gamification-card:hover::before {
  opacity: 1;
}

/* Step card accent line */
.step-card {
  position: relative;
  overflow: hidden;
}
.step-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #6366f1, transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.step-card:hover::before {
  opacity: 0.8;
}

/* Comparison panel highlight accent */
.comparison-panel-highlight {
  border-color: rgba(99, 102, 241, 0.2) !important;
}

/* Feature item icon accent — see later .feature-icon (line ~3043) for the
   full definition with size + flex properties. The filter/glow effect is added
   inline via the second definition's hover. */

/* Problem chips accent */
.chip-warn {
  border-color: rgba(251, 191, 36, 0.3) !important;
  color: #fbbf24 !important;
}
.chip-good {
  border-color: rgba(52, 211, 153, 0.3) !important;
  color: #34d399 !important;
}
.chip-arrow {
  color: #a855f7 !important;
  font-size: 1.3rem;
}

/* Pillar card accent */
.pillar-card {
  position: relative;
  overflow: hidden;
}
.pillar-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #a78bfa, transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.pillar-card:hover::before {
  opacity: 0.8;
}

/* Step number gradient */
.step-num {
  background: linear-gradient(135deg, #6366f1, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
}

/* Comparison arrow accent */
.comparison-arrow {
  color: #a855f7 !important;
  font-size: 1.5rem;
  filter: drop-shadow(0 0 12px rgba(168, 85, 247, 0.3));
}

/* ---------- nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(15, 15, 15, 0.72);
  border-bottom: 1px solid var(--border);
}

.site-nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

/* ---------- hero ---------- */
.hero-section {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 6rem 1.5rem 4rem;
  background:
    radial-gradient(60% 60% at 70% 20%, rgba(99, 102, 241, 0.16), transparent 70%),
    radial-gradient(50% 50% at 15% 85%, rgba(255, 0, 0, 0.08), transparent 70%),
    var(--bg);
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 780px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.hero-logo {
  animation: fadeSlideUpScale 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-title {
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  animation: fadeSlideUpScale 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
  background: linear-gradient(135deg, #e8e4f0 0%, #a78bfa 35%, #c4b5fd 55%, #f1f1f3 80%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeSlideUpScale 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both, heroShimmer 8s ease-in-out infinite;
}

.hero-title-accent {
  background: linear-gradient(120deg, #818cf8, #06b6d4 50%, #a855f7);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: fadeSlideUpScale 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both, gradientShift 4s ease-in-out infinite;
}

.hero-copy {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 620px;
  animation: fadeSlideUpScale 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  animation: fadeSlideUpScale 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.scroll-cue {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 42px;
  border: 2px solid var(--border);
  border-radius: 999px;
  z-index: 2;
}

.scroll-cue span {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 4px;
  height: 8px;
  background: var(--purple);
  border-radius: 999px;
  transform: translateX(-50%);
  animation: scrollCue 1.8s ease-in-out infinite;
}

/* ---------- comet hero background ---------- */
.comet-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.comet-tail {
  position: absolute;
  top: 40%;
  left: 45%;
  width: 90%;
  height: 55%;
  background: linear-gradient(100deg, rgba(99, 102, 241, 0.35), rgba(34, 211, 238, 0.16) 40%, transparent 75%);
  filter: blur(40px);
  border-radius: 50%;
  opacity: 0.8;
}

.comet-halo {
  position: absolute;
  top: 0;
  left: 0;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.35), rgba(34, 211, 238, 0.08) 55%, transparent 75%);
  filter: blur(10px);
  will-change: transform;
}

.comet-core {
  position: absolute;
  top: 0;
  left: 0;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, #d7d9ff 30%, rgba(99, 102, 241, 0.6) 60%, transparent 80%);
  box-shadow: 0 0 60px 12px rgba(99, 102, 241, 0.5), 0 0 120px 40px rgba(34, 211, 238, 0.15);
  will-change: transform;
  animation: pulseGlow 3.4s ease-in-out infinite;
}

.comet-rings {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  will-change: transform;
}

.comet-rings .ring {
  position: absolute;
  border: 1px solid rgba(154, 154, 162, 0.28);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  top: 0;
  left: 0;
}

.ring-1 {
  width: 220px;
  height: 220px;
  animation: orbitSpin 30s linear infinite;
}

.ring-2 {
  width: 340px;
  height: 340px;
  animation: orbitSpin 46s linear infinite reverse;
}

.ring-3 {
  width: 460px;
  height: 300px;
  border-color: rgba(99, 102, 241, 0.18);
  animation: orbitSpin 60s linear infinite;
}

.star-field {
  position: absolute;
  inset: 0;
}

.star {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  opacity: 0.35;
  animation: twinkle 3.2s ease-in-out infinite;
}

/* ---------- cursor trail ---------- */
.cursor-trail {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 40;
  opacity: 0;
  transition: opacity 0.4s ease;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.16), rgba(34, 211, 238, 0.06) 45%, transparent 70%);
  mix-blend-mode: screen;
  filter: blur(6px);
}
/* Hide the cursor-trail glow when inside the app or a Watch Together room */
body.app-active .cursor-trail,
body.wt-room-active .cursor-trail { display: none !important; }
}

/* ---------- problem section ---------- */
.problem-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.chip-warn {
  color: #ffb4b4;
  border-color: rgba(255, 0, 0, 0.25);
  background: rgba(255, 0, 0, 0.06);
}

.chip-good {
  color: #c7c9ff;
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.1);
}

.chip-arrow {
  color: var(--text-muted);
  font-size: 1.2rem;
  margin: 0 0.25rem;
}

/* ---------- steps ---------- */
.steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.step-line {
  position: absolute;
  top: 2.4rem;
  left: 8%;
  right: 8%;
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--border) 0 10px, transparent 10px 20px);
  z-index: 0;
}

.step-card {
  position: relative;
  z-index: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.75rem 1.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.step-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.4);
  background: var(--card-hover);
  box-shadow: 0 16px 40px -20px rgba(99, 102, 241, 0.55);
}

.step-num {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--purple);
  background: rgba(99, 102, 241, 0.12);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.9rem;
}

.step-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.step-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ---------- comparison ---------- */
.comparison {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1.5rem;
  align-items: start;
}

.comparison-arrow {
  font-size: 1.6rem;
  color: var(--purple);
  align-self: center;
  animation: floatX 2.4s ease-in-out infinite;
}

.comparison-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.5rem;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.comparison-panel:hover {
  transform: translateY(-6px);
}

.comparison-panel-highlight {
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.15), 0 20px 50px -30px rgba(99, 102, 241, 0.7);
}

.comparison-panel-highlight:hover {
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.3), 0 26px 60px -24px rgba(99, 102, 241, 0.8);
}

.comparison-label {
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.comparison-label-accent {
  color: var(--purple);
}

.comparison-visual {
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.75rem;
  margin-bottom: 1.25rem;
  position: relative;
  min-height: 150px;
}

.mock-header {
  height: 10px;
  width: 40%;
  background: var(--border);
  border-radius: 4px;
  margin-bottom: 0.6rem;
}

.mock-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.mock-video {
  height: 34px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--card), var(--card-hover));
}

.mock-video.featured {
  grid-column: span 3;
  height: 60px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(34, 211, 238, 0.18));
}

.mock-comments {
  height: 18px;
  margin-top: 8px;
  border-radius: 6px;
  background: rgba(255, 0, 0, 0.12);
}

.mock-sidebar {
  position: absolute;
  right: 8px;
  top: 8px;
  bottom: 8px;
  width: 14%;
  background: var(--card);
  border-radius: 6px;
  opacity: 0.7;
}

.mock-ai-panel {
  margin-top: 8px;
  height: 34px;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(167, 139, 250, 0.18));
  border: 1px solid rgba(99, 102, 241, 0.3);
  position: relative;
  overflow: hidden;
}

.mock-ai-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  animation: shimmer 2.6s ease-in-out infinite;
}

.comparison-traits {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.comparison-traits li {
  padding-left: 1.1rem;
  position: relative;
}

.comparison-traits li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--purple);
}

/* ---------- layout preview ---------- */
.layout-preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 40px -20px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
.layout-preview:hover {
  box-shadow: 0 12px 60px -24px rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.15);
}

/* Top bar */
.preview-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.preview-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 12px;
  width: 200px;
}
.preview-search-icon { font-size: 13px; }
.preview-topbar-actions {
  display: flex;
  gap: 6px;
}
.preview-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.3;
}

/* Body area */
.preview-body {
  display: flex;
  gap: 0;
  min-height: 260px;
}

/* Sidebar */
.preview-sidebar {
  width: 40px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  border-right: 1px solid var(--border);
  background: var(--bg);
}
.preview-sidebar-item {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--card);
  border: 1px solid var(--border);
}
.preview-sidebar-item.active {
  background: var(--purple);
  border-color: var(--purple);
  box-shadow: 0 0 12px -4px rgba(99, 102, 241, 0.3);
}

/* Grid panel */
.preview-grid-panel {
  flex: 1;
  padding: 12px 16px;
  min-width: 0;
}
.preview-chip-row {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  overflow: hidden;
}
.preview-chip {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}
.preview-chip.active {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.preview-card {
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: default;
}
.preview-card:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 30px -18px rgba(99, 102, 241, 0.6);
}
.preview-card-bg {
  width: 100%;
  height: 100%;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
}
.preview-card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  backdrop-filter: blur(4px);
}
.preview-card-title {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  margin-bottom: 2px;
}
.preview-card-channel {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* Divider */
.preview-divider {
  width: 1px;
  background: var(--border);
  flex-shrink: 0;
}

/* AI Panel */
.preview-ai-panel {
  width: 220px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.preview-ai-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--border);
}
.preview-ai-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px -2px rgba(52, 211, 153, 0.5);
}
.preview-ai-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.preview-ai {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px;
  overflow: hidden;
}
.preview-msg {
  display: flex;
}
.preview-msg.user { justify-content: flex-end; }
.preview-msg.assistant { justify-content: flex-start; }
.preview-msg-bubble {
  max-width: 85%;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 10px;
  line-height: 1.45;
}
/* .user-bubble and .assistant-bubble are defined later (around line 5065) for
   the focus-ai-preview component. The earlier definitions were overridden. */

.preview-typing {
  display: flex;
  gap: 4px;
  padding: 4px 0 2px 4px;
  align-self: flex-start;
}
.preview-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: dotBounce 1.2s ease-in-out infinite;
}
.preview-typing span:nth-child(2) { animation-delay: 0.15s; }
.preview-typing span:nth-child(3) { animation-delay: 0.3s; }

.preview-input {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 14px 12px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
}
.preview-input-placeholder {
  font-size: 11px;
  color: var(--text-muted);
}
.preview-input-send {
  font-size: 14px;
  color: var(--purple);
  opacity: 0.5;
}

/* ---------- features ---------- */
.landing-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.feature-item {
  display: flex;
  gap: 0.9rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.feature-item:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, 0.35);
  box-shadow: 0 16px 40px -22px rgba(34, 211, 238, 0.5);
}

.feature-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  color: var(--purple);
}

.feature-content {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.feature-content strong {
  color: var(--text);
  display: block;
  margin-bottom: 0.2rem;
  font-size: 1.02rem;
}

/* ---------- about teaser (landing) ---------- */
.about-teaser {
  margin-top: 4.5rem;
  border-top: 1px solid var(--border);
  padding-top: 3rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.about-teaser h3 {
  font-size: 1.2rem;
  margin-bottom: 0.35rem;
}

.about-teaser p {
  color: var(--text-muted);
}

/* ---------- final CTA ---------- */
.landing-cta {
  margin-top: 2rem;
  text-align: center;
  padding: 4rem 2rem;
  border-radius: 24px;
  background: radial-gradient(60% 140% at 50% 0%, rgba(99, 102, 241, 0.22), transparent 70%), var(--surface);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
}

.landing-cta h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.3rem);
}

/* ---------- footer ---------- */
.site-footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ---------- reveal-on-scroll ----------
   Definitions consolidated into the "Enhanced scroll reveal directions" block
   below (around line 4866). The .reveal / .reveal-visible classes there are
   the canonical ones — they support data-reveal-dir variants and use
   !important on the visible state to win against other transforms. */

/* =========================================================
   ABOUT PAGE
   ========================================================= */

.about-hero {
  position: relative;
  overflow: hidden;
  padding: 5.5rem 1.5rem 3.5rem;
  text-align: center;
}

.about-hero-glow {
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.28), transparent 70%);
  filter: blur(20px);
  animation: driftGlow 10s ease-in-out infinite;
}

.about-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--purple);
  background: rgba(99, 102, 241, 0.12);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
}

.about-hero-inner h1 {
  font-size: clamp(2rem, 4.5vw, 2.9rem);
}

.about-hero-inner p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.about-container {
  padding-top: 0.5rem;
}

.about-block p {
  color: var(--text-muted);
  max-width: 760px;
  font-size: 1.02rem;
  margin-bottom: 1rem;
}

.about-block p:last-child {
  margin-bottom: 0;
}

.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.pillar-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.75rem 1.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.pillar-card:hover {
  transform: translateY(-4px);
  border-color: rgba(167, 139, 250, 0.4);
  box-shadow: 0 16px 40px -22px rgba(167, 139, 250, 0.5);
}

.pillar-index {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--violet);
  margin-bottom: 0.75rem;
}

.pillar-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.6rem;
}

.pillar-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.privacy-block,
.growing-block {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
}

.privacy-block {
  border-color: rgba(52, 211, 153, 0.25);
  background: radial-gradient(60% 100% at 0% 0%, rgba(52, 211, 153, 0.08), transparent 70%), var(--surface);
}

.growing-block {
  border-color: rgba(247, 185, 85, 0.25);
  background: radial-gradient(60% 100% at 0% 0%, rgba(247, 185, 85, 0.08), transparent 70%), var(--surface);
}

.privacy-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(52, 211, 153, 0.12);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.about-cta {
  margin-top: 1rem;
}

/* =========================================================
   KEYFRAMES
   ========================================================= */

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gradientShift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes pulseGlow {
  0%,
  100% {
    filter: brightness(1);
    transform: scale(1) translate(-50%, -50%);
  }
  50% {
    filter: brightness(1.15);
    transform: scale(1.06) translate(-47%, -47%);
  }
}

@keyframes orbitSpin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.15;
  }
  50% {
    opacity: 0.85;
  }
}

@keyframes scrollCue {
  0% {
    opacity: 0;
    transform: translate(-50%, 0);
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, 16px);
  }
}

@keyframes floatX {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(6px);
  }
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes dotBounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

@keyframes driftGlow {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(24px);
  }
}

/* =========================================================
   ADDITIONAL LANDING PAGE ANIMATIONS
   ========================================================= */

/* Float — subtle vertical bob used on hero elements and decorative shapes */
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Pulse glow — CTA button and accent elements */
@keyframes pulseGlowBtn {
  0%, 100% { box-shadow: 0 6px 20px -6px rgba(99, 102, 241, 0.55); }
  50% { box-shadow: 0 6px 30px -4px rgba(99, 102, 241, 0.85), 0 0 60px -20px rgba(99, 102, 241, 0.4); }
}

/* Layout preview hover */
/* Shimmer sweep — used on card hover states */
@keyframes shimmerSweep {
  0% { transform: translateX(-100%) skewX(-15deg); }
  100% { transform: translateX(200%) skewX(-15deg); }
}

/* Scale breathe — subtle size pulse for decorative elements */
@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.04); opacity: 0.9; }
}

/* Hero entrance with scale for more dramatic entry */
@keyframes fadeSlideUpScale {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Floating scroll cue — animate the inner span so the container stays centered */
#landing-view .scroll-cue span {
  animation: floatY 2.8s ease-in-out infinite;
}

/* CTA button pulse */
#landing-view .landing-cta .btn-primary,
#about-view .about-cta .btn-primary {
  animation: pulseGlowBtn 2.8s ease-in-out infinite;
}

/* Step card hover enhancement */
#landing-view .step-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 48px -20px rgba(99, 102, 241, 0.6);
}

/* Comparison panel hover enhancement */
#landing-view .comparison-panel:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 56px -28px rgba(99, 102, 241, 0.5);
}

/* Feature item hover enhancement */
#landing-view .feature-item:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 20px 48px -24px rgba(34, 211, 238, 0.5);
}

/* Pillar card hover enhancement */
#landing-view .pillar-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 48px -24px rgba(167, 139, 250, 0.5);
}

/* About teaser hover */
#landing-view .about-teaser {
  border-radius: 20px;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
#landing-view .about-teaser:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px -24px rgba(99, 102, 241, 0.4);
  border-color: rgba(99, 102, 241, 0.3);
}

/* Decorative gradient line between sections */
#landing-view .landing-section::after,
#about-view .landing-section::after {
  content: "";
  display: block;
  height: 1px;
  width: 60px;
  background: linear-gradient(90deg, var(--purple), transparent);
  margin-top: 1.5rem;
  opacity: 0.4;
}
#landing-view .landing-section:last-of-type::after,
#landing-view .landing-section.about-teaser::after { display: none; }

/* Comparison chip animation */
#landing-view .problem-chips .chip {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
#landing-view .problem-chips .chip:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 20px -12px currentColor;
}

/* =========================================================
   SECTION SPACING REFINEMENTS
   ========================================================= */

#landing-view .landing-section,
#about-view .landing-section {
  position: relative;
}

/* Tighter spacing on smaller viewports */
@media (max-width: 900px) {
  #landing-view .landing-section,
  #about-view .landing-section {
    padding: 3rem 0;
  }
  #landing-view .landing-section h2,
  #about-view .landing-section h2 {
    margin-bottom: 1rem;
  }
}

@media (max-width: 640px) {
  #landing-view .landing-section,
  #about-view .landing-section {
    padding: 2.5rem 0;
  }
  #landing-view .landing-section::after,
  #about-view .landing-section::after {
    width: 40px;
  }
}

/* =========================================================
   COMET PARALLAX ENHANCEMENT
   ========================================================= */

#landing-view .comet-tail {
  animation: breathe 5s ease-in-out infinite;
}

#landing-view .comet-halo {
  filter: blur(10px);
  will-change: transform;
  transition: filter 0.3s ease;
}

/* =========================================================
   PRIVACY / GROWING BLOCK REFINEMENTS
   ========================================================= */

#landing-view .privacy-block,
#landing-view .growing-block {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

#landing-view .privacy-block:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px -24px rgba(52, 211, 153, 0.3);
}

#landing-view .growing-block:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px -24px rgba(247, 185, 85, 0.3);
}

/* =========================================================
   FINAL CTA REFINEMENT
   ========================================================= */

#landing-view .landing-cta,
#about-view .about-cta {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

#landing-view .landing-cta:hover,
#about-view .about-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 50px -30px rgba(99, 102, 241, 0.6);
  border-color: rgba(99, 102, 241, 0.3);
}

/* =========================================================
   RESPONSIVE (landing / about)
   ========================================================= */

@media (max-width: 900px) {
  .steps,
  .pillars,
  .landing-features {
    grid-template-columns: 1fr;
  }

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

  .comparison-arrow {
    transform: rotate(90deg);
    margin: 0 auto;
  }

  .step-line {
    display: none;
  }

  .layout-preview {
    overflow: hidden;
  }
  .preview-body {
    flex-direction: column;
  }
  .preview-sidebar {
    display: none;
  }
  .preview-ai-panel {
    width: 100%;
    border-top: 1px solid var(--border);
  }
  .preview-divider {
    width: 100%;
    height: 1px;
  }
  .preview-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .preview-search {
    width: 140px;
  }
}

@media (max-width: 640px) {
  .site-nav-links {
    gap: 0.6rem;
  }

  .site-nav-links .btn-primary {
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
  }

  .hero-section {
    min-height: auto;
    padding: 5rem 1.25rem 3.5rem;
  }

  .landing-section {
    padding: 3rem 0;
  }

  .privacy-block,
  .growing-block {
    flex-direction: column;
  }

  .about-teaser {
    flex-direction: column;
    align-items: flex-start;
  }

  .comet-halo {
    width: 300px;
    height: 300px;
  }

  .comet-core {
    width: 60px;
    height: 60px;
  }

  .ring-1 {
    width: 140px;
    height: 140px;
  }

  .ring-2 {
    width: 220px;
    height: 220px;
  }

  .ring-3 {
    width: 300px;
    height: 200px;
  }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .cursor-trail {
    display: none;
  }
}

/* ============ Continue watching ============ */
.continue-section {
  margin-bottom: 24px;
}

.continue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.continue-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.continue-clear-all {
  font-size: 11px;
  padding: 4px 10px;
  flex-shrink: 0;
}

.continue-remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.continue-grid .video-card:hover .continue-remove-btn {
  opacity: 1;
}

.continue-grid {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--card-hover) transparent;
  padding-bottom: 8px;
}

.continue-grid::-webkit-scrollbar {
  height: 6px;
}
.continue-grid::-webkit-scrollbar-track {
  background: transparent;
}
.continue-grid::-webkit-scrollbar-thumb {
  background: var(--card-hover);
  border-radius: 999px;
}

.continue-grid::after {
  content: "";
  flex: 0 0 8px;
}

.continue-grid .video-card {
  flex: 0 0 180px;
  min-width: 0;
  position: relative;
}

.continue-grid .video-card .thumb {
  aspect-ratio: 16 / 9;
}

.continue-grid .video-card .card-body {
  padding: 8px 10px 10px;
}

.continue-grid .video-card .card-title {
  font-size: 13px;
  -webkit-line-clamp: 2;
}

.continue-grid .video-card .card-channel {
  font-size: 11px;
}

.resume-badge {
  position: absolute;
  bottom: 36px;
  left: 6px;
  right: 6px;
  background: rgba(0,0,0,0.8);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  text-align: center;
}
/* ============ Skill Dashboard ============ */
.skill-header { margin-bottom: 24px; }
.skill-header h1 { font-size: 24px; margin: 0 0 8px; }
.skill-subtitle { color: var(--text-muted); font-size: 14px; margin: 0; }
.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.skill-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  transition: all 0.2s ease;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 14px;
  align-items: start;
}
.skill-card:hover { border-color: var(--purple); background: var(--card-hover); transform: translateY(-1px); }
.skill-card.mastered { border-color: var(--green); background: rgba(52,211,153,0.05); }
.skill-card.skill-lv-4 { border-color: rgba(99,102,241,0.4); background: rgba(99,102,241,0.04); }
.skill-card.skill-lv-5 { border-color: rgba(168,85,247,0.5); background: rgba(168,85,247,0.05); }
.skill-card-icon-wrap {
  grid-row: 1 / 3;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--surface-2, #1a1a24), var(--surface, #13131a));
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent, #a855f7);
}
.skill-card.mastered .skill-card-icon-wrap { color: var(--green); }
.skill-card-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.skill-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.skill-name { font-weight: 700; font-size: 15px; color: var(--text); }
.skill-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--card-hover);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.mastered-badge { background: rgba(52,211,153,0.15); color: var(--green); }
.strong-badge { background: rgba(99,102,241,0.15); color: var(--violet); }
.dev-badge { background: rgba(251,191,36,0.12); color: var(--amber); }
.skill-card-meta { font-size: 12px; color: var(--text-muted); }
.skill-card-progress { height: 6px; background: var(--border); border-radius: 4px; overflow: hidden; }
.skill-card-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--violet));
  border-radius: 4px;
  transition: width 0.4s ease;
  box-shadow: 0 0 12px rgba(168,85,247,0.3);
}
.skill-card.mastered .skill-card-fill { background: linear-gradient(90deg, var(--green), #34d399); box-shadow: 0 0 12px rgba(52,211,153,0.4); }
.skill-card.skill-lv-4 .skill-card-fill,
.skill-card.skill-lv-5 .skill-card-fill { background: linear-gradient(90deg, var(--accent, #a855f7), var(--accent-2, #ec4899)); }
.skill-card-stats {
  font-size: 11px;
  color: var(--text-faint);
  display: flex;
  justify-content: space-between;
  font-variant-numeric: tabular-nums;
}
.skill-card-mastery {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border, rgba(255,255,255,0.06));
}
.skill-card-mastery-pct { color: var(--text-muted, #9b9bab); }
.skill-card-mastery-pct strong { color: var(--accent, #a855f7); font-weight: 700; font-size: 14px; }
.skill-card-mastery-date { color: var(--text-faint, #5e5e72); font-size: 11px; }
.skill-toggle-btn {
  grid-column: 1 / -1;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
}
.skill-toggle-btn:hover { border-color: var(--purple); color: var(--text); }
.skill-card.mastered .skill-toggle-btn { border-color: rgba(52,211,153,0.3); color: var(--green); }
.skill-card.mastered .skill-toggle-btn:hover { border-color: var(--red); color: var(--red); }
.skill-gap-section {
  background: rgba(251,191,36,0.05);
  border: 1px solid rgba(251,191,36,0.2);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  grid-column: 1 / -1;
}
.skill-gap-section h3 { margin: 0 0 6px; font-size: 16px; }
.skill-gap-hint { color: var(--text-muted); font-size: 13px; margin: 0 0 12px; }
.skill-gap-list { display: flex; flex-direction: column; gap: 8px; }
.skill-gap-item {
  display: flex;
  align-items: center;
  gap: 12px;
}
.skill-gap-name { font-size: 13px; font-weight: 600; min-width: 140px; }
.skill-gap-bar { flex: 1; height: 6px; background: var(--border); border-radius: 4px; overflow: hidden; }
.skill-gap-fill { height: 100%; background: linear-gradient(90deg, var(--amber), #f59e0b); border-radius: 4px; }
.skill-blindspot {
  text-align: center;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: 4px;
}
.blindspot-question {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--text);
}
@media (max-width: 768px) {
  .skill-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
  .skill-header h1 { font-size: 20px; }
  .skill-gap-name { min-width: 100px; font-size: 12px; }
  .blindspot-question { font-size: 14px; }
}
@media (max-width: 500px) {
  .skill-grid { grid-template-columns: 1fr; gap: 10px; }
  .skill-card { padding: 12px; }
}
/* ============ Video Notes ============ */
.notes-panel {
  margin-top: 10px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.notes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.notes-title { font-weight: 700; font-size: 13px; }
.notes-count {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--purple);
  color: #fff;
  font-weight: 700;
}
.notes-list {
  max-height: 250px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}
.notes-empty { font-size: 12px; color: var(--text-muted); padding: 8px 0; text-align: center; }
.notes-item {
  display: flex;
  gap: 8px;
  padding: 6px 8px;
  background: var(--surface);
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.4;
}
.notes-time {
  font-size: 11px;
  font-weight: 700;
  color: var(--purple);
  cursor: pointer;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  padding: 1px 4px;
  border-radius: 4px;
  transition: background 0.15s;
}
.notes-time:hover { background: rgba(124,58,237,0.1); }
.notes-text { color: var(--text); }
.notes-input-row {
  display: flex;
  gap: 6px;
}
.notes-input-row input {
  flex: 1;
  padding: 7px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.notes-input-row input:focus { border-color: var(--purple); }
/* ============ Challenges ============ */
.challenges-header { margin-bottom: 20px; }
.challenges-header h1 { font-size: 22px; margin: 0 0 6px; }
.challenges-subtitle { color: var(--text-muted); font-size: 14px; margin: 0; }
.challenges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.challenge-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.challenge-card:hover { border-color: var(--purple); background: var(--card-hover); transform: translateY(-1px); }
.challenge-card.challenge-completed { border-color: rgba(52,211,153,0.4); background: rgba(52,211,153,0.04); }
.challenge-card.challenge-ready {
  border-color: rgba(168,85,247,0.5);
  background: rgba(168,85,247,0.06);
  animation: challenge-pulse 2.4s ease-in-out infinite;
}
@keyframes challenge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(168,85,247,0); }
  50% { box-shadow: 0 0 0 4px rgba(168,85,247,0.15); }
}
.challenge-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--surface-2, #1a1a24), var(--surface, #13131a));
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent, #a855f7);
}
.challenge-card.challenge-completed .challenge-card-icon { color: var(--green); }
.challenge-card-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.challenge-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.challenge-card-name { font-weight: 700; font-size: 15px; color: var(--text); margin: 0; }
.challenge-card-xp {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(168,85,247,0.15);
  color: var(--violet, #a78bfa);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  flex-shrink: 0;
}
.challenge-card-desc { font-size: 12px; color: var(--text-muted); margin: 0; }
.challenge-card-progress {
  height: 4px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}
.challenge-card-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--accent, #a855f7));
  border-radius: 3px;
  transition: width 0.4s ease;
}
.challenge-card.challenge-completed .challenge-card-fill { background: linear-gradient(90deg, var(--green), #34d399); }
.challenge-card-meta { font-size: 11px; color: var(--text-faint); }
.challenge-card.challenge-ready .challenge-card-meta { color: var(--violet, #a78bfa); font-weight: 600; }
.challenge-card-action { flex-shrink: 0; }
.challenge-claim-btn { font-size: 11px !important; padding: 6px 12px !important; }
.challenge-status-done {
  font-size: 11px;
  color: var(--green);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(52,211,153,0.1);
  border-radius: 6px;
}
.challenge-status-progress {
  font-size: 12px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
@media (max-width: 500px) {
  .challenges-grid { grid-template-columns: 1fr; }
  .challenge-card { padding: 12px; gap: 10px; }
}
/* ============ Learning Streaks Heatmap ============ */
.heatmap-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}
.heatmap-section h3 { margin: 0 0 12px; font-size: 15px; }
.heatmap-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.heatmap-month-row {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 2px;
  padding-left: 28px;
}
.heatmap-month-label {
  font-size: 8px;
  color: var(--text-muted);
  width: 11px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1;
}
.heatmap-grid {
  display: grid;
  grid-template-columns: 28px repeat(12, 11px);
  grid-template-rows: repeat(7, 11px);
  gap: 2px;
  align-items: center;
  justify-content: flex-start;
}
.heatmap-day-label {
  font-size: 9px;
  color: var(--text-muted);
  text-align: right;
  padding-right: 4px;
  height: 11px;
  line-height: 11px;
}
.heatmap-cell {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: var(--card-hover);
  transition: background 0.15s, transform 0.15s;
  cursor: default;
}
.heatmap-cell:hover {
  transform: scale(1.5);
  z-index: 2;
  position: relative;
}
.heatmap-cell.level-1 { background: rgba(99,102,241,0.25); }
.heatmap-cell.level-2 { background: rgba(99,102,241,0.45); }
.heatmap-cell.level-3 { background: rgba(99,102,241,0.65); }
.heatmap-cell.level-4 { background: rgba(99,102,241,0.85); }
.heatmap-stats {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: center;
}
@media (max-width: 500px) {
  .heatmap-month-row { padding-left: 25px; }
  .heatmap-grid { grid-template-columns: 25px repeat(12, 9px); grid-template-rows: repeat(7, 9px); gap: 1px; }
  .heatmap-cell { width: 9px; height: 9px; }
  .heatmap-month-label { width: 9px; font-size: 7px; }
}
/* ============ Focus Timer (Pomodoro) ============ */
.focus-timer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 6px 0 10px;
  flex-wrap: wrap;
}
.focus-timer-display {
  display: flex;
  align-items: center;
  gap: 6px;
}
.focus-timer-icon { font-size: 18px; }
.focus-timer-countdown {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
  color: var(--text);
  min-width: 60px;
}
.focus-timer-controls { display: flex; gap: 6px; }
.focus-timer-btn {
  font-size: 11px !important;
  padding: 4px 10px !important;
}
.focus-timer-btn.paused { border-color: var(--amber) !important; color: var(--amber) !important; }
.focus-timer-progress {
  flex: 1;
  min-width: 60px;
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.focus-timer-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--red), #ff6b35);
  border-radius: 4px;
  transition: width 0.5s linear;
  width: 0%;
}
.focus-timer-phase {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--card-hover);
}
@media (max-width: 768px) {
  .focus-timer { padding: 6px 10px; gap: 8px; }
  .focus-timer-countdown { font-size: 17px; }
}
/* ===== Appended feature CSS: settings / history / onboarding / checkpoint (old design language) ===== */



/* Mobile chat button — floating
   - On mobile: always show (it's the toggle for the AI overlay)
   - On desktop: only show in a room (home has the side panel always visible) */
.mobile-chat-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  border: none;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.45);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
/* Mobile (<= 900px): bubble always visible (when overlay is closed) */
@media (max-width: 900px) {
  .mobile-chat-btn {
    display: flex !important;
    z-index: 301;
  }
  /* Hide bubble in room — sidebar tabs already provide chat access */
  body.wt-room-active .mobile-chat-btn { display: none !important; }
  /* Once user opens overlay, hide the bubble (overlay is now open) */
  body.mobile-chat-open .mobile-chat-btn {
    display: none !important;
  }
}
/* Desktop (> 900px): only in a room */
@media (min-width: 901px) {
  body.wt-room-active .mobile-chat-btn { display: flex; }
}
.mobile-chat-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(99, 102, 241, 0.55);
}
.mobile-chat-btn:active {
  transform: scale(0.95);
}

/* Mobile chat panel overlay — unused, removed in favor of floating AI panel */
.mobile-chat-overlay .ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}
.mobile-chat-overlay .ai-form {
  padding: 8px 12px;
  border-top: 1px solid var(--border);
}

/* --- Checkpoint: side card (less interruptive) --- */
#checkpoint-overlay {
  opacity: 0;
  transition: opacity 0.18s ease;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  align-items: flex-end !important;
  justify-content: flex-end !important;
  padding: 0 !important;
}
#checkpoint-overlay.overlay-open { opacity: 1; }
#checkpoint-overlay .overlay-card {
  transform: translateX(20px); opacity: 0;
  transition: transform 0.22s var(--ease-out, ease-out), opacity 0.22s ease;
  border-radius: 16px !important;
  max-width: 380px !important;
  width: calc(100vw - 32px) !important;
  max-height: calc(100vh - 32px) !important;
  margin: 16px !important;
  background: var(--surface, #13131a) !important;
  border: 1px solid var(--border, rgba(255,255,255,0.08)) !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5) !important;
  text-align: left !important;
  padding: 24px !important;
  position: relative;
  overflow-y: auto;
}
#checkpoint-overlay.overlay-open .overlay-card { transform: translateX(0); opacity: 1; }
.checkpoint-card { text-align: left; }
.checkpoint-video-context {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--text-muted);
  justify-content: center;
  flex-wrap: wrap;
}
.checkpoint-badge {
  display: inline-block;
  background: var(--purple);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 10px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
}
.checkpoint-video-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 260px;
  opacity: 0.8;
}
.checkpoint-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin: -8px 0 14px;
  line-height: 1.5;
}
.checkpoint-answer {
  margin: 12px 0 0;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: 10px;
  border: 1px solid var(--border);
  text-align: left;
}
.checkpoint-answer-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.checkpoint-answer-text {
  font-size: 14px;
  color: var(--text);
  font-style: italic;
  line-height: 1.5;
}
.checkpoint-input-area {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}
.checkpoint-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.checkpoint-input:focus {
  border-color: var(--purple);
}
.cp-loading {
  padding: 12px 0;
  font-size: 14px;
  color: var(--text-muted);
  animation: cpPulse 1.2s ease-in-out infinite;
}
@keyframes cpPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* --- Voice input --- */
.checkpoint-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: #888;
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  z-index: 10;
  transition: color 0.15s;
}
.checkpoint-close:hover {
  color: #fff;
}

.checkpoint-voice-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
  min-height: 36px;
}
.voice-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  padding: 4px 12px !important;
  border-radius: 16px !important;
  border: 1px solid var(--border) !important;
  background: var(--surface) !important;
  color: var(--text-muted) !important;
  transition: all 0.15s;
}
.voice-btn:hover {
  border-color: var(--purple) !important;
  color: var(--purple) !important;
  background: color-mix(in srgb, var(--purple) 8%, var(--surface)) !important;
}
.voice-icon { font-size: 14px; }
.voice-label { font-size: 12px; }
.checkpoint-listening {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--purple);
  font-size: 12px;
}
.listening-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--purple);
  animation: listeningPulse 0.8s ease-in-out infinite;
}
@keyframes listeningPulse {
  0%, 100% { transform: scale(0.8); opacity: 0.5; box-shadow: 0 0 0 0 rgba(99,102,241,0.4); }
  50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 0 6px rgba(99,102,241,0); }
}
.listening-label { font-weight: 500; }

/* --- Onboarding (category picker) --- */
.onboarding-page {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 1.5rem; overflow-y: auto;
}
.onboarding-inner { max-width: 720px; width: 100%; text-align: center; }
.onboarding-inner .landing-logo { margin-bottom: 20px; }
.onboarding-inner h1 { font-size: 28px; margin: 0 0 8px; }
.onboarding-inner > p { color: var(--text-muted); margin: 0 0 28px; }
.onboarding-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px; margin-bottom: 24px; text-align: left;
}
.onboarding-grid-compact {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  max-height: 320px; overflow-y: auto; margin-bottom: 16px; text-align: left;
}
.onboarding-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px; cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.onboarding-card h3 { margin: 0 0 6px; font-size: 15px; color: var(--text); }
.onboarding-card p { margin: 0; font-size: 13px; color: var(--text-muted); }
.onboarding-card:hover { border-color: var(--purple); }
.onboarding-card.selected { border-color: var(--purple); background: rgba(99,102,241,0.12); }
.onboarding-card.dynamic-cat { border-color: rgba(6, 182, 212, 0.3); }
.onboarding-card.dynamic-cat.selected { border-color: var(--cyan); background: rgba(6, 182, 212, 0.12); }
.onboarding-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* --- Panel headers (shared by Settings, History) --- */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.panel-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}
.panel-header .icon-btn {
  font-size: 20px;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.panel-header .icon-btn:hover {
  background: var(--card-hover);
  color: var(--text);
}

/* --- Settings panel --- */
.settings-card {
  max-width: 440px;
  width: 92%;
  text-align: left;
  padding: 24px 28px;
}
.settings-section { margin-bottom: 22px; }
.settings-section:last-child { margin-bottom: 0; }
.settings-section h3 {
  margin: 0 0 8px; font-size: 12px; color: var(--text-muted);
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
}
.settings-row { display: flex; gap: 8px; flex-wrap: wrap; }
.settings-hint { font-size: 12px; color: var(--text-muted); margin: 0 0 10px; line-height: 1.5; }
.theme-option.active { border-color: var(--purple); color: var(--purple); }
.theme-option { transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease; }
.theme-option:hover { border-color: var(--purple); color: var(--text); }

/* --- Data overlay (export/import confirmation) --- */
/* --- History panel --- */
.history-card { max-width: 640px; width: 92%; text-align: left; }
#history-search-input {
  width: 100%; box-sizing: border-box; padding: 9px 12px; margin-bottom: 12px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 13px;
}
#history-search-input::placeholder { color: var(--text-muted); }
.history-panel-list {
  max-height: 320px; overflow-y: auto; display: flex;
  flex-direction: column; gap: 8px; margin-bottom: 16px;
}
.history-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.history-row:hover {
  background: var(--card);
}
.history-row img {
  width: 60px;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.history-row-title {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 2px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.history-row-channel {
  font-size: 11px;
  color: var(--text-muted);
}
.history-panel-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.history-panel-actions .btn-secondary.active { border-color: var(--purple); color: var(--violet); }

/* --- History panel continue watching --- */
.history-continue-section {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.history-continue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.history-continue-header .continue-clear-all {
  font-size: 10px;
  padding: 2px 8px;
  text-transform: none;
  letter-spacing: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.history-continue-header .continue-clear-all:hover {
  color: var(--red);
  border-color: rgba(255, 59, 48, 0.3);
}
.history-continue-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.history-continue-card {
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.15s ease;
}
.history-continue-card:hover {
  transform: translateY(-2px);
}
.history-continue-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
}
.history-continue-thumb {
  overflow: hidden;
}
.history-continue-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}
.history-continue-card:hover .history-continue-thumb img {
  transform: scale(1.05);
}
.history-continue-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 3px;
}
.continue-card-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
}
.history-continue-card:hover .continue-card-remove {
  opacity: 1;
}
.continue-card-remove:hover {
  background: rgba(255, 59, 48, 0.8);
}
.history-continue-title {
  font-size: 11px;
  font-weight: 600;
  margin: 5px 0 0;
  line-height: 1.3;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (max-width: 500px) {
  .history-continue-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Real light theme for the app itself --- */
[data-theme="light"] {
  --bg: #ffffff;
  --bg-deep: #f8f8fa;
  --surface: #f4f4f6;
  --surface-2: #ececef;
  --card: #ffffff;
  --card-hover: #ececef;
  --text: #16161a;
  --text-muted: #5b5b66;
  --text-faint: #8a8a96;
  --border: #e1e1e6;
  --border-strong: #d1d1d6;
  --border-hover: #c1c1c6;
  --glass-bg: rgba(255,255,255,0.85);
  --glass-border: rgba(0,0,0,0.06);
  /* Accent colors stay — they're visible on both light and dark */
}

/* --- Sepia theme for the app itself --- */
[data-theme="sepia"] {
  --bg: #fbf3e0;
  --bg-deep: #f5e6c8;
  --surface: #f5e6c8;
  --surface-2: #efe0bd;
  --card: #f5e6c8;
  --card-hover: #efe0bd;
  --text: #433422;
  --text-muted: #8b7355;
  --text-faint: #a09070;
  --border: rgba(67,52,34,0.1);
  --border-strong: rgba(67,52,34,0.2);
  --border-hover: rgba(67,52,34,0.15);
  --glass-bg: rgba(251,243,224,0.85);
  --glass-border: rgba(67,52,34,0.08);
}

/* --- About/onboarding keep the dark marketing look regardless of theme --- */
[data-theme="light"] #about-view,
[data-theme="light"] #onboarding-view {
  --bg: #06060a; --surface: #0c0c12; --card: rgba(255,255,255,0.04);
  --card-hover: rgba(255,255,255,0.07); --text: #e0e0e8; --text-muted: #8b8b9e; --border: rgba(255,255,255,0.06);
  background: var(--bg);
  color: var(--text);
}

/* =========================================================
   NEW LANDING ANIMATIONS
   ========================================================= */


/* --- Typewriter --- */
.typewriter {
  visibility: hidden;
  display: inline;
}
.typewriter-cursor {
  display: inline-block;
  color: var(--purple);
  font-weight: 100;
  margin-left: 2px;
  animation: cursorBlink 0.8s step-end infinite;
}
@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
.typing {
  visibility: visible;
}

/* --- Glitch text --- */
.glitch-text {
  display: inline;
  position: relative;
}

/* --- 3D tilt cards --- */
.step-card, .feature-item, .comparison-panel {
  will-change: transform;
  backface-visibility: hidden;
}

/* --- Animated gradient borders --- */
.btn-primary.animated-border {
  position: relative;
  overflow: hidden;
}
.btn-primary.animated-border::before {
  content: "";
  position: absolute;
  top: -2px; left: -2px;
  right: -2px; bottom: -2px;
  border-radius: inherit;
  background: linear-gradient(60deg, #6366f1, #a855f7, #06b6d4, #6366f1);
  background-size: 300% 300%;
  z-index: -1;
  animation: borderRotate 4s ease-in-out infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.btn-primary.animated-border:hover::before {
  opacity: 1;
}
@keyframes borderRotate {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* --- Enhanced scroll reveal directions --- */
.reveal {
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.reveal[data-reveal-dir="up"],
.reveal:not([data-reveal-dir]) {
  transform: translateY(30px) scale(0.98);
}
.reveal[data-reveal-dir="left"] {
  transform: translateX(-40px) scale(0.98);
}
.reveal[data-reveal-dir="right"] {
  transform: translateX(40px) scale(0.98);
}
.reveal[data-reveal-dir="scale"] {
  transform: scale(0.92);
}
.reveal-visible {
  opacity: 1 !important;
  transform: translate(0) scale(1) !important;
}

/* --- Floating scroll parallax --- */
.float-element {
  will-change: transform;
}

/* --- Hero section z-index fixes for new layers --- */
.hero-section {
  position: relative;
  z-index: 1;
  background: radial-gradient(ellipse 80% 60% at 50% 30%, rgba(99, 102, 241, 0.06), transparent 70%),
              radial-gradient(ellipse 60% 50% at 20% 70%, rgba(168, 85, 247, 0.04), transparent 60%),
              radial-gradient(ellipse 60% 50% at 80% 70%, rgba(6, 182, 212, 0.03), transparent 60%);
}
.hero-section .comet-stage {
  z-index: 1;
}
.hero-section .hero-inner {
  position: relative;
  z-index: 2;
}

/* --- Reduced motion overrides for new animations --- */
@media (prefers-reduced-motion: reduce) {
  .orb {
    animation: none !important;
    opacity: 0.08;
  }
  .grid-canvas {
    display: none;
  }
  .glitch-text {
    animation: none !important;
  }
  .typewriter {
    visibility: visible;
  }
  .typewriter-cursor {
    display: none;
  }
  .btn-primary.animated-border::before {
    animation: none !important;
    opacity: 0;
  }
}

/* =========================================================
   NEW LANDING SECTIONS (stats, category showcase, AI preview,
   gamification, FAQ)
   ========================================================= */

/* --- Stats bar --- */
.stats-bar {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 16px;
  padding: 2rem 0;
  flex-wrap: wrap;
}
.stat-item {
  text-align: center;
  flex: 1;
  min-width: 100px;
}
.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--purple), #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}
.stat-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.stat-divider {
  width: 1px;
  height: 50px;
  background: var(--border);
  opacity: 0.3;
}
@media (max-width: 640px) {
  .stat-number { font-size: 1.8rem; }
  .stat-divider { height: 30px; }
}

/* --- Category showcase --- */
.cat-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 1rem;
}
.cat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  cursor: default;
}
.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px -20px rgba(99, 102, 241, 0.4);
  border-color: rgba(99, 102, 241, 0.3);
}
.cat-icon {
  font-size: 1.8rem;
  margin-bottom: 0.6rem;
  filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.15));
  transition: filter 0.3s ease, transform 0.3s ease;
}
.cat-card:hover .cat-icon {
  filter: drop-shadow(0 0 16px rgba(99, 102, 241, 0.3));
  transform: scale(1.1);
}
.cat-card h3 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
  color: var(--text);
}
.cat-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* --- FOCUS AI preview --- */
.focus-ai-preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  max-width: 560px;
  margin: 1rem auto 0;
  box-shadow: 0 0 60px -30px rgba(99, 102, 241, 0.15), inset 0 0 80px -60px rgba(99, 102, 241, 0.05);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
.focus-ai-preview:hover {
  box-shadow: 0 0 80px -20px rgba(99, 102, 241, 0.25), inset 0 0 80px -60px rgba(99, 102, 241, 0.05);
  border-color: rgba(99, 102, 241, 0.2);
}
.focus-ai-preview-chat {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 240px;
  background: radial-gradient(ellipse 80% 60% at 30% 40%, rgba(99, 102, 241, 0.03), transparent 70%);
}
.focus-ai-preview-msg { display: flex; }
.focus-ai-preview-msg.user-msg { justify-content: flex-end; }
.focus-ai-preview-msg.ai-msg { justify-content: flex-start; }
.focus-ai-preview-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
}
.user-bubble {
  background: var(--purple);
  color: #fff;
  border-bottom-right-radius: 2px;
}
.ai-bubble {
  background: var(--card);
  color: var(--text);
  border-bottom-left-radius: 2px;
}
.focus-ai-preview-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.focus-ai-preview-placeholder {
  flex: 1;
  color: var(--text-muted);
  font-size: 13px;
}
.focus-ai-preview-send {
  color: var(--purple);
  font-size: 18px;
  cursor: pointer;
}
.focus-ai-preview-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--border);
}
.focus-ai-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  font-size: 12px;
  color: var(--text-muted);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.focus-ai-feature:nth-child(even) { border-right: none; }
.focus-ai-feature:nth-last-child(-n+2) { border-bottom: none; }
.focus-ai-feature-icon { font-size: 16px; flex-shrink: 0; }
@media (max-width: 640px) {
  .focus-ai-preview-features { grid-template-columns: 1fr; }
  .focus-ai-feature { border-right: none; }
  .focus-ai-feature:nth-last-child(-n+2) { border-bottom: 1px solid var(--border); }
  .focus-ai-feature:last-child { border-bottom: none; }
}

/* --- Gamification grid --- */
.gamification-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 1rem;
}
.gamification-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.gamification-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px -20px rgba(99, 102, 241, 0.4);
}
.gamification-icon {
  font-size: 2rem;
  margin-bottom: 0.6rem;
  filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.15));
  transition: filter 0.3s ease, transform 0.3s ease;
}
.gamification-card:hover .gamification-icon {
  filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.3));
  transform: scale(1.15);
}
.gamification-card h3 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
  color: var(--text);
}
.gamification-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* --- FAQ accordion --- */
.faq-list {
  max-width: 700px;
  margin: 1rem auto 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.faq-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}
.faq-item:hover { border-color: rgba(99, 102, 241, 0.3); }
.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--surface);
  border: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s ease;
}
.faq-question:hover { background: var(--card); }
.faq-arrow {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}
.faq-question[aria-expanded="true"] .faq-arrow { transform: rotate(180deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding: 0 20px;
  background: var(--surface);
}
.faq-question[aria-expanded="true"] + .faq-answer {
  max-height: 300px;
  padding: 0 20px 16px;
}
.faq-answer p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}


/* Level progress bar */
.level-progress {
  display: inline-block;
  width: 40px;
  height: 4px;
  background: #333;
  border-radius: 2px;
  vertical-align: middle;
  margin-left: 6px;
}
.level-progress-bar {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #22d3ee);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ============ Learning Paths ============ */
.learning-paths-header { margin-bottom: 24px; }
.learning-paths-header h1 { font-size: 24px; margin: 0 0 8px; }
.learning-paths-subtitle { color: var(--text-muted); font-size: 14px; margin: 0; }
.learning-paths-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.learning-path-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  transition: all 0.2s ease;
}
.learning-path-card:hover { border-color: var(--purple); background: var(--card-hover); transform: translateY(-1px); }
.learning-path-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}
.learning-path-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--surface-2, #1a1a24), var(--surface, #13131a));
  border: 1px solid var(--border, rgba(255,255,255,0.06));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent, #a855f7);
}
.learning-path-title-wrap { flex: 1; min-width: 0; }
.learning-path-name { font-size: 16px; font-weight: 700; margin: 0 0 4px; color: var(--text); }
.learning-path-desc { font-size: 13px; color: var(--text-muted); margin: 0 0 14px; line-height: 1.5; }
.learning-path-meta { font-size: 11px; color: var(--text-faint); }
.learning-path-progress-wrap {
  height: 6px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}
.learning-path-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--violet));
  border-radius: 4px;
  transition: width 0.4s ease;
  box-shadow: 0 0 10px rgba(168,85,247,0.3);
}
.learning-path-progress-label {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}
.learning-path-resume-btn {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--accent, #a855f7), var(--accent-2, #ec4899));
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s, filter 0.15s;
}
.learning-path-resume-btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.1); }
.learning-path-resume-btn.learning-path-completed {
  background: rgba(52,211,153,0.15);
  color: var(--green, #22c55e);
  cursor: default;
}
.learning-path-videos {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.learning-path-video-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
  font-size: 13px;
}
.learning-path-video-item:hover { background: var(--card-hover); }
.learning-path-video-item.watched { opacity: 0.6; }
.learning-path-video-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: transparent;
  transition: all 0.2s ease;
}
.learning-path-video-item.watched .learning-path-video-check {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.learning-path-video-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.learning-path-video-item.watched .learning-path-video-title {
  color: var(--text-muted);
}
@media (max-width: 768px) {
  .learning-paths-grid { grid-template-columns: 1fr; }
  .learning-paths-header h1 { font-size: 20px; }
  .learning-path-card { padding: 16px; }
}
@media (max-width: 500px) {
  .learning-paths-grid { gap: 12px; }
  .learning-path-card { padding: 14px; }
  .learning-path-name { font-size: 15px; }
}

/* ============ Reading List ============ */
.reading-list-header { margin-bottom: 24px; }
.reading-list-header h1 { font-size: 24px; margin: 0 0 8px; }
.reading-list-subtitle { color: var(--text-muted); font-size: 14px; margin: 0; }
.reading-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
  transition: all 0.15s ease;
}
.reading-list-item:hover { border-color: var(--purple); background: var(--card-hover); }
.reading-list-thumb {
  width: 80px;
  aspect-ratio: 16/9;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: #000;
}
.reading-list-thumb img { width: 100%; height: 100%; object-fit: cover; }
.reading-list-info { flex: 1; min-width: 0; }
.reading-list-title { font-size: 14px; font-weight: 600; margin: 0 0 3px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reading-list-channel { font-size: 12px; color: var(--text-muted); }
.reading-list-date { font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.reading-list-remove-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.reading-list-remove-btn:hover { border-color: var(--red); color: var(--red); }
#watch-later-btn.saved { background: linear-gradient(135deg, var(--purple), #6d28d9); border-color: var(--purple); color: #fff; }
@media (max-width: 768px) {
  .reading-list-header h1 { font-size: 20px; }
  .reading-list-thumb { width: 60px; }
  .reading-list-title { font-size: 13px; }
}
@media (max-width: 500px) {
  .reading-list-item { padding: 8px 10px; }
  .reading-list-thumb { width: 50px; }
}

/* ============ Focus Stats ============ */
.focus-stats-header { margin-bottom: 24px; }
.focus-stats-header h1 { font-size: 24px; margin: 0 0 8px; }
.focus-stats-subtitle { color: var(--text-muted); font-size: 14px; margin: 0; }
.focus-stats-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.focus-stats-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: all 0.2s ease;
}
.focus-stats-card:hover { border-color: var(--purple); background: var(--card-hover); }
.focus-stats-card-icon { font-size: 28px; margin-bottom: 8px; }
.focus-stats-card-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.focus-stats-card-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.focus-stats-chart-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}
.focus-stats-chart-section h3 { margin: 0 0 16px; font-size: 15px; }
.focus-stats-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  min-height: 120px;
  padding-bottom: 20px;
  overflow-x: auto;
}
.focus-stats-bar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 24px;
}
.focus-stats-bar {
  width: 100%;
  max-width: 32px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--purple), var(--violet));
  transition: height 0.4s ease;
  min-height: 2px;
}
.focus-stats-bar-label {
  font-size: 8px;
  color: var(--text-faint);
  text-align: center;
  white-space: nowrap;
  writing-mode: vertical-lr;
  transform: rotate(180deg);
  height: 40px;
  line-height: 1.2;
}
@media (max-width: 768px) {
  .focus-stats-cards { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .focus-stats-card { padding: 14px; }
  .focus-stats-card-value { font-size: 22px; }
  .focus-stats-header h1 { font-size: 20px; }
}
@media (max-width: 500px) {
  .focus-stats-cards { grid-template-columns: 1fr; gap: 8px; }
  .focus-stats-card { padding: 12px; display: flex; align-items: center; gap: 12px; text-align: left; }
  .focus-stats-card-icon { margin-bottom: 0; }
  .focus-stats-chart { min-height: 100px; }
}

/* ========== WATCH TOGETHER ========== */
#watch-together-view {
  display: flex; flex-direction: column;
  /* calc to sit below the app-header (~52px). Parent .app-view uses min-height
     so percentage heights don't resolve — use calc(100vh - header) instead. */
  height: calc(100vh - 52px);
  position: relative; z-index: 10;
  background: var(--bg);
}
/* Modal overlay */
.wt-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.wt-modal:not(.hidden) { display: flex; }
.wt-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); }
.wt-modal-content { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 32px; max-width: 560px; width: 90%; max-height: 90vh; overflow-y: auto; animation: wtModalIn 0.35s ease-out; }
@keyframes wtModalIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.wt-modal-close { position: absolute; top: 12px; right: 16px; background: none; border: none; color: var(--text-muted); font-size: 20px; cursor: pointer; padding: 4px 8px; border-radius: 4px; }
.wt-modal-close:hover { color: var(--text); background: var(--hover); }
.wt-modal-title { font-size: 24px; font-weight: 800; text-align: center; margin-bottom: 4px; background: linear-gradient(135deg, #a855f7, #6366f1); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.wt-modal-subtitle { font-size: 14px; color: var(--text-muted); text-align: center; margin-bottom: 24px; }
.wt-modal-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.wt-modal-card { background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 20px 16px; text-align: center; transition: all 0.2s; }
.wt-modal-card:hover { border-color: var(--purple); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(168,85,247,0.12); }
.wt-modal-card-icon { font-size: 36px; margin-bottom: 8px; }
.wt-modal-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; color: var(--text); }
.wt-modal-card p { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; line-height: 1.4; }
.wt-modal-hint { font-size: 12px; color: var(--text-faint); text-align: center; padding: 6px 12px; background: var(--bg); border-radius: 8px; }
.wt-join-inputs { display: flex; gap: 6px; margin-bottom: 6px; }
.wt-code-input { flex: 1; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font-size: 16px; text-align: center; letter-spacing: 3px; text-transform: uppercase; font-family: monospace; }
.wt-code-input:focus { outline: none; border-color: var(--purple); }
.wt-or-divider { font-size: 11px; color: var(--text-faint); margin: 4px 0; }
.wt-paste-row { display: flex; gap: 4px; }
.wt-link-input { flex: 1; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font-size: 12px; }
.wt-link-input:focus { outline: none; border-color: var(--purple); }
/* Name prompt inside modal */
.wt-modal-name-prompt { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); animation: wtModalIn 0.3s ease-out; }
.wt-modal-name-inner { text-align: center; }
.wt-modal-name-inner h3 { font-size: 16px; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.wt-name-input { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font-size: 16px; margin-bottom: 10px; }
.wt-name-input:focus { outline: none; border-color: var(--purple); }
/* Room container */
.wt-room { display: flex; flex-direction: column; flex: 1; min-height: 0; background: var(--bg); }

/* Room header — single tight row, no wasted vertical space */
.room-header {
  display: flex; align-items: center; gap: 12px; padding: 10px 18px;
  background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0;
  flex-wrap: nowrap;
}
.room-header > * { min-width: 0; flex-shrink: 0; }
.room-header > .room-header-actions { margin-left: auto; }

.room-header-id {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 8px;
  background: var(--surface-2, #14141c); border: 1px solid var(--border);
}
.room-header-label {
  font-size: 11px; color: var(--text-muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.room-id-code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px; font-weight: 700; color: var(--text); letter-spacing: 0.5px;
}
.room-header-host-badge {
  display: none;
  align-items: center; gap: 3px;
  font-size: 9px; font-weight: 700; padding: 2px 7px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent, #a855f7), var(--accent-2, #ec4899));
  color: #fff; text-transform: uppercase; letter-spacing: 0.5px;
}
.room-header-host-badge.visible { display: inline-flex; }

.room-header-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-muted);
}
.room-status-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
  flex-shrink: 0;
}
.room-status-dot.dot-green { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,0.6); animation: pulseDot 2s ease-in-out infinite; }
.room-status-dot.dot-yellow { background: #eab308; }
.room-status-dot.dot-red { background: #ef4444; }
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 6px rgba(34,197,94,0.6); }
  50% { box-shadow: 0 0 12px rgba(34,197,94,0.9); }
}

.room-header-actions { display: inline-flex; align-items: center; gap: 6px; }

/* Room content: player + sidebar (with tabs) */
.room-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  flex: 1; min-height: 0; overflow: hidden; gap: 0;
  background: var(--bg);
}

/* Player section — fills the left grid cell */
.room-player-section {
  display: flex; flex-direction: column;
  padding: 18px; gap: 12px;
  overflow-y: auto;
  min-width: 0; min-height: 0;
  border-right: 1px solid var(--border);
  background: var(--bg);
}
/* Ensure the grid cell itself can shrink */
.room-content > .room-player-section {
  min-height: 0;
}
.room-player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  flex-shrink: 0;
  transition: aspect-ratio 0.2s ease, min-height 0.2s ease;
}
/* When no video is loaded — reasonable empty state, not dominating */
.room-player-wrap:not(.has-video) {
  aspect-ratio: auto;
  min-height: 200px;
  max-height: 280px;
  flex-shrink: 1;
}
.room-player-wrap #room-yt-player {
  width: 100%; height: 100%;
  position: relative;
}
.room-player-wrap #room-yt-player iframe {
  width: 100% !important; height: 100% !important; position: absolute; top: 0; left: 0;
}

/* Empty player state */
.room-player-empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  text-align: center; padding: 24px;
  pointer-events: none;
}
.room-player-empty-icon {
  color: var(--text-faint);
  opacity: 0.5;
}
.room-player-empty h3 {
  margin: 0; font-size: 15px; font-weight: 600;
  color: var(--text); opacity: 0.7;
}
.room-player-empty p {
  margin: 0; font-size: 12px;
  color: var(--text-muted);
  max-width: 320px;
}
.room-player-wrap.has-video .room-player-empty { display: none; }

/* Enhanced empty state invite section */
.room-player-empty-invite {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px; padding: 8px 14px;
  background: rgba(168,85,247,0.08);
  border: 1px solid rgba(168,85,247,0.2);
  border-radius: 8px;
  font-size: 13px; color: var(--text-muted);
}
.room-player-empty-invite strong {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  color: var(--text); letter-spacing: 1px;
}

/* Room member count badge */
.room-member-count-badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 10px;
  background: var(--surface-2, #14141c);
  border: 1px solid var(--border);
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  margin-left: 6px;
}
.room-member-count-badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--purple);
}

/* Invite banner */
.room-invite-banner {
  background: linear-gradient(135deg, rgba(168,85,247,0.1), rgba(99,102,241,0.1));
  border: 1px solid rgba(168,85,247,0.3);
  border-radius: 10px;
  margin: 0 18px 12px;
  animation: wtModalIn 0.3s ease-out;
}
.room-invite-banner.hidden { display: none; }
.room-invite-banner-content {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
}
.room-invite-banner-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.room-invite-banner-label { font-size: 12px; font-weight: 600; color: var(--text); }
.room-invite-banner-url {
  font-size: 11px; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.room-invite-banner-dismiss {
  background: none; border: none; color: var(--text-muted);
  font-size: 18px; cursor: pointer; padding: 2px 6px; border-radius: 4px;
}
.room-invite-banner-dismiss:hover { color: var(--text); background: var(--hover); }

/* Sync indicator */
.room-sync-indicator {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px; font-size: 11px; color: var(--text-muted);
  align-self: flex-start;
}
.room-sync-indicator.hidden { display: none; }
.room-sync-dot {
  width: 6px; height: 6px; border-radius: 50%;
}
.room-sync-dot.sync-green { background: #22c55e; }
.room-sync-dot.sync-yellow { background: #eab308; }
.room-sync-dot.sync-red { background: #ef4444; }

/* Host controls: load video */
.room-controls {
  display: flex; gap: 8px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  align-items: center;
  min-height: 50px;
  flex-shrink: 0;
}
.room-video-input-row { display: flex; flex: 1; gap: 8px; align-items: center; min-width: 0; }
.room-video-input-icon { color: var(--text-muted); display: inline-flex; flex-shrink: 0; }
.room-controls input {
  flex: 1; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text); font-size: 14px;
  min-width: 0; min-height: 38px;
}
.room-controls input:focus { outline: none; border-color: var(--purple); }

/* Queue (host only) */
.room-queue-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.room-queue-header h4 {
  font-size: 11px; color: var(--text-muted); margin: 0 0 8px;
  text-transform: uppercase; letter-spacing: 0.06em;
  font-weight: 700; display: flex; align-items: center; gap: 6px;
}
.room-queue-list { display: flex; flex-direction: column; gap: 6px; }
.room-queue-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 13px;
}
.room-queue-item-thumb {
  width: 64px; height: 36px; border-radius: 4px;
  object-fit: cover; flex-shrink: 0; background: #000;
}
.room-queue-item-info { flex: 1; min-width: 0; }
.room-queue-item-title {
  color: var(--text); font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.room-queue-item-channel {
  font-size: 11px; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.room-queue-item-remove {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 4px 8px; border-radius: 4px;
}
.room-queue-item-remove:hover { color: #ef4444; background: rgba(239,68,68,0.1); }
.room-queue-empty {
  font-size: 12px; color: var(--text-muted);
  font-style: italic; text-align: center; padding: 12px 0;
}

/* Recommendations — inside scrollable player section */
.room-recommendations {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}
.room-recommendations-header-static {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px 0;
  color: var(--text);
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.room-recommendations-body { padding: 8px 12px 12px; }

.room-rec-section { margin-top: 12px; }
.room-rec-section:first-child { margin-top: 0; }
.room-rec-section h4 {
  font-size: 11px; color: var(--text-muted);
  margin: 0 0 8px;
  text-transform: uppercase; letter-spacing: 0.05em;
  font-weight: 700;
  display: flex; align-items: center; gap: 6px;
}
.room-rec-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.room-rec-card {
  display: flex; gap: 12px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
  text-align: left;
}
.room-rec-card:hover { border-color: var(--accent, #a855f7); transform: translateY(-2px); }
.room-rec-card img {
  width: 160px; height: 90px; object-fit: cover;
  border-radius: 8px; flex-shrink: 0; background: #000;
}
.room-rec-card-title {
  font-size: 15px; color: var(--text); font-weight: 600;
  line-height: 1.35; flex: 1; min-width: 0;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.room-rec-card-channel {
  font-size: 13px; color: var(--text-muted); margin-top: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.room-rec-empty {
  font-size: 12px; color: var(--text-muted); font-style: italic;
  text-align: center; padding: 16px 0;
}

/* Room sidebar (members / chat / AI tabs) */
.room-sidebar {
  display: flex; flex-direction: column;
  background: var(--surface);
  min-height: 0; min-width: 0;
}

.room-tabs {
  display: flex;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.room-tab {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
}
.room-tab:hover { color: var(--text); background: var(--surface-2, #14141c); }
.room-tab.active {
  color: var(--text);
  border-bottom-color: var(--purple);
  background: var(--bg);
}
.room-tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; padding: 0 5px; height: 16px;
  border-radius: 8px;
  background: var(--surface-2, #14141c);
  color: var(--text);
  font-size: 10px; font-weight: 700;
}
.room-tab.active .room-tab-badge { background: var(--purple); color: #fff; }

.room-tab-panel { display: none; flex: 1; min-height: 0; flex-direction: column; overflow: hidden; }
.room-tab-panel.active { display: flex; }

/* Members panel */
.room-member-list {
  flex: 1; overflow-y: auto;
  padding: 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.room-member-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  transition: background 0.15s;
}
.room-member-item:hover { background: var(--surface-2, #14141c); }
.room-member-item.is-me {
  border-color: var(--purple);
  background: rgba(168,85,247,0.06);
}
.room-member-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent, #a855f7), var(--accent-2, #ec4899));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}
.room-member-info { flex: 1; min-width: 0; }
.room-member-name {
  font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.room-member-you {
  font-size: 10px; color: var(--purple);
  font-weight: 700;
  margin-left: 4px;
}
.room-member-host-badge {
  font-size: 9px; font-weight: 700;
  background: linear-gradient(135deg, var(--accent, #a855f7), var(--accent-2, #ec4899));
  color: #fff; padding: 2px 7px; border-radius: 10px;
  text-transform: uppercase; letter-spacing: 0.5px;
}

/* Chat panel */
.room-chat {
  flex: 1; display: flex; flex-direction: column;
  min-height: 0;
}
.room-chat-messages {
  flex: 1; overflow-y: auto;
  padding: 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.room-chat-msg {
  font-size: 13px;
  line-height: 1.45;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  word-break: break-word;
}
.room-chat-msg:hover { border-color: var(--surface-2, #14141c); }
.room-chat-msg-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}
.room-chat-msg-user {
  font-size: 12px; font-weight: 700; color: var(--text);
}
.room-chat-msg-user.is-host { color: var(--accent, #a855f7); }
.room-chat-msg-time {
  font-size: 10px; color: var(--text-faint);
}
.room-chat-msg-text { color: var(--text); }
.room-chat-msg.system {
  background: transparent; border: none;
  color: var(--text-muted); font-style: italic; font-size: 12px;
  text-align: center;
  padding: 4px 8px;
}
.room-chat-input {
  display: flex; gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.room-chat-input input {
  flex: 1;
  padding: 9px 14px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface);
  color: var(--text); font-size: 13px;
  min-width: 0;
}
.room-chat-input input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(168,85,247,0.15);
}
.room-chat-input button { padding: 8px 12px; flex-shrink: 0; }

/* AI panel (inside room sidebar) */
.room-ai-messages {
  flex: 1; overflow-y: auto;
  padding: 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.room-ai-messages .room-chat-msg { font-size: 13px; line-height: 1.5; }
.room-ai-messages .room-chat-msg.system { font-style: italic; }
.room-ai-input {
  display: flex; gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.room-ai-input input {
  flex: 1;
  padding: 9px 14px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface);
  color: var(--text); font-size: 13px;
  min-width: 0;
}
.room-ai-input input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(168,85,247,0.15);
}
.room-ai-input button { padding: 8px 12px; flex-shrink: 0; }

/* Host-only visibility */
.host-only { display: none !important; }
body.wt-host .host-only { display: flex !important; }
body.wt-host .room-queue-section.host-only { display: block !important; }

/* Hide FocusAI panel when in Watch Together room */
body.wt-room-active .ai-panel { display: none !important; }
body.wt-room-active .panel-resize-handle { display: none !important; }
body.wt-room-active .main-panel { width: 100%; flex: 1; }

/* Hide search bar and header buttons when in room */
body.wt-room-active .search-form { display: none !important; }
body.wt-room-active #reload-btn { display: none !important; }
body.wt-room-active #history-btn { display: none !important; }
body.wt-room-active #bell-btn { display: none !important; }
body.wt-room-active #avatar-btn { display: none !important; }

/* Room responsive: tablet */
@media (max-width: 1100px) {
  .room-content { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 900px) {
  .room-content { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) 320px; }
  .room-sidebar { border-left: none; border-top: 1px solid var(--border); }
  .room-player-section { padding: 12px; border-right: none; }
  .room-header { padding: 8px 12px; gap: 8px; }
}
@media (max-width: 768px) {
  .room-header { gap: 6px; padding: 8px 10px; }
  .room-header button { min-height: 36px; padding: 6px 10px; font-size: 12px; }
  .room-controls input { font-size: 13px; min-height: 36px; }
  .room-content { grid-template-rows: minmax(0, 1fr) 280px; }
}


/* === For You section === */
.for-you-section {
  margin-bottom: 28px;
  padding: 20px 0 0;
}
.for-you-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 0 4px;
}
.for-you-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}
.for-you-header h2 [data-icon] {
  color: var(--purple);
  width: 22px;
  height: 22px;
  opacity: 1;
}
.for-you-header .for-you-cta {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color var(--transition-fast);
}
.for-you-header .for-you-cta:hover { color: var(--purple); }
.for-you-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 4px 4px 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.for-you-row::-webkit-scrollbar { height: 6px; }
.for-you-row::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.for-you-card {
  flex: 0 0 220px;
  scroll-snap-align: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition);
}
.for-you-card:hover {
  transform: translateY(-2px);
  border-color: rgba(168, 85, 247, 0.4);
}
.for-you-card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: #000;
  display: block;
}
.for-you-card-body { padding: 10px 12px 12px; }
.for-you-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.for-you-card-channel {
  font-size: 11px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* === Buttons (premium primary) === */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--grad-primary);
  color: white;
  border: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition-fast);
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.25);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
  filter: brightness(1.08);
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.btn-secondary:hover {
  background: var(--card-hover);
  border-color: rgba(255, 255, 255, 0.2);
}
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.btn-ghost:hover { background: var(--card-hover); color: var(--text); }

/* Search results — big cards matching home page style */
.room-search-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  max-height: 400px;
  overflow-y: auto;
  width: 100%;
  padding: 4px 0;
}
.room-search-results:not(:empty) {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.room-search-card {
  display: flex;
  gap: 12px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.room-search-card:hover {
  border-color: var(--accent, #a855f7);
  transform: translateY(-2px);
  background: var(--surface-2, #1a1a24);
}
.room-search-card img {
  width: 160px; height: 90px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: #000;
}
.room-search-card-info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; justify-content: center;
}
.room-search-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.room-search-card-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 768px) {
  .room-search-results { grid-template-columns: 1fr; }
  .room-search-card img { width: 120px; height: 68px; }
  .room-search-card-title { font-size: 14px; }
}

/* === Very small phones (≤480px) === */
@media (max-width: 480px) {
  .app-header { padding: 0 8px; gap: 4px; }
  .chip { padding: 6px 10px; font-size: 11px; }
  .for-you-card { flex: 0 0 140px; }
  .wt-modal-card { padding: 22px 16px; }
  .wt-modal-title { font-size: 22px; }
}

/* === Touch target improvements === */
@media (hover: none) {
  .sidebar-item,
  .chip,
  .chip-btn,
  .icon-btn,
  .btn-ghost,
  .btn-secondary,
  .btn-primary {
    -webkit-tap-highlight-color: rgba(168, 85, 247, 0.15);
  }
}

/* Reduced motion: respect user preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Refresh button on the recommendations header */
#room-rec-refresh {
  background: var(--surface-2, #1a1a24);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--text, #fff);
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}
#room-rec-refresh:hover { background: var(--surface-3, #232330); transform: rotate(-15deg); }
#room-rec-refresh.is-refreshing { animation: rec-refresh-spin 0.6s ease-out; }
@keyframes rec-refresh-spin {
  0% { transform: rotate(0); }
  100% { transform: rotate(-360deg); }
}

.room-recommendations-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 12px 0;
}
.room-recommendations-header h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Combined room video input row */
.room-video-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2, #1a1a24);
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: 10px;
  padding: 4px 4px 4px 12px;
  min-height: 42px;
  transition: border-color 0.2s;
}
.room-video-input-row:focus-within { border-color: var(--accent, #a855f7); }
.room-video-input-icon {
  color: var(--text-muted, #9b9bab);
  display: inline-flex;
  align-items: center;
}
.room-video-input-row input {
  flex: 1 1 auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  padding: 10px 12px;
  font-size: 15px;
  color: var(--text, #fff);
  min-width: 0;
  min-height: 38px;
}
.room-video-input-row input:focus { border-color: var(--accent, #a855f7); }
.room-video-input-row input::placeholder { color: var(--text-faint, #5e5e72); }
.room-search-empty {
  padding: 16px;
  text-align: center;
  color: var(--text-faint, #5e5e72);
  font-size: 13px;
}
.room-rec-loading { padding: 12px; color: var(--text-faint, #5e5e72); font-size: 13px; }
.room-rec-error {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; background: var(--surface, #13131a);
  border-radius: 8px; color: var(--text-muted, #9b9bab); font-size: 13px;
}
.room-rec-error button { padding: 4px 10px; font-size: 12px; }

/* For You stretch card (the 1 "outside your usual" pick) */
.for-you-card-stretch {
  position: relative;
}
.for-you-card-stretch::after {
  content: "Stretch";
  position: absolute;
  top: 6px;
  right: 6px;
  background: linear-gradient(135deg, var(--accent, #a855f7), var(--accent-2, #ec4899));
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}


/* ========== Categories Popover (v3) ========== */
.categories-trigger {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.all-focus-chip {
  background: linear-gradient(135deg, var(--accent, #a855f7), var(--accent-2, #ec4899)) !important;
  color: #fff !important;
  border: none !important;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.all-focus-chip.active { box-shadow: 0 0 0 2px rgba(255,255,255,0.15), 0 4px 16px rgba(168,85,247,0.4); }
.active-category-chip {
  background: var(--surface-2, #1a1a24) !important;
  color: var(--text, #f4f4f6) !important;
  border: 1px solid var(--accent, #a855f7) !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.categories-popover {
  position: fixed; inset: 0; z-index: 600; display: flex; align-items: center; justify-content: center;
}
.categories-popover.hidden { display: none; }
.categories-popover-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(6px);
}
.categories-popover-card {
  position: relative;
  width: min(720px, calc(100vw - 24px));
  max-height: calc(100vh - 48px);
  background: var(--surface, #13131a);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: cp-in 200ms var(--ease-out, ease-out);
}
@keyframes cp-in {
  0% { transform: scale(0.96); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.categories-popover-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.06));
  position: relative;
}
.categories-popover-header h3 { margin: 0 0 4px; font-size: 20px; font-weight: 700; }
.categories-popover-header p { margin: 0; color: var(--text-muted, #9b9bab); font-size: 13px; }
.categories-popover-header .icon-btn {
  position: absolute; top: 12px; right: 12px;
  background: transparent; border: none; color: var(--text-muted, #9b9bab);
  cursor: pointer; padding: 6px; border-radius: 8px;
}
.categories-popover-header .icon-btn:hover { background: var(--surface-2, #1a1a24); color: var(--text, #f4f4f6); }
.categories-popover-grid {
  padding: 20px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  overflow-y: auto;
}
.categories-popover-sep {
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-faint, #5e5e72);
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border, rgba(255,255,255,0.06));
}
.categories-popover-tile {
  background: var(--surface-2, #1a1a24);
  border: 1px solid var(--border, rgba(255,255,255,0.06));
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.15s ease;
  color: var(--text, #f4f4f6);
  font-family: inherit;
}
.categories-popover-tile:hover {
  background: var(--surface, #13131a);
  border-color: var(--accent, #a855f7);
  transform: translateY(-1px);
}
.categories-popover-tile.active {
  background: linear-gradient(135deg, rgba(168,85,247,0.15), rgba(236,72,153,0.1));
  border-color: var(--accent, #a855f7);
  box-shadow: 0 0 0 1px var(--accent, #a855f7);
}
.categories-popover-tile-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--surface, #13131a), var(--surface-2, #1a1a24));
  border: 1px solid var(--border, rgba(255,255,255,0.06));
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent, #a855f7);
}
.categories-popover-tile.active .categories-popover-tile-icon { color: var(--accent-2, #ec4899); }
.categories-popover-tile-name { font-weight: 700; font-size: 14px; }
.categories-popover-tile-desc { font-size: 12px; color: var(--text-muted, #9b9bab); line-height: 1.3; }
@media (max-width: 600px) {
  .categories-popover-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); padding: 16px; gap: 8px; }
  .categories-popover-header { padding: 16px; }
  .categories-popover-tile { padding: 12px; }
}

/* ========== Confirm Dialog (v3) ========== */
.confirm-dialog-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.confirm-dialog-overlay.visible { opacity: 1; }
.confirm-dialog {
  background: var(--surface, #13131a);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 16px;
  padding: 24px;
  width: min(420px, 100%);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  transform: scale(0.96);
  transition: transform 0.18s var(--ease-out, ease-out);
}
.confirm-dialog-overlay.visible .confirm-dialog { transform: scale(1); }
.confirm-dialog-title { margin: 0 0 8px; font-size: 18px; font-weight: 700; color: var(--text, #f4f4f6); }
.confirm-dialog-message { margin: 0 0 20px; color: var(--text-muted, #9b9bab); font-size: 14px; line-height: 1.5; }
.confirm-dialog-actions { display: flex; gap: 8px; justify-content: flex-end; }
.confirm-dialog-actions button { padding: 10px 18px; border-radius: 10px; font-size: 14px; cursor: pointer; border: 1px solid var(--border, rgba(255,255,255,0.08)); }
.confirm-dialog-actions .btn-ghost { background: transparent; color: var(--text-muted, #9b9bab); }
.confirm-dialog-actions .btn-ghost:hover { color: var(--text, #f4f4f6); background: var(--surface-2, #1a1a24); }
.confirm-dialog-actions .btn-primary { background: linear-gradient(135deg, var(--accent, #a855f7), var(--accent-2, #ec4899)); color: #fff; border: none; font-weight: 600; }
.confirm-dialog-actions .btn-primary:hover { filter: brightness(1.1); }
.confirm-dialog-actions .btn-danger { background: linear-gradient(135deg, #ef4444, #b91c1c); }

/* ========== TTS Settings UI ========== */
.settings-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-2, #1a1a24);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  color: var(--text, #f4f4f6);
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 12px;
}
.settings-slider-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-muted, #9b9bab);
}
.settings-slider-label input[type="range"] {
  flex: 1;
  accent-color: var(--accent, #a855f7);
}
.settings-slider-label > span {
  min-width: 50px;
  text-align: right;
  color: var(--text, #f4f4f6);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* ========== Search Suggestions (v3) ========== */
.search-suggestions {
  position: absolute;
  top: 100%; left: 0; right: 0;
  margin-top: 4px;
  background: var(--surface, #13131a);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  max-height: 420px;
  overflow-y: auto;
  z-index: 200;
  padding: 6px;
}
.search-suggestions.hidden { display: none; }
.search-suggestions-header {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-faint, #5e5e72);
  padding: 8px 10px 4px;
}
.search-suggestion-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: transparent;
  border: none;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  color: var(--text, #f4f4f6);
  font-family: inherit;
  font-size: 13px;
  transition: background 0.1s;
}
.search-suggestion-item:hover,
.search-suggestion-item:focus {
  background: var(--surface-2, #1a1a24);
  outline: none;
}
.search-suggestion-thumb {
  width: 60px;
  height: 36px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg, #0a0a0f);
}
.search-suggestion-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.search-suggestion-title {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-suggestion-channel {
  font-size: 11px;
  color: var(--text-muted, #9b9bab);
}
.search-suggestion-recent {
  font-style: normal;
  color: var(--text-muted, #9b9bab);
  font-size: 13px;
}
.search-suggestion-recent:hover { color: var(--text, #f4f4f6); }
.search-suggestions-empty {
  padding: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-faint, #5e5e72);
}

/* The search form needs relative positioning for the absolute suggestions panel */
.search-form { position: relative; }

/* ========== Checkpoint Feedback (v3) ========== */
.cp-feedback-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.cp-feedback-badge.cp-correct {
  background: rgba(52,211,153,0.15);
  color: var(--green, #22c55e);
  border: 1px solid rgba(52,211,153,0.3);
}
.cp-feedback-badge.cp-incorrect {
  background: rgba(251,191,36,0.12);
  color: var(--amber, #f59e0b);
  border: 1px solid rgba(251,191,36,0.3);
}
.checkpoint-card .cp-feedback-badge { margin-bottom: 12px; }

/* ========== Stats Weekly Target (v3) ========== */
.focus-stats-weekly-target {
  margin-bottom: 24px;
  padding: 14px 16px;
  background: var(--card, #13131a);
  border: 1px solid var(--border, rgba(255,255,255,0.06));
  border-radius: 12px;
  font-size: 13px;
  color: var(--text-muted, #9b9bab);
}
.focus-stats-weekly-label strong { color: var(--text, #f4f4f6); font-weight: 700; }
.focus-stats-weekly-bar {
  height: 6px;
  background: var(--border, rgba(255,255,255,0.06));
  border-radius: 4px;
  margin-top: 8px;
  overflow: hidden;
}
.focus-stats-weekly-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent, #a855f7), var(--accent-2, #ec4899));
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* ========== About Version Badge (v3) ========== */
.about-version-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 10px;
  background: linear-gradient(135deg, var(--accent, #a855f7), var(--accent-2, #ec4899));
  color: #fff;
  border-radius: 999px;
  margin-bottom: 12px;
  box-shadow: 0 0 16px rgba(168,85,247,0.3);
}
/* ========== v4: Auth + Social + Recall + Journal ========== */
.signin-chip-btn {
  background: linear-gradient(135deg, var(--accent, #a855f7), var(--accent-2, #ec4899));
  color: #fff !important;
  border: none;
  font-weight: 600;
  font-size: 13px;
  padding: 6px 14px;
}
.auth-card { max-width: 440px; }
.auth-subtitle { color: var(--text-muted, #9b9bab); font-size: 14px; margin: 0 0 20px; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.auth-tab {
  flex: 1; padding: 8px 12px; background: var(--surface-2, #1a1a24); border: 1px solid var(--border, rgba(255,255,255,0.06));
  border-radius: 8px; color: var(--text-muted, #9b9bab); cursor: pointer; font-family: inherit; font-size: 13px;
}
.auth-tab.active { background: linear-gradient(135deg, var(--accent, #a855f7), var(--accent-2, #ec4899)); color: #fff; border-color: transparent; }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-muted, #9b9bab); }
.auth-form input {
  padding: 10px 12px; border-radius: 8px; background: var(--surface-2, #1a1a24);
  border: 1px solid var(--border, rgba(255,255,255,0.06)); color: var(--text, #f4f4f6); font-size: 16px; font-family: inherit;
}
.auth-form input:focus { outline: none; border-color: var(--accent, #a855f7); }
.auth-submit { margin-top: 8px; padding: 12px; }
.auth-hint { font-size: 11px; color: var(--text-faint, #5e5e72); margin: 0; }
.auth-error { color: var(--danger, #ef4444); font-size: 13px; min-height: 18px; margin: 4px 0 0; }
.auth-signed-in h3 { margin: 0 0 8px; font-size: 18px; }
.auth-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.social-menu { background: var(--surface, #13131a); border: 1px solid var(--border, rgba(255,255,255,0.08)); border-radius: 16px; padding: 16px; min-width: 240px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.social-menu h3 { margin: 0 0 12px; font-size: 14px; color: var(--text-muted, #9b9bab); text-transform: uppercase; letter-spacing: 0.5px; }
.social-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 8px; background: transparent; border: none; color: var(--text, #f4f4f6); cursor: pointer; font-family: inherit; font-size: 14px; text-align: left; margin-bottom: 4px; }
.social-menu-item:hover { background: var(--surface-2, #1a1a24); }
.profile-card { max-width: 520px; }
.profile-header { display: flex; gap: 20px; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--border, rgba(255,255,255,0.06)); margin-bottom: 20px; }
.profile-avatar-lg { width: 80px; height: 80px; border-radius: 50%; background: linear-gradient(135deg, var(--accent, #a855f7), var(--accent-2, #ec4899)); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 36px; font-weight: 700; flex-shrink: 0; }
.profile-meta h3 { margin: 0 0 4px; font-size: 22px; }
.profile-displayname { color: var(--text-muted, #9b9bab); font-size: 14px; }
.profile-joined { color: var(--text-faint, #5e5e72); font-size: 12px; margin-top: 4px; }
.profile-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
.profile-stat { background: var(--surface-2, #1a1a24); border: 1px solid var(--border, rgba(255,255,255,0.06)); border-radius: 12px; padding: 16px; text-align: center; }
.profile-stat-value { font-size: 24px; font-weight: 700; color: var(--text, #f4f4f6); margin-bottom: 4px; }
.profile-stat-label { font-size: 11px; color: var(--text-muted, #9b9bab); text-transform: uppercase; letter-spacing: 0.5px; }
.profile-add-friend { text-align: center; }
.friends-card, .leaderboard-card { max-width: 560px; }
.friends-add-row { display: flex; gap: 8px; margin-bottom: 16px; }
.friends-add-row input { flex: 1; padding: 10px 12px; border-radius: 8px; background: var(--surface-2, #1a1a24); border: 1px solid var(--border, rgba(255,255,255,0.06)); color: var(--text, #f4f4f6); font-size: 16px; font-family: inherit; }
.friends-add-row input:focus { outline: none; border-color: var(--accent, #a855f7); }
.friend-row, .leaderboard-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2, #1a1a24); margin-bottom: 8px; }
.friend-avatar, .leaderboard-avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--accent, #a855f7), var(--accent-2, #ec4899)); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 16px; flex-shrink: 0; }
.friend-info, .leaderboard-info { flex: 1; min-width: 0; }
.friend-username, .leaderboard-username { font-weight: 600; font-size: 14px; }
.friend-displayname, .leaderboard-stats { font-size: 12px; color: var(--text-muted, #9b9bab); }
.leaderboard-rank { font-weight: 700; font-size: 14px; color: var(--text-faint, #5e5e72); min-width: 36px; text-align: center; }
.leaderboard-podium-1 .leaderboard-rank { color: gold; font-size: 16px; }
.leaderboard-podium-2 .leaderboard-rank { color: #c0c0c0; font-size: 16px; }
.leaderboard-podium-3 .leaderboard-rank { color: #cd7f32; font-size: 16px; }
.leaderboard-scope { display: flex; gap: 8px; margin-bottom: 16px; }
.leaderboard-scope .chip { cursor: pointer; }
.recall-due-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent, #a855f7), var(--accent-2, #ec4899));
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: auto;
}
.recall-header { padding: 16px 0 24px; }
.recall-header h1 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-size: 28px; }
.recall-subtitle { color: var(--text-muted, #9b9bab); font-size: 14px; margin: 0; }
.recall-summary-inner { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }
.recall-summary-stat { background: var(--surface-2, #1a1a24); border: 1px solid var(--border, rgba(255,255,255,0.06)); border-radius: 12px; padding: 16px; text-align: center; }
.recall-summary-value { font-size: 28px; font-weight: 700; color: var(--accent, #a855f7); margin-bottom: 4px; }
.recall-summary-label { font-size: 11px; color: var(--text-muted, #9b9bab); text-transform: uppercase; letter-spacing: 0.5px; }
.recall-card-wrap { perspective: 1000px; margin: 0 auto 24px; max-width: 540px; }
.recall-card-inner { background: transparent; }
.recall-card-face { background: var(--surface, #13131a); border: 1px solid var(--border, rgba(255,255,255,0.08)); border-radius: 16px; padding: 32px; min-height: 240px; display: flex; flex-direction: column; }
.recall-card-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-faint, #5e5e72); margin-bottom: 16px; }
.recall-card-text { font-size: 18px; line-height: 1.5; flex: 1; margin-bottom: 20px; }
.recall-card-back .recall-card-text { color: var(--accent, #a855f7); font-weight: 500; }
.recall-quality-row { display: flex; gap: 8px; margin-top: 12px; }
.recall-q-btn { flex: 1; padding: 10px; border-radius: 8px; border: 1px solid var(--border, rgba(255,255,255,0.08)); cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 600; background: var(--surface-2, #1a1a24); color: var(--text, #f4f4f6); }
.recall-q-btn:hover { transform: translateY(-1px); }
.recall-q-hard { background: rgba(239,68,68,0.15); color: #ef4444; border-color: rgba(239,68,68,0.3); }
.recall-q-good { background: rgba(168,85,247,0.15); color: var(--accent, #a855f7); border-color: rgba(168,85,247,0.3); }
.recall-q-easy { background: rgba(52,211,153,0.15); color: #22c55e; border-color: rgba(52,211,153,0.3); }
.recall-empty-icon { margin-bottom: 12px; opacity: 0.5; }
.recall-stats-empty { text-align: center; padding: 20px; color: var(--text-muted, #9b9bab); }
.journal-header { padding: 16px 0 24px; }
.journal-header h1 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-size: 28px; }
.journal-subtitle { color: var(--text-muted, #9b9bab); font-size: 14px; margin: 0; }
.journal-list { display: flex; flex-direction: column; gap: 16px; }
.journal-week-card {
  background: var(--surface, #13131a); border: 1px solid var(--border, rgba(255,255,255,0.06));
  border-radius: 14px; padding: 20px;
}
.journal-week-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.journal-week-date { font-weight: 700; font-size: 16px; }
.journal-week-current { font-size: 11px; font-weight: 700; padding: 3px 10px; background: linear-gradient(135deg, var(--accent, #a855f7), var(--accent-2, #ec4899)); color: #fff; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.5px; }
.journal-week-stats { display: flex; gap: 16px; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border, rgba(255,255,255,0.06)); }
.journal-stat { display: flex; flex-direction: column; }
.journal-stat-value { font-size: 22px; font-weight: 700; color: var(--text, #f4f4f6); }
.journal-stat-label { font-size: 11px; color: var(--text-muted, #9b9bab); text-transform: uppercase; letter-spacing: 0.4px; }
.journal-label { color: var(--text-muted, #9b9bab); font-size: 13px; }
.journal-week-topics, .journal-week-top-video { font-size: 13px; color: var(--text, #f4f4f6); margin-top: 6px; }
.loading-state, .empty-state { padding: 24px; text-align: center; color: var(--text-muted, #9b9bab); font-size: 14px; }
.empty-state h2 { margin: 8px 0 4px; font-size: 18px; color: var(--text, #f4f4f6); }
.empty-state p { margin: 4px 0; }
/* ========== Landing page trim (v4) ========== */
/* Hide overly long sections that bloat the page. Keep hero + features + stats + FAQ + footer */
.marquee-section,
.problem-section,
.sticky-features-wrap,
.features-sticky-wrap {
  display: none !important;
}
/* Trim mockup mockup visuals in the features section */
.features-visual,
.features-mockup {
  display: none !important;
}
/* ========== Onboarding v2 (v4 polish) ========== */
.onboarding-card-v2 {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  text-align: left !important;
  align-items: flex-start !important;
  padding: 16px !important;
  background: var(--surface-2, #1a1a24);
  border: 1px solid var(--border, rgba(255,255,255,0.06));
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  transition: all 0.15s ease;
}
.onboarding-card-v2:hover { background: var(--surface, #13131a); border-color: var(--accent, #a855f7); transform: translateY(-1px); }
.onboarding-card-v2.selected {
  background: linear-gradient(135deg, rgba(168,85,247,0.18), rgba(236,72,153,0.10));
  border-color: var(--accent, #a855f7);
  box-shadow: 0 0 0 1px var(--accent, #a855f7), 0 8px 24px rgba(168,85,247,0.18);
}
.onboarding-card-v2.selected::after {
  content: "✓";
  position: absolute;
  top: 12px;
  right: 14px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent, #a855f7), var(--accent-2, #ec4899));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.onboarding-card-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--surface, #13131a), var(--surface-2, #1a1a24));
  border: 1px solid var(--border, rgba(255,255,255,0.06));
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent, #a855f7);
}
.onboarding-card-v2.selected .onboarding-card-icon { color: var(--accent-2, #ec4899); }
/* ========== Reading List v2 ========== */
.reading-list-header h1 { display: flex; align-items: center; gap: 12px; margin: 16px 0 4px; font-size: 28px; }
.reading-list-count { font-size: 12px; font-weight: 700; padding: 4px 10px; background: var(--surface-2, #1a1a24); border: 1px solid var(--border, rgba(255,255,255,0.06)); border-radius: 999px; color: var(--accent, #a855f7); }
.reading-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.reading-list-card {
  background: var(--surface, #13131a);
  border: 1px solid var(--border, rgba(255,255,255,0.06));
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s, border-color 0.15s;
}
.reading-list-card:hover { border-color: var(--accent, #a855f7); transform: translateY(-1px); }
.reading-list-card-thumb { position: relative; aspect-ratio: 16/9; overflow: hidden; background: #000; }
.reading-list-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.reading-list-card-cat { position: absolute; bottom: 8px; left: 8px; padding: 3px 8px; border-radius: 999px; background: rgba(0,0,0,0.6); backdrop-filter: blur(6px); font-size: 10px; font-weight: 700; color: #fff; }
.reading-list-card-body { padding: 12px; flex: 1; }
.reading-list-card-title { font-weight: 600; font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 4px; }
.reading-list-card-channel { font-size: 12px; color: var(--text-muted, #9b9bab); }
.reading-list-card-meta { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-top: 1px solid var(--border, rgba(255,255,255,0.04)); background: var(--surface-2, #1a1a24); }
.reading-list-card-date { font-size: 11px; color: var(--text-faint, #5e5e72); }
.reading-list-card-remove { width: 24px; height: 24px; border-radius: 6px; border: none; background: transparent; color: var(--text-muted, #9b9bab); cursor: pointer; font-size: 16px; line-height: 1; }
.reading-list-card-remove:hover { background: rgba(239,68,68,0.15); color: #ef4444; }

/* =========================================================
   iOS ZOOM FIX — all <input>/<textarea>/<select> must be ≥16px on
   mobile/tablet to prevent iOS Safari from auto-zooming the viewport on
   focus. This is a final-pass guarantee that overrides the smaller
   per-element font-size values used elsewhere in this file.
   ========================================================= */
@media (max-width: 900px) {
  input[type="text"],
  input[type="search"],
  input[type="email"],
  input[type="password"],
  input[type="url"],
  input[type="tel"],
  input[type="number"],
  textarea,
  select {
    font-size: 16px !important;
  }
}
